diff --git a/CHANGELOG.md b/CHANGELOG.md index d34660847..0d582ba9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [0.4.4] - +## [0.4.4] - 2019-11-21 ### Fixed * [#423](https://github.com/plotly/dash-bio/pull/423) Fixed internal method call in Clustergram component. diff --git a/dash_bio/async~alignment.js b/dash_bio/async~alignment.js index f1a476d2e..615dc722a 100644 --- a/dash_bio/async~alignment.js +++ b/dash_bio/async~alignment.js @@ -1,4 +1,4 @@ -(window.webpackJsonpdash_bio=window.webpackJsonpdash_bio||[]).push([[0],Array(34).concat([function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return d}));var n=r(1),a=r.n(n),i=r(163),o=r(10),s=r(67);function l(t){return(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})(t)}function c(){return(c=Object.assign||function(t){for(var e=1;e @@ -6,20 +6,20 @@ * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(){var i,o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",p=1,h=2,d=4,g=1,v=2,m=1,y=2,x=4,b=8,_=16,w=32,k=64,T=128,A=256,M=512,E=30,S="...",C=800,L=16,O=1,P=2,I=1/0,D=9007199254740991,z=17976931348623157e292,R=NaN,F=4294967295,B=F-1,N=F>>>1,j=[["ary",T],["bind",m],["bindKey",y],["curry",b],["curryRight",_],["flip",M],["partial",w],["partialRight",k],["rearg",A]],V="[object Arguments]",U="[object Array]",H="[object AsyncFunction]",q="[object Boolean]",G="[object Date]",W="[object DOMException]",Y="[object Error]",X="[object Function]",Z="[object GeneratorFunction]",J="[object Map]",K="[object Number]",$="[object Null]",Q="[object Object]",tt="[object Proxy]",et="[object RegExp]",rt="[object Set]",nt="[object String]",at="[object Symbol]",it="[object Undefined]",ot="[object WeakMap]",st="[object WeakSet]",lt="[object ArrayBuffer]",ct="[object DataView]",ut="[object Float32Array]",ft="[object Float64Array]",pt="[object Int8Array]",ht="[object Int16Array]",dt="[object Int32Array]",gt="[object Uint8Array]",vt="[object Uint8ClampedArray]",mt="[object Uint16Array]",yt="[object Uint32Array]",xt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,kt=/[&<>"']/g,Tt=RegExp(wt.source),At=RegExp(kt.source),Mt=/<%-([\s\S]+?)%>/g,Et=/<%([\s\S]+?)%>/g,St=/<%=([\s\S]+?)%>/g,Ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lt=/^\w*$/,Ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pt=/[\\^$.*+?()[\]{}|]/g,It=RegExp(Pt.source),Dt=/^\s+|\s+$/g,zt=/^\s+/,Rt=/\s+$/,Ft=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,Nt=/,? & /,jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vt=/\\(\\)?/g,Ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ht=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Gt=/^0b[01]+$/i,Wt=/^\[object .+?Constructor\]$/,Yt=/^0o[0-7]+$/i,Xt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jt=/($^)/,Kt=/['\n\r\u2028\u2029\\]/g,$t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Qt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+Qt+"]",re="["+$t+"]",ne="\\d+",ae="[\\u2700-\\u27bf]",ie="[a-z\\xdf-\\xf6\\xf8-\\xff]",oe="[^\\ud800-\\udfff"+Qt+ne+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",le="[^\\ud800-\\udfff]",ce="(?:\\ud83c[\\udde6-\\uddff]){2}",ue="[\\ud800-\\udbff][\\udc00-\\udfff]",fe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",pe="(?:"+ie+"|"+oe+")",he="(?:"+fe+"|"+oe+")",de="(?:"+re+"|"+se+")"+"?",ge="[\\ufe0e\\ufe0f]?"+de+("(?:\\u200d(?:"+[le,ce,ue].join("|")+")[\\ufe0e\\ufe0f]?"+de+")*"),ve="(?:"+[ae,ce,ue].join("|")+")"+ge,me="(?:"+[le+re+"?",re,ce,ue,te].join("|")+")",ye=RegExp("['’]","g"),xe=RegExp(re,"g"),be=RegExp(se+"(?="+se+")|"+me+ge,"g"),_e=RegExp([fe+"?"+ie+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,fe,"$"].join("|")+")",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,fe+pe,"$"].join("|")+")",fe+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ne,ve].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+$t+"\\ufe0e\\ufe0f]"),ke=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Te=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ae=-1,Me={};Me[ut]=Me[ft]=Me[pt]=Me[ht]=Me[dt]=Me[gt]=Me[vt]=Me[mt]=Me[yt]=!0,Me[V]=Me[U]=Me[lt]=Me[q]=Me[ct]=Me[G]=Me[Y]=Me[X]=Me[J]=Me[K]=Me[Q]=Me[et]=Me[rt]=Me[nt]=Me[ot]=!1;var Ee={};Ee[V]=Ee[U]=Ee[lt]=Ee[ct]=Ee[q]=Ee[G]=Ee[ut]=Ee[ft]=Ee[pt]=Ee[ht]=Ee[dt]=Ee[J]=Ee[K]=Ee[Q]=Ee[et]=Ee[rt]=Ee[nt]=Ee[at]=Ee[gt]=Ee[vt]=Ee[mt]=Ee[yt]=!0,Ee[Y]=Ee[X]=Ee[ot]=!1;var Se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ce=parseFloat,Le=parseInt,Oe="object"==typeof t&&t&&t.Object===Object&&t,Pe="object"==typeof self&&self&&self.Object===Object&&self,Ie=Oe||Pe||Function("return this")(),De=e&&!e.nodeType&&e,ze=De&&"object"==typeof n&&n&&!n.nodeType&&n,Re=ze&&ze.exports===De,Fe=Re&&Oe.process,Be=function(){try{var t=ze&&ze.require&&ze.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch(t){}}(),Ne=Be&&Be.isArrayBuffer,je=Be&&Be.isDate,Ve=Be&&Be.isMap,Ue=Be&&Be.isRegExp,He=Be&&Be.isSet,qe=Be&&Be.isTypedArray;function Ge(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function We(t,e,r,n){for(var a=-1,i=null==t?0:t.length;++a-1}function $e(t,e,r){for(var n=-1,a=null==t?0:t.length;++n-1;);return r}function br(t,e){for(var r=t.length;r--&&sr(e,t[r],0)>-1;);return r}var _r=pr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),wr=pr({"&":"&","<":"<",">":">",'"':""","'":"'"});function kr(t){return"\\"+Se[t]}function Tr(t){return we.test(t)}function Ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Mr(t,e){return function(r){return t(e(r))}}function Er(t,e){for(var r=-1,n=t.length,a=0,i=[];++r",""":'"',"'":"'"});var Ir=function t(e){var r,n=(e=null==e?Ie:Ir.defaults(Ie.Object(),e,Ir.pick(Ie,Te))).Array,a=e.Date,$t=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,re=e.RegExp,ne=e.String,ae=e.TypeError,ie=n.prototype,oe=Qt.prototype,se=ee.prototype,le=e["__core-js_shared__"],ce=oe.toString,ue=se.hasOwnProperty,fe=0,pe=(r=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",he=se.toString,de=ce.call(ee),ge=Ie._,ve=re("^"+ce.call(ue).replace(Pt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),me=Re?e.Buffer:i,be=e.Symbol,we=e.Uint8Array,Se=me?me.allocUnsafe:i,Oe=Mr(ee.getPrototypeOf,ee),Pe=ee.create,De=se.propertyIsEnumerable,ze=ie.splice,Fe=be?be.isConcatSpreadable:i,Be=be?be.iterator:i,ar=be?be.toStringTag:i,pr=function(){try{var t=Bi(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Dr=e.clearTimeout!==Ie.clearTimeout&&e.clearTimeout,zr=a&&a.now!==Ie.Date.now&&a.now,Rr=e.setTimeout!==Ie.setTimeout&&e.setTimeout,Fr=te.ceil,Br=te.floor,Nr=ee.getOwnPropertySymbols,jr=me?me.isBuffer:i,Vr=e.isFinite,Ur=ie.join,Hr=Mr(ee.keys,ee),qr=te.max,Gr=te.min,Wr=a.now,Yr=e.parseInt,Xr=te.random,Zr=ie.reverse,Jr=Bi(e,"DataView"),Kr=Bi(e,"Map"),$r=Bi(e,"Promise"),Qr=Bi(e,"Set"),tn=Bi(e,"WeakMap"),en=Bi(ee,"create"),rn=tn&&new tn,nn={},an=uo(Jr),on=uo(Kr),sn=uo($r),ln=uo(Qr),cn=uo(tn),un=be?be.prototype:i,fn=un?un.valueOf:i,pn=un?un.toString:i;function hn(t){if(Ss(t)&&!ms(t)&&!(t instanceof mn)){if(t instanceof vn)return t;if(ue.call(t,"__wrapped__"))return fo(t)}return new vn(t)}var dn=function(){function t(){}return function(e){if(!Es(e))return{};if(Pe)return Pe(e);t.prototype=e;var r=new t;return t.prototype=i,r}}();function gn(){}function vn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function mn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=F,this.__views__=[]}function yn(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function zn(t,e,r,n,a,o){var s,l=e&p,c=e&h,u=e&d;if(r&&(s=a?r(t,n,a,o):r(t)),s!==i)return s;if(!Es(t))return t;var f=ms(t);if(f){if(s=function(t){var e=t.length,r=new t.constructor(e);e&&"string"==typeof t[0]&&ue.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!l)return ri(t,s)}else{var g=Vi(t),v=g==X||g==Z;if(_s(t))return Ja(t,l);if(g==Q||g==V||v&&!a){if(s=c||v?{}:Hi(t),!l)return c?function(t,e){return ni(t,ji(t),e)}(t,function(t,e){return t&&ni(e,il(e),t)}(s,t)):function(t,e){return ni(t,Ni(t),e)}(t,On(s,t))}else{if(!Ee[g])return a?t:{};s=function(t,e,r){var n=t.constructor;switch(e){case lt:return Ka(t);case q:case G:return new n(+t);case ct:return function(t,e){var r=e?Ka(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case ut:case ft:case pt:case ht:case dt:case gt:case vt:case mt:case yt:return $a(t,r);case J:return new n;case K:case nt:return new n(t);case et:return function(t){var e=new t.constructor(t.source,Ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case rt:return new n;case at:return a=t,fn?ee(fn.call(a)):{}}var a}(t,g,l)}}o||(o=new wn);var m=o.get(t);if(m)return m;o.set(t,s),Is(t)?t.forEach((function(n){s.add(zn(n,e,r,n,t,o))})):Cs(t)&&t.forEach((function(n,a){s.set(a,zn(n,e,r,a,t,o))}));var y=f?i:(u?c?Oi:Li:c?il:al)(t);return Ye(y||t,(function(n,a){y&&(n=t[a=n]),Sn(s,a,zn(n,e,r,a,t,o))})),s}function Rn(t,e,r){var n=r.length;if(null==t)return!n;for(t=ee(t);n--;){var a=r[n],o=e[a],s=t[a];if(s===i&&!(a in t)||!o(s))return!1}return!0}function Fn(t,e,r){if("function"!=typeof t)throw new ae(l);return no((function(){t.apply(i,r)}),e)}function Bn(t,e,r,n){var a=-1,i=Ke,s=!0,l=t.length,c=[],u=e.length;if(!l)return c;r&&(e=Qe(e,vr(r))),n?(i=$e,s=!1):e.length>=o&&(i=yr,s=!1,e=new _n(e));t:for(;++a-1},xn.prototype.set=function(t,e){var r=this.__data__,n=Cn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bn.prototype.clear=function(){this.size=0,this.__data__={hash:new yn,map:new(Kr||xn),string:new yn}},bn.prototype.delete=function(t){var e=Ri(this,t).delete(t);return this.size-=e?1:0,e},bn.prototype.get=function(t){return Ri(this,t).get(t)},bn.prototype.has=function(t){return Ri(this,t).has(t)},bn.prototype.set=function(t,e){var r=Ri(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},_n.prototype.add=_n.prototype.push=function(t){return this.__data__.set(t,c),this},_n.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.clear=function(){this.__data__=new xn,this.size=0},wn.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},wn.prototype.get=function(t){return this.__data__.get(t)},wn.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.set=function(t,e){var r=this.__data__;if(r instanceof xn){var n=r.__data__;if(!Kr||n.length0&&r(s)?e>1?qn(s,e-1,r,n,a):tr(a,s):n||(a[a.length]=s)}return a}var Gn=si(),Wn=si(!0);function Yn(t,e){return t&&Gn(t,e,al)}function Xn(t,e){return t&&Wn(t,e,al)}function Zn(t,e){return Je(e,(function(e){return Ts(t[e])}))}function Jn(t,e){for(var r=0,n=(e=Wa(e,t)).length;null!=t&&re}function ta(t,e){return null!=t&&ue.call(t,e)}function ea(t,e){return null!=t&&e in ee(t)}function ra(t,e,r){for(var a=r?$e:Ke,o=t[0].length,s=t.length,l=s,c=n(s),u=1/0,f=[];l--;){var p=t[l];l&&e&&(p=Qe(p,vr(e))),u=Gr(p.length,u),c[l]=!r&&(e||o>=120&&p.length>=120)?new _n(l&&p):i}p=t[0];var h=-1,d=c[0];t:for(;++h=s)return l;var c=r[n];return l*("desc"==c?-1:1)}}return t.index-e.index}(t,e,r)}))}function ya(t,e,r){for(var n=-1,a=e.length,i={};++n-1;)s!==t&&ze.call(s,l,1),ze.call(t,l,1);return t}function ba(t,e){for(var r=t?e.length:0,n=r-1;r--;){var a=e[r];if(r==n||a!==i){var i=a;Gi(a)?ze.call(t,a,1):Ba(t,a)}}return t}function _a(t,e){return t+Br(Xr()*(e-t+1))}function wa(t,e){var r="";if(!t||e<1||e>D)return r;do{e%2&&(r+=t),(e=Br(e/2))&&(t+=t)}while(e);return r}function ka(t,e){return ao(Qi(t,e,Ll),t+"")}function Ta(t){return Tn(hl(t))}function Aa(t,e){var r=hl(t);return so(r,Dn(e,0,r.length))}function Ma(t,e,r,n){if(!Es(t))return t;for(var a=-1,o=(e=Wa(e,t)).length,s=o-1,l=t;null!=l&&++ai?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=n(i);++a>>1,o=t[i];null!==o&&!zs(o)&&(r?o<=e:o=o){var u=e?null:wi(t);if(u)return Sr(u);s=!1,a=yr,c=new _n}else c=e?[]:l;t:for(;++n=n?t:La(t,e,r)}var Za=Dr||function(t){return Ie.clearTimeout(t)};function Ja(t,e){if(e)return t.slice();var r=t.length,n=Se?Se(r):new t.constructor(r);return t.copy(n),n}function Ka(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}function $a(t,e){var r=e?Ka(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Qa(t,e){if(t!==e){var r=t!==i,n=null===t,a=t==t,o=zs(t),s=e!==i,l=null===e,c=e==e,u=zs(e);if(!l&&!u&&!o&&t>e||o&&s&&c&&!l&&!u||n&&s&&c||!r&&c||!a)return 1;if(!n&&!o&&!u&&t1?r[a-1]:i,s=a>2?r[2]:i;for(o=t.length>3&&"function"==typeof o?(a--,o):i,s&&Wi(r[0],r[1],s)&&(o=a<3?i:o,a=1),e=ee(e);++n-1?a[o?e[s]:s]:i}}function pi(t){return Ci((function(e){var r=e.length,n=r,a=vn.prototype.thru;for(t&&e.reverse();n--;){var o=e[n];if("function"!=typeof o)throw new ae(l);if(a&&!s&&"wrapper"==Ii(o))var s=new vn([],!0)}for(n=s?n:r;++n1&&b.reverse(),p&&ul))return!1;var u=o.get(t);if(u&&o.get(e))return u==e;var f=-1,p=!0,h=r&v?new _n:i;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Ft,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Ye(j,(function(r){var n="_."+r[0];e&r[1]&&!Ke(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(Bt);return e?e[1].split(Nt):[]}(n),r)))}function oo(t){var e=0,r=0;return function(){var n=Wr(),a=L-(n-r);if(r=n,a>0){if(++e>=C)return arguments[0]}else e=0;return t.apply(i,arguments)}}function so(t,e){var r=-1,n=t.length,a=n-1;for(e=e===i?n:e;++r1?t[e-1]:i;return r="function"==typeof r?(t.pop(),r):i,Po(t,r)}));function No(t){var e=hn(t);return e.__chain__=!0,e}function jo(t,e){return e(t)}var Vo=Ci((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,a=function(e){return In(e,t)};return!(e>1||this.__actions__.length)&&n instanceof mn&&Gi(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:jo,args:[a],thisArg:i}),new vn(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(a)}));var Uo=ai((function(t,e,r){ue.call(t,r)?++t[r]:Pn(t,r,1)}));var Ho=fi(vo),qo=fi(mo);function Go(t,e){return(ms(t)?Ye:Nn)(t,zi(e,3))}function Wo(t,e){return(ms(t)?Xe:jn)(t,zi(e,3))}var Yo=ai((function(t,e,r){ue.call(t,r)?t[r].push(e):Pn(t,r,[e])}));var Xo=ka((function(t,e,r){var a=-1,i="function"==typeof e,o=xs(t)?n(t.length):[];return Nn(t,(function(t){o[++a]=i?Ge(e,t,r):na(t,e,r)})),o})),Zo=ai((function(t,e,r){Pn(t,r,e)}));function Jo(t,e){return(ms(t)?Qe:pa)(t,zi(e,3))}var Ko=ai((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]}));var $o=ka((function(t,e){if(null==t)return[];var r=e.length;return r>1&&Wi(t,e[0],e[1])?e=[]:r>2&&Wi(e[0],e[1],e[2])&&(e=[e[0]]),ma(t,qn(e,1),[])})),Qo=zr||function(){return Ie.Date.now()};function ts(t,e,r){return e=r?i:e,e=t&&null==e?t.length:e,Ti(t,T,i,i,i,i,e)}function es(t,e){var r;if("function"!=typeof e)throw new ae(l);return t=Vs(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=i),r}}var rs=ka((function(t,e,r){var n=m;if(r.length){var a=Er(r,Di(rs));n|=w}return Ti(t,n,e,r,a)})),ns=ka((function(t,e,r){var n=m|y;if(r.length){var a=Er(r,Di(ns));n|=w}return Ti(e,n,t,r,a)}));function as(t,e,r){var n,a,o,s,c,u,f=0,p=!1,h=!1,d=!0;if("function"!=typeof t)throw new ae(l);function g(e){var r=n,o=a;return n=a=i,f=e,s=t.apply(o,r)}function v(t){var r=t-u;return u===i||r>=e||r<0||h&&t-f>=o}function m(){var t=Qo();if(v(t))return y(t);c=no(m,function(t){var r=e-(t-u);return h?Gr(r,o-(t-f)):r}(t))}function y(t){return c=i,d&&n?g(t):(n=a=i,s)}function x(){var t=Qo(),r=v(t);if(n=arguments,a=this,u=t,r){if(c===i)return function(t){return f=t,c=no(m,e),p?g(t):s}(u);if(h)return Za(c),c=no(m,e),g(u)}return c===i&&(c=no(m,e)),s}return e=Hs(e)||0,Es(r)&&(p=!!r.leading,o=(h="maxWait"in r)?qr(Hs(r.maxWait)||0,e):o,d="trailing"in r?!!r.trailing:d),x.cancel=function(){c!==i&&Za(c),f=0,n=u=a=c=i},x.flush=function(){return c===i?s:y(Qo())},x}var is=ka((function(t,e){return Fn(t,1,e)})),os=ka((function(t,e,r){return Fn(t,Hs(e)||0,r)}));function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ae(l);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(ss.Cache||bn),r}function ls(t){if("function"!=typeof t)throw new ae(l);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=bn;var cs=Ya((function(t,e){var r=(e=1==e.length&&ms(e[0])?Qe(e[0],vr(zi())):Qe(qn(e,1),vr(zi()))).length;return ka((function(n){for(var a=-1,i=Gr(n.length,r);++a=e})),vs=aa(function(){return arguments}())?aa:function(t){return Ss(t)&&ue.call(t,"callee")&&!De.call(t,"callee")},ms=n.isArray,ys=Ne?vr(Ne):function(t){return Ss(t)&&$n(t)==lt};function xs(t){return null!=t&&Ms(t.length)&&!Ts(t)}function bs(t){return Ss(t)&&xs(t)}var _s=jr||Hl,ws=je?vr(je):function(t){return Ss(t)&&$n(t)==G};function ks(t){if(!Ss(t))return!1;var e=$n(t);return e==Y||e==W||"string"==typeof t.message&&"string"==typeof t.name&&!Os(t)}function Ts(t){if(!Es(t))return!1;var e=$n(t);return e==X||e==Z||e==H||e==tt}function As(t){return"number"==typeof t&&t==Vs(t)}function Ms(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=D}function Es(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ss(t){return null!=t&&"object"==typeof t}var Cs=Ve?vr(Ve):function(t){return Ss(t)&&Vi(t)==J};function Ls(t){return"number"==typeof t||Ss(t)&&$n(t)==K}function Os(t){if(!Ss(t)||$n(t)!=Q)return!1;var e=Oe(t);if(null===e)return!0;var r=ue.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ce.call(r)==de}var Ps=Ue?vr(Ue):function(t){return Ss(t)&&$n(t)==et};var Is=He?vr(He):function(t){return Ss(t)&&Vi(t)==rt};function Ds(t){return"string"==typeof t||!ms(t)&&Ss(t)&&$n(t)==nt}function zs(t){return"symbol"==typeof t||Ss(t)&&$n(t)==at}var Rs=qe?vr(qe):function(t){return Ss(t)&&Ms(t.length)&&!!Me[$n(t)]};var Fs=xi(fa),Bs=xi((function(t,e){return t<=e}));function Ns(t){if(!t)return[];if(xs(t))return Ds(t)?Or(t):ri(t);if(Be&&t[Be])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Be]());var e=Vi(t);return(e==J?Ar:e==rt?Sr:hl)(t)}function js(t){return t?(t=Hs(t))===I||t===-I?(t<0?-1:1)*z:t==t?t:0:0===t?t:0}function Vs(t){var e=js(t),r=e%1;return e==e?r?e-r:e:0}function Us(t){return t?Dn(Vs(t),0,F):0}function Hs(t){if("number"==typeof t)return t;if(zs(t))return R;if(Es(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Es(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Dt,"");var r=Gt.test(t);return r||Yt.test(t)?Le(t.slice(2),r?2:8):qt.test(t)?R:+t}function qs(t){return ni(t,il(t))}function Gs(t){return null==t?"":Ra(t)}var Ws=ii((function(t,e){if(Ji(e)||xs(e))ni(e,al(e),t);else for(var r in e)ue.call(e,r)&&Sn(t,r,e[r])})),Ys=ii((function(t,e){ni(e,il(e),t)})),Xs=ii((function(t,e,r,n){ni(e,il(e),t,n)})),Zs=ii((function(t,e,r,n){ni(e,al(e),t,n)})),Js=Ci(In);var Ks=ka((function(t,e){t=ee(t);var r=-1,n=e.length,a=n>2?e[2]:i;for(a&&Wi(e[0],e[1],a)&&(n=1);++r1),e})),ni(t,Oi(t),r),n&&(r=zn(r,p|h|d,Ei));for(var a=e.length;a--;)Ba(r,e[a]);return r}));var cl=Ci((function(t,e){return null==t?{}:function(t,e){return ya(t,e,(function(e,r){return tl(t,r)}))}(t,e)}));function ul(t,e){if(null==t)return{};var r=Qe(Oi(t),(function(t){return[t]}));return e=zi(e),ya(t,r,(function(t,r){return e(t,r[0])}))}var fl=ki(al),pl=ki(il);function hl(t){return null==t?[]:mr(t,al(t))}var dl=ci((function(t,e,r){return e=e.toLowerCase(),t+(r?gl(e):e)}));function gl(t){return kl(Gs(t).toLowerCase())}function vl(t){return(t=Gs(t))&&t.replace(Zt,_r).replace(xe,"")}var ml=ci((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),yl=ci((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),xl=li("toLowerCase");var bl=ci((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}));var _l=ci((function(t,e,r){return t+(r?" ":"")+kl(e)}));var wl=ci((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),kl=li("toUpperCase");function Tl(t,e,r){return t=Gs(t),(e=r?i:e)===i?function(t){return ke.test(t)}(t)?function(t){return t.match(_e)||[]}(t):function(t){return t.match(jt)||[]}(t):t.match(e)||[]}var Al=ka((function(t,e){try{return Ge(t,i,e)}catch(t){return ks(t)?t:new $t(t)}})),Ml=Ci((function(t,e){return Ye(e,(function(e){e=co(e),Pn(t,e,rs(t[e],t))})),t}));function El(t){return function(){return t}}var Sl=pi(),Cl=pi(!0);function Ll(t){return t}function Ol(t){return la("function"==typeof t?t:zn(t,p))}var Pl=ka((function(t,e){return function(r){return na(r,t,e)}})),Il=ka((function(t,e){return function(r){return na(t,r,e)}}));function Dl(t,e,r){var n=al(e),a=Zn(e,n);null!=r||Es(e)&&(a.length||!n.length)||(r=e,e=t,t=this,a=Zn(e,al(e)));var i=!(Es(r)&&"chain"in r&&!r.chain),o=Ts(t);return Ye(a,(function(r){var n=e[r];t[r]=n,o&&(t.prototype[r]=function(){var e=this.__chain__;if(i||e){var r=t(this.__wrapped__),a=r.__actions__=ri(this.__actions__);return a.push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,tr([this.value()],arguments))})})),t}function zl(){}var Rl=vi(Qe),Fl=vi(Ze),Bl=vi(nr);function Nl(t){return Yi(t)?fr(co(t)):function(t){return function(e){return Jn(e,t)}}(t)}var jl=yi(),Vl=yi(!0);function Ul(){return[]}function Hl(){return!1}var ql=gi((function(t,e){return t+e}),0),Gl=_i("ceil"),Wl=gi((function(t,e){return t/e}),1),Yl=_i("floor");var Xl,Zl=gi((function(t,e){return t*e}),1),Jl=_i("round"),Kl=gi((function(t,e){return t-e}),0);return hn.after=function(t,e){if("function"!=typeof e)throw new ae(l);return t=Vs(t),function(){if(--t<1)return e.apply(this,arguments)}},hn.ary=ts,hn.assign=Ws,hn.assignIn=Ys,hn.assignInWith=Xs,hn.assignWith=Zs,hn.at=Js,hn.before=es,hn.bind=rs,hn.bindAll=Ml,hn.bindKey=ns,hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ms(t)?t:[t]},hn.chain=No,hn.chunk=function(t,e,r){e=(r?Wi(t,e,r):e===i)?1:qr(Vs(e),0);var a=null==t?0:t.length;if(!a||e<1)return[];for(var o=0,s=0,l=n(Fr(a/e));oa?0:a+r),(n=n===i||n>a?a:Vs(n))<0&&(n+=a),n=r>n?0:Us(n);r>>0)?(t=Gs(t))&&("string"==typeof e||null!=e&&!Ps(e))&&!(e=Ra(e))&&Tr(t)?Xa(Or(t),0,r):t.split(e,r):[]},hn.spread=function(t,e){if("function"!=typeof t)throw new ae(l);return e=null==e?0:qr(Vs(e),0),ka((function(r){var n=r[e],a=Xa(r,0,e);return n&&tr(a,n),Ge(t,this,a)}))},hn.tail=function(t){var e=null==t?0:t.length;return e?La(t,1,e):[]},hn.take=function(t,e,r){return t&&t.length?La(t,0,(e=r||e===i?1:Vs(e))<0?0:e):[]},hn.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?La(t,(e=n-(e=r||e===i?1:Vs(e)))<0?0:e,n):[]},hn.takeRightWhile=function(t,e){return t&&t.length?ja(t,zi(e,3),!1,!0):[]},hn.takeWhile=function(t,e){return t&&t.length?ja(t,zi(e,3)):[]},hn.tap=function(t,e){return e(t),t},hn.throttle=function(t,e,r){var n=!0,a=!0;if("function"!=typeof t)throw new ae(l);return Es(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),as(t,e,{leading:n,maxWait:e,trailing:a})},hn.thru=jo,hn.toArray=Ns,hn.toPairs=fl,hn.toPairsIn=pl,hn.toPath=function(t){return ms(t)?Qe(t,co):zs(t)?[t]:ri(lo(Gs(t)))},hn.toPlainObject=qs,hn.transform=function(t,e,r){var n=ms(t),a=n||_s(t)||Rs(t);if(e=zi(e,4),null==r){var i=t&&t.constructor;r=a?n?new i:[]:Es(t)&&Ts(i)?dn(Oe(t)):{}}return(a?Ye:Yn)(t,(function(t,n,a){return e(r,t,n,a)})),r},hn.unary=function(t){return ts(t,1)},hn.union=So,hn.unionBy=Co,hn.unionWith=Lo,hn.uniq=function(t){return t&&t.length?Fa(t):[]},hn.uniqBy=function(t,e){return t&&t.length?Fa(t,zi(e,2)):[]},hn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?Fa(t,i,e):[]},hn.unset=function(t,e){return null==t||Ba(t,e)},hn.unzip=Oo,hn.unzipWith=Po,hn.update=function(t,e,r){return null==t?t:Na(t,e,Ga(r))},hn.updateWith=function(t,e,r,n){return n="function"==typeof n?n:i,null==t?t:Na(t,e,Ga(r),n)},hn.values=hl,hn.valuesIn=function(t){return null==t?[]:mr(t,il(t))},hn.without=Io,hn.words=Tl,hn.wrap=function(t,e){return us(Ga(e),t)},hn.xor=Do,hn.xorBy=zo,hn.xorWith=Ro,hn.zip=Fo,hn.zipObject=function(t,e){return Ha(t||[],e||[],Sn)},hn.zipObjectDeep=function(t,e){return Ha(t||[],e||[],Ma)},hn.zipWith=Bo,hn.entries=fl,hn.entriesIn=pl,hn.extend=Ys,hn.extendWith=Xs,Dl(hn,hn),hn.add=ql,hn.attempt=Al,hn.camelCase=dl,hn.capitalize=gl,hn.ceil=Gl,hn.clamp=function(t,e,r){return r===i&&(r=e,e=i),r!==i&&(r=(r=Hs(r))==r?r:0),e!==i&&(e=(e=Hs(e))==e?e:0),Dn(Hs(t),e,r)},hn.clone=function(t){return zn(t,d)},hn.cloneDeep=function(t){return zn(t,p|d)},hn.cloneDeepWith=function(t,e){return zn(t,p|d,e="function"==typeof e?e:i)},hn.cloneWith=function(t,e){return zn(t,d,e="function"==typeof e?e:i)},hn.conformsTo=function(t,e){return null==e||Rn(t,e,al(e))},hn.deburr=vl,hn.defaultTo=function(t,e){return null==t||t!=t?e:t},hn.divide=Wl,hn.endsWith=function(t,e,r){t=Gs(t),e=Ra(e);var n=t.length,a=r=r===i?n:Dn(Vs(r),0,n);return(r-=e.length)>=0&&t.slice(r,a)==e},hn.eq=hs,hn.escape=function(t){return(t=Gs(t))&&At.test(t)?t.replace(kt,wr):t},hn.escapeRegExp=function(t){return(t=Gs(t))&&It.test(t)?t.replace(Pt,"\\$&"):t},hn.every=function(t,e,r){var n=ms(t)?Ze:Vn;return r&&Wi(t,e,r)&&(e=i),n(t,zi(e,3))},hn.find=Ho,hn.findIndex=vo,hn.findKey=function(t,e){return ir(t,zi(e,3),Yn)},hn.findLast=qo,hn.findLastIndex=mo,hn.findLastKey=function(t,e){return ir(t,zi(e,3),Xn)},hn.floor=Yl,hn.forEach=Go,hn.forEachRight=Wo,hn.forIn=function(t,e){return null==t?t:Gn(t,zi(e,3),il)},hn.forInRight=function(t,e){return null==t?t:Wn(t,zi(e,3),il)},hn.forOwn=function(t,e){return t&&Yn(t,zi(e,3))},hn.forOwnRight=function(t,e){return t&&Xn(t,zi(e,3))},hn.get=Qs,hn.gt=ds,hn.gte=gs,hn.has=function(t,e){return null!=t&&Ui(t,e,ta)},hn.hasIn=tl,hn.head=xo,hn.identity=Ll,hn.includes=function(t,e,r,n){t=xs(t)?t:hl(t),r=r&&!n?Vs(r):0;var a=t.length;return r<0&&(r=qr(a+r,0)),Ds(t)?r<=a&&t.indexOf(e,r)>-1:!!a&&sr(t,e,r)>-1},hn.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var a=null==r?0:Vs(r);return a<0&&(a=qr(n+a,0)),sr(t,e,a)},hn.inRange=function(t,e,r){return e=js(e),r===i?(r=e,e=0):r=js(r),function(t,e,r){return t>=Gr(e,r)&&t=-D&&t<=D},hn.isSet=Is,hn.isString=Ds,hn.isSymbol=zs,hn.isTypedArray=Rs,hn.isUndefined=function(t){return t===i},hn.isWeakMap=function(t){return Ss(t)&&Vi(t)==ot},hn.isWeakSet=function(t){return Ss(t)&&$n(t)==st},hn.join=function(t,e){return null==t?"":Ur.call(t,e)},hn.kebabCase=ml,hn.last=ko,hn.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var a=n;return r!==i&&(a=(a=Vs(r))<0?qr(n+a,0):Gr(a,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,a):or(t,cr,a,!0)},hn.lowerCase=yl,hn.lowerFirst=xl,hn.lt=Fs,hn.lte=Bs,hn.max=function(t){return t&&t.length?Un(t,Ll,Qn):i},hn.maxBy=function(t,e){return t&&t.length?Un(t,zi(e,2),Qn):i},hn.mean=function(t){return ur(t,Ll)},hn.meanBy=function(t,e){return ur(t,zi(e,2))},hn.min=function(t){return t&&t.length?Un(t,Ll,fa):i},hn.minBy=function(t,e){return t&&t.length?Un(t,zi(e,2),fa):i},hn.stubArray=Ul,hn.stubFalse=Hl,hn.stubObject=function(){return{}},hn.stubString=function(){return""},hn.stubTrue=function(){return!0},hn.multiply=Zl,hn.nth=function(t,e){return t&&t.length?va(t,Vs(e)):i},hn.noConflict=function(){return Ie._===this&&(Ie._=ge),this},hn.noop=zl,hn.now=Qo,hn.pad=function(t,e,r){t=Gs(t);var n=(e=Vs(e))?Lr(t):0;if(!e||n>=e)return t;var a=(e-n)/2;return mi(Br(a),r)+t+mi(Fr(a),r)},hn.padEnd=function(t,e,r){t=Gs(t);var n=(e=Vs(e))?Lr(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var a=Xr();return Gr(t+a*(e-t+Ce("1e-"+((a+"").length-1))),e)}return _a(t,e)},hn.reduce=function(t,e,r){var n=ms(t)?er:hr,a=arguments.length<3;return n(t,zi(e,4),r,a,Nn)},hn.reduceRight=function(t,e,r){var n=ms(t)?rr:hr,a=arguments.length<3;return n(t,zi(e,4),r,a,jn)},hn.repeat=function(t,e,r){return e=(r?Wi(t,e,r):e===i)?1:Vs(e),wa(Gs(t),e)},hn.replace=function(){var t=arguments,e=Gs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},hn.result=function(t,e,r){var n=-1,a=(e=Wa(e,t)).length;for(a||(a=1,t=i);++nD)return[];var r=F,n=Gr(t,F);e=zi(e),t-=F;for(var a=gr(n,e);++r=o)return t;var l=r-Lr(n);if(l<1)return n;var c=s?Xa(s,0,l).join(""):t.slice(0,l);if(a===i)return c+n;if(s&&(l+=c.length-l),Ps(a)){if(t.slice(l).search(a)){var u,f=c;for(a.global||(a=re(a.source,Gs(Ht.exec(a))+"g")),a.lastIndex=0;u=a.exec(f);)var p=u.index;c=c.slice(0,p===i?l:p)}}else if(t.indexOf(Ra(a),l)!=l){var h=c.lastIndexOf(a);h>-1&&(c=c.slice(0,h))}return c+n},hn.unescape=function(t){return(t=Gs(t))&&Tt.test(t)?t.replace(wt,Pr):t},hn.uniqueId=function(t){var e=++fe;return Gs(t)+e},hn.upperCase=wl,hn.upperFirst=kl,hn.each=Go,hn.eachRight=Wo,hn.first=xo,Dl(hn,(Xl={},Yn(hn,(function(t,e){ue.call(hn.prototype,e)||(Xl[e]=t)})),Xl),{chain:!1}),hn.VERSION="4.17.15",Ye(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){hn[t].placeholder=hn})),Ye(["drop","take"],(function(t,e){mn.prototype[t]=function(r){r=r===i?1:qr(Vs(r),0);var n=this.__filtered__&&!e?new mn(this):this.clone();return n.__filtered__?n.__takeCount__=Gr(r,n.__takeCount__):n.__views__.push({size:Gr(r,F),type:t+(n.__dir__<0?"Right":"")}),n},mn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ye(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=r==O||3==r;mn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:zi(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Ye(["head","last"],(function(t,e){var r="take"+(e?"Right":"");mn.prototype[t]=function(){return this[r](1).value()[0]}})),Ye(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");mn.prototype[t]=function(){return this.__filtered__?new mn(this):this[r](1)}})),mn.prototype.compact=function(){return this.filter(Ll)},mn.prototype.find=function(t){return this.filter(t).head()},mn.prototype.findLast=function(t){return this.reverse().find(t)},mn.prototype.invokeMap=ka((function(t,e){return"function"==typeof t?new mn(this):this.map((function(r){return na(r,t,e)}))})),mn.prototype.reject=function(t){return this.filter(ls(zi(t)))},mn.prototype.slice=function(t,e){t=Vs(t);var r=this;return r.__filtered__&&(t>0||e<0)?new mn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==i&&(r=(e=Vs(e))<0?r.dropRight(-e):r.take(e-t)),r)},mn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},mn.prototype.toArray=function(){return this.take(F)},Yn(mn.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),a=hn[n?"take"+("last"==e?"Right":""):e],o=n||/^find/.test(e);a&&(hn.prototype[e]=function(){var e=this.__wrapped__,s=n?[1]:arguments,l=e instanceof mn,c=s[0],u=l||ms(e),f=function(t){var e=a.apply(hn,tr([t],s));return n&&p?e[0]:e};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var p=this.__chain__,h=!!this.__actions__.length,d=o&&!p,g=l&&!h;if(!o&&u){e=g?e:new mn(this);var v=t.apply(e,s);return v.__actions__.push({func:jo,args:[f],thisArg:i}),new vn(v,p)}return d&&g?t.apply(this,s):(v=this.thru(f),d?n?v.value()[0]:v.value():v)})})),Ye(["pop","push","shift","sort","splice","unshift"],(function(t){var e=ie[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);hn.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var a=this.value();return e.apply(ms(a)?a:[],t)}return this[r]((function(r){return e.apply(ms(r)?r:[],t)}))}})),Yn(mn.prototype,(function(t,e){var r=hn[e];if(r){var n=r.name+"";ue.call(nn,n)||(nn[n]=[]),nn[n].push({name:e,func:r})}})),nn[hi(i,y).name]=[{name:"wrapper",func:i}],mn.prototype.clone=function(){var t=new mn(this.__wrapped__);return t.__actions__=ri(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ri(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ri(this.__views__),t},mn.prototype.reverse=function(){if(this.__filtered__){var t=new mn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},mn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=ms(t),n=e<0,a=r?t.length:0,i=function(t,e,r){var n=-1,a=r.length;for(;++n=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},hn.prototype.plant=function(t){for(var e,r=this;r instanceof gn;){var n=fo(r);n.__index__=0,n.__values__=i,e?a.__wrapped__=n:e=n;var a=n;r=r.__wrapped__}return a.__wrapped__=t,e},hn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof mn){var e=t;return this.__actions__.length&&(e=new mn(this)),(e=e.reverse()).__actions__.push({func:jo,args:[Eo],thisArg:i}),new vn(e,this.__chain__)}return this.thru(Eo)},hn.prototype.toJSON=hn.prototype.valueOf=hn.prototype.value=function(){return Va(this.__wrapped__,this.__actions__)},hn.prototype.first=hn.prototype.head,Be&&(hn.prototype[Be]=function(){return this}),hn}();Ie._=Ir,(a=function(){return Ir}.call(e,r,e,n))===i||(n.exports=a)}).call(this)}).call(this,r(45),r(52)(t))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=r(53),i={};e.default=i,i.read=function(t,e){var r,n=(r=this,function(t,n,a){return i._onRetrieval(t,a,e,r)});return void 0===e?new Promise((function(r,i){e=function(t,e){t?i(t):r(e)},a(t,n)})):a(t,n)},i._onRetrieval=function(t,e,r,n){var a=void 0;return void 0!==t&&(a=n.parse(e)),r.call(n,t,a)},i.extend=function(t,e){return extend(i,t,e)},i.mixin=function(t){return"object"!==(void 0===t?"undefined":n(t))&&(t=t.prototype),["read"].forEach((function(e){t[e]=i[e]}),this),t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i(r(69)),a=i(r(73));function i(t){return t&&t.__esModule?t:{default:t}}var o=(0,n.default)(a.default);e.default=o},function(t,e,r){"use strict";var n=r(81);t.exports=Function.prototype.bind||n},function(t,e,r){"use strict";var n=Function.prototype.toString,a=/^\s*class\b/,i=function(t){try{var e=n.call(t);return a.test(e)}catch(t){return!1}},o=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(s)return function(t){try{return!i(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(i(t))return!1;var e=o.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={};e.default=n,n.getMeta=function(t){var e,r,n=!1,a=!1,i={},o={},s=t.split(" ");if(s.length>=1?(n=s.shift(),a=s.join(" ")):n=t,n){var l=n.split("|");for(e=l.pop(),o.en=e;0!=l.length;){var c=l.shift(),u=l.shift();i[c]=u}}else e=n;if(a){var f=a.split("=");if(f.length>1){var p,h;f.length;f.forEach((function(t){var e,n=(t=t.trim()).split(" ");if(n.length>1?(h=n.pop(),e=n.join(" ")):e=t,p){var a=p.toLowerCase();o[a]=e}else r=e;p=h}))}else r=f.shift()}var d={name:e,ids:i,details:o};return r&&(d.desc=r),d};var a={sp:{link:"http://www.uniprot.org/%s",name:"Uniprot"},tr:{link:"http://www.uniprot.org/%s",name:"Trembl"},gb:{link:"http://www.ncbi.nlm.nih.gov/nuccore/%s",name:"Genbank"},pdb:{link:"http://www.rcsb.org/pdb/explore/explore.do?structureId=%s",name:"PDB"}};n.buildLinks=function(t){var e={};return t=t||{},Object.keys(t).forEach((function(r){if(r in a){var n=a[r],i=n.link.replace("%s",t[r]);e[n.name]=i}})),e},n.contains=function(t,e){return-1!=="".indexOf.call(t,e,0)},n.splitNChars=function(t,e){var r,n;e=e||80;var a=[];for(r=0,n=t.length-1;r<=n;r+=e)a.push(t.substr(r,e));return a},n.reverse=function(t){return t.split("").reverse().join("")},n.complement=function(t){var e=t+"",r=[[/g/g,"0"],[/c/g,"1"],[/0/g,"c"],[/1/g,"g"],[/G/g,"0"],[/C/g,"1"],[/0/g,"C"],[/1/g,"G"],[/a/g,"0"],[/t/g,"1"],[/0/g,"t"],[/1/g,"a"],[/A/g,"0"],[/T/g,"1"],[/0/g,"T"],[/1/g,"A"]];for(var n in r)e=e.replace(r[n][0],r[n][1]);return e},n.reverseComplement=function(t){return n.reverse(n.complement(t))},n.model=function(t,e,r){this.seq=t,this.name=e,this.id=r,this.ids={}}},function(t,e,r){"use strict";function n(t){return(n="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})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}(r(1)),i=p(r(0)),o=p(r(44)),s=p(r(47)),l=r(74),c=r(58),u=r(59),f=r(104);function p(t){return t&&t.__esModule?t:{default:t}}function h(t){return(h="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)})(t)}function d(){return(d=Object.assign||function(t){for(var e=1;eK&&(K=e):e=(0,c.getConservation)(t),e})),Z="entropy"===x?Z.map((function(t){return 1-t/K})):Z.map((function(t){return t/I}))),_&&(J=P.map((function(t){return o.default.countBy(t)["-"]/I}))),b)for(var $=0;$Bar weights",titlefont:{size:12},showgrid:!1,zeroline:!1,domain:[.75,1]}):3===p?(S.yaxis.domain=[0,.64],S.yaxis2={title:"Conservation",titlefont:{size:12},showgrid:!1,zeroline:!1,domain:[.65,.89]},S.yaxis3={title:"Gap",titlefont:{size:12},showgrid:!1,zeroline:!1,domain:[.9,1]}):S.yaxis.domain=[0,1],"heatmap"===m?(S.xaxis.rangeslider={autorange:!0},S.xaxis.tick0=x,S.xaxis.dtick=b,S.margin={t:20,r:20,b:20}):"slider"===m?S.sliders=[{currentvalue:{prefix:"Position ",suffix:""},steps:i}]:(S.xaxis.tick0=x,S.xaxis.dtick=b,S.margin={t:20,r:20,b:20}),{layout:S,width:e,height:n}}},{key:"componentDidMount",value:function(){var t=this.resetWindowing(this.props),e=t.xStart,r=t.xEnd;this.setState({xStart:e,xEnd:r})}},{key:"componentDidUpdate",value:function(t,e){if(this.props.data!==t.data){var r=this.resetWindowing(this.props),n=r.xStart,a=r.xEnd;this.setState({xStart:n,xEnd:a})}}},{key:"render",value:function(){var t=this.getData(),e=t.data,r=t.length,n=t.count,i=t.labels,o=t.tick,l=t.plotCount,c=this.getLayout({length:r,count:n,labels:i,tick:o,plotCount:l}),u=c.layout,f={style:{width:c.width,height:c.height},useResizeHandler:!0};return a.default.createElement("div",null,a.default.createElement(s.default,d({data:e,layout:u,onClick:this.handleChange,onHover:this.handleChange,onRelayout:this.handleChange},f)))}}])&&v(r.prototype,n),i&&v(r,i),e}(a.PureComponent);e.default=b,b.propTypes={data:i.default.string,extension:i.default.string,colorscale:i.default.oneOfType([i.default.string,i.default.object]),opacity:i.default.oneOfType([i.default.number,i.default.string]),textcolor:i.default.string,textsize:i.default.oneOfType([i.default.number,i.default.string]),showlabel:i.default.bool,showid:i.default.bool,showconservation:i.default.bool,conservationcolor:i.default.string,conservationcolorscale:i.default.oneOfType([i.default.string,i.default.array]),conservationopacity:i.default.oneOfType([i.default.number,i.default.string]),conservationmethod:i.default.oneOf(["conservation","entropy"]),correctgap:i.default.bool,showgap:i.default.bool,gapcolor:i.default.string,gapcolorscale:i.default.oneOfType([i.default.string,i.default.array]),gapopacity:i.default.oneOfType([i.default.number,i.default.string]),groupbars:i.default.bool,showconsensus:i.default.bool,tilewidth:i.default.number,tileheight:i.default.number,overview:i.default.oneOf(["heatmap","slider","none"]),numtiles:i.default.number,scrollskip:i.default.number,tickstart:i.default.oneOfType([i.default.number,i.default.string]),ticksteps:i.default.oneOfType([i.default.number,i.default.string]),width:i.default.oneOfType([i.default.number,i.default.string]),height:i.default.oneOfType([i.default.number,i.default.string])},b.defaultProps={extension:"fasta",colorscale:"clustal2",opacity:null,textcolor:null,textsize:10,showlabel:!0,showid:!0,showconservation:!0,conservationcolor:null,conservationcolorscale:"Viridis",conservationopacity:null,conservationmethod:"entropy",correctgap:!0,showgap:!0,gapcolor:"grey",gapcolorscale:null,gapopacity:null,groupbars:!1,showconsensus:!0,tilewidth:16,tileheight:16,numtiles:null,overview:"heatmap",scrollskip:10,tickstart:null,ticksteps:null,width:null,height:900}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";var n=r(77),a=r(78),i=r(79),o=r(95);function s(t,e,r){var n=t;return a(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=o(e,{uri:t}),n.callback=r,n}function l(t,e,r){return c(e=s(t,e,r))}function c(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,a){e||(e=!0,t.callback(r,n,a))};function n(){var t=void 0;if(t=u.response?u.response:u.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(u),m)try{t=JSON.parse(t)}catch(t){}return t}function a(t){return clearTimeout(f),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,y)}function o(){if(!c){var e;clearTimeout(f),e=t.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var a=y,o=null;return 0!==e?(a={body:n(),statusCode:e,method:h,headers:{},url:p,rawRequest:u},u.getAllResponseHeaders&&(a.headers=i(u.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),r(o,a,a.body)}}var s,c,u=t.xhr||null;u||(u=t.cors||t.useXDR?new l.XDomainRequest:new l.XMLHttpRequest);var f,p=u.url=t.uri||t.url,h=u.method=t.method||"GET",d=t.body||t.data,g=u.headers=t.headers||{},v=!!t.sync,m=!1,y={body:void 0,headers:{},statusCode:0,method:h,url:p,rawRequest:u};if("json"in t&&!1!==t.json&&(m=!0,g.accept||g.Accept||(g.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(g["content-type"]||g["Content-Type"]||(g["Content-Type"]="application/json"),d=JSON.stringify(!0===t.json?d:t.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(o,0)},u.onload=o,u.onerror=a,u.onprogress=function(){},u.onabort=function(){c=!0},u.ontimeout=a,u.open(h,p,!v,t.username,t.password),v||(u.withCredentials=!!t.withCredentials),!v&&t.timeout>0&&(f=setTimeout((function(){if(!c){c=!0,u.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",a(t)}}),t.timeout)),u.setRequestHeader)for(s in g)g.hasOwnProperty(s)&&u.setRequestHeader(s,g[s]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(u.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(u),u.send(d||null),u}t.exports=l,t.exports.default=l,l.XMLHttpRequest=n.XMLHttpRequest||function(){},l.XDomainRequest="withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var r=0;r2?arguments[2]:{},i=n(e);a&&(i=o.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s0&&(n=(r=t.split(" "))[0],a=r[1].replace(/"/g,""),e[n]=a)})),e}function a(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function i(t,e,r){return 3===t.length?i(t[0],t[1],t[2]):"#"+a(t)+a(e)+a(r)}Object.defineProperty(e,"__esModule",{value:!0}),e.extractKeys=n,e.rgbToHex=i,e.default={extractKeys:n,rgbToHex:i}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getConsensus=e.getConservation=e.getEntropy=void 0;var n,a=(n=r(44))&&n.__esModule?n:{default:n};e.getEntropy=function(t){var e;e=a.default.isString(t)?t.split(""):t;var r={};return e.forEach((function(t){return r[t]?r[t]++:r[t]=1})),Object.keys(r).reduce((function(t,n){var a=r[n]/e.length;return t-a*Math.log(a)}),0)};e.getConservation=function(t){var e;return e=a.default.isString(t)?t.split(""):t,(0,a.default)(e).countBy().entries().maxBy("[1]")[1]};e.getConsensus=function(t){return t.map((function(t){return(0,a.default)(t).countBy().entries().maxBy("[1]")[0]}))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getVisualizations=e.getTicks=e.getHovertext=e.getWidth=e.SUBPLOT_RATIOS=void 0;var n,a=(n=r(44))&&n.__esModule?n:{default:n};e.SUBPLOT_RATIOS={1:1,2:.75,3:.65};e.getWidth=function(t){return a.default.isNumber(t)?t:t.includes("%")?parseFloat(t)/100*window.innerWidth:parseFloat(t)};e.getHovertext=function(t,e){for(var r=[],n=function(n){var a=[],i=0;t[n].forEach((function(t){i+=1;var r=["Name: ".concat(e[n].name),"Organism: ".concat(e[n].os?e[n].os:"N/A"),"ID: ".concat(e[n].id,"
"),"Position: (".concat(i,", ").concat(n,")"),"Letter: ".concat(t)].join("
");a.push(r)})),r.push(a)},i=0;i=0||(a[r]=t[r]);return a}(e,["children"]);if(delete n.in,delete n.mountOnEnter,delete n.unmountOnExit,delete n.appear,delete n.enter,delete n.exit,delete n.timeout,delete n.addEndListener,delete n.onEnter,delete n.onEntering,delete n.onEntered,delete n.onExit,delete n.onExiting,delete n.onExited,"function"==typeof r)return r(t,n);var i=a.default.Children.only(r);return a.default.cloneElement(i,n)},n}(a.default.Component);function h(){}p.contextTypes={transitionGroup:n.object},p.childContextTypes={transitionGroup:function(){}},p.propTypes={},p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},p.UNMOUNTED=0,p.EXITED=1,p.ENTERING=2,p.ENTERED=3,p.EXITING=4;var d=(0,o.polyfill)(p);e.default=d},function(t,e,r){"use strict";function n(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=t&&this.setState(t)}function a(t){this.setState(function(e){var r=this.constructor.getDerivedStateFromProps(t,e);return null!=r?r:null}.bind(this))}function i(t,e){try{var r=this.props,n=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(r,n)}finally{this.props=r,this.state=n}}function o(t){var e=t.prototype;if(!e||!e.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate)return t;var r=null,o=null,s=null;if("function"==typeof e.componentWillMount?r="componentWillMount":"function"==typeof e.UNSAFE_componentWillMount&&(r="UNSAFE_componentWillMount"),"function"==typeof e.componentWillReceiveProps?o="componentWillReceiveProps":"function"==typeof e.UNSAFE_componentWillReceiveProps&&(o="UNSAFE_componentWillReceiveProps"),"function"==typeof e.componentWillUpdate?s="componentWillUpdate":"function"==typeof e.UNSAFE_componentWillUpdate&&(s="UNSAFE_componentWillUpdate"),null!==r||null!==o||null!==s){var l=t.displayName||t.name,c="function"==typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+l+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==r?"\n "+r:"")+(null!==o?"\n "+o:"")+(null!==s?"\n "+s:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof t.getDerivedStateFromProps&&(e.componentWillMount=n,e.componentWillReceiveProps=a),"function"==typeof e.getSnapshotBeforeUpdate){if("function"!=typeof e.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=i;var u=e.componentDidUpdate;e.componentDidUpdate=function(t,e,r){var n=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:r;u.call(this,t,e,n)}}return t}r.r(e),r.d(e,"polyfill",(function(){return o})),n.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},function(t,e,r){"use strict";e.__esModule=!0,e.classNamesShape=e.timeoutsShape=void 0;var n;(n=r(0))&&n.__esModule;e.timeoutsShape=null;e.classNamesShape=null},function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n=s(r(0)),a=s(r(1)),i=r(61),o=r(133);function s(t){return t&&t.__esModule?t:{default:t}}function l(){return(l=Object.assign||function(t){for(var e=1;e=0||(a[r]=t[r]);return a}(t,["component","childFactory"]),i=u(this.state.children).map(r);return delete n.appear,delete n.enter,delete n.exit,null===e?i:a.default.createElement(e,n,i)},n}(a.default.Component);f.childContextTypes={transitionGroup:n.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(t){return t}};var p=(0,i.polyfill)(f);e.default=p,t.exports=e.default},,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AlignmentViewer",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"AlignmentChart",{enumerable:!0,get:function(){return a.default}});var n=i(r(68)),a=i(r(51));function i(t){return t&&t.__esModule?t:{default:t}}},function(t,e,r){"use strict";function n(t){return(n="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})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}(r(1)),i=u(r(0)),o=u(r(51)),s=r(119),l=r(59),c=r(134);function u(t){return t&&t.__esModule?t:{default:t}}function f(t){return(f="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)})(t)}function p(){return(p=Object.assign||function(t){for(var e=1;e=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function d(t,e){for(var r=0;r:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .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:white;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:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var 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":716}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":1285}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":862}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/barpolar")},{"../src/traces/barpolar":874}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":884}],6:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":589}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":893}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":912}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":926}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":933}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":939}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":954}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":965}],14:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":694}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":973}],16:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1286}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnel")},{"../src/traces/funnel":983}],18:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnelarea")},{"../src/traces/funnelarea":992}],19:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1287}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":1005}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":1014}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":1026}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":1032}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":1036}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/image")},{"../src/traces/image":1043}],26:[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("./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")]),n.register([t("./aggregate"),t("./filter"),t("./groupby"),t("./sort")]),n.register([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,"./image":25,"./indicator":27,"./isosurface":28,"./mesh3d":29,"./ohlc":30,"./parcats":31,"./parcoords":32,"./pie":33,"./pointcloud":34,"./sankey":35,"./scatter3d":36,"./scattercarpet":37,"./scattergeo":38,"./scattergl":39,"./scattermapbox":40,"./scatterpolar":41,"./scatterpolargl":42,"./scatterternary":43,"./sort":44,"./splom":45,"./streamtube":46,"./sunburst":47,"./surface":48,"./table":49,"./treemap":50,"./violin":51,"./volume":52,"./waterfall":53}],27:[function(t,e,r){"use strict";e.exports=t("../src/traces/indicator")},{"../src/traces/indicator":1051}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":1057}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":1062}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":1067}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcats")},{"../src/traces/parcats":1076}],32:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":1086}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":1097}],34:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":1106}],35:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1112}],36:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1148}],37:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1154}],38:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1161}],39:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":1172}],40:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1181}],41:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1188}],42:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1194}],43:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1201}],44:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1289}],45:[function(t,e,r){"use strict";e.exports=t("../src/traces/splom")},{"../src/traces/splom":1210}],46:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":1218}],47:[function(t,e,r){"use strict";e.exports=t("../src/traces/sunburst")},{"../src/traces/sunburst":1226}],48:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":1235}],49:[function(t,e,r){"use strict";e.exports=t("../src/traces/table")},{"../src/traces/table":1243}],50:[function(t,e,r){"use strict";e.exports=t("../src/traces/treemap")},{"../src/traces/treemap":1252}],51:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":1264}],52:[function(t,e,r){"use strict";e.exports=t("../src/traces/volume")},{"../src/traces/volume":1272}],53:[function(t,e,r){"use strict";e.exports=t("../src/traces/waterfall")},{"../src/traces/waterfall":1280}],54:[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=a(),p=i();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),p.setDistanceLimits(l[0],l[1]),p.lookAt(0,e,r,s),new o({turntable:u,orbit:f,matrix:p},c)};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;n1||a>1)}function S(t,e,r){return t.sort(L),t.forEach((function(n,a){var i,o,s=0;if(G(n,r)&&E(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 C(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={})})),S(t.links.filter((function(t){return"top"==t.circularLinkType})),r,i),S(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+w,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,G(e,i)&&E(e))e.circularPathData.leftSmallArcRadius=w+e.width/2,e.circularPathData.leftLargeArcRadius=w+e.width/2,e.circularPathData.rightSmallArcRadius=w+e.width/2,e.circularPathData.rightLargeArcRadius=w+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+_+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-_-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(O);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+u,e.circularPathData.leftLargeArcRadius=w+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(D):c.sort(I),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+u,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(a,e.source.y1,e.target.y1)+_+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-_-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){return"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}(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 L(t,e){return z(t)==z(e)?"bottom"==t.circularLinkType?P(t,e):O(t,e):z(e)-z(t)}function O(t,e){return t.y0-e.y0}function P(t,e){return e.y0-t.y0}function I(t,e){return t.y1-e.y1}function D(t,e){return e.y1-t.y1}function z(t){return t.target.column-t.source.column}function R(t){return t.target.x0-t.source.x1}function F(t,e){var r=A(t),n=R(e)/Math.tan(r);return"up"==q(t)?t.y1+n:t.y1-n}function B(t,e){var r=A(t),n=R(e)/Math.tan(r);return"up"==q(t)?t.y1-n:t.y1+n}function N(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),f=Math.pow(1-u,3),p=3*u*Math.pow(1-u,2),h=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),g=f*a.y0+p*a.y0+h*a.y1+d*a.y1,v=g-a.width/2,m=g+a.width/2;v>o.y0&&vi.y0&&a.y0i.y0&&a.y1i.y1)&&j(t,c,e,r)}))):m>o.y0&&mo.y1&&j(t,c,e,r)}))):vo.y1&&(c=m-o.y0+10,o=j(o,c,e,r),t.nodes.forEach((function(t){b(t,n)!=b(o,n)&&t.column==o.column&&t.y0o.y1&&j(t,c,e,r)})))}}))}}))}function j(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 V(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 b(t.source,r)==b(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(!H(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=B(e,t);return t.y1-r}if(e.target.column>t.target.column)return B(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(!H(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function G(t,e){return b(t.source,e)==b(t.target,e)}t.sankeyCircular=function(){var t,n,i=0,b=0,A=1,E=1,S=24,L=v,O=o,P=m,I=y,D=32,z=2,R=null;function F(){var o={nodes:P.apply(null,arguments),links:I.apply(null,arguments)};!function(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,L);t.links.forEach((function(t,r){t.index=r;var n=t.source,a=t.target;"object"!==(void 0===n?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==(void 0===a?"undefined":l(a))&&(a=t.target=x(e,a)),n.sourceLinks.push(t),a.targetLinks.push(t)}))}(o),function(t,e,r){var n=0;if(null===r){for(var i=[],o=0;o0?r+_+w:r,bottom:n=n>0?n+_+w:n,left:i=i>0?i+_+w:i,right:a=a>0?a+_+w:a}}(a),u=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),a=A-i,o=E-b,s=a+r.right+r.left,l=o+r.top+r.bottom,c=a/s,u=o/l;return i=i*c+r.left,A=0==r.right?A:A*c,b=b*u+r.top,E*=u,t.nodes.forEach((function(t){t.x0=i+t.column*((A-i-S)/n),t.x1=t.x0+S})),u}(a,c);s*=u,a.links.forEach((function(t){t.width=t.value*s})),l.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==l.length-1&&1==e?(t.y0=E/2-t.value*s,t.y1=t.y0+t.value*s):0==t.depth&&1==e?(t.y0=E/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==M(t,r)?(t.y0=E/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=b+n,t.y1=t.y0+t.value*s):(t.y0=E-t.value*s-n,t.y1=t.y0+t.value*s):0==c.top||0==c.bottom?(t.y0=(E-b)/e*n,t.y1=t.y0+t.value*s):(t.y0=(E-b)/2-e/2+n,t.y1=t.y0+t.value*s)}))}))})(s),m();for(var c=1,u=o;u>0;--u)v(c*=.99,s),m();function v(t,r){var n=l.length;l.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&&M(a,r)>0);else if(0==o&&1==i)s=a.y1-a.y0,a.y0=E/2-s/2,a.y1=E/2+s/2;else if(o==n-1&&1==i)s=a.y1-a.y0,a.y0=E/2-s/2,a.y1=E/2+s/2;else{var l=e.mean(a.sourceLinks,g),c=e.mean(a.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-h(a))*t;a.y0+=u,a.y1+=u}}))}))}function m(){l.forEach((function(e){var r,n,a,i=b,o=e.length;for(e.sort(f),a=0;a0&&(r.y0+=n,r.y1+=n),i=r.y1+t;if((n=i-t-E)>0)for(i=r.y0-=n,r.y1-=n,a=o-2;a>=0;--a)(n=(r=e[a]).y1+t-i)>0&&(r.y0-=n,r.y1-=n),i=r.y0}))}}(o,D,L),B(o);for(var s=0;s<4;s++)V(o,E,L),U(o,0,L),N(o,b,E,L),V(o,E,L),U(o,0,L);return function(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=e.max(a,(function(t){return t.y1})),u=(n-r)/(c-l);a.forEach((function(t){var e=(t.y1-t.y0)*u;t.y0=(t.y0-l)*u,t.y1=t.y0+e})),i.forEach((function(t){t.y0=(t.y0-l)*u,t.y1=(t.y1-l)*u,t.width=t.width*u}))}}(o,b,E),C(o,z,E,L),o}function B(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 F.nodeId=function(t){return arguments.length?(L="function"==typeof t?t:s(t),F):L},F.nodeAlign=function(t){return arguments.length?(O="function"==typeof t?t:s(t),F):O},F.nodeWidth=function(t){return arguments.length?(S=+t,F):S},F.nodePadding=function(e){return arguments.length?(t=+e,F):t},F.nodes=function(t){return arguments.length?(P="function"==typeof t?t:s(t),F):P},F.links=function(t){return arguments.length?(I="function"==typeof t?t:s(t),F):I},F.size=function(t){return arguments.length?(i=b=0,A=+t[0],E=+t[1],F):[A-i,E-b]},F.extent=function(t){return arguments.length?(i=+t[0][0],A=+t[1][0],b=+t[0][1],E=+t[1][1],F):[[i,b],[A,E]]},F.iterations=function(t){return arguments.length?(D=+t,F):D},F.circularLinkGap=function(t){return arguments.length?(z=+t,F):z},F.nodePaddingRatio=function(t){return arguments.length?(n=+t,F):n},F.sortNodes=function(t){return arguments.length?(R=t,F):R},F.update=function(t){return T(t,L),B(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1i&&(b=i);var o=e.min(a,(function(t){return(y-n-(t.length-1)*b)/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=A;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,p)/e.sum(r.targetLinks,u)-f(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)-f(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+b;if((r=i-b-y)>0)for(i=e.y0-=r,e.y1-=r,a=o-2;a>=0;--a)(r=(e=t[a]).y1+b-i)>0&&(e.y0-=r,e.y1-=r),i=e.y0}))}}(i),S(i),i}function S(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 E.update=function(t){return S(t),t},E.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:o(t),E):_},E.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),E):w},E.nodeWidth=function(t){return arguments.length?(x=+t,E):x},E.nodePadding=function(t){return arguments.length?(b=+t,E):b},E.nodes=function(t){return arguments.length?(k="function"==typeof t?t:o(t),E):k},E.links=function(t){return arguments.length?(T="function"==typeof t?t:o(t),E):T},E.size=function(e){return arguments.length?(t=n=0,a=+e[0],y=+e[1],E):[a-t,y-n]},E.extent=function(e){return arguments.length?(t=+e[0][0],a=+e[1][0],n=+e[0][1],y=+e[1][1],E):[[t,n],[a,y]]},E.iterations=function(t){return arguments.length?(A=+t,E):A},E},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(y).target(x)},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":153,"d3-collection":154,"d3-shape":162}],57:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta"),a=6378137;function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var r=1;r2){for(l=0;l=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=p,r.lengthToDegrees=function(t,e){return h(p(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 f(p(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`")}},{}],60:[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,f,p=0,h=0,d=t.type,g="FeatureCollection"===d,v="Feature"===d,m=g?t.features.length:1,y=0;yc||h>u||d>f)return l=a,c=r,u=h,f=d,void(o=0);var g=n.lineString([l,a],t.properties);if(!1===e(g,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;sa&&(a=t[o]),t[o]>>1,j=[["ary",A],["bind",m],["bindKey",y],["curry",b],["curryRight",_],["flip",M],["partial",w],["partialRight",k],["rearg",T]],V="[object Arguments]",U="[object Array]",H="[object AsyncFunction]",q="[object Boolean]",G="[object Date]",W="[object DOMException]",Y="[object Error]",X="[object Function]",Z="[object GeneratorFunction]",$="[object Map]",J="[object Number]",K="[object Null]",Q="[object Object]",tt="[object Proxy]",et="[object RegExp]",rt="[object Set]",nt="[object String]",it="[object Symbol]",at="[object Undefined]",ot="[object WeakMap]",st="[object WeakSet]",lt="[object ArrayBuffer]",ut="[object DataView]",ct="[object Float32Array]",ft="[object Float64Array]",ht="[object Int8Array]",pt="[object Int16Array]",dt="[object Int32Array]",vt="[object Uint8Array]",gt="[object Uint8ClampedArray]",mt="[object Uint16Array]",yt="[object Uint32Array]",xt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,kt=/[&<>"']/g,At=RegExp(wt.source),Tt=RegExp(kt.source),Mt=/<%-([\s\S]+?)%>/g,Et=/<%([\s\S]+?)%>/g,St=/<%=([\s\S]+?)%>/g,Ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lt=/^\w*$/,Ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,It=/[\\^$.*+?()[\]{}|]/g,Pt=RegExp(It.source),Dt=/^\s+|\s+$/g,zt=/^\s+/,Rt=/\s+$/,Ft=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,Nt=/,? & /,jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vt=/\\(\\)?/g,Ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ht=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Gt=/^0b[01]+$/i,Wt=/^\[object .+?Constructor\]$/,Yt=/^0o[0-7]+$/i,Xt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$t=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,Kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Qt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+Qt+"]",re="["+Kt+"]",ne="\\d+",ie="[\\u2700-\\u27bf]",ae="[a-z\\xdf-\\xf6\\xf8-\\xff]",oe="[^\\ud800-\\udfff"+Qt+ne+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",le="[^\\ud800-\\udfff]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",ce="[\\ud800-\\udbff][\\udc00-\\udfff]",fe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",he="(?:"+ae+"|"+oe+")",pe="(?:"+fe+"|"+oe+")",de="(?:"+re+"|"+se+")"+"?",ve="[\\ufe0e\\ufe0f]?"+de+("(?:\\u200d(?:"+[le,ue,ce].join("|")+")[\\ufe0e\\ufe0f]?"+de+")*"),ge="(?:"+[ie,ue,ce].join("|")+")"+ve,me="(?:"+[le+re+"?",re,ue,ce,te].join("|")+")",ye=RegExp("['’]","g"),xe=RegExp(re,"g"),be=RegExp(se+"(?="+se+")|"+me+ve,"g"),_e=RegExp([fe+"?"+ae+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,fe,"$"].join("|")+")",pe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,fe+he,"$"].join("|")+")",fe+"?"+he+"+(?:['’](?:d|ll|m|re|s|t|ve))?",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ne,ge].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+Kt+"\\ufe0e\\ufe0f]"),ke=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ae=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Te=-1,Me={};Me[ct]=Me[ft]=Me[ht]=Me[pt]=Me[dt]=Me[vt]=Me[gt]=Me[mt]=Me[yt]=!0,Me[V]=Me[U]=Me[lt]=Me[q]=Me[ut]=Me[G]=Me[Y]=Me[X]=Me[$]=Me[J]=Me[Q]=Me[et]=Me[rt]=Me[nt]=Me[ot]=!1;var Ee={};Ee[V]=Ee[U]=Ee[lt]=Ee[ut]=Ee[q]=Ee[G]=Ee[ct]=Ee[ft]=Ee[ht]=Ee[pt]=Ee[dt]=Ee[$]=Ee[J]=Ee[Q]=Ee[et]=Ee[rt]=Ee[nt]=Ee[it]=Ee[vt]=Ee[gt]=Ee[mt]=Ee[yt]=!0,Ee[Y]=Ee[X]=Ee[ot]=!1;var Se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ce=parseFloat,Le=parseInt,Oe="object"==typeof t&&t&&t.Object===Object&&t,Ie="object"==typeof self&&self&&self.Object===Object&&self,Pe=Oe||Ie||Function("return this")(),De=e&&!e.nodeType&&e,ze=De&&"object"==typeof n&&n&&!n.nodeType&&n,Re=ze&&ze.exports===De,Fe=Re&&Oe.process,Be=function(){try{var t=ze&&ze.require&&ze.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch(t){}}(),Ne=Be&&Be.isArrayBuffer,je=Be&&Be.isDate,Ve=Be&&Be.isMap,Ue=Be&&Be.isRegExp,He=Be&&Be.isSet,qe=Be&&Be.isTypedArray;function Ge(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function We(t,e,r,n){for(var i=-1,a=null==t?0:t.length;++i-1}function Ke(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function br(t,e){for(var r=t.length;r--&&sr(e,t[r],0)>-1;);return r}var _r=hr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),wr=hr({"&":"&","<":"<",">":">",'"':""","'":"'"});function kr(t){return"\\"+Se[t]}function Ar(t){return we.test(t)}function Tr(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function Mr(t,e){return function(r){return t(e(r))}}function Er(t,e){for(var r=-1,n=t.length,i=0,a=[];++r",""":'"',"'":"'"});var Pr=function t(e){var r,n=(e=null==e?Pe:Pr.defaults(Pe.Object(),e,Pr.pick(Pe,Ae))).Array,i=e.Date,Kt=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,re=e.RegExp,ne=e.String,ie=e.TypeError,ae=n.prototype,oe=Qt.prototype,se=ee.prototype,le=e["__core-js_shared__"],ue=oe.toString,ce=se.hasOwnProperty,fe=0,he=(r=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",pe=se.toString,de=ue.call(ee),ve=Pe._,ge=re("^"+ue.call(ce).replace(It,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),me=Re?e.Buffer:a,be=e.Symbol,we=e.Uint8Array,Se=me?me.allocUnsafe:a,Oe=Mr(ee.getPrototypeOf,ee),Ie=ee.create,De=se.propertyIsEnumerable,ze=ae.splice,Fe=be?be.isConcatSpreadable:a,Be=be?be.iterator:a,ir=be?be.toStringTag:a,hr=function(){try{var t=Ba(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Dr=e.clearTimeout!==Pe.clearTimeout&&e.clearTimeout,zr=i&&i.now!==Pe.Date.now&&i.now,Rr=e.setTimeout!==Pe.setTimeout&&e.setTimeout,Fr=te.ceil,Br=te.floor,Nr=ee.getOwnPropertySymbols,jr=me?me.isBuffer:a,Vr=e.isFinite,Ur=ae.join,Hr=Mr(ee.keys,ee),qr=te.max,Gr=te.min,Wr=i.now,Yr=e.parseInt,Xr=te.random,Zr=ae.reverse,$r=Ba(e,"DataView"),Jr=Ba(e,"Map"),Kr=Ba(e,"Promise"),Qr=Ba(e,"Set"),tn=Ba(e,"WeakMap"),en=Ba(ee,"create"),rn=tn&&new tn,nn={},an=co($r),on=co(Jr),sn=co(Kr),ln=co(Qr),un=co(tn),cn=be?be.prototype:a,fn=cn?cn.valueOf:a,hn=cn?cn.toString:a;function pn(t){if(Ss(t)&&!ms(t)&&!(t instanceof mn)){if(t instanceof gn)return t;if(ce.call(t,"__wrapped__"))return fo(t)}return new gn(t)}var dn=function(){function t(){}return function(e){if(!Es(e))return{};if(Ie)return Ie(e);t.prototype=e;var r=new t;return t.prototype=a,r}}();function vn(){}function gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=a}function mn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=F,this.__views__=[]}function yn(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function zn(t,e,r,n,i,o){var s,l=e&h,u=e&p,c=e&d;if(r&&(s=i?r(t,n,i,o):r(t)),s!==a)return s;if(!Es(t))return t;var f=ms(t);if(f){if(s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&ce.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!l)return ra(t,s)}else{var v=Va(t),g=v==X||v==Z;if(_s(t))return $i(t,l);if(v==Q||v==V||g&&!i){if(s=u||g?{}:Ha(t),!l)return u?function(t,e){return na(t,ja(t),e)}(t,function(t,e){return t&&na(e,al(e),t)}(s,t)):function(t,e){return na(t,Na(t),e)}(t,On(s,t))}else{if(!Ee[v])return i?t:{};s=function(t,e,r){var n,i,a,o=t.constructor;switch(e){case lt:return Ji(t);case q:case G:return new o(+t);case ut:return function(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case ct:case ft:case ht:case pt:case dt:case vt:case gt:case mt:case yt:return Ki(t,r);case $:return new o;case J:case nt:return new o(t);case et:return(a=new(i=t).constructor(i.source,Ht.exec(i))).lastIndex=i.lastIndex,a;case rt:return new o;case it:return n=t,fn?ee(fn.call(n)):{}}}(t,v,l)}}o||(o=new wn);var m=o.get(t);if(m)return m;o.set(t,s),Ps(t)?t.forEach(function(n){s.add(zn(n,e,r,n,t,o))}):Cs(t)&&t.forEach(function(n,i){s.set(i,zn(n,e,r,i,t,o))});var y=f?a:(c?u?Oa:La:u?al:il)(t);return Ye(y||t,function(n,i){y&&(n=t[i=n]),Sn(s,i,zn(n,e,r,i,t,o))}),s}function Rn(t,e,r){var n=r.length;if(null==t)return!n;for(t=ee(t);n--;){var i=r[n],o=e[i],s=t[i];if(s===a&&!(i in t)||!o(s))return!1}return!0}function Fn(t,e,r){if("function"!=typeof t)throw new ie(l);return no(function(){t.apply(a,r)},e)}function Bn(t,e,r,n){var i=-1,a=Je,s=!0,l=t.length,u=[],c=e.length;if(!l)return u;r&&(e=Qe(e,gr(r))),n?(a=Ke,s=!1):e.length>=o&&(a=yr,s=!1,e=new _n(e));t:for(;++i-1},xn.prototype.set=function(t,e){var r=this.__data__,n=Cn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bn.prototype.clear=function(){this.size=0,this.__data__={hash:new yn,map:new(Jr||xn),string:new yn}},bn.prototype.delete=function(t){var e=Ra(this,t).delete(t);return this.size-=e?1:0,e},bn.prototype.get=function(t){return Ra(this,t).get(t)},bn.prototype.has=function(t){return Ra(this,t).has(t)},bn.prototype.set=function(t,e){var r=Ra(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},_n.prototype.add=_n.prototype.push=function(t){return this.__data__.set(t,u),this},_n.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.clear=function(){this.__data__=new xn,this.size=0},wn.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},wn.prototype.get=function(t){return this.__data__.get(t)},wn.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.set=function(t,e){var r=this.__data__;if(r instanceof xn){var n=r.__data__;if(!Jr||n.length0&&r(s)?e>1?qn(s,e-1,r,n,i):tr(i,s):n||(i[i.length]=s)}return i}var Gn=sa(),Wn=sa(!0);function Yn(t,e){return t&&Gn(t,e,il)}function Xn(t,e){return t&&Wn(t,e,il)}function Zn(t,e){return $e(e,function(e){return As(t[e])})}function $n(t,e){for(var r=0,n=(e=Wi(e,t)).length;null!=t&&re}function ti(t,e){return null!=t&&ce.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ri(t,e,r){for(var i=r?Ke:Je,o=t[0].length,s=t.length,l=s,u=n(s),c=1/0,f=[];l--;){var h=t[l];l&&e&&(h=Qe(h,gr(e))),c=Gr(h.length,c),u[l]=!r&&(e||o>=120&&h.length>=120)?new _n(l&&h):a}h=t[0];var p=-1,d=u[0];t:for(;++p=s)return l;var u=r[n];return l*("desc"==u?-1:1)}}return t.index-e.index}(t,e,r)})}function yi(t,e,r){for(var n=-1,i=e.length,a={};++n-1;)s!==t&&ze.call(s,l,1),ze.call(t,l,1);return t}function bi(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==a){var a=i;Ga(i)?ze.call(t,i,1):Bi(t,i)}}return t}function _i(t,e){return t+Br(Xr()*(e-t+1))}function wi(t,e){var r="";if(!t||e<1||e>D)return r;do{e%2&&(r+=t),(e=Br(e/2))&&(t+=t)}while(e);return r}function ki(t,e){return io(Qa(t,e,Ll),t+"")}function Ai(t){return An(pl(t))}function Ti(t,e){var r=pl(t);return so(r,Dn(e,0,r.length))}function Mi(t,e,r,n){if(!Es(t))return t;for(var i=-1,o=(e=Wi(e,t)).length,s=o-1,l=t;null!=l&&++ia?0:a+e),(r=r>a?a:r)<0&&(r+=a),a=e>r?0:r-e>>>0,e>>>=0;for(var o=n(a);++i>>1,o=t[a];null!==o&&!zs(o)&&(r?o<=e:o=o){var c=e?null:wa(t);if(c)return Sr(c);s=!1,i=yr,u=new _n}else u=e?[]:l;t:for(;++n=n?t:Li(t,e,r)}var Zi=Dr||function(t){return Pe.clearTimeout(t)};function $i(t,e){if(e)return t.slice();var r=t.length,n=Se?Se(r):new t.constructor(r);return t.copy(n),n}function Ji(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}function Ki(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Qi(t,e){if(t!==e){var r=t!==a,n=null===t,i=t==t,o=zs(t),s=e!==a,l=null===e,u=e==e,c=zs(e);if(!l&&!c&&!o&&t>e||o&&s&&u&&!l&&!c||n&&s&&u||!r&&u||!i)return 1;if(!n&&!o&&!c&&t1?r[i-1]:a,s=i>2?r[2]:a;for(o=t.length>3&&"function"==typeof o?(i--,o):a,s&&Wa(r[0],r[1],s)&&(o=i<3?a:o,i=1),e=ee(e);++n-1?i[o?e[s]:s]:a}}function ha(t){return Ca(function(e){var r=e.length,n=r,i=gn.prototype.thru;for(t&&e.reverse();n--;){var o=e[n];if("function"!=typeof o)throw new ie(l);if(i&&!s&&"wrapper"==Pa(o))var s=new gn([],!0)}for(n=s?n:r;++n1&&b.reverse(),h&&cl))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var f=-1,h=!0,p=r&g?new _n:a;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Ft,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Ye(j,function(r){var n="_."+r[0];e&r[1]&&!Je(t,n)&&t.push(n)}),t.sort()}(function(t){var e=t.match(Bt);return e?e[1].split(Nt):[]}(n),r)))}function oo(t){var e=0,r=0;return function(){var n=Wr(),i=L-(n-r);if(r=n,i>0){if(++e>=C)return arguments[0]}else e=0;return t.apply(a,arguments)}}function so(t,e){var r=-1,n=t.length,i=n-1;for(e=e===a?n:e;++r1?t[e-1]:a;return r="function"==typeof r?(t.pop(),r):a,Io(t,r)});function No(t){var e=pn(t);return e.__chain__=!0,e}function jo(t,e){return e(t)}var Vo=Ca(function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,i=function(e){return Pn(e,t)};return!(e>1||this.__actions__.length)&&n instanceof mn&&Ga(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:jo,args:[i],thisArg:a}),new gn(n,this.__chain__).thru(function(t){return e&&!t.length&&t.push(a),t})):this.thru(i)});var Uo=ia(function(t,e,r){ce.call(t,r)?++t[r]:In(t,r,1)});var Ho=fa(go),qo=fa(mo);function Go(t,e){return(ms(t)?Ye:Nn)(t,za(e,3))}function Wo(t,e){return(ms(t)?Xe:jn)(t,za(e,3))}var Yo=ia(function(t,e,r){ce.call(t,r)?t[r].push(e):In(t,r,[e])});var Xo=ki(function(t,e,r){var i=-1,a="function"==typeof e,o=xs(t)?n(t.length):[];return Nn(t,function(t){o[++i]=a?Ge(e,t,r):ni(t,e,r)}),o}),Zo=ia(function(t,e,r){In(t,r,e)});function $o(t,e){return(ms(t)?Qe:hi)(t,za(e,3))}var Jo=ia(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});var Ko=ki(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Wa(t,e[0],e[1])?e=[]:r>2&&Wa(e[0],e[1],e[2])&&(e=[e[0]]),mi(t,qn(e,1),[])}),Qo=zr||function(){return Pe.Date.now()};function ts(t,e,r){return e=r?a:e,e=t&&null==e?t.length:e,Aa(t,A,a,a,a,a,e)}function es(t,e){var r;if("function"!=typeof e)throw new ie(l);return t=Vs(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=a),r}}var rs=ki(function(t,e,r){var n=m;if(r.length){var i=Er(r,Da(rs));n|=w}return Aa(t,n,e,r,i)}),ns=ki(function(t,e,r){var n=m|y;if(r.length){var i=Er(r,Da(ns));n|=w}return Aa(e,n,t,r,i)});function is(t,e,r){var n,i,o,s,u,c,f=0,h=!1,p=!1,d=!0;if("function"!=typeof t)throw new ie(l);function v(e){var r=n,o=i;return n=i=a,f=e,s=t.apply(o,r)}function g(t){var r=t-c;return c===a||r>=e||r<0||p&&t-f>=o}function m(){var t=Qo();if(g(t))return y(t);u=no(m,function(t){var r=e-(t-c);return p?Gr(r,o-(t-f)):r}(t))}function y(t){return u=a,d&&n?v(t):(n=i=a,s)}function x(){var t=Qo(),r=g(t);if(n=arguments,i=this,c=t,r){if(u===a)return function(t){return f=t,u=no(m,e),h?v(t):s}(c);if(p)return Zi(u),u=no(m,e),v(c)}return u===a&&(u=no(m,e)),s}return e=Hs(e)||0,Es(r)&&(h=!!r.leading,o=(p="maxWait"in r)?qr(Hs(r.maxWait)||0,e):o,d="trailing"in r?!!r.trailing:d),x.cancel=function(){u!==a&&Zi(u),f=0,n=c=i=u=a},x.flush=function(){return u===a?s:y(Qo())},x}var as=ki(function(t,e){return Fn(t,1,e)}),os=ki(function(t,e,r){return Fn(t,Hs(e)||0,r)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(l);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(ss.Cache||bn),r}function ls(t){if("function"!=typeof t)throw new ie(l);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=bn;var us=Yi(function(t,e){var r=(e=1==e.length&&ms(e[0])?Qe(e[0],gr(za())):Qe(qn(e,1),gr(za()))).length;return ki(function(n){for(var i=-1,a=Gr(n.length,r);++i=e}),gs=ii(function(){return arguments}())?ii:function(t){return Ss(t)&&ce.call(t,"callee")&&!De.call(t,"callee")},ms=n.isArray,ys=Ne?gr(Ne):function(t){return Ss(t)&&Kn(t)==lt};function xs(t){return null!=t&&Ms(t.length)&&!As(t)}function bs(t){return Ss(t)&&xs(t)}var _s=jr||Hl,ws=je?gr(je):function(t){return Ss(t)&&Kn(t)==G};function ks(t){if(!Ss(t))return!1;var e=Kn(t);return e==Y||e==W||"string"==typeof t.message&&"string"==typeof t.name&&!Os(t)}function As(t){if(!Es(t))return!1;var e=Kn(t);return e==X||e==Z||e==H||e==tt}function Ts(t){return"number"==typeof t&&t==Vs(t)}function Ms(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=D}function Es(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ss(t){return null!=t&&"object"==typeof t}var Cs=Ve?gr(Ve):function(t){return Ss(t)&&Va(t)==$};function Ls(t){return"number"==typeof t||Ss(t)&&Kn(t)==J}function Os(t){if(!Ss(t)||Kn(t)!=Q)return!1;var e=Oe(t);if(null===e)return!0;var r=ce.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ue.call(r)==de}var Is=Ue?gr(Ue):function(t){return Ss(t)&&Kn(t)==et};var Ps=He?gr(He):function(t){return Ss(t)&&Va(t)==rt};function Ds(t){return"string"==typeof t||!ms(t)&&Ss(t)&&Kn(t)==nt}function zs(t){return"symbol"==typeof t||Ss(t)&&Kn(t)==it}var Rs=qe?gr(qe):function(t){return Ss(t)&&Ms(t.length)&&!!Me[Kn(t)]};var Fs=xa(fi),Bs=xa(function(t,e){return t<=e});function Ns(t){if(!t)return[];if(xs(t))return Ds(t)?Or(t):ra(t);if(Be&&t[Be])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Be]());var e=Va(t);return(e==$?Tr:e==rt?Sr:pl)(t)}function js(t){return t?(t=Hs(t))===P||t===-P?(t<0?-1:1)*z:t==t?t:0:0===t?t:0}function Vs(t){var e=js(t),r=e%1;return e==e?r?e-r:e:0}function Us(t){return t?Dn(Vs(t),0,F):0}function Hs(t){if("number"==typeof t)return t;if(zs(t))return R;if(Es(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Es(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Dt,"");var r=Gt.test(t);return r||Yt.test(t)?Le(t.slice(2),r?2:8):qt.test(t)?R:+t}function qs(t){return na(t,al(t))}function Gs(t){return null==t?"":Ri(t)}var Ws=aa(function(t,e){if($a(e)||xs(e))na(e,il(e),t);else for(var r in e)ce.call(e,r)&&Sn(t,r,e[r])}),Ys=aa(function(t,e){na(e,al(e),t)}),Xs=aa(function(t,e,r,n){na(e,al(e),t,n)}),Zs=aa(function(t,e,r,n){na(e,il(e),t,n)}),$s=Ca(Pn);var Js=ki(function(t,e){t=ee(t);var r=-1,n=e.length,i=n>2?e[2]:a;for(i&&Wa(e[0],e[1],i)&&(n=1);++r1),e}),na(t,Oa(t),r),n&&(r=zn(r,h|p|d,Ea));for(var i=e.length;i--;)Bi(r,e[i]);return r});var ul=Ca(function(t,e){return null==t?{}:function(t,e){return yi(t,e,function(e,r){return tl(t,r)})}(t,e)});function cl(t,e){if(null==t)return{};var r=Qe(Oa(t),function(t){return[t]});return e=za(e),yi(t,r,function(t,r){return e(t,r[0])})}var fl=ka(il),hl=ka(al);function pl(t){return null==t?[]:mr(t,il(t))}var dl=ua(function(t,e,r){return e=e.toLowerCase(),t+(r?vl(e):e)});function vl(t){return kl(Gs(t).toLowerCase())}function gl(t){return(t=Gs(t))&&t.replace(Zt,_r).replace(xe,"")}var ml=ua(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),yl=ua(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),xl=la("toLowerCase");var bl=ua(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});var _l=ua(function(t,e,r){return t+(r?" ":"")+kl(e)});var wl=ua(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),kl=la("toUpperCase");function Al(t,e,r){return t=Gs(t),(e=r?a:e)===a?function(t){return ke.test(t)}(t)?function(t){return t.match(_e)||[]}(t):function(t){return t.match(jt)||[]}(t):t.match(e)||[]}var Tl=ki(function(t,e){try{return Ge(t,a,e)}catch(t){return ks(t)?t:new Kt(t)}}),Ml=Ca(function(t,e){return Ye(e,function(e){e=uo(e),In(t,e,rs(t[e],t))}),t});function El(t){return function(){return t}}var Sl=ha(),Cl=ha(!0);function Ll(t){return t}function Ol(t){return li("function"==typeof t?t:zn(t,h))}var Il=ki(function(t,e){return function(r){return ni(r,t,e)}}),Pl=ki(function(t,e){return function(r){return ni(t,r,e)}});function Dl(t,e,r){var n=il(e),i=Zn(e,n);null!=r||Es(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Zn(e,il(e)));var a=!(Es(r)&&"chain"in r&&!r.chain),o=As(t);return Ye(i,function(r){var n=e[r];t[r]=n,o&&(t.prototype[r]=function(){var e=this.__chain__;if(a||e){var r=t(this.__wrapped__);return(r.__actions__=ra(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,tr([this.value()],arguments))})}),t}function zl(){}var Rl=ga(Qe),Fl=ga(Ze),Bl=ga(nr);function Nl(t){return Ya(t)?fr(uo(t)):function(t){return function(e){return $n(e,t)}}(t)}var jl=ya(),Vl=ya(!0);function Ul(){return[]}function Hl(){return!1}var ql=va(function(t,e){return t+e},0),Gl=_a("ceil"),Wl=va(function(t,e){return t/e},1),Yl=_a("floor");var Xl,Zl=va(function(t,e){return t*e},1),$l=_a("round"),Jl=va(function(t,e){return t-e},0);return pn.after=function(t,e){if("function"!=typeof e)throw new ie(l);return t=Vs(t),function(){if(--t<1)return e.apply(this,arguments)}},pn.ary=ts,pn.assign=Ws,pn.assignIn=Ys,pn.assignInWith=Xs,pn.assignWith=Zs,pn.at=$s,pn.before=es,pn.bind=rs,pn.bindAll=Ml,pn.bindKey=ns,pn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ms(t)?t:[t]},pn.chain=No,pn.chunk=function(t,e,r){e=(r?Wa(t,e,r):e===a)?1:qr(Vs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,l=n(Fr(i/e));oi?0:i+r),(n=n===a||n>i?i:Vs(n))<0&&(n+=i),n=r>n?0:Us(n);r>>0)?(t=Gs(t))&&("string"==typeof e||null!=e&&!Is(e))&&!(e=Ri(e))&&Ar(t)?Xi(Or(t),0,r):t.split(e,r):[]},pn.spread=function(t,e){if("function"!=typeof t)throw new ie(l);return e=null==e?0:qr(Vs(e),0),ki(function(r){var n=r[e],i=Xi(r,0,e);return n&&tr(i,n),Ge(t,this,i)})},pn.tail=function(t){var e=null==t?0:t.length;return e?Li(t,1,e):[]},pn.take=function(t,e,r){return t&&t.length?Li(t,0,(e=r||e===a?1:Vs(e))<0?0:e):[]},pn.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?Li(t,(e=n-(e=r||e===a?1:Vs(e)))<0?0:e,n):[]},pn.takeRightWhile=function(t,e){return t&&t.length?ji(t,za(e,3),!1,!0):[]},pn.takeWhile=function(t,e){return t&&t.length?ji(t,za(e,3)):[]},pn.tap=function(t,e){return e(t),t},pn.throttle=function(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new ie(l);return Es(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),is(t,e,{leading:n,maxWait:e,trailing:i})},pn.thru=jo,pn.toArray=Ns,pn.toPairs=fl,pn.toPairsIn=hl,pn.toPath=function(t){return ms(t)?Qe(t,uo):zs(t)?[t]:ra(lo(Gs(t)))},pn.toPlainObject=qs,pn.transform=function(t,e,r){var n=ms(t),i=n||_s(t)||Rs(t);if(e=za(e,4),null==r){var a=t&&t.constructor;r=i?n?new a:[]:Es(t)&&As(a)?dn(Oe(t)):{}}return(i?Ye:Yn)(t,function(t,n,i){return e(r,t,n,i)}),r},pn.unary=function(t){return ts(t,1)},pn.union=So,pn.unionBy=Co,pn.unionWith=Lo,pn.uniq=function(t){return t&&t.length?Fi(t):[]},pn.uniqBy=function(t,e){return t&&t.length?Fi(t,za(e,2)):[]},pn.uniqWith=function(t,e){return e="function"==typeof e?e:a,t&&t.length?Fi(t,a,e):[]},pn.unset=function(t,e){return null==t||Bi(t,e)},pn.unzip=Oo,pn.unzipWith=Io,pn.update=function(t,e,r){return null==t?t:Ni(t,e,Gi(r))},pn.updateWith=function(t,e,r,n){return n="function"==typeof n?n:a,null==t?t:Ni(t,e,Gi(r),n)},pn.values=pl,pn.valuesIn=function(t){return null==t?[]:mr(t,al(t))},pn.without=Po,pn.words=Al,pn.wrap=function(t,e){return cs(Gi(e),t)},pn.xor=Do,pn.xorBy=zo,pn.xorWith=Ro,pn.zip=Fo,pn.zipObject=function(t,e){return Hi(t||[],e||[],Sn)},pn.zipObjectDeep=function(t,e){return Hi(t||[],e||[],Mi)},pn.zipWith=Bo,pn.entries=fl,pn.entriesIn=hl,pn.extend=Ys,pn.extendWith=Xs,Dl(pn,pn),pn.add=ql,pn.attempt=Tl,pn.camelCase=dl,pn.capitalize=vl,pn.ceil=Gl,pn.clamp=function(t,e,r){return r===a&&(r=e,e=a),r!==a&&(r=(r=Hs(r))==r?r:0),e!==a&&(e=(e=Hs(e))==e?e:0),Dn(Hs(t),e,r)},pn.clone=function(t){return zn(t,d)},pn.cloneDeep=function(t){return zn(t,h|d)},pn.cloneDeepWith=function(t,e){return zn(t,h|d,e="function"==typeof e?e:a)},pn.cloneWith=function(t,e){return zn(t,d,e="function"==typeof e?e:a)},pn.conformsTo=function(t,e){return null==e||Rn(t,e,il(e))},pn.deburr=gl,pn.defaultTo=function(t,e){return null==t||t!=t?e:t},pn.divide=Wl,pn.endsWith=function(t,e,r){t=Gs(t),e=Ri(e);var n=t.length,i=r=r===a?n:Dn(Vs(r),0,n);return(r-=e.length)>=0&&t.slice(r,i)==e},pn.eq=ps,pn.escape=function(t){return(t=Gs(t))&&Tt.test(t)?t.replace(kt,wr):t},pn.escapeRegExp=function(t){return(t=Gs(t))&&Pt.test(t)?t.replace(It,"\\$&"):t},pn.every=function(t,e,r){var n=ms(t)?Ze:Vn;return r&&Wa(t,e,r)&&(e=a),n(t,za(e,3))},pn.find=Ho,pn.findIndex=go,pn.findKey=function(t,e){return ar(t,za(e,3),Yn)},pn.findLast=qo,pn.findLastIndex=mo,pn.findLastKey=function(t,e){return ar(t,za(e,3),Xn)},pn.floor=Yl,pn.forEach=Go,pn.forEachRight=Wo,pn.forIn=function(t,e){return null==t?t:Gn(t,za(e,3),al)},pn.forInRight=function(t,e){return null==t?t:Wn(t,za(e,3),al)},pn.forOwn=function(t,e){return t&&Yn(t,za(e,3))},pn.forOwnRight=function(t,e){return t&&Xn(t,za(e,3))},pn.get=Qs,pn.gt=ds,pn.gte=vs,pn.has=function(t,e){return null!=t&&Ua(t,e,ti)},pn.hasIn=tl,pn.head=xo,pn.identity=Ll,pn.includes=function(t,e,r,n){t=xs(t)?t:pl(t),r=r&&!n?Vs(r):0;var i=t.length;return r<0&&(r=qr(i+r,0)),Ds(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&sr(t,e,r)>-1},pn.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:Vs(r);return i<0&&(i=qr(n+i,0)),sr(t,e,i)},pn.inRange=function(t,e,r){return e=js(e),r===a?(r=e,e=0):r=js(r),function(t,e,r){return t>=Gr(e,r)&&t=-D&&t<=D},pn.isSet=Ps,pn.isString=Ds,pn.isSymbol=zs,pn.isTypedArray=Rs,pn.isUndefined=function(t){return t===a},pn.isWeakMap=function(t){return Ss(t)&&Va(t)==ot},pn.isWeakSet=function(t){return Ss(t)&&Kn(t)==st},pn.join=function(t,e){return null==t?"":Ur.call(t,e)},pn.kebabCase=ml,pn.last=ko,pn.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=n;return r!==a&&(i=(i=Vs(r))<0?qr(n+i,0):Gr(i,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,i):or(t,ur,i,!0)},pn.lowerCase=yl,pn.lowerFirst=xl,pn.lt=Fs,pn.lte=Bs,pn.max=function(t){return t&&t.length?Un(t,Ll,Qn):a},pn.maxBy=function(t,e){return t&&t.length?Un(t,za(e,2),Qn):a},pn.mean=function(t){return cr(t,Ll)},pn.meanBy=function(t,e){return cr(t,za(e,2))},pn.min=function(t){return t&&t.length?Un(t,Ll,fi):a},pn.minBy=function(t,e){return t&&t.length?Un(t,za(e,2),fi):a},pn.stubArray=Ul,pn.stubFalse=Hl,pn.stubObject=function(){return{}},pn.stubString=function(){return""},pn.stubTrue=function(){return!0},pn.multiply=Zl,pn.nth=function(t,e){return t&&t.length?gi(t,Vs(e)):a},pn.noConflict=function(){return Pe._===this&&(Pe._=ve),this},pn.noop=zl,pn.now=Qo,pn.pad=function(t,e,r){t=Gs(t);var n=(e=Vs(e))?Lr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return ma(Br(i),r)+t+ma(Fr(i),r)},pn.padEnd=function(t,e,r){t=Gs(t);var n=(e=Vs(e))?Lr(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var i=Xr();return Gr(t+i*(e-t+Ce("1e-"+((i+"").length-1))),e)}return _i(t,e)},pn.reduce=function(t,e,r){var n=ms(t)?er:pr,i=arguments.length<3;return n(t,za(e,4),r,i,Nn)},pn.reduceRight=function(t,e,r){var n=ms(t)?rr:pr,i=arguments.length<3;return n(t,za(e,4),r,i,jn)},pn.repeat=function(t,e,r){return e=(r?Wa(t,e,r):e===a)?1:Vs(e),wi(Gs(t),e)},pn.replace=function(){var t=arguments,e=Gs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},pn.result=function(t,e,r){var n=-1,i=(e=Wi(e,t)).length;for(i||(i=1,t=a);++nD)return[];var r=F,n=Gr(t,F);e=za(e),t-=F;for(var i=vr(n,e);++r=o)return t;var l=r-Lr(n);if(l<1)return n;var u=s?Xi(s,0,l).join(""):t.slice(0,l);if(i===a)return u+n;if(s&&(l+=u.length-l),Is(i)){if(t.slice(l).search(i)){var c,f=u;for(i.global||(i=re(i.source,Gs(Ht.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var h=c.index;u=u.slice(0,h===a?l:h)}}else if(t.indexOf(Ri(i),l)!=l){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+n},pn.unescape=function(t){return(t=Gs(t))&&At.test(t)?t.replace(wt,Ir):t},pn.uniqueId=function(t){var e=++fe;return Gs(t)+e},pn.upperCase=wl,pn.upperFirst=kl,pn.each=Go,pn.eachRight=Wo,pn.first=xo,Dl(pn,(Xl={},Yn(pn,function(t,e){ce.call(pn.prototype,e)||(Xl[e]=t)}),Xl),{chain:!1}),pn.VERSION="4.17.15",Ye(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){pn[t].placeholder=pn}),Ye(["drop","take"],function(t,e){mn.prototype[t]=function(r){r=r===a?1:qr(Vs(r),0);var n=this.__filtered__&&!e?new mn(this):this.clone();return n.__filtered__?n.__takeCount__=Gr(r,n.__takeCount__):n.__views__.push({size:Gr(r,F),type:t+(n.__dir__<0?"Right":"")}),n},mn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Ye(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==O||3==r;mn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:za(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}}),Ye(["head","last"],function(t,e){var r="take"+(e?"Right":"");mn.prototype[t]=function(){return this[r](1).value()[0]}}),Ye(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");mn.prototype[t]=function(){return this.__filtered__?new mn(this):this[r](1)}}),mn.prototype.compact=function(){return this.filter(Ll)},mn.prototype.find=function(t){return this.filter(t).head()},mn.prototype.findLast=function(t){return this.reverse().find(t)},mn.prototype.invokeMap=ki(function(t,e){return"function"==typeof t?new mn(this):this.map(function(r){return ni(r,t,e)})}),mn.prototype.reject=function(t){return this.filter(ls(za(t)))},mn.prototype.slice=function(t,e){t=Vs(t);var r=this;return r.__filtered__&&(t>0||e<0)?new mn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==a&&(r=(e=Vs(e))<0?r.dropRight(-e):r.take(e-t)),r)},mn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},mn.prototype.toArray=function(){return this.take(F)},Yn(mn.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),i=pn[n?"take"+("last"==e?"Right":""):e],o=n||/^find/.test(e);i&&(pn.prototype[e]=function(){var e=this.__wrapped__,s=n?[1]:arguments,l=e instanceof mn,u=s[0],c=l||ms(e),f=function(t){var e=i.apply(pn,tr([t],s));return n&&h?e[0]:e};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var h=this.__chain__,p=!!this.__actions__.length,d=o&&!h,v=l&&!p;if(!o&&c){e=v?e:new mn(this);var g=t.apply(e,s);return g.__actions__.push({func:jo,args:[f],thisArg:a}),new gn(g,h)}return d&&v?t.apply(this,s):(g=this.thru(f),d?n?g.value()[0]:g.value():g)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(t){var e=ae[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);pn.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(ms(i)?i:[],t)}return this[r](function(r){return e.apply(ms(r)?r:[],t)})}}),Yn(mn.prototype,function(t,e){var r=pn[e];if(r){var n=r.name+"";ce.call(nn,n)||(nn[n]=[]),nn[n].push({name:e,func:r})}}),nn[pa(a,y).name]=[{name:"wrapper",func:a}],mn.prototype.clone=function(){var t=new mn(this.__wrapped__);return t.__actions__=ra(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ra(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ra(this.__views__),t},mn.prototype.reverse=function(){if(this.__filtered__){var t=new mn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},mn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=ms(t),n=e<0,i=r?t.length:0,a=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:t,value:t?a:this.__values__[this.__index__++]}},pn.prototype.plant=function(t){for(var e,r=this;r instanceof vn;){var n=fo(r);n.__index__=0,n.__values__=a,e?i.__wrapped__=n:e=n;var i=n;r=r.__wrapped__}return i.__wrapped__=t,e},pn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof mn){var e=t;return this.__actions__.length&&(e=new mn(this)),(e=e.reverse()).__actions__.push({func:jo,args:[Eo],thisArg:a}),new gn(e,this.__chain__)}return this.thru(Eo)},pn.prototype.toJSON=pn.prototype.valueOf=pn.prototype.value=function(){return Vi(this.__wrapped__,this.__actions__)},pn.prototype.first=pn.prototype.head,Be&&(pn.prototype[Be]=function(){return this}),pn}();Pe._=Pr,(i=function(){return Pr}.call(e,r,e,n))===a||(n.exports=i)}).call(this)}).call(this,r(45),r(52)(t))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i=r(53),a={};e.default=a,a.read=function(t,e){var r,n=(r=this,function(t,n,i){return a._onRetrieval(t,i,e,r)});return void 0===e?new Promise(function(r,a){e=function(t,e){t?a(t):r(e)},i(t,n)}):i(t,n)},a._onRetrieval=function(t,e,r,n){var i=void 0;return void 0!==t&&(i=n.parse(e)),r.call(n,t,i)},a.extend=function(t,e){return extend(a,t,e)},a.mixin=function(t){return"object"!==(void 0===t?"undefined":n(t))&&(t=t.prototype),["read"].forEach(function(e){t[e]=a[e]},this),t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(r(69)),i=a(r(70));function a(t){return t&&t.__esModule?t:{default:t}}var o=(0,n.default)(i.default);e.default=o,t.exports=e.default},function(t,e,r){"use strict";var n=r(78);t.exports=Function.prototype.bind||n},function(t,e,r){"use strict";var n=Function.prototype.toString,i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},o=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(s)return function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(a(t))return!1;var e=o.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={};e.default=n,n.getMeta=function(t){var e,r,n=!1,i=!1,a={},o={},s=t.split(" ");if(s.length>=1?(n=s.shift(),i=s.join(" ")):n=t,n){var l=n.split("|");for(e=l.pop(),o.en=e;0!=l.length;){var u=l.shift(),c=l.shift();a[u]=c}}else e=n;if(i){var f=i.split("=");if(f.length>1){var h,p;f.length;f.forEach(function(t){var e,n=(t=t.trim()).split(" ");if(n.length>1?(p=n.pop(),e=n.join(" ")):e=t,h){var i=h.toLowerCase();o[i]=e}else r=e;h=p})}else r=f.shift()}var d={name:e,ids:a,details:o};return r&&(d.desc=r),d};var i={sp:{link:"http://www.uniprot.org/%s",name:"Uniprot"},tr:{link:"http://www.uniprot.org/%s",name:"Trembl"},gb:{link:"http://www.ncbi.nlm.nih.gov/nuccore/%s",name:"Genbank"},pdb:{link:"http://www.rcsb.org/pdb/explore/explore.do?structureId=%s",name:"PDB"}};n.buildLinks=function(t){var e={};return t=t||{},Object.keys(t).forEach(function(r){if(r in i){var n=i[r],a=n.link.replace("%s",t[r]);e[n.name]=a}}),e},n.contains=function(t,e){return-1!=="".indexOf.call(t,e,0)},n.splitNChars=function(t,e){var r,n;e=e||80;var i=[];for(r=0,n=t.length-1;r<=n;r+=e)i.push(t.substr(r,e));return i},n.reverse=function(t){return t.split("").reverse().join("")},n.complement=function(t){var e=t+"",r=[[/g/g,"0"],[/c/g,"1"],[/0/g,"c"],[/1/g,"g"],[/G/g,"0"],[/C/g,"1"],[/0/g,"C"],[/1/g,"G"],[/a/g,"0"],[/t/g,"1"],[/0/g,"t"],[/1/g,"a"],[/A/g,"0"],[/T/g,"1"],[/0/g,"T"],[/1/g,"A"]];for(var n in r)e=e.replace(r[n][0],r[n][1]);return e},n.reverseComplement=function(t){return n.reverse(n.complement(t))},n.model=function(t,e,r){this.seq=t,this.name=e,this.id=r,this.ids={}}},function(t,e,r){"use strict";function n(t){return(n="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})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}(r(1)),a=h(r(0)),o=h(r(44)),s=h(r(47)),l=r(71),u=r(58),c=r(59),f=r(101);function h(t){return t&&t.__esModule?t:{default:t}}function p(t){return(p="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)})(t)}function d(){return(d=Object.assign||function(t){for(var e=1;eJ&&(J=e):e=(0,u.getConservation)(t),e}),Z="entropy"===x?Z.map(function(t){return 1-t/J}):Z.map(function(t){return t/P})),_&&($=I.map(function(t){return o.default.countBy(t)["-"]/P})),b)for(var K=0;KBar weights",titlefont:{size:12},showgrid:!1,zeroline:!1,domain:[.75,1]}):3===h?(S.yaxis.domain=[0,.64],S.yaxis2={title:"Conservation",titlefont:{size:12},showgrid:!1,zeroline:!1,domain:[.65,.89]},S.yaxis3={title:"Gap",titlefont:{size:12},showgrid:!1,zeroline:!1,domain:[.9,1]}):S.yaxis.domain=[0,1],"heatmap"===m?(S.xaxis.rangeslider={autorange:!0},S.xaxis.tick0=x,S.xaxis.dtick=b,S.margin={t:20,r:20,b:20}):"slider"===m?S.sliders=[{currentvalue:{prefix:"Position ",suffix:""},steps:a}]:(S.xaxis.tick0=x,S.xaxis.dtick=b,S.margin={t:20,r:20,b:20}),{layout:S,width:e,height:n}}},{key:"componentDidMount",value:function(){var t=this.resetWindowing(this.props),e=t.xStart,r=t.xEnd;this.setState({xStart:e,xEnd:r})}},{key:"componentDidUpdate",value:function(t,e){if(this.props.data!==t.data){var r=this.resetWindowing(this.props),n=r.xStart,i=r.xEnd;this.setState({xStart:n,xEnd:i})}}},{key:"render",value:function(){var t=this.getData(),e=t.data,r=t.length,n=t.count,a=t.labels,o=t.tick,l=t.plotCount,u=this.getLayout({length:r,count:n,labels:a,tick:o,plotCount:l}),c=u.layout,f={style:{width:u.width,height:u.height},useResizeHandler:!0};return i.default.createElement("div",null,i.default.createElement(s.default,d({data:e,layout:c,onClick:this.handleChange,onHover:this.handleChange,onRelayout:this.handleChange},f)))}}])&&g(r.prototype,n),a&&g(r,a),e}();e.default=b,b.propTypes={data:a.default.string,extension:a.default.string,colorscale:a.default.oneOfType([a.default.string,a.default.object]),opacity:a.default.oneOfType([a.default.number,a.default.string]),textcolor:a.default.string,textsize:a.default.oneOfType([a.default.number,a.default.string]),showlabel:a.default.bool,showid:a.default.bool,showconservation:a.default.bool,conservationcolor:a.default.string,conservationcolorscale:a.default.oneOfType([a.default.string,a.default.array]),conservationopacity:a.default.oneOfType([a.default.number,a.default.string]),conservationmethod:a.default.oneOf(["conservation","entropy"]),correctgap:a.default.bool,showgap:a.default.bool,gapcolor:a.default.string,gapcolorscale:a.default.oneOfType([a.default.string,a.default.array]),gapopacity:a.default.oneOfType([a.default.number,a.default.string]),groupbars:a.default.bool,showconsensus:a.default.bool,tilewidth:a.default.number,tileheight:a.default.number,overview:a.default.oneOf(["heatmap","slider","none"]),numtiles:a.default.number,scrollskip:a.default.number,tickstart:a.default.oneOfType([a.default.number,a.default.string]),ticksteps:a.default.oneOfType([a.default.number,a.default.string]),width:a.default.oneOfType([a.default.number,a.default.string]),height:a.default.oneOfType([a.default.number,a.default.string])},b.defaultProps={extension:"fasta",colorscale:"clustal2",opacity:null,textcolor:null,textsize:10,showlabel:!0,showid:!0,showconservation:!0,conservationcolor:null,conservationcolorscale:"Viridis",conservationopacity:null,conservationmethod:"entropy",correctgap:!0,showgap:!0,gapcolor:"grey",gapcolorscale:null,gapopacity:null,groupbars:!1,showconsensus:!0,tilewidth:16,tileheight:16,numtiles:null,overview:"heatmap",scrollskip:10,tickstart:null,ticksteps:null,width:null,height:900}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";var n=r(74),i=r(75),a=r(76),o=r(92);function s(t,e,r){var n=t;return i(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=o(e,{uri:t}),n.callback=r,n}function l(t,e,r){return u(e=s(t,e,r))}function u(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,i){e||(e=!0,t.callback(r,n,i))};function n(t){return clearTimeout(c),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,m)}function i(){if(!s){var e;clearTimeout(c),e=t.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var n=m,i=null;return 0!==e?(n={body:function(){var t=void 0;if(t=u.response?u.response:u.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(u),g)try{t=JSON.parse(t)}catch(t){}return t}(),statusCode:e,method:h,headers:{},url:f,rawRequest:u},u.getAllResponseHeaders&&(n.headers=a(u.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),r(i,n,n.body)}}var o,s,u=t.xhr||null;u||(u=t.cors||t.useXDR?new l.XDomainRequest:new l.XMLHttpRequest);var c,f=u.url=t.uri||t.url,h=u.method=t.method||"GET",p=t.body||t.data,d=u.headers=t.headers||{},v=!!t.sync,g=!1,m={body:void 0,headers:{},statusCode:0,method:h,url:f,rawRequest:u};if("json"in t&&!1!==t.json&&(g=!0,d.accept||d.Accept||(d.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(d["content-type"]||d["Content-Type"]||(d["Content-Type"]="application/json"),p=JSON.stringify(!0===t.json?p:t.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(i,0)},u.onload=i,u.onerror=n,u.onprogress=function(){},u.onabort=function(){s=!0},u.ontimeout=n,u.open(h,f,!v,t.username,t.password),v||(u.withCredentials=!!t.withCredentials),!v&&t.timeout>0&&(c=setTimeout(function(){if(!s){s=!0,u.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)}},t.timeout)),u.setRequestHeader)for(o in d)d.hasOwnProperty(o)&&u.setRequestHeader(o,d[o]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(u.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(u),u.send(p||null),u}t.exports=l,t.exports.default=l,l.XMLHttpRequest=n.XMLHttpRequest||function(){},l.XDomainRequest="withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var r=0;r2?arguments[2]:{},a=n(e);i&&(a=o.call(a,Object.getOwnPropertySymbols(e)));for(var s=0;s0&&(n=(r=t.split(" "))[0],i=r[1].replace(/"/g,""),e[n]=i)}),e}function i(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function a(t,e,r){return 3===t.length?a(t[0],t[1],t[2]):"#"+i(t)+i(e)+i(r)}Object.defineProperty(e,"__esModule",{value:!0}),e.extractKeys=n,e.rgbToHex=a,e.default={extractKeys:n,rgbToHex:a}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getConsensus=e.getConservation=e.getEntropy=void 0;var n,i=(n=r(44))&&n.__esModule?n:{default:n};e.getEntropy=function(t){var e;e=i.default.isString(t)?t.split(""):t;var r={};return e.forEach(function(t){return r[t]?r[t]++:r[t]=1}),Object.keys(r).reduce(function(t,n){var i=r[n]/e.length;return t-i*Math.log(i)},0)};e.getConservation=function(t){var e;return e=i.default.isString(t)?t.split(""):t,(0,i.default)(e).countBy().entries().maxBy("[1]")[1]};e.getConsensus=function(t){return t.map(function(t){return(0,i.default)(t).countBy().entries().maxBy("[1]")[0]})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getVisualizations=e.getTicks=e.getHovertext=e.getWidth=e.SUBPLOT_RATIOS=void 0;var n,i=(n=r(44))&&n.__esModule?n:{default:n};e.SUBPLOT_RATIOS={1:1,2:.75,3:.65};e.getWidth=function(t){return i.default.isNumber(t)?t:t.includes("%")?parseFloat(t)/100*window.innerWidth:parseFloat(t)};e.getHovertext=function(t,e){for(var r=[],n=function(n){var i=[],a=0;t[n].forEach(function(t){a+=1;var r=["Name: ".concat(e[n].name),"Organism: ".concat(e[n].os?e[n].os:"N/A"),"ID: ".concat(e[n].id,"
"),"Position: (".concat(a,", ").concat(n,")"),"Letter: ".concat(t)].join("
");i.push(r)}),r.push(i)},a=0;a=0||(i[r]=t[r]);return i}(e,["children"]);if(delete n.in,delete n.mountOnEnter,delete n.unmountOnExit,delete n.appear,delete n.enter,delete n.exit,delete n.timeout,delete n.addEndListener,delete n.onEnter,delete n.onEntering,delete n.onEntered,delete n.onExit,delete n.onExiting,delete n.onExited,"function"==typeof r)return r(t,n);var a=i.default.Children.only(r);return i.default.cloneElement(a,n)},n}(i.default.Component);function p(){}h.contextTypes={transitionGroup:n.object},h.childContextTypes={transitionGroup:function(){}},h.propTypes={},h.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:p,onEntering:p,onEntered:p,onExit:p,onExiting:p,onExited:p},h.UNMOUNTED=0,h.EXITED=1,h.ENTERING=2,h.ENTERED=3,h.EXITING=4;var d=(0,o.polyfill)(h);e.default=d},function(t,e,r){"use strict";function n(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=t&&this.setState(t)}function i(t){this.setState(function(e){var r=this.constructor.getDerivedStateFromProps(t,e);return null!=r?r:null}.bind(this))}function a(t,e){try{var r=this.props,n=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(r,n)}finally{this.props=r,this.state=n}}function o(t){var e=t.prototype;if(!e||!e.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate)return t;var r=null,o=null,s=null;if("function"==typeof e.componentWillMount?r="componentWillMount":"function"==typeof e.UNSAFE_componentWillMount&&(r="UNSAFE_componentWillMount"),"function"==typeof e.componentWillReceiveProps?o="componentWillReceiveProps":"function"==typeof e.UNSAFE_componentWillReceiveProps&&(o="UNSAFE_componentWillReceiveProps"),"function"==typeof e.componentWillUpdate?s="componentWillUpdate":"function"==typeof e.UNSAFE_componentWillUpdate&&(s="UNSAFE_componentWillUpdate"),null!==r||null!==o||null!==s){var l=t.displayName||t.name,u="function"==typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+l+" uses "+u+" but also contains the following legacy lifecycles:"+(null!==r?"\n "+r:"")+(null!==o?"\n "+o:"")+(null!==s?"\n "+s:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof t.getDerivedStateFromProps&&(e.componentWillMount=n,e.componentWillReceiveProps=i),"function"==typeof e.getSnapshotBeforeUpdate){if("function"!=typeof e.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=a;var c=e.componentDidUpdate;e.componentDidUpdate=function(t,e,r){var n=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:r;c.call(this,t,e,n)}}return t}r.r(e),r.d(e,"polyfill",function(){return o}),n.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},function(t,e,r){"use strict";e.__esModule=!0,e.classNamesShape=e.timeoutsShape=void 0;var n;(n=r(0))&&n.__esModule;e.timeoutsShape=null;e.classNamesShape=null},function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n=s(r(0)),i=s(r(1)),a=r(61),o=r(130);function s(t){return t&&t.__esModule?t:{default:t}}function l(){return(l=Object.assign||function(t){for(var e=1;e=0||(i[r]=t[r]);return i}(t,["component","childFactory"]),a=c(this.state.children).map(r);return delete n.appear,delete n.enter,delete n.exit,null===e?a:i.default.createElement(e,n,a)},n}(i.default.Component);f.childContextTypes={transitionGroup:n.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(t){return t}};var h=(0,a.polyfill)(f);e.default=h,t.exports=e.default},,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AlignmentViewer",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"AlignmentChart",{enumerable:!0,get:function(){return i.default}});var n=a(r(68)),i=a(r(51));function a(t){return t&&t.__esModule?t:{default:t}}},function(t,e,r){"use strict";function n(t){return(n="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})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}(r(1)),a=c(r(0)),o=c(r(51)),s=r(116),l=r(59),u=r(131);function c(t){return t&&t.__esModule?t:{default:t}}function f(t){return(f="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)})(t)}function h(){return(h=Object.assign||function(t){for(var e=1;e=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function d(t,e){for(var r=0;r:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .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:white;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:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},{"../src/lib":703}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},newplotlylogo:{name:"newplotlylogo",svg:"plotly-logomark"}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":1210}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":848}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/barpolar")},{"../src/traces/barpolar":860}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":870}],7:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":578}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":879}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":898}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":912}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":920}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":935}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":946}],14:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":682}],15:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1211}],16:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnel")},{"../src/traces/funnel":958}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnelarea")},{"../src/traces/funnelarea":967}],18:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1212}],19:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":980}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":989}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":1001}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":1007}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":1011}],24:[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("./pie"),t("./sunburst"),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("./sankey"),t("./table"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick"),t("./scatterpolar"),t("./scatterpolargl"),t("./barpolar")]),n.register([t("./aggregate"),t("./filter"),t("./groupby"),t("./sort")]),n.register([t("./calendars")]),e.exports=n},{"./aggregate":3,"./bar":4,"./barpolar":5,"./box":6,"./calendars":7,"./candlestick":8,"./carpet":9,"./choropleth":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./filter":15,"./funnel":16,"./funnelarea":17,"./groupby":18,"./heatmap":19,"./heatmapgl":20,"./histogram":21,"./histogram2d":22,"./histogram2dcontour":23,"./isosurface":25,"./mesh3d":26,"./ohlc":27,"./parcats":28,"./parcoords":29,"./pie":30,"./pointcloud":31,"./sankey":32,"./scatter3d":33,"./scattercarpet":34,"./scattergeo":35,"./scattergl":36,"./scattermapbox":37,"./scatterpolar":38,"./scatterpolargl":39,"./scatterternary":40,"./sort":41,"./splom":42,"./streamtube":43,"./sunburst":44,"./surface":45,"./table":46,"./violin":47,"./volume":48,"./waterfall":49}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":1016}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":1021}],27:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":1026}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcats")},{"../src/traces/parcats":1035}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":1044}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":1055}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":1064}],32:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1070}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1106}],34:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1112}],35:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1119}],36:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":1127}],37:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1133}],38:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1140}],39:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1144}],40:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1150}],41:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1214}],42:[function(t,e,r){"use strict";e.exports=t("../src/traces/splom")},{"../src/traces/splom":1155}],43:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":1160}],44:[function(t,e,r){"use strict";e.exports=t("../src/traces/sunburst")},{"../src/traces/sunburst":1166}],45:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":1175}],46:[function(t,e,r){"use strict";e.exports=t("../src/traces/table")},{"../src/traces/table":1183}],47:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":1191}],48:[function(t,e,r){"use strict";e.exports=t("../src/traces/volume")},{"../src/traces/volume":1199}],49:[function(t,e,r){"use strict";e.exports=t("../src/traces/waterfall")},{"../src/traces/waterfall":1205}],50:[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=i(),h=a();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"),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;na&&(b=a);var o=e.min(i,function(t){return(y-n-(t.length-1)*b)/e.sum(t,c)});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=T;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,c)-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,c)-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(u),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)e=t[i],(r=e.y1+b-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0})}}(a),S(a),a}function S(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 E.update=function(t){return S(t),t},E.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:o(t),E):_},E.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),E):w},E.nodeWidth=function(t){return arguments.length?(x=+t,E):x},E.nodePadding=function(t){return arguments.length?(b=+t,E):b},E.nodes=function(t){return arguments.length?(k="function"==typeof t?t:o(t),E):k},E.links=function(t){return arguments.length?(A="function"==typeof t?t:o(t),E):A},E.size=function(e){return arguments.length?(t=n=0,i=+e[0],y=+e[1],E):[i-t,y-n]},E.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],y=+e[1][1],E):[[t,n],[i,y]]},E.iterations=function(t){return arguments.length?(T=+t,E):T},E},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})},"object"==typeof r&&void 0!==e?i(r,t("d3-array"),t("d3-collection"),t("d3-shape")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3)},{"d3-array":145,"d3-collection":146,"d3-shape":155}],52:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":240,"gl-vao":322,"weak-map":539}],53:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;si&&(i=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;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 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}p.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=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(p.AssertionError,Error),p.fail=m,p.ok=y,p.equal=function(t,e,r){t!=e&&m(t,e,r,"==",p.equal)},p.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",p.notEqual)},p.deepEqual=function(t,e,r){x(t,e,!1)||m(t,e,r,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(t,e,r){x(t,e,!0)||m(t,e,r,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(t,e,r){x(t,e,!1)&&m(t,e,r,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function t(e,r,n){x(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},p.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",p.strictEqual)},p.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",p.notStrictEqual)},p.throws=function(t,e,r){w(!0,t,e,r)},p.doesNotThrow=function(t,e,r){w(!1,t,e,r)},p.ifError=function(t){if(t)throw t},p.strict=n((function t(e,r){e||m(e,!0,r,"==",t)}),p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var k=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":455,"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,r,n){(function(e,r){var a=/%[sdj%]/g;n.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&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(e)?r.showHidden=e:e&&n._extend(r,e),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),u(r,t,r.depth)}function l(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function c(t,e){return t}function u(t,e,r){if(t.customInspect&&e&&k(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(r,t);return m(a)||(a=u(t,a,r)),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")}return v(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}(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(k(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="",T=!1,A=["{","}"];return h(e)&&(T=!0,A=["[","]"]),k(e)&&(b=" [Function"+(e.name?": "+e.name:"")+"]"),x(e)&&(b=" "+RegExp.prototype.toString.call(e)),_(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+f(e)),0!==o.length||T&&0!=e.length?r<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=T?function(t,e,r,n,a){for(var i=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]: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 p(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)?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")),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 h(t){return Array.isArray(t)}function d(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 x(t){return b(t)&&"[object RegExp]"===T(t)}function b(t){return"object"==typeof t&&null!==t}function _(t){return b(t)&&"[object Date]"===T(t)}function w(t){return b(t)&&("[object Error]"===T(t)||t instanceof Error)}function k(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}n.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 r=e.pid;o[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else o[t]=function(){};return o[t]},n.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"},n.isArray=h,n.isBoolean=d,n.isNull=g,n.isNullOrUndefined=function(t){return null==t},n.isNumber=v,n.isString=m,n.isSymbol=function(t){return"symbol"==typeof t},n.isUndefined=y,n.isRegExp=x,n.isObject=b,n.isDate=_,n.isError=w,n.isFunction=k,n.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},n.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=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),M[t.getMonth()],e].join(" ")}function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.log=function(){console.log("%s - %s",E(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._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,t("_process"),void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":71,_process:483,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,i=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;return 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),l},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,s=r-a;os?s:o+16383));return 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]+"=")),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},{}],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"),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 c,u,f=0;if(a(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[i(0),i(1)];if(e===Math.floor(e))c=i(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;c=i(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(a(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=i(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;u=i(r)}else u=i(1);return f>0?c=c.ushln(f):f<0&&(u=u.ushln(-f)),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":95}],82:[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?52:r+32}},{"bit-twiddle":93,"double-bits":168}],84:[function(t,e,r){"use strict";t("bn.js"),e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":95}],85:[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":95,"double-bits":168}],86:[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);return o.cmpn(1)?[t.div(o),e.div(o)]:[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":95}],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"),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,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=a(s)+4,f=n(l.ushln(u).divRound(r));return c*(s+f*Math.pow(2,-u))}var p=r.bitLength()-l.bitLength()+53;return f=n(l.ushln(p).divRound(r)),p<1023?c*f*Math.pow(2,-p):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-p))}},{"./lib/bn-to-num":82,"./lib/ctz":83}],92:[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)}},{}],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,1+(t|=t>>>16)},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}},{}],94:[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,p,h,d,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,u=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(p=t).getContext("2d"),r=p.width,o=p.height,h=f.getImageData(0,0,r,o),l=h.data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(p=t.canvas,f=t,r=p.width,o=p.height,h=f.getImageData(0,0,r,o),l=h.data,u=4):window.ImageData&&t instanceof window.ImageData&&(h=t,r=t.width,o=t.height,l=h.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 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,c=0,u=r;u1&&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 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 p(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 c=1;c>>26,f=67108863&l,p=Math.min(c,e.length-1),h=Math.max(0,c-t.length+1);h<=p;h++){var d=c-h|0;u+=(o=(a=0|t.words[d])*(i=0|e.words[h])+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()}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?c[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 p=u[t],h=f[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var g=d.modn(h).toString(t);r=(d=d.idivn(h)).isZero()?g+r:c[p-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,c=new t(i),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},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,h=0|o[1],d=8191&h,g=h>>>13,v=0|o[2],m=8191&v,y=v>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],k=8191&w,T=w>>>13,A=0|o[5],M=8191&A,E=A>>>13,S=0|o[6],C=8191&S,L=S>>>13,O=0|o[7],P=8191&O,I=O>>>13,D=0|o[8],z=8191&D,R=D>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],V=8191&j,U=j>>>13,H=0|s[1],q=8191&H,G=H>>>13,W=0|s[2],Y=8191&W,X=W>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,$=0|s[4],Q=8191&$,tt=$>>>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,ct=st>>>13,ut=0|s[8],ft=8191&ut,pt=ut>>>13,ht=0|s[9],dt=8191&ht,gt=ht>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(c+(n=Math.imul(f,V))|0)+((8191&(a=(a=Math.imul(f,U))+Math.imul(p,V)|0))<<13)|0;c=((i=Math.imul(p,U))+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(d,V),a=(a=Math.imul(d,U))+Math.imul(g,V)|0,i=Math.imul(g,U);var mt=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(a=(a=a+Math.imul(f,G)|0)+Math.imul(p,q)|0))<<13)|0;c=((i=i+Math.imul(p,G)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,V),a=(a=Math.imul(m,U))+Math.imul(y,V)|0,i=Math.imul(y,U),n=n+Math.imul(d,q)|0,a=(a=a+Math.imul(d,G)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,G)|0;var yt=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(a=(a=a+Math.imul(f,X)|0)+Math.imul(p,Y)|0))<<13)|0;c=((i=i+Math.imul(p,X)|0)+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,V),a=(a=Math.imul(b,U))+Math.imul(_,V)|0,i=Math.imul(_,U),n=n+Math.imul(m,q)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(y,q)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(d,Y)|0,a=(a=a+Math.imul(d,X)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(a=(a=a+Math.imul(f,K)|0)+Math.imul(p,J)|0))<<13)|0;c=((i=i+Math.imul(p,K)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,V),a=(a=Math.imul(k,U))+Math.imul(T,V)|0,i=Math.imul(T,U),n=n+Math.imul(b,q)|0,a=(a=a+Math.imul(b,G)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,G)|0,n=n+Math.imul(m,Y)|0,a=(a=a+Math.imul(m,X)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,X)|0,n=n+Math.imul(d,J)|0,a=(a=a+Math.imul(d,K)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0;var bt=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(a=(a=a+Math.imul(f,tt)|0)+Math.imul(p,Q)|0))<<13)|0;c=((i=i+Math.imul(p,tt)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,V),a=(a=Math.imul(M,U))+Math.imul(E,V)|0,i=Math.imul(E,U),n=n+Math.imul(k,q)|0,a=(a=a+Math.imul(k,G)|0)+Math.imul(T,q)|0,i=i+Math.imul(T,G)|0,n=n+Math.imul(b,Y)|0,a=(a=a+Math.imul(b,X)|0)+Math.imul(_,Y)|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(d,Q)|0,a=(a=a+Math.imul(d,tt)|0)+Math.imul(g,Q)|0,i=i+Math.imul(g,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(a=(a=a+Math.imul(f,nt)|0)+Math.imul(p,rt)|0))<<13)|0;c=((i=i+Math.imul(p,nt)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,V),a=(a=Math.imul(C,U))+Math.imul(L,V)|0,i=Math.imul(L,U),n=n+Math.imul(M,q)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(E,q)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(k,Y)|0,a=(a=a+Math.imul(k,X)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(b,J)|0,a=(a=a+Math.imul(b,K)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(m,Q)|0,a=(a=a+Math.imul(m,tt)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,a=(a=a+Math.imul(d,nt)|0)+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0;var wt=(c+(n=n+Math.imul(f,it)|0)|0)+((8191&(a=(a=a+Math.imul(f,ot)|0)+Math.imul(p,it)|0))<<13)|0;c=((i=i+Math.imul(p,ot)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,V),a=(a=Math.imul(P,U))+Math.imul(I,V)|0,i=Math.imul(I,U),n=n+Math.imul(C,q)|0,a=(a=a+Math.imul(C,G)|0)+Math.imul(L,q)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(M,Y)|0,a=(a=a+Math.imul(M,X)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,X)|0,n=n+Math.imul(k,J)|0,a=(a=a+Math.imul(k,K)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,tt)|0)+Math.imul(_,Q)|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(d,it)|0,a=(a=a+Math.imul(d,ot)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,ot)|0;var kt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(a=(a=a+Math.imul(f,ct)|0)+Math.imul(p,lt)|0))<<13)|0;c=((i=i+Math.imul(p,ct)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,V),a=(a=Math.imul(z,U))+Math.imul(R,V)|0,i=Math.imul(R,U),n=n+Math.imul(P,q)|0,a=(a=a+Math.imul(P,G)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,G)|0,n=n+Math.imul(C,Y)|0,a=(a=a+Math.imul(C,X)|0)+Math.imul(L,Y)|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(E,J)|0,i=i+Math.imul(E,K)|0,n=n+Math.imul(k,Q)|0,a=(a=a+Math.imul(k,tt)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,tt)|0,n=n+Math.imul(b,rt)|0,a=(a=a+Math.imul(b,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(d,lt)|0,a=(a=a+Math.imul(d,ct)|0)+Math.imul(g,lt)|0,i=i+Math.imul(g,ct)|0;var Tt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(a=(a=a+Math.imul(f,pt)|0)+Math.imul(p,ft)|0))<<13)|0;c=((i=i+Math.imul(p,pt)|0)+(a>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(B,V),a=(a=Math.imul(B,U))+Math.imul(N,V)|0,i=Math.imul(N,U),n=n+Math.imul(z,q)|0,a=(a=a+Math.imul(z,G)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(P,Y)|0,a=(a=a+Math.imul(P,X)|0)+Math.imul(I,Y)|0,i=i+Math.imul(I,X)|0,n=n+Math.imul(C,J)|0,a=(a=a+Math.imul(C,K)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(M,Q)|0,a=(a=a+Math.imul(M,tt)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,a=(a=a+Math.imul(k,nt)|0)+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,n=n+Math.imul(b,it)|0,a=(a=a+Math.imul(b,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,ct)|0)+Math.imul(y,lt)|0,i=i+Math.imul(y,ct)|0,n=n+Math.imul(d,ft)|0,a=(a=a+Math.imul(d,pt)|0)+Math.imul(g,ft)|0,i=i+Math.imul(g,pt)|0;var At=(c+(n=n+Math.imul(f,dt)|0)|0)+((8191&(a=(a=a+Math.imul(f,gt)|0)+Math.imul(p,dt)|0))<<13)|0;c=((i=i+Math.imul(p,gt)|0)+(a>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,G))+Math.imul(N,q)|0,i=Math.imul(N,G),n=n+Math.imul(z,Y)|0,a=(a=a+Math.imul(z,X)|0)+Math.imul(R,Y)|0,i=i+Math.imul(R,X)|0,n=n+Math.imul(P,J)|0,a=(a=a+Math.imul(P,K)|0)+Math.imul(I,J)|0,i=i+Math.imul(I,K)|0,n=n+Math.imul(C,Q)|0,a=(a=a+Math.imul(C,tt)|0)+Math.imul(L,Q)|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(E,rt)|0,i=i+Math.imul(E,nt)|0,n=n+Math.imul(k,it)|0,a=(a=a+Math.imul(k,ot)|0)+Math.imul(T,it)|0,i=i+Math.imul(T,ot)|0,n=n+Math.imul(b,lt)|0,a=(a=a+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,i=i+Math.imul(_,ct)|0,n=n+Math.imul(m,ft)|0,a=(a=a+Math.imul(m,pt)|0)+Math.imul(y,ft)|0,i=i+Math.imul(y,pt)|0;var Mt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(a=(a=a+Math.imul(d,gt)|0)+Math.imul(g,dt)|0))<<13)|0;c=((i=i+Math.imul(g,gt)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,Y),a=(a=Math.imul(B,X))+Math.imul(N,Y)|0,i=Math.imul(N,X),n=n+Math.imul(z,J)|0,a=(a=a+Math.imul(z,K)|0)+Math.imul(R,J)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,tt)|0)+Math.imul(I,Q)|0,i=i+Math.imul(I,tt)|0,n=n+Math.imul(C,rt)|0,a=(a=a+Math.imul(C,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(E,it)|0,i=i+Math.imul(E,ot)|0,n=n+Math.imul(k,lt)|0,a=(a=a+Math.imul(k,ct)|0)+Math.imul(T,lt)|0,i=i+Math.imul(T,ct)|0,n=n+Math.imul(b,ft)|0,a=(a=a+Math.imul(b,pt)|0)+Math.imul(_,ft)|0,i=i+Math.imul(_,pt)|0;var Et=(c+(n=n+Math.imul(m,dt)|0)|0)+((8191&(a=(a=a+Math.imul(m,gt)|0)+Math.imul(y,dt)|0))<<13)|0;c=((i=i+Math.imul(y,gt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,J),a=(a=Math.imul(B,K))+Math.imul(N,J)|0,i=Math.imul(N,K),n=n+Math.imul(z,Q)|0,a=(a=a+Math.imul(z,tt)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,a=(a=a+Math.imul(P,nt)|0)+Math.imul(I,rt)|0,i=i+Math.imul(I,nt)|0,n=n+Math.imul(C,it)|0,a=(a=a+Math.imul(C,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,ct)|0)+Math.imul(E,lt)|0,i=i+Math.imul(E,ct)|0,n=n+Math.imul(k,ft)|0,a=(a=a+Math.imul(k,pt)|0)+Math.imul(T,ft)|0,i=i+Math.imul(T,pt)|0;var St=(c+(n=n+Math.imul(b,dt)|0)|0)+((8191&(a=(a=a+Math.imul(b,gt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((i=i+Math.imul(_,gt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,Q),a=(a=Math.imul(B,tt))+Math.imul(N,Q)|0,i=Math.imul(N,tt),n=n+Math.imul(z,rt)|0,a=(a=a+Math.imul(z,nt)|0)+Math.imul(R,rt)|0,i=i+Math.imul(R,nt)|0,n=n+Math.imul(P,it)|0,a=(a=a+Math.imul(P,ot)|0)+Math.imul(I,it)|0,i=i+Math.imul(I,ot)|0,n=n+Math.imul(C,lt)|0,a=(a=a+Math.imul(C,ct)|0)+Math.imul(L,lt)|0,i=i+Math.imul(L,ct)|0,n=n+Math.imul(M,ft)|0,a=(a=a+Math.imul(M,pt)|0)+Math.imul(E,ft)|0,i=i+Math.imul(E,pt)|0;var Ct=(c+(n=n+Math.imul(k,dt)|0)|0)+((8191&(a=(a=a+Math.imul(k,gt)|0)+Math.imul(T,dt)|0))<<13)|0;c=((i=i+Math.imul(T,gt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,rt),a=(a=Math.imul(B,nt))+Math.imul(N,rt)|0,i=Math.imul(N,nt),n=n+Math.imul(z,it)|0,a=(a=a+Math.imul(z,ot)|0)+Math.imul(R,it)|0,i=i+Math.imul(R,ot)|0,n=n+Math.imul(P,lt)|0,a=(a=a+Math.imul(P,ct)|0)+Math.imul(I,lt)|0,i=i+Math.imul(I,ct)|0,n=n+Math.imul(C,ft)|0,a=(a=a+Math.imul(C,pt)|0)+Math.imul(L,ft)|0,i=i+Math.imul(L,pt)|0;var Lt=(c+(n=n+Math.imul(M,dt)|0)|0)+((8191&(a=(a=a+Math.imul(M,gt)|0)+Math.imul(E,dt)|0))<<13)|0;c=((i=i+Math.imul(E,gt)|0)+(a>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,it),a=(a=Math.imul(B,ot))+Math.imul(N,it)|0,i=Math.imul(N,ot),n=n+Math.imul(z,lt)|0,a=(a=a+Math.imul(z,ct)|0)+Math.imul(R,lt)|0,i=i+Math.imul(R,ct)|0,n=n+Math.imul(P,ft)|0,a=(a=a+Math.imul(P,pt)|0)+Math.imul(I,ft)|0,i=i+Math.imul(I,pt)|0;var Ot=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(a=(a=a+Math.imul(C,gt)|0)+Math.imul(L,dt)|0))<<13)|0;c=((i=i+Math.imul(L,gt)|0)+(a>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(B,lt),a=(a=Math.imul(B,ct))+Math.imul(N,lt)|0,i=Math.imul(N,ct),n=n+Math.imul(z,ft)|0,a=(a=a+Math.imul(z,pt)|0)+Math.imul(R,ft)|0,i=i+Math.imul(R,pt)|0;var Pt=(c+(n=n+Math.imul(P,dt)|0)|0)+((8191&(a=(a=a+Math.imul(P,gt)|0)+Math.imul(I,dt)|0))<<13)|0;c=((i=i+Math.imul(I,gt)|0)+(a>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,ft),a=(a=Math.imul(B,pt))+Math.imul(N,ft)|0,i=Math.imul(N,pt);var It=(c+(n=n+Math.imul(z,dt)|0)|0)+((8191&(a=(a=a+Math.imul(z,gt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((i=i+Math.imul(R,gt)|0)+(a>>>13)|0)+(It>>>26)|0,It&=67108863;var Dt=(c+(n=Math.imul(B,dt))|0)+((8191&(a=(a=Math.imul(B,gt))+Math.imul(N,dt)|0))<<13)|0;return c=((i=Math.imul(N,gt))+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=vt,l[1]=mt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=kt,l[8]=Tt,l[9]=At,l[10]=Mt,l[11]=Et,l[12]=St,l[13]=Ct,l[14]=Lt,l[15]=Ot,l[16]=Pt,l[17]=It,l[18]=Dt,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||(h=p),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):r<63?p(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):d(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,c=0;c=0&&(0!==u||c>=a);c--){var f=0|this.words[c];this.words[c]=u<<26-i|f>>>i,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),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 c=0;c=0;f--){var p=67108864*(0|n.words[a.length+f])+(0|n.words[a.length+f-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(a,p,f);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(a,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=p)}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),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 p=0,h=1;0==(e.words[0]&h)&&p<26;++p,h<<=1);if(p>0)for(e.iushrn(p);p-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(f)),a.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),a.isub(s),o.isub(l)):(r.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},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 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,p=1;0==(r.words[0]&p)&&f<26;++f,p<<=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 x(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){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 k(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 x;else if("p192"===t)e=new b;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(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,a),p=this.pow(t,a.addn(1).iushrn(1)),h=this.pow(t,a),d=o;0!==h.cmp(s);){for(var g=h,v=0;0!==g.cmp(s);v++)g=g.redSqr();n(v=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===u)&&(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 k(t)},a(k,w),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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)},k.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)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:104}],96:[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(!(u<=0)){var f,p=a.mallocDouble(2*u*s),h=a.mallocInt32(s);if((s=l(t,u,p,h))>0){if(1===u&&n)i.init(s),f=i.sweepComplete(u,r,0,s,p,h,0,s,p,h);else{var d=a.mallocDouble(2*u*c),g=a.mallocInt32(c);(c=l(e,u,d,g))>0&&(i.init(s+c),f=1===u?i.sweepBipartite(u,r,0,s,p,h,0,c,d,g):o(u,r,n,s,p,h,c,d,g),a.free(d),a.free(g))}a.free(p),a.free(h)}return f}}}function u(t,e){n.push([t,e])}},{"./lib/intersect":99,"./lib/sweep":103,"typedarray-pool":543}],98:[function(t,e,r){"use strict";var n="d",a="ax",i="vv",o="fp",s="es",l="rs",c="re",u="rb",f="ri",p="rp",h="bs",d="be",g="bb",v="bi",m="bp",y="rv",x="Q",b=[n,a,i,l,c,u,f,h,d,g,v];function _(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],_=b.slice();t||_.splice(3,0,o);var w=["function "+e+"("+_.join()+"){"];function k(e,o){var _=function(t,e,r){var o="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),_=["function ",o,"(",b.join(),"){","var ",s,"=2*",n,";"],w="for(var i="+l+","+p+"="+s+"*"+l+";i<"+c+";++i,"+p+"+="+s+"){var x0="+u+"["+a+"+"+p+"],x1="+u+"["+a+"+"+p+"+"+n+"],xi="+f+"[i];",k="for(var j="+h+","+m+"="+s+"*"+h+";j<"+d+";++j,"+m+"+="+s+"){var y0="+g+"["+a+"+"+m+"],"+(r?"y1="+g+"["+a+"+"+m+"+"+n+"],":"")+"yi="+v+"[j];";return t?_.push(w,x,":",k):_.push(k,x,":",w),r?_.push("if(y1"+d+"-"+h+"){"),t?(k(!0,!1),w.push("}else{"),k(!1,!1)):(w.push("if("+o+"){"),k(!0,!0),w.push("}else{"),k(!0,!1),w.push("}}else{if("+o+"){"),k(!1,!0),w.push("}else{"),k(!1,!1),w.push("}")),w.push("}}return "+e);var T=r.join("")+w.join("");return new Function(T)()}r.partial=_(!1),r.full=_(!0)},{}],99:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,u,E,S,C,L){!function(t,e){var r=8*a.log2(e+1)*(t+1)|0,i=a.nextPow2(b*r);w.length0;){var D=(P-=1)*b,z=w[D],R=w[D+1],F=w[D+2],B=w[D+3],N=w[D+4],j=w[D+5],V=P*_,U=k[V],H=k[V+1],q=1&j,G=!!(16&j),W=u,Y=E,X=C,Z=L;if(q&&(W=C,Y=L,X=u,Z=E),!(2&j&&(F=v(t,z,R,F,W,Y,H),R>=F)||4&j&&(R=m(t,z,R,F,W,Y,U))>=F)){var J=F-R,K=N-B;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)",["p0","p1"]),g=u("lo===p0",["p0"]),v=u("lo>>1,p=2*t,h=f,d=s[p*f+e];c=x?(h=y,d=x):m>=_?(h=v,d=m):(h=b,d=_):x>=_?(h=y,d=x):_>=m?(h=v,d=m):(h=b,d=_);for(var w=p*(u-1),k=p*h,T=0;Tr&&a[f+e]>c;--u,f-=o){for(var p=f,h=f+o,d=0;d=0&&a.push("lo=e[k+n]"),t.indexOf("hi")>=0&&a.push("hi=e[k+o]"),r.push(n.replace("_",a.join()).replace("$",t)),Function.apply(void 0,r)};var n="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"},{}],102:[function(t,e,r){"use strict";e.exports=function(t,e){e<=4*n?a(0,e-1,t):function t(e,r,f){var p=(r-e+1)/6|0,h=e+p,d=r-p,g=e+r>>1,v=g-p,m=g+p,y=h,x=v,b=g,_=m,w=d,k=e+1,T=r-1,A=0;c(y,x,f)&&(A=y,y=x,x=A),c(_,w,f)&&(A=_,_=w,w=A),c(y,b,f)&&(A=y,y=b,b=A),c(x,b,f)&&(A=x,x=b,b=A),c(y,_,f)&&(A=y,y=_,_=A),c(b,_,f)&&(A=b,b=_,_=A),c(x,w,f)&&(A=x,x=w,w=A),c(x,b,f)&&(A=x,x=b,b=A),c(_,w,f)&&(A=_,_=w,w=A);for(var M=f[2*x],E=f[2*x+1],S=f[2*_],C=f[2*_+1],L=2*y,O=2*b,P=2*w,I=2*h,D=2*g,z=2*d,R=0;R<2;++R){var F=f[L+R],B=f[O+R],N=f[P+R];f[I+R]=F,f[D+R]=B,f[z+R]=N}o(v,e,f),o(m,r,f);for(var j=k;j<=T;++j)if(u(j,M,E,f))j!==k&&i(j,k,f),++k;else if(!u(j,S,C,f))for(;;){if(u(T,S,C,f)){u(T,M,E,f)?(s(j,k,T,f),++k,--T):(i(j,T,f),--T);break}if(--Tt;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function u(t,e,r,n){var a=n[t*=2];return a>>1;i(h,E);var S=0,C=0;for(k=0;k=o)d(c,u,C--,L=L-o|0);else if(L>=0)d(s,l,S--,L);else if(L<=-o){L=-L-o|0;for(var O=0;O>>1;i(h,S);var C=0,L=0,O=0;for(T=0;T>1==h[2*T+3]>>1&&(I=2,T+=1),P<0){for(var D=-(P>>1)-1,z=0;z>1)-1,0===I?d(s,l,C--,D):1===I?d(c,u,L--,D):2===I&&d(f,p,O--,D)}},scanBipartite:function(t,e,r,n,a,c,u,f,p,v,m,y){var x=0,b=2*t,_=e,w=e+t,k=1,T=1;n?T=o:k=o;for(var A=a;A>>1;i(h,C);var L=0;for(A=0;A=o?(P=!n,M-=o):(P=!!n,M-=1),P)g(s,l,L++,M);else{var I=y[M],D=b*M,z=m[D+e+1],R=m[D+e+1+t];t:for(var F=0;F>>1;i(h,k);var T=0;for(x=0;x=o)s[T++]=b-o;else{var M=d[b-=1],E=v*b,S=p[E+e+1],C=p[E+e+1+t];t:for(var L=0;L=0;--L)if(s[L]===b){for(D=L+1;D0&&s.length>i){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else s=o[e]=r,++t._eventsCount;return t}function m(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var l=new Error('Unhandled "error" event. ('+e+")");throw l.context=e,l}if(!(r=o[t]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:f(r,c,this);break;case 2:p(r,c,this,arguments[1]);break;case 3:h(r,c,this,arguments[1],arguments[2]);break;case 4:d(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(a=new Array(n-1),i=1;i=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(var r=e,n=r+1,a=t.length;n=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return x(this,t,!0)},o.prototype.rawListeners=function(t){return x(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):b.call(t,e)},o.prototype.listenerCount=b,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],106:[function(t,e,r){(function(e){ + */function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(l=c[u],!y(t[l],e[l],r,n))return!1;return!0}(t,e,r,o))}return r?t===e:t==e}function x(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 _(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&&g(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!t&&a.isError(i),l=!t&&i&&!r;if((s&&o&&b(i,r)||l)&&g(i,r,"Got unwanted exception"+n),t&&i&&r&&!b(i,r)||!t&&i)throw i}f.AssertionError=function(t){var e;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=d(v((e=this).actual),128)+" "+e.operator+" "+d(v(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,a=p(r),o=i.indexOf("\n"+a);if(o>=0){var s=i.indexOf("\n",o+1);i=i.substring(s+1)}this.stack=i}}},a.inherits(f.AssertionError,Error),f.fail=g,f.ok=m,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){y(t,e,!1)||g(t,e,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,r){y(t,e,!0)||g(t,e,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){y(t,e,!1)&&g(t,e,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){y(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){_(!0,t,e,r)},f.doesNotThrow=function(t,e,r){_(!1,t,e,r)},f.ifError=function(t){if(t)throw t};var w=Object.keys||function(t){var e=[];for(var r in t)o.call(t,r)&&e.push(r);return e}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":64}],62:[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}},{}],63:[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}},{}],64:[function(t,r,n){(function(e,r){var i=/%[sdj%]/g;n.format=function(t){if(!m(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&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(e)?r.showHidden=e:e&&n._extend(r,e),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),c(r,t,r.depth)}function l(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function u(t,e){return t}function c(t,e,r){if(t.customInspect&&e&&k(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return m(i)||(i=c(t,i,r)),i}var a=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")}return g(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}(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(k(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 u,b="",A=!1,T=["{","}"];if(p(e)&&(A=!0,T=["[","]"]),k(e)){var M=e.name?": "+e.name:"";b=" [Function"+M+"]"}return x(e)&&(b=" "+RegExp.prototype.toString.call(e)),_(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+f(e)),0!==o.length||A&&0!=e.length?r<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=A?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,b,T)):T[0]+b+T[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=v(r)?c(t,l.value,null):c(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 v(t){return null===t}function g(t){return"number"==typeof t}function m(t){return"string"==typeof t}function y(t){return void 0===t}function x(t){return b(t)&&"[object RegExp]"===A(t)}function b(t){return"object"==typeof t&&null!==t}function _(t){return b(t)&&"[object Date]"===A(t)}function w(t){return b(t)&&("[object Error]"===A(t)||t instanceof Error)}function k(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}n.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 r=e.pid;o[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else o[t]=function(){};return o[t]},n.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"},n.isArray=p,n.isBoolean=d,n.isNull=v,n.isNullOrUndefined=function(t){return null==t},n.isNumber=g,n.isString=m,n.isSymbol=function(t){return"symbol"==typeof t},n.isUndefined=y,n.isRegExp=x,n.isObject=b,n.isDate=_,n.isError=w,n.isFunction=k,n.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},n.isBuffer=t("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"),[t.getDate(),M[t.getMonth()],e].join(" ")),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._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,t("_process"),void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":63,_process:477,inherits:62}],65:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],66:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o0?n-4:n,f=0;f>16&255,s[l++]=e>>8&255,s[l++]=255&e;return 2===o&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,s[l++]=255&e),1===o&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e),s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));return 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]+"=")),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("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function c(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},{}],68:[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":78}],69:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],70:[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":78}],71:[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 u,c,f=0;if(i(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))u=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;u=a(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(i(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;c=a(r)}else c=a(1);return f>0?u=u.ushln(f):f<0&&(c=c.ushln(-f)),s(u,c)}},{"./div":70,"./is-rat":72,"./lib/is-bn":76,"./lib/num-to-bn":77,"./lib/rationalize":78,"./lib/str-to-bn":79}],72:[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":76}],73:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":87}],74:[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?52:r+32}},{"bit-twiddle":85,"double-bits":161}],76:[function(t,e,r){"use strict";t("bn.js"),e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":87}],77:[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":87,"double-bits":161}],78:[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);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},{"./bn-sign":73,"./num-to-bn":77}],79:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":87}],80:[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":78}],81:[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":73}],82:[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":78}],83:[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,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(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":74,"./lib/ctz":75}],84:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],85:[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,1+(t|=t>>>16)},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}},{}],86:[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,p,d,v,g=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,p=f.getImageData(0,0,r,o),l=p.data,c=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,c=4):window.ImageData&&t instanceof window.ImageData&&(p=t,r=t.width,o=t.height,l=p.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),d=0,v=u.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),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=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,u=0,c=r;c1&&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 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 i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=h;p++){var d=u-p|0;i=0|t.words[d],a=0|e.words[p],c+=(o=i*a+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()}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?u[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=c[t],p=f[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var v=d.modn(p).toString(t);d=d.idivn(p),r=d.isZero()?v+r:u[h-v.length]+v+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,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=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,v=p>>>13,g=0|o[2],m=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],k=8191&w,A=w>>>13,T=0|o[5],M=8191&T,E=T>>>13,S=0|o[6],C=8191&S,L=S>>>13,O=0|o[7],I=8191&O,P=O>>>13,D=0|o[8],z=8191&D,R=D>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],V=8191&j,U=j>>>13,H=0|s[1],q=8191&H,G=H>>>13,W=0|s[2],Y=8191&W,X=W>>>13,Z=0|s[3],$=8191&Z,J=Z>>>13,K=0|s[4],Q=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,pt=0|s[9],dt=8191&pt,vt=pt>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(f,V),i=(i=Math.imul(f,U))+Math.imul(h,V)|0,a=Math.imul(h,U);var gt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,V),i=(i=Math.imul(d,U))+Math.imul(v,V)|0,a=Math.imul(v,U),n=n+Math.imul(f,q)|0,i=(i=i+Math.imul(f,G)|0)+Math.imul(h,q)|0,a=a+Math.imul(h,G)|0;var mt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,V),i=(i=Math.imul(m,U))+Math.imul(y,V)|0,a=Math.imul(y,U),n=n+Math.imul(d,q)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(v,q)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(f,Y)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(h,Y)|0,a=a+Math.imul(h,X)|0;var yt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,V),i=(i=Math.imul(b,U))+Math.imul(_,V)|0,a=Math.imul(_,U),n=n+Math.imul(m,q)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(d,Y)|0,i=(i=i+Math.imul(d,X)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,X)|0,n=n+Math.imul(f,$)|0,i=(i=i+Math.imul(f,J)|0)+Math.imul(h,$)|0,a=a+Math.imul(h,J)|0;var xt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,V),i=(i=Math.imul(k,U))+Math.imul(A,V)|0,a=Math.imul(A,U),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(m,Y)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,J)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,J)|0,n=n+Math.imul(f,Q)|0,i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,Q)|0,a=a+Math.imul(h,tt)|0;var bt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,V),i=(i=Math.imul(M,U))+Math.imul(E,V)|0,a=Math.imul(E,U),n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(A,q)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,n=n+Math.imul(f,rt)|0,i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0,a=a+Math.imul(h,nt)|0;var _t=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,U))+Math.imul(L,V)|0,a=Math.imul(L,U),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(E,q)|0,a=a+Math.imul(E,G)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(y,Q)|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(v,rt)|0,a=a+Math.imul(v,nt)|0,n=n+Math.imul(f,at)|0,i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0,a=a+Math.imul(h,ot)|0;var wt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,V),i=(i=Math.imul(I,U))+Math.imul(P,V)|0,a=Math.imul(P,U),n=n+Math.imul(C,q)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(L,q)|0,a=a+Math.imul(L,G)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(E,Y)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,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(v,at)|0,a=a+Math.imul(v,ot)|0,n=n+Math.imul(f,lt)|0,i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,lt)|0,a=a+Math.imul(h,ut)|0;var kt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,V),i=(i=Math.imul(z,U))+Math.imul(R,V)|0,a=Math.imul(R,U),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(P,q)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(L,Y)|0,a=a+Math.imul(L,X)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,J)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,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(m,at)|0,i=(i=i+Math.imul(m,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,ut)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ut)|0,n=n+Math.imul(f,ft)|0,i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0,a=a+Math.imul(h,ht)|0;var At=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,V),i=(i=Math.imul(B,U))+Math.imul(N,V)|0,a=Math.imul(N,U),n=n+Math.imul(z,q)|0,i=(i=i+Math.imul(z,G)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(P,Y)|0,a=a+Math.imul(P,X)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(A,rt)|0,a=a+Math.imul(A,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(m,lt)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ut)|0,n=n+Math.imul(d,ft)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(v,ft)|0,a=a+Math.imul(v,ht)|0,n=n+Math.imul(f,dt)|0,i=(i=i+Math.imul(f,vt)|0)+Math.imul(h,dt)|0,a=a+Math.imul(h,vt)|0;var Tt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Tt>>>26)|0,Tt&=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(z,Y)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(R,Y)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(P,$)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(L,Q)|0,a=a+Math.imul(L,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(E,rt)|0,a=a+Math.imul(E,nt)|0,n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(A,at)|0,a=a+Math.imul(A,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ut)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0,n=n+Math.imul(d,dt)|0,i=(i=i+Math.imul(d,vt)|0)+Math.imul(v,dt)|0,a=a+Math.imul(v,vt)|0;var Mt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,X))+Math.imul(N,Y)|0,a=Math.imul(N,X),n=n+Math.imul(z,$)|0,i=(i=i+Math.imul(z,J)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(L,rt)|0,a=a+Math.imul(L,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(E,at)|0,a=a+Math.imul(E,ot)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(A,lt)|0,a=a+Math.imul(A,ut)|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,n=n+Math.imul(m,dt)|0,i=(i=i+Math.imul(m,vt)|0)+Math.imul(y,dt)|0,a=a+Math.imul(y,vt)|0;var Et=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,J))+Math.imul(N,$)|0,a=Math.imul(N,J),n=n+Math.imul(z,Q)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(R,Q)|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(P,rt)|0,a=a+Math.imul(P,nt)|0,n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(L,at)|0,a=a+Math.imul(L,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(E,lt)|0,a=a+Math.imul(E,ut)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(A,ft)|0,a=a+Math.imul(A,ht)|0,n=n+Math.imul(b,dt)|0,i=(i=i+Math.imul(b,vt)|0)+Math.imul(_,dt)|0,a=a+Math.imul(_,vt)|0;var St=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,tt))+Math.imul(N,Q)|0,a=Math.imul(N,tt),n=n+Math.imul(z,rt)|0,i=(i=i+Math.imul(z,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(P,at)|0,a=a+Math.imul(P,ot)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ut)|0)+Math.imul(L,lt)|0,a=a+Math.imul(L,ut)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(E,ft)|0,a=a+Math.imul(E,ht)|0,n=n+Math.imul(k,dt)|0,i=(i=i+Math.imul(k,vt)|0)+Math.imul(A,dt)|0,a=a+Math.imul(A,vt)|0;var Ct=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ct>>>26)|0,Ct&=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(z,at)|0,i=(i=i+Math.imul(z,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,ut)|0)+Math.imul(P,lt)|0,a=a+Math.imul(P,ut)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(L,ft)|0,a=a+Math.imul(L,ht)|0,n=n+Math.imul(M,dt)|0,i=(i=i+Math.imul(M,vt)|0)+Math.imul(E,dt)|0,a=a+Math.imul(E,vt)|0;var Lt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Lt>>>26)|0,Lt&=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(z,lt)|0,i=(i=i+Math.imul(z,ut)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ut)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ft)|0,a=a+Math.imul(P,ht)|0,n=n+Math.imul(C,dt)|0,i=(i=i+Math.imul(C,vt)|0)+Math.imul(L,dt)|0,a=a+Math.imul(L,vt)|0;var Ot=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ut))+Math.imul(N,lt)|0,a=Math.imul(N,ut),n=n+Math.imul(z,ft)|0,i=(i=i+Math.imul(z,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0,n=n+Math.imul(I,dt)|0,i=(i=i+Math.imul(I,vt)|0)+Math.imul(P,dt)|0,a=a+Math.imul(P,vt)|0;var It=(u+n|0)+((8191&i)<<13)|0;u=(a+(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),n=n+Math.imul(z,dt)|0,i=(i=i+Math.imul(z,vt)|0)+Math.imul(R,dt)|0,a=a+Math.imul(R,vt)|0;var Pt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,dt),i=(i=Math.imul(B,vt))+Math.imul(N,dt)|0,a=Math.imul(N,vt);var Dt=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=gt,l[1]=mt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=kt,l[8]=At,l[9]=Tt,l[10]=Mt,l[11]=Et,l[12]=St,l[13]=Ct,l[14]=Lt,l[15]=Ot,l[16]=It,l[17]=Pt,l[18]=Dt,0!==u&&(l[19]=u,r.length++),r};function d(t,e,r){var n=new v;return n.mulp(t,e,r)}function v(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)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},v.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,u=0;u=0&&(0!==c||u>=i);u--){var f=0|this.words[u];this.words[u]=c<<26-a|f>>>a,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=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],s=this._countBits(o);0!=(r=26-s)&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var l,u=n.length-i.length;if("mod"!==e){(l=new a(null)).length=u+1,l.words=new Array(l.length);for(var c=0;c=0;h--){var p=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(i,p,h);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);l&&(l.words[h]=p)}return l&&l.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:l||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),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,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(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var d=0,v=1;0==(r.words[0]&v)&&d<26;++d,v<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),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(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(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(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 m(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(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){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=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 k(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)}m.prototype._tmp=function(){var t=new a(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),r=(r=this.imulK(r)).iadd(this.tmp),e=r.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)},i(y,m),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(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,i),h=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var v=p,g=0;0!==v.cmp(s);g++)v=v.redSqr();n(g=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===c)&&(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 k(t)},i(k,w),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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)},k.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)},k.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}(void 0===e||e,this)},{buffer:96}],88:[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(!(c<=0)){var f,h=i.mallocDouble(2*c*s),p=i.mallocInt32(s);if((s=l(t,c,h,p))>0){if(1===c&&n)a.init(s),f=a.sweepComplete(c,r,0,s,h,p,0,s,h,p);else{var d=i.mallocDouble(2*c*u),v=i.mallocInt32(u);(u=l(e,c,d,v))>0&&(a.init(s+u),f=1===c?a.sweepBipartite(c,r,0,s,h,p,0,u,d,v):o(c,r,n,s,h,p,u,d,v),i.free(d),i.free(v))}i.free(h),i.free(p)}return f}}}function c(t,e){n.push([t,e])}},{"./lib/intersect":91,"./lib/sweep":95,"typedarray-pool":532}],90:[function(t,e,r){"use strict";var n="d",i="ax",a="vv",o="fp",s="es",l="rs",u="re",c="rb",f="ri",h="rp",p="bs",d="be",v="bb",g="bi",m="bp",y="rv",x="Q",b=[n,i,a,l,u,c,f,p,d,v,g];function _(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],_=b.slice();t||_.splice(3,0,o);var w=["function "+e+"("+_.join()+"){"];function k(e,o){var _=function(t,e,r){var o="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),_=["function ",o,"(",b.join(),"){","var ",s,"=2*",n,";"],w="for(var i="+l+","+h+"="+s+"*"+l+";i<"+u+";++i,"+h+"+="+s+"){var x0="+c+"["+i+"+"+h+"],x1="+c+"["+i+"+"+h+"+"+n+"],xi="+f+"[i];",k="for(var j="+p+","+m+"="+s+"*"+p+";j<"+d+";++j,"+m+"+="+s+"){var y0="+v+"["+i+"+"+m+"],"+(r?"y1="+v+"["+i+"+"+m+"+"+n+"],":"")+"yi="+g+"[j];";return t?_.push(w,x,":",k):_.push(k,x,":",w),r?_.push("if(y1"+d+"-"+p+"){"),t?(k(!0,!1),w.push("}else{"),k(!1,!1)):(w.push("if("+o+"){"),k(!0,!0),w.push("}else{"),k(!0,!1),w.push("}}else{if("+o+"){"),k(!1,!0),w.push("}else{"),k(!1,!1),w.push("}")),w.push("}}return "+e);var A=r.join("")+w.join(""),T=new Function(A);return T()}r.partial=_(!1),r.full=_(!0)},{}],91:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,c,E,S,C,L){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(b*r);w.length0;){var D=(I-=1)*b,z=w[D],R=w[D+1],F=w[D+2],B=w[D+3],N=w[D+4],j=w[D+5],V=I*_,U=k[V],H=k[V+1],q=1&j,G=!!(16&j),W=c,Y=E,X=C,Z=L;if(q&&(W=C,Y=L,X=c,Z=E),!(2&j&&(F=g(t,z,R,F,W,Y,H),R>=F)||4&j&&(R=m(t,z,R,F,W,Y,U))>=F)){var $=F-R,J=N-B;if(G){if(t*$*($+J)=p0)&&!(p1>=hi)",["p0","p1"]),v=c("lo===p0",["p0"]),g=c("lo>>1,h=2*t,p=f,d=s[h*f+e];u=x?(p=y,d=x):m>=_?(p=g,d=m):(p=b,d=_):x>=_?(p=y,d=x):_>=m?(p=g,d=m):(p=b,d=_);for(var w=h*(c-1),k=h*p,A=0;Ar&&i[f+e]>u;--c,f-=o){for(var h=f,p=f+o,d=0;d=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="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"},{}],94:[function(t,e,r){"use strict";e.exports=function(t,e){e<=4*n?i(0,e-1,t):function t(e,r,f){var h=(r-e+1)/6|0,p=e+h,d=r-h,v=e+r>>1,g=v-h,m=v+h,y=p,x=g,b=v,_=m,w=d,k=e+1,A=r-1,T=0;u(y,x,f)&&(T=y,y=x,x=T),u(_,w,f)&&(T=_,_=w,w=T),u(y,b,f)&&(T=y,y=b,b=T),u(x,b,f)&&(T=x,x=b,b=T),u(y,_,f)&&(T=y,y=_,_=T),u(b,_,f)&&(T=b,b=_,_=T),u(x,w,f)&&(T=x,x=w,w=T),u(x,b,f)&&(T=x,x=b,b=T),u(_,w,f)&&(T=_,_=w,w=T);for(var M=f[2*x],E=f[2*x+1],S=f[2*_],C=f[2*_+1],L=2*y,O=2*b,I=2*w,P=2*p,D=2*v,z=2*d,R=0;R<2;++R){var F=f[L+R],B=f[O+R],N=f[I+R];f[P+R]=F,f[D+R]=B,f[z+R]=N}o(g,e,f),o(m,r,f);for(var j=k;j<=A;++j)if(c(j,M,E,f))j!==k&&a(j,k,f),++k;else if(!c(j,S,C,f))for(;;){if(c(A,S,C,f)){c(A,M,E,f)?(s(j,k,A,f),++k,--A):(a(j,A,f),--A);break}if(--At;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>>1;a(p,E);for(var S=0,C=0,k=0;k=o)d(u,c,C--,L=L-o|0);else if(L>=0)d(s,l,S--,L);else if(L<=-o){L=-L-o|0;for(var O=0;O>>1;a(p,S);for(var C=0,L=0,O=0,A=0;A>1==p[2*A+3]>>1&&(P=2,A+=1),I<0){for(var D=-(I>>1)-1,z=0;z>1)-1;0===P?d(s,l,C--,D):1===P?d(u,c,L--,D):2===P&&d(f,h,O--,D)}}},scanBipartite:function(t,e,r,n,i,u,c,f,h,g,m,y){var x=0,b=2*t,_=e,w=e+t,k=1,A=1;n?A=o:k=o;for(var T=i;T>>1;a(p,C);for(var L=0,T=0;T=o?(I=!n,M-=o):(I=!!n,M-=1),I)v(s,l,L++,M);else{var P=y[M],D=b*M,z=m[D+e+1],R=m[D+e+1+t];t:for(var F=0;F>>1;a(p,k);for(var A=0,x=0;x=o)s[A++]=b-o;else{var M=d[b-=1],E=g*b,S=h[E+e+1],C=h[E+e+1+t];t:for(var L=0;L=0;--L)if(s[L]===b){for(var D=L+1;D0&&s.length>a){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else s=o[e]=r,++t._eventsCount;return t}function h(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var l=new Error('Unhandled "error" event. ('+e+")");throw l.context=e,l}if(!(r=o[t]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=g(t,n),a=0;a=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,a=o;break}if(a<0)return this;0===a?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n=0;a--)this.removeListener(t,e[a]);return this},o.prototype.listeners=function(t){return d(this,t,!0)},o.prototype.rawListeners=function(t){return d(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):v.call(t,e)},o.prototype.listenerCount=v,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],98:[function(t,e,r){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -"use strict";var n=t("base64-js"),a=t("ieee754"),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=e,r.SlowBuffer=function(t){return+t!=t&&(t=0),e.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function s(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,e.prototype),r}function e(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 u(t)}return l(t,e,r)}function l(t,r,n){if("string"==typeof t)return function(t,r){if("string"==typeof r&&""!==r||(r="utf8"),!e.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|h(t,r),a=s(n),i=a.write(t,r);return i!==n&&(a=a.slice(0,i)),a}(t,r);if(ArrayBuffer.isView(t))return f(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(j(t,ArrayBuffer)||t&&j(t.buffer,ArrayBuffer))return function(t,r,n){if(r<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function h(t,r){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||j(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 n=t.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(t).length;default:if(i)return a?-1:F(t).length;r=(""+r).toLowerCase(),i=!0}}function d(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 C(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return T(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 g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,r,n,a,i){if(0===t.length)return-1;if("string"==typeof n?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof r&&(r=e.from(r,a)),e.isBuffer(r))return 0===r.length?-1:m(t,r,n,a,i);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,n):Uint8Array.prototype.lastIndexOf.call(t,r,n):m(t,[r],n,a,i);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 f=!0,p=0;pa&&(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 T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(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+f<=r)switch(f){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,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),a+=f}return function(t){var e=t.length;if(e<=M)return String.fromCharCode.apply(String,t);for(var r="",n=0;ne&&(t+=" ... "),""},i&&(e.prototype[i]=e.prototype.inspect),e.prototype.compare=function(t,r,n,a,i){if(j(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),!e.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===a&&(a=0),void 0===i&&(i=this.length),r<0||n>t.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&r>=n)return 0;if(a>=i)return-1;if(r>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(a>>>=0),s=(n>>>=0)-(r>>>=0),l=Math.min(o,s),c=this.slice(a,i),u=t.slice(r,n),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 y(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;aa)&&(r=a);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function P(t,r,n,a,i,o){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||rt.length)throw new RangeError("Index out of range")}function I(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 D(t,e,r,n,i){return e=+e,r>>>=0,i||I(t,0,r,4),a.write(t,e,r,n,23,4),r+4}function z(t,e,r,n,i){return e=+e,r>>>=0,i||I(t,0,r,8),a.write(t,e,r,n,52,8),r+8}e.prototype.slice=function(t,r){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],a=1,i=0;++i>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},e.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},e.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},e.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},e.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},e.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},e.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*e)),n},e.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(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},e.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},e.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},e.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},e.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),a.read(this,t,!0,23,4)},e.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),a.read(this,t,!1,23,4)},e.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),a.read(this,t,!0,52,8)},e.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),a.read(this,t,!1,52,8)},e.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(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||P(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},e.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},e.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},e.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);P(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},e.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);P(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},e.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},e.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},e.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},e.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},e.prototype.writeDoubleLE=function(t,e,r){return z(this,t,e,!0,r)},e.prototype.writeDoubleBE=function(t,e,r){return z(this,t,e,!1,r)},e.prototype.copy=function(t,r,n,a){if(!e.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),a||0===a||(a=this.length),r>=t.length&&(r=t.length),r||(r=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-r=0;--o)t[o+r]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,a),r);return i},e.prototype.fill=function(t,r,n,a){if("string"==typeof t){if("string"==typeof r?(a=r,r=0,n=this.length):"string"==typeof n&&(a=n,n=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!e.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===t.length){var i=t.charCodeAt(0);("utf8"===a&&i<128||"latin1"===a)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(r<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=r;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 B(t){return n.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 j(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}}).call(this,t("buffer").Buffer)},{"base64-js":75,buffer:106,ieee754:413}],107:[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 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),p=!!c(r,"exterior",!0),h=!!c(r,"infinity",!1);if(!f&&!p||0===t.length)return[];var d=n(t,e);if(u||f!==p||h){for(var g=a(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v0;){for(var h=r.pop(),d=(s=r.pop(),u=-1,f=-1,l=o[s],1);d=0||(e.flip(s,h),a(t,e,r,u,s,f),a(t,e,r,s,f,u),a(t,e,r,f,h,u),a(t,e,r,h,u,f))}}},{"binary-search-bounds":112,"robust-in-sphere":506}],109:[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 h=s.pop();if(c[h]!==-a){c[h]=a,u[h];for(var d=0;d<3;++d){var g=p[3*h+d];g>=0&&0===c[g]&&(f[3*h+d]?l.push(g):(s.push(g),c[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[p[h-2]],r[p[h-1]],i)>0;)t.push([p[h-1],p[h-2],o]),h-=1;p.length=h,p.push(o);var d=u.upperIds;for(h=d.length;h>1&&a(r[d[h-2]],r[d[h-1]],i)<0;)t.push([d[h-2],d[h-1],o]),h-=1;d.length=h,d.push(o)}}function h(t,e){var r;return(r=t.a[0]m[0]&&a.push(new c(m,v,s,f),new c(v,m,o,f))}a.sort(u);for(var y=a[0].a[0]-(1+Math.abs(a[0].a[0]))*Math.pow(2,-52),x=[new l([y,1],[y,0],-1,[],[],[],[])],b=[],_=(f=0,a.length);f<_;++f){var w=a[f],k=w.type;k===i?p(b,x,t,w.a,w.idx):k===s?d(x,0,w):g(x,0,w)}return b}},{"binary-search-bounds":112,"robust-orientation":508}],111:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function a(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n=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;n>>1,x=a[m]"];return a?e.indexOf("c")<0?i.push(";if(x===y){return m}else if(x<=y){"):i.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):i.push(";if(",e,"){i=m;"),r?i.push("l=m+1}else{h=m-1}"):i.push("h=m-1}else{l=m+1}"),i.push("}"),a?i.push("return -1};"):i.push("return i};"),i.join("")}function a(t,e,r,a){return new Function([n("A","x"+t+"y",e,["y"],a),n("P","c(x,y)"+t+"0",e,["y","c"],a),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:a(">=",!1,"GE"),gt:a(">",!1,"GT"),lt:a("<",!0,"LT"),le:a("<=",!0,"LE"),eq:a("-",!0,"EQ",!0)}},{}],113:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],117:[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 x=e[u=(E=n[i])[0]],b=x[0],_=x[1],w=t[b],k=t[_];if((w[0]-k[0]||w[1]-k[1])<0){var T=b;b=_,_=T}x[0]=b;var A,M=x[1]=E[1];for(a&&(A=x[2]);i>0&&n[i-1][0]===u;){var E,S=(E=n[--i])[1];a?e.push([M,S,A]):e.push([M,S]),M=S}a?e.push([M,_,A]):e.push([M,_])}return p}(t,e,p,v,r));return m(e,y,r),!!y||p.length>0||v.length>0}},{"./lib/rat-seg-intersect":118,"big-rat":79,"big-rat/cmp":77,"big-rat/to-float":91,"box-intersect":97,nextafter:452,"rat-vec":487,"robust-segment-intersect":511,"union-find":544}],118:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=s(e,t),f=s(n,r),p=u(i,f);if(0===o(p))return null;var h=s(t,r),d=u(f,h),g=a(d,p),v=c(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"),c=t("rat-vec/muls");function u(t,e){return i(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":486,"rat-vec/muls":488,"rat-vec/sub":489}],119:[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:116}],120:[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]}},{}],121:[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:116,"color-rgba":123,dtype:170}],122:[function(t,r,n){(function(e){"use strict";var n=t("color-name"),a=t("is-plain-obj"),i=t("defined");r.exports=function(t){var r,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=(h=t.slice(1)).length;c=1,u<=4?(l=[parseInt(h[0]+h[0],16),parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16)],4===u&&(c=parseInt(h[3]+h[3],16)/255)):(l=[parseInt(h[0]+h[1],16),parseInt(h[2]+h[3],16),parseInt(h[4]+h[5],16)],8===u&&(c=parseInt(h[6]+h[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(r=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=r[1],p="rgb"===f,h=f.replace(/a$/,"");s=h,u="cmyk"===h?4:"gray"===h?1:3,l=r[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===h?255*parseFloat(t)/100:parseFloat(t);if("h"===h[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),f===h&&l.push(1),c=p?1: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(a(t)){var d=i(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,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)]),c=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||e.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,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":120,defined:165,"is-plain-obj":423}],123:[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:116,"color-parse":122,"color-space/hsl":124}],124:[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 c=0;c<3;c++)(n=o+1/3*-(c-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[c]=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":125}],125:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],126:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index: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]}]}},{}],127:[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,c,u,f,p,h,d,g;if(t||(t={}),h=(t.nshades||72)-1,p=t.format||"hex",(f=t.colormap)||(f="jet"),"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>h+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*h)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var v=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:(n[3]=d[0]+(d[1]-d[0])*r,n)})),m=[];for(g=0;g0?-1:l(t,e,i)?-1:1:0===s?c>0?1:l(t,e,r)?1:-1:a(c-s)}var p=n(t,e,r);return p>0?o>0&&n(t,e,i)>0?1:-1:p<0?o>0||n(t,e,i)>0?1:-1:n(t,e,i)>0?1: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]),c=i(r[1],-e[1]),u=s(o(n,l),o(a,c));return u[u.length-1]>=0}},{"robust-orientation":508,"robust-product":509,"robust-sum":513,signum:514,"two-sum":542}],129:[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]),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],p=t[2],h=t[3],d=e[0],g=e[1],v=e[2],m=e[3];return u+f+p+h-(d+g+v+m)||n(u,f,p,h)-n(d,g,v,m,d)||n(u+f,u+p,u+h,f+p,f+h,p+h)-n(d+g,d+v,d+m,g+v,g+m,v+m)||n(u+f+p,u+f+h,u+p+h,f+p+h)-n(d+g+v,d+g+m,d+v+m,g+v+m);default:for(var y=t.slice().sort(a),x=e.slice().sort(a),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],133:[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":64,"incremental-convex-hull":414}],135:[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|ç)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"}},{}],136:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],137:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],138:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],139:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],140:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":142,"./stringify":143}],141:[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":136}],142:[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"),c=t("string-split-by"),u=t("./lib/util").isSize;e.exports=p;var f=p.cache={};function p(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"]},p=c(t,/\s+/);e=p.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(u(e)){var d=c(e,"/");if(r.size=d[0],null!=d[1]?r.lineHeight=h(d[1]):"/"===p[0]&&(p.shift(),r.lineHeight=h(p.shift())),!p.length)throw new Error("Missing required font-family.");return r.family=c(p.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 h(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":141,"css-font-stretch-keywords":137,"css-font-style-keywords":138,"css-font-weight-keywords":139,"css-global-keywords":144,"css-system-font-keywords":145,"string-split-by":527,unquote:546}],143:[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")),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},p="1rem",h="serif";function d(t,e){if(t&&!e[t]&&!i[t])throw Error("Unknown keyword `"+t+"`");return t}function g(t){for(var e={},r=0;r=0;--h)i[h]=c*t[h]+u*e[h]+f*r[h]+p*n[h];return i}return c*t+u*e+f*r+p*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,c=3*a*a-2*a;if(t.length){i||(i=new Array(t.length));for(var u=t.length-1;u>=0;--u)i[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return i}return o*t+s*e+l*r[u]+c*n}},{}],147:[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":149}],148:[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=[],c=[],u=0,f=0;for(n=0;n0&&l.push("var "+c.join(",")),n=i-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 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),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(i(t.pre,t,l));var T=i(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(i(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,"(",m.join(","),"){",y.join("\n"),"} return ",M].join(""))()}},{uniq:545}],149:[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=[],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){return 1===t.length&&(t=function(t){return function(r,n){return e(t(r),n)}}(t)),{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>=m?10:i>=y?5:i>=x?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(i>=m?10:i>=y?5:i>=x?2:1)}function _(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>=m?a*=10:i>=y?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 T(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 A(t){if(!(a=t.length))return[];for(var e=-1,r=T(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 i,o,s=n.length,l=new Array(s);for(i=0;if;)p.pop(),--h;var d,g=new Array(h+1);for(i=0;i<=h;++i)(d=g[i]=[]).x0=i>0?p[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=T,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,f,p=-1,h=n.length,d=l[a++],g=r(),v=i();++pl.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})}))},{}],155:[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,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})$/,l=/^#([0-9a-f]{6})$/,c=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),u=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),f=new RegExp("^rgba\\("+[a,a,a,i]+"\\)$"),p=new RegExp("^rgba\\("+[o,o,o,i]+"\\)$"),h=new RegExp("^hsl\\("+[i,o,o]+"\\)$"),d=new RegExp("^hsla\\("+[i,o,o,i]+"\\)$"),g={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 v(t){var e;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?new _((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=l.exec(t))?m(parseInt(e[1],16)):(e=c.exec(t))?new _(e[1],e[2],e[3],1):(e=u.exec(t))?new _(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=f.exec(t))?y(e[1],e[2],e[3],e[4]):(e=p.exec(t))?y(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=h.exec(t))?k(e[1],e[2]/100,e[3]/100,1):(e=d.exec(t))?k(e[1],e[2]/100,e[3]/100,e[4]):g.hasOwnProperty(t)?m(g[t]):"transparent"===t?new _(NaN,NaN,NaN,0):null}function m(t){return new _(t>>16&255,t>>8&255,255&t,1)}function y(t,e,r,n){return n<=0&&(t=e=r=NaN),new _(t,e,r,n)}function x(t){return t instanceof n||(t=v(t)),t?new _((t=t.rgb()).r,t.g,t.b,t.opacity):new _}function b(t,e,r,n){return 1===arguments.length?x(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function w(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function k(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new A(t,e,r,n)}function T(t,e,r,a){return 1===arguments.length?function(t){if(t instanceof A)return new A(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=v(t)),!t)return new A;if(t instanceof A)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 A(s,l,c,t.opacity)}(t):new A(t,e,r,null==a?1:a)}function A(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function M(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,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),e(_,b,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+w(this.r)+w(this.g)+w(this.b)},toString:function(){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+")")}})),e(A,T,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new A(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new A(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 _(M(t>=240?t-240:t+120,a,n),M(t,a,n),M(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}}));var E=Math.PI/180,S=180/Math.PI,C=.96422,L=1,O=.82521,P=4/29,I=6/29,D=3*I*I,z=I*I*I;function R(t){if(t instanceof B)return new B(t.l,t.a,t.b,t.opacity);if(t instanceof G){if(isNaN(t.h))return new B(t.l,0,0,t.opacity);var e=t.h*E;return new B(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof _||(t=x(t));var r,n,a=U(t.r),i=U(t.g),o=U(t.b),s=N((.2225045*a+.7168786*i+.0606169*o)/L);return a===i&&i===o?r=n=s:(r=N((.4360747*a+.3850649*i+.1430804*o)/C),n=N((.0139322*a+.0971045*i+.7141733*o)/O)),new B(116*s-16,500*(r-s),200*(s-n),t.opacity)}function F(t,e,r,n){return 1===arguments.length?R(t):new B(t,e,r,null==n?1:n)}function B(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function N(t){return t>z?Math.pow(t,1/3):t/D+P}function j(t){return t>I?t*t*t:D*(t-P)}function V(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 H(t){if(t instanceof G)return new G(t.h,t.c,t.l,t.opacity);if(t instanceof B||(t=R(t)),0===t.a&&0===t.b)return new G(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*S;return new G(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function q(t,e,r,n){return 1===arguments.length?H(t):new G(t,e,r,null==n?1:n)}function G(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}e(B,F,r(n,{brighter:function(t){return new B(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new B(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new _(V(3.1338561*(e=C*j(e))-1.6168667*(t=L*j(t))-.4906146*(r=O*j(r))),V(-.9787684*e+1.9161415*t+.033454*r),V(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),e(G,q,r(n,{brighter:function(t){return new G(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new G(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return R(this).rgb()}}));var W=-.14861,Y=1.78277,X=-.29227,Z=-.90649,J=1.97294,K=J*Z,$=J*Y,Q=Y*X-Z*W;function tt(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof et)return new et(t.h,t.s,t.l,t.opacity);t instanceof _||(t=x(t));var e=t.r/255,r=t.g/255,n=t.b/255,a=(Q*n+K*e-$*r)/(Q+K-$),i=n-a,o=(J*(r-a)-X*i)/Z,s=Math.sqrt(o*o+i*i)/(J*a*(1-a)),l=s?Math.atan2(o,i)*S-120:NaN;return new et(l<0?l+360:l,s,a,t.opacity)}(t):new et(t,e,r,null==n?1:n)}function et(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e(et,tt,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new et(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new et(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*E,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),a=Math.sin(t);return new _(255*(e+r*(W*n+Y*a)),255*(e+r*(X*n+Z*a)),255*(e+r*(J*n)),this.opacity)}})),t.color=v,t.rgb=b,t.hsl=T,t.lab=F,t.hcl=q,t.lch=function(t,e,r,n){return 1===arguments.length?H(t):new G(r,e,t,null==n?1:n)},t.gray=function(t,e){return new B(t,0,0,null==e?1:e)},t.cubehelix=tt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],156:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,(function(t){"use strict";var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,a={};e=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;ip+c||nh+c||iu.index){var f=p-s.x-s.vx,v=h-s.y-s.vy,m=f*f+v*v;mt.r&&(t.r=t[e].r)}function p(){if(r){var e,a,i=r.length;for(n=new Array(i),e=0;e=c)){(t.data!==r||t.next)&&(0===f&&(d+=(f=o())*f),0===p&&(d+=(p=o())*p),d1?(null==r?u.remove(t):u.set(t,y(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?(p.on(t,r),e):p.on(t)}}},t.forceX=function(t){var e,r,n,a=i(.1);function o(t){for(var a,i=0,o=e.length;i=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),f=+t.value&&(u.value=t.value),p=[u];for(null==e&&(e=o);r=p.pop();)if(f&&(r.value=+r.data.value),(a=e(r.data))&&(s=a.length))for(r.children=new Array(s),i=s-1;i>=0;--i)p.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;for(t=r.pop(),e=n.pop();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 f(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 g(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 b(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 _(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 k(t){if(!(a=t.length))return 0;var e,r,n,a,i,o,s,l,c,u,p;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;sp&&(p=s),v=u*u*g,(h=Math.max(p/v,v/f))>d){u-=s;break}d=h}m.push(o={value:u,dice:l1?e:1)},r}(W),Z=function t(e){function r(t,r,n,a,i){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,f=-1,p=o.length,h=t.value;++f1?e:1)},r}(W);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),f=c.x-t(c,u)/2,p=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-f)/(p-f)*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=M;function a(a){return a.x=e/2,a.y=r/2,t?a.eachBefore(C(t)).eachAfter(L(n,.5)).eachBefore(O(1)):a.eachBefore(C(S)).eachAfter(L(M,1)).eachAfter(L(n,a.r/Math.min(e,r))).eachBefore(O(Math.min(e,r)/(2*a.r))),a}return a.radius=function(e){return arguments.length?(t=T(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:E(+t),a):n},a},t.packSiblings=function(t){return k(t),t},t.packEnclose=f,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&&I(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=A(e),r):t},r.parentId=function(t){return arguments.length?(e=A(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,f=a;a.eachBefore((function(t){t.xu.x&&(u=t),t.depth>f.depth&&(f=t)}));var p=c===u?1:t(c,u)/2,h=p-c.x,d=e/(u.x+p+h),g=r/(f.depth||1);a.eachBefore((function(t){t.x=(t.x+h)*d,t.y=t.depth*g}))}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,f=s.m,p=l.m;s=V(s),i=j(i),s&&i;)l=j(l),(o=V(o)).a=e,(a=s.z+f-i.z-c+t(s._,i._))>0&&(U(H(s,e,n),e,a),c+=a,u+=a),f+=s.m,c+=i.m,p+=l.m,u+=o.m;s&&!V(o)&&(o.t=s,o.m+=f-u),i&&!j(l)&&(l.t=i,l.m+=c-p,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=X,e=!1,r=1,n=1,a=[0],i=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),a=[0],e&&t.eachBefore(P),t}function f(e){var r=a[e.depth],n=e.x0+r,u=e.y0+r,f=e.x1-r,p=e.y1-r;f=r-1){var u=s[e];return u.x0=a,u.y0=i,u.x1=o,void(u.y1=l)}for(var f=c[e],p=n/2+f,h=e+1,d=r-1;h>>1;c[g]l-i){var y=(a*m+o*v)/n;t(e,h,v,a,i,y,l),t(h,r,m,y,i,o,l)}else{var x=(i*m+l*v)/n;t(e,h,v,a,i,o,x),t(h,r,m,a,x,o,l)}}(0,l,t.value,e,r,n,a)},t.treemapDice=I,t.treemapSlice=G,t.treemapSliceDice=function(t,e,r,n,a){(1&t.depth?G:I)(t,e,r,n,a)},t.treemapSquarify=X,t.treemapResquarify=Z,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],159:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-color")):a(n.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 f(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=x.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(f*l-c*u)>1e-6&&i){var h=n-o,d=a-s,g=l*l+c*c,v=h*h+d*d,m=Math.sqrt(g),y=Math.sqrt(p),x=i*Math.tan((e-Math.acos((g+p-v)/(2*m*y)))/2),b=x/y,_=x/m;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(r+b*f)),this._+="A"+i+","+i+",0,0,"+ +(f*h>u*d)+","+(this._x1=t+_*l)+","+(this._y1=r+_*c)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,a,i,o,s,l){t=+t,a=+a;var c=(i=+i)*Math.cos(o),u=i*Math.sin(o),f=t+c,p=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"+f+","+p:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-p)>1e-6)&&(this._+="L"+f+","+p),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=f)+","+(this._y1=p):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})}))},{}],161:[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,r,n){if(isNaN(e)||isNaN(r))return t;var a,i,o,s,l,c,u,f,p,h=t._root,d={data:n},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!h)return t._root=d,t;for(;h.length;)if((c=e>=(i=(g+m)/2))?g=i:m=i,(u=r>=(o=(v+y)/2))?v=o:y=o,a=h,!(h=h[f=u<<1|c]))return a[f]=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[f]=d:t._root=d,t;do{a=a?a[f]=new Array(4):t._root=new Array(4),(c=e>=(i=(g+m)/2))?g=i:m=i,(u=r>=(o=(v+y)/2))?v=o:y=o}while((f=u<<1|c)==(p=(l>=o)<<1|s>=i));return a[p]=h,a[f]=d,t}var r=function(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,f=-1/0,p=-1/0;for(n=0;nf&&(f=a),ip&&(p=i));for(ft||t>a||n>e||e>i))return this;var o,s,l=a-r,c=this._root;switch(s=(e<(n+i)/2)<<1|t<(r+a)/2){case 0:do{(o=new Array(4))[s]=c,c=o}while(i=n+(l*=2),t>(a=r+l)||e>i);break;case 1:do{(o=new Array(4))[s]=c,c=o}while(i=n+(l*=2),(r=a-l)>t||e>i);break;case 2:do{(o=new Array(4))[s]=c,c=o}while(n=i-(l*=2),t>(a=r+l)||n>e);break;case 3:do{(o=new Array(4))[s]=c,c=o}while(n=i-(l*=2),(r=a-l)>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=a,this._y1=i,this},l.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var a,i,o,s,l,c,u,f=this._x0,p=this._y0,h=this._x1,d=this._y1,g=[],v=this._root;for(v&&g.push(new r(v,f,p,h,d)),null==n?n=1/0:(f=t-n,p=e-n,h=t+n,d=e+n,n*=n);c=g.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(o=c.y0)>d||(s=c.x1)=y)<<1|t>=m)&&(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,v.data),b=e-+this._y.call(null,v.data),_=x*x+b*b;if(_=(s=(d+v)/2))?d=s:v=s,(u=o>=(l=(g+m)/2))?g=l:m=l,e=h,!(h=h[f=u<<1|c]))return this;if(!h.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,p=f)}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[f]=a:delete e[f],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(r?r[p]=h:this._root=h),this):(this._root=a,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=1?p:t<=-1?-p:Math.asin(t)}function g(t){return t.innerRadius}function v(t){return t.outerRadius}function m(t){return t.startAngle}function y(t){return t.endAngle}function x(t){return t&&t.padAngle}function b(t,e,r,n,a,i,s){var l=t-r,u=e-n,f=(s?i:-i)/c(l*l+u*u),p=f*u,h=-f*l,d=t+p,g=e+h,v=r+p,m=n+h,y=(d+v)/2,x=(g+m)/2,b=v-d,_=m-g,w=b*b+_*_,k=a-i,T=d*m-v*g,A=(_<0?-1:1)*c(o(0,k*k*w-T*T)),M=(T*_-b*A)/w,E=(-T*b-_*A)/w,S=(T*_+b*A)/w,C=(-T*b+_*A)/w,L=M-y,O=E-x,P=S-y,I=C-x;return L*L+O*O>P*P+I*I&&(M=S,E=C),{cx:M,cy:E,x01:-p,y01:-h,x11:M*(a/k-1),y11:E*(a/k-1)}}function _(t){this._context=t}function w(t){return new _(t)}function k(t){return t[0]}function T(t){return t[1]}function A(){var t=k,n=T,a=r(!0),i=null,o=w,s=null;function l(r){var l,c,u,f=r.length,p=!1;for(null==i&&(s=o(u=e.path())),l=0;l<=f;++l)!(l=f;--p)c.point(m[p],y[p]);c.lineEnd(),c.areaEnd()}v&&(m[u]=+t(h,u,r),y[u]=+a(h,u,r),c.point(n?+n(h,u,r):m[u],i?+i(h,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?(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 f().x(t).y(a)},u.lineY1=function(){return f().x(t).y(i)},u.lineX1=function(){return f().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 E(t,e){return et?1:e>=t?0:NaN}function S(t){return t}_.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=O(w);function L(t){this._curve=t}function O(t){function e(e){return new L(t(e))}return e._curve=t,e}function P(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(O(t)):e()._curve},t}function I(){return P(A().curve(C))}function D(){var t=M().curve(C),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 P(r())},delete t.lineX0,t.lineEndAngle=function(){return P(n())},delete t.lineX1,t.lineInnerRadius=function(){return P(a())},delete t.lineY0,t.lineOuterRadius=function(){return P(i())},delete t.lineY1,t.curve=function(t){return arguments.length?e(O(t)):e()._curve},t}function z(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}L.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 R=Array.prototype.slice;function F(t){return t.source}function B(t){return t.target}function N(t){var n=F,a=B,i=k,o=T,s=null;function l(){var r,l=R.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 j(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 U(t,e,r,n,a){var i=z(e,r),o=z(e,r=(r+a)/2),s=z(n,r),l=z(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/f);t.moveTo(r,0),t.arc(0,0,r,0,h)}},q={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()}},G=Math.sqrt(1/3),W=2*G,Y={draw:function(t,e){var r=Math.sqrt(e/W),n=r*G;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},X=Math.sin(f/10)/Math.sin(7*f/10),Z=Math.sin(h/10)*X,J=-Math.cos(h/10)*X,K={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=Z*r,a=J*r;t.moveTo(0,-r),t.lineTo(n,a);for(var i=1;i<5;++i){var o=h*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()}},$={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),at=3*(nt/2+1),it={draw:function(t,e){var r=Math.sqrt(e/at),n=r/2,a=r*nt,i=n,o=r*nt+r,s=-i,l=o;t.moveTo(n,a),t.lineTo(i,o),t.lineTo(s,l),t.lineTo(et*n-rt*a,rt*n+et*a),t.lineTo(et*i-rt*o,rt*i+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*a,et*a-rt*n),t.lineTo(et*i+rt*o,et*o-rt*i),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[H,q,Y,$,K,tt,it];function st(){}function lt(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 ct(t){this._context=t}function ut(t){this._context=t}function ft(t){this._context=t}function pt(t,e){this._basis=new ct(t),this._beta=e}ct.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:lt(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:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ut.prototype={areaStart:st,areaEnd:st,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:lt(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:lt(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,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 ht=function t(e){function r(t){return 1===e?new ct(t):new pt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function dt(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:dt(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:dt(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 mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:st,areaEnd:st,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:dt(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 yt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function xt(t,e){this._context=t,this._k=(1-e)/6}xt.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:dt(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 xt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function _t(t,e,r){var n=t._x1,a=t._y1,i=t._x2,o=t._y2;if(t._l01_a>u){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>u){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*c+t._x1*t._l23_2a-e*t._l12_2a)/f,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/f}t._context.bezierCurveTo(n,a,i,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.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:_t(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 wt(t,e):new gt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Tt(t,e){this._context=t,this._alpha=e}Tt.prototype={areaStart:st,areaEnd:st,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:_t(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 Tt(t,e):new mt(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: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:_t(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 Mt(t,e):new xt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t){this._context=t}function Ct(t){return t<0?-1:1}function Lt(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(Ct(i)+Ct(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function Ot(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Pt(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 It(t){this._context=t}function Dt(t){this._context=new zt(t)}function zt(t){this._context=t}function Rt(t){this._context=t}function Ft(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 Ut(t){var e=t.map(Ht);return jt(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 qt(t){var e=t.map(Gt);return jt(t).sort((function(t,r){return e[t]-e[r]}))}function Gt(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=g,o=v,_=r(0),w=null,k=m,T=y,A=x,M=null;function E(){var r,g,v=+t.apply(this,arguments),m=+o.apply(this,arguments),y=k.apply(this,arguments)-p,x=T.apply(this,arguments)-p,E=n(x-y),S=x>y;if(M||(M=r=e.path()),mu)if(E>h-u)M.moveTo(m*i(y),m*l(y)),M.arc(0,0,m,y,x,!S),v>u&&(M.moveTo(v*i(x),v*l(x)),M.arc(0,0,v,x,y,S));else{var C,L,O=y,P=x,I=y,D=x,z=E,R=E,F=A.apply(this,arguments)/2,B=F>u&&(w?+w.apply(this,arguments):c(v*v+m*m)),N=s(n(m-v)/2,+_.apply(this,arguments)),j=N,V=N;if(B>u){var U=d(B/v*l(F)),H=d(B/m*l(F));(z-=2*U)>u?(I+=U*=S?1:-1,D-=U):(z=0,I=D=(y+x)/2),(R-=2*H)>u?(O+=H*=S?1:-1,P-=H):(R=0,O=P=(y+x)/2)}var q=m*i(O),G=m*l(O),W=v*i(D),Y=v*l(D);if(N>u){var X,Z=m*i(P),J=m*l(P),K=v*i(I),$=v*l(I);if(E1?0:t<-1?f:Math.acos(t)}((Q*et+tt*rt)/(c(Q*Q+tt*tt)*c(et*et+rt*rt)))/2),at=c(X[0]*X[0]+X[1]*X[1]);j=s(N,(v-at)/(nt-1)),V=s(N,(m-at)/(nt+1))}}R>u?V>u?(C=b(K,$,q,G,m,V,S),L=b(Z,J,W,Y,m,V,S),M.moveTo(C.cx+C.x01,C.cy+C.y01),Vu&&z>u?j>u?(C=b(W,Y,Z,J,v,-j,S),L=b(q,G,K,$,v,-j,S),M.lineTo(C.cx+C.x01,C.cy+C.y01),j0&&(d+=f);for(null!=e?g.sort((function(t,r){return e(v[t],v[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,v[l]={data:r[l],index:s,value:f,startAngle:m,endAngle:u,padAngle:x};return v}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.areaRadial=D,t.radialArea=D,t.lineRadial=I,t.radialLine=I,t.pointRadial=z,t.linkHorizontal=function(){return N(j)},t.linkVertical=function(){return N(V)},t.linkRadial=function(){var t=N(U);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=r(H),n=r(64),a=null;function i(){var r;if(a||(a=r=e.path()),t.apply(this,arguments).draw(a,+n.apply(this,arguments)),r)return a=null,r+""||null}return i.type=function(e){return arguments.length?(t="function"==typeof e?e:r(e),i):t},i.size=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),i):n},i.context=function(t){return arguments.length?(a=null==t?null:t,i):a},i},t.symbols=ot,t.symbolCircle=H,t.symbolCross=q,t.symbolDiamond=Y,t.symbolSquare=$,t.symbolStar=K,t.symbolTriangle=tt,t.symbolWye=it,t.curveBasisClosed=function(t){return new ut(t)},t.curveBasisOpen=function(t){return new ft(t)},t.curveBasis=function(t){return new ct(t)},t.curveBundle=ht,t.curveCardinalClosed=yt,t.curveCardinalOpen=bt,t.curveCardinal=vt,t.curveCatmullRomClosed=At,t.curveCatmullRomOpen=Et,t.curveCatmullRom=kt,t.curveLinearClosed=function(t){return new St(t)},t.curveLinear=w,t.curveMonotoneX=function(t){return new It(t)},t.curveMonotoneY=function(t){return new Dt(t)},t.curveNatural=function(t){return new Rt(t)},t.curveStep=function(t){return new Bt(t,.5)},t.curveStepAfter=function(t){return new Bt(t,1)},t.curveStepBefore=function(t){return new Bt(t,0)},t.stack=function(){var t=r([]),e=jt,n=Nt,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=0,o=t[0].length;i1)for(var r,n,a,i,o,s,l=0,c=t[e[0]].length;l=0?(n[0]=i,n[1]=i+=a):a<0?(n[1]=o,n[0]=o+=a):n[0]=i},t.stackOffsetNone=Nt,t.stackOffsetSilhouette=function(t,e){if((r=t.length)>0){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=0&&r._call.call(null,t),r=r._next;--n}function m(){l=(s=u.now())+c,n=a=0;try{v()}finally{n=0,function(){for(var t,n,a=e,i=1/0;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,x(i)}(),l=0}}function y(){var t=u.now(),e=t-s;e>o&&(c-=e,s=t)}function x(t){n||(a&&(a=clearTimeout(a)),t-l>24?(t<1/0&&(a=setTimeout(m,t-u.now()-c)),i&&(i=clearInterval(i))):(i||(s=u.now(),i=setInterval(y,o)),n=1,f(m)))}d.prototype=g.prototype={constructor:d,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,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}},t.now=p,t.timer=g,t.timerFlush=v,t.timeout=function(t,e,r){var n=new d;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.interval=function(t,e,r){var n=new d,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)},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],164:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},a=this.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,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 p(t,e){return te?1:t>=e?0:NaN}function h(t){return null===t?NaN:+t}function d(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=p,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(p);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 p(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 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,a=[],i=x(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,c,u,f,p=-1,h=i.length,d=a[s++],g=new _;++p=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 O;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(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,H={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function q(t){return H(t,X),t}var G=function(t,e){return e.querySelector(t)},W=function(t,e){return e.querySelectorAll(t)},Y=function(t,e){var r=t.matches||t[D(t,"matchesSelector")];return(Y=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(G=function(t,e){return Sizzle(t,e)[0]||null},W=Sizzle,Y=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var X=t.selection.prototype=[];function Z(t){return"function"==typeof t?t:function(){return G(t,this)}}function J(t){return"function"==typeof t?t:function(){return W(t,this)}}X.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)),$.hasOwnProperty(r)?{space:$[r],local:t}:t}},X.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))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=rt(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},X.sort=function(t){t=ft.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=xt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:c:r?R: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=ht,t.selection.enter.prototype=dt,dt.append=X.append,dt.empty=X.empty,dt.node=X.node,dt.call=X.call,dt.size=X.size,dt.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s0?1:t<0?-1:0}function zt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Rt(t){return t>1?0:t<-1?St:Math.acos(t)}function Ft(t){return t>1?Ot:t<-1?-Ot:Math.asin(t)}function Bt(t){return((t=Math.exp(t))+1/t)/2}function Nt(t){return(t=Math.sin(t/2))*t}var jt=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,f=l-i,p=u*u+f*f;if(p0&&(e=e.transition().duration(g)),e.call(w.event)}function E(){c&&c.domain(l.range().map((function(t){return(t-p.x)/p.k})).map(l.invert)),f&&f.domain(u.range().map((function(t){return(t-p.y)/p.k})).map(u.invert))}function S(t){v++||t({type:"zoomstart"})}function C(t){E(),t({type:"zoom",scale:p.k,translate:[p.x,p.y]})}function L(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,(function(){n=1,A(t.mouse(e),i),C(r)})).on(x,(function(){a.on(y,null).on(x,null),s(n),L(r)})),i=k(t.mouse(e)),s=wt(e);ws.call(e),S(r)}function P(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],f=t.select(r),h=wt(r);function d(){var n=t.touches(r);return e=p.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=k(t))})),n}function g(){var e=t.event.target;t.select(e).on(l,v).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){m=h[0];var x=h[1],b=m[0]-x[0],_=m[1]-x[1];i=b*b+_*_}}function v(){var o,l,c,u,f=t.touches(r);ws.call(r);for(var p=0,h=f.length;p360?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)?0: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 le(i(t+120),i(t),i(t-120))}function Xt(e,r,n){return this instanceof Xt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Xt?new Xt(e.h,e.c,e.l):ae(e instanceof Kt?e.l:(e=ge((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Xt(e,r,n)}Wt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Gt(this.h,this.s,this.l/t)},Wt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Gt(this.h,this.s,t*this.l)},Wt.rgb=function(){return Yt(this.h,this.s,this.l)},t.hcl=Xt;var Zt=Xt.prototype=new qt;function Jt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Kt(r,Math.cos(t*=Pt)*e,Math.sin(t)*e)}function Kt(t,e,r){return this instanceof Kt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Kt?new Kt(t.l,t.a,t.b):t instanceof Xt?Jt(t.h,t.c,t.l):ge((t=le(t)).r,t.g,t.b):new Kt(t,e,r)}Zt.brighter=function(t){return new Xt(this.h,this.c,Math.min(100,this.l+$t*(arguments.length?t:1)))},Zt.darker=function(t){return new Xt(this.h,this.c,Math.max(0,this.l-$t*(arguments.length?t:1)))},Zt.rgb=function(){return Jt(this.h,this.c,this.l).rgb()},t.lab=Kt;var $t=18,Qt=.95047,te=1,ee=1.08883,re=Kt.prototype=new qt;function ne(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new le(se(3.2404542*(a=ie(a)*Qt)-1.5371385*(n=ie(n)*te)-.4985314*(i=ie(i)*ee)),se(-.969266*a+1.8760108*n+.041556*i),se(.0556434*a-.2040259*n+1.0572252*i))}function ae(t,e,r){return t>0?new Xt(Math.atan2(r,e)*It,Math.sqrt(e*e+r*r),t):new Xt(NaN,NaN,t)}function ie(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function oe(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function se(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function le(t,e,r){return this instanceof le?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof le?new le(t.r,t.g,t.b):he(""+t,le,Yt):new le(t,e,r)}function ce(t){return new le(t>>16,t>>8&255,255&t)}function ue(t){return ce(t)+""}re.brighter=function(t){return new Kt(Math.min(100,this.l+$t*(arguments.length?t:1)),this.a,this.b)},re.darker=function(t){return new Kt(Math.max(0,this.l-$t*(arguments.length?t:1)),this.a,this.b)},re.rgb=function(){return ne(this.l,this.a,this.b)},t.rgb=le;var fe=le.prototype=new qt;function pe(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function he(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(me(a[0]),me(a[1]),me(a[2]))}return(i=ye.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 de(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 Gt(n,a,l)}function ge(t,e,r){var n=oe((.4124564*(t=ve(t))+.3575761*(e=ve(e))+.1804375*(r=ve(r)))/Qt),a=oe((.2126729*t+.7151522*e+.072175*r)/te);return Kt(116*a-16,500*(n-a),200*(a-oe((.0193339*t+.119192*e+.9503041*r)/ee)))}function ve(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function me(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}fe.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!this.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 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))}ye.forEach((function(t,e){ye.set(t,ce(e))})),t.functor=xe,t.xhr=be(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=_e(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=new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}");r=e?function(t,r){return e(a(t),r)}:a}))},a.parseRows=function(t,e){var r,a,i={},o={},s=[],l=t.length,c=0,u=0;function f(){if(c>=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(Ae),Ae=setTimeout(Se,e)),Te=0):(Te=1,Me(Se))}function Ce(){for(var t=Date.now(),e=we;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Le(){for(var t,e=we,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}}));function Ie(e){var r=e.decimal,n=e.thousands,a=e.grouping,i=e.currency,o=a&&n?function(t,e){for(var r=t.length,i=[],o=0,s=a[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),i.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=a[o=(o+1)%a.length];return i.reverse().join(n)}:P;return function(e){var n=De.exec(e),a=n[1]||" ",s=n[2]||">",l=n[3]||"-",c=n[4]||"",u=n[5],f=+n[6],p=n[7],h=n[8],d=n[9],g=1,v="",m="",y=!1,x=!0;switch(h&&(h=+h.substring(1)),(u||"0"===a&&"="===s)&&(u=a="0",s="="),d){case"n":p=!0,d="g";break;case"%":g=100,m="%",d="f";break;case"p":g=100,m="%",d="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+d.toLowerCase());case"c":x=!1;case"d":y=!0,h=0;break;case"s":g=-1,d="r"}"$"===c&&(v=i[0],m=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=ze.get(d)||Re;var b=u&&p;return function(e){var n=m;if(y&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var c=t.formatPrefix(e,h);e=c.scale(e),n=c.symbol+m}else e*=g;var _,w,k=(e=d(e,h)).lastIndexOf(".");if(k<0){var T=x?e.lastIndexOf("e"):-1;T<0?(_=e,w=""):(_=e.substring(0,T),w=e.substring(T))}else _=e.substring(0,k),w=r+e.substring(k+1);!u&&p&&(_=o(_,1/0));var A=v.length+_.length+w.length+(b?0:i.length),M=A"===s?M+i+e:"^"===s?M.substring(0,A>>=1)+i+e+M.substring(A):i+(b?e:M+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Oe(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Pe[8+n/3]};var De=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ze=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Oe(e,r))).toFixed(Math.max(0,Math.min(20,Oe(e*(1+1e-15),r))))}});function Re(t){return t+""}var Fe=t.time={},Be=Date;function Ne(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ne.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){je.setUTCDate.apply(this._,arguments)},setDay:function(){je.setUTCDay.apply(this._,arguments)},setFullYear:function(){je.setUTCFullYear.apply(this._,arguments)},setHours:function(){je.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){je.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){je.setUTCMinutes.apply(this._,arguments)},setMonth:function(){je.setUTCMonth.apply(this._,arguments)},setSeconds:function(){je.setUTCSeconds.apply(this._,arguments)},setTime:function(){je.setTime.apply(this._,arguments)}};var je=Date.prototype;function Ve(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r1)for(;o=c)return-1;if(37===(a=e.charCodeAt(s++))){if(o=e.charAt(s++),!(i=w[o in qe?e.charAt(s++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(Be=Ne);return r._=t,e(r)}finally{Be=Date}}return r.parse=function(t){try{Be=Ne;var r=e.parse(t);return r&&r._}finally{Be=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=fr;var p=t.map(),h=Xe(o),d=Ze(o),g=Xe(s),v=Ze(s),m=Xe(l),y=Ze(l),x=Xe(c),b=Ze(c);i.forEach((function(t,e){p.set(t.toLowerCase(),e)}));var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:u(r),d:function(t,e){return Ye(t.getDate(),e,2)},e:function(t,e){return Ye(t.getDate(),e,2)},H:function(t,e){return Ye(t.getHours(),e,2)},I:function(t,e){return Ye(t.getHours()%12||12,e,2)},j:function(t,e){return Ye(1+Fe.dayOfYear(t),e,3)},L:function(t,e){return Ye(t.getMilliseconds(),e,3)},m:function(t,e){return Ye(t.getMonth()+1,e,2)},M:function(t,e){return Ye(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return Ye(t.getSeconds(),e,2)},U:function(t,e){return Ye(Fe.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ye(Fe.mondayOfYear(t),e,2)},x:u(n),X:u(a),y:function(t,e){return Ye(t.getFullYear()%100,e,2)},Y:function(t,e){return Ye(t.getFullYear()%1e4,e,4)},Z:cr,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){h.lastIndex=0;var n=h.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:nr,e:nr,H:ir,I:ir,j:ar,L:lr,m:rr,M:or,p:function(t,e,r){var n=p.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:sr,U:Ke,w:Je,W:$e,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:tr,Y:Qe,Z:er,"%":ur};return u}Fe.year=Ve((function(t){return(t=Fe.day(t)).setMonth(0,1),t}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),Fe.years=Fe.year.range,Fe.years.utc=Fe.year.utc.range,Fe.day=Ve((function(t){var e=new Be(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t){return t.getDate()-1})),Fe.days=Fe.day.range,Fe.days.utc=Fe.day.utc.range,Fe.dayOfYear=function(t){var e=Fe.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(t,e){e=7-e;var r=Fe[t]=Ve((function(t){return(t=Fe.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t}),(function(t,e){t.setDate(t.getDate()+7*Math.floor(e))}),(function(t){var r=Fe.year(t).getDay();return Math.floor((Fe.dayOfYear(t)+(r+e)%7)/7)-(r!==e)}));Fe[t+"s"]=r.range,Fe[t+"s"].utc=r.utc.range,Fe[t+"OfYear"]=function(t){var r=Fe.year(t).getDay();return Math.floor((Fe.dayOfYear(t)+(r+e)%7)/7)}})),Fe.week=Fe.sunday,Fe.weeks=Fe.sunday.range,Fe.weeks.utc=Fe.sunday.utc.range,Fe.weekOfYear=Fe.sundayOfYear;var qe={"-":"",_:" ",0:"0"},Ge=/^\s*\d+/,We=/^%/;function Ye(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+a[0].length):-1}function er(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function rr(t,e,r){Ge.lastIndex=0;var n=Ge.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function nr(t,e,r){Ge.lastIndex=0;var n=Ge.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ar(t,e,r){Ge.lastIndex=0;var n=Ge.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ir(t,e,r){Ge.lastIndex=0;var n=Ge.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function or(t,e,r){Ge.lastIndex=0;var n=Ge.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function sr(t,e,r){Ge.lastIndex=0;var n=Ge.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function lr(t,e,r){Ge.lastIndex=0;var n=Ge.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function cr(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,a=y(e)%60;return r+Ye(n,"0",2)+Ye(a,"0",2)}function ur(t,e,r){We.lastIndex=0;var n=We.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function fr(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*i,l=Math.cos(e),c=Math.sin(e),u=a*c,f=n*l+u*Math.cos(s),p=u*o*Math.sin(s);Ir.add(Math.atan2(p,f)),r=t,n=l,a=c}Dr.point=function(o,s){Dr.point=i,r=(t=o)*Pt,n=Math.cos(s=(e=s)*Pt/2+St/4),a=Math.sin(s)},Dr.lineEnd=function(){i(t,e)}}function Rr(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Fr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Br(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 Nr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function jr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Vr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Ur(t){return[Math.atan2(t[1],t[0]),Ft(t[2])]}function Hr(t,e){return y(t[0]-e[0])Mt?a=90:c<-Mt&&(r=-90),f[0]=e,f[1]=n}};function h(t,i){u.push(f=[e=t,n=t]),ia&&(a=i)}function d(t,o){var s=Rr([t*Pt,o*Pt]);if(l){var c=Br(l,s),u=Br([c[1],-c[0],0],c);Vr(u),u=Ur(u);var f=t-i,p=f>0?1:-1,d=u[0]*It*p,g=y(f)>180;if(g^(p*ia&&(a=v);else if(g^(p*i<(d=(d+360)%360-180)&&da&&(a=o);g?t_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(tn&&(n=t)):t>i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else h(t,o);l=s,i=t}function g(){p.point=d}function v(){f[0]=e,f[1]=n,p.point=h,l=null}function m(t,e){if(l){var r=t-i;c+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Dr.point(t,e),d(t,e)}function x(){Dr.lineStart()}function b(){m(o,s),Dr.lineEnd(),y(c)>Mt&&(e=-(n=180)),f[0]=e,f[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(g[0],g[1])&&(g[1]=h[1]),_(h[0],g[1])>_(g[0],g[1])&&(g[0]=h[0])):s.push(g=h);for(var l,c,h,d=-1/0,g=(o=0,s[c=s.length-1]);o<=c;g=h,++o)h=s[o],(l=_(g[1],h[0]))>d&&(d=l,e=h[0],n=g[1])}return u=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,a]]}}(),t.geo.centroid=function(e){wr=kr=Tr=Ar=Mr=Er=Sr=Cr=Lr=Or=Pr=0,t.geo.stream(e,qr);var r=Lr,n=Or,a=Pr,i=r*r+n*n+a*a;return i=0;--s)a.point((f=u[s])[0],f[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 Qr(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n=0?1:-1,k=w*_,T=k>St,A=d*x;if(Ir.add(Math.atan2(A*w*Math.sin(k),g*b+A*Math.cos(k))),i+=T?_+w*Ct:_,T^p>=r^m>=r){var M=Br(Rr(f),Rr(t));Vr(M);var E=Br(a,M);Vr(E);var S=(T^_>=0?-1:1)*Ft(E[2]);(n>S||n===S&&(M[0]||M[1]))&&(o+=T^_>=0?1:-1)}if(!v++)break;p=m,d=x,g=b,f=t}}return(i<-Mt||i0){for(x||(o.polygonStart(),x=!0),o.lineStart();++i1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(rn))}return u}}function rn(t){return t.length>1}function nn(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:R,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function an(t,e){return((t=t.x)[0]<0?t[1]-Ot-Mt:Ot-t[1])-((e=e.x)[0]<0?e[1]-Ot-Mt:Ot-e[1])}var on=en(Kr,(function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var s=i>0?St:-St,l=y(i-r);y(l-St)0?Ot:-Ot),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(i,n),e=0):a!==s&&l>=St&&(y(r-a)Mt?Math.atan((Math.sin(e)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*i*o)):(e+n)/2}(r,n,i,o),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=i,n=o),a=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var a;if(null==t)a=r*Ot,n.point(-St,a),n.point(0,a),n.point(St,a),n.point(St,0),n.point(St,-a),n.point(0,-a),n.point(-St,-a),n.point(-St,0),n.point(-St,a);else if(y(t[0]-e[0])>Mt){var i=t[0]0,n=y(e)>Mt;return en(a,(function(t){var e,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,p){var h,d=[f,p],g=a(f,p),v=r?g?0:o(f,p):g?o(f+(f<0?St:-St),p):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(h=i(e,d),(Hr(e,h)||Hr(d,h))&&(d[0]+=Mt,d[1]+=Mt,g=a(d[0],d[1]))),g!==l)u=0,g?(t.lineStart(),h=i(d,e),t.point(h[0],h[1])):(h=i(e,d),t.point(h[0],h[1]),t.lineEnd()),e=h;else if(n&&e&&r^g){var m;v&s||!(m=i(d,e,!0))||(u=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||e&&Hr(e,d)||t.point(d[0],d[1]),e=d,l=g,s=v},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}}),qn(t,6*Pt),r?[0,-t]:[-St,t-St]);function a(t,r){return Math.cos(t)*Math.cos(r)>e}function i(t,r,n){var a=[1,0,0],i=Br(Rr(t),Rr(r)),o=Fr(i,i),s=i[0],l=o-s*s;if(!l)return!n&&t;var c=e*o/l,u=-e*s/l,f=Br(a,i),p=jr(a,c);Nr(p,jr(i,u));var h=f,d=Fr(p,h),g=Fr(h,h),v=d*d-g*(Fr(p,p)-1);if(!(v<0)){var m=Math.sqrt(v),x=jr(h,(-d-m)/g);if(Nr(x,p),x=Ur(x),!n)return x;var b,_=t[0],w=r[0],k=t[1],T=r[1];w<_&&(b=_,_=w,w=b);var A=w-_,M=y(A-St)0^x[1]<(y(x[0]-_)St^(_<=x[0]&&x[0]<=w)){var E=jr(h,(-d+m)/g);return Nr(E,p),[x,Ur(E)]}}}function o(e,n){var a=r?t:St-t,i=0;return e<-a?i|=1:e>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}function ln(t,e,r,n){return function(a){var i,o=a.a,s=a.b,l=o.x,c=o.y,u=0,f=1,p=s.x-l,h=s.y-c;if(i=t-l,p||!(i>0)){if(i/=p,p<0){if(i0){if(i>f)return;i>u&&(u=i)}if(i=r-l,p||!(i<0)){if(i/=p,p<0){if(i>f)return;i>u&&(u=i)}else if(p>0){if(i0)){if(i/=h,h<0){if(i0){if(i>f)return;i>u&&(u=i)}if(i=n-c,h||!(i<0)){if(i/=h,h<0){if(i>f)return;i>u&&(u=i)}else if(h>0){if(i0&&(a.a={x:l+u*p,y:c+u*h}),f<1&&(a.b={x:l+f*p,y:c+f*h}),a}}}}}}var cn=1e9;function un(e,r,n,a){return function(l){var c,u,f,p,h,d,g,v,m,y,x,b=l,_=nn(),w=ln(e,r,n,a),k={point:M,lineStart:function(){k.point=E,u&&u.push(f=[]),y=!0,m=!1,g=v=NaN},lineEnd:function(){c&&(E(p,h),d&&m&&_.rejoin(),c.push(_.buffer())),k.point=M,m&&l.lineEnd()},polygonStart:function(){l=_,c=[],u=[],x=!0},polygonEnd:function(){l=b,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],a=0;an&&zt(c,i,t)>0&&++e:i[1]<=n&&zt(c,i,t)<0&&--e,c=i;return 0!==e}([e,a]),n=x&&r,i=c.length;(n||i)&&(l.polygonStart(),n&&(l.lineStart(),T(null,null,1,l),l.lineEnd()),i&&$r(c,o,r,T,l),l.polygonEnd()),c=u=f=null}};function T(t,o,l,c){var u=0,f=0;if(null==t||(u=i(t,l))!==(f=i(o,l))||s(t,o)<0^l>0)do{c.point(0===u||3===u?e:n,u>1?a:r)}while((u=(u+l+4)%4)!==f);else c.point(o[0],o[1])}function A(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function M(t,e){A(t,e)&&l.point(t,e)}function E(t,e){var r=A(t=Math.max(-cn,Math.min(cn,t)),e=Math.max(-cn,Math.min(cn,e)));if(u&&f.push([t,e]),y)p=t,h=e,d=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&m)l.point(t,e);else{var n={a:{x:g,y:v},b:{x:t,y:e}};w(n)?(m||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),x=!1):r&&(l.lineStart(),l.point(t,e),x=!1)}g=t,v=e,m=r}return k};function i(t,a){return y(t[0]-e)0?0:3:y(t[0]-n)0?2:1:y(t[1]-r)0?1:0:a>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function fn(t){var e=0,r=St/3,n=Rn(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*St/180,r=t[1]*St/180):[e/St*180,r/St*180]},a}function pn(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(t,e){var r=Math.sqrt(a-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),i-r*Math.cos(t)]}return o.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,Ft((a-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,a,i,o={stream:function(t){return a&&(a.valid=!1),(a=i(t)).valid=!0,a},extent:function(s){return arguments.length?(i=un(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),a&&(a.valid=!1,a=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return fn(pn)}).raw=pn,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,a,i=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function c(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}return c.invert=function(t){var e=i.scale(),r=i.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?s:i).invert(t)},c.stream=function(t){var e=i.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),s.precision(t),c):i.precision()},c.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),s.scale(t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var e=i.scale(),u=+t[0],f=+t[1];return r=i.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(l).point,n=o.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+Mt,f+.12*e+Mt],[u-.214*e-Mt,f+.234*e-Mt]]).stream(l).point,a=s.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+Mt,f+.166*e+Mt],[u-.115*e-Mt,f+.234*e-Mt]]).stream(l).point,c},c.scale(1070)};var hn,dn,gn,vn,mn,yn,xn={point:R,lineStart:R,lineEnd:R,polygonStart:function(){dn=0,xn.lineStart=bn},polygonEnd:function(){xn.lineStart=xn.lineEnd=xn.point=R,hn+=y(dn/2)}};function bn(){var t,e,r,n;function a(t,e){dn+=n*t-r*e,r=t,n=e}xn.point=function(i,o){xn.point=a,t=r=i,e=n=o},xn.lineEnd=function(){a(t,e)}}var _n={point:function(t,e){tmn&&(mn=t),eyn&&(yn=e)},lineStart:R,lineEnd:R,polygonStart:R,polygonEnd:R};function wn(){var t=kn(4.5),e=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=kn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function a(t,n){e.push("M",t,",",n),r.point=i}function i(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function kn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var Tn,An={point:Mn,lineStart:En,lineEnd:Sn,polygonStart:function(){An.lineStart=Cn},polygonEnd:function(){An.point=Mn,An.lineStart=En,An.lineEnd=Sn}};function Mn(t,e){Tr+=t,Ar+=e,++Mr}function En(){var t,e;function r(r,n){var a=r-t,i=n-e,o=Math.sqrt(a*a+i*i);Er+=o*(t+r)/2,Sr+=o*(e+n)/2,Cr+=o,Mn(t=r,e=n)}An.point=function(n,a){An.point=r,Mn(t=n,e=a)}}function Sn(){An.point=Mn}function Cn(){var t,e,r,n;function a(t,e){var a=t-r,i=e-n,o=Math.sqrt(a*a+i*i);Er+=o*(r+t)/2,Sr+=o*(n+e)/2,Cr+=o,Lr+=(o=n*t-r*e)*(r+t),Or+=o*(n+e),Pr+=3*o,Mn(r=t,n=e)}An.point=function(i,o){An.point=a,Mn(t=r=i,e=n=o)},An.lineEnd=function(){a(t,e)}}function Ln(t){var e=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:R};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Ct)}function a(e,n){t.moveTo(e,n),r.point=i}function i(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function On(t){var e=.5,r=Math.cos(30*Pt),n=16;function a(t){return(n?o:i)(t)}function i(e){return Dn(e,(function(r,n){r=t(r,n),e.point(r[0],r[1])}))}function o(e){var r,a,i,o,l,c,u,f,p,h,d,g,v={point:m,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,v.point=x,e.lineStart()}function x(r,a){var i=Rr([r,a]),o=t(r,a);s(f,p,u,h,d,g,f=o[0],p=o[1],u=r,h=i[0],d=i[1],g=i[2],n,e),e.point(f,p)}function b(){v.point=m,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=k}function w(t,e){x(r=t,e),a=f,i=p,o=h,l=d,c=g,v.point=x}function k(){s(f,p,u,h,d,g,a,i,r,o,l,c,n,e),v.lineEnd=b,b()}return v}function s(n,a,i,o,l,c,u,f,p,h,d,g,v,m){var x=u-n,b=f-a,_=x*x+b*b;if(_>4*e&&v--){var w=o+h,k=l+d,T=c+g,A=Math.sqrt(w*w+k*k+T*T),M=Math.asin(T/=A),E=y(y(T)-1)e||y((x*O+b*P)/_-.5)>.3||o*h+l*d+c*g0&&16,a):Math.sqrt(e)},a}function Pn(t){var e=On((function(e,r){return t([e*It,r*It])}));return function(t){return Fn(e(t))}}function In(t){this.stream=t}function Dn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function zn(t){return Rn((function(){return t}))()}function Rn(e){var r,n,a,i,o,s,l=On((function(t,e){return[(t=r(t,e))[0]*c+i,o-t[1]*c]})),c=150,u=480,f=250,p=0,h=0,d=0,g=0,v=0,m=on,y=P,x=null,b=null;function _(t){return[(t=a(t[0]*Pt,t[1]*Pt))[0]*c+i,o-t[1]*c]}function w(t){return(t=a.invert((t[0]-i)/c,(o-t[1])/c))&&[t[0]*It,t[1]*It]}function k(){a=Jr(n=jn(d,g,v),r);var t=r(p,h);return i=u-t[0]*c,o=f+t[1]*c,T()}function T(){return s&&(s.valid=!1,s=null),_}return _.stream=function(t){return s&&(s.valid=!1),(s=Fn(m(n,l(y(t))))).valid=!0,s},_.clipAngle=function(t){return arguments.length?(m=null==t?(x=t,on):sn((x=+t)*Pt),T()):x},_.clipExtent=function(t){return arguments.length?(b=t,y=t?un(t[0][0],t[0][1],t[1][0],t[1][1]):P,T()):b},_.scale=function(t){return arguments.length?(c=+t,k()):c},_.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],k()):[u,f]},_.center=function(t){return arguments.length?(p=t[0]%360*Pt,h=t[1]%360*Pt,k()):[p*It,h*It]},_.rotate=function(t){return arguments.length?(d=t[0]%360*Pt,g=t[1]%360*Pt,v=t.length>2?t[2]%360*Pt:0,k()):[d*It,g*It,v*It]},t.rebind(_,l,"precision"),function(){return r=e.apply(this,arguments),_.invert=r.invert&&w,k()}}function Fn(t){return Dn(t,(function(e,r){t.point(e*Pt,r*Pt)}))}function Bn(t,e){return[t,e]}function Nn(t,e){return[t>St?t-Ct:t<-St?t+Ct:t,e]}function jn(t,e,r){return t?e||r?Jr(Un(t),Hn(e,r)):Un(t):e||r?Hn(e,r):Nn}function Vn(t){return function(e,r){return[(e+=t)>St?e-Ct:e<-St?e+Ct:e,r]}}function Un(t){var e=Vn(t);return e.invert=Vn(-t),e}function Hn(t,e){var r=Math.cos(t),n=Math.sin(t),a=Math.cos(e),i=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*r+s*n;return[Math.atan2(l*a-u*i,s*r-c*n),Ft(u*a+l*i)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*a-l*i;return[Math.atan2(l*a+c*i,s*r+u*n),Ft(u*r-s*n)]},o}function qn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,s){var l=o*e;null!=a?(a=Gn(r,a),i=Gn(r,i),(o>0?ai)&&(a+=o*Ct)):(a=t+o*Ct,i=t-.5*l);for(var c,u=a;o>0?u>i:u2?t[2]*Pt:0),e.invert=function(e){return(e=t.invert(e[0]*Pt,e[1]*Pt))[0]*=It,e[1]*=It,e},e},Nn.invert=Bn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function a(){var t="function"==typeof r?r.apply(this,arguments):r,n=jn(-t[0]*Pt,-t[1]*Pt,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=n(t,e)),t[0]*=It,t[1]*=It}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(r=t,a):r},a.angle=function(r){return arguments.length?(e=qn((t=+r)*Pt,n*Pt),a):t},a.precision=function(r){return arguments.length?(e=qn(t*Pt,(n=+r)*Pt),a):n},a.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Pt,a=t[1]*Pt,i=e[1]*Pt,o=Math.sin(n),s=Math.cos(n),l=Math.sin(a),c=Math.cos(a),u=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},t.geo.graticule=function(){var e,r,n,a,i,o,s,l,c,u,f,p,h=10,d=h,g=90,v=360,m=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(a/g)*g,n,g).map(f).concat(t.range(Math.ceil(l/v)*v,s,v).map(p)).concat(t.range(Math.ceil(r/h)*h,e,h).filter((function(t){return y(t%g)>Mt})).map(c)).concat(t.range(Math.ceil(o/d)*d,i,d).filter((function(t){return y(t%v)>Mt})).map(u))}return x.lines=function(){return b().map((function(t){return{type:"LineString",coordinates:t}}))},x.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(p(s).slice(1),f(n).reverse().slice(1),p(l).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],a>n&&(t=a,a=n,n=t),l>s&&(t=l,l=s,s=t),x.precision(m)):[[a,l],[n,s]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),o>i&&(t=o,o=i,i=t),x.precision(m)):[[r,o],[e,i]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],x):[g,v]},x.minorStep=function(t){return arguments.length?(h=+t[0],d=+t[1],x):[h,d]},x.precision=function(t){return arguments.length?(m=+t,c=Wn(o,i,90),u=Yn(r,e,m),f=Wn(l,s,90),p=Yn(a,n,m),x):m},x.majorExtent([[-180,-90+Mt],[180,90-Mt]]).minorExtent([[-180,-80-Mt],[180,80+Mt]])},t.geo.greatArc=function(){var e,r,n=Xn,a=Zn;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(t){return arguments.length?(a=t,r="function"==typeof t?null:t,i):a},i.precision=function(){return arguments.length?i:0},i},t.geo.interpolate=function(t,e){return r=t[0]*Pt,n=t[1]*Pt,a=e[0]*Pt,i=e[1]*Pt,o=Math.cos(n),s=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=o*Math.cos(r),f=o*Math.sin(r),p=l*Math.cos(a),h=l*Math.sin(a),d=2*Math.asin(Math.sqrt(Nt(i-n)+o*l*Nt(a-r))),g=1/Math.sin(d),(v=d?function(t){var e=Math.sin(t*=d)*g,r=Math.sin(d-t)*g,n=r*u+e*p,a=r*f+e*h,i=r*s+e*c;return[Math.atan2(a,n)*It,Math.atan2(i,Math.sqrt(n*n+a*a))*It]}:function(){return[r*It,n*It]}).distance=d,v;var r,n,a,i,o,s,l,c,u,f,p,h,d,g,v},t.geo.length=function(e){return Tn=0,t.geo.stream(e,Jn),Tn};var Jn={sphere:R,point:R,lineStart:function(){var t,e,r;function n(n,a){var i=Math.sin(a*=Pt),o=Math.cos(a),s=y((n*=Pt)-t),l=Math.cos(s);Tn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*i-e*o*l)*s),e*i+r*o*l),t=n,e=i,r=o}Jn.point=function(a,i){t=a*Pt,e=Math.sin(i*=Pt),r=Math.cos(i),Jn.point=n},Jn.lineEnd=function(){Jn.point=Jn.lineEnd=R}},lineEnd:R,polygonStart:R,polygonEnd:R};function Kn(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),i=t(n*a);return[i*a*Math.sin(e),i*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(t*i,n*o),Math.asin(n&&r*i/n)]},r}var $n=Kn((function(t){return Math.sqrt(2/(1+t))}),(function(t){return 2*Math.asin(t/2)}));(t.geo.azimuthalEqualArea=function(){return zn($n)}).raw=$n;var Qn=Kn((function(t){var e=Math.acos(t);return e&&e/Math.sin(e)}),P);function ta(t,e){var r=Math.cos(t),n=function(t){return Math.tan(St/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),i=r*Math.pow(n(t),a)/a;if(!a)return na;function o(t,e){i>0?e<-Ot+Mt&&(e=-Ot+Mt):e>Ot-Mt&&(e=Ot-Mt);var r=i/Math.pow(n(e),a);return[r*Math.sin(a*t),i-r*Math.cos(a*t)]}return o.invert=function(t,e){var r=i-e,n=Dt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(i/n,1/a))-Ot]},o}function ea(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/n+t;if(y(n)1&&zt(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function fa(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return zn(oa)}).raw=oa,sa.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ot]},(t.geo.transverseMercator=function(){var t=aa(sa),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=sa,t.geom={},t.geom.hull=function(t){var e=la,r=ca;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=xe(e),i=xe(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)h.push(t[s[c[n]][2]]);for(n=+f;nMt)s=s.L;else{if(!((a=i-Ca(s,o))>Mt)){n>-Mt?(e=s.P,r=s):a>-Mt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Ta(t);if(ya.insert(e,l),e||r){if(e===r)return Da(e),r=Ta(e.site),ya.insert(l,r),l.edge=r.edge=Fa(e.site,l.site),Ia(e),void Ia(r);if(r){Da(e),Da(r);var c=e.site,u=c.x,f=c.y,p=t.x-u,h=t.y-f,d=r.site,g=d.x-u,v=d.y-f,m=2*(p*v-h*g),y=p*p+h*h,x=g*g+v*v,b={x:(v*y-h*x)/m+u,y:(p*x-g*y)/m+f};Ba(r.edge,c,d,b),l.edge=Fa(c,t,null,b),r.edge=Fa(t,d,null,b),Ia(e),Ia(r)}else l.edge=Fa(e.site,l.site)}}function Sa(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,f=1/i-1/c,p=u/c;return f?(-p+Math.sqrt(p*p-2*f*(u*u/(-2*c)-l+c/2+a-i/2)))/f+n:(n+s)/2}function Ca(t,e){var r=t.N;if(r)return Sa(r,e);var n=t.site;return n.y===e?n.x:1/0}function La(t){this.site=t,this.edges=[]}function Oa(t,e){return e.angle-t.angle}function Pa(){Va(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ia(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,f=2*(l*(v=i.y-s)-c*u);if(!(f>=-Et)){var p=l*l+c*c,h=u*u+v*v,d=(v*p-c*h)/f,g=(l*h-u*p)/f,v=g+s,m=wa.pop()||new Pa;m.arc=t,m.site=a,m.x=d+o,m.y=v+Math.sqrt(d*d+g*g),m.cy=v,t.circle=m;for(var y=null,x=ba._;x;)if(m.y=s)return;if(p>d){if(i){if(i.y>=c)return}else i={x:v,y:l};r={x:v,y:c}}else{if(i){if(i.y1)if(p>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.xMt||y(a-r)>Mt)&&(s.splice(o,0,new Na((m=i.site,x=u,b=y(n-f)Mt?{x:f,y:y(e-f)Mt?{x:y(r-d)Mt?{x:p,y:y(e-p)Mt?{x:y(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)/Mt)*Mt,y:Math.round(a(t,e)/Mt)*Mt,i:e}}))}return o.links=function(t){return Ga(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 Ga(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,c=r.edges.sort(Oa),u=-1,f=c.length,p=c[f-1].edge,h=p.l===l?p.r:p.l;++ui||f>o||p=_)<<1|e>=b,k=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:ti(r,n)})),i=ni.lastIndex;return ig&&(g=l.x),l.y>v&&(v=l.y),c.push(l.x),u.push(l.y);else for(f=0;fg&&(g=b),_>v&&(v=_),c.push(b),u.push(_)}var w=g-h,k=v-d;function T(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(y(l-r)+y(c-n)<.01)A(t,e,r,n,a,i,o,s);else{var u=t.point;t.x=t.y=t.point=null,A(t,u,l,c,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),c=.5*(i+s),u=r>=l,f=n>=c,p=f<<1|u;t.leaf=!1,u?a=l:o=l,f?i=c:s=c,T(t=t.nodes[p]||(t.nodes[p]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>k?v=d+w:g=h+k;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(M,t,+m(t,++f),+x(t,f),h,d,g,v)},visit:function(t){Ja(t,M,h,d,g,v)},find:function(t){return Ka(M,t[0],t[1],h,d,g,v)}};if(f=-1,null==e){for(;++f=0&&!(n=t.interpolators[a](e,r)););return n}function ii(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 ui(t){return function(e){return 1-t(1-e)}}function fi(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function pi(t){return t*t}function hi(t){return t*t*t}function di(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 gi(t){return 1-Math.cos(t*Ot)}function vi(t){return Math.pow(2,10*(t-1))}function mi(t){return 1-Math.sqrt(1-t*t)}function yi(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 xi(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function bi(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=wi(a),s=_i(a,i),l=wi(((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=si.get(n)||oi,ci((a=li.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;return 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),function(t){return Jt(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;return 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),function(t){return Yt(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 ne(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=xi,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 bi(e?e.matrix:ki)})(e)},bi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ki={a:1,b:0,c:0,d:1,e:0,f:0};function Ti(t){return t.length?t.pop()+",":""}function Ai(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:ti(t[0],e[0])},{i:a-2,x:ti(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(Ti(r)+"rotate(",null,")")-2,x:ti(t,e)})):e&&r.push(Ti(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(Ti(r)+"skewX(",null,")")-2,x:ti(t,e)}):e&&r.push(Ti(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(Ti(r)+"scale(",null,",",null,")");n.push({i:a-4,x:ti(t[0],e[0])},{i:a-2,x:ti(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Ti(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=Ee(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,u=c[0],d=c[1];for(t=0;t=0;)r.push(a[n])}function Ni(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 Ni(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&&(Bi(t,(function(t){t.children&&(t.value=0)})),Ni(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 Qi(t){return t.reduce(to,0)}function to(t,e){return t+e[1]}function eo(t,e){return ro(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function ro(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 no(e){return[t.min(e),t.max(e)]}function ao(t,e){return t.value-e.value}function io(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function oo(t,e){t._pack_next=e,e._pack_prev=t}function so(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 lo(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,c=1/0,u=-1/0,f=1/0,p=-1/0;if(e.forEach(co),(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(fo(r,n,a=e[2]),x(a),io(r,a),r._pack_prev=a,io(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=c[t.bisect(p,l,1,d)-1]).y+=g,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=xe(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return ro(e,t)}:xe(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(ao),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,Ni(s,(function(t){t.r=+u(t.value)})),Ni(s,lo),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;Ni(s,(function(t){t.r+=f})),Ni(s,lo),Ni(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;++oh.x&&(h=t),t.depth>d.depth&&(d=t)}));var g=r(p,h)/2-p.x,v=n[0]/(h.x+r(h,p)/2+g),m=n[1]/(d.depth||1);Bi(u,(function(t){t.x=(t.x+g)*v,t.y=t.depth*m}))}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){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)}(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,f=s.m,p=l.m;s=go(s),i=ho(i),s&&i;)l=ho(l),(o=go(o)).a=t,(a=s.z+f-i.z-c+r(s._,i._))>0&&(vo(mo(s,t,n),t,a),c+=a,u+=a),f+=s.m,c+=i.m,p+=l.m,u+=o.m;s&&!go(o)&&(o.t=s,o.m+=f-u),i&&!ho(l)&&(l.t=i,l.m+=c-p,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},Fi(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=po,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),c=l[0],u=0;Ni(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),p=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),h=f.x-r(f,p)/2,d=p.x+r(p,f)/2;return Ni(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},Fi(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=yo,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,g))<=p?(c.pop(),p=n):(s.area-=s.pop().area,d(s,g,i,!1),g=Math.min(i.dx,i.dy),s.length=s.area=0,p=1/0);s.length&&(d(s,g,i,!0),s.length=s.area=0),e.forEach(f)}}function p(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(p)}}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?Mo:wo,s=a?Ei:Mi;return i=t(e,r,s,n),o=t(r,e,s,ai),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(xi)},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 Lo(e,t)},l.tickFormat=function(t,r){return Oo(e,t,r)},l.nice=function(t){return So(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],ai,!1)};var Po={s:1,g:1,p:1,r:1,e:1};function Io(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,a,i){function o(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return a?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}return l.invert=function(t){return s(r.invert(t))},l.domain=function(t){return arguments.length?(a=t[0]>=0,r.domain((i=t.map(Number)).map(o)),l):i},l.base=function(t){return arguments.length?(n=+t,r.domain(i.map(o)),l):n},l.nice=function(){var t=ko(i.map(o),a?Math:zo);return r.domain(t),i=t.map(s),l},l.ticks=function(){var t=bo(i),e=[],r=t[0],l=t[1],c=Math.floor(o(r)),u=Math.ceil(o(l)),f=n%1?2:n;if(isFinite(u-c)){if(a){for(;c0;p--)e.push(s(c)*p);for(c=0;e[c]l;u--);e=e.slice(c,u)}return e},l.tickFormat=function(e,r){if(!arguments.length)return Do;arguments.length<2?r=Do:"function"!=typeof r&&(r=t.format(r));var a=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n0?a[t-1]:r[0],tf?0:1;if(c=Lt)return l(c,h)+(s?l(s,1-h):"")+"Z";var d,g,v,m,y,x,b,_,w,k,T,A,M=0,E=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Uo?Math.sqrt(s*s+c*c):+n.apply(this,arguments),h||(E*=-1),c&&(E=Ft(v/c*Math.sin(m))),s&&(M=Ft(v/s*Math.sin(m)))),c){y=c*Math.cos(u+E),x=c*Math.sin(u+E),b=c*Math.cos(f-E),_=c*Math.sin(f-E);var C=Math.abs(f-u-2*E)<=St?0:1;if(E&&Xo(y,x,b,_)===h^C){var L=(u+f)/2;y=c*Math.cos(L),x=c*Math.sin(L),b=_=null}}else y=x=0;if(s){w=s*Math.cos(f-M),k=s*Math.sin(f-M),T=s*Math.cos(u+M),A=s*Math.sin(u+M);var O=Math.abs(u-f+2*M)<=St?0:1;if(M&&Xo(w,k,T,A)===1-h^O){var P=(u+f)/2;w=s*Math.cos(P),k=s*Math.sin(P),T=A=null}}else w=k=0;if(p>Mt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function Zo(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,f=t[1]+c,p=e[0]+l,h=e[1]+c,d=(u+p)/2,g=(f+h)/2,v=p-u,m=h-f,y=v*v+m*m,x=r-n,b=u*h-p*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,k=(-b*v-m*_)/y,T=(b*m+v*_)/y,A=(-b*v+m*_)/y,M=w-d,E=k-g,S=T-d,C=A-g;return M*M+E*E>S*S+C*C&&(w=T,k=A),[[w-l,k-c],[w*r/x,k*r/x]]}function Jo(t){var e=la,r=ca,n=Kr,a=$o,i=a.key,o=.7;function s(i){var s,l=[],c=[],u=-1,f=i.length,p=xe(e),h=xe(r);function d(){l.push("M",a(t(c),o))}for(;++u1&&a.push("H",n[0]),a.join("")},"step-before":ts,"step-after":es,basis:as,"basis-open":function(t){if(t.length<4)return $o(t);for(var e,r=[],n=-1,a=t.length,i=[0],o=[0];++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);for(r.push(is(ls,i)+","+is(ls,o)),--n;++n9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));for(s=-1;++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 $o(t){return t.length>1?t.join("L"):t+"Z"}function Qo(t){return t.join("L")+"Z"}function ts(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;cSt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=xe(t),i):r},i.source=function(e){return arguments.length?(t=xe(e),i):t},i.target=function(t){return arguments.length?(e=xe(t),i):e},i.startAngle=function(t){return arguments.length?(n=xe(t),i):n},i.endAngle=function(t){return arguments.length?(a=xe(t),i):a},i},t.svg.diagonal=function(){var t=Xn,e=Zn,r=ds;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=xe(e),n):t},n.target=function(t){return arguments.length?(e=xe(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=ds,n=e.projection;return e.projection=function(t){return arguments.length?n(gs(r=t)):r},e},t.svg.symbol=function(){var t=ms,e=vs;function r(r,n){return(xs.get(t.call(this,r,n))||ys)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=xe(e),r):t},r.size=function(t){return arguments.length?(e=xe(t),r):e},r};var xs=t.map({circle:ys,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*_s)),r=e*_s;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/bs),r=e*bs/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/bs),r=e*bs/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=xs.keys();var bs=Math.sqrt(3),_s=Math.tan(30*Pt);X.transition=function(t){for(var e,r,n=As||++Ss,a=Os(t),i=[],o=Ms||{time:Date.now(),ease:di,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--p].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(i=a.time,o=Ee((function(t){var e=f.delay;if(o.t=e+i,e<=t)return p(t-e);o.c=p}),0,i),f=u[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}Es.call=X.call,Es.empty=X.empty,Es.node=X.node,Es.size=X.size,t.transition=function(e,r){return e&&e.transition?As?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=Es,Es.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 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),x=n.of(m,arguments),b=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),A=wt(m),M=t.mouse(m),E=t.select(o(m)).on("keydown.brush",(function(){32==t.event.keyCode&&(T||(f=null,M[0]-=s[1],M[1]-=l[1],T=2),N())})).on("keyup.brush",(function(){32==t.event.keyCode&&2==T&&(M[0]+=s[1],M[1]+=l[1],T=0,N())}));if(t.event.changedTouches?E.on("touchmove.brush",L).on("touchend.brush",P):E.on("mousemove.brush",L).on("mouseup.brush",P),b.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 L(){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?{floor:function(e){for(;s(e=t.floor(e));)e=qs(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=qs(+e+1);return e}}:t))},a.ticks=function(t,e){var r=bo(a.domain()),n=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],qs(+r[1]+1),e<1?1:e)},a.tickFormat=function(){return n},a.copy=function(){return Hs(e.copy(),r,n)},Eo(a,e)}function qs(t){return new Date(t)}Ns.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Us:Vs,Us.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Us.toString=Vs.toString,Fe.second=Ve((function(t){return new Be(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),Fe.seconds=Fe.second.range,Fe.seconds.utc=Fe.second.utc.range,Fe.minute=Ve((function(t){return new Be(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),Fe.minutes=Fe.minute.range,Fe.minutes.utc=Fe.minute.utc.range,Fe.hour=Ve((function(t){var e=t.getTimezoneOffset()/60;return new Be(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),Fe.hours=Fe.hour.range,Fe.hours.utc=Fe.hour.utc.range,Fe.month=Ve((function(t){return(t=Fe.day(t)).setDate(1),t}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),Fe.months=Fe.month.range,Fe.months.utc=Fe.month.utc.range;var Gs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ws=[[Fe.second,1],[Fe.second,5],[Fe.second,15],[Fe.second,30],[Fe.minute,1],[Fe.minute,5],[Fe.minute,15],[Fe.minute,30],[Fe.hour,1],[Fe.hour,3],[Fe.hour,6],[Fe.hour,12],[Fe.day,1],[Fe.day,2],[Fe.week,1],[Fe.month,1],[Fe.month,3],[Fe.year,1]],Ys=Ns.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Kr]]),Xs={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(qs)},floor:P,ceil:P};Ws.year=Fe.year,Fe.scale=function(){return Hs(t.scale.linear(),Ws,Ys)};var Zs=Ws.map((function(t){return[t[0].utc,t[1]]})),Js=js.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Kr]]);function Ks(t){return JSON.parse(t.responseText)}function $s(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}Zs.year=Fe.year.utc,Fe.scale.utc=function(){return Hs(t.scale.linear(),Zs,Js)},t.text=be((function(t){return t.responseText})),t.json=function(t,e){return _e(t,"application/json",Ks,e)},t.html=function(t,e){return _e(t,"text/html",$s,e)},t.xml=be((function(t){return t.responseXML})),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],165:[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})),1&s)for(u=0;u<_.length;++u)p=(b=_[u])[0],b[0]=b[1],b[1]=p;return _}},{"incremental-convex-hull":414,uniq:545}],167:[function(t,e,r){"use strict";e.exports=i;var n=(i.canvas=document.createElement("canvas")).getContext("2d"),a=o([32,126]);function i(t,e){Array.isArray(t)&&(t=t.join(", "));var r,i={},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=a),n.font=s+"px "+t;for(var c=0;cs*l){var h=(p-f)/s;i[u]=1e3*h}}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,t("buffer").Buffer)},{buffer:106}],169:[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":62,"normalize-svg-path":453}],170:[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}}},{}],171:[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),h>c&&(c=h);d=0!==(d=Math.max(l-n,c-s))?1/d:0}return o(y,x,r,n,s,d),x}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=A(i,t[i],t[i+1],o);return o&&x(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||!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,a,f,p){if(t){!p&&f&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=d(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,f);for(var h,g,v=t;t.prev!==t.next;)if(h=t.prev,g=t.next,f?l(t,n,a,f):s(t))e.push(h.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){p?1===p?o(t=c(i(t),e,r),e,r,n,a,f,2):2===p&&u(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,u=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=d(s,l,e,r,n),p=d(c,u,e,r,n),h=t.prevZ,g=t.nextZ;h&&h.z>=f&&g&&g.z<=p;){if(h!==t.prev&&h!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&y(h.prev,h,h.next)>=0)return!1;if(h=h.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(;h&&h.z>=f;){if(h!==t.prev&&h!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&y(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;g&&g.z<=p;){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 c(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!x(a,o)&&b(a,n,n.next,o)&&k(a,o)&&k(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 u(t,e,r,n,a,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var u=T(l,c);return l=i(l,l.next),u=i(u,u.next),o(l,e,r,n,a,s),void o(u,e,r,n,a,s)}c=c.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function p(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&&v(ir.x||n.x===r.x&&h(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(t,e)){var r=T(e,t);i(r,r.next)}}function h(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(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&&b(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(k(t,e)&&k(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))||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 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 k(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 A(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}},{}],173:[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=e}))}(e);for(var r,a=n(t).components.filter((function(t){return t.length>1})),i=1/0,o=0;o=55296&&y<=56319&&(w+=t[++r]),w=k?p.call(k,T,w,g):w,e?(h.value=w,d(v,g,h)):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}},{}],185:[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":182}],186:[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":185}],187:[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,c){var u,f=arguments[2],p=arguments[3];return r=Object(a(r)),n(c),u=s(r),p&&u.sort("function"==typeof p?i.call(p,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":205,"./valid-value":207}],188:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":189,"./shim":190}],189:[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")}},{}],190:[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}},{}],211:[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}},{}],212:[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}},{}],213:[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("./"),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?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",c(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}))}),c(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":216,d:152,"es5-ext/object/set-prototype-of":202,"es5-ext/string/#/contains":208,"es6-symbol":221}],214:[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,c=Array.prototype.some;e.exports=function(t,e){var r,u,f,p,h,d,g,v,m=arguments[2];if(s(t)||n(t)?r="array":i(t)?r="string":t=o(t),a(e),f=function(){p=!0},"array"!==r)if("string"!==r)for(u=t.next();!u.done;){if(l.call(e,m,u.value,f),p)return;u=t.next()}else for(d=t.length,h=0;h=55296&&v<=56319&&(g+=t[++h]),l.call(e,m,g,f),!p);++h);else c.call(t,(function(t){return l.call(e,m,t,f),p}))}},{"./get":215,"es5-ext/function/is-arguments":179,"es5-ext/object/valid-callable":205,"es5-ext/string/is-string":211}],215:[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":213,"./string":218,"./valid-iterable":219,"es5-ext/function/is-arguments":179,"es5-ext/string/is-string":211,"es6-symbol":221}],216:[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"),c=t("d/auto-bind"),u=t("es6-symbol"),f=Object.defineProperty,p=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");p(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,p(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,u.iterator,l((function(){return this})))},{d:152,"d/auto-bind":151,"es5-ext/array/#/clear":175,"es5-ext/object/assign":188,"es5-ext/object/valid-callable":205,"es5-ext/object/valid-value":207,"es6-symbol":221}],217:[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":179,"es5-ext/object/is-value":196,"es5-ext/string/is-string":211,"es6-symbol":221}],218:[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"))},{"./":216,d:152,"es5-ext/object/set-prototype-of":202,"es6-symbol":221}],219:[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":217}],220:[function(t,r,n){(function(e,a){ +"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var a=2147483647;function o(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(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 c(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=o(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return f(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=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function p(t,e){if(s.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 R(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(i)return n?-1:R(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(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),j(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=s.from(e,n)),s.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 u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-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 k(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&u)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=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&u)<<18|(63&a)<<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),i+=f}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.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 S(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},s.prototype.compare=function(t,e,r,n,i){if(N(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.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(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var a=i-n,o=r-e,l=Math.min(a,o),u=this.slice(n,i),c=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 y(this,t,e,r);case"ascii":return x(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function M(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;ii)&&(r=i);for(var a="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,a){if(!s.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 I(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,n,a){return e=+e,r>>>=0,a||I(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,a){return e=+e,r>>>=0,a||I(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.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],i=1,a=0;++a>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},s.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]},s.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])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(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},s.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.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},s.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},s.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},s.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]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var a=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var a=r-1,o=1;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.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;--a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.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&&!s.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(a=e;a55295&&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 F(t){return n.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 B(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 j(t){return t!=t}},{"base64-js":67,ieee754:407}],99:[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 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),p=!!u(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var d=n(t,e);if(c||f!==h||p){for(var v=i(t.length,function(t){return t.map(s).sort(l)}(e)),g=0;g0;){for(var c=r.pop(),s=r.pop(),f=-1,h=-1,l=o[s],d=1;d=0||(e.flip(s,c),i(t,e,r,f,s,h),i(t,e,r,s,h,f),i(t,e,r,h,c,f),i(t,e,r,c,f,h))}}},{"binary-search-bounds":104,"robust-in-sphere":495}],101:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(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}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(;o.length>0;){var p=o.pop();if(u[p]!==-a){u[p]=a,c[p];for(var d=0;d<3;++d){var v=h[3*p+d];v>=0&&0===u[v]&&(f[3*p+d]?l.push(v):(o.push(v),u[v]=a))}}}var g=l;l=o,o=g,l.length=0,a=-a}var m=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);for(var d=c.upperIds,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 p(t,e){var r;return(r=t.a[0]m[0]&&i.push(new u(m,g,s,f),new u(g,m,o,f))}i.sort(c);for(var y=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),x=[new l([y,1],[y,0],-1,[],[],[],[])],b=[],f=0,_=i.length;f<_;++f){var w=i[f],k=w.type;k===a?h(b,x,t,w.a,w.idx):k===s?d(x,0,w):v(x,0,w)}return b}},{"binary-search-bounds":104,"robust-orientation":497}],103:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n=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;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],105:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],109:[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 m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=n[a];c=x[0];var b=e[c],_=b[0],w=b[1],k=t[_],A=t[w];if((k[0]-A[0]||k[1]-A[1])<0){var T=_;_=w,w=T}b[0]=_;var M,E=b[1]=x[1];for(i&&(M=b[2]);a>0&&n[a-1][0]===c;){var x=n[--a],S=x[1];i?e.push([E,S,M]):e.push([E,S]),E=S}i?e.push([E,w,M]):e.push([E,w])}return h}(t,e,h,g,r),x=d(t,y);return m(e,x,r),!!x||h.length>0||g.length>0}},{"./lib/rat-seg-intersect":110,"big-rat":71,"big-rat/cmp":69,"big-rat/to-float":83,"box-intersect":89,nextafter:446,"rat-vec":481,"robust-segment-intersect":500,"union-find":533}],110:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=c(a,f);if(0===o(h))return null;var p=s(t,r),d=c(f,p),v=i(d,h),g=u(a,v);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"),u=t("rat-vec/muls");function c(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":70,"big-rat/mul":80,"big-rat/sign":81,"big-rat/sub":82,"rat-vec/add":480,"rat-vec/muls":482,"rat-vec/sub":483}],111:[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];null==o&&(o=e?1:255),e&&(r*=255,i*=255,a*=255,o*=255),r=255&n(r,0,255),i=255&n(i,0,255),a=255&n(a,0,255),o=255&n(o,0,255);var s=16777216*r+(i<<16)+(a<<8)+o;return s}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:108}],112:[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]}},{}],113:[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=a(e),o=new r(4),s="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)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.floor(255*t[0]),0,255),o[1]=i(Math.floor(255*t[1]),0,255),o[2]=i(Math.floor(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:108,"color-rgba":115,dtype:163}],114:[function(t,r,n){(function(e){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");r.exports=function(t){var r,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=t.slice(1),f=c.length,h=f<=4;u=1,h?(l=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===f&&(u=parseInt(c[3]+c[3],16)/255)):(l=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===f&&(u=parseInt(c[6]+c[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(r=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var p=r[1],c=p.replace(/a$/,"");s=c;var f="cmyk"===c?4:"gray"===c?1:3;l=r[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===f?parseFloat(t)/100:"rgb"===c?255*parseFloat(t)/100:parseFloat(t);if("h"===c[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),p===c&&l.push(1),u=void 0===l[f]?1:l[f],l=l.slice(0,f)}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)]),u=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||e.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,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":112,defined:158,"is-plain-obj":417}],115:[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:108,"color-parse":114,"color-space/hsl":116}],116:[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 u=0;u<3;u++)(n=o+1/3*-(u-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[u]=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":117}],117:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],118:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index: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]}]}},{}],119:[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)e=(e=t[n]).toString(16),r+=("00"+e).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,u,c,f,h,p,d,v;if(t||(t={}),p=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet"),"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>p+1)throw new Error(f+" map requires nshades to be at least size "+c.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=c.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=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:(n[3]=d[0]+(d[1]-d[0])*r,n)}),m=[];for(v=0;v0?-1:l(t,e,a)?-1:1:0===s?u>0?1:l(t,e,r)?1:-1:i(u-s)}var h=n(t,e,r);if(h>0)return o>0&&n(t,e,a)>0?1:-1;if(h<0)return o>0||n(t,e,a)>0?1:-1;var p=n(t,e,a);return p>0?1: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]),u=a(r[1],-e[1]),c=s(o(n,l),o(i,u));return c[c.length-1]>=0}},{"robust-orientation":497,"robust-product":498,"robust-sum":502,signum:503,"two-sum":531}],121:[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]),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],p=t[3],d=e[0],v=e[1],g=e[2],m=e[3];return c+f+h+p-(d+v+g+m)||n(c,f,h,p)-n(d,v,g,m,d)||n(c+f,c+h,c+p,f+h,f+p,h+p)-n(d+v,d+g,d+m,v+g,v+m,g+m)||n(c+f+h,c+f+p,c+h+p,f+h+p)-n(d+v+g,d+v+m,d+g+m,v+g+m);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]]}},{}],125:[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}(o,r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":55,"incremental-convex-hull":408}],127:[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|ç)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"}},{}],128:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],129:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],130:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],131:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],132:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":134,"./stringify":135}],133:[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":128}],134:[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"),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!==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=u(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(c(e)){var d=u(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=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 p(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":133,"css-font-stretch-keywords":129,"css-font-style-keywords":130,"css-font-weight-keywords":131,"css-global-keywords":136,"css-system-font-keywords":137,"string-split-by":516,unquote:535}],135:[function(t,e,r){"use strict";var n=t("pick-by-alias"),i=t("./lib/util").isSize,a=d(t("css-global-keywords")),o=d(t("css-system-font-keywords")),s=d(t("css-font-weight-keywords")),l=d(t("css-font-style-keywords")),u=d(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={style:"normal",variant:"normal",weight:"normal",stretch:"normal",size:"1rem",lineHeight:"normal",family:"serif"};function p(t,e){if(t&&!e[t]&&!a[t])throw Error("Unknown keyword `"+t+"`");return t}function d(t){for(var e={},r=0;r=0;--p)a[p]=u*t[p]+c*e[p]+f*r[p]+h*n[p];return a}return u*t+c*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,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}},{}],139:[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":141}],140:[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=[],u=[],c=0,f=0;for(n=0;n0&&l.push("var "+u.join(",")),n=a-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 a(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var x=new Array(r),l=0;l0&&m.push("var "+y.join(","));for(var l=0;l3&&m.push(a(t.pre,t,s));var k=a(t.body,t,s),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(var c=0;c3&&m.push(a(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+m.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",A,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",T,"(",g.join(","),"){",m.join("\n"),"} return ",T].join(""))()}},{uniq:534}],141:[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=[],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])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;ce?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,u=0;if(null==e)for(;++o1)return u/(a-1)}function u(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function c(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>=m?10:a>=y?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=m?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>=m?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),l=+r(t[a+1],a+1,t);return o+(l-o)*(i-a)}}function A(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 T(t){if(!(i=t.length))return[];for(var e=-1,r=A(t,M),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=u,t.extent=c,t.histogram=function(){var t=v,e=c,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;af;)h.pop(),--p;var d,v=new Array(p+1);for(a=0;a<=p;++a)(d=v[a]=[]).x0=a>0?h[a-1]:c,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(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r},t.min=A,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,u,f,h=-1,p=n.length,d=l[i++],v=r(),g=a();++hl.length)return r;var i,a=u[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}(c(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return u[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=u,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})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],147:[function(t,e,r){var n;n=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=1/.7,a="\\s*([+-]?\\d+)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",s="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l=/^#([0-9a-f]{3})$/,u=/^#([0-9a-f]{6})$/,c=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),f=new RegExp("^rgb\\("+[s,s,s]+"\\)$"),h=new RegExp("^rgba\\("+[a,a,a,o]+"\\)$"),p=new RegExp("^rgba\\("+[s,s,s,o]+"\\)$"),d=new RegExp("^hsl\\("+[o,s,s]+"\\)$"),v=new RegExp("^hsla\\("+[o,s,s,o]+"\\)$"),g={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(t){var e;return t=(t+"").trim().toLowerCase(),(e=l.exec(t))?new w((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=u.exec(t))?y(parseInt(e[1],16)):(e=c.exec(t))?new w(e[1],e[2],e[3],1):(e=f.exec(t))?new w(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=h.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=d.exec(t))?A(e[1],e[2]/100,e[3]/100,1):(e=v.exec(t))?A(e[1],e[2]/100,e[3]/100,e[4]):g.hasOwnProperty(t)?y(g[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=m(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 k(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 M(t,e,r,n)}function T(t,e,r,i){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=m(t)),!t)return new M;if(t instanceof M)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,u=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r0&&u<1?0:s,new M(s,l,u,t.opacity)}(t):new M(t,e,r,null==i?1:i)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function E(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,m,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),e(w,_,r(n,{brighter:function(t){return t=null==t?i:Math.pow(i,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 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+k(this.r)+k(this.g)+k(this.b)},toString:function(){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+")")}})),e(M,T,r(n,{brighter:function(t){return t=null==t?i:Math.pow(i,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(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(E(t>=240?t-240:t+120,i,n),E(t,i,n),E(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var S=Math.PI/180,C=180/Math.PI,L=.96422,O=1,I=.82521,P=4/29,D=6/29,z=3*D*D,R=D*D*D;function F(t){if(t instanceof N)return new N(t.l,t.a,t.b,t.opacity);if(t instanceof W){if(isNaN(t.h))return new N(t.l,0,0,t.opacity);var e=t.h*S;return new N(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof w||(t=b(t));var r,n,i=H(t.r),a=H(t.g),o=H(t.b),s=j((.2225045*i+.7168786*a+.0606169*o)/O);return i===a&&a===o?r=n=s:(r=j((.4360747*i+.3850649*a+.1430804*o)/L),n=j((.0139322*i+.0971045*a+.7141733*o)/I)),new N(116*s-16,500*(r-s),200*(s-n),t.opacity)}function B(t,e,r,n){return 1===arguments.length?F(t):new N(t,e,r,null==n?1:n)}function N(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function j(t){return t>R?Math.pow(t,1/3):t/z+P}function V(t){return t>D?t*t*t:z*(t-P)}function U(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function H(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function q(t){if(t instanceof W)return new W(t.h,t.c,t.l,t.opacity);if(t instanceof N||(t=F(t)),0===t.a&&0===t.b)return new W(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*C;return new W(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function G(t,e,r,n){return 1===arguments.length?q(t):new W(t,e,r,null==n?1:n)}function W(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}e(N,B,r(n,{brighter:function(t){return new N(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new N(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=L*V(e),t=O*V(t),r=I*V(r),new w(U(3.1338561*e-1.6168667*t-.4906146*r),U(-.9787684*e+1.9161415*t+.033454*r),U(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),e(W,G,r(n,{brighter:function(t){return new W(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new W(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return F(this).rgb()}}));var Y=-.14861,X=1.78277,Z=-.29227,$=-.90649,J=1.97294,K=J*$,Q=J*X,tt=X*Z-$*Y;function et(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof rt)return new rt(t.h,t.s,t.l,t.opacity);t instanceof w||(t=b(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(tt*n+K*e-Q*r)/(tt+K-Q),a=n-i,o=(J*(r-i)-Z*a)/$,s=Math.sqrt(o*o+a*a)/(J*i*(1-i)),l=s?Math.atan2(o,a)*C-120:NaN;return new rt(l<0?l+360:l,s,i,t.opacity)}(t):new rt(t,e,r,null==n?1:n)}function rt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e(rt,et,r(n,{brighter:function(t){return t=null==t?i:Math.pow(i,t),new rt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new rt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*S,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new w(255*(e+r*(Y*n+X*i)),255*(e+r*(Z*n+$*i)),255*(e+r*(J*n)),this.opacity)}})),t.color=m,t.rgb=_,t.hsl=T,t.lab=B,t.hcl=G,t.lch=function(t,e,r,n){return 1===arguments.length?q(t):new W(r,e,t,null==n?1:n)},t.gray=function(t,e){return new N(t,0,0,null==e?1:e)},t.cubehelix=et,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],148:[function(t,e,r){var n;n=this,function(t){"use strict";var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),l=-1,u=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l0)for(var r,n,i=new Array(r),a=0;ah+u||np+u||ac.index){var f=h-s.x-s.vx,g=p-s.y-s.vy,m=f*f+g*g;mt.r&&(t.r=t[e].r)}function h(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e=u)){(t.data!==r||t.next)&&(0===f&&(f=o(),d+=f*f),0===h&&(h=o(),d+=h*h),d1?(null==r?c.remove(t):c.set(t,y(r)),e):c.get(t)},find:function(e,r,n){var i,a,o,s,l,u=0,c=t.length;for(null==n?n=1/0:n*=n,u=0;u1?(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;a=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,c=new u(t),f=+t.value&&(c.value=t.value),h=[c];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 u(i[a])),n.parent=r,n.depth=r.depth+1;return c.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 u(t){this.data=t,this.depth=this.height=0,this.parent=null}u.prototype=a.prototype={constructor:u,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;for(t=r.pop(),e=n.pop();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 c=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}(c.call(t))).length,a=[];n0&&r*r>n*n+i*i}function v(t,e){for(var r=0;r(o*=o)?(n=(u+o-i)/(2*u),a=Math.sqrt(Math.max(0,o/u-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(u+i-o)/(2*u),a=Math.sqrt(Math.max(0,i/u-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 k(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,u,c,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=c*c*v,(p=Math.max(h/g,g/f))>d){c-=s;break}d=p}m.push(o={value:c,dice:l1?e:1)},r}(G),X=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,u,c,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 u=function(t){for(var e;e=t.children;)t=e[0];return t}(e),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),f=u.x-t(u,c)/2,h=c.x+t(c,u)/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=T;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(S(t)).eachAfter(C(n,.5)).eachBefore(L(1)):i.eachBefore(S(E)).eachAfter(C(T,1)).eachAfter(C(n,i.r/Math.min(e,r))).eachBefore(L(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(r=e)?null:A(r),i):t;var r},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:M(+t),i):n},i},t.packSiblings=function(t){return k(t),t},t.packEnclose=f,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&&I(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 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 u=i,c=i,f=i;i.eachBefore(function(t){t.xc.x&&(c=t),t.depth>f.depth&&(f=t)});var h=u===c?1:t(u,c)/2,p=h-u.x,d=e/(c.x+h+p),v=r/(f.depth||1);i.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*v})}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],u=a.m,c=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-u+t(s._,a._))>0&&(V(U(s,e,n),e,i),u+=i,c+=i),f+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!j(o)&&(o.t=s,o.m+=f-c),a&&!N(l)&&(l.t=a,l.m+=u-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=Y,e=!1,r=1,n=1,i=[0],a=T,o=T,s=T,l=T,u=T;function c(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(f),i=[0],e&&t.eachBefore(O),t}function f(e){var r=i[e.depth],n=e.x0+r,c=e.y0+r,f=e.x1-r,h=e.y1-r;f=r-1){var c=s[e];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=l)}for(var f=u[e],h=n/2+f,p=e+1,d=r-1;p>>1;u[v]l-a){var y=(i*m+o*g)/n;t(e,p,g,i,a,y,l),t(p,r,m,y,a,o,l)}else{var x=(a*m+l*g)/n;t(e,p,g,i,a,o,x),t(p,r,m,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=I,t.treemapSlice=q,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?q:I)(t,e,r,n,i)},t.treemapSquarify=Y,t.treemapResquarify=X,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],151:[function(t,e,r){var n,i;n=this,i=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)?u: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 u(t,e){var r=e-t;return r?o(t,r):a(isNaN(t)?e:t)}var c=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=u(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:g(r,n)})),a=x.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:g(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:g(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:g(t,r)},{i:s-2,x:g(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-u*c)>1e-6&&a){var p=n-o,d=i-s,v=l*l+u*u,g=p*p+d*d,m=Math.sqrt(v),y=Math.sqrt(h),x=a*Math.tan((e-Math.acos((v+h-g)/(2*m*y)))/2),b=x/y,_=x/m;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*c)+","+(r+b*f)),this._+="A"+a+","+a+",0,0,"+ +(f*p>c*d)+","+(this._x1=t+_*l)+","+(this._y1=r+_*u)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,i,a,o,s,l){t=+t,i=+i;var u=(a=+a)*Math.cos(o),c=a*Math.sin(o),f=t+u,h=i+c,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-u)+","+(i-c)+"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})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],153:[function(t,e,r){var n;n=this,function(t){"use strict";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,u,c,f,h,p=t._root,d={data:n},v=t._x0,g=t._y0,m=t._x1,y=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((u=e>=(a=(v+m)/2))?v=a:m=a,(c=r>=(o=(g+y)/2))?g=o:y=o,i=p,!(p=p[f=c<<1|u]))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),(u=e>=(a=(v+m)/2))?v=a:m=a,(c=r>=(o=(g+y)/2))?g=o:y=o}while((f=c<<1|u)==(h=(l>=o)<<1|s>=a));return i[h]=p,i[f]=d,t}var r=function(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),u=1/0,c=1/0,f=-1/0,h=-1/0;for(n=0;nf&&(f=i),ah&&(h=a));for(ft||t>i||n>e||e>a))return this;var o,s,l=i-r,u=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{(o=new Array(4))[s]=u,u=o}while(a=n+(l*=2),t>(i=r+l)||e>a);break;case 1:do{(o=new Array(4))[s]=u,u=o}while(a=n+(l*=2),(r=i-l)>t||e>a);break;case 2:do{(o=new Array(4))[s]=u,u=o}while(n=a-(l*=2),t>(i=r+l)||n>e);break;case 3:do{(o=new Array(4))[s]=u,u=o}while(n=a-(l*=2),(r=i-l)>t||n>e)}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var i,a,o,s,l,u,c,f=this._x0,h=this._y0,p=this._x1,d=this._y1,v=[],g=this._root;for(g&&v.push(new r(g,f,h,p,d)),null==n?n=1/0:(f=t-n,h=e-n,p=t+n,d=e+n,n*=n);u=v.pop();)if(!(!(g=u.node)||(a=u.x0)>p||(o=u.y0)>d||(s=u.x1)=y)<<1|t>=m)&&(u=v[v.length-1],v[v.length-1]=v[v.length-1-c],v[v.length-1-c]=u)}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,(c=o>=(l=(v+m)/2))?v=l:m=l,e=p,!(p=p[f=c<<1|u]))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||i>1)}function S(t,e,r){return t.sort(L),t.forEach(function(n,i){var a,o,s=0;if(G(n,r)&&E(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var u=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=u>s?u:s}n.circularPathData.verticalBuffer=s+n.width/2}}),t}function C(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={})});var s=t.links.filter(function(t){return"top"==t.circularLinkType});S(s,r,a);var l=t.links.filter(function(t){return"bottom"==t.circularLinkType});S(l,r,a),t.links.forEach(function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+w,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,G(e,a)&&E(e))e.circularPathData.leftSmallArcRadius=w+e.width/2,e.circularPathData.leftLargeArcRadius=w+e.width/2,e.circularPathData.rightSmallArcRadius=w+e.width/2,e.circularPathData.rightLargeArcRadius=w+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+_+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-_-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,u=t.links.filter(function(t){return t.source.column==s&&t.circularLinkType==l});"bottom"==e.circularLinkType?u.sort(I):u.sort(O);var c=0;u.forEach(function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+c,e.circularPathData.leftLargeArcRadius=w+e.width/2+n*r+c),c+=t.width}),s=e.target.column,u=t.links.filter(function(t){return t.target.column==s&&t.circularLinkType==l}),"bottom"==e.circularLinkType?u.sort(D):u.sort(P),c=0,u.forEach(function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+c,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+c),c+=t.width}),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+_+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-_-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){return"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}(e);else{var f=n.linkHorizontal().source(function(t){var e=t.source.x0+(t.source.x1-t.source.x0),r=t.y0;return[e,r]}).target(function(t){var e=t.target.x0,r=t.y1;return[e,r]});e.path=f(e)}})}function L(t,e){return z(t)==z(e)?"bottom"==t.circularLinkType?I(t,e):O(t,e):z(e)-z(t)}function O(t,e){return t.y0-e.y0}function I(t,e){return e.y0-t.y0}function P(t,e){return t.y1-e.y1}function D(t,e){return e.y1-t.y1}function z(t){return t.target.column-t.source.column}function R(t){return t.target.x0-t.source.x1}function F(t,e){var r=T(t),n=R(e)/Math.tan(r),i="up"==q(t)?t.y1+n:t.y1-n;return i}function B(t,e){var r=T(t),n=R(e)/Math.tan(r),i="up"==q(t)?t.y1-n:t.y1+n;return i}function N(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 u,c=s/(l+1),f=Math.pow(1-c,3),h=3*c*Math.pow(1-c,2),p=3*Math.pow(c,2)*(1-c),d=Math.pow(c,3),v=f*i.y0+h*i.y0+p*i.y1+d*i.y1,g=v-i.width/2,m=v+i.width/2;g>o.y0&&ga.y0&&i.y0a.y0&&i.y1a.y1)&&j(t,u,e,r)})):m>o.y0&&mo.y1&&j(t,u,e,r)})):go.y1&&(u=m-o.y0+10,o=j(o,u,e,r),t.nodes.forEach(function(t){b(t,n)!=b(o,n)&&t.column==o.column&&t.y0o.y1&&j(t,u,e,r)}))}})}})}function j(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 V(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(!H(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=B(e,t);return t.y1-r}if(e.target.column>t.target.column){var n=B(t,e);return n-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(!H(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function G(t,e){return b(t.source,e)==b(t.target,e)}t.sankeyCircular=function(){var t,n,a=0,b=0,T=1,E=1,S=24,L=g,O=o,I=m,P=y,D=32,z=2,R=null;function F(){var t={nodes:I.apply(null,arguments),links:P.apply(null,arguments)};!function(t){t.nodes.forEach(function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]});var e=r.map(t.nodes,L);t.links.forEach(function(t,r){t.index=r;var n=t.source,i=t.target;"object"!==(void 0===n?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==(void 0===i?"undefined":l(i))&&(i=t.target=x(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)})}(t),function(t,e,r){var n=0;if(null===r){for(var a=[],o=0;o0?r+_+w:r,bottom:n=n>0?n+_+w:n,left:a=a>0?a+_+w:a,right:i=i>0?i+_+w:i}}(i),c=function(t,r){var n=e.max(t.nodes,function(t){return t.column}),i=T-a,o=E-b,s=i+r.right+r.left,l=o+r.top+r.bottom,u=i/s,c=o/l;return a=a*u+r.left,T=0==r.right?T:T*u,b=b*c+r.top,E*=c,t.nodes.forEach(function(t){t.x0=a+t.column*((T-a-S)/n),t.x1=t.x0+S}),c}(i,u);s*=c,i.links.forEach(function(t){t.width=t.value*s}),l.forEach(function(t){var e=t.length;t.forEach(function(t,n){t.depth==l.length-1&&1==e?(t.y0=E/2-t.value*s,t.y1=t.y0+t.value*s):0==t.depth&&1==e?(t.y0=E/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==M(t,r)?(t.y0=E/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=b+n,t.y1=t.y0+t.value*s):(t.y0=E-t.value*s-n,t.y1=t.y0+t.value*s):0==u.top||0==u.bottom?(t.y0=(E-b)/e*n,t.y1=t.y0+t.value*s):(t.y0=(E-b)/2-e/2+n,t.y1=t.y0+t.value*s)})})})(s),m();for(var u=1,c=o;c>0;--c)g(u*=.99,s),m();function g(t,r){var n=l.length;l.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&&M(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=E/2-s/2,i.y1=E/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=E/2-s/2,i.y1=E/2+s/2;else{var l=e.mean(i.sourceLinks,v),u=e.mean(i.targetLinks,d),c=((l&&u?(l+u)/2:l||u)-p(i))*t;i.y0+=c,i.y1+=c}})})}function m(){l.forEach(function(e){var r,n,i,a=b,o=e.length;for(e.sort(f),i=0;i0&&(r.y0+=n,r.y1+=n),a=r.y1+t;if((n=a-t-E)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)r=e[i],(n=r.y1+t-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0})}}function j(t){t.nodes.forEach(function(t){t.sourceLinks.sort(c),t.targetLinks.sort(u)}),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 F.nodeId=function(t){return arguments.length?(L="function"==typeof t?t:s(t),F):L},F.nodeAlign=function(t){return arguments.length?(O="function"==typeof t?t:s(t),F):O},F.nodeWidth=function(t){return arguments.length?(S=+t,F):S},F.nodePadding=function(e){return arguments.length?(t=+e,F):t},F.nodes=function(t){return arguments.length?(I="function"==typeof t?t:s(t),F):I},F.links=function(t){return arguments.length?(P="function"==typeof t?t:s(t),F):P},F.size=function(t){return arguments.length?(a=b=0,T=+t[0],E=+t[1],F):[T-a,E-b]},F.extent=function(t){return arguments.length?(a=+t[0][0],T=+t[1][0],b=+t[0][1],E=+t[1][1],F):[[a,b],[T,E]]},F.iterations=function(t){return arguments.length?(D=+t,F):D},F.circularLinkGap=function(t){return arguments.length?(z=+t,F):z},F.nodePaddingRatio=function(t){return arguments.length?(n=+t,F):n},F.sortNodes=function(t){return arguments.length?(R=t,F):R},F.update=function(t){return A(t,L),j(t),t.links.forEach(function(t){t.circular&&(t.circularLinkType=t.y0+t.y1=1?h:t<=-1?-h:Math.asin(t)}function v(t){return t.innerRadius}function g(t){return t.outerRadius}function m(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,s){var l=t-r,c=e-n,f=(s?a:-a)/u(l*l+c*c),h=f*c,p=-f*l,d=t+h,v=e+p,g=r+h,m=n+p,y=(d+g)/2,x=(v+m)/2,b=g-d,_=m-v,w=b*b+_*_,k=i-a,A=d*m-g*v,T=(_<0?-1:1)*u(o(0,k*k*w-A*A)),M=(A*_-b*T)/w,E=(-A*b-_*T)/w,S=(A*_+b*T)/w,C=(-A*b+_*T)/w,L=M-y,O=E-x,I=S-y,P=C-x;return L*L+O*O>I*I+P*P&&(M=S,E=C),{cx:M,cy:E,x01:-h,y01:-p,x11:M*(i/k-1),y11:E*(i/k-1)}}function _(t){this._context=t}function w(t){return new _(t)}function k(t){return t[0]}function A(t){return t[1]}function T(){var t=k,n=A,i=r(!0),a=null,o=w,s=null;function l(r){var l,u,c,f=r.length,h=!1;for(null==a&&(s=o(c=e.path())),l=0;l<=f;++l)!(l=f;--h)u.point(m[h],y[h]);u.lineEnd(),u.areaEnd()}g&&(m[c]=+t(p,c,r),y[c]=+i(p,c,r),u.point(n?+n(p,c,r):m[c],a?+a(p,c,r):y[c]))}if(d)return u=null,d+""||null}function f(){return T().defined(o).curve(l).context(s)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),c):n},c.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,c):i},c.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),c):i},c.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),c):a},c.lineX0=c.lineY0=function(){return f().x(t).y(i)},c.lineY1=function(){return f().x(t).y(a)},c.lineX1=function(){return f().x(n).y(i)},c.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),c):o},c.curve=function(t){return arguments.length?(l=t,null!=s&&(u=l(s)),c):l},c.context=function(t){return arguments.length?(null==t?s=u=null:u=l(s=t),c):s},c}function E(t,e){return et?1:e>=t?0:NaN}function S(t){return t}_.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=O(w);function L(t){this._curve=t}function O(t){function e(e){return new L(t(e))}return e._curve=t,e}function I(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(O(t)):e()._curve},t}function P(){return I(T().curve(C))}function D(){var t=M().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 I(r())},delete t.lineX0,t.lineEndAngle=function(){return I(n())},delete t.lineX1,t.lineInnerRadius=function(){return I(i())},delete t.lineY0,t.lineOuterRadius=function(){return I(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(O(t)):e()._curve},t}function z(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}L.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 R=Array.prototype.slice;function F(t){return t.source}function B(t){return t.target}function N(t){var n=F,i=B,a=k,o=A,s=null;function l(){var r,l=R.call(arguments),u=n.apply(this,l),c=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=u,l)),+o.apply(this,l),+a.apply(this,(l[0]=c,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 j(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 U(t,e,r,n,i){var a=z(e,r),o=z(e,r=(r+i)/2),s=z(n,r),l=z(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/f);t.moveTo(r,0),t.arc(0,0,r,0,p)}},q={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()}},G=Math.sqrt(1/3),W=2*G,Y={draw:function(t,e){var r=Math.sqrt(e/W),n=r*G;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},X=Math.sin(f/10)/Math.sin(7*f/10),Z=Math.sin(p/10)*X,$=-Math.cos(p/10)*X,J={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=Z*r,i=$*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=p*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()}},K={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),it=3*(nt/2+1),at={draw:function(t,e){var r=Math.sqrt(e/it),n=r/2,i=r*nt,a=n,o=r*nt+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(et*n-rt*i,rt*n+et*i),t.lineTo(et*a-rt*o,rt*a+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*i,et*i-rt*n),t.lineTo(et*a+rt*o,et*o-rt*a),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[H,q,Y,K,J,tt,at];function st(){}function lt(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 ct(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:lt(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:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ct.prototype={areaStart:st,areaEnd:st,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:lt(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:lt(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,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 pt=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 dt(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 vt(t,e){this._context=t,this._k=(1-e)/6}vt.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:dt(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:dt(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 vt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:st,areaEnd:st,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:dt(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 yt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function xt(t,e){this._context=t,this._k=(1-e)/6}xt.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:dt(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 xt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function _t(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>c){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>c){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/f,o=(o*u+t._y1*t._l23_2a-r*t._l12_2a)/f}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.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:_t(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 wt(t,e):new vt(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:st,areaEnd:st,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:_t(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 Tt=function t(e){function r(t){return e?new At(t,e):new mt(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: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:_t(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 Mt(t,e):new xt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t){this._context=t}function Ct(t){return t<0?-1:1}function Lt(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 Ot(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function It(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 Pt(t){this._context=t}function Dt(t){this._context=new zt(t)}function zt(t){this._context=t}function Rt(t){this._context=t}function Ft(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 Ut(t){var e=t.map(Ht);return jt(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 qt(t){var e=t.map(Gt);return jt(t).sort(function(t,r){return e[t]-e[r]})}function Gt(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=v,o=g,_=r(0),w=null,k=m,A=y,T=x,M=null;function E(){var r,v,g,m=+t.apply(this,arguments),y=+o.apply(this,arguments),x=k.apply(this,arguments)-h,E=A.apply(this,arguments)-h,S=n(E-x),C=E>x;if(M||(M=r=e.path()),yc)if(S>p-c)M.moveTo(y*a(x),y*l(x)),M.arc(0,0,y,x,E,!C),m>c&&(M.moveTo(m*a(E),m*l(E)),M.arc(0,0,m,E,x,C));else{var L,O,I=x,P=E,D=x,z=E,R=S,F=S,B=T.apply(this,arguments)/2,N=B>c&&(w?+w.apply(this,arguments):u(m*m+y*y)),j=s(n(y-m)/2,+_.apply(this,arguments)),V=j,U=j;if(N>c){var H=d(N/m*l(B)),q=d(N/y*l(B));(R-=2*H)>c?(D+=H*=C?1:-1,z-=H):(R=0,D=z=(x+E)/2),(F-=2*q)>c?(I+=q*=C?1:-1,P-=q):(F=0,I=P=(x+E)/2)}var G=y*a(I),W=y*l(I),Y=m*a(z),X=m*l(z);if(j>c){var Z,$=y*a(P),J=y*l(P),K=m*a(D),Q=m*l(D);if(S1?0:g<-1?f:Math.acos(g))/2),at=u(Z[0]*Z[0]+Z[1]*Z[1]);V=s(j,(m-at)/(it-1)),U=s(j,(y-at)/(it+1))}}F>c?U>c?(L=b(K,Q,G,W,y,U,C),O=b($,J,Y,X,y,U,C),M.moveTo(L.cx+L.x01,L.cy+L.y01),Uc&&R>c?V>c?(L=b(Y,X,$,J,m,-V,C),O=b(G,W,K,Q,m,-V,C),M.lineTo(L.cx+L.x01,L.cy+L.y01),V0&&(d+=f);for(null!=e?v.sort(function(t,r){return e(g[t],g[r])}):null!=n&&v.sort(function(t,e){return n(r[t],r[e])}),s=0,u=d?(y-h*b)/d:0;s0?f*u:0)+b,g[l]={data:r[l],index:s,value:f,startAngle:m,endAngle:c,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.areaRadial=D,t.radialArea=D,t.lineRadial=P,t.radialLine=P,t.pointRadial=z,t.linkHorizontal=function(){return N(j)},t.linkVertical=function(){return N(V)},t.linkRadial=function(){var t=N(U);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=r(H),n=r(64),i=null;function a(){var r;if(i||(i=r=e.path()),t.apply(this,arguments).draw(i,+n.apply(this,arguments)),r)return i=null,r+""||null}return a.type=function(e){return arguments.length?(t="function"==typeof e?e:r(e),a):t},a.size=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),a):n},a.context=function(t){return arguments.length?(i=null==t?null:t,a):i},a},t.symbols=ot,t.symbolCircle=H,t.symbolCross=q,t.symbolDiamond=Y,t.symbolSquare=K,t.symbolStar=J,t.symbolTriangle=tt,t.symbolWye=at,t.curveBasisClosed=function(t){return new ct(t)},t.curveBasisOpen=function(t){return new ft(t)},t.curveBasis=function(t){return new ut(t)},t.curveBundle=pt,t.curveCardinalClosed=yt,t.curveCardinalOpen=bt,t.curveCardinal=gt,t.curveCatmullRomClosed=Tt,t.curveCatmullRomOpen=Et,t.curveCatmullRom=kt,t.curveLinearClosed=function(t){return new St(t)},t.curveLinear=w,t.curveMonotoneX=function(t){return new Pt(t)},t.curveMonotoneY=function(t){return new Dt(t)},t.curveNatural=function(t){return new Rt(t)},t.curveStep=function(t){return new Bt(t,.5)},t.curveStepAfter=function(t){return new Bt(t,1)},t.curveStepBefore=function(t){return new Bt(t,0)},t.stack=function(){var t=r([]),e=jt,n=Nt,i=Vt;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,u=s.length,c=new Array(u);for(a=0;a0){for(var r,n,i,a=0,o=t[0].length;a1)for(var r,n,i,a,o,s,l=0,u=t[e[0]].length;l=0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):n[0]=a},t.stackOffsetNone=Nt,t.stackOffsetSilhouette=function(t,e){if((r=t.length)>0){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=0&&r._call.call(null,t),r=r._next;--n}function m(){l=(s=c.now())+u,n=i=0;try{g()}finally{n=0,function(){for(var t,n,i=e,a=1/0;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,x(a)}(),l=0}}function y(){var t=c.now(),e=t-s;e>o&&(u-=e,s=t)}function x(t){if(!n){i&&(i=clearTimeout(i));var e=t-l;e>24?(t<1/0&&(i=setTimeout(m,t-c.now()-u)),a&&(a=clearInterval(a))):(a||(s=c.now(),a=setInterval(y,o)),n=1,f(m))}}d.prototype=v.prototype={constructor:d,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,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}},t.now=h,t.timer=v,t.timerFlush=g,t.timeout=function(t,e,r){var n=new d;return e=null==e?0:+e,n.restart(function(r){n.stop(),t(r+e)},e,r),n},t.interval=function(t,e,r){var n=new d,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)},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],157:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},i=this.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,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 p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function v(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=v(h);function m(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return v(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(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;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,i=[],a=function(t){for(var e=1;t*e%1;)e*=10;return e}(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,u,c,f,h=-1,p=a.length,d=i[s++],v=new b;++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(V,"\\$&")};var V=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/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,Y),t}var q=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},W=function(t,e){var r=t.matches||t[P(t,"matchesSelector")];return(W=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,W=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var Y=t.selection.prototype=[];function X(t){return"function"==typeof t?t:function(){return q(t,this)}}function Z(t){return"function"==typeof t?t:function(){return G(t,this)}}Y.select=function(t){var e,r,n,i,a=[];t=X(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=et(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=function(t){return arguments.length||(t=h),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.slice(0,o));var l=dt.get(e);function u(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=gt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:u: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;++s=n&&(n=e+1);!(o=s[n])&&++n0?1:t<0?-1:0}function It(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Pt(t){return t>1?0:t<-1?Tt:Math.acos(t)}function Dt(t){return t>1?St:t<-1?-St:Math.asin(t)}function zt(t){return((t=Math.exp(t))+1/t)/2}function Rt(t){return(t=Math.sin(t/2))*t}var Ft=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],u=e[2],c=s-i,f=l-a,h=c*c+f*f;if(h0&&(e=e.transition().duration(v)),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){g++||t({type:"zoomstart"})}function C(t){E(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function L(t){--g||(t({type:"zoomend"}),r=null)}function O(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,function(){n=1,T(t.mouse(e),a),C(r)}).on(x,function(){i.on(y,null).on(x,null),s(n),L(r)}),a=k(t.mouse(e)),s=xt(e);fs.call(e),S(r)}function I(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],f=t.select(r),p=xt(r);function d(){var n=t.touches(r);return e=h.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=k(t))}),n}function v(){var e=t.event.target;t.select(e).on(l,g).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){var m=p[0],x=p[1],b=m[0]-x[0],_=m[1]-x[1];a=b*b+_*_}}function g(){var o,l,u,c,f=t.touches(r);fs.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)?0: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 ae(a(t+120),a(t),a(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Xt?e.l:(e=he((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}Ht.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,this.l/t)},Ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,t*this.l)},Ht.rgb=function(){return qt(this.h,this.s,this.l)},t.hcl=Gt;var Wt=Gt.prototype=new Vt;function Yt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Xt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function Xt(t,e,r){return this instanceof Xt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Xt?new Xt(t.l,t.a,t.b):t instanceof Gt?Yt(t.h,t.c,t.l):he((t=ae(t)).r,t.g,t.b):new Xt(t,e,r)}Wt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Wt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Wt.rgb=function(){return Yt(this.h,this.c,this.l).rgb()},t.lab=Xt;var Zt=18,$t=.95047,Jt=1,Kt=1.08883,Qt=Xt.prototype=new Vt;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=re(i)*$t,n=re(n)*Jt,a=re(a)*Kt,new ae(ie(3.2404542*i-1.5371385*n-.4985314*a),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Lt,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ce(""+t,ae,qt):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+""}Qt.brighter=function(t){return new Xt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},Qt.darker=function(t){return new Xt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},Qt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ae;var le=ae.prototype=new Vt;function ue(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ce(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(de(i[0]),de(i[1]),de(i[2]))}return(a=ve.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 fe(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 Ut(n,i,l)}function he(t,e,r){t=pe(t),e=pe(e),r=pe(r);var n=ne((.4124564*t+.3575761*e+.1804375*r)/$t),i=ne((.2126729*t+.7151522*e+.072175*r)/Jt),a=ne((.0193339*t+.119192*e+.9503041*r)/Kt);return Xt(116*i-16,500*(n-i),200*(i-a))}function pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function de(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.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,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return!this.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 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),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var a in l)u.setRequestHeader(a,l[a]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=i&&o.on("error",i).on("load",function(t){i(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==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}ve.forEach(function(t,e){ve.set(t,oe(e))}),t.functor=ge,t.xhr=me(O),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=ye(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=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,r){return e(i(t),r)}:i})},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,u=0,c=0;function f(){if(u>=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Te,e)),_e=0):(_e=1,ke(Te))}function Me(){for(var t=Date.now(),e=xe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ee(){for(var t,e=xe,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}});t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Se(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ce[8+n/3]};var Le=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Oe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Se(e,r))).toFixed(Math.max(0,Math.min(20,Se(e*(1+1e-15),r))))}});function Ie(t){return t+""}var Pe=t.time={},De=Date;function ze(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}ze.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Re.setUTCDate.apply(this._,arguments)},setDay:function(){Re.setUTCDay.apply(this._,arguments)},setFullYear:function(){Re.setUTCFullYear.apply(this._,arguments)},setHours:function(){Re.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Re.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Re.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Re.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Re.setUTCSeconds.apply(this._,arguments)},setTime:function(){Re.setTime.apply(this._,arguments)}};var Re=Date.prototype;function Fe(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3),r+i[0].length):-1}function $e(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Je(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Ke(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Qe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ir(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,i=y(e)%60;return r+Ue(n,"0",2)+Ue(i,"0",2)}function ar(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:O;return function(e){var n=Le.exec(e),i=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],f=+n[6],h=n[7],p=n[8],d=n[9],v=1,g="",m="",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(c||"0"===i&&"="===s)&&(c=i="0",s="="),d){case"n":h=!0,d="g";break;case"%":v=100,m="%",d="f";break;case"p":v=100,m="%",d="r";break;case"b":case"o":case"x":case"X":"#"===u&&(g="0"+d.toLowerCase());case"c":x=!1;case"d":y=!0,p=0;break;case"s":v=-1,d="r"}"$"===u&&(g=a[0],m=a[1]),"r"!=d||p||(d="g"),null!=p&&("g"==d?p=Math.max(1,Math.min(21,p)):"e"!=d&&"f"!=d||(p=Math.max(0,Math.min(20,p)))),d=Oe.get(d)||Ie;var b=c&&h;return function(e){var n=m;if(y&&e%1)return"";var a=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(v<0){var u=t.formatPrefix(e,p);e=u.scale(e),n=u.symbol+m}else e*=v;var _,w,k=(e=d(e,p)).lastIndexOf(".");if(k<0){var A=x?e.lastIndexOf("e"):-1;A<0?(_=e,w=""):(_=e.substring(0,A),w=e.substring(A))}else _=e.substring(0,k),w=r+e.substring(k+1);!c&&h&&(_=o(_,1/0));var T=g.length+_.length+w.length+(b?0:a.length),M=T"===s?M+a+e:"^"===s?M.substring(0,T>>=1)+a+e+M.substring(T):a+(b?e:M+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,i=e.time,a=e.periods,o=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(t){var e=t.length;function r(r){for(var n,i,a,o=[],s=-1,l=0;++s=u)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in Ne?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}c.utc=function(t){var e=c(t);function r(t){try{var r=new(De=ze);return r._=t,e(r)}finally{De=Date}}return r.parse=function(t){try{De=ze;var r=e.parse(t);return r&&r._}finally{De=Date}},r.toString=e.toString,r},c.multi=c.utc.multi=or;var h=t.map(),p=He(o),d=qe(o),v=He(s),g=qe(s),m=He(l),y=qe(l),x=He(u),b=qe(u);a.forEach(function(t,e){h.set(t.toLowerCase(),e)});var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:c(r),d:function(t,e){return Ue(t.getDate(),e,2)},e:function(t,e){return Ue(t.getDate(),e,2)},H:function(t,e){return Ue(t.getHours(),e,2)},I:function(t,e){return Ue(t.getHours()%12||12,e,2)},j:function(t,e){return Ue(1+Pe.dayOfYear(t),e,3)},L:function(t,e){return Ue(t.getMilliseconds(),e,3)},m:function(t,e){return Ue(t.getMonth()+1,e,2)},M:function(t,e){return Ue(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ue(t.getSeconds(),e,2)},U:function(t,e){return Ue(Pe.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ue(Pe.mondayOfYear(t),e,2)},x:c(n),X:c(i),y:function(t,e){return Ue(t.getFullYear()%100,e,2)},Y:function(t,e){return Ue(t.getFullYear()%1e4,e,4)},Z:ir,"%":function(){return"%"}},w={a:function(t,e,r){v.lastIndex=0;var n=v.exec(e.slice(r));return n?(t.w=g.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:Ke,e:Ke,H:tr,I:tr,j:Qe,L:nr,m:Je,M:er,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:We,w:Ge,W:Ye,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:Ze,Y:Xe,Z:$e,"%":ar};return c}(e)}};var sr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){cr(t,this.t,ur),cr(ur.s,this.s,this),this.s?this.t+=ur.t:this.s=ur.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ur=new lr;function cr(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fr(t,e){t&&pr.hasOwnProperty(t.type)&&pr[t.type](t,e)}t.geo.stream=function(t,e){t&&hr.hasOwnProperty(t.type)?hr[t.type](t,e):fr(t,e)};var hr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,s=o*a,l=Math.cos(e),u=Math.sin(e),c=i*u,f=n*l+c*Math.cos(s),h=c*o*Math.sin(s);Sr.add(Math.atan2(h,f)),r=t,n=l,i=u}Cr.point=function(o,s){Cr.point=a,r=(t=o)*Ct,n=Math.cos(s=(e=s)*Ct/2+Tt/4),i=Math.sin(s)},Cr.lineEnd=function(){a(t,e)}}function Or(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Ir(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Pr(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 Dr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function zr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Rr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Fr(t){return[Math.atan2(t[1],t[0]),Dt(t[2])]}function Br(t,e){return y(t[0]-e[0])kt?i=90:u<-kt&&(r=-90),f[0]=e,f[1]=n}};function p(t,a){c.push(f=[e=t,n=t]),ai&&(i=a)}function d(t,o){var s=Or([t*Ct,o*Ct]);if(l){var u=Pr(l,s),c=[u[1],-u[0],0],f=Pr(c,u);Rr(f),f=Fr(f);var h=t-a,d=h>0?1:-1,v=f[0]*Lt*d,g=y(h)>180;if(g^(d*ai&&(i=m)}else if(g^(d*a<(v=(v+360)%360-180)&&vi&&(i=o);g?t_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(tn&&(n=t)):t>a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);l=s,a=t}function v(){h.point=d}function g(){f[0]=e,f[1]=n,h.point=p,l=null}function m(t,e){if(l){var r=t-a;u+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Cr.point(t,e),d(t,e)}function x(){Cr.lineStart()}function b(){m(o,s),Cr.lineEnd(),y(u)>kt&&(e=-(n=180)),f[0]=e,f[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(l[0],l[1])&&(l[1]=d[1]),_(d[0],l[1])>_(l[0],l[1])&&(l[0]=d[0])):u.push(l=d);for(var p,d,v=-1/0,o=u.length-1,s=0,l=u[o];s<=o;l=d,++s)d=u[s],(p=_(l[1],d[0]))>v&&(v=p,e=d[0],n=l[1])}return c=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){mr=yr=xr=br=_r=wr=kr=Ar=Tr=Mr=Er=0,t.geo.stream(e,Nr);var r=Tr,n=Mr,i=Er,a=r*r+n*n+i*i;return a=0;--s)i.point((f=c[s])[0],f[1]);else n(p.x,p.p.x,-1,i);p=p.p}p=p.o,c=p.z,d=!d}while(!p.v);i.lineEnd()}}}function Xr(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,k=w*_,A=k>Tt,T=d*x;if(Sr.add(Math.atan2(T*w*Math.sin(k),v*b+T*Math.cos(k))),a+=A?_+w*Mt:_,A^h>=r^m>=r){var M=Pr(Or(f),Or(t));Rr(M);var E=Pr(i,M);Rr(E);var S=(A^_>=0?-1:1)*Dt(E[2]);(n>S||n===S&&(M[0]||M[1]))&&(o+=A^_>=0?1:-1)}if(!g++)break;h=m,d=x,v=b,f=t}}return(a<-kt||a0){for(x||(o.polygonStart(),x=!0),o.lineStart();++a1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Jr))}return c}}function Jr(t){return t.length>1}function Kr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:z,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Qr(t,e){return((t=t.x)[0]<0?t[1]-St-kt:St-t[1])-((e=e.x)[0]<0?e[1]-St-kt:St-e[1])}var tn=$r(Wr,function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Tt:-Tt,l=y(a-r);y(l-Tt)0?St:-St),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Tt&&(y(r-i)kt?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*St,n.point(-Tt,i),n.point(0,i),n.point(Tt,i),n.point(Tt,0),n.point(Tt,-i),n.point(0,-i),n.point(-Tt,-i),n.point(-Tt,0),n.point(-Tt,i);else if(y(t[0]-e[0])>kt){var a=t[0]0)){if(a/=d,d<0){if(a0){if(a>p)return;a>h&&(h=a)}if(a=r-l,d||!(a<0)){if(a/=d,d<0){if(a>p)return;a>h&&(h=a)}else if(d>0){if(a0)){if(a/=v,v<0){if(a0){if(a>p)return;a>h&&(h=a)}if(a=n-u,v||!(a<0)){if(a/=v,v<0){if(a>p)return;a>h&&(h=a)}else if(v>0){if(a0&&(i.a={x:l+h*d,y:u+h*v}),p<1&&(i.b={x:l+p*d,y:u+p*v}),i}}}}}}var rn=1e9;function nn(e,r,n,i){return function(l){var u,c,f,h,p,d,v,g,m,y,x,b=l,_=Kr(),w=en(e,r,n,i),k={point:M,lineStart:function(){k.point=E,c&&c.push(f=[]),y=!0,m=!1,v=g=NaN},lineEnd:function(){u&&(E(h,p),d&&m&&_.rejoin(),u.push(_.buffer())),k.point=M,m&&l.lineEnd()},polygonStart:function(){l=_,u=[],c=[],x=!0},polygonEnd:function(){l=b,u=t.merge(u);var r=function(t){for(var e=0,r=c.length,n=t[1],i=0;in&&It(u,a,t)>0&&++e:a[1]<=n&&It(u,a,t)<0&&--e,u=a;return 0!==e}([e,i]),n=x&&r,a=u.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),A(null,null,1,l),l.lineEnd()),a&&Yr(u,o,r,A,l),l.polygonEnd()),u=c=f=null}};function A(t,o,l,u){var c=0,f=0;if(null==t||(c=a(t,l))!==(f=a(o,l))||s(t,o)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?i:r)}while((c=(c+l+4)%4)!==f);else u.point(o[0],o[1])}function T(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function M(t,e){T(t,e)&&l.point(t,e)}function E(t,e){t=Math.max(-rn,Math.min(rn,t)),e=Math.max(-rn,Math.min(rn,e));var r=T(t,e);if(c&&f.push([t,e]),y)h=t,p=e,d=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&m)l.point(t,e);else{var n={a:{x:v,y:g},b:{x:t,y:e}};w(n)?(m||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),x=!1):r&&(l.lineStart(),l.point(t,e),x=!1)}v=t,g=e,m=r}return k};function a(t,i){return y(t[0]-e)0?0:3:y(t[0]-n)0?2:1:y(t[1]-r)0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(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]}}function an(t){var e=0,r=Tt/3,n=Cn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Tt/180,r=t[1]*Tt/180):[e/Tt*180,r/Tt*180]},i}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,Dt((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=nn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function u(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return u.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},u.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},u.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),u):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),c=+t[0],f=+t[1];return r=a.translate(t).clipExtent([[c-.455*e,f-.238*e],[c+.455*e,f+.238*e]]).stream(l).point,n=o.translate([c-.307*e,f+.201*e]).clipExtent([[c-.425*e+kt,f+.12*e+kt],[c-.214*e-kt,f+.234*e-kt]]).stream(l).point,i=s.translate([c-.205*e,f+.212*e]).clipExtent([[c-.214*e+kt,f+.166*e+kt],[c-.115*e-kt,f+.234*e-kt]]).stream(l).point,u},u.scale(1070)};var sn,ln,un,cn,fn,hn,pn={point:z,lineStart:z,lineEnd:z,polygonStart:function(){ln=0,pn.lineStart=dn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=z,sn+=y(ln/2)}};function dn(){var t,e,r,n;function i(t,e){ln+=n*t-r*e,r=t,n=e}pn.point=function(a,o){pn.point=i,t=r=a,e=n=o},pn.lineEnd=function(){i(t,e)}}var vn={point:function(t,e){tfn&&(fn=t),ehn&&(hn=e)},lineStart:z,lineEnd:z,polygonStart:z,polygonEnd:z};function gn(){var t=mn(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=mn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function i(t,n){e.push("M",t,",",n),r.point=a}function a(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function mn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var yn,xn={point:bn,lineStart:_n,lineEnd:wn,polygonStart:function(){xn.lineStart=kn},polygonEnd:function(){xn.point=bn,xn.lineStart=_n,xn.lineEnd=wn}};function bn(t,e){xr+=t,br+=e,++_r}function _n(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);wr+=o*(t+r)/2,kr+=o*(e+n)/2,Ar+=o,bn(t=r,e=n)}xn.point=function(n,i){xn.point=r,bn(t=n,e=i)}}function wn(){xn.point=bn}function kn(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);wr+=o*(r+t)/2,kr+=o*(n+e)/2,Ar+=o,Tr+=(o=n*t-r*e)*(r+t),Mr+=o*(n+e),Er+=3*o,bn(r=t,n=e)}xn.point=function(a,o){xn.point=i,bn(t=r=a,e=n=o)},xn.lineEnd=function(){i(t,e)}}function An(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:z};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Mt)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function Tn(t){var e=.5,r=Math.cos(30*Ct),n=16;function i(e){return(n?function(e){var r,i,o,s,l,u,c,f,h,p,d,v,g={point:m,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=_},polygonEnd:function(){e.polygonEnd(),g.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,g.point=x,e.lineStart()}function x(r,i){var o=Or([r,i]),s=t(r,i);a(f,h,c,p,d,v,f=s[0],h=s[1],c=r,p=o[0],d=o[1],v=o[2],n,e),e.point(f,h)}function b(){g.point=m,e.lineEnd()}function _(){y(),g.point=w,g.lineEnd=k}function w(t,e){x(r=t,e),i=f,o=h,s=p,l=d,u=v,g.point=x}function k(){a(f,h,c,p,d,v,i,o,r,s,l,u,n,e),g.lineEnd=b,b()}return g}:function(e){return En(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function a(n,i,o,s,l,u,c,f,h,p,d,v,g,m){var x=c-n,b=f-i,_=x*x+b*b;if(_>4*e&&g--){var w=s+p,k=l+d,A=u+v,T=Math.sqrt(w*w+k*k+A*A),M=Math.asin(A/=T),E=y(y(A)-1)e||y((x*O+b*I)/_-.5)>.3||s*p+l*d+u*v0&&16,i):Math.sqrt(e)},i}function Mn(t){this.stream=t}function En(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Sn(t){return Cn(function(){return t})()}function Cn(e){var r,n,i,a,o,s,l=Tn(function(t,e){return[(t=r(t,e))[0]*u+a,o-t[1]*u]}),u=150,c=480,f=250,h=0,p=0,d=0,v=0,g=0,m=tn,x=O,b=null,_=null;function w(t){return[(t=i(t[0]*Ct,t[1]*Ct))[0]*u+a,o-t[1]*u]}function k(t){return(t=i.invert((t[0]-a)/u,(o-t[1])/u))&&[t[0]*Lt,t[1]*Lt]}function A(){i=Gr(n=Pn(d,v,g),r);var t=r(h,p);return a=c-t[0]*u,o=f+t[1]*u,T()}function T(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=Ln(m(n,l(x(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(m=null==t?(b=t,tn):function(t){var e=Math.cos(t),r=e>0,n=y(e)>kt;return $r(i,function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,h){var p,d=[f,h],v=i(f,h),g=r?v?0:o(f,h):v?o(f+(f<0?Tt:-Tt),h):0;if(!e&&(u=l=v)&&t.lineStart(),v!==l&&(p=a(e,d),(Br(e,p)||Br(d,p))&&(d[0]+=kt,d[1]+=kt,v=i(d[0],d[1]))),v!==l)c=0,v?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^v){var m;g&s||!(m=a(d,e,!0))||(c=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!v||e&&Br(e,d)||t.point(d[0],d[1]),e=d,l=v,s=g},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}},Fn(t,6*Ct),r?[0,-t]:[-Tt,t-Tt]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=Or(t),a=Or(r),o=[1,0,0],s=Pr(i,a),l=Ir(s,s),u=s[0],c=l-u*u;if(!c)return!n&&t;var f=e*l/c,h=-e*u/c,p=Pr(o,s),d=zr(o,f),v=zr(s,h);Dr(d,v);var g=p,m=Ir(d,g),x=Ir(g,g),b=m*m-x*(Ir(d,d)-1);if(!(b<0)){var _=Math.sqrt(b),w=zr(g,(-m-_)/x);if(Dr(w,d),w=Fr(w),!n)return w;var k,A=t[0],T=r[0],M=t[1],E=r[1];T0^w[1]<(y(w[0]-A)Tt^(A<=w[0]&&w[0]<=T)){var O=zr(g,(-m+_)/x);return Dr(O,d),[w,Fr(O)]}}}function o(e,n){var i=r?t:Tt-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}((b=+t)*Ct),T()):b},w.clipExtent=function(t){return arguments.length?(_=t,x=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):O,T()):_},w.scale=function(t){return arguments.length?(u=+t,A()):u},w.translate=function(t){return arguments.length?(c=+t[0],f=+t[1],A()):[c,f]},w.center=function(t){return arguments.length?(h=t[0]%360*Ct,p=t[1]%360*Ct,A()):[h*Lt,p*Lt]},w.rotate=function(t){return arguments.length?(d=t[0]%360*Ct,v=t[1]%360*Ct,g=t.length>2?t[2]%360*Ct:0,A()):[d*Lt,v*Lt,g*Lt]},t.rebind(w,l,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&k,A()}}function Ln(t){return En(t,function(e,r){t.point(e*Ct,r*Ct)})}function On(t,e){return[t,e]}function In(t,e){return[t>Tt?t-Mt:t<-Tt?t+Mt:t,e]}function Pn(t,e,r){return t?e||r?Gr(zn(t),Rn(e,r)):zn(t):e||r?Rn(e,r):In}function Dn(t){return function(e,r){return[(e+=t)>Tt?e-Mt:e<-Tt?e+Mt:e,r]}}function zn(t){var e=Dn(t);return e.invert=Dn(-t),e}function Rn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*r+s*n;return[Math.atan2(l*i-c*a,s*r-u*n),Dt(c*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*i-l*a;return[Math.atan2(l*i+u*a,s*r+c*n),Dt(c*r-s*n)]},o}function Fn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Bn(r,i),a=Bn(r,a),(o>0?ia)&&(i+=o*Mt)):(i=t+o*Mt,a=t-.5*l);for(var u,c=i;o>0?c>a:c2?t[2]*Ct:0),e.invert=function(e){return(e=t.invert(e[0]*Ct,e[1]*Ct))[0]*=Lt,e[1]*=Lt,e},e},In.invert=On,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t="function"==typeof r?r.apply(this,arguments):r,n=Pn(-t[0]*Ct,-t[1]*Ct,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Lt,t[1]*=Lt}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=Fn((t=+r)*Ct,n*Ct),i):t},i.precision=function(r){return arguments.length?(e=Fn(t*Ct,(n=+r)*Ct),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ct,i=t[1]*Ct,a=e[1]*Ct,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=u*c-l*f*s)*r),l*c+u*f*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,u,c,f,h,p=10,d=p,v=90,g=360,m=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(i/v)*v,n,v).map(f).concat(t.range(Math.ceil(l/g)*g,s,g).map(h)).concat(t.range(Math.ceil(r/p)*p,e,p).filter(function(t){return y(t%v)>kt}).map(u)).concat(t.range(Math.ceil(o/d)*d,a,d).filter(function(t){return y(t%g)>kt}).map(c))}return x.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(h(s).slice(1),f(n).reverse().slice(1),h(l).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),x.precision(m)):[[i,l],[n,s]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),x.precision(m)):[[r,o],[e,a]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(v=+t[0],g=+t[1],x):[v,g]},x.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],x):[p,d]},x.precision=function(t){return arguments.length?(m=+t,u=Nn(o,a,90),c=jn(r,e,m),f=Nn(l,s,90),h=jn(i,n,m),x):m},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=Vn,i=Un;function a(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r="function"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*Ct,n=t[1]*Ct,i=e[0]*Ct,a=e[1]*Ct,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),u=Math.sin(a),c=o*Math.cos(r),f=o*Math.sin(r),h=l*Math.cos(i),p=l*Math.sin(i),d=2*Math.asin(Math.sqrt(Rt(a-n)+o*l*Rt(i-r))),v=1/Math.sin(d),(g=d?function(t){var e=Math.sin(t*=d)*v,r=Math.sin(d-t)*v,n=r*c+e*h,i=r*f+e*p,a=r*s+e*u;return[Math.atan2(i,n)*Lt,Math.atan2(a,Math.sqrt(n*n+i*i))*Lt]}:function(){return[r*Lt,n*Lt]}).distance=d,g;var r,n,i,a,o,s,l,u,c,f,h,p,d,v,g},t.geo.length=function(e){return yn=0,t.geo.stream(e,Hn),yn};var Hn={sphere:z,point:z,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=Ct),o=Math.cos(i),s=y((n*=Ct)-t),l=Math.cos(s);yn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Hn.point=function(i,a){t=i*Ct,e=Math.sin(a*=Ct),r=Math.cos(a),Hn.point=n},Hn.lineEnd=function(){Hn.point=Hn.lineEnd=z}},lineEnd:z,polygonStart:z,polygonEnd:z};function qn(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}var Gn=qn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Sn(Gn)}).raw=Gn;var Wn=qn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},O);function Yn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(Tt/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return $n;function o(t,e){a>0?e<-St+kt&&(e=-St+kt):e>St-kt&&(e=St-kt);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=Ot(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-St]},o}function Xn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(y(n)1&&It(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ii(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Sn(Qn)}).raw=Qn,ti.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-St]},(t.geo.transverseMercator=function(){var t=Jn(ti),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ti,t.geom={},t.geom.hull=function(t){var e=ei,r=ri;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ge(e),a=ge(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)p.push(t[s[u[n]][2]]);for(n=+f;nkt)s=s.L;else{if(!((i=a-wi(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=mi(t);if(fi.insert(e,l),e||r){if(e===r)return Ei(e),r=mi(e.site),fi.insert(l,r),l.edge=r.edge=Li(e.site,l.site),Mi(e),void Mi(r);if(r){Ei(e),Ei(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,p=t.y-f,d=r.site,v=d.x-c,g=d.y-f,m=2*(h*g-p*v),y=h*h+p*p,x=v*v+g*g,b={x:(g*y-p*x)/m+c,y:(h*x-v*y)/m+f};Oi(r.edge,u,d,b),l.edge=Li(u,t,null,b),r.edge=Li(t,d,null,b),Mi(e),Mi(r)}else l.edge=Li(e.site,l.site)}}function _i(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,u=l-e;if(!u)return s;var c=s-n,f=1/a-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+n:(n+s)/2}function wi(t,e){var r=t.N;if(r)return _i(r,e);var n=t.site;return n.y===e?n.x:1/0}function ki(t){this.site=t,this.edges=[]}function Ai(t,e){return e.angle-t.angle}function Ti(){Di(this),this.x=this.y=this.arc=this.site=this.cy=null}function Mi(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,f=a.y-s,h=2*(l*f-u*c);if(!(h>=-At)){var p=l*l+u*u,d=c*c+f*f,v=(f*p-u*d)/h,g=(l*d-c*p)/h,f=g+s,m=vi.pop()||new Ti;m.arc=t,m.site=i,m.x=v+o,m.y=f+Math.sqrt(v*v+g*g),m.cy=f,t.circle=m;for(var y=null,x=pi._;x;)if(m.y=s)return;if(h>d){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y1)if(h>d){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xkt||y(i-r)>kt)&&(s.splice(o,0,new Ii((m=a.site,x=c,b=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&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[];c.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 Bi(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 Bi(s(t)).cells.forEach(function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(Ai),c=-1,f=u.length,h=u[f-1].edge,p=h.l===l?h.r:h.l;++ca&&(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:Gi(r,n)})),a=Xi.lastIndex;return av&&(v=l.x),l.y>g&&(g=l.y),u.push(l.x),c.push(l.y);else for(f=0;fv&&(v=b),_>g&&(g=_),u.push(b),c.push(_)}var w=v-p,k=g-d;function A(t,e,r,n,i,a,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)T(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,T(t,c,l,u,i,a,o,s),T(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else T(t,e,r,n,i,a,o,s)}function T(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),c?i=l:o=l,f?a=u:s=u,A(t,e,r,n,i,a,o,s)}w>k?g=d+w:v=p+k;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){A(M,t,+m(t,++f),+x(t,f),p,d,v,g)},visit:function(t){!function t(e,r,n,i,a,o){if(!e(r,n,i,a,o)){var s=.5*(n+a),l=.5*(i+o),u=r.nodes;u[0]&&t(e,u[0],n,i,s,l),u[1]&&t(e,u[1],s,i,a,l),u[2]&&t(e,u[2],n,l,s,o),u[3]&&t(e,u[3],s,l,a,o)}}(t,M,p,d,v,g)},find:function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,f,h,p){if(!(c>a||f>o||h=_)<<1|e>=b,k=w+4;w=0&&!(n=t.interpolators[i](e,r)););return n}function $i(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function aa(t){return 1-Math.cos(t*St)}function oa(t){return Math.pow(2,10*(t-1))}function sa(t){return 1-Math.sqrt(1-t*t)}function la(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 ua(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function ca(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=ha(i),s=fa(i,a),l=ha(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):"in";return i=Ki.get(i)||Ji,a=Qi.get(a)||O,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},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;return 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),function(t){return Yt(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;return 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),function(t){return qt(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 te(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=ua,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 ca(e?e.matrix:pa)})(e)},ca.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var pa={a:1,b:0,c:0,d:1,e:0,f:0};function da(t){return t.length?t.pop()+",":""}function va(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:Gi(t[0],e[0])},{i:i-2,x:Gi(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(da(r)+"rotate(",null,")")-2,x:Gi(t,e)})):e&&r.push(da(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(da(r)+"skewX(",null,")")-2,x:Gi(t,e)}):e&&r.push(da(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(da(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Gi(t[0],e[0])},{i:i-2,x:Gi(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(da(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=Ae(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,c=u[0],d=u[1];for(t=0;t=0;)r.push(i[n])}function Ca(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(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return Ca(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&&(Sa(t,function(t){t.children&&(t.value=0)}),Ca(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,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function Ha(t){return t.reduce(qa,0)}function qa(t,e){return t+e[1]}function Ga(t,e){return Wa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Wa(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 Ya(e){return[t.min(e),t.max(e)]}function Xa(t,e){return t.value-e.value}function Za(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function $a(t,e){t._pack_next=e,e._pack_prev=t}function Ja(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 Ka(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach(Qa),(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(i=e[2],eo(r,n,i),x(i),Za(r,i),r._pack_prev=i,Za(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[t.bisect(h,l,1,d)-1]).y+=v,s.push(a[o]));return u}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ge(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return Wa(e,t)}:ge(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(Xa),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,Ca(s,function(t){t.r=+c(t.value)}),Ca(s,Ka),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;Ca(s,function(t){t.r+=f}),Ca(s,Ka),Ca(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 v=r(h,p)/2-h.x,g=n[0]/(p.x+r(p,h)/2+v),m=n[1]/(d.depth||1);Sa(c,function(t){t.x=(t.x+v)*g,t.y=t.depth*m})}return u}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!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)}(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],u=a.m,c=o.m,f=s.m,h=l.m;s=io(s),a=no(a),s&&a;)l=no(l),(o=io(o)).a=t,(i=s.z+f-a.z-u+r(s._,a._))>0&&(ao(oo(s,t,n),t,i),u+=i,c+=i),f+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!io(o)&&(o.t=s,o.m+=f-c),a&&!no(l)&&(l.t=a,l.m+=u-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},Ea(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ro,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),u=l[0],c=0;Ca(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),p=f.x-r(f,h)/2,d=h.x+r(h,f)/2;return Ca(u,i?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(u.y?t.y/u.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},Ea(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=so,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,v))<=h?(u.pop(),h=n):(s.area-=s.pop().area,d(s,v,a,!1),v=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,v,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(c(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*u/n,n/(e*a*u)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((i||c>r.dy)&&(c=r.dy);++or.dx)&&(c=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?go:fo,s=i?ma:ga;return a=t(e,r,s,n),o=t(r,e,s,Zi),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(ua)},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 bo(e,t)},l.tickFormat=function(t,r){return _o(e,t,r)},l.nice=function(t){return yo(e,t),s()},l.copy=function(){return t(e,r,n,i)},s()}([0,1],[0,1],Zi,!1)};var wo={s:1,g:1,p:1,r:1,e:1};function ko(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}return l.invert=function(t){return s(r.invert(t))},l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a},l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n},l.nice=function(){var t=ho(a.map(o),i?Math:To);return r.domain(t),a=t.map(s),l},l.ticks=function(){var t=uo(a),e=[],r=t[0],l=t[1],u=Math.floor(o(r)),c=Math.ceil(o(l)),f=n%1?2:n;if(isFinite(c-u)){if(i){for(;u0;h--)e.push(s(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e},l.tickFormat=function(e,r){if(!arguments.length)return Ao;arguments.length<2?r=Ao:"function"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n0?i[t-1]:r[0],tf?0:1;if(u=Et)return l(u,p)+(s?l(s,1-p):"")+"Z";var d,v,g,m,y,x,b,_,w,k,A,T,M=0,E=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(g=n===Io?Math.sqrt(s*s+u*u):+n.apply(this,arguments),p||(E*=-1),u&&(E=Dt(g/u*Math.sin(m))),s&&(M=Dt(g/s*Math.sin(m)))),u){y=u*Math.cos(c+E),x=u*Math.sin(c+E),b=u*Math.cos(f-E),_=u*Math.sin(f-E);var C=Math.abs(f-c-2*E)<=Tt?0:1;if(E&&Bo(y,x,b,_)===p^C){var L=(c+f)/2;y=u*Math.cos(L),x=u*Math.sin(L),b=_=null}}else y=x=0;if(s){w=s*Math.cos(f-M),k=s*Math.sin(f-M),A=s*Math.cos(c+M),T=s*Math.sin(c+M);var O=Math.abs(c-f+2*M)<=Tt?0:1;if(M&&Bo(w,k,A,T)===1-p^O){var I=(c+f)/2;w=s*Math.cos(I),k=s*Math.sin(I),A=T=null}}else w=k=0;if(h>kt&&(d=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){v=s0?0:1}function No(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,f=t[1]+u,h=e[0]+l,p=e[1]+u,d=(c+h)/2,v=(f+p)/2,g=h-c,m=p-f,y=g*g+m*m,x=r-n,b=c*p-h*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-g*_)/y,k=(-b*g-m*_)/y,A=(b*m+g*_)/y,T=(-b*g+m*_)/y,M=w-d,E=k-v,S=A-d,C=T-v;return M*M+E*E>S*S+C*C&&(w=A,k=T),[[w-l,k-u],[w*r/x,k*r/x]]}function jo(t){var e=ei,r=ri,n=Wr,i=Uo,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,f=a.length,h=ge(e),p=ge(r);function d(){l.push("M",i(t(u),o))}for(;++c1&&i.push("H",n[0]),i.join("")},"step-before":qo,"step-after":Go,basis:Xo,"basis-open":function(t){if(t.length<4)return Uo(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Zo(Ko,a)+","+Zo(Ko,o)),--n;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Uo(t){return t.length>1?t.join("L"):t+"Z"}function Ho(t){return t.join("L")+"Z"}function qo(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 u=2;uTt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ge(t),a):r},a.source=function(e){return arguments.length?(t=ge(e),a):t},a.target=function(t){return arguments.length?(e=ge(t),a):e},a.startAngle=function(t){return arguments.length?(n=ge(t),a):n},a.endAngle=function(t){return arguments.length?(i=ge(t),a):i},a},t.svg.diagonal=function(){var t=Vn,e=Un,r=is;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=ge(e),n):t},n.target=function(t){return arguments.length?(e=ge(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=is,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-St;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=os,e=as;function r(r,n){return(ls.get(t.call(this,r,n))||ss)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ge(e),r):t},r.size=function(t){return arguments.length?(e=ge(t),r):e},r};var ls=t.map({circle:ss,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*cs)),r=e*cs;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/us),r=e*us/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/us),r=e*us/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=ls.keys();var us=Math.sqrt(3),cs=Math.tan(30*Ct);Y.transition=function(t){for(var e,r,n=ds||++ms,i=bs(t),a=[],o=vs||{time:Date.now(),ease:ia,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(a=i.time,o=Ae(function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h},0,a),f=c[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}gs.call=Y.call,gs.empty=Y.empty,gs.node=Y.node,gs.size=Y.size,t.transition=function(e,r){return e&&e.transition?ds?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=gs,gs.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=X(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function v(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,m=this,y=t.select(t.event.target),x=n.of(m,arguments),b=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,k=!/^(e|w)$/.test(_)&&a,A=y.classed("extent"),T=xt(m),M=t.mouse(m),E=t.select(o(m)).on("keydown.brush",function(){32==t.event.keyCode&&(A||(f=null,M[0]-=s[1],M[1]-=l[1],A=2),B())}).on("keyup.brush",function(){32==t.event.keyCode&&2==A&&(M[0]+=s[1],M[1]+=l[1],A=0,B())});if(t.event.changedTouches?E.on("touchmove.brush",L).on("touchend.brush",I):E.on("mousemove.brush",L).on("mouseup.brush",I),b.interrupt().selectAll("*").interrupt(),A)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);g=[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 L(){var e=t.mouse(m),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),A||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]1?{floor:function(e){for(;s(e=t.floor(e));)e=Ps(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Ps(+e+1);return e}}:t))},i.ticks=function(t,e){var r=uo(i.domain()),n=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Ps(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Is(e.copy(),r,n)},mo(i,e)}function Ps(t){return new Date(t)}Ss.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Os:Ls,Os.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Os.toString=Ls.toString,Pe.second=Fe(function(t){return new De(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Pe.seconds=Pe.second.range,Pe.seconds.utc=Pe.second.utc.range,Pe.minute=Fe(function(t){return new De(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Pe.minutes=Pe.minute.range,Pe.minutes.utc=Pe.minute.utc.range,Pe.hour=Fe(function(t){var e=t.getTimezoneOffset()/60;return new De(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Pe.hours=Pe.hour.range,Pe.hours.utc=Pe.hour.utc.range,Pe.month=Fe(function(t){return(t=Pe.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Pe.months=Pe.month.range,Pe.months.utc=Pe.month.utc.range;var Ds=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],zs=[[Pe.second,1],[Pe.second,5],[Pe.second,15],[Pe.second,30],[Pe.minute,1],[Pe.minute,5],[Pe.minute,15],[Pe.minute,30],[Pe.hour,1],[Pe.hour,3],[Pe.hour,6],[Pe.hour,12],[Pe.day,1],[Pe.day,2],[Pe.week,1],[Pe.month,1],[Pe.month,3],[Pe.year,1]],Rs=Ss.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Wr]]),Fs={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Ps)},floor:O,ceil:O};zs.year=Pe.year,Pe.scale=function(){return Is(t.scale.linear(),zs,Rs)};var Bs=zs.map(function(t){return[t[0].utc,t[1]]}),Ns=Cs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Wr]]);function js(t){return JSON.parse(t.responseText)}function Vs(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Bs.year=Pe.year.utc,Pe.scale.utc=function(){return Is(t.scale.linear(),Bs,Ns)},t.text=me(function(t){return t.responseText}),t.json=function(t,e){return ye(t,"application/json",js,e)},t.html=function(t,e){return ye(t,"text/html",Vs,e)},t.xml=me(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],158:[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}),1&s)for(var c=0;c<_.length;++c){var b=_[c],h=b[0];b[0]=b[1],b[1]=h}return _}},{"incremental-convex-hull":408,uniq:534}],160:[function(t,e,r){"use strict";e.exports=o;var n=o.canvas=document.createElement("canvas"),i=n.getContext("2d"),a=s([32,126]);function o(t,e){Array.isArray(t)&&(t=t.join(", "));var r,n={},o=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?r=s(e):Array.isArray(e)?r=e:(e.o?r=s(e.o):e.pairs&&(r=e.pairs),e.fontSize&&(o=e.fontSize),null!=e.threshold&&(l=e.threshold))),r||(r=a),i.font=o+"px "+t;for(var u=0;uo*l){var p=(h-f)/o;n[c]=1e3*p}}return n}function s(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){var r=e.exports.hi(t);return(r<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){var r=e.exports.hi(t);return!(2146435072&r)}}).call(this,t("buffer").Buffer)},{buffer:98}],162:[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":53,"normalize-svg-path":447}],163:[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}}},{}],164:[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 b=r;bl&&(l=c),p>u&&(u=p);v=0!==(v=Math.max(l-n,u-s))?1/v:0}return o(y,x,r,n,s,v),x}function i(t,e,r,n,i){var a,o;if(i===T(t,e,r,n)>0)for(a=e;a=e;a-=n)o=w(a,t[a],t[a+1],o);return o&&y(o,o.next)&&(k(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||!y(n,n.next)&&0!==m(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,i,f,h){if(t){!h&&f&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=p(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,u=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,u*=2}while(o>1)}(i)}(t,n,i,f);for(var d,v,g=t;t.prev!==t.next;)if(d=t.prev,v=t.next,f?l(t,n,i,f):s(t))e.push(d.i/r),e.push(t.i/r),e.push(v.i/r),k(t),t=v.next,g=v.next;else if((t=v)===g){h?1===h?o(t=u(t,e,r),e,r,n,i,f,2):2===h&&c(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(m(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(v(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&m(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(m(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,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.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(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&m(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,g!==t.prev&&g!==t.next&&v(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&v(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&m(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;g&&g.z<=h;){if(g!==t.prev&&g!==t.next&&v(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function u(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!y(i,a)&&x(i,n,n.next,a)&&b(i,a)&&b(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),k(n),k(n.next),n=t=a),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=_(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,r,n,i,s),void o(c,e,r,n,i,s)}u=u.next}l=l.next}while(l!==t)}function 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>=c&&i!==n.x&&v(ar.x)&&b(n,t)&&(r=n,h=l),n=n.next;return r}(t,e)){var r=_(e,t);a(r,r.next)}}function p(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 d(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 g(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)&&b(t,e)&&b(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)}function m(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){return!!(y(t,e)&&y(r,n)||y(t,n)&&y(r,e))||m(t,e,r)>0!=m(t,e,n)>0&&m(r,n,t)>0!=m(r,n,e)>0}function b(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function _(t,e){var r=new A(t.i,t.x,t.y),n=new A(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 w(t,e,r,n){var i=new A(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 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 A(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 T(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}},{}],166:[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=t,a=n(i),o=a.components.filter(function(t){return t.length>1}),s=1/0,l=0;l=55296&&y<=56319&&(w+=t[++r]),w=k?h.call(k,A,w,v):w,e?(p.value=w,d(g,v,p)):g[v]=w,++v;m=v}if(void 0===m)for(m=o(t.length),e&&(g=new e(m)),r=0;r0?1:-1}},{}],178:[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":175}],179:[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":178}],180:[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,u){var c,f=arguments[2],h=arguments[3];return r=Object(i(r)),n(u),c=s(r),h&&c.sort("function"==typeof h?a.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":198,"./valid-value":200}],181:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":182,"./shim":183}],182:[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")}},{}],183:[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}},{}],204:[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}},{}],205:[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}},{}],206:[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("./"),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?a.call(e,"key+value")?"key+value":a.call(e,"key")?"key":"value":"value",u(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})}),u(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":209,d:144,"es5-ext/object/set-prototype-of":195,"es5-ext/string/#/contains":201,"es6-symbol":214}],207:[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,u=Array.prototype.some;e.exports=function(t,e){var r,c,f,h,p,d,v,g,m=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(c=t.next();!c.done;){if(l.call(e,m,c.value,f),h)return;c=t.next()}else for(d=t.length,p=0;p=55296&&g<=56319&&(v+=t[++p]),l.call(e,m,v,f),!h);++p);else u.call(t,function(t){return l.call(e,m,t,f),h})}},{"./get":208,"es5-ext/function/is-arguments":172,"es5-ext/object/valid-callable":198,"es5-ext/string/is-string":204}],208:[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":206,"./string":211,"./valid-iterable":212,"es5-ext/function/is-arguments":172,"es5-ext/string/is-string":204,"es6-symbol":214}],209:[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"),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,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,c.iterator,l(function(){return this}))},{d:144,"d/auto-bind":143,"es5-ext/array/#/clear":168,"es5-ext/object/assign":181,"es5-ext/object/valid-callable":198,"es5-ext/object/valid-value":200,"es6-symbol":214}],210:[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":172,"es5-ext/object/is-value":189,"es5-ext/string/is-string":204,"es6-symbol":214}],211:[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"))},{"./":209,d:144,"es5-ext/object/set-prototype-of":195,"es6-symbol":214}],212:[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":210}],213:[function(t,r,n){(function(e,i){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) @@ -27,37 +27,37 @@ * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version 3.3.1 */ -!function(t,e){"object"==typeof n&&void 0!==r?r.exports=e():t.ES6Promise=e()}(this,(function(){"use strict";function r(t){return"function"==typeof t}var n=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,s=void 0,l=function(t,e){g[i]=t,g[i+1]=e,2===(i+=2)&&(s?s(v):_())},c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(v,1)}}var g=new Array(1e3);function v(){for(var t=0;t=r-1){p=l.length-1;var d=t-e[r-1];for(h=0;h=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(i(l[f-1],c[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 p=r;p>0;--p){var h=i(c[p-1],u[p-1],arguments[p]);n.push(h),a.push((h-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],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var p=r;p>0;--p){var h=arguments[p];n.push(i(l[p-1],c[p-1],n[o++]+h)),a.push(h*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(i(l[f],c[f],n[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":92,"cubic-hermite":146}],229:[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,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(a=0,o=r;ae[0]-o[0]/2&&(p=o[0]/2,h+=o[1]);return r}},{"css-font/stringify":143}],231:[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 a(n.cache[r],c);var u=e.canvas||n.canvas,f=u.getContext("2d"),p={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"},h=Math.ceil(1.5*s);u.height=h,u.width=.5*h,f.font=t;var d={top:0};f.clearRect(0,0,h,h),f.textBaseline="top",f.fillStyle="black",f.fillText("H",0,0);var g=i(f.getImageData(0,0,h,h));f.clearRect(0,0,h,h),f.textBaseline="bottom",f.fillText("H",0,h);var v=i(f.getImageData(0,0,h,h));d.lineHeight=d.bottom=h-v+g,f.clearRect(0,0,h,h),f.textBaseline="alphabetic",f.fillText("H",0,h);var m=h-i(f.getImageData(0,0,h,h))-1+g;d.baseline=d.alphabetic=m,f.clearRect(0,0,h,h),f.textBaseline="middle",f.fillText("H",0,.5*h);var y=i(f.getImageData(0,0,h,h));d.median=d.middle=h-y-1+g-.5*h,f.clearRect(0,0,h,h),f.textBaseline="hanging",f.fillText("H",0,.5*h);var x=i(f.getImageData(0,0,h,h));d.hanging=h-x-1+g-.5*h,f.clearRect(0,0,h,h),f.textBaseline="ideographic",f.fillText("H",0,h);var b=i(f.getImageData(0,0,h,h));if(d.ideographic=h-b-1+g,p.upper&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.upper,0,0),d.upper=i(f.getImageData(0,0,h,h)),d.capHeight=d.baseline-d.upper),p.lower&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.lower,0,0),d.lower=i(f.getImageData(0,0,h,h)),d.xHeight=d.baseline-d.lower),p.tittle&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.tittle,0,0),d.tittle=i(f.getImageData(0,0,h,h))),p.ascent&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.ascent,0,0),d.ascent=i(f.getImageData(0,0,h,h))),p.descent&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.descent,0,0),d.descent=o(f.getImageData(0,0,h,h))),p.overshoot){f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(p.overshoot,0,0);var _=o(f.getImageData(0,0,h,h));d.overshoot=_-m}for(var w in d)d[w]/=s;return d.em=s,n.cache[r]=d,a(d,c)}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={}},{}],232:[function(t,e,r){"use strict";e.exports=function(t){return new c(t||m,null)};var n=0,a=1;function i(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 o(t){return new i(t._color,t.key,t.value,t.left,t.right,t._count)}function s(t,e){return new i(t,e.key,e.value,e.left,e.right,e._count)}function l(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function c(t,e){this._compare=t,this.root=e}var u=c.prototype;function f(t,e){var r;return e.left&&(r=f(t,e.left))?r:(r=t(e.key,e.value))||(e.right?f(t,e.right):void 0)}function p(t,e,r,n){if(e(t,n.key)<=0){var a;if(n.left&&(a=p(t,e,r,n.left)))return a;if(a=r(n.key,n.value))return a}if(n.right)return p(t,e,r,n.right)}function h(t,e,r,n,a){var i,o=r(t,a.key),s=r(e,a.key);if(o<=0){if(a.left&&(i=h(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 h(t,e,r,n,a.right)}function d(t,e){this.tree=t,this._stack=e}Object.defineProperty(u,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(u,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(u,"length",{get:function(){return this.root?this.root._count:0}}),u.insert=function(t,e){for(var r=this._compare,o=this.root,u=[],f=[];o;){var p=r(t,o.key);u.push(o),f.push(p),o=p<=0?o.left:o.right}u.push(new i(n,t,e,null,null,1));for(var h=u.length-2;h>=0;--h)o=u[h],f[h]<=0?u[h]=new i(o._color,o.key,o.value,u[h+1],o.right,o._count+1):u[h]=new i(o._color,o.key,o.value,o.left,u[h+1],o._count+1);for(h=u.length-1;h>1;--h){var d=u[h-1];if(o=u[h],d._color===a||o._color===a)break;var g=u[h-2];if(g.left===d)if(d.left===o){if(!(v=g.right)||v._color!==n){g._color=n,g.left=d.right,d._color=a,d.right=g,u[h-2]=d,u[h-1]=o,l(g),l(d),h>=3&&((m=u[h-3]).left===g?m.left=d:m.right=d);break}d._color=a,g.right=s(a,v),g._color=n,h-=1}else{if(!(v=g.right)||v._color!==n){d.right=o.left,g._color=n,g.left=o.right,o._color=a,o.left=d,o.right=g,u[h-2]=o,u[h-1]=d,l(g),l(d),l(o),h>=3&&((m=u[h-3]).left===g?m.left=o:m.right=o);break}d._color=a,g.right=s(a,v),g._color=n,h-=1}else if(d.right===o){if(!(v=g.left)||v._color!==n){g._color=n,g.right=d.left,d._color=a,d.left=g,u[h-2]=d,u[h-1]=o,l(g),l(d),h>=3&&((m=u[h-3]).right===g?m.right=d:m.left=d);break}d._color=a,g.left=s(a,v),g._color=n,h-=1}else{var v;if(!(v=g.left)||v._color!==n){var m;d.left=o.right,g._color=n,g.right=o.left,o._color=a,o.right=d,o.left=g,u[h-2]=o,u[h-1]=d,l(g),l(d),l(o),h>=3&&((m=u[h-3]).right===g?m.right=o:m.left=o);break}d._color=a,g.left=s(a,v),g._color=n,h-=1}}return u[0]._color=a,new c(r,u[0])},u.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return f(t,this.root);case 2:return p(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(u,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new d(this,t)}}),Object.defineProperty(u,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new d(this,t)}}),u.at=function(t){if(t<0)return new d(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new d(this,[])},u.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 d(this,n)},u.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 d(this,n)},u.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 d(this,n)},u.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 d(this,n)},u.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 d(this,n);r=a<=0?r.left:r.right}return new d(this,[])},u.remove=function(t){var e=this.find(t);return e?e.remove():this},u.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 g=d.prototype;function v(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(g,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(g,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),g.clone=function(){return new d(this.tree,this._stack.slice())},g.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 i(r._color,r.key,r.value,r.left,r.right,r._count);for(var u=t.length-2;u>=0;--u)(r=t[u]).left===t[u+1]?e[u]=new i(r._color,r.key,r.value,e[u+1],r.right,r._count):e[u]=new i(r._color,r.key,r.value,r.left,e[u+1],r._count);if((r=e[e.length-1]).left&&r.right){var f=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var p=e[f-1];for(e.push(new i(r._color,p.key,p.value,r.left,r.right,r._count)),e[f-1].key=r.key,e[f-1].value=r.value,u=e.length-2;u>=f;--u)r=e[u],e[u]=new i(r._color,r.key,r.value,r.left,e[u+1],r._count);e[f-1].left=e[f]}if((r=e[e.length-1])._color===n){var h=e[e.length-2];for(h.left===r?h.left=null:h.right===r&&(h.right=null),e.pop(),u=0;u=0;--u){if(e=t[u],0===u)return void(e._color=a);if((r=t[u-1]).left===e){if((i=r.right).right&&i.right._color===n)return c=(i=r.right=o(i)).right=o(i.right),r.right=i.left,i.left=r,i.right=c,i._color=r._color,e._color=a,r._color=a,c._color=a,l(r),l(i),u>1&&((f=t[u-2]).left===r?f.left=i:f.right=i),void(t[u-1]=i);if(i.left&&i.left._color===n)return c=(i=r.right=o(i)).left=o(i.left),r.right=c.left,i.left=c.right,c.left=r,c.right=i,c._color=r._color,r._color=a,i._color=a,e._color=a,l(r),l(i),l(c),u>1&&((f=t[u-2]).left===r?f.left=c:f.right=c),void(t[u-1]=c);if(i._color===a){if(r._color===n)return r._color=a,void(r.right=s(n,i));r.right=s(n,i);continue}i=o(i),r.right=i.left,i.left=r,i._color=r._color,r._color=n,l(r),l(i),u>1&&((f=t[u-2]).left===r?f.left=i:f.right=i),t[u-1]=i,t[u]=r,u+11&&((f=t[u-2]).right===r?f.right=i:f.left=i),void(t[u-1]=i);if(i.right&&i.right._color===n)return c=(i=r.left=o(i)).right=o(i.right),r.left=c.right,i.right=c.left,c.right=r,c.left=i,c._color=r._color,r._color=a,i._color=a,e._color=a,l(r),l(i),l(c),u>1&&((f=t[u-2]).right===r?f.right=c:f.left=c),void(t[u-1]=c);if(i._color===a){if(r._color===n)return r._color=a,void(r.left=s(n,i));r.left=s(n,i);continue}var f;i=o(i),r.left=i.right,i.right=r,i._color=r._color,r._color=n,l(r),l(i),u>1&&((f=t[u-2]).right===r?f.right=i:f.left=i),t[u-1]=i,t[u]=r,u+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(g,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(g,"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}),g.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(g,"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}}),g.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),n=e[e.length-1];r[r.length-1]=new i(n._color,n.key,t,n.left,n.right,n._count);for(var a=e.length-2;a>=0;--a)(n=e[a]).left===e[a+1]?r[a]=new i(n._color,n.key,n.value,r[a+1],n.right,n._count):r[a]=new i(n._color,n.key,n.value,n.left,r[a+1],n._count);return new c(this.tree._compare,r[0])},g.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(g,"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}})},{}],233:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,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 o(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+a+.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(o(e));e-=1;for(var r=n[0],a=1;a<9;a++)r+=n[a]/(e+a);var i=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(i,e+.5)*Math.exp(-i)*r},e.exports.log=o},{}],234:[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?(h[u]=-1,d[u]=0):(h[u]=0,d[u]=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],x=[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,u=o(r,n,a,i,s),f=u.cubeEdges,p=u.axis,b=n[12],_=n[13],w=n[14],k=n[15],T=(s?2:1)*this.pixelRatio*(a[3]*b+a[7]*_+a[11]*w+a[15]*k)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=f[A],this.lastCubeProps.axis[A]=p[A];var M=h;for(A=0;A<3;++A)d(h[A],A,this.bounds,f,p);e=this.gl;var E,S,C,L=g;for(A=0;A<3;++A)this.backgroundEnable[A]?L[A]=p[A]:L[A]=0;for(this._background.draw(r,n,a,i,L,this.backgroundColor),this._lines.bind(r,n,a,this),A=0;A<3;++A){var O=[0,0,0];p[A]>0?O[A]=i[1][A]:O[A]=i[0][A];for(var P=0;P<2;++P){var I=(A+1+P)%3,D=(A+1+(1^P))%3;this.gridEnable[I]&&this._lines.drawGrid(I,D,this.bounds,O,this.gridColor[I],this.gridWidth[I]*this.pixelRatio)}for(P=0;P<2;++P)I=(A+1+P)%3,D=(A+1+(1^P))%3,this.zeroEnable[D]&&Math.min(i[0][D],i[1][D])<=0&&Math.max(i[0][D],i[1][D])>=0&&this._lines.drawZero(I,D,this.bounds,O,this.zeroLineColor[D],this.zeroLineWidth[D]*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 z=c(m,M[A].primalMinor),R=c(y,M[A].mirrorMinor),F=this.lineTickLength;for(P=0;P<3;++P){var B=T/r[5*P];z[P]*=F[P]*B,R[P]*=F[P]*B}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,R,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}function N(t){(C=[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?N(n):i>0&&l<0?N(n):i<0&&l>0?N(n):i<0&&l<0?N(n):o>0&&s>0?N(a):o>0&&s<0?N(a):o<0&&s>0?N(a):o<0&&s<0&&N(a)}for(this._lines.unbind(),this._text.bind(r,n,a,this.pixelRatio),A=0;A<3;++A){var V=M[A].primalMinor,U=M[A].mirrorMinor,H=c(x,M[A].primalOffset);for(P=0;P<3;++P)this.lineTickEnable[A]&&(H[P]+=T*V[P]*Math.max(this.lineTickLength[P],0)/r[5*P]);var q=[0,0,0];if(q[A]=1,this.tickEnable[A]){for(-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,S=1,"auto"===(E=[this.tickAlign[A],.5,S])[0]?E[0]=0:E[0]=parseInt(""+E[0]),C=[0,0,0],j(A,V,U),P=0;P<3;++P)H[P]+=T*V[P]*this.tickPad[P]/r[5*P];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],H,this.tickColor[A],q,C,E)}if(this.labelEnable[A]){for(S=0,C=[0,0,0],this.labels[A].length>4&&(N(A),S=1),"auto"===(E=[this.labelAlign[A],.5,S])[0]?E[0]=0:E[0]=parseInt(""+E[0]),P=0;P<3;++P)H[P]+=T*V[P]*this.labelPad[P]/r[5*P];H[A]+=.5*(i[0][A]+i[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],H,this.labelColor[A],[0,0,0],C,E)}}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":236,"./lib/cube.js":237,"./lib/lines.js":238,"./lib/text.js":240,"./lib/ticks.js":241}],236:[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],p=[0,0,0],h=-1;h<=1;h+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=h,p[l]=h;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],p[0],p[1],p[2]),s+=1}var v=c;c=u,u=v}var m=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=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),b=i(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,m,x,b)};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":239,"gl-buffer":243,"gl-vao":328}],237:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,h){a(s,e,t),a(s,r,s);for(var y=0,x=0;x<2;++x){u[2]=i[x][2];for(var b=0;b<2;++b){u[1]=i[b][1];for(var _=0;_<2;++_)u[0]=i[_][0],p(l[y],u,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var k=l[x][3],T=0;T<3;++T)c[x][T]=l[x][T]/k;h&&(c[x][2]*=-1),k<0&&(w<0?w=x:c[x][2]S&&(w|=1<S&&(w|=1<c[x][1]&&(R=x));var F=-1;for(x=0;x<3;++x)(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 V=7^B;V===w||V===z?(V=7^F,j[n.log2(B^V)]=V&B):j[n.log2(F^V)]=V&F;var U=v,H=w;for(A=0;A<3;++A)U[A]=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 a(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 a(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":303,glslify:410}],240:[function(t,e,r){(function(r){"use strict";e.exports=function(t,e,r,i,s,l){var u=n(t),f=a(t,[{buffer:u,size:3}]),p=o(t);p.attributes.position.location=0;var h=new c(t,p,u,f);return h.update(e,r,i,s,l),h};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||{};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}s.__TEXT_CACHE={};var u=c.prototype,f=[0,0];u.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},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,a){var o=[];function s(t,e,r,n,a,s){var c=l[r];c||(c=l[r]={});var u=c[e];u||(u=c[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,p=u.positions,h=u.cells,d=0,g=h.length;d=0;--m){var y=p[v[m]];o.push(f*y[0],-f*y[1],t)}}for(var c=[0,0,0],u=[0,0,0],f=[0,0,0],p=[0,0,0],h={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,h),p[d]=(o.length/3|0)-f[d],c[d]=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,c=o%i;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),a){for(var f=""+c;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 u(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=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=i(s,t.shape);a.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 a=t.createBuffer(),i=new s(t,r,a,0,n);return i.update(e),i}},{ndarray:451,"ndarray-ops":445,"typedarray-pool":543}],244:[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,c=1/0,u=-1/0,f=1/0,p=-1/0,h=null,d=null,g=[],v=1/0,m=!1,y=0;yo&&(o=n.length(b)),y){var _=2*n.distance(h,x)/(n.length(d)+n.length(b));_?(v=Math.min(v,_),m=!1):m=!0}m||(h=x,d=b),g.push(b)}var w=[s,c,f],k=[l,u,p];e&&(e[0]=w,e[1]=k),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 M=0;y=1},h.isTransparent=function(){return this.opacity<1},h.pickSlots=1,h.setPickBase=function(t){this.pickId=t},h.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 a=e[n],i=0;i<3;++i)r[4*n+i]=a[i];r[4*n+3]=255*a[3]}return c(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 p=t.meshColor||[1,1,1,1],h=t.vertexIntensity,d=1/0,g=-1/0;if(h)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],g=+t.vertexIntensityBounds[1];else for(var v=0;v0){var g=this.triShader;g.bind(),g.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},h.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())},h.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},h.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 s=r.shaders;1===arguments.length&&(t=(e=t).gl);var l=function(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(t,s),u=function(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(t,s),f=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));f.generateMipmap(),f.minFilter=t.LINEAR_MIPMAP_LINEAR,f.magFilter=t.LINEAR;var h=a(t),d=a(t),g=a(t),v=a(t),m=a(t),y=new p(t,f,l,u,h,d,m,g,v,i(t,[{buffer:h,type:t.FLOAT,size:4},{buffer:m,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:g,type:t.FLOAT,size:4},{buffer:v,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:4}]),r.traceType||"cone");return y.update(e),y}},{colormap:127,"gl-buffer":243,"gl-mat4/invert":267,"gl-mat4/multiply":269,"gl-shader":303,"gl-texture2d":323,"gl-vao":328,ndarray:451}],246:[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:410}],247:[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"}},{}],248:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":247}],249:[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 c=new s(e,r,o,l);return c.update(t),c};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 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,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],c=n[15],u=(t._ortho?2:1)*this.pixelRatio*(a[3]*i+a[7]*s+a[11]*l+a[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 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=u[n],i=0;i0&&((h=u.slice())[s]+=d[1][s],a.push(u[0],u[1],u[2],g[0],g[1],g[2],g[3],0,0,0,h[0],h[1],h[2],g[0],g[1],g[2],g[3],0,0,0),c(this.bounds,h),o+=2+f(a,h,g,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":250,"gl-buffer":243,"gl-vao":328}],250:[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":303,glslify:410}],251:[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 c=t.getExtension("WEBGL_draw_buffers");if(!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 a=new Array(r),i=0;iu||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 p=t.UNSIGNED_BYTE,h=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!h)throw new Error("gl-fbo: Context does not support floating point textures");p=t.FLOAT}else n.preferFloat&&f>0&&h&&(p=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var v=!1;return"stencil"in n&&(v=!!n.stencil),new d(t,e,r,p,f,g,v,c)};var a,i,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 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 p(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 h(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 d(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 d=0;d1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=p(r,a,i,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=p(r,a,i,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&d?t._depth_rb=h(r,a,i,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=h(r,a,i,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=h(r,a,i,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(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),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=c(n),o=0;o>8*h&255;this.pickOffset=r,a.bind();var d=a.uniforms;d.viewTransform=t,d.pickOffset=e,d.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]);this.xData=r,this.yData=o;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,f=this.bounds,h=f[0]=r[0],d=f[1]=o[0],g=1/((f[2]=r[r.length-1])-h),v=1/((f[3]=o[o.length-1])-d),m=e[0],y=e[1];this.shape=[m,y];var x=(m-1)*(y-1)*(p.length>>>1);this.numVertices=x;for(var b=i.mallocUint8(4*x),_=i.mallocFloat32(2*x),w=i.mallocUint8(2*x),k=i.mallocUint32(x),T=0,A=0;A 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\nlowp vec4 encode_float_1540259130(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\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, encode_float_1540259130(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":303,glslify:410}],257:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=u(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),c=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}]),p=l(new Array(1024),[256,1,4]),h=0;h<1024;++h)p.data[h]=255;var d=i(e,p);d.wrap=e.REPEAT;var g=new v(e,r,o,s,c,d);return g.update(t),g};var n=t("gl-buffer"),a=t("gl-vao"),i=t("gl-texture2d"),o=t("glsl-read-float"),s=t("binary-search-bounds"),l=t("ndarray"),c=t("./lib/shaders"),u=c.createShader,f=c.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(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 d(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,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 m=v.prototype;m.isTransparent=function(){return this.hasAlpha},m.isOpaque=function(){return!this.hasAlpha},m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.drawTransparent=m.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:d(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()}},m.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:d(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.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=[],c=0,u=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],p=t.position||t.positions;if(p){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]);u+=2,v=!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(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),x=Array.isArray(g)?g.length>e-1?g[e-1]:g.length>0?g[g.length-1]:[0,0,0,1]:g;var k=c;if(c+=h(b,_),v){for(r=0;r<2;++r)a.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,m[0],m[1],m[2],m[3]);u+=2,v=!1}a.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,m[0],m[1],m[2],m[3],b[0],b[1],b[2],_[0],_[1],_[2],k,-x,m[0],m[1],m[2],m[3],_[0],_[1],_[2],b[0],b[1],b[2],c,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],c,x,y[0],y[1],y[2],y[3]),u+=4}}if(this.buffer.update(a),i.push(c),o.push(p[p.length-1].slice()),this.bounds=f,this.vertexCount=u,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]}return Math.abs(m-1)>.001?null:[p,s(t,v),v]}},{barycentric:74,"polytope-closest-point/lib/closest_point_2d.js":482}],281:[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}"]),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}"]),p=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}"]),h=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: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: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:p,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:h,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:410}],282:[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"),c=t("gl-mat4/invert"),u=t("ndarray"),f=t("colormap"),p=t("simplicial-complex-contour"),h=t("typedarray-pool"),d=t("./lib/shaders"),g=t("./lib/closest-point"),v=d.meshShader,m=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 k(t,e,r,n,a,i,o,s,l,c,u,f,p,h,d,g,v,m,y,x,b,_,k,T,A,M,E){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=u,this.triangleNormals=p,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=h,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=v,this.edgeUVs=m,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=k,this.pointSizes=T,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var T=k.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,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,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function S(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 C(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=p(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,a=e.vertexWeights,i=r.length,o=h.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;ia[T]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=v[t],r.uniforms.angle=m[t],i.drawArrays(i.TRIANGLES,a[T],a[A]-a[T]))),y[t]&&k&&(u[1^t]-=M*h*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t],r.uniforms.angle=_[t],i.drawArrays(i.TRIANGLES,w,k)),u[1^t]=M*s[2+(1^t)]-1,d[t+2]&&(u[1^t]+=M*h*g[t+2],Ta[T]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=v[t+2],r.uniforms.angle=m[t+2],i.drawArrays(i.TRIANGLES,a[T],a[A]-a[T]))),y[t+2]&&k&&(u[1^t]+=M*h*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],i.drawArrays(i.TRIANGLES,w,k))}),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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-i[u])/(i[2+u]-i[u])-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=(p=[0,0],h=[0,0],d=[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,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],f=i[o],g=i[o+2]-f,v=a[o],m=a[o+2]-v;h[o]=2*l/u*g/m,p[o]=2*(s-c)/u*g/m}d[1]=2*t.pixelRatio/(a[3]-a[1]),d[0]=d[1]*(a[3]-a[1])/(a[2]-a[0]),e.uniforms.dataScale=h,e.uniforms.dataShift=p,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),g.update=function(t){var e,r,n,a,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],f=[-1/0],p=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],h[d],p[d]):o.drawLine(e[0],g,e[2],g,h[d],p[d])}}for(d=0;d=0;--t)this.objects[t].dispose();for(this.objects.length=0,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(i,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*a*e/window.innerHeight*(i-c.lastT())/20;c.pan(i,0,0,f*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};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":54,"has-passive-events":412,"mouse-change":436,"mouse-event-offset":437,"mouse-wheel":439,"right-now":502}],291:[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":303,glslify:410}],292:[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"),c=t("a-big-triangle"),u=t("mouse-change"),f=t("gl-mat4/perspective"),p=t("gl-mat4/ortho"),h=t("./lib/shader"),d=t("is-mobile")({tablet:!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}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):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;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(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})),!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}),_=h(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,k={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 M=t.spikes||{},E=o(r,M),S=[],C=[],L=[],O=[],P=!0,I=!0,D=new Array(16),z=new Array(16),R={view:null,projection:D,model:z,_ortho:!1},F=(I=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),B=t.cameraObject||n(e,k),N={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:B,axes:A,axesPixels:null,spikes:E,bounds:y,objects:S,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: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: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}},j=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function V(){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 a=0|Math.ceil(r*N.pixelRatio),i=0|Math.ceil(n*N.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",P=!0}}}function U(){for(var t=S.length,e=O.length,n=0;n0&&0===L[e-1];)L.pop(),O.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())}N.autoResize&&V(),window.addEventListener("resize",V),N.update=function(t){N._stopped||(t=t||{},P=!0,I=!0)},N.add=function(t){N._stopped||(t.axes=A,S.push(t),C.push(-1),P=!0,I=!0,U())},N.remove=function(t){if(!N._stopped){var e=S.indexOf(t);e<0||(S.splice(e,1),C.pop(),P=!0,I=!0,U())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener("resize",V),e.removeEventListener("webglcontextlost",H),N.mouseListener.enabled=!1,!N.contextLost)){A.dispose(),E.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:410}],294:[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),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),f=new s(t,i,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,a=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=a?s:i.mallocFloat32(s.length),c=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),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/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=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),p=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),p&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),p&&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,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":293,"gl-buffer":243,"gl-shader":303,"typedarray-pool":543}],295:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s,l,c=e[0],u=e[1],f=e[2],p=e[3],h=r[0],d=r[1],g=r[2],v=r[3];return(i=c*h+u*d+f*g+p*v)<0&&(i=-i,h=-h,d=-d,g=-g,v=-v),1-i>1e-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),t[0]=s*c+l*h,t[1]=s*u+l*d,t[2]=s*f+l*g,t[3]=s*p+l*v,t}},{}],296:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],297:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var i=a[e];if(i||(i=a[e]={}),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,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=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"]),c=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}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:i,fragment:l,attributes:u},p={vertex:o,fragment:l,attributes:u},h={vertex:s,fragment:l,attributes:u},d={vertex:i,fragment:c,attributes:u},g={vertex:o,fragment:c,attributes:u},v={vertex:s,fragment:c,attributes:u};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,p)},r.createProject=function(t){return m(t,h)},r.createPickPerspective=function(t){return m(t,d)},r.createPickOrtho=function(t){return m(t,g)},r.createPickProject=function(t){return m(t,v)}},{"gl-shader":303,glslify:410}],299:[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"),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 p(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 h(t,e,r,n){return p(n,n),p(n,n),p(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function g(t){return!0===t?1:t>1?1:t}function v(t,e,r,n,a,i,o,s,l,c,u,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=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=a(e),p=a(e),h=a(e),d=a(e),g=i(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:p,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),m=new v(e,r,n,o,f,p,h,d,g,s,c,u);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],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],k=f.slice(),T=[0,0,0],A=[[0,0,0],[0,0,0]];function M(t){return t[0]=t[1]=t[2]=0,t}function E(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 C(t,e,r,n){var a,i=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||f,u=r.view||f,p=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);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=u,l.projection=p,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=k,C=0;C<16;++C)m[C]=0;for(C=0;C<4;++C)m[5*C]=1;m[5*v]=0,a[v]<0?m[12+v]=d[0][v]:m[12+v]=d[1][v],s(m,c,m),l.model=m;var L=(v+1)%3,O=(v+2)%3,P=M(x),I=M(b);P[L]=1,I[O]=1;var D=h(0,0,0,E(_,P)),z=h(0,0,0,E(w,I));if(Math.abs(D[1])>Math.abs(z[1])){var R=D;D=z,z=R,R=P,P=I,I=R;var F=L;L=O,O=F}D[0]<0&&(P[L]=-1),z[1]>0&&(I[O]=-1);var B=0,N=0;for(C=0;C<4;++C)B+=Math.pow(c[4*L+C],2),N+=Math.pow(c[4*O+C],2);P[L]/=Math.sqrt(B),I[O]/=Math.sqrt(N),l.axes[0]=P,l.axes[1]=I,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 L=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(t,e,r,n,a,i,o){var s=r.gl;if((i===r.projectHasAlpha||o)&&C(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=L,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 P(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){Array.isArray(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(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",c=t.alignment||[0,0];if(2===c.length)a=c[0],i=c[1];else for(a=[],i=[],n=0;n0){var I=0,D=x,z=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(h)&&Array.isArray(h[0]),B=Array.isArray(m)&&Array.isArray(m[0]);t:for(n=0;n<_;++n){for(y+=1,w=s[n],k=0;k<3;++k){if(isNaN(w[k])||!isFinite(w[k]))continue t;f[k]=Math.max(f[k],w[k]),u[k]=Math.min(u[k],w[k])}T=(N=P(p,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;var N,j=N.visible;if(j)if(Array.isArray(h)){if(3===(V=F?n0?1-M[0][0]:W<0?1+M[1][0]:1,Y*=Y>0?1-M[0][1]:Y<0?1+M[1][1]:1],Z=T.cells||[],J=T.positions||[];for(k=0;k0){var m=r*u;o.drawBox(f-m,p-m,h+m,p+m,i),o.drawBox(f-m,d-m,h+m,d+m,i),o.drawBox(f-m,p-m,f+m,d+m,i),o.drawBox(h-m,p-m,h+m,d+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":300,"gl-buffer":243,"gl-shader":303}],302:[function(t,e,r){"use strict";e.exports=function(t,e){var r=n(t,e),i=a.mallocUint8(e[0]*e[1]*4);return new c(t,r,i)};var n=t("gl-fbo"),a=t("typedarray-pool"),i=t("ndarray"),o=t("bit-twiddle").nextPow2,s=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_16_arg0_<255||_inline_16_arg1_<255||_inline_16_arg2_<255||_inline_16_arg3_<255){var _inline_16_l=_inline_16_arg4_-_inline_16_arg6_[0],_inline_16_a=_inline_16_arg5_-_inline_16_arg6_[1],_inline_16_f=_inline_16_l*_inline_16_l+_inline_16_a*_inline_16_a;_inline_16_fthis.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 k=0|w.type.charAt(w.type.length-1),T=new Array(k),A=0;A=0;)M+=1;_[y]=M}var E=new Array(r.length);function S(){p.program=o.program(h,p._vref,p._fref,b,_);for(var t=0;t=0){if((d=p.charCodeAt(p.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+p);o(t,e,h[0],a,d,i,f)}else{if(!(p.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+p);var d;if((d=p.charCodeAt(p.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+p);s(t,e,h,a,d,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"],c=[],u=0;u4)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 c(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[u].type);var h}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:410}],314:[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(k=0;k<8;k++){var T=(k+1)%8;c.push(p[k],h[k],h[T],h[T],p[T],p[k]),f.push(y,m,m,m,y,y),d.push(g,v,v,v,g,g);var A=c.length;u.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var M=p;p=h,h=M;var E=y;y=m,m=E;var S=g;g=v,v=S}return{positions:c,cells:u,vectors:f,vertexIntensity:d}}(t,r,i,o)})),f=[],p=[],h=[],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>p-1||x>h-1)return n.create();var b,_,w,k,T,A,M=i[0][d],E=i[0][m],S=i[1][g],C=i[1][y],L=i[2][v],O=(o-M)/(E-M),P=(c-S)/(C-S),I=(u-L)/(i[2][x]-L);switch(isFinite(O)||(O=.5),isFinite(P)||(P=.5),isFinite(I)||(I=.5),r.reversedX&&(d=f-1-d,m=f-1-m),r.reversedY&&(g=p-1-g,y=p-1-y),r.reversedZ&&(v=h-1-v,x=h-1-x),r.filled){case 5:T=v,A=x,w=g*h,k=y*h,b=d*h*p,_=m*h*p;break;case 4:T=v,A=x,b=d*h,_=m*h,w=g*h*f,k=y*h*f;break;case 3:w=g,k=y,T=v*p,A=x*p,b=d*p*h,_=m*p*h;break;case 2:w=g,k=y,b=d*p,_=m*p,T=v*p*f,A=x*p*f;break;case 1:b=d,_=m,T=v*f,A=x*f,w=g*f*h,k=y*f*h;break;default:b=d,_=m,w=g*f,k=y*f,T=v*f*p,A=x*f*p}var D=a[b+w+T],z=a[b+w+A],R=a[b+k+T],F=a[b+k+A],B=a[_+w+T],N=a[_+w+A],j=a[_+k+T],V=a[_+k+A],U=n.create(),H=n.create(),q=n.create(),G=n.create();n.lerp(U,D,B,O),n.lerp(H,z,N,O),n.lerp(q,R,j,O),n.lerp(G,F,V,O);var W=n.create(),Y=n.create();n.lerp(W,U,q,P),n.lerp(Y,H,G,P);var X=n.create();return n.lerp(X,W,Y,I),X}(e,t,h)},g=t.getDivergence||function(t,e){var r=n.create(),a=1e-4;n.add(r,t,[a,0,0]);var i=d(r);n.subtract(i,i,e),n.scale(i,i,1e4),n.add(r,t,[0,a,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1e4),n.add(r,t,[0,0,a]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1e4),n.add(r,i,o),n.add(r,r,s),r},v=[],m=e[0][0],y=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],k=function(t){var e=t[0],r=t[1],n=t[2];return!(eb||r_||nw)},T=10*n.distance(e[0],e[1])/a,A=T*T,M=1,E=0,S=r.length;S>1&&(M=function(t){for(var e=[],r=[],n=[],a={},i={},o={},s=t.length,l=0;lE&&(E=F),z.push(F),v.push({points:O,velocities:P,divergences:z});for(var B=0;B<100*a&&O.lengthA&&n.scale(N,N,T/Math.sqrt(j)),n.add(N,N,L),I=d(N),n.squaredDistance(D,N)-A>-1e-4*A&&(O.push(N),D=N,P.push(I),R=g(N,I),F=n.length(R),isFinite(F)&&F>E&&(E=F),z.push(F)),L=N}}var V=o(v,t.colormap,E,M);return f?V.tubeScale=f:(0===E&&(E=1),V.tubeScale=.5*u*M/E),V};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":313,"gl-cone3d":244,"gl-vec3":347,"gl-vec4":383}],315:[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 ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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"]),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":303,glslify:410}],316:[function(t,e,r){arguments[4][112][0].apply(r,arguments)},{dup:112}],317:[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=a(e),u=i(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),f=a(e),p=i(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),h=a(e),d=i(e,[{buffer:h,size:2,type:e.FLOAT}]),g=o(e,1,E,e.RGBA,e.UNSIGNED_BYTE);g.minFilter=e.LINEAR,g.magFilter=e.LINEAR;var v=new S(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,g,s,l,f,p,h,d,[0,0,0]),m={levels:[[],[],[]]};for(var k in t)m[k]=t[k];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"),c=t("ndarray-ops"),u=t("ndarray-pack"),f=t("ndarray"),p=t("surface-nets"),h=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),g=t("binary-search-bounds"),v=t("ndarray-gradient"),m=t("./lib/shaders"),y=m.createShader,x=m.createContourShader,b=m.createPickShader,_=m.createPickContourShader,w=40,k=[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]],A=[[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,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=A[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var E=256;function S(t,e,r,n,a,i,o,l,c,u,p,h,d,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=c,this._contourPickShader=u,this._contourBuffer=p,this._contourVAO=h,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=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 C=S.prototype;C.isTransparent=function(){return this.opacity<1},C.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},C.pickSlots=1,C.setPickBase=function(t){this.pickId=t};var L=[0,0,0],O={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(t,e){var r,n,a,i=e.axes&&e.axes.lastCubeProps.axis||L,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=O.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],h(l,t.model,l);var c=O.clipBounds[r];for(a=0;a<2;++a)for(n=0;n<3;++n)c[a][n]=t.clipBounds[a][n];c[0][r]=-1e8,c[1][r]=1e8}return O.showSurface=o,O.showContour=s,O}var I={model:k,view:k,projection:k,inverseModel:k.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},D=k.slice(),z=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=I;n.model=t.model||k,n.view=t.view||k,n.projection=t.projection||k,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 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=z,n.vertexColor=this.vertexColor;var s=D;for(h(s,n.view,n.model),h(s,n.projection,s),d(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 c=s[12+a];for(o=0;o<3;++o)c+=s[4*o+a]*this.lightPosition[o];n.lightPosition[a]=c/l}var u=P(n,this);if(u.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[a],this._shader.uniforms.clipBounds=u.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var p=this._contourVAO;for(p.bind(),a=0;a<3;++a)for(f.uniforms.permutation=A[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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?i:1-i,p=0;p<2;++p)for(var h=a+u,d=s+p,v=f*(p?l:1-l),m=0;m<3;++m)c[m]+=this._field[m].get(h,d)*v;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]=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},C.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))},C.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=B(t.contourWidth,Number)),"showContour"in t&&(this.showContour=B(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=B(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=j(t.contourColor)),"contourProject"in t&&(this.contourProject=B(t.contourProject,(function(t){return B(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=j(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=B(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=B(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var 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 h=t.coords;if(!Array.isArray(h)||3!==h.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var d=h[o];for(b=0;b<2;++b)if(d.shape[b]!==i[b])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],d)}}else if(t.ticks){var g=t.ticks;if(!Array.isArray(g)||2!==g.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var m=g[o];if((Array.isArray(m)||m.length)&&(m=f(m)),m.shape[0]!==i[o])throw new Error("gl-surface: invalid tick length");var y=f(m.data,i);y.stride[o]=m.stride[0],y.stride[1^o]=0,this.padField(this._field[o],y)}}else{for(o=0;o<2;++o){var x=[0,0];x[o]=1,this._field[o]=f(this._field[o].data,[i[0]+2,i[1]+2],x,0)}this._field[0].set(0,0,0);for(var b=0;b0){for(var kt=0;kt<5;++kt)rt.pop();G-=1}continue t}rt.push(st[0],st[1],ut[0],ut[1],st[2]),G+=1}}ot.push(G)}this._contourOffsets[nt]=it,this._contourCounts[nt]=ot}var Tt=s.mallocFloat(rt.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:{}}},k.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),k.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=k.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(k.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var a=n.stringify({size:k.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=h(t.size),l=Math.round(s[0]*d(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]=k.fonts[a],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:a,family:c,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:m(c,{origin:"top",fontSize:k.baseFontSize,fontStyle:u.join(" ")})},k.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),p=0;p2){for(var w=!t.position[0].length,T=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,a=0;return a+=.5*n.bottom,a+="number"==typeof t?t-n.baseline:-n[t],k.normalViewport||(a*=-1),a}))),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 W=(t.color.subarray||t.color.slice).bind(t.color),Y=0;Y4||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=[]},k.prototype.destroy=function(){},k.prototype.kerning=!0,k.prototype.position={constant:new Float32Array(2)},k.prototype.translate=null,k.prototype.scale=null,k.prototype.font=null,k.prototype.text="",k.prototype.positionOffset=[0,0],k.prototype.opacity=1,k.prototype.color=new Uint8Array([0,0,0,255]),k.prototype.alignOffset=[0,0],k.normalViewport=!1,k.maxAtlasSize=1024,k.atlasCanvas=document.createElement("canvas"),k.atlasContext=k.atlasCanvas.getContext("2d",{alpha:!1}),k.baseFontSize=64,k.fonts={},e.exports=k},{"bit-twiddle":93,"color-normalize":121,"css-font":140,"detect-kerning":167,"es6-weak-map":319,"flatten-vertex-data":229,"font-atlas":230,"font-measure":231,"gl-util/context":324,"is-plain-obj":423,"object-assign":455,"parse-rect":460,"parse-unit":462,"pick-by-alias":466,regl:500,"to-px":537,"typedarray-pool":543}],319:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?WeakMap:t("./polyfill")},{"./is-implemented":320,"./polyfill":322}],320:[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)}},{}],321:[function(t,e,r){"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},{}],322:[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"),c=t("d"),u=t("es6-iterator/get"),f=t("es6-iterator/for-of"),p=t("es6-symbol").toStringTag,h=t("./is-native-implemented"),d=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=h&&i&&WeakMap!==n?i(new WeakMap,m(this)):this,a(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},h&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:c(n)})),Object.defineProperties(n.prototype,{delete:c((function(t){return!!v.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:c((function(t){if(v.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:c((function(t){return v.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,p,c("c","WeakMap"))},{"./is-native-implemented":321,d:152,"es5-ext/object/is-value":196,"es5-ext/object/set-prototype-of":202,"es5-ext/object/valid-object":206,"es5-ext/object/valid-value":207,"es5-ext/string/random-uniq":212,"es6-iterator/for-of":214,"es6-iterator/get":215,"es6-symbol":221}],323:[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");if(o||function(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]}(t),"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=c(e)?e:e.raw;if(r)return function(t,e,r,n,a,i){var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,a,a,i,e),new p(t,o,r,n,a,i)}(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 function(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=d(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 f,h,v=0;if(2===o.length)v=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])v=t.ALPHA;else if(2===o[2])v=t.LUMINANCE_ALPHA;else if(3===o[2])v=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)f=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 x=n(h,o,y,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?a.assign(x,e):u(x,e),f=h.subarray(0,m)}var b=g(t);return t.texImage2D(t.TEXTURE_2D,0,v,o[0],o[1],0,v,c,f),l||i.free(h),new p(t,b,o[0],o[1],v,c)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;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 u=function(t,e){a.muls(t,e,255)};function f(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 p(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 h=p.prototype;function d(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,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=g(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,a,null),new p(t,o,e,r,n,a)}Object.defineProperties(h,{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}}}),h.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},h.dispose=function(){this.gl.deleteTexture(this.handle)},h.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)},h.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,c,f){var p=f.dtype,h=f.shape.slice();if(h.length<2||h.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var g=0,v=0,m=d(h,f.stride.slice());if("float32"===p?g=t.FLOAT:"float64"===p?(g=t.FLOAT,m=!1,p="float32"):"uint8"===p?g=t.UNSIGNED_BYTE:(g=t.UNSIGNED_BYTE,m=!1,p="uint8"),2===h.length)v=t.LUMINANCE,h=[h[0],h[1],1],f=n(f.data,h,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==h.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===h[2])v=t.ALPHA;else if(2===h[2])v=t.LUMINANCE_ALPHA;else if(3===h[2])v=t.RGB;else{if(4!==h[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}h[2]}if(v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s),v!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=f.size,x=c.indexOf(o)<0;if(x&&c.push(o),g===l&&m)0===f.offset&&f.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,h[0],h[1],0,s,l,f.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,h[0],h[1],s,l,f.data):x?t.texImage2D(t.TEXTURE_2D,o,s,h[0],h[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,h[0],h[1],s,l,f.data.subarray(f.offset,f.offset+y));else{var b;b=l===t.FLOAT?i.mallocFloat32(y):i.mallocUint8(y);var _=n(b,h,[h[2],h[2]*h[0],1]);g===t.FLOAT&&l===t.UNSIGNED_BYTE?u(_,f):a.assign(_,f),x?t.texImage2D(t.TEXTURE_2D,o,s,h[0],h[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,h[0],h[1],s,l,b.subarray(0,y)),l===t.FLOAT?i.freeFloat32(b):i.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:451,"ndarray-ops":445,"typedarray-pool":543}],324:[function(t,r,n){(function(e){"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*e.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*e.innerHeight);else{var r=t.container.getBoundingClientRect();t.canvas.width=t.width||r.right-r.left,t.canvas.height=t.height||r.bottom-r.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}r.exports=function(t){var r;if(t?"string"==typeof t&&(t={container:t}):t={},(t=i(t)?{container:t}:"string"==typeof(r=t).nodeName&&"function"==typeof r.appendChild&&"function"==typeof r.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)).pixelRatio||(t.pixelRatio=e.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)}if(!t.gl)try{t.gl=t.canvas.getContext("webgl",t.attrs)}catch(r){try{t.gl=t.canvas.getContext("experimental-webgl",t.attrs)}catch(r){t.gl=t.canvas.getContext("webgl-experimental",t.attrs)}}return t.gl}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"pick-by-alias":466}],325:[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":340,"./fromValues":346,"./normalize":357}],331:[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}},{}],332:[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}},{}],333:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],334:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],335:[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}},{}],336:[function(t,e,r){e.exports=t("./distance")},{"./distance":337}],337:[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)}},{}],338:[function(t,e,r){e.exports=t("./divide")},{"./divide":339}],339:[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}},{}],340:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],341:[function(t,e,r){e.exports=1e-6},{}],342:[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":341}],343:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],344:[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}},{}],345:[function(t,e,r){e.exports=function(t,e,r,a,i,o){var s,l;for(e||(e=3),r||(r=0),l=a?Math.min(a*e+r,t.length):t.length,s=r;s0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i),t}},{}],358:[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}},{}],359:[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),c=Math.cos(n);return t[0]=e[0],t[1]=a+o*c-s*l,t[2]=i+o*l+s*c,t}},{}],360:[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),c=Math.cos(n);return t[0]=a+s*l+o*c,t[1]=e[1],t[2]=i+s*c-o*l,t}},{}],361:[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),c=Math.cos(n);return t[0]=a+o*c-s*l,t[1]=i+o*l+s*c,t[2]=e[2],t}},{}],362:[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}},{}],363:[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}},{}],364:[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}},{}],365:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],366:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":368}],367:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":369}],368:[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}},{}],369:[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}},{}],370:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":371}],371:[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}},{}],372:[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}},{}],373:[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}},{}],374:[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],c=r[3],u=c*n+s*i-l*a,f=c*a+l*n-o*i,p=c*i+o*a-s*n,h=-o*n-s*a-l*i;return t[0]=u*c+h*-o+f*-l-p*-s,t[1]=f*c+h*-s+p*-o-u*-l,t[2]=p*c+h*-l+u*-s-f*-o,t}},{}],375:[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}},{}],376:[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}},{}],377:[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}},{}],378:[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}},{}],379:[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)}},{}],380:[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}},{}],381:[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]}},{}],382:[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}},{}],383:[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":375,"./clone":376,"./copy":377,"./create":378,"./distance":379,"./divide":380,"./dot":381,"./fromValues":382,"./inverse":384,"./length":385,"./lerp":386,"./max":387,"./min":388,"./multiply":389,"./negate":390,"./normalize":391,"./random":392,"./scale":393,"./scaleAndAdd":394,"./set":395,"./squaredDistance":396,"./squaredLength":397,"./subtract":398,"./transformMat4":399,"./transformQuat":400}],384:[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}},{}],385:[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)}},{}],386:[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}},{}],387:[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}},{}],388:[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}},{}],389:[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}},{}],390:[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}},{}],391:[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;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=a*o,t[3]=i*o),t}},{}],392:[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":391,"./scale":393}],393:[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}},{}],394:[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}},{}],395:[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}},{}],396:[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}},{}],397:[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}},{}],398:[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}},{}],399:[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}},{}],400:[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],c=r[3],u=c*n+s*i-l*a,f=c*a+l*n-o*i,p=c*i+o*a-s*n,h=-o*n-s*a-l*i;return t[0]=u*c+h*-o+f*-l-p*-s,t[1]=f*c+h*-s+p*-o-u*-l,t[2]=p*c+h*-l+u*-s-f*-o,t[3]=e[3],t}},{}],401:[function(t,e,r){e.exports=function(t,e,r,i){return n[0]=i,n[1]=r,n[2]=e,n[3]=t,a[0]};var n=new Uint8Array(4),a=new Float32Array(n.buffer)},{}],402:[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 F(r),O+=r.length,(E=E.slice(r.length)).length}}function q(){return/[^a-fA-F0-9]/.test(e)?(F(E.join("")),M=l,T):(E.push(e),r=e,T+1)}function G(){return"."===e?(E.push(e),M=g,r=e,T+1):/[eE]/.test(e)?(E.push(e),M=g,r=e,T+1):"x"===e&&1===E.length&&"0"===E[0]?(M=_,E.push(e),r=e,T+1):/[^\d]/.test(e)?(F(E.join("")),M=l,T):(E.push(e),r=e,T+1)}function W(){return"f"===e&&(E.push(e),r=e,T+=1),/[eE]/.test(e)?(E.push(e),r=e,T+1):"-"===e&&/[eE]/.test(r)?(E.push(e),r=e,T+1):/[^\d]/.test(e)?(F(E.join("")),M=l,T):(E.push(e),r=e,T+1)}function Y(){if(/[^\d\w_]/.test(e)){var t=E.join("");return M=R.indexOf(t)>-1?y:z.indexOf(t)>-1?m:v,F(E.join("")),M=l,T}return E.push(e),r=e,T+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=999,c=9999,u=0,f=1,p=2,h=3,d=4,g=5,v=6,m=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":405,"./lib/builtins-300es":404,"./lib/literals":407,"./lib/literals-300es":406,"./lib/operators":408}],404:[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":405}],405:[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"]},{}],406:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":407}],407:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],408:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],409:[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":403}],410:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,u=-7,f=r?a-1:0,p=r?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+t[e+f],f+=p,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=p,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,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-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?p/l:p*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,a),o+=f):(s=e*Math.pow(2,f-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*g}},{}],414:[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),u=0;u<=a;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var f=new i(l,new Array(a+1),!1),p=f.adjacent,h=new Array(a+2);for(u=0;u<=a;++u){for(var d=l.slice(),g=0;g<=a;++g)g===u&&(d[g]=-1);var v=d[0];d[0]=d[1],d[1]=v;var m=new i(d,new Array(a+1),!0);p[u]=m,h[u]=m}for(h[a+1]=f,u=0;u<=a;++u){d=p[u].vertices;var y=p[u].adjacent;for(g=0;g<=a;++g){var x=d[g];if(x<0)y[g]=f;else for(var b=0;b<=a;++b)p[b].vertices.indexOf(x)<0&&(y[g]=p[b])}}var _=new c(a,o,h),w=!!e;for(u=a+1;u0&&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 u=c.prototype;u.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 c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var p=u[f];a[f]=p<0?e:i[p]}var h=this.orient();if(h>0)return c;c.lastVisited=-n,0===h&&o.push(c)}}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)i[u]=a[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var p=i[u];i[u]=t;var h=this.orient();if(i[u]=p,h<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,a=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 p=[];f.length>0;){var h=(e=f.pop()).vertices,d=e.adjacent,g=h.indexOf(r);if(!(g<0))for(var v=0;v<=n;++v)if(v!==g){var m=d[v];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=a[y[b]];if(this.orient()>0){y[x]=r,m.boundary=!1,c.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var _=m.adjacent,w=h.slice(),k=d.slice(),T=new i(w,k,!0);u.push(T);var A=_.indexOf(e);if(!(A<0))for(_[A]=T,k[g]=m,w[v]=-1,k[v]=e,d[v]=T,T.flip(),b=0;b<=n;++b){var M=w[b];if(!(M<0||M===r)){for(var E=new Array(n-1),S=0,C=0;C<=n;++C){var L=w[C];L<0||C===b||(E[S++]=L)}p.push(new o(E,T,b))}}}}}for(p.sort(s),v=0;v+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":508,"simplicial-complex":518}],415:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),a=0,i=1;function o(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){return t&&0!==t.length?new x(y(t)):new x(null)};var s=o.prototype;function l(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 c(t,e){var r=y(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 u(t,e){var r=t.intervals([]);r.push(e),c(t,r)}function f(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?a:(r.splice(n,1),c(t,r),i)}function p(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function d(t,e){for(var r=0;r>1],a=[],i=[],s=[];for(r=0;r3*(e+1)?u(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?u(this,t):this.right.insert(t):this.right=y([t]);else{var r=n.ge(this.leftPoints,t,v),a=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(a,0,t)}},s.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?f(this,t):2===(c=this.left.remove(t))?(this.left=null,this.count-=1,i):(c===i&&(this.count-=1),c):a;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?f(this,t):2===(c=this.right.remove(t))?(this.right=null,this.count-=1,i):(c===i&&(this.count-=1),c):a;if(1===this.count)return this.leftPoints[0]===t?2:a;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,o=this.left;o.right;)r=o,o=o.right;if(r===this)o.right=this.right;else{var s=this.left,c=this.right;r.count-=o.count,r.right=o.left,o.left=s,o.right=c}l(this,o),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?l(this,this.left):l(this,this.right);return i}for(s=n.ge(this.leftPoints,t,v);sthis.mid?this.right&&(r=this.right.queryPoint(t,e))?r:h(this.rightPoints,t,e):d(this.leftPoints,e);var r},s.queryInterval=function(t,e,r){var n;return tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:ethis.mid?h(this.rightPoints,t,r):d(this.leftPoints,r)};var b=x.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new o(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==a}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":92}],416:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r=r-1)for(var h=l.length-1,d=t-e[r-1],p=0;p=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(a(l[f-1],u[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(u[h-1],c[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],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 p=arguments[h];n.push(a(l[h-1],u[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],u[f],n[o]+c*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":84,"cubic-hermite":138}],226:[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,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(i=0,o=r;ie[0]-o[0]/2&&(h=o[0]/2,p+=o[1]);return r}},{"css-font/stringify":135}],228:[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=e.style||e.fontStyle||"",t=[u,l,s].join(" ")+"px "+r,c=e.origin||"top";if(n.cache[r]&&s<=n.cache[r].em)return i(n.cache[r],c);var f=e.canvas||n.canvas,h=f.getContext("2d"),p={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);f.height=d,f.width=.5*d,h.font=t;var v={top:0};h.clearRect(0,0,d,d),h.textBaseline="top",h.fillStyle="black",h.fillText("H",0,0);var g=a(h.getImageData(0,0,d,d));h.clearRect(0,0,d,d),h.textBaseline="bottom",h.fillText("H",0,d);var m=a(h.getImageData(0,0,d,d));v.lineHeight=v.bottom=d-m+g,h.clearRect(0,0,d,d),h.textBaseline="alphabetic",h.fillText("H",0,d);var y=a(h.getImageData(0,0,d,d)),x=d-y-1+g;v.baseline=v.alphabetic=x,h.clearRect(0,0,d,d),h.textBaseline="middle",h.fillText("H",0,.5*d);var b=a(h.getImageData(0,0,d,d));v.median=v.middle=d-b-1+g-.5*d,h.clearRect(0,0,d,d),h.textBaseline="hanging",h.fillText("H",0,.5*d);var _=a(h.getImageData(0,0,d,d));v.hanging=d-_-1+g-.5*d,h.clearRect(0,0,d,d),h.textBaseline="ideographic",h.fillText("H",0,d);var w=a(h.getImageData(0,0,d,d));if(v.ideographic=d-w-1+g,p.upper&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.upper,0,0),v.upper=a(h.getImageData(0,0,d,d)),v.capHeight=v.baseline-v.upper),p.lower&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.lower,0,0),v.lower=a(h.getImageData(0,0,d,d)),v.xHeight=v.baseline-v.lower),p.tittle&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.tittle,0,0),v.tittle=a(h.getImageData(0,0,d,d))),p.ascent&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.ascent,0,0),v.ascent=a(h.getImageData(0,0,d,d))),p.descent&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.descent,0,0),v.descent=o(h.getImageData(0,0,d,d))),p.overshoot){h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.overshoot,0,0);var k=o(h.getImageData(0,0,d,d));v.overshoot=k-x}for(var A in v)v[A]/=s;return v.em=s,n.cache[r]=v,i(v,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={}},{}],229:[function(t,e,r){"use strict";e.exports=function(t){return new u(t||d,null)};var n=0,i=1;function a(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 o(t){return new a(t._color,t.key,t.value,t.left,t.right,t._count)}function s(t,e){return new a(t,e.key,e.value,e.left,e.right,e._count)}function l(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function u(t,e){this._compare=t,this.root=e}var c=u.prototype;function f(t,e){this.tree=t,this._stack=e}Object.defineProperty(c,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(c,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(c,"length",{get:function(){return this.root?this.root._count:0}}),c.insert=function(t,e){for(var r=this._compare,o=this.root,c=[],f=[];o;){var h=r(t,o.key);c.push(o),f.push(h),o=h<=0?o.left:o.right}c.push(new a(n,t,e,null,null,1));for(var p=c.length-2;p>=0;--p){var o=c[p];f[p]<=0?c[p]=new a(o._color,o.key,o.value,c[p+1],o.right,o._count+1):c[p]=new a(o._color,o.key,o.value,o.left,c[p+1],o._count+1)}for(var p=c.length-1;p>1;--p){var d=c[p-1],o=c[p];if(d._color===i||o._color===i)break;var v=c[p-2];if(v.left===d)if(d.left===o){var g=v.right;if(!g||g._color!==n){if(v._color=n,v.left=d.right,d._color=i,d.right=v,c[p-2]=d,c[p-1]=o,l(v),l(d),p>=3){var m=c[p-3];m.left===v?m.left=d:m.right=d}break}d._color=i,v.right=s(i,g),v._color=n,p-=1}else{var g=v.right;if(!g||g._color!==n){if(d.right=o.left,v._color=n,v.left=o.right,o._color=i,o.left=d,o.right=v,c[p-2]=o,c[p-1]=d,l(v),l(d),l(o),p>=3){var m=c[p-3];m.left===v?m.left=o:m.right=o}break}d._color=i,v.right=s(i,g),v._color=n,p-=1}else if(d.right===o){var g=v.left;if(!g||g._color!==n){if(v._color=n,v.right=d.left,d._color=i,d.left=v,c[p-2]=d,c[p-1]=o,l(v),l(d),p>=3){var m=c[p-3];m.right===v?m.right=d:m.left=d}break}d._color=i,v.left=s(i,g),v._color=n,p-=1}else{var g=v.left;if(!g||g._color!==n){if(d.left=o.right,v._color=n,v.right=o.left,o._color=i,o.right=d,o.left=v,c[p-2]=o,c[p-1]=d,l(v),l(d),l(o),p>=3){var m=c[p-3];m.right===v?m.right=o:m.left=o}break}d._color=i,v.left=s(i,g),v._color=n,p-=1}}return c[0]._color=i,new u(r,c[0])},c.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return function t(e,r){if(r.left){var n=t(e,r.left);if(n)return n}var n=e(r.key,r.value);return n||(r.right?t(e,r.right):void 0)}(t,this.root);case 2:return function t(e,r,n,i){var a=r(e,i.key);if(a<=0){if(i.left){var o=t(e,r,n,i.left);if(o)return o}var o=n(i.key,i.value);if(o)return o}if(i.right)return t(e,r,n,i.right)}(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return function t(e,r,n,i,a){var o,s=n(e,a.key),l=n(r,a.key);if(s<=0){if(a.left&&(o=t(e,r,n,i,a.left)))return o;if(l>0&&(o=i(a.key,a.value)))return o}if(l>0&&a.right)return t(e,r,n,i,a.right)}(e,r,this._compare,t,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(c,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),c.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,[])},c.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)},c.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)},c.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)},c.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)},c.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,[])},c.remove=function(t){var e=this.find(t);return e?e.remove():this},c.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 h=f.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 d(t,e){return te?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new f(this.tree,this._stack.slice())},h.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 a(r._color,r.key,r.value,r.left,r.right,r._count);for(var c=t.length-2;c>=0;--c){var r=t[c];r.left===t[c+1]?e[c]=new a(r._color,r.key,r.value,e[c+1],r.right,r._count):e[c]=new a(r._color,r.key,r.value,r.left,e[c+1],r._count)}if((r=e[e.length-1]).left&&r.right){var f=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var h=e[f-1];e.push(new a(r._color,h.key,h.value,r.left,r.right,r._count)),e[f-1].key=r.key,e[f-1].value=r.value;for(var c=e.length-2;c>=f;--c)r=e[c],e[c]=new a(r._color,r.key,r.value,r.left,e[c+1],r._count);e[f-1].left=e[f]}if((r=e[e.length-1])._color===n){var d=e[e.length-2];d.left===r?d.left=null:d.right===r&&(d.right=null),e.pop();for(var c=0;c=0;--c){if(e=t[c],0===c)return void(e._color=i);if((r=t[c-1]).left===e){if((a=r.right).right&&a.right._color===n){if(a=r.right=o(a),u=a.right=o(a.right),r.right=a.left,a.left=r,a.right=u,a._color=r._color,e._color=i,r._color=i,u._color=i,l(r),l(a),c>1){var f=t[c-2];f.left===r?f.left=a:f.right=a}return void(t[c-1]=a)}if(a.left&&a.left._color===n){if(a=r.right=o(a),u=a.left=o(a.left),r.right=u.left,a.left=u.right,u.left=r,u.right=a,u._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(u),c>1){var f=t[c-2];f.left===r?f.left=u:f.right=u}return void(t[c-1]=u)}if(a._color===i){if(r._color===n)return r._color=i,void(r.right=s(n,a));r.right=s(n,a);continue}if(a=o(a),r.right=a.left,a.left=r,a._color=r._color,r._color=n,l(r),l(a),c>1){var f=t[c-2];f.left===r?f.left=a:f.right=a}t[c-1]=a,t[c]=r,c+11){var f=t[c-2];f.right===r?f.right=a:f.left=a}return void(t[c-1]=a)}if(a.right&&a.right._color===n){if(a=r.left=o(a),u=a.right=o(a.right),r.left=u.right,a.right=u.left,u.right=r,u.left=a,u._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(u),c>1){var f=t[c-2];f.right===r?f.right=u:f.left=u}return void(t[c-1]=u)}if(a._color===i){if(r._color===n)return r._color=i,void(r.left=s(n,a));r.left=s(n,a);continue}if(a=o(a),r.left=a.right,a.right=r,a._color=r._color,r._color=n,l(r),l(a),c>1){var f=t[c-2];f.right===r?f.right=a:f.left=a}t[c-1]=a,t[c]=r,c+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"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}),h.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(h,"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}}),h.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),n=e[e.length-1];r[r.length-1]=new a(n._color,n.key,t,n.left,n.right,n._count);for(var i=e.length-2;i>=0;--i)(n=e[i]).left===e[i+1]?r[i]=new a(n._color,n.key,n.value,r[i+1],n.right,n._count):r[i]=new a(n._color,n.key,n.value,n.left,r[i+1],n._count);return new u(this.tree._compare,r[0])},h.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(h,"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}})},{}],230:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=607/128,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 o(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+i+.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(o(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var a=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,e+.5)*Math.exp(-a)*r},e.exports.log=o},{}],231:[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[c]=-1,d[c]=0):(p[c]=0,d[c]=1)}}var v=[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 m=[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,c=o(r,n,i,a,s),f=c.cubeEdges,h=c.axis,b=n[12],_=n[13],w=n[14],k=n[15],A=s?2:1,T=A*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*k)/e.drawingBufferHeight,M=0;M<3;++M)this.lastCubeProps.cubeEdges[M]=f[M],this.lastCubeProps.axis[M]=h[M];for(var E=p,M=0;M<3;++M)d(p[M],M,this.bounds,f,h);for(var S,e=this.gl,C=v,M=0;M<3;++M)this.backgroundEnable[M]?C[M]=h[M]:C[M]=0;this._background.draw(r,n,i,a,C,this.backgroundColor),this._lines.bind(r,n,i,this);for(var 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 O=0;O<2;++O){var I=(M+1+O)%3,P=(M+1+(1^O))%3;this.gridEnable[I]&&this._lines.drawGrid(I,P,this.bounds,L,this.gridColor[I],this.gridWidth[I]*this.pixelRatio)}for(var O=0;O<2;++O){var I=(M+1+O)%3,P=(M+1+(1^O))%3;this.zeroEnable[P]&&Math.min(a[0][P],a[1][P])<=0&&Math.max(a[0][P],a[1][P])>=0&&this._lines.drawZero(I,P,this.bounds,L,this.zeroLineColor[P],this.zeroLineWidth[P]*this.pixelRatio)}}for(var M=0;M<3;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,E[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,E[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);for(var D=u(m,E[M].primalMinor),z=u(y,E[M].mirrorMinor),R=this.lineTickLength,O=0;O<3;++O){var F=T/r[5*O];D[O]*=R[O]*F,z[O]*=R[O]*F}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,E[M].primalOffset,D,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,E[M].mirrorOffset,z,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}var B,N;function j(t){(N=[0,0,0])[t]=1}function V(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?j(n):a>0&&l<0?j(n):a<0&&l>0?j(n):a<0&&l<0?j(n):o>0&&s>0?j(i):o>0&&s<0?j(i):o<0&&s>0?j(i):o<0&&s<0&&j(i)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);for(var M=0;M<3;++M){for(var U=E[M].primalMinor,H=E[M].mirrorMinor,q=u(x,E[M].primalOffset),O=0;O<3;++O)this.lineTickEnable[M]&&(q[O]+=T*U[O]*Math.max(this.lineTickLength[O],0)/r[5*O]);var G=[0,0,0];if(G[M]=1,this.tickEnable[M]){-3600===this.tickAngle[M]?(this.tickAngle[M]=0,this.tickAlign[M]="auto"):this.tickAlign[M]=-1,B=1,"auto"===(S=[this.tickAlign[M],.5,B])[0]?S[0]=0:S[0]=parseInt(""+S[0]),N=[0,0,0],V(M,U,H);for(var O=0;O<3;++O)q[O]+=T*U[O]*this.tickPad[O]/r[5*O];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],q,this.tickColor[M],G,N,S)}if(this.labelEnable[M]){B=0,N=[0,0,0],this.labels[M].length>4&&(j(M),B=1),"auto"===(S=[this.labelAlign[M],.5,B])[0]?S[0]=0:S[0]=parseInt(""+S[0]);for(var O=0;O<3;++O)q[O]+=T*U[O]*this.labelPad[O]/r[5*O];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()},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":233,"./lib/cube.js":234,"./lib/lines.js":235,"./lib/text.js":237,"./lib/ticks.js":238}],233:[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],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[u]=d;for(var v=-1;v<=1;v+=2)f[c]=v,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=u;u=c,c=g}var m=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,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,m,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":236,"gl-buffer":240,"gl-vao":322}],234:[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){c[2]=a[x][2];for(var b=0;b<2;++b){c[1]=a[b][1];for(var _=0;_<2;++_)c[0]=a[_][0],h(l[y],c,s),y+=1}}for(var w=-1,x=0;x<8;++x){for(var k=l[x][3],A=0;A<3;++A)u[x][A]=l[x][A]/k;p&&(u[x][2]*=-1),k<0&&(w<0?w=x:u[x][2]S&&(w|=1<S&&(w|=1<u[x][1]&&(R=x));for(var F=-1,x=0;x<3;++x){var B=R^1<u[N][0]&&(N=B)}}var j=v;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^N)]=R&N;var V=7^N;V===w||V===z?(V=7^F,j[n.log2(N^V)]=V&N):j[n.log2(F^V)]=V&F;for(var U=g,H=w,T=0;T<3;++T)U[T]=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 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 i(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":300,glslify:404}],237:[function(t,e,r){(function(r){"use strict";e.exports=function(t,e,r,a,s,l){var c=n(t),f=i(t,[{buffer:c,size:3}]),h=o(t);h.attributes.position.location=0;var p=new u(t,h,c,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||{};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}s.__TEXT_CACHE={};var c=u.prototype,f=[0,0];c.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},c.unbind=function(){this.vao.unbind()},c.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var u=l[r];u||(u=l[r]={});var c=u[e];c||(c=u[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=c.positions,p=c.cells,d=0,v=p.length;d=0;--m){var y=h[g[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],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],u[d]=o.length/3|0;for(var v=0;v=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var f=""+u;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 c(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=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 l=n.malloc(t.size,r),f=a(l,t.shape);i.assign(f,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?l:l.subarray(0,t.size),e),n.free(l)}}else if(Array.isArray(t)){var h;h=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?h:h.subarray(0,t.length),e),n.free(h)}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 i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:445,"ndarray-ops":439,"typedarray-pool":532}],241:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=function(t,e){for(var r=0;r=e)return r-1;return r},a=n.create(),o=n.create(),s=function(t,e,r){return tr?r:t},l=function(t,e,r,l){var u=t[0],c=t[1],f=t[2],h=r[0].length,p=r[1].length,d=r[2].length,v=i(r[0],u),g=i(r[1],c),m=i(r[2],f),y=v+1,x=g+1,b=m+1;if(l&&(v=s(v,0,h-1),y=s(y,0,h-1),g=s(g,0,p-1),x=s(x,0,p-1),m=s(m,0,d-1),b=s(b,0,d-1)),v<0||g<0||m<0||y>=h||x>=p||b>=d)return n.create();var _=(u-r[0][v])/(r[0][y]-r[0][v]),w=(c-r[1][g])/(r[1][x]-r[1][g]),k=(f-r[2][m])/(r[2][b]-r[2][m]);(_<0||_>1||isNaN(_))&&(_=0),(w<0||w>1||isNaN(w))&&(w=0),(k<0||k>1||isNaN(k))&&(k=0);var A=m*h*p,T=b*h*p,M=g*h,E=x*h,S=v,C=y,L=e[M+A+S],O=e[M+A+C],I=e[E+A+S],P=e[E+A+C],D=e[M+T+S],z=e[M+T+C],R=e[E+T+S],F=e[E+T+C],B=n.create();return n.lerp(B,L,O,_),n.lerp(a,I,P,_),n.lerp(B,B,a,w),n.lerp(a,D,z,_),n.lerp(o,R,F,_),n.lerp(a,a,o,w),n.lerp(B,B,a,k),B};e.exports=function(t,e){var r;r=t.positions?t.positions:function(t){for(var e=t[0],r=t[1],n=t[2],i=[],a=0;as&&(s=n.length(b)),x&&(y=Math.min(y,2*n.distance(v,_)/(n.length(g)+n.length(b)))),v=_,g=b,m.push(b)}var w=[u,f,p],k=[c,h,d];e&&(e[0]=w,e[1]=k),0===s&&(s=1);var A=1/s;isFinite(y)&&!isNaN(y)||(y=1),o.vectorScale=y;var T=function(t,e,r){var i=n.create();return void 0!==t&&n.set(i,t,e,r),i}(0,1,0),M=t.coneSize||.5;t.absoluteConeSize&&(M=t.absoluteConeSize*A),o.coneScale=M;for(var x=0,E=0;x=1},x.isTransparent=function(){return this.opacity<1},x.pickSlots=1,x.setPickBase=function(t){this.pickId=t},x.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){var d=this.triShader;d.bind(),d.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},x.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||m,n=t.view||m,i=t.projection||m,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,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()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind())},x.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);return{index:Math.floor(r[1]/48),position:n,dataCoordinate:n}},x.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.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,v.vertex,v.fragment,null,v.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=b(t),l=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var u=i(t),f=i(t),h=i(t),p=i(t),d=i(t),g=i(t),m=a(t,[{buffer:u,type:t.FLOAT,size:4},{buffer:g,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:h,type:t.FLOAT,size:4},{buffer:p,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:3},{buffer:f,type:t.FLOAT,size:3}]),x=i(t),_=i(t),w=i(t),k=i(t),A=a(t,[{buffer:x,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),T=i(t),M=i(t),E=i(t),S=i(t),C=i(t),L=a(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:C,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:M,type:t.FLOAT,size:4},{buffer:E,type:t.FLOAT,size:2},{buffer:S,type:t.FLOAT,size:1}]),O=i(t),I=a(t,[{buffer:O,type:t.FLOAT,size:3}]),P=new y(t,l,r,s,u,f,g,h,p,d,m,x,k,_,w,A,T,C,M,E,S,L,O,I);return P.update(e),P}},{"./shaders":243,colormap:119,"gl-buffer":240,"gl-mat4/invert":264,"gl-mat4/multiply":266,"gl-shader":300,"gl-texture2d":317,"gl-vao":322,ndarray:445,normals:448,"simplicial-complex-contour":505,"typedarray-pool":532}],243:[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;\nuniform float vectorScale;\nuniform float coneScale;\n\nuniform float coneOffset;\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\n , 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\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , 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 vec3 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nuniform float vectorScale;\nuniform float coneScale;\nuniform float 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), 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:"normal",type:"vec3"},{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:404}],244:[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",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"}},{}],245:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":244}],246:[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 u=new s(e,r,o,l);return u.update(t),u};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 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,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],u=n[15],c=t._ortho||!1,f=c?2:1,h=f*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var p=0;p<3;++p)e.lineWidth(this.lineWidth[p]*this.pixelRatio),r.capSize=this.capSize[p]*h,this.lineCount[p]&&e.drawArrays(e.LINES,this.lineOffset[p],this.lineCount[p]);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 i=-1;i<=1;i+=2){var a=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();function f(t,e,r,n){for(var i=c[n],a=0;a0){var v=c.slice();v[s]+=p[1][s],i.push(c[0],c[1],c[2],d[0],d[1],d[2],d[3],0,0,0,v[0],v[1],v[2],d[0],d[1],d[2],d[3],0,0,0),u(this.bounds,v),o+=2+f(i,v,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":247,"gl-buffer":240,"gl-vao":322}],247:[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":300,glslify:404}],248:[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 u=t.getExtension("WEBGL_draw_buffers");if(!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 i=new Array(r),a=0;ac||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,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 v=!0;"depth"in n&&(v=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new d(t,e,r,h,f,v,g,u)};var i,a,o,s,l=null;function u(t){var e=t.getParameter(t.FRAMEBUFFER_BINDING),r=t.getParameter(t.RENDERBUFFER_BINDING),n=t.getParameter(t.TEXTURE_BINDING_2D);return[e,r,n]}function 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 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):v&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):v&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v?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(var m=0;mi||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=u(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 v=i.attributes;return this.positionBuffer.bind(),v.position.pointer(),this.weightBuffer.bind(),v.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),v.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]);this.xData=r,this.yData=o;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,f=this.bounds,p=f[0]=r[0],d=f[1]=o[0],v=f[2]=r[r.length-1],g=f[3]=o[o.length-1],m=1/(v-p),y=1/(g-d),x=e[0],b=e[1];this.shape=[x,b];var _=(x-1)*(b-1)*(h.length>>>1);this.numVertices=_;for(var w=a.mallocUint8(4*_),k=a.mallocFloat32(2*_),A=a.mallocUint8(2*_),T=a.mallocUint32(_),M=0,E=0;E 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\nlowp vec4 encode_float_1540259130(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\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, encode_float_1540259130(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":300,glslify:404}],254:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=c(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),u=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}]),h=l(new Array(1024),[256,1,4]),p=0;p<1024;++p)h.data[p]=255;var d=a(e,h);d.wrap=e.REPEAT;var v=new g(e,r,o,s,u,d);return v.update(t),v};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=t("glsl-read-float"),s=t("binary-search-bounds"),l=t("ndarray"),u=t("./lib/shaders"),c=u.createShader,f=u.createPickShader,h=[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 i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function d(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 g(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 m=g.prototype;m.isTransparent=function(){return this.hasAlpha},m.isOpaque=function(){return!this.hasAlpha},m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.drawTransparent=m.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,clipBounds:d(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()}},m.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,pickId:this.pickId,clipBounds:d(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.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=[],u=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],v=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);c+=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(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),x=Array.isArray(v)?v.length>e-1?v[e-1]:v.length>0?v[v.length-1]:[0,0,0,1]:v;var k=u;if(u+=p(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,m[0],m[1],m[2],m[3]);c+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,m[0],m[1],m[2],m[3],b[0],b[1],b[2],_[0],_[1],_[2],k,-x,m[0],m[1],m[2],m[3],_[0],_[1],_[2],b[0],b[1],b[2],u,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],u,x,y[0],y[1],y[2],y[3]),c+=4}}if(this.buffer.update(i),a.push(u),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in t){var A=t.dashes,T=A.slice();for(T.unshift(0),e=1;e1.0001)return null;g+=v[c]}return Math.abs(g-1)>.001?null:[f,function(t,e){for(var r=[0,0,0],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 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}"]),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: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:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:404}],279:[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"),u=t("gl-mat4/invert"),c=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./lib/shaders"),v=t("./lib/closest-point"),g=d.meshShader,m=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 k(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,m,y,x,b,_,k,A,T,M,E){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=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=m,this.edgeIds=v,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=k,this.pointSizes=A,this.pointIds=b,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var A=k.prototype;function T(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,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,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function S(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 C(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}A.isOpaque=function(){return!this.hasAlpha},A.isTransparent=function(){return this.hasAlpha},A.pickSlots=1,A.setPickBase=function(t){this.pickId=t},A.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){var d=this.triShader;d.bind(),d.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var d=this.lineShader;d.bind(),d.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var d=this.pointShader;d.bind(),d.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var d=this.contourShader;d.bind(),d.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},A.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={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},A.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[A]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t],r.uniforms.angle=m[t],a.drawArrays(a.TRIANGLES,i[A],i[T]-i[A]))),y[t]&&k&&(c[1^t]-=M*p*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,k)),c[1^t]=M*s[2+(1^t)]-1,d[t+2]&&(c[1^t]+=M*p*v[t+2],Ai[A]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t+2],r.uniforms.angle=m[t+2],a.drawArrays(a.TRIANGLES,i[A],i[T]-i[A]))),y[t+2]&&k&&(c[1^t]+=M*p*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,k))}),v.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),v.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],u=l-s,c=.5*(n[o+2]+n[o]),f=n[o+2]-n[o],v=a[o],g=a[o+2],m=g-v,y=i[o],x=i[o+2],b=x-y;p[o]=2*u/f*m/b,h[o]=2*(s-c)/f*m/b}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()}),v.update=function(t){var e,r,n,i,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 v=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(v,e[1],v,e[3],p[d],h[d]):o.drawLine(e[0],v,e[2],v,p[d],h[d])}}for(var d=0;d=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},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;rMath.abs(e))u.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-u.lastT())/20;u.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":50,"has-passive-events":406,"mouse-change":430,"mouse-event-offset":431,"mouse-wheel":433,"right-now":491}],288:[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":300,glslify:404}],289:[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"),u=t("a-big-triangle"),c=t("mouse-change"),f=t("mouse-wheel"),h=t("gl-mat4/perspective"),p=t("gl-mat4/ortho"),d=t("./lib/shader"),v=t("is-mobile")({tablet:!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){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function y(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){var r=t.container;r.appendChild(e)}else document.body.appendChild(e);var x=t.gl;if(x||(x=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:v})),!x)throw new Error("webgl not supported");var b=t.bounds||[[-10,-10,-10],[10,10,10]],_=new g,w=l(x,[x.drawingBufferWidth,x.drawingBufferHeight],{preferFloat:!v}),k=d(x),A=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:A},M=t.axes||{},E=i(x,M);E.enable=!M.disable;var S=t.spikes||{},C=o(x,S),L=[],O=[],I=[],P=[],D=!0,z=!0,R=new Array(16),F=new Array(16),B={view:null,projection:R,model:F,_ortho:!1},z=!0,N=[x.drawingBufferWidth,x.drawingBufferHeight],j=t.cameraObject||n(e,T),V={gl:x,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:_,camera:j,axes:E,axesPixels:null,spikes:C,bounds:b,objects:L,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:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:B,oncontextloss:null,mouseListener:null,_stopped:!1},U=[x.drawingBufferWidth/V.pixelRatio|0,x.drawingBufferHeight/V.pixelRatio|0];function H(){if(!V._stopped&&V.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*V.pixelRatio),a=0|Math.ceil(n*V.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",D=!0}}}function q(){for(var t=L.length,e=P.length,r=0;r0&&0===I[e-1];)I.pop(),P.pop().dispose()}function G(){if(V.contextLost)return!0;x.isContextLost()&&(V.contextLost=!0,V.mouseListener.enabled=!1,V.selection.object=null,V.oncontextloss&&V.oncontextloss())}V.autoResize&&H(),window.addEventListener("resize",H),V.update=function(t){V._stopped||(t=t||{},D=!0,z=!0)},V.add=function(t){V._stopped||(t.axes=E,L.push(t),O.push(-1),D=!0,z=!0,q())},V.remove=function(t){if(!V._stopped){var e=L.indexOf(t);e<0||(L.splice(e,1),O.pop(),D=!0,z=!0,q())}},V.dispose=function(){if(!V._stopped&&(V._stopped=!0,window.removeEventListener("resize",H),e.removeEventListener("webglcontextlost",G),V.mouseListener.enabled=!1,!V.contextLost)){E.dispose(),C.dispose();for(var t=0;te?1.1:1/1.1;V.aspect[0]*=r,V.aspect[1]*=r,V.aspect[2]*=r,V.redraw()}},!0),V._mouseRotating=!1,V._prevButtons=0,V.enableMouseListeners=function(){V.mouseListener=c(e,function(t,e,r){if(!V._stopped){var n=P.length,i=L.length,a=_.object;_.distance=1/0,_.mouse[0]=e,_.mouse[1]=r,_.object=null,_.screen=null,_.dataCoordinate=_.dataPosition=null;var o=!1;if(t&&V._prevButtons)V._mouseRotating=!0;else{V._mouseRotating&&(z=!0),V._mouseRotating=!1;for(var s=0;s_.distance)continue;for(var u=0;u 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:404}],291:[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),u=n(r,o.pointVertex,o.pointFragment),c=n(r,o.pickVertex,o.pickFragment),f=new s(t,a,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,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),u=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),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/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=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,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":290,"gl-buffer":240,"gl-shader":300,"typedarray-pool":532}],292:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],f=e[2],h=e[3],p=r[0],d=r[1],v=r[2],g=r[3];return(a=u*p+c*d+f*v+h*g)<0&&(a=-a,p=-p,d=-d,v=-v,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*p,t[1]=s*c+l*d,t[2]=s*f+l*v,t[3]=s*h+l*g,t}},{}],293:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],294:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var a=i[e];if(a||(a=i[e]={}),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,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=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 vec4 pickId;\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=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}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:c},h={vertex:o,fragment:l,attributes:c},p={vertex:s,fragment:l,attributes:c},d={vertex:a,fragment:u,attributes:c},v={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};function m(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 m(t,f)},r.createOrtho=function(t){return m(t,h)},r.createProject=function(t){return m(t,p)},r.createPickPerspective=function(t){return m(t,d)},r.createPickOrtho=function(t){return m(t,v)},r.createPickProject=function(t){return m(t,g)}},{"gl-shader":300,glslify:404}],296:[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"),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],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 v(t){return!0===t?1:t>1?1:t}function g(t,e,r,n,i,a,o,s,l,u,c,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=u,this.pickOrthoShader=c,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),u=l.createPickOrtho(e),c=l.createPickProject(e),f=i(e),h=i(e),p=i(e),d=i(e),v=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}]),m=new g(e,r,n,o,f,h,p,d,v,s,u,c);return m.update(t),m};var m=g.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],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],k=f.slice(),A=[0,0,0],T=[[0,0,0],[0,0,0]];function M(t){return t[0]=t[1]=t[2]=0,t}function E(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 C(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,u=r.model||f,c=r.view||f,h=r.projection||f,d=e.axesBounds,v=function(t){for(var e=T,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=c,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=v,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 m=k,C=0;C<16;++C)m[C]=0;for(var C=0;C<4;++C)m[5*C]=1;m[5*g]=0,i[g]<0?m[12+g]=d[0][g]:m[12+g]=d[1][g],s(m,u,m),l.model=m;var L=(g+1)%3,O=(g+2)%3,I=M(x),P=M(b);I[L]=1,P[O]=1;var D=p(0,0,0,E(_,I)),z=p(0,0,0,E(w,P));if(Math.abs(D[1])>Math.abs(z[1])){var R=D;D=z,z=R,R=I,I=P,P=R;var F=L;L=O,O=F}D[0]<0&&(I[L]=-1),z[1]>0&&(P[O]=-1);for(var B=0,N=0,C=0;C<4;++C)B+=Math.pow(u[4*L+C],2),N+=Math.pow(u[4*O+C],2);I[L]/=Math.sqrt(B),P[O]/=Math.sqrt(N),l.axes[0]=I,l.axes[1]=P,l.fragClipBounds[0]=S(A,v[0],g,-1e8),l.fragClipBounds[1]=S(A,v[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 L=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&C(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=L,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},m.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]},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{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=v(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||"normal",u=t.alignment||[0,0];if(2===u.length)i=u[0],a=u[1];else{i=[],a=[];for(var n=0;n0){var D=0,z=x,R=[0,0,0,1],F=[0,0,0,1],B=Array.isArray(p)&&Array.isArray(p[0]),N=Array.isArray(m)&&Array.isArray(m[0]);t:for(var n=0;n<_;++n){y+=1;for(var w=s[n],k=0;k<3;++k){if(isNaN(w[k])||!isFinite(w[k]))continue t;f[k]=Math.max(f[k],w[k]),c[k]=Math.min(c[k],w[k])}var A=I(h,n,l,this.pixelRatio),T=A.mesh,M=A.lines,E=A.bounds,j=A.visible;if(j)if(Array.isArray(p)){if(3===(V=B?n0?1-E[0][0]:W<0?1+E[1][0]:1,Y*=Y>0?1-E[0][1]:Y<0?1+E[1][1]:1;for(var X=[W,Y],Z=T.cells||[],$=T.positions||[],k=0;k0){var m=r*c;o.drawBox(f-m,h-m,p+m,h+m,a),o.drawBox(f-m,d-m,p+m,d+m,a),o.drawBox(f-m,h-m,f+m,d+m,a),o.drawBox(p-m,h-m,p+m,d+m,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":297,"gl-buffer":240,"gl-shader":300}],299:[function(t,e,r){"use strict";e.exports=function(t,e){var r=n(t,e),a=i.mallocUint8(e[0]*e[1]*4);return new u(t,r,a)};var n=t("gl-fbo"),i=t("typedarray-pool"),a=t("ndarray"),o=t("bit-twiddle").nextPow2,s=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_16_arg0_<255||_inline_16_arg1_<255||_inline_16_arg2_<255||_inline_16_arg3_<255){var _inline_16_l=_inline_16_arg4_-_inline_16_arg6_[0],_inline_16_a=_inline_16_arg5_-_inline_16_arg6_[1],_inline_16_f=_inline_16_l*_inline_16_l+_inline_16_a*_inline_16_a;_inline_16_fthis.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 k=0|w.type.charAt(w.type.length-1),A=new Array(k),T=0;T=0;)M+=1;_[y]=M}var E=new Array(r.length);function S(){h.program=o.program(p,h._vref,h._fref,b,_);for(var t=0;t=0){var d=h.charCodeAt(h.length-1)-48;if(d<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=h.charCodeAt(h.length-1)-48;if(d<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"],u=[],c=0;c4)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)}var a=r.charCodeAt(r.length-1)-48;if(a<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 u(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=t.charCodeAt(t.length-1)-48;if(r<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[c].type);var p}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)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;\nuniform float vectorScale;\nuniform float tubeScale;\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\n , 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\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , 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:"normal",type:"vec3"},{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:404}],311:[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"),u=t("gl-mat4/invert"),c=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./shaders"),v=d.meshShader,g=d.pickShader,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function y(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,y,x,b,_,w,k,A){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=i,this.triangleVectors=a,this.triangleColors=s,this.triangleNormals=u,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=0,this.lineWidth=1,this.edgePositions=f,this.edgeColors=p,this.edgeUVs=d,this.edgeIds=h,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=g,this.pointColors=x,this.pointUVs=b,this.pointSizes=_,this.pointIds=y,this.pointVAO=w,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=A,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!1,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.tubeScale=1,this._model=m,this._view=m,this._projection=m,this._resolution=[1,1],this.pixelRatio=1}var x=y.prototype;function b(t){var e=n(t,g.vertex,g.fragment,null,g.attributes);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.vector.location=5,e}x.isOpaque=function(){return this.opacity>=1},x.isTransparent=function(){return this.opacity<1},x.pickSlots=1,x.setPickBase=function(t){this.pickId=t},x.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){var d=this.triShader;d.bind(),d.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},x.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||m,n=t.view||m,i=t.projection||m,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,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()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind())},x.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=this.intensity[r[1]],a=this.vectors[r[1]].slice(0,3),o=this.vectors[r[1]][3];return{index:e,position:n,intensity:i,velocity:a,divergence:o,dataCoordinate:n}},x.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.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,v.vertex,v.fragment,null,v.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=b(t),l=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var u=i(t),f=i(t),h=i(t),p=i(t),d=i(t),g=i(t),m=a(t,[{buffer:u,type:t.FLOAT,size:4},{buffer:g,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:h,type:t.FLOAT,size:4},{buffer:p,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:3},{buffer:f,type:t.FLOAT,size:4}]),x=i(t),_=i(t),w=i(t),k=i(t),A=a(t,[{buffer:x,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),T=i(t),M=i(t),E=i(t),S=i(t),C=i(t),L=a(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:C,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:M,type:t.FLOAT,size:4},{buffer:E,type:t.FLOAT,size:2},{buffer:S,type:t.FLOAT,size:1}]),O=i(t),I=a(t,[{buffer:O,type:t.FLOAT,size:3}]),P=new y(t,l,r,s,u,f,g,h,p,d,m,x,k,_,w,A,T,C,M,E,S,L,O,I);return P.update(e),P}},{"./shaders":310,colormap:119,"gl-buffer":240,"gl-mat4/invert":264,"gl-mat4/multiply":266,"gl-shader":300,"gl-texture2d":317,"gl-vao":322,ndarray:445,normals:448,"simplicial-complex-contour":505,"typedarray-pool":532}],312:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=t("gl-vec4"),a=function(t,e,r,a){for(var o=0,s=0;so&&(o=c)}for(var f=t.map(function(t){return function(t,e,r,a){var o,s,l,u=t.points,c=t.velocities,f=t.divergences;n.set(n.create(),0,1,0),n.create(),n.create(),n.create();for(var h=[],p=[],d=[],v=[],g=[],m=[],y=0,x=0,b=i.create(),_=i.create(),w=0;w0)for(var k=0;k<8;k++){var A=(k+1)%8;h.push(v[k],g[k],g[A],g[A],v[A],v[k]),d.push(_,b,b,b,_,_),m.push(y,x,x,x,y,y),p.push([h.length-6,h.length-5,h.length-4],[h.length-3,h.length-2,h.length-1])}var T=v;v=g,g=T,T=_,_=b,b=T,T=y,y=x,x=T}return{positions:h,cells:p,vectors:d,vertexIntensity:m}}(t,r,a,o)}),h=[],p=[],d=[],v=[],s=0;se)return r-1}return r},u=n.create(),c=n.create(),f=function(t,e,r){return tr?r:t},h=function(t,e,r,i){var a=t[0],o=t[1],s=t[2],h=r[0].length,p=r[1].length,d=r[2].length,v=l(r[0],a),g=l(r[1],o),m=l(r[2],s),y=v+1,x=g+1,b=m+1;if(r[0][v]===a&&(y=v),r[1][g]===o&&(x=g),r[2][m]===s&&(b=m),i&&(v=f(v,0,h-1),y=f(y,0,h-1),g=f(g,0,p-1),x=f(x,0,p-1),m=f(m,0,d-1),b=f(b,0,d-1)),v<0||g<0||m<0||y>=h||x>=p||b>=d)return n.create();var _=(a-r[0][v])/(r[0][y]-r[0][v]),w=(o-r[1][g])/(r[1][x]-r[1][g]),k=(s-r[2][m])/(r[2][b]-r[2][m]);(_<0||_>1||isNaN(_))&&(_=0),(w<0||w>1||isNaN(w))&&(w=0),(k<0||k>1||isNaN(k))&&(k=0);var A=m*h*p,T=b*h*p,M=g*h,E=x*h,S=v,C=y,L=e[M+A+S],O=e[M+A+C],I=e[E+A+S],P=e[E+A+C],D=e[M+T+S],z=e[M+T+C],R=e[E+T+S],F=e[E+T+C],B=n.create();return n.lerp(B,L,O,_),n.lerp(u,I,P,_),n.lerp(B,B,u,w),n.lerp(u,D,z,_),n.lerp(c,R,F,_),n.lerp(u,u,c,w),n.lerp(B,B,u,k),B},p=function(t){var e=1/0;t.sort(function(t,e){return t-e});for(var r=1;r=f&&r<=v&&n>=h&&n<=g&&i>=d&&i<=m},x=n.distance(e[0],e[1]),b=10*x/i,_=b*b,w=1,k=0;n.create(),r.length>=2&&(w=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=0;sk&&!isNaN(I)&&isFinite(I)&&(k=I),L.push(I),c.push({points:M,velocities:E,divergences:L});for(var P=0;P<100*i&&M.length_&&n.scale(D,D,b/Math.sqrt(z)),n.add(D,D,T),S=t.getVelocity(D),n.squaredDistance(C,D)-_>-1e-4*_){M.push(D),C=D,E.push(S);var O=t.getDivergence(D,S),I=n.length(O);I>k&&!isNaN(I)&&isFinite(I)&&(k=I),L.push(I)}T=D}}for(var A=0;A 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 ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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"]),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":300,glslify:404}],314:[function(t,e,r){arguments[4][104][0].apply(r,arguments)},{dup:104}],315:[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),u=i(e),c=a(e,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,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}]),v=o(e,1,E,e.RGBA,e.UNSIGNED_BYTE);v.minFilter=e.LINEAR,v.magFilter=e.LINEAR;var g=new S(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,v,s,l,f,h,p,d,[0,0,0]),m={levels:[[],[],[]]};for(var k in t)m[k]=t[k];return m.colormap=m.colormap||"jet",g.update(m),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"),u=t("ndarray-ops"),c=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),p=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),v=t("binary-search-bounds"),g=t("ndarray-gradient"),m=t("./lib/shaders"),y=m.createShader,x=m.createContourShader,b=m.createPickShader,_=m.createPickContourShader,w=40,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=[[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 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=T[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var E=256;function S(t,e,r,n,i,a,o,l,u,c,h,p,d,v,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=u,this._contourPickShader=c,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=v,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 C=S.prototype;C.isTransparent=function(){return this.opacity<1},C.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},C.pickSlots=1,C.setPickBase=function(t){this.pickId=t};var L=[0,0,0],O={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function I(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||L,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=O.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 u=O.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return O.showSurface=o,O.showContour=s,O}var P={model:k,view:k,projection:k,inverseModel:k.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},D=k.slice(),z=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=P;n.model=t.model||k,n.view=t.view||k,n.projection=t.projection||k,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=D;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 u=s[12+i];for(o=0;o<3;++o)u+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=u/l}var c=I(n,this);if(c.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour&&!e){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=T[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 u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?a:1-a,h=0;h<2;++h)for(var p=h?l:1-l,d=i+c,g=s+h,m=f*p,y=0;y<3;++y)u[y]+=this._field[y].get(d,g)*m;for(var x=this._pickResult.level,b=0;b<3;++b)if(x[b]=v.le(this.contourLevels[b],u[b]),x[b]<0)this.contourLevels[b].length>0&&(x[b]=0);else if(x[b]Math.abs(w-u[b])&&(x[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},C.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))},C.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=B(t.contourWidth,Number)),"showContour"in t&&(this.showContour=B(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=B(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=j(t.contourColor)),"contourProject"in t&&(this.contourProject=B(t.contourProject,function(t){return B(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=j(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=B(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=B(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var 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 p=t.coords;if(!Array.isArray(p)||3!==p.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var d=p[o];for(b=0;b<2;++b)if(d.shape[b]!==a[b])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],d)}}else if(t.ticks){var v=t.ticks;if(!Array.isArray(v)||2!==v.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var m=v[o];if((Array.isArray(m)||m.length)&&(m=f(m)),m.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var y=f(m.data,a);y.stride[o]=m.stride[0],y.stride[1^o]=0,this.padField(this._field[o],y)}}else{for(o=0;o<2;++o){var x=[0,0];x[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],x,0)}this._field[0].set(0,0,0);for(var b=0;b0){for(var kt=0;kt<5;++kt)rt.pop();G-=1}continue t}rt.push(st[0],st[1],ct[0],ct[1],st[2]),G+=1}}ot.push(G)}this._contourOffsets[nt]=at,this._contourCounts[nt]=ot}var At=s.mallocFloat(rt.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:{}}},A.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),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,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(A.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var i=n.stringify({size:A.baseFontSize,family:t.family,stretch:w?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]=A.fonts[i],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),w&&t.weight!=t.stretch&&c.push(t.stretch),e.font[r]={baseString:i,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[i]=e.font[r]}}),(a||o)&&this.font.forEach(function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:w?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 _=!t.position[0].length,k=c.mallocFloat(2*this.count),T=0,M=0;T1?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],A.normalViewport||(i*=-1),i})),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var G;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var W=t.color.length;G=c.mallocUint8(W);for(var Y=(t.color.subarray||t.color.slice).bind(t.color),X=0;X4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(J){var K=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(K);for(var Q=0;Q1?e.counts[Q]:e.counts[0],offset:e.textOffsets.length>1?e.textOffsets[Q]:e.textOffsets[0],color:e.color?e.color.length<=4?e.color:e.color.subarray(4*Q,4*Q+4):[0,0,0,255],opacity:Array.isArray(e.opacity)?e.opacity[Q]:e.opacity,baseline:null!=e.baselineOffset[Q]?e.baselineOffset[Q]:e.baselineOffset[0],align:e.align?null!=e.alignOffset[Q]?e.alignOffset[Q]:e.alignOffset[0]:0,atlas:e.fontAtlas[Q]||e.fontAtlas[0],positionOffset:e.positionOffset.length>2?e.positionOffset.subarray(2*Q,2*Q+2):e.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":85,"color-normalize":113,"css-font":132,"detect-kerning":160,"es6-weak-map":219,"flatten-vertex-data":226,"font-atlas":227,"font-measure":228,"gl-util/context":318,"is-plain-obj":417,"object-assign":449,"parse-rect":454,"parse-unit":456,"pick-by-alias":460,regl:489,"to-px":526,"typedarray-pool":532}],317:[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");if(o||function(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]}(t),"number"==typeof arguments[1])return g(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return g(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 function(t,e,r,n,i,a){var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new h(t,o,r,n,i,a)}(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 function(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=d(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 f,p,g=0;if(2===o.length)g=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])g=t.ALPHA;else if(2===o[2])g=t.LUMINANCE_ALPHA;else if(3===o[2])g=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)f=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];p=a.malloc(m,r);var x=n(p,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?i.assign(x,e):c(x,e),f=p.subarray(0,m)}var b=v(t);return t.texImage2D(t.TEXTURE_2D,0,g,o[0],o[1],0,g,u,f),l||a.free(p),new h(t,b,o[0],o[1],g,u)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;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 c=function(t,e){i.muls(t,e,255)};function f(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 h(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 p=h.prototype;function d(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 g(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=v(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new h(t,o,e,r,n,i)}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 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}}}),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=u(t)?t:t.raw;if(l){var f=this._mipLevels.indexOf(o)<0;f?(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,f){var h=f.dtype,p=f.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var v=0,g=0,m=d(p,f.stride.slice());if("float32"===h?v=t.FLOAT:"float64"===h?(v=t.FLOAT,m=!1,h="float32"):"uint8"===h?v=t.UNSIGNED_BYTE:(v=t.UNSIGNED_BYTE,m=!1,h="uint8"),2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],f=n(f.data,p,[f.stride[0],f.stride[1],1],f.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]}if(g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=f.size,x=u.indexOf(o)<0;if(x&&u.push(o),v===l&&m)0===f.offset&&f.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,f.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,f.data.subarray(f.offset,f.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]);v===t.FLOAT&&l===t.UNSIGNED_BYTE?c(_,f):i.assign(_,f),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:445,"ndarray-ops":439,"typedarray-pool":532}],318:[function(t,e,r){"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*window.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*window.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}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},(t=a(t)?{container: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"},!0)).pixelRatio||(t.pixelRatio=window.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var r=document.querySelector(t.container);if(!r)throw Error("Element "+t.container+" is not found");t.container=r}a(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=document.createElement("canvas"),t.container.appendChild(t.canvas),i(t))}else t.canvas||(t.container=document.body||document.documentElement,t.canvas=document.createElement("canvas"),t.canvas.style.position="absolute",t.canvas.style.top=0,t.canvas.style.left=0,t.container.appendChild(t.canvas),i(t));if(!t.gl)try{t.gl=t.canvas.getContext("webgl",t.attrs)}catch(e){try{t.gl=t.canvas.getContext("experimental-webgl",t.attrs)}catch(e){t.gl=t.canvas.getContext("webgl-experimental",t.attrs)}}return t.gl}},{"pick-by-alias":460}],319:[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":334,"./fromValues":340,"./normalize":351}],325:[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}},{}],326:[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}},{}],327:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],328:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],329:[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}},{}],330:[function(t,e,r){e.exports=t("./distance")},{"./distance":331}],331:[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)}},{}],332:[function(t,e,r){e.exports=t("./divide")},{"./divide":333}],333:[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}},{}],334:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],335:[function(t,e,r){e.exports=1e-6},{}],336:[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":335}],337:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],338:[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}},{}],339:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},{}],352:[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}},{}],353:[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),u=Math.cos(n);return t[0]=e[0],t[1]=i+o*u-s*l,t[2]=a+o*l+s*u,t}},{}],354:[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),u=Math.cos(n);return t[0]=i+s*l+o*u,t[1]=e[1],t[2]=a+s*u-o*l,t}},{}],355:[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),u=Math.cos(n);return t[0]=i+o*u-s*l,t[1]=a+o*l+s*u,t[2]=e[2],t}},{}],356:[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}},{}],357:[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}},{}],358:[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}},{}],359:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],360:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":362}],361:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":363}],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 r*r+n*n+i*i}},{}],363:[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}},{}],364:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":365}],365:[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}},{}],366:[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}},{}],367:[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}},{}],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],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=c*u+p*-o+f*-l-h*-s,t[1]=f*u+p*-s+h*-o-c*-l,t[2]=h*u+p*-l+c*-s-f*-o,t}},{}],369:[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}},{}],370:[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}},{}],371:[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}},{}],372:[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}},{}],373:[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)}},{}],374:[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}},{}],375:[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]}},{}],376:[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}},{}],377:[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":369,"./clone":370,"./copy":371,"./create":372,"./distance":373,"./divide":374,"./dot":375,"./fromValues":376,"./inverse":378,"./length":379,"./lerp":380,"./max":381,"./min":382,"./multiply":383,"./negate":384,"./normalize":385,"./random":386,"./scale":387,"./scaleAndAdd":388,"./set":389,"./squaredDistance":390,"./squaredLength":391,"./subtract":392,"./transformMat4":393,"./transformQuat":394}],378:[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}},{}],379:[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)}},{}],380:[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}},{}],381:[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}},{}],382:[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}},{}],383:[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}},{}],384:[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}},{}],385:[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;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}},{}],386:[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":385,"./scale":387}],387:[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}},{}],388:[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}},{}],389:[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}},{}],390:[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}},{}],391:[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}},{}],392:[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}},{}],393:[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}},{}],394:[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],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=c*u+p*-o+f*-l-h*-s,t[1]=f*u+p*-s+h*-o-c*-l,t[2]=h*u+p*-l+c*-s-f*-o,t[3]=e[3],t}},{}],395:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],396:[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 F(r),O+=r.length,(E=E.slice(r.length)).length}}function q(){return/[^a-fA-F0-9]/.test(e)?(F(E.join("")),M=l,A):(E.push(e),r=e,A+1)}function G(){return"."===e?(E.push(e),M=v,r=e,A+1):/[eE]/.test(e)?(E.push(e),M=v,r=e,A+1):"x"===e&&1===E.length&&"0"===E[0]?(M=_,E.push(e),r=e,A+1):/[^\d]/.test(e)?(F(E.join("")),M=l,A):(E.push(e),r=e,A+1)}function W(){return"f"===e&&(E.push(e),r=e,A+=1),/[eE]/.test(e)?(E.push(e),r=e,A+1):"-"===e&&/[eE]/.test(r)?(E.push(e),r=e,A+1):/[^\d]/.test(e)?(F(E.join("")),M=l,A):(E.push(e),r=e,A+1)}function Y(){if(/[^\d\w_]/.test(e)){var t=E.join("");return M=R.indexOf(t)>-1?y:z.indexOf(t)>-1?m:g,F(E.join("")),M=l,A}return E.push(e),r=e,A+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=999,u=9999,c=0,f=1,h=2,p=3,d=4,v=5,g=6,m=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":399,"./lib/builtins-300es":398,"./lib/literals":401,"./lib/literals-300es":400,"./lib/operators":402}],398:[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":399}],399:[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"]},{}],400:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":401}],401:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],402:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],403:[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":397}],404:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,v=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,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,u-=8);t[r+p-d]|=128*v}},{}],408:[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),c=0;c<=i;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);for(var f=new a(l,new Array(i+1),!1),h=f.adjacent,p=new Array(i+2),c=0;c<=i;++c){for(var d=l.slice(),v=0;v<=i;++v)v===c&&(d[v]=-1);var g=d[0];d[0]=d[1],d[1]=g;var m=new a(d,new Array(i+1),!0);h[c]=m,p[c]=m}p[i+1]=f;for(var c=0;c<=i;++c)for(var d=h[c].vertices,y=h[c].adjacent,v=0;v<=i;++v){var x=d[v];if(x<0)y[v]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[v]=h[b])}for(var _=new u(i,o,p),w=!!e,c=i+1;c0&&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 c=u.prototype;c.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 u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var h=c[f];i[f]=h<0?e:a[h]}var p=this.orient();if(p>0)return u;u.lastVisited=-n,0===p&&o.push(u)}}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=a[c];a[c]=t;var p=this.orient();if(a[c]=h,p<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,i=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 e=f.pop(),p=e.vertices,d=e.adjacent,v=p.indexOf(r);if(!(v<0))for(var g=0;g<=n;++g)if(g!==v){var m=d[g];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=i[y[b]];var _=this.orient();if(_>0){y[x]=r,m.boundary=!1,u.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var w=m.adjacent,k=p.slice(),A=d.slice(),T=new a(k,A,!0);c.push(T);var M=w.indexOf(e);if(!(M<0)){w[M]=T,A[v]=m,k[g]=-1,A[g]=e,d[g]=T,T.flip();for(var b=0;b<=n;++b){var E=k[b];if(!(E<0||E===r)){for(var S=new Array(n-1),C=0,L=0;L<=n;++L){var O=k[L];O<0||L===b||(S[C++]=O)}h.push(new o(S,T,b))}}}}}}h.sort(s);for(var g=0;g+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":497,"simplicial-complex":507}],409:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=0,a=1;function o(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){return t&&0!==t.length?new x(y(t)):new x(null)};var s=o.prototype;function l(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 u(t,e){var r=y(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 c(t,e){var r=t.intervals([]);r.push(e),u(t,r)}function f(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?i:(r.splice(n,1),u(t,r),a)}function h(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function d(t,e){for(var r=0;r>1],i=[],a=[],s=[],r=0;r3*(e+1)?c(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?c(this,t):this.right.insert(t):this.right=y([t]);else{var r=n.ge(this.leftPoints,t,g),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},s.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return f(this,t);var o=this.left.remove(t);return 2===o?(this.left=null,this.count-=1,a):(o===a&&(this.count-=1),o)}if(t[0]>this.mid){if(!this.right)return i;var s=this.left?this.left.count:0;if(4*s>3*(e-1))return f(this,t);var o=this.right.remove(t);return 2===o?(this.right=null,this.count-=1,a):(o===a&&(this.count-=1),o)}if(1===this.count)return this.leftPoints[0]===t?2:i;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var u=this,c=this.left;c.right;)u=c,c=c.right;if(u===this)c.right=this.right;else{var h=this.left,o=this.right;u.count-=c.count,u.right=c.left,c.left=h,c.right=o}l(this,c),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?l(this,this.left):l(this,this.right);return a}for(var h=n.ge(this.leftPoints,t,g);hthis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return p(this.rightPoints,t,e)}return d(this.leftPoints,e)},s.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return ethis.mid?p(this.rightPoints,t,r):d(this.leftPoints,r)};var b=x.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new o(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==i}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":84}],410:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var 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)}},{}],420:[function(t,e,r){"use strict";e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],421:[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;return e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"==typeof e&&(t.tablet?a.test(e):n.test(e))}},{}],422:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],423:[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({}))}},{}],424:[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}},{}],425:[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))}},{}],426:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],427:[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){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r0;)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 g(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 v(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 y(t,e,r){var n={};for(var a in t)n[a]=e.call(r||this,t[a],a,t);return n}function x(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 b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?y(t,b):t}var _={};function w(t){_[t]||("undefined"!=typeof console&&console.warn(t),_[t]=!0)}function k(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}function M(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var E,S,C,L,O=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),P=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,I=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,D={now:O,frame:function(t){var e=P(t);return{cancel:function(){return I(e)}}},getImageData:function(t){var e=self.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},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==S&&(S=self.matchMedia("(prefers-reduced-motion: reduce)")),S.matches)}},z={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},R={supported:!1,testSupport:function(t){!F&&L&&(B?N(t):C=t)}},F=!1,B=!1;function N(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,L),t.isContextLost())return;R.supported=!0}catch(t){}t.deleteTexture(e),F=!0}self.document&&((L=self.document.createElement("img")).onload=function(){C&&N(C),C=null,B=!0},L.onerror=function(){F=!0,C=null},L.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var j="01",V=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function U(t){return 0===t.indexOf("mapbox:")}V.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",j,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},V.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},V.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},V.prototype.normalizeStyleURL=function(t,e){if(!U(t))return t;var r=W(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},V.prototype.normalizeGlyphsURL=function(t,e){if(!U(t))return t;var r=W(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},V.prototype.normalizeSourceURL=function(t,e){if(!U(t))return t;var r=W(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},V.prototype.normalizeSpriteURL=function(t,e,r,n){var a=W(t);return U(t)?(a.path="/styles/v1"+a.path+"/sprite"+e+r,this._makeAPIURL(a,this._customAccessToken||n)):(a.path+=""+e+r,Y(a))},V.prototype.normalizeTileURL=function(t,e,r){if(this._isSkuTokenExpired()&&this._createSkuToken(),!e||!U(e))return t;var n=W(t),a=D.devicePixelRatio>=2||512===r?"@2x":"",i=R.supported?".webp":"$1";return n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+a+i),n.path=n.path.replace(/^.+\/v4\//,"/"),n.path="/v4"+n.path,z.REQUIRE_ACCESS_TOKEN&&(z.ACCESS_TOKEN||this._customAccessToken)&&this._skuToken&&n.params.push("sku="+this._skuToken),this._makeAPIURL(n,this._customAccessToken)},V.prototype.canonicalizeTileURL=function(t){var e=W(t);if(!e.path.match(/(^\/v4\/)/)||!e.path.match(/\.[\w]+$/))return t;var r="mapbox://tiles/";r+=e.path.replace("/v4/","");var n=e.params.filter((function(t){return!t.match(/^access_token=/)}));return n.length&&(r+="?"+n.join("&")),r},V.prototype.canonicalizeTileset=function(t,e){if(!U(e))return t.tiles||[];for(var r=[],n=0,a=t.tiles;n=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},Z.prototype.processRequests=function(t){},Z.prototype.postEvent=function(t,e,r,n){var a=this;if(z.EVENTS_URL){var i=W(z.EVENTS_URL);i.params.push("access_token="+(n||z.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.3.2",skuId:j,userId:this.anonId},s=e?f(o,e):o,l={url:Y(i),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=mt(l,(function(t){a.pendingRequest=null,r(t),a.saveEventData(),a.processRequests(n)}))}},Z.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var J,K=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,(z.EVENTS_URL&&n||z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return U(t)||q(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(),g(this.anonId)||(this.anonId=d()),this.postEvent(a,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(Z),$=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){z.EVENTS_URL&&z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return U(t)||q(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=X(z.ACCESS_TOKEN),n=r?r.u:z.ACCESS_TOKEN,a=n!==this.eventData.tokenU;g(this.anonId)||(this.anonId=d(),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}(Z)),Q=$.postTurnstileEvent.bind($),tt=new K,et=tt.postMapLoadEvent.bind(tt),rt="mapbox-tiles",nt=500,at=50,it=42e4;function ot(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var st=1/0,lt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(lt);var ct=function(t){function e(e,r,n){401===r&&q(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);function ut(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}var ft=ut()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function pt(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:ft(),signal:n.signal}),i=!1,o=!1,s=(r=a.url).indexOf("sku=")>0&&q(r);"json"===t.type&&a.headers.set("Accept","application/json");var l=function(r,n,i){if(!o){if(r&&"SecurityError"!==r.message&&w(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 ct(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&&function(t,e,r){if(self.caches){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=A(e.headers.get("Cache-Control")||"");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()-rDate.now()&&!r["no-cache"]}(n);t.delete(r),a&&t.put(r,n.clone()),e(null,n,a)})).catch(e)})).catch(e)}(a,l):l(null,null),{cancel:function(){o=!0,i||n.abort()}}}var ht,dt,gt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(ft())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return pt(t,e);if(ut()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}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 ct(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},vt=function(t,e){return gt(f(t,{type:"arrayBuffer"}),e)},mt=function(t,e){return gt(f(t,{method:"POST"}),e)};ht=[],dt=0;var yt=function(t,e){if(dt>=z.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return ht.push(r),r}dt++;var n=!1,a=function(){if(!n)for(n=!0,dt--;ht.length&&dt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},kt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Tt={$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"},"*":{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}},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:"string",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"},{"!":"text-variable-anchor"}],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":{}}},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:22,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"},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"},"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"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{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:"string",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:"string",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:"string",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:"string",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"}}},At=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Mt(t){var e=t.key,r=t.value;return r?[new At(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 qt=[It,Dt,zt,Rt,Ft,Vt,Bt,Ut(Nt)];function Gt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Gt(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=qt;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),f=a.substr(l+1,c-(l+1)).split(","),p=1;switch(u){case"rgba":if(4!==f.length)return null;p=o(f.pop());case"rgb":return 3!==f.length?null:[i(f[0]),i(f[1]),i(f[2]),p];case"hsla":if(4!==f.length)return null;p=o(f.pop());case"hsl":if(3!==f.length)return null;var h=(parseFloat(f[0])%360+360)%360/360,d=o(f[1]),g=o(f[2]),v=g<=.5?g*(d+1):g+d-g*d,m=2*g-v;return[n(255*s(m,v,h+1/3)),n(255*s(m,v,h)),n(255*s(m,v,h-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,Yt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};Yt.parse=function(t){if(t){if(t instanceof Yt)return t;if("string"==typeof t){var e=Wt(t);if(e)return new Yt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Yt.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+")"},Yt.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]},Yt.black=new Yt(0,0,0,1),Yt.white=new Yt(1,1,1,1),Yt.transparent=new Yt(0,0,0,0),Yt.red=new Yt(1,0,0,1);var Xt=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"})};Xt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Xt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Zt=function(t,e,r,n){this.text=t,this.scale=e,this.fontStack=r,this.textColor=n},Jt=function(t){this.sections=t};function Kt(t,e,r,n){return"number"==typeof t&&t>=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 $t(t){if(null===t)return It;if("string"==typeof t)return zt;if("boolean"==typeof t)return Rt;if("number"==typeof t)return Dt;if(t instanceof Yt)return Ft;if(t instanceof Xt)return jt;if(t instanceof Jt)return Vt;if(Array.isArray(t)){for(var e,r=t.length,n=0,a=t;n2){var s=t[1];if("string"!=typeof s||!(s in re)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=re[s],n++}else i=Nt;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=Ut(i,o)}else r=re[a];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ae=function(t){this.type=Vt,this.sections=t};ae.parse=function(t,e){if(t.length<3)return e.error("Expected at least two arguments.");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");for(var r=[],n=1;n4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":Kt(e[0],e[1],e[2],e[3])))return new Yt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ee(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=0)return!1;var r=!0;return t.eachChild((function(t){r&&!he(t,e)&&(r=!1)})),r}ue.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Rt);if(!n)return null;var a=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Rt);if(!a)return null;var i=null;return r.locale&&!(i=e.parse(r.locale,1,zt))?null:new ue(n,a,i)},ue.prototype.evaluate=function(t){return new Xt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ue.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ue.prototype.possibleOutputs=function(){return[void 0]},ue.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var de=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};de.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new de(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},de.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},de.prototype.eachChild=function(){},de.prototype.possibleOutputs=function(){return[void 0]},de.prototype.serialize=function(){return["var",this.name]};var ge=function(t,e,r,n,a){void 0===e&&(e=[]),void 0===n&&(n=new Pt),void 0===a&&(a=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=a,this.expectedType=r};function ve(t,e){for(var r,n,a=t.length-1,i=0,o=a,s=0;i<=o;)if(r=t[s=Math.floor((i+o)/2)],n=t[s+1],r<=e){if(s===a||ee))throw new ee("Input is not a number.");o=s-1}return 0}ge.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)},ge.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ne(e,[t]):"coerce"===r?new oe(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||"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 te)&&function t(e){if(e instanceof de)return t(e.boundExpression);if(e instanceof ce&&"error"===e.name)return!1;if(e instanceof ue)return!1;var r=e instanceof oe||e instanceof ne,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof te})),!!n&&fe(e)&&he(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(i)){var l=new le;try{i=new te(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.")},ge.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 ge(this.registry,n,e||null,a,this.errors)},ge.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))},ge.prototype.checkSubtype=function(t,e){var r=Gt(t,e);return r&&this.error(r),r};var me=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 me(a,r,n)},me.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)},me.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 xe=Object.freeze({number:ye,color:function(t,e,r){return new Yt(ye(t.r,e.r,r),ye(t.g,e.g,r),ye(t.b,e.b,r),ye(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return ye(t,e[n],r)}))}}),be=.95047,_e=1,we=1.08883,ke=4/29,Te=6/29,Ae=3*Te*Te,Me=Te*Te*Te,Ee=Math.PI/180,Se=180/Math.PI;function Ce(t){return t>Me?Math.pow(t,1/3):t/Ae+ke}function Le(t){return t>Te?t*t*t:Ae*(t-ke)}function Oe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ie(t){var e=Pe(t.r),r=Pe(t.g),n=Pe(t.b),a=Ce((.4124564*e+.3575761*r+.1804375*n)/be),i=Ce((.2126729*e+.7151522*r+.072175*n)/_e);return{l:116*i-16,a:500*(a-i),b:200*(i-Ce((.0193339*e+.119192*r+.9503041*n)/we)),alpha:t.a}}function De(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=_e*Le(e),r=be*Le(r),n=we*Le(n),new Yt(Oe(3.2404542*r-1.5371385*e-.4985314*n),Oe(-.969266*r+1.8760108*e+.041556*n),Oe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function ze(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Re={forward:Ie,reverse:De,interpolate:function(t,e,r){return{l:ye(t.l,e.l,r),a:ye(t.a,e.a,r),b:ye(t.b,e.b,r),alpha:ye(t.alpha,e.alpha,r)}}},Fe={forward:function(t){var e=Ie(t),r=e.l,n=e.a,a=e.b,i=Math.atan2(a,n)*Se;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*Ee,r=t.c;return De({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:ze(t.h,e.h,r),c:ye(t.c,e.c,r),l:ye(t.l,e.l,r),alpha:ye(t.alpha,e.alpha,r)}}},Be=Object.freeze({lab:Re,hcl:Fe}),Ne=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,Dt)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ft: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.',h);var g=e.parse(p,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 Ne(c,r,n,a,l):e.error("Type "+Ht(c)+" is not interpolatable.")},Ne.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=Ne.interpolationFactor(this.interpolation,n,o,s),c=r[i].evaluate(t),u=r[i+1].evaluate(t);return"interpolate"===this.operator?xe[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?Fe.reverse(Fe.interpolate(Fe.forward(c),Fe.forward(u),l)):Re.reverse(Re.interpolate(Re.forward(c),Re.forward(u),l))},Ne.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ee("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ee("Array index must be an integer, but found "+e+" instead.");return r[e]},He.prototype.eachChild=function(t){t(this.index),t(this.input)},He.prototype.possibleOutputs=function(){return[void 0]},He.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var qe=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};qe.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 p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,$t(p)))return null}else r=$t(p);if(void 0!==a[String(p)])return c.error("Branch labels must be unique.");a[String(p)]=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,Nt);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 qe(r,n,d,a,i,g):null},qe.prototype.evaluate=function(t){var e=this.input.evaluate(t);return($t(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},qe.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},qe.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},qe.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},a=0,i=Object.keys(this.cases).sort();a",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Qe=Xe("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),tr=Xe(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),er=function(t,e,r,n,a){this.type=zt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=a};er.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Dt);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,zt)))return null;var i=null;if(n.currency&&!(i=e.parse(n.currency,1,zt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Dt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Dt))?null:new er(r,a,i,o,s)},er.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))},er.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)},er.prototype.possibleOutputs=function(){return[void 0]},er.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 rr=function(t){this.type=Dt,this.input=t};rr.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 "+Ht(r.type)+" instead."):new rr(r):null},rr.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 ee("Expected value to be of type string or array, but found "+Ht($t(e))+" instead.")},rr.prototype.eachChild=function(t){t(this.input)},rr.prototype.possibleOutputs=function(){return[void 0]},rr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var nr={"==":Ze,"!=":Je,">":$e,"<":Ke,">=":tr,"<=":Qe,array:ne,at:He,boolean:ne,case:Ge,coalesce:Ve,collator:ue,format:ae,interpolate:Ne,"interpolate-hcl":Ne,"interpolate-lab":Ne,length:rr,let:Ue,literal:te,match:qe,number:ne,"number-format":er,object:ne,step:me,string:ne,"to-boolean":oe,"to-color":oe,"to-number":oe,"to-string":oe,var:de};function ar(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=Kt(r,n,a,o);if(s)throw new ee(s);return new Yt(r/255*o,n/255*o,a/255*o,o)}function ir(t,e){return t in e}function or(t,e){var r=e[t];return void 0===r?null:r}function sr(t){return{type:t}}function lr(t){return{result:"success",value:t}}function cr(t){return{result:"error",value:t}}function ur(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function fr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function pr(t){return!!t.expression&&t.expression.interpolated}function hr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function dr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function gr(t){return t}function vr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function mr(t,e,r,n,a){return vr(typeof r===a?n[r]:void 0,t.default,e.default)}function yr(t,e,r){if("number"!==hr(r))return vr(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 xr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==hr(r))return vr(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=xe[e.type]||gr;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=Be[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 br(t,e,r){return"color"===e.type?r=Yt.parse(r):"formatted"===e.type?r=Jt.fromString(r.toString()):hr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),vr(r,t.default,e.default)}ce.register(nr,{error:[{kind:"error"},[zt],function(t,e){var r=e[0];throw new ee(r.evaluate(t))}],typeof:[zt,[Nt],function(t,e){return Ht($t(e[0].evaluate(t)))}],"to-rgba":[Ut(Dt,4),[Ft],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ft,[Dt,Dt,Dt],ar],rgba:[Ft,[Dt,Dt,Dt,Dt],ar],has:{type:Rt,overloads:[[[zt],function(t,e){return ir(e[0].evaluate(t),t.properties())}],[[zt,Bt],function(t,e){var r=e[0],n=e[1];return ir(r.evaluate(t),n.evaluate(t))}]]},get:{type:Nt,overloads:[[[zt],function(t,e){return or(e[0].evaluate(t),t.properties())}],[[zt,Bt],function(t,e){var r=e[0],n=e[1];return or(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Nt,[zt],function(t,e){return or(e[0].evaluate(t),t.featureState||{})}],properties:[Bt,[],function(t){return t.properties()}],"geometry-type":[zt,[],function(t){return t.geometryType()}],id:[Nt,[],function(t){return t.id()}],zoom:[Dt,[],function(t){return t.globals.zoom}],"heatmap-density":[Dt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Dt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Nt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Dt,sr(Dt),function(t,e){for(var r=0,n=0,a=e;n":[Rt,[zt,Nt],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->":[Rt,[Nt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[Rt,[zt,Nt],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-<=":[Rt,[Nt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[Rt,[zt,Nt],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->=":[Rt,[Nt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[Rt,[Nt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Rt,[],function(t){return null!==t.id()}],"filter-type-in":[Rt,[Ut(zt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Rt,[Ut(Nt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Rt,[zt,Ut(Nt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Rt,[zt,Ut(Nt)],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:Rt,overloads:[[[Rt,Rt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[sr(Rt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in nr}function kr(t,e){var r=new ge(nr,[],e?function(t){var e={color:Ft,string:zt,number:Dt,enum:zt,boolean:Rt,formatted:Vt};return"array"===t.type?Ut(e[t.value]||Nt,t.length):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?lr(new _r(n,e)):cr(r.errors)}_r.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)},_r.prototype.evaluate=function(t,e,r,n){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.formattedSection=n||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ee("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Tr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!pe(e.expression)};Tr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n)},Tr.prototype.evaluate=function(t,e,r,n){return this._styleExpression.evaluate(t,e,r,n)};var Ar=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!pe(e.expression),this.interpolationType=n};function Mr(t,e){if("error"===(t=kr(t,e)).result)return t;var r=t.value.expression,n=fe(r);if(!n&&!ur(e))return cr([new Ot("","data expressions not supported")]);var a=he(r,["zoom"]);if(!a&&!fr(e))return cr([new Ot("","zoom expressions not supported")]);var i=function t(e){var r=null;if(e instanceof Ue)r=t(e.result);else if(e instanceof Ve)for(var n=0,a=e.args;nn.maximum?[new At(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Or(t){var e,r,n,a=t.valueSpec,i=Ct(t.value.type),o={},s="categorical"!==i&&void 0===t.value.property,l=!s,c="array"===hr(t.value.stops)&&"array"===hr(t.value.stops[0])&&"object"===hr(t.value.stops[0][0]),u=Sr({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 At(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Cr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:f})),"array"===hr(r)&&0===r.length&&e.push(new At(t.key,r,"array must have at least one stop")),e},default:function(t){return $r({key:t.key,value:t.value,valueSpec:a,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&s&&u.push(new At(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||u.push(new At(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!pr(t.valueSpec)&&u.push(new At(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!ur(t.valueSpec)?u.push(new At(t.key,t.value,"property functions not supported")):s&&!fr(t.valueSpec)&&u.push(new At(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||u.push(new At(t.key,t.value,'"property" property is required')),u;function f(t){var e=[],i=t.value,s=t.key;if("array"!==hr(i))return[new At(s,i,"array expected, "+hr(i)+" found")];if(2!==i.length)return[new At(s,i,"array length 2 expected, length "+i.length+" found")];if(c){if("object"!==hr(i[0]))return[new At(s,i,"object expected, "+hr(i[0])+" found")];if(void 0===i[0].zoom)return[new At(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new At(s,i,"object stop key must have value")];if(n&&n>Ct(i[0].zoom))return[new At(s,i[0].zoom,"stop zoom values must appear in ascending order")];Ct(i[0].zoom)!==n&&(n=Ct(i[0].zoom),r=void 0,o={}),e=e.concat(Sr({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Lr,value:p}}))}else e=e.concat(p({key:s+"[0]",value:i[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},i));return wr(Lt(i[1]))?e.concat([new At(s+"[1]",i[1],"expressions are not allowed in function stops.")]):e.concat($r({key:s+"[1]",value:i[1],valueSpec:a,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=hr(t.value),l=Ct(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new At(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 At(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 ur(a)&&void 0===i&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new At(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":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 Br(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Nr(t[1],t[2],"=="):"!="===r?Ur(Nr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Nr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Br))):"all"===r?["all"].concat(t.slice(1).map(Br)):"none"===r?["all"].concat(t.slice(1).map(Br).map(Ur)):"in"===r?jr(t[1],t.slice(2)):"!in"===r?Ur(jr(t[1],t.slice(2))):"has"===r?Vr(t[1]):"!has"!==r||Ur(Vr(t[1]))}function Nr(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 jr(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(Fr)]]:["filter-in-small",t,["literal",e]]}}function Vr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ur(t){return["!",t]}function Hr(t){return Dr(Lt(t.value))?Pr(Et({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==hr(r))return[new At(n,r,"array expected, "+hr(r)+" found")];var a,i=e.styleSpec,o=[];if(r.length<1)return[new At(n,r,"filter array must have at least 1 element")];switch(o=o.concat(Ir({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ct(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Ct(r[1])&&o.push(new At(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new At(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(a=hr(r[1]))&&o.push(new At(n+"[1]",r[1],"string expected, "+a+" found"));for(var s=2;s=u[h+0]&&n>=u[h+1])?(o[p]=!0,i.push(c[p])):o[p]=!1}}},fn.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),f=this._convertToCellCoord(n),p=l;p<=u;p++)for(var h=c;h<=f;h++){var d=this.d*h+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(h),this._convertFromCellCoord(p+1),this._convertFromCellCoord(h+1)))&&a.call(this,t,e,r,n,d,i,o,s))return}},fn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},fn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},fn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=un+this.cells.length+1+1,r=0,n=0;n=0)){var f=t[u];c[u]=hn[l].shallow.indexOf(u)>=0?f:vn(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 mn(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||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof pn)return t;if(Array.isArray(t))return t.map(mn);if("object"==typeof t){var e=t.$name||"Object",r=hn[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:mn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var yn=function(){this.first=!0};yn.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 bn(t){for(var e=0,r=t;e=65097&&t<=65103)||xn["CJK Compatibility Ideographs"](t)||xn["CJK Compatibility"](t)||xn["CJK Radicals Supplement"](t)||xn["CJK Strokes"](t)||!(!xn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||xn["CJK Unified Ideographs Extension A"](t)||xn["CJK Unified Ideographs"](t)||xn["Enclosed CJK Letters and Months"](t)||xn["Hangul Compatibility Jamo"](t)||xn["Hangul Jamo Extended-A"](t)||xn["Hangul Jamo Extended-B"](t)||xn["Hangul Jamo"](t)||xn["Hangul Syllables"](t)||xn.Hiragana(t)||xn["Ideographic Description Characters"](t)||xn.Kanbun(t)||xn["Kangxi Radicals"](t)||xn["Katakana Phonetic Extensions"](t)||xn.Katakana(t)&&12540!==t||!(!xn["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)||!(!xn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||xn["Unified Canadian Aboriginal Syllabics"](t)||xn["Unified Canadian Aboriginal Syllabics Extended"](t)||xn["Vertical Forms"](t)||xn["Yijing Hexagram Symbols"](t)||xn["Yi Syllables"](t)||xn["Yi Radicals"](t))))}function kn(t){return!(wn(t)||function(t){return!!(xn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||xn["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)||xn["Letterlike Symbols"](t)||xn["Number Forms"](t)||xn["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)||xn["Control Pictures"](t)&&9251!==t||xn["Optical Character Recognition"](t)||xn["Enclosed Alphanumerics"](t)||xn["Geometric Shapes"](t)||xn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||xn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||xn["CJK Symbols and Punctuation"](t)||xn.Katakana(t)||xn["Private Use Area"](t)||xn["CJK Compatibility Forms"](t)||xn["Small Form Variants"](t)||xn["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 Tn(t,e){return!(!e&&(t>=1424&&t<=2303||xn["Arabic Presentation Forms-A"](t)||xn["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||xn.Khmer(t))}var An,Mn=!1,En=null,Sn=!1,Cn=new kt,Ln={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Sn||null!=Ln.applyArabicShaping}},On=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 yn,this.transition={})};On.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 Pn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(dr(t))return new Er(t,e);if(wr(t)){var r=Mr(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=Yt.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Pn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Pn.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var In=function(t){this.property=t,this.value=new Pn(t,void 0)};In.prototype.transitioned=function(t,e){return new zn(this.property,this.value,e,f({},t.transition,this.transition),t.now)},In.prototype.untransitioned=function(){return new zn(this.property,this.value,null,{},0)};var Dn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Dn.prototype.getValue=function(t){return b(this._values[t].value.value)},Dn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new In(this._values[t].property)),this._values[t].value=new Pn(this._values[t].property,null===e?void 0:b(e))},Dn.prototype.getTransition=function(t){return b(this._values[t].transition)},Dn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new In(this._values[t].property)),this._values[t].transition=b(e)||void 0},Dn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return r};var Rn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Rn.prototype.possiblyEvaluate=function(t){for(var e=new Nn(this._properties),r=0,n=Object.keys(this._values);rn.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Vn),Hn=function(t){this.specification=t};Hn.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new On(Math.floor(e.zoom-1),e)),t.expression.evaluate(new On(Math.floor(e.zoom),e)),t.expression.evaluate(new On(Math.floor(e.zoom+1),e)),e)}},Hn.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Hn.prototype.interpolate=function(t){return t};var qn=function(t){this.specification=t};qn.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},qn.prototype.interpolate=function(){return!1};var Gn=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 Pn(r,void 0),a=this.defaultTransitionablePropertyValues[e]=new In(r);this.defaultTransitioningPropertyValues[e]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};dn("DataDrivenProperty",Vn),dn("DataConstantProperty",jn),dn("CrossFadedDataDrivenProperty",Un),dn("CrossFadedProperty",Hn),dn("ColorRampProperty",qn);var Wn=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter=function(){return!0},"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 Fn(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Dn(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()}}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(sn,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(on,n,t,e,r))return!1}if(m(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){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},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),x(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)&&ln(this,t.call(nn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Tt,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 Bn&&ur(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(kt),Yn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Xn=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},Zn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Jn(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var a,i=(a=t.type,Yn[a].BYTES_PER_ELEMENT),o=r=Kn(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:Kn(r,Math.max(n,e)),alignment:e}}function Kn(t,e){return Math.ceil(t/e)*e}Zn.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Zn.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},Zn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Zn.prototype.clear=function(){this.length=0},Zn.prototype.resize=function(t){this.reserve(t),this.length=t},Zn.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)}},Zn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var $n=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}(Zn);$n.prototype.bytesPerElement=4,dn("StructArrayLayout2i4",$n);var Qn=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}(Zn);Qn.prototype.bytesPerElement=8,dn("StructArrayLayout4i8",Qn);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.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}(Zn);ta.prototype.bytesPerElement=12,dn("StructArrayLayout2i4i12",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.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}(Zn);ea.prototype.bytesPerElement=8,dn("StructArrayLayout2i4ub8",ea);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.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,a,i,o,s)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l){var c=8*t;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=n,this.uint16[c+3]=a,this.uint16[c+4]=i,this.uint16[c+5]=o,this.uint16[c+6]=s,this.uint16[c+7]=l,t},e}(Zn);ra.prototype.bytesPerElement=16,dn("StructArrayLayout8ui16",ra);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){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,a,i,o,s)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l){var c=8*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=a,this.uint16[c+4]=i,this.uint16[c+5]=o,this.uint16[c+6]=s,this.uint16[c+7]=l,t},e}(Zn);na.prototype.bytesPerElement=16,dn("StructArrayLayout4i4ui16",na);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._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}(Zn);aa.prototype.bytesPerElement=12,dn("StructArrayLayout3f12",aa);var ia=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}(Zn);ia.prototype.bytesPerElement=4,dn("StructArrayLayout1ul4",ia);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),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,c,u){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,a,i,o,s,l,c,u)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,c,u,f){var p=12*t,h=6*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=a,this.int16[p+4]=i,this.int16[p+5]=o,this.uint32[h+3]=s,this.uint16[p+8]=l,this.uint16[p+9]=c,this.int16[p+10]=u,this.int16[p+11]=f,t},e}(Zn);oa.prototype.bytesPerElement=24,dn("StructArrayLayout6i1ul2ui2i24",oa);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._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}(Zn);sa.prototype.bytesPerElement=12,dn("StructArrayLayout2i2i2i12",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._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}(Zn);la.prototype.bytesPerElement=12,dn("StructArrayLayout2ub2f12",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._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,f,p,h,d,g){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,a,i,o,s,l,c,u,f,p,h,d,g)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,c,u,f,p,h,d,g,v){var m=22*t,y=11*t,x=44*t;return this.int16[m+0]=e,this.int16[m+1]=r,this.uint16[m+2]=n,this.uint16[m+3]=a,this.uint32[y+2]=i,this.uint32[y+3]=o,this.uint32[y+4]=s,this.uint16[m+10]=l,this.uint16[m+11]=c,this.uint16[m+12]=u,this.float32[y+7]=f,this.float32[y+8]=p,this.uint8[x+36]=h,this.uint8[x+37]=d,this.uint8[x+38]=g,this.uint32[y+10]=v,t},e}(Zn);ca.prototype.bytesPerElement=44,dn("StructArrayLayout2i2ui3ul3ui2f3ub1ul44",ca);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.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,f,p,h,d,g,v,m,y,x){var b=this.length;return this.resize(b+1),this.emplace(b,t,e,r,n,a,i,o,s,l,c,u,f,p,h,d,g,v,m,y,x)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,c,u,f,p,h,d,g,v,m,y,x,b){var _=24*t,w=12*t;return this.int16[_+0]=e,this.int16[_+1]=r,this.int16[_+2]=n,this.int16[_+3]=a,this.int16[_+4]=i,this.int16[_+5]=o,this.uint16[_+6]=s,this.uint16[_+7]=l,this.uint16[_+8]=c,this.uint16[_+9]=u,this.uint16[_+10]=f,this.uint16[_+11]=p,this.uint16[_+12]=h,this.uint16[_+13]=d,this.uint16[_+14]=g,this.uint16[_+15]=v,this.uint16[_+16]=m,this.uint32[w+9]=y,this.float32[w+10]=x,this.float32[w+11]=b,t},e}(Zn);ua.prototype.bytesPerElement=48,dn("StructArrayLayout6i11ui1ul2f48",ua);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.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}(Zn);fa.prototype.bytesPerElement=4,dn("StructArrayLayout1f4",fa);var pa=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}(Zn);pa.prototype.bytesPerElement=6,dn("StructArrayLayout3i6",pa);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.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}(Zn);ha.prototype.bytesPerElement=8,dn("StructArrayLayout1ul2ui8",ha);var da=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}(Zn);da.prototype.bytesPerElement=6,dn("StructArrayLayout3ui6",da);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){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}(Zn);ga.prototype.bytesPerElement=4,dn("StructArrayLayout2ui4",ga);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.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}(Zn);va.prototype.bytesPerElement=2,dn("StructArrayLayout1ui2",va);var ma=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}(Zn);ma.prototype.bytesPerElement=8,dn("StructArrayLayout2f8",ma);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.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}(Zn);ya.prototype.bytesPerElement=16,dn("StructArrayLayout4f16",ya);var xa=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},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Xn);xa.prototype.size=24;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.get=function(t){return new xa(this,t)},e}(oa);dn("CollisionBoxArray",ba);var _a=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}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},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},Object.defineProperties(e.prototype,r),e}(Xn);_a.prototype.size=44;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.get=function(t){return new _a(this,t)},e}(ca);dn("PlacedSymbolArray",wa);var ka=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},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},radialTextOffset:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},r.key.get=function(){return this._structArray.uint16[this._pos2+6]},r.key.set=function(t){this._structArray.uint16[this._pos2+6]=t},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+14]},r.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+14]=t},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+15]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+15]=t},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+16]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+16]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+9]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+9]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+10]},r.textBoxScale.set=function(t){this._structArray.float32[this._pos4+10]=t},r.radialTextOffset.get=function(){return this._structArray.float32[this._pos4+11]},r.radialTextOffset.set=function(t){this._structArray.float32[this._pos4+11]=t},Object.defineProperties(e.prototype,r),e}(Xn);ka.prototype.size=48;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.get=function(t){return new ka(this,t)},e}(ua);dn("SymbolInstanceArray",Ta);var Aa=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={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(Xn);Aa.prototype.size=4;var Ma=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.prototype.get=function(t){return new Aa(this,t)},e}(fa);dn("GlyphOffsetArray",Ma);var Ea=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={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(Xn);Ea.prototype.size=6;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.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.prototype.get=function(t){return new Ea(this,t)},e}(pa);dn("SymbolLineVertexArray",Sa);var Ca=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.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(Xn);Ca.prototype.size=8;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.get=function(t){return new Ca(this,t)},e}(ha);dn("FeatureIndexArray",La);var Oa=Jn([{name:"a_pos",components:2,type:"Int16"}],4).members,Pa=function(t){void 0===t&&(t=[]),this.segments=t};function Ia(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}Pa.prototype.prepareSegment=function(t,e,r,n){var a=this.segments[this.segments.length-1];return t>Pa.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+Pa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!a||a.vertexLength+t>Pa.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},Pa.prototype.get=function(){return this.segments},Pa.prototype.destroy=function(){for(var t=0,e=this.segments;t>1;this.ids[n]>=t?r=n:e=n+1}for(var a=[];this.ids[e]===t;){var i=this.positions[3*e],o=this.positions[3*e+1],s=this.positions[3*e+2];a.push({index:i,start:o,end:s}),e++}return a},Da.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,a){if(!(n>=a)){for(var i=e[n+a>>1],o=n-1,s=a+1;;){do{o++}while(e[o]i);if(o>=s)break;za(e,o,s),za(r,3*o,3*s),za(r,3*o+1,3*s+1),za(r,3*o+2,3*s+2)}t(e,r,n,s),t(e,r,s+1,a)}}(r,n,0,r.length-1),e.push(r.buffer,n.buffer),{ids:r,positions:n}},Da.deserialize=function(t){var e=new Da;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},dn("FeaturePositionMap",Da);var Ra=function(t,e){this.gl=t.gl,this.location=e},Fa=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Ra),Ba=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Ra),Na=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(Ra),ja=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(Ra),Va=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Ra),Ua=function(t){function e(e,r){t.call(this,e,r),this.current=Yt.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Ra),Ha=new Float32Array(16),qa=function(t){function e(e,r){t.call(this,e,r),this.current=Ha}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(Ra);function Ga(t){return[Ia(255*t.r,255*t.g),Ia(255*t.b,255*t.a)]}var Wa=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0};Wa.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Wa.prototype.setConstantPatternPositions=function(){},Wa.prototype.populatePaintArray=function(){},Wa.prototype.updatePaintArray=function(){},Wa.prototype.upload=function(){},Wa.prototype.destroy=function(){},Wa.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value))},Wa.prototype.getBinding=function(t,e){return"color"===this.type?new Ua(t,e):new Ba(t,e)},Wa.serialize=function(t){var e=t.value,r=t.names,n=t.type;return{value:vn(e),names:r,type:n}},Wa.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new Wa(mn(e),r,n)};var Ya=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};Ya.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Ya.prototype.populatePaintArray=function(){},Ya.prototype.updatePaintArray=function(){},Ya.prototype.upload=function(){},Ya.prototype.destroy=function(){},Ya.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},Ya.prototype.setUniforms=function(t,e,r,n,a){var i=this.patternPositions;"u_pattern_to"===a&&i.patternTo&&e.set(i.patternTo),"u_pattern_from"===a&&i.patternFrom&&e.set(i.patternFrom)},Ya.prototype.getBinding=function(t,e){return new Va(t,e)};var Xa=function(t,e,r,n){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};Xa.prototype.defines=function(){return[]},Xa.prototype.setConstantPatternPositions=function(){},Xa.prototype.populatePaintArray=function(t,e,r,n){var a=this.paintVertexArray,i=a.length;a.reserve(t);var o=this.expression.evaluate(new On(0),e,{},n);if("color"===this.type)for(var s=Ga(o),l=i;lri.max||o.yri.max)&&(w("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=c(o.x,ri.min,ri.max),o.y=c(o.y,ri.min,ri.max))}return r}function ai(t,e,r,n,a){t.emplaceBack(2*e+(n+1)/2,2*r+(a+1)/2)}var ii=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 $n,this.indexArray=new da,this.segments=new Pa,this.programConfigurations=new $a(Oa,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function oi(t,e){for(var r=0;r1){if(ui(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(a)._add(e))}function di(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 gi(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 vi(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=k(t,e,r[0]);return i!==k(t,e,r[1])||i!==k(t,e,r[2])||i!==k(t,e,r[3])}function mi(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].maxValue}function yi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function xi(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=ei||c<0||c>=ei)){var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=u.vertexLength;ai(this.layoutVertexArray,l,c,-1,-1),ai(this.layoutVertexArray,l,c,1,-1),ai(this.layoutVertexArray,l,c,1,1),ai(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),u.vertexLength+=4,u.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{})},dn("CircleBucket",ii,{omit:["layers"]});var bi,_i=new Gn({"circle-sort-key":new Vn(Tt.layout_circle["circle-sort-key"])}),wi={paint:new Gn({"circle-radius":new Vn(Tt.paint_circle["circle-radius"]),"circle-color":new Vn(Tt.paint_circle["circle-color"]),"circle-blur":new Vn(Tt.paint_circle["circle-blur"]),"circle-opacity":new Vn(Tt.paint_circle["circle-opacity"]),"circle-translate":new jn(Tt.paint_circle["circle-translate"]),"circle-translate-anchor":new jn(Tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new jn(Tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new jn(Tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Vn(Tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Vn(Tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Vn(Tt.paint_circle["circle-stroke-opacity"])}),layout:_i},ki="undefined"!=typeof Float32Array?Float32Array:Array;function Ti(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}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),bi=new ki(3),ki!=Float32Array&&(bi[0]=0,bi[1]=0,bi[2]=0),function(){var t=new ki(4);ki!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Ai=function(t){function e(e){t.call(this,e,wi)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new ii(t)},e.prototype.queryRadius=function(t){var e=t;return mi("circle-radius",this,e)+mi("circle-stroke-width",this,e)+yi(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,i,o,s){for(var l=xi(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"),f=u?l:function(t,e){return t.map((function(t){return Mi(t,e)}))}(l,s),p=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 qi(p,h,r,n,a,c),h}function Ui(t,e,r,n,a){var i,o;if(a===po(t,e,r,n)>0)for(i=e;i=e;i-=n)o=co(i,t[i],t[i+1],o);return o&&no(o,o.next)&&(uo(o),o=o.next),o}function Hi(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!no(n,n.next)&&0!==ro(n.prev,n,n.next))n=n.next;else{if(uo(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function qi(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=$i(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?Wi(t,n,a,i):Gi(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),uo(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?qi(t=Yi(Hi(t),e,r),e,r,n,a,i,2):2===o&&Xi(t,e,r,n,a,i):qi(Hi(t),e,r,n,a,i,1);break}}}function Gi(t){var e=t.prev,r=t,n=t.next;if(ro(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(to(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&ro(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function Wi(t,e,r,n){var a=t.prev,i=t,o=t.next;if(ro(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,f=$i(s,l,e,r,n),p=$i(c,u,e,r,n),h=t.prevZ,d=t.nextZ;h&&h.z>=f&&d&&d.z<=p;){if(h!==t.prev&&h!==t.next&&to(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&ro(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,d!==t.prev&&d!==t.next&&to(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&ro(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;h&&h.z>=f;){if(h!==t.prev&&h!==t.next&&to(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&ro(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&to(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&ro(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Yi(t,e,r){var n=t;do{var a=n.prev,i=n.next.next;!no(a,i)&&ao(a,n,n.next,i)&&so(a,i)&&so(i,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(i.i/r),uo(n),uo(n.next),n=t=i),n=n.next}while(n!==t);return Hi(n)}function Xi(t,e,r,n,a,i){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&eo(o,s)){var l=lo(o,s);return o=Hi(o,o.next),l=Hi(l,l.next),qi(o,e,r,n,a,i),void qi(l,e,r,n,a,i)}s=s.next}o=o.next}while(o!==t)}function Zi(t,e){return t.x-e.x}function Ji(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&&to(ir.x||n.x===r.x&&Ki(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(t,e)){var r=lo(e,t);Hi(r,r.next)}}function Ki(t,e){return ro(t.prev,t,e.prev)<0&&ro(e.next,t,t.next)<0}function $i(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 Qi(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 eo(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&&ao(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(so(t,e)&&so(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)&&(ro(t.prev,t,e.prev)||ro(t,e.prev,e))||no(t,e)&&ro(t.prev,t,t.next)>0&&ro(e.prev,e,e.next)>0)}function ro(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function no(t,e){return t.x===e.x&&t.y===e.y}function ao(t,e,r,n){var a=oo(ro(t,e,r)),i=oo(ro(t,e,n)),o=oo(ro(r,n,t)),s=oo(ro(r,n,e));return a!==i&&o!==s||!(0!==a||!io(t,r,e))||!(0!==i||!io(t,n,e))||!(0!==o||!io(r,t,n))||!(0!==s||!io(r,e,n))}function io(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 oo(t){return t>0?1:t<0?-1:0}function so(t,e){return ro(t.prev,t,t.next)<0?ro(t,e,t.next)>=0&&ro(t,t.prev,e)>=0:ro(t,e,t.prev)<0||ro(t,t.next,e)<0}function lo(t,e){var r=new fo(t.i,t.x,t.y),n=new fo(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 co(t,e,r,n){var a=new fo(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 uo(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 fo(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 po(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);t(e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(a,Math.floor(r+(o-s)*c/o+u)),i)}var f=e[r],p=n,h=a;for(go(e,n,r),i(e[a],f)>0&&go(e,n,a);p0;)h--}0===i(e[n],f)?go(e,n,h):go(e,++h,a),h<=r&&(n=h+1),r<=h&&(a=h-1)}}(t,e,r||0,n||t.length-1,a||vo)}function go(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function vo(t,e){return te?1:0}function mo(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},Ni.default=ji;var _o=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 $n,this.indexArray=new da,this.indexArray2=new ga,this.programConfigurations=new $a(Bi,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}))};_o.prototype.populate=function(t,e){this.hasPattern=xo("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],a=0,i=t;a>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},Eo.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]},Eo.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=Eo.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 Io(t,e,r){if(3===t){var n=new Lo(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Oo.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 Mo(this._pbf,e,this.extent,this._keys,this._values)};var Do={VectorTile:function(t,e){this.layers=t.readFields(Io,{},e)},VectorTileFeature:Mo,VectorTileLayer:Lo},zo=Do.VectorTileFeature.types,Ro=Math.pow(2,13);function Fo(t,e,r,n,a,i,o,s){t.emplaceBack(e,r,2*Math.floor(n*Ro)+o,a*Ro*2,i*Ro*2,Math.round(s))}var Bo=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 ta,this.indexArray=new da,this.programConfigurations=new $a(Ao,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 No(t,e){return t.x===e.x&&(t.x<0||t.x>ei)||t.y===e.y&&(t.y<0||t.y>ei)}function jo(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>ei}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>ei}))}Bo.prototype.populate=function(t,e){this.features=[],this.hasPattern=xo("fill-extrusion",this.layers,e);for(var r=0,n=t;r=1){var m=h[g-1];if(!No(v,m)){u.vertexLength+4>Pa.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var y=v.sub(m)._perp()._unit(),x=m.dist(v);d+x>32768&&(d=0),Fo(this.layoutVertexArray,v.x,v.y,y.x,y.y,0,0,d),Fo(this.layoutVertexArray,v.x,v.y,y.x,y.y,0,1,d),d+=x,Fo(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,0,d),Fo(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,1,d);var b=u.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),u.vertexLength+=4,u.primitiveLength+=2}}}}if(u.vertexLength+s>Pa.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===zo[t.type]){for(var _=[],w=[],k=u.vertexLength,T=0,A=o;T=2&&t[u-1].equals(t[u-2]);)u--;for(var f=0;f0;if(A&&x>f){var E=p.dist(g);if(E>2*h){var S=p.sub(p.sub(g)._mult(h/E)._round());this.updateDistance(g,S),this.addCurrentVertex(S,m,0,0,d),g=S}}var C=g&&v,L=C?r:c?"butt":n;if(C&&"round"===L&&(ka&&(L="bevel"),"bevel"===L&&(k>2&&(L="flipbevel"),k100)b=y.mult(-1);else{var O=k*m.add(y).mag()/m.sub(y).mag();b._perp()._mult(O*(M?-1:1))}this.addCurrentVertex(p,b,0,0,d),this.addCurrentVertex(p,b.mult(-1),0,0,d)}else if("bevel"===L||"fakeround"===L){var P=-Math.sqrt(k*k-1),I=M?P:0,D=M?0:P;if(g&&this.addCurrentVertex(p,m,I,D,d),"fakeround"===L)for(var z=Math.round(180*T/Math.PI/20),R=1;R2*h){var U=p.add(v.sub(p)._mult(h/V)._round());this.updateDistance(p,U),this.addCurrentVertex(U,y,0,0,d),p=U}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,s)}},Zo.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>Xo/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,a,i))},Zo.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},Zo.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Xo-1):this.distance},dn("LineBucket",Zo,{omit:["layers","patternFeatures"]});var Jo=new Gn({"line-cap":new jn(Tt.layout_line["line-cap"]),"line-join":new Vn(Tt.layout_line["line-join"]),"line-miter-limit":new jn(Tt.layout_line["line-miter-limit"]),"line-round-limit":new jn(Tt.layout_line["line-round-limit"]),"line-sort-key":new Vn(Tt.layout_line["line-sort-key"])}),Ko={paint:new Gn({"line-opacity":new Vn(Tt.paint_line["line-opacity"]),"line-color":new Vn(Tt.paint_line["line-color"]),"line-translate":new jn(Tt.paint_line["line-translate"]),"line-translate-anchor":new jn(Tt.paint_line["line-translate-anchor"]),"line-width":new Vn(Tt.paint_line["line-width"]),"line-gap-width":new Vn(Tt.paint_line["line-gap-width"]),"line-offset":new Vn(Tt.paint_line["line-offset"]),"line-blur":new Vn(Tt.paint_line["line-blur"]),"line-dasharray":new Hn(Tt.paint_line["line-dasharray"]),"line-pattern":new Un(Tt.paint_line["line-pattern"]),"line-gradient":new qn(Tt.paint_line["line-gradient"])}),layout:Jo},$o=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 On(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=f({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,a)},e}(Vn))(Ko.paint.properties["line-width"].specification);$o.useIntegerZoom=!0;var Qo=function(t){function e(e){t.call(this,e,Ko)}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=Di(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=$o.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Zo(t)},e.prototype.queryRadius=function(t){var e=t,r=ts(mi("line-width",this,e),mi("line-gap-width",this,e)),n=mi("line-offset",this,e);return r/2+Math.abs(n)+yi(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=xi(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*ts(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 es=Jn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),rs=Jn([{name:"a_projected_pos",components:3,type:"Float32"}],4),ns=(Jn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Jn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),as=(Jn([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Jn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),is=Jn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function os(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()),Ln.applyArabicShaping&&(t=Ln.applyArabicShaping(t)),t}(t.text,e,r)})),t}Jn([{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"}]),Jn([{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:"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:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"radialTextOffset"}]),Jn([{type:"Float32",name:"offsetX"}]),Jn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var ss={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ls=24,cs={horizontal:1,vertical:2,horizontalOnly:3},us=function(){this.text="",this.sectionIndex=[],this.sections=[]};function fs(t,e,r,n,a,i,o,s,l,c,u){var f,p=us.fromFeature(t,r);c===cs.vertical&&p.verticalizePunctuation();var h=Ln.processBidirectionalText,d=Ln.processStyledBidirectionalText;if(h&&1===p.sections.length){f=[];for(var g=0,v=h(p.toString(),ms(p,s,n,e));g=0&&n>=t&&ps[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},us.prototype.substring=function(t,e){var r=new us;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},us.prototype.toString=function(){return this.text},us.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)};var ps={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},hs={};function ds(t,e,r,n){var a=Math.pow(t-e,2);return n?t=0,l=0,c=0;c0)&&("constant"!==a.value.kind||a.value.value.length>0),l="constant"!==o.value.kind||o.value.value&&o.value.value.length>0,c=n.get("symbol-sort-key");if(this.features=[],s||l){for(var u=e.iconDependencies,f=e.glyphDependencies,p=new On(this.zoom),h=0,d=t;h=0;for(var M=0,E=x.sections;M=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;this.addCollisionDebugVertices(i,o,s,l,c?this.collisionCircle:this.collisionBox,a.anchorPoint,r,c)}},Ps.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t0},Ps.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ps.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},Ps.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},Ps.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n1||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.addIndicesForPlacedTextSymbol(t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(i.verticalPlacedTextSymbolIndex);var o=this.icon.placedSymbolArray.get(a);if(o.numGlyphs){var s=o.vertexStartIndex;this.icon.indexArray.emplaceBack(s,s+1,s+2),this.icon.indexArray.emplaceBack(s+1,s+2,s+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},dn("SymbolBucket",Ps,{omit:["layers","collisionBoxArray","features","compareText"]}),Ps.MAX_GLYPHS=65535,Ps.addDynamicAttributes=Cs;var Is=new Gn({"symbol-placement":new jn(Tt.layout_symbol["symbol-placement"]),"symbol-spacing":new jn(Tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new jn(Tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Vn(Tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new jn(Tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new jn(Tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new jn(Tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new jn(Tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new jn(Tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Vn(Tt.layout_symbol["icon-size"]),"icon-text-fit":new jn(Tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new jn(Tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Vn(Tt.layout_symbol["icon-image"]),"icon-rotate":new Vn(Tt.layout_symbol["icon-rotate"]),"icon-padding":new jn(Tt.layout_symbol["icon-padding"]),"icon-keep-upright":new jn(Tt.layout_symbol["icon-keep-upright"]),"icon-offset":new Vn(Tt.layout_symbol["icon-offset"]),"icon-anchor":new Vn(Tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new jn(Tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new jn(Tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new jn(Tt.layout_symbol["text-rotation-alignment"]),"text-field":new Vn(Tt.layout_symbol["text-field"]),"text-font":new Vn(Tt.layout_symbol["text-font"]),"text-size":new Vn(Tt.layout_symbol["text-size"]),"text-max-width":new Vn(Tt.layout_symbol["text-max-width"]),"text-line-height":new jn(Tt.layout_symbol["text-line-height"]),"text-letter-spacing":new Vn(Tt.layout_symbol["text-letter-spacing"]),"text-justify":new Vn(Tt.layout_symbol["text-justify"]),"text-radial-offset":new Vn(Tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new jn(Tt.layout_symbol["text-variable-anchor"]),"text-anchor":new Vn(Tt.layout_symbol["text-anchor"]),"text-max-angle":new jn(Tt.layout_symbol["text-max-angle"]),"text-writing-mode":new jn(Tt.layout_symbol["text-writing-mode"]),"text-rotate":new Vn(Tt.layout_symbol["text-rotate"]),"text-padding":new jn(Tt.layout_symbol["text-padding"]),"text-keep-upright":new jn(Tt.layout_symbol["text-keep-upright"]),"text-transform":new Vn(Tt.layout_symbol["text-transform"]),"text-offset":new Vn(Tt.layout_symbol["text-offset"]),"text-allow-overlap":new jn(Tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new jn(Tt.layout_symbol["text-ignore-placement"]),"text-optional":new jn(Tt.layout_symbol["text-optional"])}),Ds={paint:new Gn({"icon-opacity":new Vn(Tt.paint_symbol["icon-opacity"]),"icon-color":new Vn(Tt.paint_symbol["icon-color"]),"icon-halo-color":new Vn(Tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Vn(Tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Vn(Tt.paint_symbol["icon-halo-blur"]),"icon-translate":new jn(Tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new jn(Tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Vn(Tt.paint_symbol["text-opacity"]),"text-color":new Vn(Tt.paint_symbol["text-color"],{runtimeType:Ft,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Vn(Tt.paint_symbol["text-halo-color"]),"text-halo-width":new Vn(Tt.paint_symbol["text-halo-width"]),"text-halo-blur":new Vn(Tt.paint_symbol["text-halo-blur"]),"text-translate":new jn(Tt.paint_symbol["text-translate"]),"text-translate-anchor":new jn(Tt.paint_symbol["text-translate-anchor"])}),layout:Is},zs=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:It,this.defaultValue=t};zs.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},zs.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},zs.prototype.possibleOutputs=function(){return[void 0]},zs.prototype.serialize=function(){return null},dn("FormatSectionOverride",zs,{omit:["defaultValue"]});var Rs=function(t){function e(e){t.call(this,e,Ds)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){if(t.prototype.recalculate.call(this,e),"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 r=this.layout.get("text-writing-mode");if(r){for(var n=[],a=0,i=r;a=0;p--){var h=o[p];if(!(f.w>h.w||f.h>h.h)){if(f.x=h.x,f.y=h.y,l=Math.max(l,f.y+f.h),s=Math.max(s,f.x+f.w),f.w===h.w&&f.h===h.h){var d=o.pop();p>1,u=-7,f=r?a-1:0,p=r?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+t[e+f],f+=p,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=p,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)},Qs=function(t,e,r,n,a,i){var o,s,l,c=8*i-a-1,u=(1<>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-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?p/l:p*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,a),o+=f):(s=e*Math.pow(2,f-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*g},tl=el;function el(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function rl(t){return t.type===el.Bytes?t.readVarint()+t.pos:t.pos+1}function nl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function al(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 il(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function vl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}el.Varint=0,el.Fixed64=1,el.Bytes=2,el.Fixed32=5,el.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=dl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=vl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=dl(this.buf,this.pos)+4294967296*dl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=dl(this.buf,this.pos)+4294967296*vl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=$s(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=$s(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(n=(112&(a=i[r.pos++]))>>4,a<128)return nl(t,n,e);if(n|=(127&(a=i[r.pos++]))<<3,a<128)return nl(t,n,e);if(n|=(127&(a=i[r.pos++]))<<10,a<128)return nl(t,n,e);if(n|=(127&(a=i[r.pos++]))<<17,a<128)return nl(t,n,e);if(n|=(127&(a=i[r.pos++]))<<24,a<128)return nl(t,n,e);if(n|=(1&(a=i[r.pos++]))<<31,a<128)return nl(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=function(t,e,r){for(var n="",a=e;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,this.pos,t);return this.pos=t,e},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!==el.Bytes)return t.push(this.readVarint(e));var r=rl(this);for(t=t||[];this.pos127;);else if(e===el.Bytes)this.pos=this.readVarint()+this.pos;else if(e===el.Fixed32)this.pos+=4;else{if(e!==el.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;if(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)),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;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(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&&al(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Qs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Qs(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&&al(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,el.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,cl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ul,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,fl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,hl,e)},writeBytesField:function(t,e){this.writeTag(t,el.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,el.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,el.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,el.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,el.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,el.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,el.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,el.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,el.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,el.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var ml=3;function yl(t,e,r){1===t&&r.readMessage(xl,e)}function xl(t,e,r){if(3===t){var n=r.readMessage(bl,{}),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 Oi({width:o+2*ml,height:s+2*ml},i),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function bl(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())}var _l=ml,wl=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};wl.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))};var kl=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},v(["receive","process"],this),this.invoker=new wl(this.process),this.target.addEventListener("message",this.receive,!1)};function Tl(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}kl.prototype.send=function(t,e,r,n){var a=this,i=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[i]=r);var o=[];return this.target.postMessage({id:i,type:t,hasCallback:!!r,targetMapId:n,sourceMapId:this.mapId,data:vn(e,o)},o),{cancel:function(){r&&delete a.callbacks[i],a.target.postMessage({id:i,type:"",targetMapId:n,sourceMapId:a.mapId})}}},kl.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 this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()},kl.prototype.process=function(){var t=this;if(this.taskQueue.length){var e=this.taskQueue.shift(),r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),r)if(""===r.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(r.error?n(mn(r.error)):n(null,mn(r.data)))}else{var a=!1,i=r.hasCallback?function(r,n){a=!0,delete t.cancelCallbacks[e];var i=[];t.target.postMessage({id:e,type:"",sourceMapId:t.mapId,error:r?vn(r):null,data:vn(n,i)},i)}:function(t){a=!0},o=null,s=mn(r.data);if(this.parent[r.type])o=this.parent[r.type](r.sourceMapId,s,i);else if(this.parent.getWorkerSource){var l=r.type.split(".");o=this.parent.getWorkerSource(r.sourceMapId,l[0],s.source)[l[1]](s,i)}else i(new Error("Could not find function "+r.type));!a&&o&&o.cancel&&(this.cancelCallbacks[e]=o.cancel)}}},kl.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var Al=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]))};Al.prototype.setNorthEast=function(t){return this._ne=t instanceof Ml?new Ml(t.lng,t.lat):Ml.convert(t),this},Al.prototype.setSouthWest=function(t){return this._sw=t instanceof Ml?new Ml(t.lng,t.lat):Ml.convert(t),this},Al.prototype.extend=function(t){var e,r,n=this._sw,a=this._ne;if(t instanceof Ml)e=t,r=t;else{if(!(t instanceof Al))return Array.isArray(t)?t.every(Array.isArray)?this.extend(Al.convert(t)):this.extend(Ml.convert(t)):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 Ml(e.lng,e.lat),this._ne=new Ml(r.lng,r.lat)),this},Al.prototype.getCenter=function(){return new Ml((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Al.prototype.getSouthWest=function(){return this._sw},Al.prototype.getNorthEast=function(){return this._ne},Al.prototype.getNorthWest=function(){return new Ml(this.getWest(),this.getNorth())},Al.prototype.getSouthEast=function(){return new Ml(this.getEast(),this.getSouth())},Al.prototype.getWest=function(){return this._sw.lng},Al.prototype.getSouth=function(){return this._sw.lat},Al.prototype.getEast=function(){return this._ne.lng},Al.prototype.getNorth=function(){return this._ne.lat},Al.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Al.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Al.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Al.convert=function(t){return!t||t instanceof Al?t:new Al(t)};var Ml=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")};Ml.prototype.wrap=function(){return new Ml(u(this.lng,-180,180),this.lat)},Ml.prototype.toArray=function(){return[this.lng,this.lat]},Ml.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ml.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 Al(new Ml(this.lng-r,this.lat-e),new Ml(this.lng+r,this.lat+e))},Ml.convert=function(t){if(t instanceof Ml)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ml(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ml(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 El=2*Math.PI*6378137;function Sl(t){return El*Math.cos(t*Math.PI/180)}function Cl(t){return(180+t)/360}function Ll(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ol(t,e){return t/Sl(e)}function Pl(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Il=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Il.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Ml.convert(t);return new Il(Cl(r.lng),Ll(r.lat),Ol(e,r.lat))},Il.prototype.toLngLat=function(){return new Ml(360*this.x-180,Pl(this.y))},Il.prototype.toAltitude=function(){return this.z*Sl(Pl(this.y))},Il.prototype.meterInMercatorCoordinateUnits=function(){return 1/El*(t=Pl(this.y),1/Math.cos(t*Math.PI/180));var t};var Dl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Fl(0,t,e,r)};Dl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Dl.prototype.url=function(t,e){var r,n,a,i,o,s=(r=this.x,n=this.y,a=this.z,i=Tl(256*r,256*(n=Math.pow(2,a)-n-1),a),o=Tl(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 Rl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Rl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Rl.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},Rl.prototype.children=function(t){if(this.overscaledZ>=t)return[new Rl(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 Rl(e,this.wrap,e,r,n),new Rl(e,this.wrap,e,r+1,n),new Rl(e,this.wrap,e,r,n+1),new Rl(e,this.wrap,e,r+1,n+1)]},Rl.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)},Bl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Bl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Bl.prototype.getPixels=function(){return new Pi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Bl.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)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e&&e>=0)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},Hl.prototype.getState=function(t,e){var r=String(e),n=this.state[t]||{},a=this.stateChanges[t]||{},i=f({},n[r],a[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var o=this.deletedStates[t][e];if(null===o)return{};for(var s in o)delete i[s]}return i},Hl.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Hl.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var a={};for(var i in this.stateChanges[n])this.state[n][i]||(this.state[n][i]={}),f(this.state[n][i],this.stateChanges[n][i]),a[i]=this.state[n][i];r[n]=a}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var c in this.deletedStates[o]){if(null===this.deletedStates[o][c])this.state[o][c]={};else for(var u=0,p=Object.keys(this.deletedStates[o][c]);u=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},ql.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Do.VectorTile(new tl(this.rawTileData)).layers,this.sourceLayerCoder=new jl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ql.prototype.query=function(t,e,r){var n=this;this.loadVTLayers();for(var i=t.params||{},o=ei/t.tileSize/t.scale,s=Rr(i.filter),l=t.queryGeometry,c=t.queryPadding*o,u=Gl(l),f=this.grid.query(u.minX-c,u.minY-c,u.maxX+c,u.maxY+c),p=Gl(t.cameraQueryGeometry),h=0,d=this.grid3D.query(p.minX-c,p.minY-c,p.maxX+c,p.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 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,f=c;u=0)return!0;return!1}(i,l)){var c=this.sourceLayerCoder.decode(r),u=this.vtLayers[c].feature(n);if(a(new On(this.tileID.overscaledZ),u))for(var 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+=f.dist(p)}return!0}function Zl(t){for(var e=0,r=0;rc){var d=(c-l)/h,g=ye(f.x,p.x,d),v=ye(f.y,p.y,d),m=new bs(g,v,p.angleTo(f),u);return m._round(),!o||Xl(t,m,s,o,e)?m:void 0}l+=h}}function Ql(t,e,r,n,a,i,o,s,l){var c=Jl(n,i,o),u=Kl(n,a),f=u*o,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-f=0&&_=0&&w=0&&h+u<=f){var k=new bs(_,w,x,g);k._round(),a&&!Xl(e,k,o,a,i)||d.push(k)}}p+=y}return l||d.length||s||(d=t(e,p/2,n,a,i,o,s,!0,c)),d}(t,p?e/2*s%e:(u/2+2*i)*o*s%e,e,c,r,f,p,!1,l)}Yl.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e>l.z,u=new a(l.x*c,l.y*c),f=new a(u.x+c,u.y+c),p=this.segments.prepareSegment(4,r,n);r.emplaceBack(u.x,u.y,u.x,u.y),r.emplaceBack(f.x,u.y,f.x,u.y),r.emplaceBack(u.x,f.y,u.x,f.y),r.emplaceBack(f.x,f.y,f.x,f.y);var h=p.vertexLength;n.emplaceBack(h,h+1,h+2),n.emplaceBack(h+1,h+2,h+3),p.vertexLength+=4,p.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(r,Nl.members),this.maskedIndexBuffer=e.createIndexBuffer(n)}},Yl.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Yl.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Yl.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=A(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),a=!1;if(this.expirationTime>n)a=!1;else if(e)if(this.expirationTime0&&(m=Math.max(10*l,m),this._addLineCollisionCircles(t,e,r,r.segment,y,m,n,i,o,f))}else{if(p){var x=new a(g,h),b=new a(v,h),_=new a(g,d),w=new a(v,d),k=p*Math.PI/180;x._rotate(k),b._rotate(k),_._rotate(k),w._rotate(k),g=Math.min(x.x,b.x,_.x,w.x),v=Math.max(x.x,b.x,_.x,w.x),h=Math.min(x.y,b.y,_.y,w.y),d=Math.max(x.y,b.y,_.y,w.y)}t.emplaceBack(r.x,r.y,g,h,v,d,n,i,o,0,0)}this.boxEndIndex=t.length};tc.prototype._addLineCollisionCircles=function(t,e,r,n,a,i,o,s,l,c){var u=i/2,f=Math.floor(a/u)||1,p=1+.4*Math.log(c)/Math.LN2,h=Math.floor(f*p/2),d=-i/2,g=r,v=n+1,m=d,y=-a/2,x=y-a/4;do{if(--v<0){if(m>y)return;v=0;break}m-=e[v].dist(g),g=e[v]}while(m>x);for(var b=e[v].dist(e[v+1]),_=-h;_a&&(k+=w-a),!(k=e.length)return;b=e[v].dist(e[v+1])}var T=k-m,A=e[v],M=e[v+1].sub(A)._unit()._mult(T)._add(A)._round(),E=Math.abs(k-d)0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function rc(t,e){return te?1:0}function nc(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 f=o-n,p=s-i,h=Math.min(f,p),d=h/2,g=new ec([],ac);if(0===h)return new a(n,i);for(var v=n;vy.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 ic(b.p.x-d,b.p.y-d,d,t)),g.push(new ic(b.p.x+d,b.p.y-d,d,t)),g.push(new ic(b.p.x-d,b.p.y+d,d,t)),g.push(new ic(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 ac(t,e){return e.max-t.max}function ic(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,hi(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}ec.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},ec.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}},ec.prototype.peek=function(){return this.data[0]},ec.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},ec.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 oc=e((function(t){t.exports=function(t,e){var r,n,a,i,o,s,l,c;for(r=3&t.length,n=t.length-r,a=e,o=3432918353,s=461845907,c=0;c>>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}})),sc=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}})),lc=oc,cc=oc,uc=sc;lc.murmur3=cc,lc.murmur2=uc;var fc=7;function pc(t,e){var r=0,n=0,a=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=a-fc;break;case"bottom-right":case"bottom-left":n=-a+fc;break;case"bottom":n=-e+fc;break;case"top":n=e-fc}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]}function hc(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"}var dc=65535;function gc(t,e,r,n,i,o,s,l,c,u,f,p,h){var d=function(t,e,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=e.positionedGlyphs,f=[],p=0;pdc&&w(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===g.kind&&((v=[_s*h.compositeTextSizes[0].evaluate(o,{}),_s*h.compositeTextSizes[1].evaluate(o,{})])[0]>dc||v[1]>dc)&&w(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),t.addSymbols(t.text,d,v,s,i,o,c,e,l.lineStartIndex,l.lineLength);for(var m=0,y=u;m=0;o--)if(n.dist(i[o])at&&(t.getActor().send("enforceCacheSizeLimit",nt),st=0)},t.clamp=c,t.clearTileCache=function(t){var e=self.caches.delete(rt);t&&e.catch(t).then((function(){return t()}))},t.clone=function(t){var e=new ki(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=b,t.config=z,t.create=function(){var t=new ki(16);return ki!=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 ki(9);return ki!=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 ki(4);return ki!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=kr,t.createLayout=Jn,t.createStyleLayer=function(t){return"custom"===t.type?new Vs(t):new Us[t.type](t)},t.deepEqual=o,t.ease=l,t.emitValidationErrors=ln,t.endsWith=m,t.enforceCacheSizeLimit=function(t){self.caches&&self.caches.open(rt).then((function(e){e.keys().then((function(r){for(var n=0;n=ei||c.y<0||c.y>=ei||function(t,e,r,n,i,o,s,l,c,u,f,p,h,d,g,v,m,y,x,b,_){var k,T,A,M=t.addToLineVertexArray(e,r),E=0,S=0,C=0,L={},O=lc(""),P=(o.layout.get("text-radial-offset").evaluate(x,{})||0)*ls;if(t.allowVerticalPlacement&&n.vertical){var I=o.layout.get("text-rotate").evaluate(x,{})+90,D=n.vertical;A=new tc(s,r,e,l,c,u,D,f,p,h,t.overscaling,I)}for(var z in n.horizontal){var R=n.horizontal[z];if(!k){O=lc(R.text);var F=o.layout.get("text-rotate").evaluate(x,{});k=new tc(s,r,e,l,c,u,R,f,p,h,t.overscaling,F)}var B=1===R.lineCount;if(S+=gc(t,e,R,o,h,x,d,M,n.vertical?cs.horizontal:cs.horizontalOnly,B?Object.keys(n.horizontal):[z],L,b,_),B)break}n.vertical&&(C+=gc(t,e,n.vertical,o,h,x,d,M,cs.vertical,["vertical"],L,b,_));var N=k?k.boxStartIndex:t.collisionBoxArray.length,j=k?k.boxEndIndex:t.collisionBoxArray.length,V=A?A.boxStartIndex:t.collisionBoxArray.length,U=A?A.boxEndIndex:t.collisionBoxArray.length;if(i){var H=function(t,e,r,n,i,o){var s,l,c,u,f=e.image,p=r.layout,h=e.top-1/f.pixelRatio,d=e.left-1/f.pixelRatio,g=e.bottom+1/f.pixelRatio,v=e.right+1/f.pixelRatio;if("none"!==p.get("icon-text-fit")&&i){var m=v-d,y=g-h,x=p.get("text-size").evaluate(o,{})/24,b=i.left*x,_=i.right*x,w=i.top*x,k=_-b,T=i.bottom*x-w,A=p.get("icon-text-fit-padding")[0],M=p.get("icon-text-fit-padding")[1],E=p.get("icon-text-fit-padding")[2],S=p.get("icon-text-fit-padding")[3],C="width"===p.get("icon-text-fit")?.5*(T-y):0,L="height"===p.get("icon-text-fit")?.5*(k-m):0,O="width"===p.get("icon-text-fit")||"both"===p.get("icon-text-fit")?k:m,P="height"===p.get("icon-text-fit")||"both"===p.get("icon-text-fit")?T:y;s=new a(b+L-S,w+C-A),l=new a(b+L+M+O,w+C-A),c=new a(b+L+M+O,w+C+E+P),u=new a(b+L-S,w+C+E+P)}else s=new a(d,h),l=new a(v,h),c=new a(v,g),u=new a(d,g);var I=r.layout.get("icon-rotate").evaluate(o,{})*Math.PI/180;if(I){var D=Math.sin(I),z=Math.cos(I),R=[z,-D,D,z];s._matMult(R),l._matMult(R),u._matMult(R),c._matMult(R)}return[{tl:s,tr:l,bl:u,br:c,tex:f.paddedRect,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0}]}(0,i,o,0,vc(n.horizontal),x),q=o.layout.get("icon-rotate").evaluate(x,{});T=new tc(s,r,e,l,c,u,i,g,v,!1,t.overscaling,q),E=4*H.length;var G=t.iconSizeData,W=null;"source"===G.kind?(W=[_s*o.layout.get("icon-size").evaluate(x,{})])[0]>dc&&w(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===G.kind&&((W=[_s*_.compositeIconSizes[0].evaluate(x,{}),_s*_.compositeIconSizes[1].evaluate(x,{})])[0]>dc||W[1]>dc)&&w(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,H,W,y,m,x,!1,e,M.lineStartIndex,M.lineLength)}var Y=T?T.boxStartIndex:t.collisionBoxArray.length,X=T?T.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=Ps.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),t.symbolInstances.emplaceBack(e.x,e.y,L.right>=0?L.right:-1,L.center>=0?L.center:-1,L.left>=0?L.left:-1,L.vertical||-1,O,N,j,V,U,Y,X,l,S,C,E,0,f,P)}(t,c,l,r,n,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,x,k,s,m,b,T,p,e,i,o)};if("line"===A)for(var S=0,C=function(t,e,r,n,i){for(var o=[],s=0;s=n&&p.x>=n||(f.x>=n?f=new a(n,f.y+(p.y-f.y)*((n-f.x)/(p.x-f.x)))._round():p.x>=n&&(p=new a(n,f.y+(p.y-f.y)*((n-f.x)/(p.x-f.x)))._round()),f.y>=i&&p.y>=i||(f.y>=i?f=new a(f.x+(p.x-f.x)*((i-f.y)/(p.y-f.y)),i)._round():p.y>=i&&(p=new a(f.x+(p.x-f.x)*((i-f.y)/(p.y-f.y)),i)._round()),c&&f.equals(c[c.length-1])||(c=[f],o.push(c)),c.push(p)))))}return o}(e.geometry,0,0,ei,ei);S1){var F=$l(R,_,r.vertical||h,n,24,v);F&&E(R,F)}}else if("Polygon"===e.type)for(var B=0,N=mo(e.geometry,0);B=M.maxzoom||"none"!==M.visibility&&(o(A,this.zoom),(d[M.id]=M.createBucket({index:c.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,g),c.bucketLayerIDs.push(A.map((function(t){return t.id}))))}}}var E=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(E).length?n.send("getGlyphs",{uid:this.uid,stacks:E},(function(t,e){u||(u=t,f=e,L.call(s))})):f={};var S=Object.keys(g.iconDependencies);S.length?n.send("getImages",{icons:S},(function(t,e){u||(u=t,p=e,L.call(s))})):p={};var C=Object.keys(g.patternDependencies);function L(){if(u)return i(u);if(f&&p&&h){var e=new a(f),r=new t.ImageAtlas(p,h);for(var n in d){var s=d[n];s instanceof t.SymbolBucket?(o(s.layers,this.zoom),t.performSymbolLayout(s,f,e.positions,p,r.iconPositions,this.showCollisionBoxes)):s.hasPattern&&(s instanceof t.LineBucket||s instanceof t.FillBucket||s instanceof t.FillExtrusionBucket)&&(o(s.layers,this.zoom),s.addFeatures(g,r.patternPositions))}this.status="done",i(null,{buckets:t.values(d).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}C.length?n.send("getImages",{icons:C},(function(t,e){u||(u=t,h=e,L.call(s))})):h={},L.call(this)};var s="undefined"!=typeof performance,l={getEntriesByName:function(t){return!!(s&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(s&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,r){return!!(s&&performance&&performance.measure)&&performance.measure(t,e,r)},clearMarks:function(t){return!!(s&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(s&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},c=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},l.mark(this._marks.start)};function u(e,r){var n=t.getArrayBuffer(e.request,(function(e,n,a,i){e?r(e):n&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(n)),rawData:n,cacheControl:a,expires:i})}));return function(){n.cancel(),r()}}c.prototype.finish=function(){l.mark(this._marks.end);var t=l.getEntriesByName(this._marks.measure);return 0===t.length&&(l.measure(this._marks.measure,this._marks.start,this._marks.end),t=l.getEntriesByName(this._marks.measure),l.clearMarks(this._marks.start),l.clearMarks(this._marks.end),l.clearMeasures(this._marks.measure)),t},l.Performance=c;var f=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||u,this.loading={},this.loaded={}};f.prototype.loadTile=function(e,r){var n=this,a=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new l.Performance(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 f=o.finish();f&&(u.resourceTiming=JSON.parse(JSON.stringify(f)))}s.vectorTile=i.vectorTile,s.parse(i.vectorTile,n.layerIndex,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}))},f.prototype.reloadTile=function(t,e){var r=this.loaded,n=t.uid,a=this;if(r&&r[n]){var i=r[n];i.showCollisionBoxes=t.showCollisionBoxes;var o=function(t,r){var n=i.reloadCallback;n&&(delete i.reloadCallback,i.parse(i.vectorTile,a.layerIndex,a.actor,n)),e(t,r)};"parsing"===i.status?i.reloadCallback=o:"done"===i.status&&(i.vectorTile?i.parse(i.vectorTile,this.layerIndex,this.actor,o):o())}},f.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()},f.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var p=function(){this.loaded={}};p.prototype.loadTile=function(e,r){var n=e.uid,a=e.encoding,i=e.rawImageData,o=new t.DEMData(n,i,a);this.loaded=this.loaded||{},this.loaded[n]=o,r(null,o)},p.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var h={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function d(t){var e=0;if(t&&t.length>0){e+=Math.abs(g(t[0]));for(var r=1;r2){for(o=0;o=0}(t)===e?t:t.reverse()}var _=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,w=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))};w.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function F(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),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);t(e,r,n,Math.max(a,Math.floor(n-l*u/s+f)),Math.min(i,Math.floor(n+(s-l)*u/s+f)),o)}var p=r[2*n+o],h=a,d=i;for(N(e,r,a,n),r[2*i+o]>p&&N(e,r,a,i);hp;)d--}r[2*a+o]===p?N(e,r,a,d):N(e,r,++d,i),d<=n&&(a=d+1),n<=d&&(i=d-1)}}(e,r,s,a,i,o%2),t(e,r,n,a,s-1,o+1),t(e,r,n,s+1,i,o+1)}}(o,s,n,0,o.length-1,0)};q.prototype.range=function(t,e,r,n){return function(t,e,r,n,a,i,o){for(var s,l,c=[0,t.length-1,0],u=[];c.length;){var f=c.pop(),p=c.pop(),h=c.pop();if(p-h<=o)for(var d=h;d<=p;d++)s=e[2*d],l=e[2*d+1],s>=r&&s<=a&&l>=n&&l<=i&&u.push(t[d]);else{var g=Math.floor((h+p)/2);s=e[2*g],l=e[2*g+1],s>=r&&s<=a&&l>=n&&l<=i&&u.push(t[g]);var v=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(h),c.push(g-1),c.push(v)),(0===f?a>=s:i>=l)&&(c.push(g+1),c.push(p),c.push(v))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},q.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(),f=o.pop();if(u-f<=i)for(var p=f;p<=u;p++)V(e[2*p],e[2*p+1],r,n)<=l&&s.push(t[p]);else{var h=Math.floor((f+u)/2),d=e[2*h],g=e[2*h+1];V(d,g,r,n)<=l&&s.push(t[h]);var v=(c+1)%2;(0===c?r-a<=d:n-a<=g)&&(o.push(f),o.push(h-1),o.push(v)),(0===c?r+a>=d:n+a>=g)&&(o.push(h+1),o.push(u),o.push(v))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var G={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,map:function(t){return t}},W=function(t){this.options=Q(Object.create(G),t),this.trees=new Array(this.options.maxZoom+1)};function Y(t,e,r,n,a){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:a}}function X(t,e){var r=t.geometry.coordinates,n=r[0],a=r[1];return{x:K(n),y:$(a),zoom:1/0,index:e,parentId:-1}}function Z(t){return{type:"Feature",id:t.id,properties:J(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 J(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return Q(Q({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function K(t){return t/360+.5}function $(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 Q(t,e){for(var r in e)t[r]=e[r];return t}function tt(t){return t.x}function et(t){return t.y}function rt(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 nt(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)at(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],f=e[n],p=e[n+1],h=r+3;ho)i=h,o=d;else if(d===o){var g=Math.abs(h-s);ga&&(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 lt(t,e,r,n){for(var a=0;a1?1:r}function ft(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 g=[];if("Point"===p||"MultiPoint"===p)pt(f,g,r,n,a);else if("LineString"===p)ht(f,g,r,n,a,!1,s.lineMetrics);else if("MultiLineString"===p)gt(f,g,r,n,a,!1);else if("Polygon"===p)gt(f,g,r,n,a,!0);else if("MultiPolygon"===p)for(var v=0;v=r&&o<=n&&(e.push(t[i]),e.push(t[i+1]),e.push(t[i+2]))}}function ht(t,e,r,n,a,i,o){for(var s,l,c=dt(t),u=0===a?mt:yt,f=t.start,p=0;pr&&(l=u(c,h,d,v,m,r),o&&(c.start=f+s*l)):y>n?x=r&&(l=u(c,h,d,v,m,r),b=!0),x>n&&y<=n&&(l=u(c,h,d,v,m,n),b=!0),!i&&b&&(o&&(c.end=f+s*l),e.push(c),c=dt(t)),o&&(f+=s)}var _=t.length-3;h=t[_],d=t[_+1],g=t[_+2],(y=0===a?h:d)>=r&&y<=n&&vt(c,h,d,g),_=c.length-3,i&&_>=3&&(c[_]!==c[0]||c[_+1]!==c[1])&&vt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function dt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function gt(t,e,r,n,a,i){for(var o=0;oo.maxX&&(o.maxX=u),f>o.maxY&&(o.maxY=f)}return o}function Tt(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 q(s,tt,et,i,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},W.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,f=l.range(K(r),$(i),K(a),$(n));u>5,r=t%32,n="No cluster with the specified id.",a=this.trees[r];if(!a)throw new Error(n);var i=a.points[e];if(!i)throw new Error(n);for(var o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,c=a.within(i.x,i.y,o);l1?this._map(c,!0):null,v=(l<<5)+(e+1),m=0,y=f;m1&&console.time("creation"),p=this.tiles[f]=kt(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,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var h="z"+e;this.stats[h]=(this.stats[h]||0)+1,this.total++}if(p.source=t,a){if(e===l.maxZoom||e===a)continue;var d=1<1&&console.time("clipping");var g,v,m,y,x,b,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,T=1+_;g=v=m=y=null,x=ft(t,u,r-_,r+k,0,p.minX,p.maxX,l),b=ft(t,u,r+w,r+T,0,p.minX,p.maxX,l),t=null,x&&(g=ft(x,u,n-_,n+k,1,p.minY,p.maxY,l),v=ft(x,u,n+w,n+T,1,p.minY,p.maxY,l),x=null),b&&(m=ft(b,u,n-_,n+k,1,p.minY,p.maxY,l),y=ft(b,u,n+w,n+T,1,p.minY,p.maxY,l),b=null),c>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(v||[],e+1,2*r,2*n+1),s.push(m||[],e+1,2*r+1,2*n),s.push(y||[],e+1,2*r+1,2*n+1)}}},Mt.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,f=r;!l&&c>0;)c--,u=Math.floor(u/2),f=Math.floor(f/2),l=this.tiles[Et(c,u,f)];return l&&l.source?(i>1&&console.log("found parent tile z%d-%d-%d",c,u,f),i>1&&console.time("drilling down"),this.splitTile(l.source,c,u,f,t,e,r),i>1&&console.timeEnd("drilling down"),this.tiles[s]?_t(this.tiles[s],a):null):null};var Ct=function(e){function r(t,r,n){e.call(this,t,r,St),n&&(this.loadGeoJSON=n)}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 l.Performance(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."));!function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(y(t,r)),e;case"GeometryCollection":return e.geometries=e.geometries.map(y(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=x(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(y(x,e))),t}(e,r);default:return e}}(o,!0);try{e._geoJSONIndex=n.cluster?new W(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 p=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 m(t,e,r,n,a,i,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));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]);for(var a=0,o=l;athis.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};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),O=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("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,t.rasterBoundsAttributes.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}(O),I=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,t.rasterBoundsAttributes.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.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};var j=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};j.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},j.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},j.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var V={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},U=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var a=t.gl;this.buffer=a.createBuffer(),t.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};U.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},U.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},U.prototype.enableAttributes=function(t,e){for(var r=0;r1||(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.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},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){for(var r=t.overscaledZ-1;r>=e;r--){var n=t.scaledTo(r);if(!n)return;var a=String(n.key),i=this._tiles[a];if(i&&i.hasData())return i;if(this._cache.has(n))return this._cache.get(n)}},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=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),o=Math.max(i-r.maxOverzooming,this._source.minzoom),s=Math.max(i+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(a,i);if(Pt(this._source.type)){for(var c={},u={},f=0,p=Object.keys(l);fthis._source.maxzoom){var v=d.children(this._source.maxzoom)[0],m=this.getTile(v);if(m&&m.hasData()){n[v.key]=v;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>=i;--b){var _=d.scaledTo(b);if(a[_.key])break;if(a[_.key]=!0,!(g=this.getTile(_))&&x&&(g=this._addTile(_)),g&&(n[_.key]=_,x=g.wasRequested(),g.hasData()))break}}}return n},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var n=Boolean(r);return n||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(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(),f=1/0,p=1/0,h=-1/0,d=-1/0,g=0,v=c;g=0&&m[1].y+v>=0){var y=l.map((function(t){return s.getTilePoint(t)})),x=c.map((function(t){return s.getTilePoint(t)}));i.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}(t.Evented);function Ot(t,e){return t%32-e%32||e-t}function Pt(t){return"raster"===t||"image"===t||"video"===t}function It(){return new t.window.Worker(Qn.workerUrl)}Lt.maxOverzooming=10,Lt.maxUnderzooming=3;var Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function $t(e,r,n,a,i,o,s,l){var c=a?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),f=[256/n.width*2+1,256/n.height*2+1],p=a?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var h=e.lineVertexArray,d=a?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height,v=!1,m=0;mMath.abs(n.x-r.x)*a?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function ee(e,r,n,a,i,o,s,l,c,u,f,p,h,d){var g,v=r/24,m=e.lineOffsetX*v,y=e.lineOffsetY*v;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,_=e.lineStartIndex+e.lineLength,w=Qt(v,l,m,y,n,f,p,e,c,o,h,!1);if(!w)return{notEnoughRoom:!0};var k=Jt(w.first.point,s).point,T=Jt(w.last.point,s).point;if(a&&!n){var A=te(e.writingMode,k,T,d);if(A)return A}g=[w.first];for(var M=e.glyphStartIndex+1;M0?L.point:re(p,C,E,1,i),P=te(e.writingMode,E,O,d);if(P)return P}var I=ne(v*l.getoffsetX(e.glyphStartIndex),m,y,n,f,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,h,!1);if(!I)return{notEnoughRoom:!0};g=[I]}for(var D=0,z=g;D0?1:-1,v=0;a&&(g*=-1,v=Math.PI),g<0&&(v+=Math.PI);for(var m=g>0?l+s:l+s+1,y=m,x=i,b=i,_=0,w=0,k=Math.abs(d);_+w<=k;){if((m+=g)=c)return null;if(b=x,void 0===(x=p[m])){var T=new t.Point(u.getx(m),u.gety(m)),A=Jt(T,f);if(A.signedDistanceFromCamera>0)x=p[m]=A.point;else{var M=m-g;x=re(0===_?o:new t.Point(u.getx(M),u.gety(M)),T,b,k-_+1,f)}}_+=w,w=b.dist(x)}var E=(k-_)/w,S=x.sub(b),C=S.mult(E)._add(b);return C._add(S._unit()._perp()._mult(n*g)),{point:C,angle:v+Math.atan2(x.y-b.y,x.x-b.x),tileDistance:h?{prevTileDistance:m-g===y?0:u.gettileUnitDistanceFromAnchor(m-g),lastSegmentViewportDistance:k-_}:null}}Yt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Yt.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)},Yt.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)},Yt.prototype._insertBoxCell=function(t,e,r,n,a,i){this.boxCells[a].push(i)},Yt.prototype._insertCircleCell=function(t,e,r,n,a,i){this.circleCells[a].push(i)},Yt.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},Yt.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},Yt.prototype.query=function(t,e,r,n,a){return this._query(t,e,r,n,!1,a)},Yt.prototype.hitTest=function(t,e,r,n,a){return this._query(t,e,r,n,!0,a)},Yt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Yt.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,f=0,p=c;f=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 g=this.circleCells[a];if(null!==g)for(var v=this.circles,m=0,y=g;mo*o+s*s},Yt.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 f=l-s,p=u-c;return f*f+p*p<=r*r};var ae=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ie(t,e){for(var r=0;rE)le(e,S,!1);else{var I=this.projectPoint(c,C,L),D=O*T;if(d.length>0){var z=I.x-d[d.length-4],R=I.y-d[d.length-3];if(D*D*2>z*z+R*R&&S+8-M&&F=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},se.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&&(v=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={radialOffset:i,width:n,height:a,anchor:e,textBoxScale:o,prevAnchor:v},this.markUsedJustification(d,e,h,g),d.allowVerticalPlacement&&(this.markUsedOrientation(d,g,h),this.placedOrientations[h.crossTileID]=g),y},ve.prototype.placeLayerBucket=function(e,r,n,a,i,o,s,l,c,u){var f=this,p=e.layers[0].layout,h=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom),d=p.get("text-optional"),g=p.get("icon-optional"),v=p.get("text-allow-overlap"),m=p.get("icon-allow-overlap"),y=v&&(m||!e.hasIconData()||g),x=m&&(v||!e.hasTextData()||d),b=this.collisionGroups.get(e.sourceID),_="map"===p.get("text-rotation-alignment"),w="map"===p.get("text-pitch-alignment"),k="viewport-y"===p.get("symbol-z-order");!e.collisionArrays&&u&&e.deserializeCollisionBoxes(u);var T=function(a,u){if(!c[a.crossTileID])if(l)f.placements[a.crossTileID]=new pe(!1,!1,!1);else{var m,k=!1,T=!1,A=!0,M={box:null,offscreen:null},E={box:null,offscreen:null},S=null,C=null,L=0,O=0,P=0;u.textFeatureIndex&&(L=u.textFeatureIndex),u.verticalTextFeatureIndex&&(O=u.verticalTextFeatureIndex);var I=u.textBox;if(I){var D=function(r){var n=t.WritingMode.horizontal;if(e.allowVerticalPlacement&&!r&&f.prevPlacement){var i=f.prevPlacement.placedOrientations[a.crossTileID];i&&(f.placedOrientations[a.crossTileID]=i,n=i,f.markUsedOrientation(e,n,a))}return n},z=function(r,n){if(e.allowVerticalPlacement&&a.numVerticalGlyphVertices>0&&u.verticalTextBox)for(var i=0,o=e.writingModes;i0&&(R=R.filter((function(t){return t!==F.anchor}))).unshift(F.anchor)}var B=function(t,n){for(var i=t.x2-t.x1,s=t.y2-t.y1,l=a.textBoxScale,c={box:[],offscreen:!1},u=v?2*R.length:R.length,p=0;p=R.length;if((c=f.attemptAnchorPlacement(h,t,i,s,a.radialTextOffset,l,_,w,o,r,b,d,a,e,n))&&c.box&&c.box.length){k=!0;break}}return c};z((function(){return B(I,t.WritingMode.horizontal)}),(function(){var r=u.verticalTextBox,n=M&&M.box&&M.box.length;return e.allowVerticalPlacement&&!n&&a.numVerticalGlyphVertices>0&&r?B(r,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(k=M.box,A=M.offscreen);var N=D(M&&M.box);if(!k&&f.prevPlacement){var j=f.prevPlacement.variableOffsets[a.crossTileID];j&&(f.variableOffsets[a.crossTileID]=j,f.markUsedJustification(e,j.anchor,a,N))}}else{var V=function(t,n){var i=f.collisionIndex.placeCollisionBox(t,p.get("text-allow-overlap"),o,r,b.predicate);return i&&i.box&&i.box.length&&(f.markUsedOrientation(e,n,a),f.placedOrientations[a.crossTileID]=n),i};z((function(){return V(I,t.WritingMode.horizontal)}),(function(){var r=u.verticalTextBox;return e.allowVerticalPlacement&&a.numVerticalGlyphVertices>0&&r?V(r,t.WritingMode.vertical):{box:null,offscreen:null}})),D(M&&M.box&&M.box.length)}}k=(m=M)&&m.box&&m.box.length>0,A=m&&m.offscreen;var U=u.textCircles;if(U){var H=e.text.placedSymbolArray.get(a.centerJustifiedTextSymbolIndex),q=t.evaluateSizeForFeature(e.textSizeData,h,H);S=f.collisionIndex.placeCollisionCircles(U,p.get("text-allow-overlap"),i,o,H,e.lineVertexArray,e.glyphOffsetArray,q,r,n,s,w,b.predicate),k=p.get("text-allow-overlap")||S.circles.length>0,A=A&&S.offscreen}u.iconFeatureIndex&&(P=u.iconFeatureIndex),u.iconBox&&(T=(C=f.collisionIndex.placeCollisionBox(u.iconBox,p.get("icon-allow-overlap"),o,r,b.predicate)).box.length>0,A=A&&C.offscreen);var G=d||0===a.numHorizontalGlyphVertices&&0===a.numVerticalGlyphVertices,W=g||0===a.numIconVertices;G||W?W?G||(T=T&&k):k=T&&k:T=k=T&&k,k&&m&&m.box&&(E&&E.box&&O?f.collisionIndex.insertCollisionBox(m.box,p.get("text-ignore-placement"),e.bucketInstanceId,O,b.ID):f.collisionIndex.insertCollisionBox(m.box,p.get("text-ignore-placement"),e.bucketInstanceId,L,b.ID)),T&&C&&f.collisionIndex.insertCollisionBox(C.box,p.get("icon-ignore-placement"),e.bucketInstanceId,P,b.ID),k&&S&&f.collisionIndex.insertCollisionCircles(S.circles,p.get("text-ignore-placement"),e.bucketInstanceId,L,b.ID),f.placements[a.crossTileID]=new pe(k||y,T||x,A||e.justReloaded),c[a.crossTileID]=!0}};if(k)for(var A=e.getSortedSymbolIndexes(this.transform.angle),M=A.length-1;M>=0;--M){var E=A[M];T(e.symbolInstances.get(E),e.collisionArrays[E])}else for(var S=0;S=0&&(e.text.placedSymbolArray.get(c).crossTileID=i>=0&&c!==i?0:n.crossTileID)}},ve.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||g>0,b=h.numIconVertices>0;if(x){for(var _=Ae(y.text),w=(d+g)/4,k=0;k=0&&(e.text.placedSymbolArray.get(t).hidden=T||E)})),h.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(h.verticalPlacedTextSymbolIndex).hidden=T||M);var S=this.variableOffsets[h.crossTileID];S&&this.markUsedJustification(e,S.anchor,h,A);var C=this.placedOrientations[h.crossTileID];C&&(this.markUsedJustification(e,"left",h,C),this.markUsedOrientation(e,C,h))}if(b){for(var L=Ae(y.icon),O=0;Ot},ve.prototype.setStale=function(){this.stale=!0};var ye=Math.pow(2,25),xe=Math.pow(2,24),be=Math.pow(2,17),_e=Math.pow(2,16),we=Math.pow(2,9),ke=Math.pow(2,8),Te=Math.pow(2,1);function Ae(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*ye+e*xe+r*be+e*_e+r*we+e*ke+r*Te+e}var Me=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};Me.prototype.continuePlacement=function(t,e,r,n,a){for(;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 Me),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ee.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Se=512/t.EXTENT/2,Ce=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,f=l.x,p=l.y,h=l.sdf,d=l.pixelRatio,g=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,g,{x:f,y:p},{x:0,y:0},{width:c,height:u}),r[s]={data:g,pixelRatio:d,sdf:h}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e.sprite,this.map._requestManager,(function(e,r){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(r)for(var a in r)n.imageManager.addImage(a,r[a]);n.imageManager.setLoaded(!0),n.fire(new t.Event("data",{dataType:"style"}))})):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var i=Bt(this.stylesheet.layers);this._order=i.map((function(t){return t.id})),this._layers={};for(var o=0,s=i;o0)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.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.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 Lt(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(Ie(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}})}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._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.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],o=parseInt(e.id,10);if(void 0!==i){var s=i.getSource().type;"geojson"===s&&a?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||a?isNaN(o)||o<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):i.setFeatureState(a,o,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,s=parseInt(e.id,10);"vector"!==i||o?void 0!==e.id&&isNaN(s)||s<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be non-negative."))):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,s,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],i=parseInt(e.id,10);if(void 0!==a)if("vector"!==a.getSource().type||n){if(!(isNaN(i)||i<0))return a.getFeatureState(n,i);this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")))}else 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]&&(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 g=this._order[d];if(r(g))for(var v=a.length-1;v>=0;v--){var m=a[v].feature;if(n[m.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;}"),We=cr("uniform float u_overscale_factor;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {float alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {color=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {color*=.2;}float extrude_scale_length=length(v_extrude_scale);float extrude_length=length(v_extrude)*extrude_scale_length;float stroke_width=15.0*extrude_scale_length/u_overscale_factor;float radius=v_radius*extrude_scale_length;float distance_to_edge=abs(extrude_length-radius);float opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);gl_FragColor=opacity_t*color;}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;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);highp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;v_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;v_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;}"),Ye=cr("uniform highp vec4 u_color;void main() {gl_FragColor=u_color;}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Xe=cr("#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);}"),Ze=cr("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;}"),Je=cr("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 vec4 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\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;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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;}"),Ke=cr("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 vec4 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\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;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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);}"),$e=cr("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;}"),Qe=cr("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\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\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 vec4 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\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\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 pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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;}"),tr=cr("#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;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;return (data.r+data.g*256.0+data.b*256.0*256.0)/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;}"),er=cr("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;}"),rr=cr("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);}"),nr=cr("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);}"),ar=cr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec4 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_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 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 pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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 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,1.0);float x_b=mod(v_linesofar/pattern_size_b.x,1.0);float y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);float y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);vec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));vec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));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;\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 vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_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 mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_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);}"),ir=cr("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);}"),or=cr("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;}"),sr=cr("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 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;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[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} 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),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));}"),lr=cr("#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 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;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[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} 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),0.0,1.0);float gamma_scale=gl_Position.w;vec2 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;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=vec2(tex.x,tex.y);v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}");function cr(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 ur=Object.freeze({prelude:Be,background:Ne,backgroundPattern:je,circle:Ve,clippingMask:Ue,heatmap:He,heatmapTexture:qe,collisionBox:Ge,collisionCircle:We,debug:Ye,fill:Xe,fillOutline:Ze,fillOutlinePattern:Je,fillPattern:Ke,fillExtrusion:$e,fillExtrusionPattern:Qe,hillshadePrepare:tr,hillshade:er,line:rr,lineGradient:nr,linePattern:ar,lineSDF:ir,raster:or,symbolIcon:sr,symbolSDF:lr}),fr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};fr.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,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}pr.prototype.draw=function(t,e,r,n,a,i,o,s,l,c,u,f,p,h,d,g){var v,m=t.gl;for(var y in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(a),t.setCullFace(i),this.fixedUniforms)this.fixedUniforms[y].set(o[y]);h&&h.setUniforms(t,this.binderUniforms,f,{zoom:p});for(var x=(v={},v[m.LINES]=2,v[m.TRIANGLES]=3,v[m.LINE_STRIP]=1,v)[e],b=0,_=u.get();b<_.length;b+=1){var w=_[b],k=w.vaos||(w.vaos={});(k[s]||(k[s]=new fr)).bind(t,this,l,h?h.getPaintVertexBuffers():[],c,w.vertexOffset,d,g),m.drawElements(e,w.primitiveLength*x,m.UNSIGNED_SHORT,w.primitiveOffset*x*2)}};var dr=function(e,r,n,a){var i=r.style.light,o=i.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===i.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var c=i.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:i.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:a}},gr=function(e,r,n,a,i,o,s){return t.extend(dr(e,r,n,a),hr(o,r,s),{u_height_factor:-Math.pow(2,i.overscaledZ)/s.tileSize/8})},vr=function(t){return{u_matrix:t}},mr=function(e,r,n,a){return t.extend(vr(e),hr(n,r,a))},yr=function(t,e){return{u_matrix:t,u_world:e}},xr=function(e,r,n,a,i){return t.extend(mr(e,r,n,a),{u_world:i})},br=function(e,r,n,a){var i,o,s=e.transform;if("map"===a.paint.get("circle-pitch-alignment")){var l=ce(n,1,s.zoom);i=!0,o=[l,l]}else i=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===a.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+i,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},_r=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)}},wr=function(t,e,r){var n=ce(r,1,e.zoom),a=Math.pow(2,e.zoom-r.tileID.overscaledZ),i=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*a),e.pixelsToGLUnits[1]/(n*a)],u_overscale_factor:i}},kr=function(t,e){return{u_matrix:t,u_color:e}},Tr=function(t){return{u_matrix:t}},Ar=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:ce(e,1,r),u_intensity:n}},Mr=function(t,e,r){var n=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),i=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=t.transform.angle);var s=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),s),u_image:0,u_latrange:Sr(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:a,u_accent:i}},Er=function(e,r){var n=e.dem.stride,a=t.create();return t.ortho(a,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(a,a,[0,-t.EXTENT,0]),{u_matrix:a,u_image:1,u_dimension:[n,n],u_zoom:e.tileID.overscaledZ,u_maxzoom:r}};function Sr(e,r){var n=Math.pow(2,r.canonical.z),a=r.canonical.y;return[new t.MercatorCoordinate(0,a/n).toLngLat().lat,new t.MercatorCoordinate(0,(a+1)/n).toLngLat().lat]}var Cr=function(e,r,n){var a=e.transform;return{u_matrix:Dr(e,r,n),u_ratio:1/ce(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Lr=function(e,r,n){return t.extend(Cr(e,r,n),{u_image:0})},Or=function(e,r,n,a){var i=e.transform,o=Ir(r,i);return{u_matrix:Dr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/ce(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[t.browser.devicePixelRatio,o,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Pr=function(e,r,n,a,i){var o=e.transform,s=e.lineAtlas,l=Ir(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(a.from,c),f=s.getDash(a.to,c),p=u.width*i.fromScale,h=f.width*i.toScale;return t.extend(Cr(e,r,n),{u_patternscale_a:[l/p,-u.height/2],u_patternscale_b:[l/h,-f.height/2],u_sdfgamma:s.width/(256*Math.min(p,h)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:f.y,u_mix:i.t})};function Ir(t,e){return 1/ce(t,1,e.tileZoom)}function Dr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var zr=function(t,e,r,n,a){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*a.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:a.paint.get("raster-brightness-min"),u_brightness_high:a.paint.get("raster-brightness-max"),u_saturation_factor:(o=a.paint.get("raster-saturation"),o>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:Rr(a.paint.get("raster-hue-rotate"))};var i,o};function Rr(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 Fr=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}},Br=function(e,r,n,a,i,o,s,l,c,u,f){var p=i.transform;return t.extend(Fr(e,r,n,a,i,o,s,l,c,u),{u_gamma_scale:a?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+f})},Nr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},jr=function(e,r,n,a,i,o){return t.extend(function(t,e,r,n){var a=r.imageManager.getPattern(t.from),i=r.imageManager.getPattern(t.to),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),p=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/ce(n,1,r.transform.tileZoom),u_pixel_coord_upper:[f>>16,p>>16],u_pixel_coord_lower:[65535&f,65535&p]}}(a,o,n,i),{u_matrix:e,u_opacity:r})},Vr={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.Uniform4f(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.Uniform4f(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.Uniform4f(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:_r,collisionCircle:_r,debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},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)}},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.Uniform4f(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.Uniform1f(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.Uniform1f(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.Uniform1f(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 Ur(e,r){for(var n=e.sort((function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0})),a=0;a0){var s=t.browser.now(),l=(s-e.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),f=i.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-f)>Math.abs(e.tileID.overscaledZ-f),h=p&&e.refreshedUponExpiration?1:t.clamp(p?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}}function rn(e,r,n){var a=e.context,i=a.gl,o=n.posMatrix,s=e.useProgram("debug"),l=At.disabled,c=Mt.disabled,u=e.colorModeForRenderPass(),f="$debug";s.draw(a,i.LINE_STRIP,l,c,u,St.disabled,kr(o,t.Color.red),f,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);for(var p=r.getTileByID(n.key).latestRawTileData,h=p&&p.byteLength||0,d=Math.floor(h/1024),g=r.getTile(n).tileSize,v=512/Math.min(g,512),m=function(t,e,r,n){n=n||1;var a,i,o,s,l,c,u,f,p=[];for(a=0,i=t.length;a":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},an={symbol:function(t,e,r,n,a){if("translucent"===t.renderPass){var i=Mt.disabled,o=t.colorModeForRenderPass();0!==r.paint.get("icon-opacity").constantOr(1)&&Zr(t,e,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),i,o,a),0!==r.paint.get("text-opacity").constantOr(1)&&Zr(t,e,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),i,o,a),e.map.showCollisionBoxes&&function(t,e,r,n){qr(t,e,r,n,!1),qr(t,e,r,n,!0)}(t,e,r,n)}},circle:function(e,r,n,a){if("translucent"===e.renderPass){var i=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==i.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var c=e.context,u=c.gl,f=e.depthModeForSublayer(0,At.ReadOnly),p=Mt.disabled,h=e.colorModeForRenderPass(),d=[],g=0;ge.y){var r=t;t=e,e=r}return{x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function ln(t,e,r,n,a){var i=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,p=i;pl.dy&&(o=s,s=l,l=o),s.dy>c.dy&&(o=s,s=c,c=o),l.dy>c.dy&&(o=l,l=c,c=o),s.dy&&ln(c,s,n,a,i),l.dy&&ln(c,l,n,a,i)}on.prototype.resize=function(e,r){var n=this.context.gl;if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var a=0,i=this.style._order;a256&&this.clearStencil(),r.setColorMode(Et.disabled),r.setDepthMode(At.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 Mt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},on.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)},on.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Et([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Et.unblended:Et.alphaBlended},on.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return At.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new At(r||this.context.gl.LEQUAL,e,[n,n])},on.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer=0;this.currentLayer--){var M=this.style._layers[n[this.currentLayer]],E=a[M.source],S=s[M.source];this._renderTileClippingMasks(M,S),this.renderLayer(this,E,M,S)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},on.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from),r=this.imageManager.getPattern(t.to);return!e||!r},on.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new pr(this.context,ur[t],e,Vr[t],this._showOverdrawInspector)),this.cache[r]},on.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()},on.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)};var un=function(e,r,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=e||0,this._maxZoom=r||22,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._posMatrixCache={},this._alignedPosMatrixCache={}},fn={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};un.prototype.clone=function(){var t=new un(this._minZoom,this._maxZoom,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._calcMatrices(),t},fn.minZoom.get=function(){return this._minZoom},fn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},fn.maxZoom.get=function(){return this._maxZoom},fn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},fn.renderWorldCopies.get=function(){return this._renderWorldCopies},fn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},fn.worldSize.get=function(){return this.tileSize*this.scale},fn.centerPoint.get=function(){return this.size._div(2)},fn.size.get=function(){return new t.Point(this.width,this.height)},fn.bearing.get=function(){return-this.angle/Math.PI*180},fn.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))},fn.pitch.get=function(){return this._pitch/Math.PI*180},fn.pitch.set=function(e){var r=t.clamp(e,0,60)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},fn.fov.get=function(){return this._fov/Math.PI*180},fn.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())},fn.zoom.get=function(){return this._zoom},fn.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())},fn.center.get=function(){return this._center},fn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},un.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},un.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},un.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=new t.Point(i*a.x-.5,i*a.y-.5);return function(e,r,n,a){void 0===a&&(a=!0);var i=1<=0&&l<=i)for(c=r;co&&(a=o-v)}if(this.lngRange){var m=h.x,y=c.x/2;m-yl&&(n=l-y)}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}},un.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,r=Math.PI/2+this._pitch,n=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-r-e),a=this.point,i=a.x,o=a.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,l,s),t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-i,-o,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c;var u=this.width%2/2,f=this.height%2/2,p=Math.cos(this.angle),h=Math.sin(this.angle),d=i-Math.round(i)+p*u+h*f,g=o-Math.round(o)+p*f+h*u,v=new Float64Array(c);if(t.translate(v,v,[d>.5?d-1:d,g>.5?g-1:g,0]),this.alignedProjMatrix=v,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},un.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},un.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},un.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&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},pn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var hn=function(e){function n(n,a,i,o){void 0===o&&(o={});var s=r.mousePos(a.getCanvasContainer(),i),l=a.unproject(s);e.call(this,n,t.extend({point:s,lngLat:l,originalEvent:i},o)),this._defaultPrevented=!1,this.target=a}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var a={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},a.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,a),n}(t.Event),dn=function(e){function n(n,a,i){var o=r.touchPos(a.getCanvasContainer(),i),s=o.map((function(t){return a.unproject(t)})),l=o.reduce((function(t,e,r,n){return t.add(e.div(n.length))}),new t.Point(0,0)),c=a.unproject(l);e.call(this,n,{points:o,point:l,lngLats:s,lngLat:c,originalEvent:i}),this._defaultPrevented=!1}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var a={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},a.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,a),n}(t.Event),gn=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),vn=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};vn.prototype.setZoomRate=function(t){this._defaultZoomRate=t},vn.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},vn.prototype.isEnabled=function(){return!!this._enabled},vn.prototype.isActive=function(){return!!this._active},vn.prototype.isZooming=function(){return!!this._zooming},vn.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},vn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},vn.prototype.onWheel=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.isActive()||this._start(e)),e.preventDefault()}},vn.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},vn.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e}))),this._finishTimeout&&clearTimeout(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=this._map._requestRenderFrame(this._onScrollFrame))}},vn.prototype._onScrollFrame=function(){var e=this;if(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="number"==typeof this._targetZoom?this._targetZoom:r.zoom,s=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&s&&l){var u=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=l(u);r.zoom=t.number(s,o,f),u<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):c=!0}else r.zoom=o,c=!0;r.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom}),200))}},vn.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};var mn=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};mn.prototype.isEnabled=function(){return!!this._enabled},mn.prototype.isActive=function(){return!!this._active},mn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},mn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},mn.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),r.disableDrag(),this._startPos=this._lastPos=r.mousePos(this._el,e),this._active=!0)},mn.prototype._onMouseMove=function(t){var e=r.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)180&&(h=180);var d=h/180;c+=f*h*(d/2),Math.abs(r._normalizeBearing(c,0))0&&r-e[0][0]>160;)e.shift()};var bn=t.bezier(0,0,.3,1),_n=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=r.clickTolerance||1,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};_n.prototype.isEnabled=function(){return"disabled"!==this._state},_n.prototype.isActive=function(){return"active"===this._state},_n.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},_n.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},_n.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==r.mouseButton(e)||(r.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),r.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)))},_n.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(r.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),r.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)))},_n.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=r.mousePos(this._el,e),this._inertia=[[t.browser.now(),this._startPos]]},_n.prototype._onMove=function(e){e.preventDefault();var n=r.mousePos(this._el,e);this._lastPos.equals(n)||"pending"===this._state&&n.dist(this._mouseDownPos)1400&&(s=1400,o._unit()._mult(s));var l=s/750,c=o.mult(-l/2);this._map.panBy(c,{duration:1e3*l,easing:bn,noMoveStart:!0},{originalEvent:t})}}},_n.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},_n.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>0&&r-e[0][0]>160;)e.shift()};var wn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function kn(t){return t*(2-t)}wn.prototype.isEnabled=function(){return!!this._enabled},wn.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},wn.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},wn.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,n=0,a=0,i=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),i=-1);break;case 40:t.shiftKey?n=-1:(i=1,t.preventDefault());break;default:return}var o=this._map,s=o.getZoom(),l={duration:300,delayEndEvents:500,easing:kn,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:o.getBearing()+15*r,pitch:o.getPitch()+10*n,offset:[100*-a,100*-i],center:o.getCenter()};o.easeTo(l,{originalEvent:t})}};var Tn=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};Tn.prototype.isEnabled=function(){return!!this._enabled},Tn.prototype.isActive=function(){return!!this._active},Tn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Tn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Tn.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var r=t.points[0],n=this._tappedPoint;if(n&&n.dist(r)<=30){t.originalEvent.preventDefault();var a=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",i),e._resetTapped()},i=function(){e._map.off("touchend",a),e._resetTapped()};this._map.once("touchend",a),this._map.once("touchcancel",i)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout((function(){e._tapped=null,e._tappedPoint=null}),300)},Tn.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},Tn.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},Tn.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},Tn.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var An=t.bezier(0,0,.15,1),Mn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};Mn.prototype.isEnabled=function(){return!!this._enabled},Mn.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},Mn.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},Mn.prototype.disableRotation=function(){this._rotationDisabled=!0},Mn.prototype.enableRotation=function(){this._rotationDisabled=!1},Mn.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var n=r.mousePos(this._el,e.touches[0]),a=r.mousePos(this._el,e.touches[1]),i=n.add(a).div(2);this._startVec=n.sub(a),this._startAround=this._map.transform.pointLocation(i),this._gestureIntent=void 0,this._inertia=[],r.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.addEventListener(t.window.document,"touchend",this._onEnd)}},Mn.prototype._getTouchEventData=function(t){var e=r.mousePos(this._el,t.touches[0]),n=r.mousePos(this._el,t.touches[1]),a=e.sub(n);return{vec:a,center:e.add(n).div(2),scale:a.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI}},Mn.prototype._onMove=function(e){if(2===e.touches.length){var r=this._getTouchEventData(e),n=r.vec,a=r.scale,i=r.bearing;if(!this._gestureIntent){var o=this._rotationDisabled&&1!==a||Math.abs(1-a)>.15;Math.abs(i)>10?this._gestureIntent="rotate":o&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=n)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},Mn.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var r=this._map.transform;this._startScale||(this._startScale=r.scale,this._startBearing=r.bearing);var n=this._getTouchEventData(this._lastTouchEvent),a=n.center,i=n.bearing,o=n.scale,s=r.pointLocation(a),l=r.locationPoint(s);"rotate"===e&&(r.bearing=this._startBearing+i),r.zoom=r.scaleZoom(this._startScale*o),r.setLocationAtPoint(this._startAround,l),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),o,a])}},Mn.prototype._onEnd=function(e){r.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.removeEventListener(t.window.document,"touchend",this._onEnd);var n=this._gestureIntent,a=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,n){this._map.fire(new t.Event(n+"end",{originalEvent:e})),this._drainInertiaBuffer();var i=this._inertia,o=this._map;if(i.length<2)o.snapToNorth({},{originalEvent:e});else{var s=i[i.length-1],l=i[0],c=o.transform.scaleZoom(a*s[1]),u=o.transform.scaleZoom(a*l[1]),f=c-u,p=(s[0]-l[0])/1e3,h=s[2];if(0!==p&&c!==u){var d=.15*f/p;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var g=1e3*Math.abs(d/(12*.15)),v=c+d*g/2e3;v<0&&(v=0),o.easeTo({zoom:v,duration:g,easing:An,around:this._aroundCenter?o.getCenter():o.unproject(h),noMoveStart:!0},{originalEvent:e})}else o.snapToNorth({},{originalEvent:e})}}},Mn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>2&&r-e[0][0]>160;)e.shift()};var En={scrollZoom:vn,boxZoom:mn,dragRotate:xn,dragPan:_n,keyboard:wn,doubleClickZoom:Tn,touchZoomRotate:Mn},Sn=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())e?1:0})),["bottom","left","right","top"])){var o=this.transform,s=o.project(t.LngLat.convert(e)),l=o.project(t.LngLat.convert(r)),c=s.rotate(-n*Math.PI/180),u=l.rotate(-n*Math.PI/180),f=new t.Point(Math.max(c.x,u.x),Math.max(c.y,u.y)),p=new t.Point(Math.min(c.x,u.x),Math.min(c.y,u.y)),h=f.sub(p),d=(o.width-a.padding.left-a.padding.right)/h.x,g=(o.height-a.padding.top-a.padding.bottom)/h.y;if(!(g<0||d<0)){var v=Math.min(o.scaleZoom(o.scale*Math.min(d,g)),a.maxZoom),m=t.Point.convert(a.offset),y=(a.padding.left-a.padding.right)/2,x=(a.padding.top-a.padding.bottom)/2,b=new t.Point(m.x+y,m.y+x).mult(o.scale/o.zoomScale(v));return{center:o.unproject(s.add(l).div(2).sub(b)),zoom:v,bearing:n}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,n,a,i){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),n,a),a,i)},r.prototype._fitInternal=function(e,r,n){return e?(r=t.extend(e,r)).linear?this.easeTo(r,n):this.flyTo(r,n):this},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,a=!1,i=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(a=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(i=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),a&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),i&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),o&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this.stop(),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||t.browser.prefersReducedMotion)&&(e.duration=0);var a=this.transform,i=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?+e.zoom:i,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,u="pitch"in e?+e.pitch:s,f=a.centerPoint.add(t.Point.convert(e.offset)),p=a.pointLocation(f),h=t.LngLat.convert(e.center||p);this._normalizeCenter(h);var d,g,v=a.project(p),m=a.project(h).sub(v),y=a.zoomScale(l-i);return e.around&&(d=t.LngLat.convert(e.around),g=a.locationPoint(d)),this._zooming=l!==i,this._rotating=o!==c,this._pitching=u!==s,this._prepareEase(r,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(n._zooming&&(a.zoom=t.number(i,l,e)),n._rotating&&(a.bearing=t.number(o,c,e)),n._pitching&&(a.pitch=t.number(s,u,e)),d)a.setLocationAtPoint(d,g);else{var p=a.zoomScale(a.zoom-i),h=l>i?Math.min(2,y):Math.max(.5,y),x=Math.pow(h,1-e),b=a.unproject(v.add(m.mult(e*x)).mult(p));a.setLocationAtPoint(a.renderWorldCopies?b.wrap():b,f)}n._fireMoveEvents(r)}),(function(){e.delayEndEvents?n._easeEndTimeoutID=setTimeout((function(){return n._afterEase(r)}),e.delayEndEvents):n._afterEase(r)}),e),this},r.prototype._prepareEase=function(e,r){this._moving=!0,r||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._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){var r=this._zooming,n=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,r&&this.fire(new t.Event("zoomend",e)),n&&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(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="zoom"in e?t.clamp(+e.zoom,i.minZoom,i.maxZoom):o,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,f="pitch"in e?+e.pitch:l,p=i.zoomScale(c-o),h=i.centerPoint.add(t.Point.convert(e.offset)),d=i.pointLocation(h),g=t.LngLat.convert(e.center||d);this._normalizeCenter(g);var v=i.project(d),m=i.project(g).sub(v),y=e.curve,x=Math.max(i.width,i.height),b=x/p,_=m.mag();if("minZoom"in e){var w=t.clamp(Math.min(e.minZoom,o,c),i.minZoom,i.maxZoom),k=x/i.zoomScale(w-o);y=Math.sqrt(k/_*2)}var T=y*y;function A(t){var e=(b*b-x*x+(t?-1:1)*T*T*_*_)/(2*(t?b:x)*T*_);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function E(t){return(Math.exp(t)+Math.exp(-t))/2}var S=A(0),C=function(t){return E(S)/E(S+y*t)},L=function(t){return x*((E(S)*(M(e=S+y*t)/E(e))-M(S))/T)/_;var e},O=(A(1)-S)/y;if(Math.abs(_)<1e-6||!isFinite(O)){if(Math.abs(x-b)<1e-6)return this.easeTo(e,r);var P=be.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=f!==l,this._prepareEase(r,!1),this._ease((function(e){var a=e*O,p=1/C(a);i.zoom=1===e?c:o+i.scaleZoom(p),n._rotating&&(i.bearing=t.number(s,u,e)),n._pitching&&(i.pitch=t.number(l,f,e));var d=1===e?g:i.unproject(v.add(m.mult(L(a))).mult(p));i.setLocationAtPoint(i.renderWorldCopies?d.wrap():d,h),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}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),Cn=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Cn.prototype.getDefaultPosition=function(){return"bottom-right"},Cn.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},Cn.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},Cn.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)}},Cn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Ln=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Ln.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","Mapbox logo"),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},Ln.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ln.prototype.getDefaultPosition=function(){return"bottom-left"},Ln.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Ln.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}},Ln.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 On=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};On.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},On.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 minZoom");var i=new un(e.minZoom,e.maxZoom,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 On,this._controls=[],this._mapId=t.uniqueId(),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 In))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 a._update(!1)})),this.on("moveend",(function(){return a._update(!1)})),this.on("zoom",(function(){return a._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var n=t.getCanvasContainer(),a=null,i=!1,o=null;for(var s in En)t[s]=new En[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);r.addEventListener(n,"mouseout",(function(e){t.fire(new hn("mouseout",t,e))})),r.addEventListener(n,"mousedown",(function(a){i=!0,o=r.mousePos(n,a);var s=new hn("mousedown",t,a);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(a),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(a),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(a))})),r.addEventListener(n,"mouseup",(function(e){var r=t.dragRotate.isActive();a&&!r&&t.fire(new hn("contextmenu",t,a)),a=null,i=!1,t.fire(new hn("mouseup",t,e))})),r.addEventListener(n,"mousemove",(function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var r=e.target;r&&r!==n;)r=r.parentNode;r===n&&t.fire(new hn("mousemove",t,e))}})),r.addEventListener(n,"mouseover",(function(e){for(var r=e.target;r&&r!==n;)r=r.parentNode;r===n&&t.fire(new hn("mouseover",t,e))})),r.addEventListener(n,"touchstart",(function(r){var n=new dn("touchstart",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r),t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(n))}),{passive:!1}),r.addEventListener(n,"touchmove",(function(e){t.fire(new dn("touchmove",t,e))}),{passive:!1}),r.addEventListener(n,"touchend",(function(e){t.fire(new dn("touchend",t,e))})),r.addEventListener(n,"touchcancel",(function(e){t.fire(new dn("touchcancel",t,e))})),r.addEventListener(n,"click",(function(a){var i=r.mousePos(n,a);(!o||i.equals(o)||i.dist(o)-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];return this._resizeCanvas(n,a),this.transform.resize(n,a),this.painter.resize(n,a),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).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?0:t)>=0&&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.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},a.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},a.prototype.getMaxZoom=function(){return this.transform.maxZoom},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.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},a.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},a.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},a.prototype.on=function(t,e,r){var a=this;if(void 0===r)return n.prototype.on.call(this,t,e);var i=function(){var n;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 hn(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 hn(t,a,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(a,new hn(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)}}();for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},a.prototype.off=function(t,e,r){if(void 0===r)return n.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var a=this._delegatedListeners[t],i=0;i180;){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}Bn.prototype._updateZoomButtons=function(){var t=this._map.getZoom();t===this._map.getMaxZoom()?this._zoomInButton.classList.add("mapboxgl-ctrl-icon-disabled"):this._zoomInButton.classList.remove("mapboxgl-ctrl-icon-disabled"),t===this._map.getMinZoom()?this._zoomOutButton.classList.add("mapboxgl-ctrl-icon-disabled"):this._zoomOutButton.classList.remove("mapboxgl-ctrl-icon-disabled")},Bn.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},Bn.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new xn(t,{button:"left",element:this._compass}),r.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),r.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},Bn.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),r.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),r.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map},Bn.prototype._createButton=function(t,e,n){var a=r.create("button",t,this._container);return a.type="button",a.title=e,a.setAttribute("aria-label",e),a.addEventListener("click",n),a};var jn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Vn(t,e,r){var n=t.classList;for(var a in jn)n.remove("mapboxgl-"+r+"-anchor-"+a);n.add("mapboxgl-"+r+"-anchor-"+e)}var Un,Hn=function(e){function n(n,a){if(e.call(this),(n instanceof t.window.HTMLElement||a)&&(n=t.extend({element:n},a)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._draggable=n&&n.draggable||!1,this._state="inactive",n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div");var i=r.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");var o=r.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var c=0,u=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];c5280?Zn(e,c,p/5280,"mi"):Zn(e,c,p,"ft")}else r&&"nautical"===r.unit?Zn(e,c,f/1852,"nm"):Zn(e,c,f,"m")}function Zn(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))),l=s/r;"m"===n&&s>=1e3&&(s/=1e3,n="km"),t.style.width=e*l+"px",t.innerHTML=s+n}Yn.prototype.getDefaultPosition=function(){return"bottom-left"},Yn.prototype._onMove=function(){Xn(this._map,this._container,this.options)},Yn.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},Yn.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Yn.prototype.setUnit=function(t){this.options.unit=t,Xn(this._map,this._container,this.options)};var Jn=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"),this._className="mapboxgl-ctrl"};Jn.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Jn.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Jn.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Jn.prototype._setupUI=function(){(this._fullscreenButton=r.create("button",this._className+"-icon "+this._className+"-fullscreen",this._controlContainer)).type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Jn.prototype._updateTitle=function(){var t=this._isFullscreen()?"Exit fullscreen":"Enter fullscreen";this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Jn.prototype._isFullscreen=function(){return this._fullscreen},Jn.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(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"),this._updateTitle())},Jn.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 Kn={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},$n=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Kn),r),t.bindAll(["_update","_onClickClose","remove"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){var r=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",(function(t){r._update(t.point)})),this._map.on("mouseup",(function(t){r._update(t.point)})),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("click",this._onClickClose),this._map.off("remove",this.remove),this._map.off("mousemove"),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._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._map&&(this._map.off("move",this._update),this._map.on("mousemove",(function(e){t._update(e.point)})),this._map.on("drag",(function(e){t._update(e.point)})),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.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._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._onClickClose))},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.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Nn(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 f=i.add(s[o]).round();r.setTransform(this._container,jn[o]+" translate("+f.x+"px,"+f.y+"px)"),Vn(this._container,o,"popup")}},n.prototype._onClickClose=function(){this.remove()},n}(t.Evented),Qn={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,Map:zn,NavigationControl:Bn,GeolocateControl:Gn,AttributionControl:Cn,ScaleControl:Yn,FullscreenControl:Jn,Popup:$n,Marker:Hn,Style:Re,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,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 Qn})),r}))},{}],428:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1<h[1][2]&&(m[0]=-m[0]),h[0][2]>h[2][0]&&(m[1]=-m[1]),h[1][0]>h[0][1]&&(m[2]=-m[2]),!0}},{"./normalize":430,"gl-mat4/clone":261,"gl-mat4/create":262,"gl-mat4/determinant":263,"gl-mat4/invert":267,"gl-mat4/transpose":278,"gl-vec3/cross":335,"gl-vec3/dot":340,"gl-vec3/length":350,"gl-vec3/normalize":357}],430:[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}},{}],431:[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(),c=f(),u=f();function f(){return{translate:p(),scale:p(1),skew:p(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function p(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 p=i(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),h=i(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!p||!h||(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),a(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),0))}},{"gl-mat4/determinant":263,"gl-vec3/lerp":351,"mat4-decompose":429,"mat4-recompose":432,"quat-slerp":484}],432:[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":262,"gl-mat4/fromRotationTranslation":265,"gl-mat4/identity":266,"gl-mat4/multiply":269,"gl-mat4/scale":276,"gl-mat4/translate":277}],433:[function(t,e,r){"use strict";e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],434:[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"),c=t("gl-mat4/lookAt"),u=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];function h(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 h((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=h.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],p=(l=16*r,this.prevMatrix),h=!0;for(c=0;c<16;++c)p[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],h=h&&p[c]===d[c];if(u<1e-6||h)for(c=0;c<16;++c)o[c]=p[c];else a(o,p,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 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 x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=m[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,p=(a=0,o.length);a0;--h)r[f++]=s[h];return r};var n=t("robust-orientation")[3]},{"robust-orientation":508}],436:[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 c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==a||u!==i||l(s))&&(r=0|t,a=c||0,i=u||0,e&&e(r,a,i,o))}function u(t){c(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 p(t){l(t)&&e&&e(r,a,i,o)}function h(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 v(){s||(s=!0,t.addEventListener("mousemove",h),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",p),t.addEventListener("keydown",p),t.addEventListener("keypress",p),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",p),window.addEventListener("keydown",p),window.addEventListener("keypress",p)))}v();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?v():s&&(s=!1,t.removeEventListener("mousemove",h),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",p),t.removeEventListener("keydown",p),t.removeEventListener("keypress",p),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",p),window.removeEventListener("keydown",p),window.removeEventListener("keypress",p)))},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":438}],437:[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,i=t.clientX||0,o=t.clientY||0,s=(a=e)===window||a===document||a===document.body?n:a.getBoundingClientRect();return r[0]=i-s.left,r[1]=o-s.top,r}},{}],438:[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"),"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||[],C=new Array(M),L=0;L=0?C[L]=!0:C[L]=!1;return function(t,e,r,M,E,S){var C=S.length,L=E.length;if(L<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var O="extractContour"+E.join("_"),P=[],I=[],D=[],z=0;z0&&N.push(l(z,E[R-1])+"*"+s(E[R-1])),I.push(d(z,E[R])+"=("+N.join("-")+")|0")}for(z=0;z=0;--z)j.push(s(E[z]));for(I.push(w+"=("+j.join("*")+")|0",b+"=mallocUint32("+w+")",x+"=mallocUint32("+w+")",k+"=0"),I.push(g(0)+"=0"),R=1;R<1<0;T=T-1&d)w.push(x+"["+k+"+"+m(T)+"]");for(w.push(y(0)),T=0;T=0;--e)G(e,0);var r=[];for(e=0;e0){",h(E[e]),"=1;"),t(e-1,r|1<=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 c=".lo("+i.join()+").hi("+o.join()+")";if(0===i.length&&(c=""),a>0){for(n.push("if(1"),l=0;l=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");for(n.push("){grad",a,"(src.pick(",s.join(),")",c),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(",p.join(),")-src.get(",h.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):n.push("if(s[",u,"]>1){diff(",f,",src.pick(",p.join(),")",c,",src.pick(",h.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===a?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===a?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")}}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 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: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":147}],446:[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":447,ndarray:451}],447:[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":147}],448:[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",d,"=s",d,"-d",f,"*n",f].join("")):s.push(["d",d,"=s",d].join("")),f=d),0!=(h=t.length-1-l)&&(p>0?s.push(["e",h,"=s",h,"-e",p,"*n",p,",f",h,"=",c[h],"-f",p,"*n",p].join("")):s.push(["e",h,"=s",h,",f",h,"=",c[h]].join("")),p=h)}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 c=[],u=1;u1){for(r.push("dptr=0;sptr=ptr"),u=t.length-1;u>=0;--u)0!==(h=t[u])&&r.push(["for(i",h,"=0;i",h,"b){break __l}"].join("")),u=t.length-1;u>=1;--u)r.push("sptr+=e"+u,"dptr+=f"+u,"}");for(r.push("dptr=cptr;sptr=cptr-s0"),u=t.length-1;u>=0;--u)0!==(h=t[u])&&r.push(["for(i",h,"=0;i",h,"=0;--u)0!==(h=t[u])&&r.push(["for(i",h,"=0;i",h,"scratch)){",p("cptr",f("cptr-s0")),"cptr-=s0","}",p("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=i(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 p=[],h=1;h=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="+d(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 x(){t.length>1&&c&&n.push("free(pivot1)","free(pivot2)")}function b(e,r){var a="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++u;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(d(a)),">",g(d(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(d(e),g(d(r))))}function w(e,r,a){if(t.length>1){var i="__l"+ ++u;y(i,[r],!0,[e,"=",g("ptr0"),"-pivot",a,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else n.push([e,"=",g(d(r)),"-pivot",a].join(""))}function k(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=",d(e),"\n","ptr1=",d(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=",d(e),"\n","ptr1=",d(r),"\n","ptr2=",d(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){k(t,e),n.push("--"+e)}function M(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(d(e),g(d(r))),v(d(r),"pivot"+a))}function E(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",++u,":while(true){"].join("")),m([e],!0,["if(",g("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",u,"}"].join("")),n.push(a,"}")):n.push(["while(",g(d(e)),"===pivot",r,"){",a,"}"].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?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(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",v(d("index1"),"x"),"\n",v(d("index3"),"y"),"\n",v(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){"),k("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){"),k("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){"),k("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,m);return v(m,y)}},{"typedarray-pool":543}],449:[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":448}],450:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_3_arg4_)}",args:[{name:"_inline_3_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_4_arg2_(this_warped,_inline_4_arg0_),_inline_4_arg1_=_inline_4_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_4_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_4_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_7_arg2_(this_warped,_inline_7_arg0_),_inline_7_arg1_=_inline_7_arg3_(_inline_7_arg4_,this_warped[0])}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_(_inline_10_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:i(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:a(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":150,"ndarray-linear-interpolate":444}],451:[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("+u+",v)}"):i.push("return this.data["+u+"]=v}"),i.push("proto.get=function "+r+"_get("+l.join(",")+"){"),a?i.push("return this.data.get("+u+")}"):i.push("return this.data["+u+"]}"),i.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),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 h=o.map((function(t){return"a"+t+"=this.shape["+t+"]"})),d=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,"+h.join(",")+","+d.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");for(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"),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"))(c[t],s)}var c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],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)for(n=0,s=0;s>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-a:a;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===i?(r+=1,o=0):o+=1:0===o?(o=i,r-=1):o-=1,n.pack(o,r)}},{"double-bits":168}],453:[function(t,e,r){var n=Math.PI,a=c(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,c,u,f,p,h){if(h)k=h[0],T=h[1],_=h[2],w=h[3];else{var d=l(t,e,-o);t=d.x,e=d.y;var g=(t-(f=(d=l(f,p,-o)).x))/2,v=(e-(p=d.y))/2,m=g*g/(r*r)+v*v/(i*i);m>1&&(r*=m=Math.sqrt(m),i*=m);var y=r*r,x=i*i,b=(c==u?-1:1)*Math.sqrt(Math.abs((y*x-y*v*v-x*g*g)/(y*v*v+x*g*g)));b==1/0&&(b=1);var _=b*r*v/i+(t+f)/2,w=b*-i*g/r+(e+p)/2,k=Math.asin(((e-w)/i).toFixed(9)),T=Math.asin(((p-w)/i).toFixed(9));(k=t<_?n-k:k)<0&&(k=2*n+k),(T=f<_?n-T:T)<0&&(T=2*n+T),u&&k>T&&(k-=2*n),!u&&T>k&&(T-=2*n)}if(Math.abs(T-k)>a){var A=T,M=f,E=p;T=k+a*(u&&T>k?1:-1);var S=s(f=_+r*Math.cos(T),p=w+i*Math.sin(T),r,i,o,0,u,M,E,[T,A,_,w])}var C=Math.tan((T-k)/4),L=4/3*r*C,O=4/3*i*C,P=[2*t-(t+L*Math.sin(k)),2*e-(e-O*Math.cos(k)),f+L*Math.sin(T),p-O*Math.cos(T),f,p];if(h)return P;S&&(P=P.concat(S));for(var I=0;I7&&(r.push(m.splice(0,7)),m.unshift("C"));break;case"S":var x=h,b=d;"C"!=e&&"S"!=e||(x+=x-n,b+=b-a),m=["C",x,b,m[1],m[2],m[3],m[4]];break;case"T":"Q"==e||"T"==e?(f=2*h-f,p=2*d-p):(f=h,p=d),m=o(h,d,f,p,m[1],m[2]);break;case"Q":f=m[1],p=m[2],m=o(h,d,m[1],m[2],m[3],m[4]);break;case"L":m=i(h,d,m[1],m[2]);break;case"H":m=i(h,d,m[1],d);break;case"V":m=i(h,d,h,m[1]);break;case"Z":m=i(h,d,l,u)}e=y,h=m[m.length-2],d=m[m.length-1],m.length>4?(n=m[m.length-4],a=m[m.length-3]):(n=h,a=d),r.push(m)}return r}},{}],454:[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 b=a[c],_=1/Math.sqrt(v*y);for(x=0;x<3;++x){var w=(x+1)%3,k=(x+2)%3;b[x]+=_*(m[w]*g[k]-m[k]*g[w])}}}for(o=0;oi)for(_=1/Math.sqrt(T),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=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(h):0,c=0;c<3;++c)p[c]*=h;a[o]=p}return a}},{}],455:[function(t,e,r){ +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)}},{}],414:[function(t,e,r){"use strict";e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],415:[function(t,e,r){"use strict";e.exports=a,e.exports.isMobile=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(4|6)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(4|6)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;return e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"==typeof e&&(t.tablet?i.test(e):n.test(e))}},{}],416:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],417:[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({}))}},{}],418:[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}},{}],419:[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))}},{}],420:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],421:[function(t,r,n){(function(t){!function(t,e){"object"==typeof n&&void 0!==r?r.exports=e():t.mapboxgl=e()}(this,function(){"use strict";var e,r,n;function i(t,i){if(e)if(r){var a="var sharedChunk = {}; ("+e+")(sharedChunk); ("+r+")(sharedChunk);",o={};e(o),(n=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else r=i;else e=i}return i(0,function(e){var r="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function i(t,e){return t(e={exports:{}},e.exports),e.exports}var a=o;function o(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}o.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},o.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},o.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},o.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},o.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var s=function(t,e,r){this.column=t,this.row=e,this.zoom=r};s.prototype.clone=function(){return new s(this.column,this.row,this.zoom)},s.prototype.zoomTo=function(t){return this.clone()._zoomTo(t)},s.prototype.sub=function(t){return this.clone()._sub(t)},s.prototype._zoomTo=function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},s.prototype._sub=function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this};var l=u;function u(t,e){this.x=t,this.y=e}function c(t,e,r,n){var i=new a(t,e,r,n);return function(t){return i.solve(t)}}u.prototype={clone:function(){return new u(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}},u.convert=function(t){return t instanceof u?t:Array.isArray(t)?new u(t[0],t[1]):t};var f=c(.25,.1,.25,1);function h(t,e,r){return Math.min(r,Math.max(e,t))}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n(e.y-t.y)*(r.x-t.x)}function k(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r=200&&r.status<300&&r.response?e(null,{data:n,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new T(r.statusText,r.status,t.url))},r.send(),r};function S(t,e,r){r[t]=r[t]||[],r[t].push(e)}function C(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var L=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},O=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(L),I=function(){};I.prototype.on=function(t,e){return this._listeners=this._listeners||{},S(t,e,this._listeners),this},I.prototype.off=function(t,e){return C(t,e,this._listeners),C(t,e,this._oneTimeListeners),this},I.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},S(t,e,this._oneTimeListeners),this},I.prototype.fire=function(t){"string"==typeof t&&(t=new L(t,arguments[1]||{}));var e=t.type;if(this.listens(e)){t.target=this;for(var r=0,n=this._listeners&&this._listeners[e]?this._listeners[e].slice():[];r0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},I.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var P={$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.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{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.0511,180,85.0511]},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.0511,180,85.0511]},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},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"},lineMetrics:{type:"boolean",default:!1}},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"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{butt:{},round:{},square:{}},default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{bevel:{},round:{},miter:{}},default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{point:{},line:{}},default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"factor of the original icon size",requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"]},"icon-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{left:{},center:{},right:{}},default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function_stop:{type:"array",minimum:0,maximum:22,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"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{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"},"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"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Heatmap"},"+":{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"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{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:{}},transition:!1,"zoom-function":!0,"property-function":!1,function:"piecewise-constant"},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,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",function:"piecewise-constant","zoom-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"line-gradient":{type:"color",function:"interpolated","zoom-function":!1,"property-function":!1,transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}]}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map"},"circle-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"heatmap-weight":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!1},"heatmap-intensity":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},"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"],function:"interpolated","zoom-function":!1,"property-function":!1,transition:!1},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!1,units:"milliseconds"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,function:"interpolated","zoom-function":!0,transition:!1},"hillshade-illumination-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"hillshade-shadow-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-accent-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},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}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"]}}},D=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function z(t){var e=t.key,r=t.value;return r?[new D(e,r,"constants have been deprecated as of v8")]:[]}function R(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 J=[V,U,H,q,G,W,Z(Y)];function K(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&!K(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=J;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("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),f=i.substr(l+1,u-(l+1)).split(","),h=1;switch(c){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]),v=o(f[2]),g=v<=.5?v*(d+1):v+d-v*d,m=2*v-g;return[n(255*s(m,g,p+1/3)),n(255*s(m,g,p)),n(255*s(m,g,p-1/3)),h];default:return null}}return null}}catch(t){}}).parseCSSColor,tt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};tt.parse=function(t){if(t){if(t instanceof tt)return t;if("string"==typeof t){var e=Q(t);if(e)return new tt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},tt.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+")"},tt.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]},tt.black=new tt(0,0,0,1),tt.white=new tt(1,1,1,1),tt.transparent=new tt(0,0,0,0);var et=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"})};et.prototype.compare=function(t,e){return this.collator.compare(t,e)},et.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var rt=function(t,e,r){this.type=X,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function nt(t,e,r,n){return"number"==typeof t&&t>=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 it(t){if(null===t)return V;if("string"==typeof t)return H;if("boolean"==typeof t)return q;if("number"==typeof t)return U;if(t instanceof tt)return G;if(t instanceof et)return X;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n4)return e.error("Expected 1, 2, or 3 arguments, but found "+(t.length-1)+" instead.");var r,n;if(t.length>2){var i=t[1];if("string"!=typeof i||!(i in ut))return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=ut[i]}else r=Y;if(t.length>3){if("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);n=t[2]}var a=Z(r,n),o=e.parse(t[t.length-1],t.length-1,Y);return o?new ct(a,o):null},ct.prototype.evaluate=function(t){var e=this.input.evaluate(t);if(K(this.type,it(e)))throw new ot("Expected value to be of type "+$(this.type)+", but found "+$(it(e))+" instead.");return e},ct.prototype.eachChild=function(t){t(this.input)},ct.prototype.possibleOutputs=function(){return this.input.possibleOutputs()},ct.prototype.serialize=function(){var t=["array"],e=this.type.itemType;if("string"===e.kind||"number"===e.kind||"boolean"===e.kind){t.push(e.kind);var r=this.type.N;"number"==typeof r&&t.push(r)}return t.push(this.input.serialize()),t};var ft={"to-number":U,"to-color":G},ht=function(t,e){this.type=t,this.args=e};ht.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");for(var r=t[0],n=ft[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":nt(e[0],e[1],e[2],e[3])))return new tt(e[0]/255,e[1]/255,e[2]/255,e[3]);throw new ot(r||"Could not parse color from value '"+("string"==typeof e?e:JSON.stringify(e))+"'")}for(var o=null,s=0,l=this.args;s=0)return!1;var r=!0;return t.eachChild(function(t){r&&!mt(t,e)&&(r=!1)}),r}vt.prototype.evaluate=function(t){return this._evaluate(t,this.args)},vt.prototype.eachChild=function(t){this.args.forEach(t)},vt.prototype.possibleOutputs=function(){return[void 0]},vt.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},vt.parse=function(t,e){var r=t[0],n=vt.definitions[r];if(!n)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter(function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1}),s=[],l=1;lr&&ee))throw new ot("Input is not a number.");a=o-1}}return Math.max(o-1,0)}xt.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)},xt.prototype._parse=function(t,e){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 r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var i=n.parse(t,this);if(!i)return null;if(this.expectedType){var a=this.expectedType,o=i.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind||"value"!==o.kind)if("array"===a.kind&&"value"===o.kind)e.omitTypeAnnotations||(i=new ct(a,i));else if("color"!==a.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(this.expectedType,i.type))return null}else e.omitTypeAnnotations||(i=new ht(a,[i]));else e.omitTypeAnnotations||(i=new lt(a,[i]))}if(!(i instanceof at)&&function t(e){if(e instanceof yt)return t(e.boundExpression);if(e instanceof vt&&"error"===e.name)return!1;if(e instanceof rt)return!1;var r=e instanceof ht||e instanceof lt||e instanceof ct,n=!0;return e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof at}),!!n&>(e)&&mt(e,["zoom","heatmap-density","line-progress","is-supported-script"])}(i)){var s=new dt;try{i=new at(i.type,i.evaluate(s))}catch(t){return this.error(t.message),null}}return i}return this.error('Unknown expression "'+r+'". 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.")},xt.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 xt(this.registry,n,e||null,i,this.errors)},xt.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 N(n,t))},xt.prototype.checkSubtype=function(t,e){var r=K(t,e);return r&&this.error(r),r};var _t=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var f=e.parse(l,c,a);if(!f)return null;a=a||f.type,i.push([s,f])}return new _t(a,r,i)},_t.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[bt(e,n)].evaluate(t)},_t.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 kt=Object.freeze({number:wt,color:function(t,e,r){return new tt(wt(t.r,e.r,r),wt(t.g,e.g,r),wt(t.b,e.b,r),wt(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return wt(t,e[n],r)})}}),At=function(t,e,r,n){this.type=t,this.interpolation=e,this.input=r,this.labels=[],this.outputs=[];for(var i=0,a=n;i1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:o}}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(!(n=e.parse(n,2,U)))return null;var s=[],l=null;e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var u=0;u=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);var d=e.parse(f,p,l);if(!d)return null;l=l||d.type,s.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new At(l,r,n,s):e.error("Type "+$(l)+" is not interpolatable.")},At.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=bt(e,n),o=e[a],s=e[a+1],l=At.interpolationFactor(this.interpolation,n,o,s),u=r[a].evaluate(t),c=r[a+1].evaluate(t);return kt[this.type.kind.toLowerCase()](u,c,l)},At.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ot("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ot("Array index must be an integer, but found "+e+" instead.");return r[e]},St.prototype.eachChild=function(t){t(this.index),t(this.input)},St.prototype.possibleOutputs=function(){return[void 0]},St.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ct=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};Ct.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 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,it(h)))return null}else r=it(h);if(void 0!==i[String(h)])return u.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,r);if(!d)return null;var v=e.parse(t[t.length-1],t.length-1,n);return v?new Ct(r,n,d,i,a,v):null},Ct.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ct.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ct.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t},Ct.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();in.evaluate(t)}function Ut(t,e){var r=e[0],n=e[1];return r.evaluate(t)<=n.evaluate(t)}function Ht(t,e){var r=e[0],n=e[1];return r.evaluate(t)>=n.evaluate(t)}function qt(t){return{type:t}}function Gt(t){return{result:"success",value:t}}function Wt(t){return{result:"error",value:t}}vt.register(Rt,{error:[{kind:"error"},[H],function(t,e){var r=e[0];throw new ot(r.evaluate(t))}],typeof:[H,[Y],function(t,e){return $(it(e[0].evaluate(t)))}],"to-string":[H,[Y],function(t,e){var r=e[0],n=typeof(r=r.evaluate(t));return null===r?"":"string"===n||"number"===n||"boolean"===n?String(r):r instanceof tt?r.toString():JSON.stringify(r)}],"to-boolean":[q,[Y],function(t,e){var r=e[0];return Boolean(r.evaluate(t))}],"to-rgba":[Z(U,4),[G],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[G,[U,U,U],Ft],rgba:[G,[U,U,U,U],Ft],has:{type:q,overloads:[[[H],function(t,e){return Bt(e[0].evaluate(t),t.properties())}],[[H,W],function(t,e){var r=e[0],n=e[1];return Bt(r.evaluate(t),n.evaluate(t))}]]},get:{type:Y,overloads:[[[H],function(t,e){return Nt(e[0].evaluate(t),t.properties())}],[[H,W],function(t,e){var r=e[0],n=e[1];return Nt(r.evaluate(t),n.evaluate(t))}]]},properties:[W,[],function(t){return t.properties()}],"geometry-type":[H,[],function(t){return t.geometryType()}],id:[Y,[],function(t){return t.id()}],zoom:[U,[],function(t){return t.globals.zoom}],"heatmap-density":[U,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[U,[],function(t){return t.globals.lineProgress||0}],"+":[U,qt(U),function(t,e){for(var r=0,n=0,i=e;n":[q,[H,Y],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->":[q,[Y],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[q,[H,Y],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-<=":[q,[Y],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[q,[H,Y],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->=":[q,[Y],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[q,[Y],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[q,[],function(t){return null!==t.id()}],"filter-type-in":[q,[Z(H)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[q,[Z(Y)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[q,[H,Z(Y)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[q,[H,Z(Y)],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)}],">":{type:q,overloads:[[[U,U],Vt],[[H,H],Vt],[[H,H,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))>0}]]},"<":{type:q,overloads:[[[U,U],jt],[[H,H],jt],[[H,H,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))<0}]]},">=":{type:q,overloads:[[[U,U],Ht],[[H,H],Ht],[[H,H,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))>=0}]]},"<=":{type:q,overloads:[[[U,U],Ut],[[H,H],Ut],[[H,H,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))<=0}]]},all:{type:q,overloads:[[[q,q],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[qt(q),function(t,e){for(var r=0,n=e;rQt?Math.pow(t,1/3):t/Kt+$t}function ne(t){return t>Jt?t*t*t:Kt*(t-$t)}function ie(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ae(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function oe(t){var e=ae(t.r),r=ae(t.g),n=ae(t.b),i=re((.4124564*e+.3575761*r+.1804375*n)/Yt),a=re((.2126729*e+.7151522*r+.072175*n)/Xt);return{l:116*a-16,a:500*(i-a),b:200*(a-re((.0193339*e+.119192*r+.9503041*n)/Zt)),alpha:t.a}}function se(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=Xt*ne(e),r=Yt*ne(r),n=Zt*ne(n),new tt(ie(3.2404542*r-1.5371385*e-.4985314*n),ie(-.969266*r+1.8760108*e+.041556*n),ie(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var le={forward:oe,reverse:se,interpolate:function(t,e,r){return{l:wt(t.l,e.l,r),a:wt(t.a,e.a,r),b:wt(t.b,e.b,r),alpha:wt(t.alpha,e.alpha,r)}}},ue={forward:function(t){var e=oe(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*ee;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*te,r=t.c;return se({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,r),c:wt(t.c,e.c,r),l:wt(t.l,e.l,r),alpha:wt(t.alpha,e.alpha,r)}}},ce=Object.freeze({lab:le,hcl:ue});function fe(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function he(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function pe(t){return t}function de(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function ve(t,e,r,n,i){return de(typeof r===i?n[r]:void 0,t.default,e.default)}function ge(t,e,r){if("number"!==fe(r))return de(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=xe(t.stops,r);return t.stops[i][1]}function me(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==fe(r))return de(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=xe(t.stops,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],u=kt[e.type]||pe;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=ce[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 ye(t,e,r){return"color"===e.type?r=tt.parse(r):fe(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),de(r,t.default,e.default)}function xe(t,e){for(var r,n,i=0,a=t.length-1,o=0;i<=a;){if(r=t[o=Math.floor((i+a)/2)][0],n=t[o+1][0],e===r||e>r&&ee&&(a=o-1)}return Math.max(o-1,0)}var be=function(t,e){var r;this.expression=t,this._warningHistory={},this._defaultValue="color"===(r=e).type&&he(r.default)?new tt(0,0,0,0):"color"===r.type?tt.parse(r.default)||null:void 0===r.default?null:r.default,"enum"===e.type&&(this._enumValues=e.values)};function _e(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Rt}function we(t,e){var r=new xt(Rt,[],function(t){var e={color:G,string:H,number:U,enum:H,boolean:q};return"array"===t.type?Z(e[t.value]||Y,t.length):e[t.type]||null}(e)),n=r.parse(t);return n?Gt(new be(n,e)):Wt(r.errors)}be.prototype.evaluateWithoutErrorHandling=function(t,e){return this._evaluator||(this._evaluator=new dt),this._evaluator.globals=t,this._evaluator.feature=e,this.expression.evaluate(this._evaluator)},be.prototype.evaluate=function(t,e){this._evaluator||(this._evaluator=new dt),this._evaluator.globals=t,this._evaluator.feature=e;try{var r=this.expression.evaluate(this._evaluator);if(null==r)return this._defaultValue;if(this._enumValues&&!(r in this._enumValues))throw new ot("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(r)+" instead.");return r}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ke=function(t,e){this.kind=t,this._styleExpression=e};ke.prototype.evaluateWithoutErrorHandling=function(t,e){return this._styleExpression.evaluateWithoutErrorHandling(t,e)},ke.prototype.evaluate=function(t,e){return this._styleExpression.evaluate(t,e)};var Ae=function(t,e,r){this.kind=t,this.zoomStops=r.labels,this._styleExpression=e,r instanceof At&&(this._interpolationType=r.interpolation)};function Te(t,e){if("error"===(t=we(t,e)).result)return t;var r=t.value.expression,n=gt(r);if(!n&&!e["property-function"])return Wt([new N("","property expressions not supported")]);var i=mt(r,["zoom"]);if(!i&&!1===e["zoom-function"])return Wt([new N("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof Et)r=t(e.result);else if(e instanceof Mt)for(var n=0,i=e.args;nn.maximum?[new D(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Oe(t){var e,r,n,i=t.valueSpec,a=F(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,u="array"===fe(t.value.stops)&&"array"===fe(t.value.stops[0])&&"object"===fe(t.value.stops[0][0]),c=Se({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 D(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Ce({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:f})),"array"===fe(r)&&0===r.length&&e.push(new D(t.key,r,"array must have at least one stop")),e},default:function(t){return Ke({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&c.push(new D(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||c.push(new D(t.key,t.value,'missing required property "stops"')),"exponential"===a&&"piecewise-constant"===t.valueSpec.function&&c.push(new D(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!t.valueSpec["property-function"]?c.push(new D(t.key,t.value,"property functions not supported")):s&&!t.valueSpec["zoom-function"]&&"heatmap-color"!==t.objectKey&&"line-gradient"!==t.objectKey&&c.push(new D(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==t.value.property||c.push(new D(t.key,t.value,'"property" property is required')),c;function f(t){var e=[],a=t.value,s=t.key;if("array"!==fe(a))return[new D(s,a,"array expected, "+fe(a)+" found")];if(2!==a.length)return[new D(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==fe(a[0]))return[new D(s,a,"object expected, "+fe(a[0])+" found")];if(void 0===a[0].zoom)return[new D(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new D(s,a,"object stop key must have value")];if(n&&n>F(a[0].zoom))return[new D(s,a[0].zoom,"stop zoom values must appear in ascending order")];F(a[0].zoom)!==n&&(n=F(a[0].zoom),r=void 0,o={}),e=e.concat(Se({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Le,value:h}}))}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return e.concat(Ke({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=fe(t.value),l=F(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new D(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 D(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return i["property-function"]&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new D(t.key,u,c)]}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":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 Be(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Ne(t[1],t[2],"=="):"!="===r?Ue(Ne(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Ne(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Be))):"all"===r?["all"].concat(t.slice(1).map(Be)):"none"===r?["all"].concat(t.slice(1).map(Be).map(Ue)):"in"===r?je(t[1],t.slice(2)):"!in"===r?Ue(je(t[1],t.slice(2))):"has"===r?Ve(t[1]):"!has"!==r||Ue(Ve(t[1]))}function Ne(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 je(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(Fe)]]:["filter-in-small",t,["literal",e]]}}function Ve(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ue(t){return["!",t]}function He(t){return De(B(t.value))?Ie(R({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==fe(r))return[new D(n,r,"array expected, "+fe(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return[new D(n,r,"filter array must have at least 1 element")];switch(o=o.concat(Pe({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),F(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===F(r[1])&&o.push(new D(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new D(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=fe(r[1]))&&o.push(new D(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=u[h+0]&&n>=u[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},cr.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),f=s;f<=u;f++)for(var h=l;h<=c;h++){var p=this.d*h+f;if(i.call(this,t,e,r,n,p,a,o))return}},cr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},cr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=ur+this.cells.length+1+1,r=0,n=0;n=0)){var f=t[c];u[c]=hr[l].shallow.indexOf(c)>=0?f:vr(f,e)}t instanceof Error&&(u.message=t.message)}return{name:l,properties:u}}throw new Error("can't serialize object of type "+typeof t)}function gr(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||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof fr)return t;if(Array.isArray(t))return t.map(function(t){return gr(t)});if("object"==typeof t){var e=t,r=e.name,n=e.properties;if(!r)throw new Error("can't deserialize object of anonymous class");var i=hr[r].klass;if(!i)throw new Error("can't deserialize unregistered class "+r);if(i.deserialize)return i.deserialize(n._serialized);for(var a=Object.create(i.prototype),o=0,s=Object.keys(n);o=0?n[l]:gr(n[l])}return a}throw new Error("can't deserialize object of type "+typeof t)}var mr=function(){this.first=!0};mr.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 xr(t){for(var e=0,r=t;e=65097&&t<=65103)||yr["CJK Compatibility Ideographs"](t)||yr["CJK Compatibility"](t)||yr["CJK Radicals Supplement"](t)||yr["CJK Strokes"](t)||!(!yr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||yr["CJK Unified Ideographs Extension A"](t)||yr["CJK Unified Ideographs"](t)||yr["Enclosed CJK Letters and Months"](t)||yr["Hangul Compatibility Jamo"](t)||yr["Hangul Jamo Extended-A"](t)||yr["Hangul Jamo Extended-B"](t)||yr["Hangul Jamo"](t)||yr["Hangul Syllables"](t)||yr.Hiragana(t)||yr["Ideographic Description Characters"](t)||yr.Kanbun(t)||yr["Kangxi Radicals"](t)||yr["Katakana Phonetic Extensions"](t)||yr.Katakana(t)&&12540!==t||!(!yr["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)||!(!yr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||yr["Unified Canadian Aboriginal Syllabics"](t)||yr["Unified Canadian Aboriginal Syllabics Extended"](t)||yr["Vertical Forms"](t)||yr["Yijing Hexagram Symbols"](t)||yr["Yi Syllables"](t)||yr["Yi Radicals"](t))))}function wr(t){return!(_r(t)||function(t){return!!(yr["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||yr["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)||yr["Letterlike Symbols"](t)||yr["Number Forms"](t)||yr["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)||yr["Control Pictures"](t)&&9251!==t||yr["Optical Character Recognition"](t)||yr["Enclosed Alphanumerics"](t)||yr["Geometric Shapes"](t)||yr["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||yr["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||yr["CJK Symbols and Punctuation"](t)||yr.Katakana(t)||yr["Private Use Area"](t)||yr["CJK Compatibility Forms"](t)||yr["Small Form Variants"](t)||yr["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 kr(t,e){return!(!e&&(t>=1424&&t<=2303||yr["Arabic Presentation Forms-A"](t)||yr["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||yr.Khmer(t))}var Ar,Tr=!1,Mr=null,Er=!1,Sr=new I,Cr={applyArabicShaping:null,processBidirectionalText:null,isLoaded:function(){return Er||null!=Cr.applyArabicShaping}},Lr=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 mr,this.transition={})};Lr.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(en.zoomHistory.lastIntegerZoom?{from:t,to:e,fromScale:2,toScale:1,t:a+(1-a)*o}:{from:r,to:e,fromScale:.5,toScale:1,t:1-(1-o)*a}},Vr.prototype.interpolate=function(t){return t};var Ur=function(t){this.specification=t};Ur.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},Ur.prototype.interpolate=function(){return!1};var Hr=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var r=t[e],n=this.defaultPropertyValues[e]=new Or(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Ir(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};pr("DataDrivenProperty",jr),pr("DataConstantProperty",Nr),pr("CrossFadedProperty",Vr),pr("ColorRampProperty",Ur);var qr=function(t){function e(e,r){for(var n in t.call(this),this.id=e.id,this.metadata=e.metadata,this.type=e.type,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.visibility="visible","background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),this._featureFilter=function(){return!0},r.layout&&(this._unevaluatedLayout=new Rr(r.layout)),this._transitionablePaint=new Pr(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()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(or,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible"},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(null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(ar,n,t,e,r))return}g(t,"-transition")?this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0):this._transitionablePaint.setValue(t,e)},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){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},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"none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),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(!i||!1!==i.validate)&&sr(this,t.call(nr,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:P,style:{glyphs:!0,sprite:!0}}))},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e}(I),Gr={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Wr=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},Yr=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Xr(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map(function(t){var i,a=(i=t.type,Gr[i].BYTES_PER_ELEMENT),o=r=Zr(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:Zr(r,Math.max(n,e)),alignment:e}}function Zr(t,e){return Math.ceil(t/e)*e}Yr.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Yr.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},Yr.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Yr.prototype.clear=function(){this.length=0},Yr.prototype.resize=function(t){this.reserve(t),this.length=t},Yr.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)}},Yr.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var $r=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;this.resize(r+1);var n=2*r;return this.int16[n+0]=t,this.int16[n+1]=e,r},e}(Yr);$r.prototype.bytesPerElement=4,pr("StructArrayLayout2i4",$r);var Jr=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;this.resize(i+1);var a=4*i;return this.int16[a+0]=t,this.int16[a+1]=e,this.int16[a+2]=r,this.int16[a+3]=n,i},e}(Yr);Jr.prototype.bytesPerElement=8,pr("StructArrayLayout4i8",Jr);var Kr=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;this.resize(o+1);var s=6*o;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=a,o},e}(Yr);Kr.prototype.bytesPerElement=12,pr("StructArrayLayout2i4i12",Kr);var Qr=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,o,s){var l=this.length;this.resize(l+1);var u=6*l,c=12*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=n,this.uint8[c+8]=i,this.uint8[c+9]=a,this.uint8[c+10]=o,this.uint8[c+11]=s,l},e}(Yr);Qr.prototype.bytesPerElement=12,pr("StructArrayLayout4i4ub12",Qr);var tn=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){var l=this.length;this.resize(l+1);var u=8*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=n,this.uint16[u+4]=i,this.uint16[u+5]=a,this.uint16[u+6]=o,this.uint16[u+7]=s,l},e}(Yr);tn.prototype.bytesPerElement=16,pr("StructArrayLayout4i4ui16",tn);var en=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;this.resize(n+1);var i=3*n;return this.float32[i+0]=t,this.float32[i+1]=e,this.float32[i+2]=r,n},e}(Yr);en.prototype.bytesPerElement=12,pr("StructArrayLayout3f12",en);var rn=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;this.resize(e+1);var r=1*e;return this.uint32[r+0]=t,e},e}(Yr);rn.prototype.bytesPerElement=4,pr("StructArrayLayout1ul4",rn);var nn=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,u,c){var f=this.length;this.resize(f+1);var h=12*f,p=6*f;return this.int16[h+0]=t,this.int16[h+1]=e,this.int16[h+2]=r,this.int16[h+3]=n,this.int16[h+4]=i,this.int16[h+5]=a,this.uint32[p+3]=o,this.uint16[h+8]=s,this.uint16[h+9]=l,this.int16[h+10]=u,this.int16[h+11]=c,f},e}(Yr);nn.prototype.bytesPerElement=24,pr("StructArrayLayout6i1ul2ui2i24",nn);var an=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;this.resize(o+1);var s=6*o;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=a,o},e}(Yr);an.prototype.bytesPerElement=12,pr("StructArrayLayout2i2i2i12",an);var on=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)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=4*r;return this.uint8[n+0]=t,this.uint8[n+1]=e,r},e}(Yr);on.prototype.bytesPerElement=4,pr("StructArrayLayout2ub4",on);var sn=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,u,c,f,h,p){var d=this.length;this.resize(d+1);var v=20*d,g=10*d,m=40*d;return this.int16[v+0]=t,this.int16[v+1]=e,this.uint16[v+2]=r,this.uint16[v+3]=n,this.uint32[g+2]=i,this.uint32[g+3]=a,this.uint32[g+4]=o,this.uint16[v+10]=s,this.uint16[v+11]=l,this.uint16[v+12]=u,this.float32[g+7]=c,this.float32[g+8]=f,this.uint8[m+36]=h,this.uint8[m+37]=p,d},e}(Yr);sn.prototype.bytesPerElement=40,pr("StructArrayLayout2i2ui3ul3ui2f2ub40",sn);var ln=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;this.resize(e+1);var r=1*e;return this.float32[r+0]=t,e},e}(Yr);ln.prototype.bytesPerElement=4,pr("StructArrayLayout1f4",ln);var un=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;this.resize(n+1);var i=3*n;return this.int16[i+0]=t,this.int16[i+1]=e,this.int16[i+2]=r,n},e}(Yr);un.prototype.bytesPerElement=6,pr("StructArrayLayout3i6",un);var cn=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;this.resize(n+1);var i=2*n,a=4*n;return this.uint32[i+0]=t,this.uint16[a+2]=e,this.uint16[a+3]=r,n},e}(Yr);cn.prototype.bytesPerElement=8,pr("StructArrayLayout1ul2ui8",cn);var fn=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;this.resize(n+1);var i=3*n;return this.uint16[i+0]=t,this.uint16[i+1]=e,this.uint16[i+2]=r,n},e}(Yr);fn.prototype.bytesPerElement=6,pr("StructArrayLayout3ui6",fn);var hn=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;this.resize(r+1);var n=2*r;return this.uint16[n+0]=t,this.uint16[n+1]=e,r},e}(Yr);hn.prototype.bytesPerElement=4,pr("StructArrayLayout2ui4",hn);var pn=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;this.resize(r+1);var n=2*r;return this.float32[n+0]=t,this.float32[n+1]=e,r},e}(Yr);pn.prototype.bytesPerElement=8,pr("StructArrayLayout2f8",pn);var dn=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;this.resize(i+1);var a=4*i;return this.float32[a+0]=t,this.float32[a+1]=e,this.float32[a+2]=r,this.float32[a+3]=n,i},e}(Yr);dn.prototype.bytesPerElement=16,pr("StructArrayLayout4f16",dn);var vn=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},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new l(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Wr);vn.prototype.size=24;var gn=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 vn(this,t)},e}(nn);pr("CollisionBoxArray",gn);var mn=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},hidden:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},Object.defineProperties(e.prototype,r),e}(Wr);mn.prototype.size=40;var yn=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 mn(this,t)},e}(sn);pr("PlacedSymbolArray",yn);var xn=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={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(Wr);xn.prototype.size=4;var bn=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.prototype.get=function(t){return new xn(this,t)},e}(ln);pr("GlyphOffsetArray",bn);var _n=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={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(Wr);_n.prototype.size=6;var wn=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.prototype.get=function(t){return new _n(this,t)},e}(un);pr("SymbolLineVertexArray",wn);var kn=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.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(Wr);kn.prototype.size=8;var An=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 kn(this,t)},e}(cn);pr("FeatureIndexArray",An);var Tn=Xr([{name:"a_pos",components:2,type:"Int16"}],4).members,Mn=function(t){void 0===t&&(t=[]),this.segments=t};Mn.prototype.prepareSegment=function(t,e,r){var n=this.segments[this.segments.length-1];return t>Mn.MAX_VERTEX_ARRAY_LENGTH&&_("Max vertices per segment is "+Mn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Mn.MAX_VERTEX_ARRAY_LENGTH)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},this.segments.push(n)),n},Mn.prototype.get=function(){return this.segments},Mn.prototype.destroy=function(){for(var t=0,e=this.segments;tRn.max||o.yRn.max)&&_("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Bn(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Nn=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.layoutVertexArray=new $r,this.indexArray=new fn,this.segments=new Mn,this.programConfigurations=new Pn(Tn,t.layers,t.zoom)};function jn(t,e,r){for(var n=0;n=3)for(var s=0;s1){if(qn(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Xn(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 Zn(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 $n(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].statistics.max}function Jn(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Kn(t,e,r,n,i){if(!e[0]&&!e[1])return t;var a=l.convert(e);"viewport"===r&&a._rotate(-n);for(var o=[],s=0;s=zn||l<0||l>=zn)){var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=u.vertexLength;Bn(this.layoutVertexArray,s,l,-1,-1),Bn(this.layoutVertexArray,s,l,1,-1),Bn(this.layoutVertexArray,s,l,1,1),Bn(this.layoutVertexArray,s,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),u.vertexLength+=4,u.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)},pr("CircleBucket",Nn,{omit:["layers"]});var Qn={paint:new Hr({"circle-radius":new jr(P.paint_circle["circle-radius"]),"circle-color":new jr(P.paint_circle["circle-color"]),"circle-blur":new jr(P.paint_circle["circle-blur"]),"circle-opacity":new jr(P.paint_circle["circle-opacity"]),"circle-translate":new Nr(P.paint_circle["circle-translate"]),"circle-translate-anchor":new Nr(P.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Nr(P.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Nr(P.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new jr(P.paint_circle["circle-stroke-width"]),"circle-stroke-color":new jr(P.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new jr(P.paint_circle["circle-stroke-opacity"])})},ti=i(function(t,e){var r;t.exports=((r=new Float32Array(3))[0]=0,r[1]=0,r[2]=0,function(){var t=new Float32Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=0}(),{vec3:{transformMat3:function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},vec4:{transformMat4:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},mat2:{create:function(){var t=new Float32Array(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},rotate:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},scale:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*l,t[3]=o*l,t}},mat3:{create:function(){var t=new Float32Array(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromRotation:function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}},mat4:{create: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},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},translate:function(t,e,r){var n,i,a,o,s,l,u,c,f,h,p,d,v=r[0],g=r[1],m=r[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*m+e[12],t[13]=e[1]*v+e[5]*g+e[9]*m+e[13],t[14]=e[2]*v+e[6]*g+e[10]*m+e[14],t[15]=e[3]*v+e[7]*g+e[11]*m+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=f,t[9]=h,t[10]=p,t[11]=d,t[12]=n*v+s*g+f*m+e[12],t[13]=i*v+l*g+h*m+e[13],t[14]=a*v+u*g+p*m+e[14],t[15]=o*v+c*g+d*m+e[15]),t},scale:function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},multiply:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],v=e[12],g=e[13],m=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*v,t[1]=x*i+b*l+_*h+w*g,t[2]=x*a+b*u+_*p+w*m,t[3]=x*o+b*c+_*d+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*f+w*v,t[5]=x*i+b*l+_*h+w*g,t[6]=x*a+b*u+_*p+w*m,t[7]=x*o+b*c+_*d+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*f+w*v,t[9]=x*i+b*l+_*h+w*g,t[10]=x*a+b*u+_*p+w*m,t[11]=x*o+b*c+_*d+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*f+w*v,t[13]=x*i+b*l+_*h+w*g,t[14]=x*a+b*u+_*p+w*m,t[15]=x*o+b*c+_*d+w*y,t},perspective:function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},rotateX:function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t},rotateZ:function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t},invert:function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],g=e[14],m=e[15],y=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,k=i*u-a*l,A=c*v-f*d,T=c*g-h*d,M=c*m-p*d,E=f*g-h*v,S=f*m-p*v,C=h*m-p*g,L=y*C-x*S+b*E+_*M-w*T+k*A;return L?(L=1/L,t[0]=(s*C-l*S+u*E)*L,t[1]=(i*S-n*C-a*E)*L,t[2]=(v*k-g*w+m*_)*L,t[3]=(h*w-f*k-p*_)*L,t[4]=(l*M-o*C-u*T)*L,t[5]=(r*C-i*M+a*T)*L,t[6]=(g*b-d*k-m*x)*L,t[7]=(c*k-h*b+p*x)*L,t[8]=(o*S-s*M+u*A)*L,t[9]=(n*M-r*S-a*A)*L,t[10]=(d*w-v*b+m*y)*L,t[11]=(f*b-c*w-p*y)*L,t[12]=(s*T-o*E-l*A)*L,t[13]=(r*E-n*T+i*A)*L,t[14]=(v*x-d*_-g*y)*L,t[15]=(c*_-f*x+h*y)*L,t):null},ortho:function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t}}})}),ei=(ti.vec3,ti.vec4),ri=(ti.mat2,ti.mat3,ti.mat4),ni=function(t){function e(e){t.call(this,e,Qn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Nn(t)},e.prototype.queryRadius=function(t){var e=t;return $n("circle-radius",this,e)+$n("circle-stroke-width",this,e)+Jn(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){for(var s=Kn(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),i.angle,a),l=this.paint.get("circle-radius").evaluate(e)+this.paint.get("circle-stroke-width").evaluate(e),u="map"===this.paint.get("circle-pitch-alignment"),c=u?s:function(t,e,r){return t.map(function(t){return t.map(function(t){return ii(t,e,r)})})}(s,o,i),f=u?l*a:l,h=0,p=r;ht.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);u=0!==(u=Math.max(a-n,o-i))?1/u:0}return wi(h,p,r,n,i,u),p}function bi(t,e,r,n,i){var a,o;if(i===Vi(t,e,r,n)>0)for(a=e;a=e;a-=n)o=Bi(a,t[a],t[a+1],o);return o&&Di(o,o.next)&&(Ni(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||!Di(n,n.next)&&0!==Pi(n.prev,n,n.next))n=n.next;else{if(Ni(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function wi(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=Ci(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,u=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,u*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Ai(t,n,i,a):ki(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ni(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?wi(t=Ti(t,e,r),e,r,n,i,a,2):2===o&&Mi(t,e,r,n,i,a):wi(_i(t),e,r,n,i,a,1);break}}}function ki(t){var e=t.prev,r=t,n=t.next;if(Pi(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Oi(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Pi(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ai(t,e,r,n){var i=t.prev,a=t,o=t.next;if(Pi(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,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=Ci(s,l,e,r,n),h=Ci(u,c,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=f&&d&&d.z<=h;){if(p!==t.prev&&p!==t.next&&Oi(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Pi(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&Oi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Pi(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&Oi(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Pi(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&Oi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Pi(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Ti(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!Di(i,a)&&zi(i,n,n.next,a)&&Ri(i,a)&&Ri(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ni(n),Ni(n.next),n=t=a),n=n.next}while(n!==t);return n}function Mi(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Ii(o,s)){var l=Fi(o,s);return o=_i(o,o.next),l=_i(l,l.next),wi(o,e,r,n,i,a),void wi(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function Ei(t,e){return t.x-e.x}function Si(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>=c&&i!==n.x&&Oi(ar.x)&&Ri(n,t)&&(r=n,h=l),n=n.next;return r}(t,e)){var r=Fi(e,t);_i(r,r.next)}}function Ci(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 Li(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 Ii(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&&zi(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&Ri(t,e)&&Ri(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)}function Pi(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Di(t,e){return t.x===e.x&&t.y===e.y}function zi(t,e,r,n){return!!(Di(t,e)&&Di(r,n)||Di(t,n)&&Di(r,e))||Pi(t,e,r)>0!=Pi(t,e,n)>0&&Pi(r,n,t)>0!=Pi(r,n,e)>0}function Ri(t,e){return Pi(t.prev,t,t.next)<0?Pi(t,e,t.next)>=0&&Pi(t,t.prev,e)>=0:Pi(t,e,t.prev)<0||Pi(t,t.next,e)<0}function Fi(t,e){var r=new ji(t.i,t.x,t.y),n=new ji(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 Bi(t,e,r,n){var i=new ji(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 Ni(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 ji(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 Vi(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},mi.default=yi;var Ui=qi,Hi=qi;function qi(t,e,r,n,i){!function t(e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-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),f=Math.max(n,Math.floor(r-s*u/o+c)),h=Math.min(i,Math.floor(r+(o-s)*u/o+c));t(e,r,f,h,a)}var p=e[r],d=n,v=i;for(Gi(e,n,r),a(e[i],p)>0&&Gi(e,n,i);d0;)v--}0===a(e[n],p)?Gi(e,n,v):Gi(e,++v,i),v<=r&&(n=v+1),r<=v&&(i=v-1)}}(t,e,r||0,n||t.length-1,i||Wi)}function Gi(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Wi(t,e){return te?1:0}function Yi(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;lzn)||t.y===e.y&&(t.y<0||t.y>zn)}function na(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>zn})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>zn})}ea.prototype.populate=function(t,e){for(var r=0,n=t;r=1){var v=f[p-1];if(!ra(d,v)){l.vertexLength+4>Mn.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=d.sub(v)._perp()._unit(),m=v.dist(d);h+m>32768&&(h=0),ta(this.layoutVertexArray,d.x,d.y,g.x,g.y,0,0,h),ta(this.layoutVertexArray,d.x,d.y,g.x,g.y,0,1,h),h+=m,ta(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,h),ta(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,1,h);var y=l.vertexLength;this.indexArray.emplaceBack(y,y+1,y+2),this.indexArray.emplaceBack(y+1,y+2,y+3),l.vertexLength+=4,l.primitiveLength+=2}}}}l.vertexLength+a>Mn.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(a,this.layoutVertexArray,this.indexArray));for(var x=[],b=[],_=l.vertexLength,w=0,k=i;w>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},la.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},la.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(),u=la.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 da(t,e,r){if(3===t){var n=new fa(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ha.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 sa(this._pbf,e,this.extent,this._keys,this._values)};var va={VectorTile:function(t,e){this.layers=t.readFields(da,{},e)},VectorTileFeature:sa,VectorTileLayer:fa},ga=va.VectorTileFeature.types,ma=63,ya=Math.cos(Math.PI/180*37.5),xa=.5,ba=Math.pow(2,14)/xa;function _a(t,e,r,n,i,a,o){t.emplaceBack(e.x,e.y,n?1:0,i?1:-1,Math.round(ma*r.x)+128,Math.round(ma*r.y)+128,1+(0===a?0:a<0?-1:1)|(o*xa&63)<<2,o*xa>>6)}var wa=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.layoutVertexArray=new Qr,this.indexArray=new fn,this.programConfigurations=new Pn(oa,t.layers,t.zoom),this.segments=new Mn};function ka(t,e){return(t/e.tileTotal*(e.end-e.start)+e.start)*(ba-1)}wa.prototype.populate=function(t,e){for(var r=0,n=t;r=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;uu){var S=p.dist(x);if(S>2*c){var C=p.sub(p.sub(x)._mult(c/S)._round());this.distance+=C.dist(x),this.addCurrentVertex(C,this.distance,_.mult(1),0,0,!1,h,o),x=C}}var L=x&&b,O=L?r:b?g:m;if(L&&"round"===O&&(Mi&&(O="bevel"),"bevel"===O&&(M>2&&(O="flipbevel"),M100)A=w.clone().mult(-1);else{var I=_.x*w.y-_.y*w.x>0?-1:1,P=M*_.add(w).mag()/_.sub(w).mag();A._perp()._mult(P*I)}this.addCurrentVertex(p,this.distance,A,0,0,!1,h,o),this.addCurrentVertex(p,this.distance,A.mult(-1),0,0,!1,h,o)}else if("bevel"===O||"fakeround"===O){var D=_.x*w.y-_.y*w.x>0,z=-Math.sqrt(M*M-1);if(D?(v=0,d=z):(d=0,v=z),y||this.addCurrentVertex(p,this.distance,_,d,v,!1,h,o),"fakeround"===O){for(var R=Math.floor(8*(.5-(T-.5))),F=void 0,B=0;B=0;N--)F=_.mult((N+1)/(R+1))._add(w)._unit(),this.addPieSliceVertex(p,this.distance,F,D,h,o)}b&&this.addCurrentVertex(p,this.distance,w,-d,-v,!1,h,o)}else"butt"===O?(y||this.addCurrentVertex(p,this.distance,_,0,0,!1,h,o),b&&this.addCurrentVertex(p,this.distance,w,0,0,!1,h,o)):"square"===O?(y||(this.addCurrentVertex(p,this.distance,_,1,1,!1,h,o),this.e1=this.e2=-1),b&&this.addCurrentVertex(p,this.distance,w,-1,-1,!1,h,o)):"round"===O&&(y||(this.addCurrentVertex(p,this.distance,_,0,0,!1,h,o),this.addCurrentVertex(p,this.distance,_,1,1,!0,h,o),this.e1=this.e2=-1),b&&(this.addCurrentVertex(p,this.distance,w,-1,-1,!0,h,o),this.addCurrentVertex(p,this.distance,w,0,0,!1,h,o)));if(E&&k2*c){var V=p.add(b.sub(p)._mult(c/j)._round());this.distance+=V.dist(p),this.addCurrentVertex(V,this.distance,w.mult(1),0,0,!1,h,o),p=V}}y=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)}},wa.prototype.addCurrentVertex=function(t,e,r,n,i,a,o,s){var l,u=this.layoutVertexArray,c=this.indexArray;s&&(e=ka(e,s)),l=r.clone(),n&&l._sub(r.perp()._mult(n)),_a(u,t,l,a,!1,n,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=r.mult(-1),i&&l._sub(r.perp()._mult(i)),_a(u,t,l,a,!0,-i,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>ba/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a,o))},wa.prototype.addPieSliceVertex=function(t,e,r,n,i,a){r=r.mult(n?-1:1);var o=this.layoutVertexArray,s=this.indexArray;a&&(e=ka(e,a)),_a(o,t,r,!1,n,0,e),this.e3=i.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),i.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3},pr("LineBucket",wa,{omit:["layers"]});var Aa=new Hr({"line-cap":new Nr(P.layout_line["line-cap"]),"line-join":new jr(P.layout_line["line-join"]),"line-miter-limit":new Nr(P.layout_line["line-miter-limit"]),"line-round-limit":new Nr(P.layout_line["line-round-limit"])}),Ta={paint:new Hr({"line-opacity":new jr(P.paint_line["line-opacity"]),"line-color":new jr(P.paint_line["line-color"]),"line-translate":new Nr(P.paint_line["line-translate"]),"line-translate-anchor":new Nr(P.paint_line["line-translate-anchor"]),"line-width":new jr(P.paint_line["line-width"]),"line-gap-width":new jr(P.paint_line["line-gap-width"]),"line-offset":new jr(P.paint_line["line-offset"]),"line-blur":new jr(P.paint_line["line-blur"]),"line-dasharray":new Vr(P.paint_line["line-dasharray"]),"line-pattern":new Vr(P.paint_line["line-pattern"]),"line-gradient":new Ur(P.paint_line["line-gradient"])}),layout:Aa},Ma=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 Lr(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){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n)},e}(jr))(Ta.paint.properties["line-width"].specification);Ma.useIntegerZoom=!0;var Ea=function(t){function e(e){t.call(this,e,Ta)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setPaintProperty=function(e,r,n){t.prototype.setPaintProperty.call(this,e,r,n),"line-gradient"===e&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=hi(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=Ma.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new wa(t)},e.prototype.queryRadius=function(t){var e=t,r=Sa($n("line-width",this,e),$n("line-gap-width",this,e)),n=$n("line-offset",this,e);return r/2+Math.abs(n)+Jn(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a){var o=Kn(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),i.angle,a),s=a/2*Sa(this.paint.get("line-width").evaluate(e),this.paint.get("line-gap-width").evaluate(e)),u=this.paint.get("line-offset").evaluate(e);return u&&(r=function(t,e){for(var r=[],n=new l(0,0),i=0;i0?e+2*t:t}var Ca=Xr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),La=Xr([{name:"a_projected_pos",components:3,type:"Float32"}],4),Oa=(Xr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Xr([{name:"a_placed",components:2,type:"Uint8"}],4)),Ia=(Xr([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Xr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Pa=Xr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function Da(t,e,r){var n=e.layout.get("text-transform").evaluate(r);return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Cr.applyArabicShaping&&(t=Cr.applyArabicShaping(t)),t}Xr([{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:"hidden"}]),Xr([{type:"Float32",name:"offsetX"}]),Xr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var za={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ra=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(l);function Fa(t,e){var r=e.expression;if("constant"===r.kind)return{functionType:"constant",layoutSize:r.evaluate(new Lr(t+1))};if("source"===r.kind)return{functionType:"source"};for(var n=r.zoomStops,i=0;i0)&&("constant"!==i.value.kind||i.value.value.length>0),l="constant"!==o.value.kind||o.value.value&&o.value.value.length>0;if(this.features=[],s||l){for(var u=e.iconDependencies,c=e.glyphDependencies,f=new Lr(this.zoom),h=0,p=t;h=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;this.addCollisionDebugVertices(s,l,u,c,f?this.collisionCircle:this.collisionBox,o.anchorPoint,r,f)}}}},qa.prototype.deserializeCollisionBoxes=function(t,e,r,n,i){for(var a={},o=e;o0},qa.prototype.hasIconData=function(){return this.icon.segments.get().length>0},qa.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},qa.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},qa.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&(this.sortedAngle=t,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var r=[],n=0;ni.maxh||t>i.maxw||r<=i.maxh&&t<=i.maxw&&(o=i.maxw*i.maxh-t*r)a.free)){if(r===a.h)return this.allocShelf(s,t,r,n);r>a.h||rc)&&(f=2*Math.max(t,c)),(ll)&&(u=2*Math.max(r,l)),this.resize(f,u),this.packOne(t,r,n)):null},t.prototype.allocFreebin=function(t,e,r,n){var i=this.freebins.splice(t,1)[0];return i.id=n,i.w=e,i.h=r,i.refcount=0,this.bins[n]=i,this.ref(i),i},t.prototype.allocShelf=function(t,e,r,n){var i=this.shelves[t].alloc(e,r,n);return this.bins[n]=i,this.ref(i),i},t.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,r=0;rthis.free||e>this.h)return null;var n=this.x;return this.x+=t,this.free-=t,new function(t,e,r,n,i,a,o){this.id=t,this.x=e,this.y=r,this.w=n,this.h=i,this.maxw=a||n,this.maxh=o||i,this.refcount=0}(r,n,this.y,t,e,t,this.h)},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t}()}),Qa=function(t,e){var r=e.pixelRatio;this.paddedRect=t,this.pixelRatio=r},to={tl:{configurable:!0},br:{configurable:!0},displaySize:{configurable:!0}};to.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},to.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},to.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Qa.prototype,to);var eo=function(t){var e=new ci({width:0,height:0}),r={},n=new Ka(0,0,{autoResize:!0});for(var i in t){var a=t[i],o=n.packOne(a.data.width+2,a.data.height+2);e.resize({width:n.w,height:n.h}),ci.copy(a.data,e,{x:0,y:0},{x:o.x+1,y:o.y+1},a.data),r[i]=new Qa(o,a)}n.shrink(),e.resize({width:n.w,height:n.h}),this.image=e,this.positions=r};pr("ImagePosition",Qa),pr("ImageAtlas",eo);var ro=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},no=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,v=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,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,u-=8);t[r+p-d]|=128*v},io=ao;function ao(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function oo(t){return t.type===ao.Bytes?t.readVarint()+t.pos:t.pos+1}function so(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function lo(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function uo(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function _o(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ao.Varint=0,ao.Fixed64=1,ao.Bytes=2,ao.Fixed32=5,ao.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=xo(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_o(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=xo(this.buf,this.pos)+4294967296*xo(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=xo(this.buf,this.pos)+4294967296*_o(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ro(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ro(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 so(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return so(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return so(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return so(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return so(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return so(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=function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=t[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<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),i+=c}return n}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=oo(this);for(t=t||[];this.pos127;);else if(e===ao.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ao.Fixed32)this.pos+=4;else{if(e!==ao.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;if(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)),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;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(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&&lo(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),no(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),no(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&&lo(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ao.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,uo,e)},writePackedSVarint:function(t,e){this.writeMessage(t,co,e)},writePackedBoolean:function(t,e){this.writeMessage(t,po,e)},writePackedFloat:function(t,e){this.writeMessage(t,fo,e)},writePackedDouble:function(t,e){this.writeMessage(t,ho,e)},writePackedFixed32:function(t,e){this.writeMessage(t,vo,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,go,e)},writePackedFixed64:function(t,e){this.writeMessage(t,mo,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,yo,e)},writeBytesField:function(t,e){this.writeTag(t,ao.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ao.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ao.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ao.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ao.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ao.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ao.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ao.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ao.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ao.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var wo=3;function ko(t,e,r){1===t&&r.readMessage(Ao,e)}function Ao(t,e,r){if(3===t){var n=r.readMessage(To,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;e.push({id:i,bitmap:new ui({width:o+2*wo,height:s+2*wo},a),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function To(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())}var Mo=wo,Eo=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,v(["receive"],this),this.target.addEventListener("message",this.receive,!1)};Eo.prototype.send=function(t,e,r,n){var i=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[i]=r);var a=[];this.target.postMessage({targetMapId:n,sourceMapId:this.mapId,type:t,id:String(i),data:vr(e,a)},a)},Eo.prototype.receive=function(t){var e,r=this,n=t.data,i=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var a=function(t,e){var n=[];r.target.postMessage({sourceMapId:r.mapId,type:"",id:String(i),error:t?vr(t):null,data:vr(e,n)},n)};if(""===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&n.error?e(gr(n.error)):e&&e(null,gr(n.data));else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,gr(n.data),a);else if(void 0!==n.id&&this.parent.getWorkerSource){var o=n.type.split(".");this.parent.getWorkerSource(n.sourceMapId,o[0],o[1])[o[2]](gr(n.data),a)}else this.parent[n.type](gr(n.data))}},Eo.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var So=n(i(function(t,e){!function(t){function e(t,e,n){e=Math.pow(2,n)-e-1;var i=r(256*t,256*e,n),a=r(256*(t+1),256*(e+1),n);return i[0]+","+i[1]+","+a[0]+","+a[1]}function r(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,a=e*n-2*Math.PI*6378137/2;return[i,a]}t.getURL=function(t,r,n,i,a,o){return o=o||{},t+"?"+["bbox="+e(n,i,a),"format="+(o.format||"image/png"),"service="+(o.service||"WMS"),"version="+(o.version||"1.1.1"),"request="+(o.request||"GetMap"),"srs="+(o.srs||"EPSG:3857"),"width="+(o.width||256),"height="+(o.height||256),"layers="+r].join("&")},t.getTileBBox=e,t.getMercCoords=r,Object.defineProperty(t,"__esModule",{value:!0})}(e)})),Co=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Io(0,t,e,r)};Co.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Co.prototype.url=function(t,e){var r=So.getTileBBox(this.x,this.y,this.z),n=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new Oo(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Oo(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Oo.prototype.isChildOf=function(t){var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Oo.prototype.children=function(t){if(this.overscaledZ>=t)return[new Oo(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 Oo(e,this.wrap,e,r,n),new Oo(e,this.wrap,e,r+1,n),new Oo(e,this.wrap,e,r,n+1),new Oo(e,this.wrap,e,r+1,n+1)]},Oo.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+this.border||e<-this.border||e>=this.dim+this.border)throw new RangeError("out of range source coordinates for DEM data");return(e+this.border)*this.stride+(t+this.border)},pr("Level",Po);var Do=function(t,e,r){this.uid=t,this.scale=e||1,this.level=r||new Po(256,512),this.loaded=!!r};Do.prototype.loadFromImage=function(t,e){if(t.height!==t.width)throw new RangeError("DEM tiles must be square");if(e&&"mapbox"!==e&&"terrarium"!==e)return _('"'+e+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var r=this.level=new Po(t.width,t.width/2),n=t.data;this._unpackData(r,n,e||"mapbox");for(var i=0;i=0&&l[3]>=0&&this.grid.insert(a,l[0],l[1],l[2],l[3])}},Bo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new va.VectorTile(new io(this.rawTileData)).layers,this.sourceLayerCoder=new zo(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Bo.prototype.query=function(t,e){var r=this;this.loadVTLayers();for(var n=t.params||{},i=zn/t.tileSize/t.scale,a=Re(n.filter),o=t.queryGeometry,s=t.queryPadding*i,l=1/0,u=1/0,c=-1/0,f=-1/0,h=0;h=0)return!0;return!1}(a,l)){var u=this.sourceLayerCoder.decode(r),c=this.vtLayers[u].feature(n);if(i(new Lr(this.tileID.overscaledZ),c))for(var f=0;f=200&&r.status<300&&r.response){var n;try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n)}else 401===r.status&&t.url.match(/mapbox.com/)?e(new T(r.statusText+": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens",r.status,t.url)):e(new T(r.statusText,r.status,t.url))},r.send(),r},e.getImage=function(t,e){return E(t,function(t,r){if(t)e(t);else if(r){var n=new self.Image,i=self.URL||self.webkitURL;n.onload=function(){e(null,n),i.revokeObjectURL(n.src)};var a=new self.Blob([new Uint8Array(r.data)],{type:"image/png"});n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data.byteLength?i.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}})},e.ResourceType=A,e.RGBAImage=ci,e.default$2=Ka,e.ImagePosition=Qa,e.getArrayBuffer=E,e.default$3=function(t){return new io(t).readFields(ko,[])},e.default$4=yr,e.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i)})})},e.AlphaImage=ui,e.default$5=P,e.endsWith=g,e.extend=p,e.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},e.Evented=I,e.validateStyle=nr,e.validateLight=ir,e.emitValidationErrors=sr,e.default$6=tt,e.number=wt,e.Properties=Hr,e.Transitionable=Pr,e.Transitioning=zr,e.PossiblyEvaluated=Br,e.DataConstantProperty=Nr,e.warnOnce=_,e.uniqueId=function(){return d++},e.default$7=Eo,e.pick=function(t,e){for(var r={},n=0;n@\,;\:\\"\/\[\]\?\=\{\}\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},e.default$11=Bo,e.default$12=Ro,e.default$13=Re,e.default$14=qa,e.CollisionBoxArray=gn,e.default$15=Mn,e.TriangleIndexArray=fn,e.default$16=Lr,e.default$17=s,e.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},e.default$18=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.mat4=ri,e.vec4=ei,e.getSizeData=Fa,e.evaluateSizeForFeature=function(t,e,r){var n=e;return"source"===t.functionType?r.lowerSize/10:"composite"===t.functionType?wt(r.lowerSize/10,r.upperSize/10,n.uSizeT):n.uSize},e.evaluateSizeForZoom=function(t,e,r){if("constant"===t.functionType)return{uSizeT:0,uSize:t.layoutSize};if("source"===t.functionType)return{uSizeT:0,uSize:0};if("camera"===t.functionType){var n=t.propertyValue,i=t.zoomRange,a=t.sizeRange,o=h(Ee(n,r.specification).interpolationFactor(e,i.min,i.max),0,1);return{uSizeT:0,uSize:a.min+o*(a.max-a.min)}}var s=t.propertyValue,l=t.zoomRange;return{uSizeT:h(Ee(s,r.specification).interpolationFactor(e,l.min,l.max),0,1),uSize:0}},e.addDynamicAttributes=Va,e.default$19=Wa,e.WritingMode=jo,e.multiPolygonIntersectsBufferedPoint=jn,e.multiPolygonIntersectsMultiPolygon=Vn,e.multiPolygonIntersectsBufferedMultiLine=Un,e.polygonIntersectsPolygon=function(t,e){for(var r=0;r-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=[],u=0;sn;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=f.dist(h)}return!0}function a(e,r,n,a,o,s,l,u,c){var f=a?.6*s*l:0,h=Math.max(a?a.right-a.left:0,o?o.right-o.left:0),p=0===e[0].x||e[0].x===c||0===e[0].y||e[0].y===c;return r-h*l=0&&A=0&&T=0&&g+h<=p){var M=new t.default$25(A,T,w,y);M._round(),o&&!i(r,M,l,o,s)||m.push(M)}}v+=_}return c||m.length||u||(m=e(r,v/2,a,o,s,l,u,!0,f)),m}(e,p?r/2*u%r:(h/2+2*s)*l*u%r,r,f,n,h*l,p,!1,c)}n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var i=this,a=0,o=e;a0&&(v=Math.max(10*s,v),this._addLineCollisionCircles(t,e,r,r.segment,g,v,n,i,a,c))}else t.emplaceBack(r.x,r.y,p,f,d,h,n,i,a,0,0);this.boxEndIndex=t.length};s.prototype._addLineCollisionCircles=function(t,e,r,n,i,a,o,s,l,u){var c=a/2,f=Math.floor(i/c),h=1+.4*Math.log(u)/Math.LN2,p=Math.floor(f*h/2),d=-a/2,v=r,g=n+1,m=d,y=-i/2,x=y-i/4;do{if(--g<0){if(m>y)return;g=0;break}m-=e[g].dist(v),v=e[g]}while(m>x);for(var b=e[g].dist(e[g+1]),_=-p;_i&&(k+=w-i),!(k=e.length)return;b=e[g].dist(e[g+1])}var A=k-m,T=e[g],M=e[g+1].sub(T)._unit()._mult(A)._add(T)._round(),E=Math.abs(k-d)0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}function f(t,e){return te?1:0}function h(e,r,n){void 0===r&&(r=1),void 0===n&&(n=!1);for(var i=1/0,a=1/0,o=-1/0,s=-1/0,u=e[0],c=0;co)&&(o=f.x),(!c||f.y>s)&&(s=f.y)}var h=o-i,v=s-a,g=Math.min(h,v),m=g/2,y=new l(null,p);if(0===g)return new t.default$1(i,a);for(var x=i;x_.d||!_.d)&&(_=k,n&&console.log("found best %d after %d probes",Math.round(1e4*k.d)/1e4,w)),k.max-_.d<=r||(m=k.h/2,y.push(new d(k.p.x-m,k.p.y-m,m,e)),y.push(new d(k.p.x+m,k.p.y-m,m,e)),y.push(new d(k.p.x-m,k.p.y+m,m,e)),y.push(new d(k.p.x+m,k.p.y+m,m,e)),w+=4)}return n&&(console.log("num probes: "+w),console.log("best distance: "+_.d)),_.p}function p(t,e){return e.max-t.max}function d(e,r,n,i){this.p=new t.default$1(e,r),this.h=n,this.d=function(e,r){for(var n=!1,i=1/0,a=0;ae.y!=f.y>e.y&&e.x<(f.x-c.x)*(e.y-c.y)/(f.y-c.y)+c.x&&(n=!n),i=Math.min(i,t.distToSegmentSquared(e,c,f))}return(n?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}function v(e,r,n,i,a,o){e.createArrays(),e.symbolInstances=[];var s=512*e.overscaling;e.tilePixelRatio=t.default$8/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,u=e.layers[0]._unevaluatedLayout._values,c={};if("composite"===e.textSizeData.functionType){var f=e.textSizeData.zoomRange,h=f.min,p=f.max;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new t.default$16(h)),u["text-size"].possiblyEvaluate(new t.default$16(p))]}if("composite"===e.iconSizeData.functionType){var d=e.iconSizeData.zoomRange,v=d.min,m=d.max;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new t.default$16(v)),u["icon-size"].possiblyEvaluate(new t.default$16(m))]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new t.default$16(e.zoom+1)),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new t.default$16(e.zoom+1)),c.textMaxSize=u["text-size"].possiblyEvaluate(new t.default$16(18));for(var y=24*l.get("text-line-height"),x="map"===l.get("text-rotation-alignment")&&"line"===l.get("symbol-placement"),b=l.get("text-keep-upright"),_=0,w=e.features;_=t.default$8||c.y<0||c.y>=t.default$8||e.symbolInstances.push(function(e,r,n,i,a,l,u,c,f,h,p,d,v,g,y,x,b,_,w,k,A){var T,M,E=e.addToLineVertexArray(r,n),S=0,C=0,L=0,O=i.horizontal?i.horizontal.text:"",I=[];i.horizontal&&(T=new s(u,n,r,c,f,h,i.horizontal,p,d,v,e.overscaling),C+=m(e,r,i.horizontal,l,v,w,g,E,i.vertical?t.WritingMode.horizontal:t.WritingMode.horizontalOnly,I,k,A),i.vertical&&(L+=m(e,r,i.vertical,l,v,w,g,E,t.WritingMode.vertical,I,k,A)));var P=T?T.boxStartIndex:e.collisionBoxArray.length,D=T?T.boxEndIndex:e.collisionBoxArray.length;if(a){var z=function(e,r,n,i,a,o){var s,l,u,c,f=r.image,h=n.layout,p=r.top-1/f.pixelRatio,d=r.left-1/f.pixelRatio,v=r.bottom+1/f.pixelRatio,g=r.right+1/f.pixelRatio;if("none"!==h.get("icon-text-fit")&&a){var m=g-d,y=v-p,x=h.get("text-size").evaluate(o)/24,b=a.left*x,_=a.right*x,w=a.top*x,k=_-b,A=a.bottom*x-w,T=h.get("icon-text-fit-padding")[0],M=h.get("icon-text-fit-padding")[1],E=h.get("icon-text-fit-padding")[2],S=h.get("icon-text-fit-padding")[3],C="width"===h.get("icon-text-fit")?.5*(A-y):0,L="height"===h.get("icon-text-fit")?.5*(k-m):0,O="width"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?k:m,I="height"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?A:y;s=new t.default$1(b+L-S,w+C-T),l=new t.default$1(b+L+M+O,w+C-T),u=new t.default$1(b+L+M+O,w+C+E+I),c=new t.default$1(b+L-S,w+C+E+I)}else s=new t.default$1(d,p),l=new t.default$1(g,p),u=new t.default$1(g,v),c=new t.default$1(d,v);var P=n.layout.get("icon-rotate").evaluate(o)*Math.PI/180;if(P){var D=Math.sin(P),z=Math.cos(P),R=[z,-D,D,z];s._matMult(R),l._matMult(R),c._matMult(R),u._matMult(R)}return[{tl:s,tr:l,bl:c,br:u,tex:f.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,a,l,0,i.horizontal,w);M=new s(u,n,r,c,f,h,a,y,x,!1,e.overscaling),S=4*z.length;var R=e.iconSizeData,F=null;"source"===R.functionType?F=[10*l.layout.get("icon-size").evaluate(w)]:"composite"===R.functionType&&(F=[10*A.compositeIconSizes[0].evaluate(w),10*A.compositeIconSizes[1].evaluate(w)]),e.addSymbols(e.icon,z,F,_,b,w,!1,r,E.lineStartIndex,E.lineLength)}var B=M?M.boxStartIndex:e.collisionBoxArray.length,N=M?M.boxEndIndex:e.collisionBoxArray.length;e.glyphOffsetArray.length>=t.default$14.MAX_GLYPHS&&t.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var j=new o,V=new o;return{key:O,textBoxStartIndex:P,textBoxEndIndex:D,iconBoxStartIndex:B,iconBoxEndIndex:N,textOffset:g,iconOffset:_,anchor:r,line:n,featureIndex:c,feature:w,numGlyphVertices:C,numVerticalGlyphVertices:L,numIconVertices:S,textOpacityState:j,iconOpacityState:V,isDuplicate:!1,placedTextSymbolIndices:I,crossTileID:0}}(e,c,a,n,i,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,b,A,E,v,w,T,S,g,r,l,u))};if("line"===d.get("symbol-placement"))for(var O=0,I=function(e,r,n,i,a){for(var o=[],s=0;s=i&&h.x>=i||(f.x>=i?f=new t.default$1(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new t.default$1(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new t.default$1(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new t.default$1(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),u&&f.equals(u[u.length-1])||(u=[f],o.push(u)),u.push(h)))))}return o}(r.geometry,0,0,t.default$8,t.default$8);O=0;o--)if(n.dist(a[o])0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_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},_down:function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=s,t=a}e[t]=i}},l.default=u;var x=function(e){var r=new t.AlphaImage({width:0,height:0}),n={},i=new t.default$2(0,0,{autoResize:!0});for(var a in e){var o=e[a],s=n[a]={};for(var l in o){var u=o[+l];if(u&&0!==u.bitmap.width&&0!==u.bitmap.height){var c=i.packOne(u.bitmap.width+2,u.bitmap.height+2);r.resize({width:i.w,height:i.h}),t.AlphaImage.copy(u.bitmap,r,{x:0,y:0},{x:c.x+1,y:c.y+1},u.bitmap),s[l]={rect:c,metrics:u.metrics}}}}i.shrink(),r.resize({width:i.w,height:i.h}),this.image=r,this.positions=n};t.register("GlyphAtlas",x);var b=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming};function _(e,r){for(var n=new t.default$16(r),i=0,a=e;i=M.maxzoom||"none"!==M.visibility&&(_(T,a.zoom),(f[M.id]=M.createBucket({index:s.bucketLayerIDs.length,layers:T,zoom:a.zoom,pixelRatio:a.pixelRatio,overscaling:a.overscaling,collisionBoxArray:a.collisionBoxArray,sourceLayerIndex:m})).populate(y,h),s.bucketLayerIDs.push(T.map(function(t){return t.id})))}}}var E=t.mapObject(h.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(E).length?n.send("getGlyphs",{uid:this.uid,stacks:E},function(t,e){l||(l=t,u=e,C.call(a))}):u={};var S=Object.keys(h.iconDependencies);function C(){if(l)return i(l);if(u&&c){var e=new x(u),r=new t.default$28(c);for(var n in f){var a=f[n];a instanceof t.default$14&&(_(a.layers,this.zoom),v(a,u,e.positions,c,r.positions,this.showCollisionBoxes))}this.status="done",i(null,{buckets:t.values(f).filter(function(t){return!t.isEmpty()}),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,iconAtlasImage:r.image})}}S.length?n.send("getImages",{icons:S},function(t,e){l||(l=t,c=e,C.call(a))}):c={},C.call(this)};var w=function(t){return!(!performance||!performance.getEntriesByName)&&performance.getEntriesByName(t)};function k(e,r){var n=t.getArrayBuffer(e.request,function(e,n){e?r(e):n&&r(null,{vectorTile:new t.default$29.VectorTile(new t.default$30(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires})});return function(){n.abort(),r()}}var A=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||k,this.loading={},this.loaded={}};A.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=this.loading[i]=new b(e);a.abort=this.loadVectorData(e,function(o,s){if(delete n.loading[i],o||!s)return r(o);var l=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl);var c={};if(e.request&&e.request.collectResourceTiming){var f=w(e.request.url);f&&(c.resourceTiming=JSON.parse(JSON.stringify(f)))}a.vectorTile=s.vectorTile,a.parse(s.vectorTile,n.layerIndex,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[i]=a})},A.prototype.reloadTile=function(t,e){var r=this.loaded,n=t.uid,i=this;if(r&&r[n]){var a=r[n];a.showCollisionBoxes=t.showCollisionBoxes;var o=function(t,r){var n=a.reloadCallback;n&&(delete a.reloadCallback,a.parse(a.vectorTile,i.layerIndex,i.actor,n)),e(t,r)};"parsing"===a.status?a.reloadCallback=o:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,o)}},A.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()},A.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var T=function(){this.loading={},this.loaded={}};T.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=new t.default$31(n);this.loading[n]=a,a.loadFromImage(e.rawImageData,i),delete this.loading[n],this.loaded=this.loaded||{},this.loaded[n]=a,r(null,a)},T.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var M={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function E(t){var e=0;if(t&&t.length>0){e+=Math.abs(S(t[0]));for(var r=1;r2){for(o=0;o=0}(t)===e?t:t.reverse()}var D=t.default$29.VectorTileFeature.prototype.toGeoJSON,z=function(e){this._feature=e,this.extent=t.default$8,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};z.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function $(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;si;){if(a-i>600){var s=a-i+1,l=n-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),h=Math.max(i,Math.floor(n-l*c/s+f)),p=Math.min(a,Math.floor(n+(s-l)*c/s+f));t(e,r,n,h,p,o)}var d=r[2*n+o],v=i,g=a;for(Q(e,r,i,n),r[2*a+o]>d&&Q(e,r,i,a);vd;)g--}r[2*i+o]===d?Q(e,r,i,g):Q(e,r,++g,a),g<=n&&(i=g+1),n<=g&&(a=g-1)}}(e,r,s,i,a,o%2),t(e,r,n,i,s-1,o+1),t(e,r,n,s+1,a,o+1)}};function Q(t,e,r,n){tt(t,r,n),tt(e,2*r,2*n),tt(e,2*r+1,2*n+1)}function tt(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function et(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}var rt=function(t,e,r,n,i){return new nt(t,e,r,n,i)};function nt(t,e,r,n,i){e=e||it,r=r||at,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var a=0;a=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return pt(pt({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function ft(t){return t/360+.5}function ht(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 pt(t,e){for(var r in e)t[r]=e[r];return t}function dt(t){return t.x}function vt(t){return t.y}function gt(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 mt(t,e,r,n){var i={id:t||null,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)yt(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*u-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-a,2))),i=l,a=u}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var a,o=i,s=e[r],l=e[r+1],u=e[n],c=e[n+1],f=r+3;fo&&(a=f,o=h)}o>i&&(a-r>3&&t(e,r,a,i),e[a+2]=o,n-a>3&&t(e,a,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function wt(t,e,r,n){for(var i=0;i1?1:r}function Tt(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<=n)return t;if(a>n||o=r&&d<=n)l.push(c);else if(!(p>n||d=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function Et(t,e,r,n,i,a,o){for(var s,l,u=St(t),c=0===i?Ot:It,f=t.start,h=0;h=r&&(l=c(u,p,d,g,m,r),o&&(u.start=f+s*l)):y>n?x<=n&&(l=c(u,p,d,g,m,n),o&&(u.start=f+s*l)):Lt(u,p,d,v),x=r&&(l=c(u,p,d,g,m,r),b=!0),x>n&&y<=n&&(l=c(u,p,d,g,m,n),b=!0),!a&&b&&(o&&(u.end=f+s*l),e.push(u),u=St(t)),o&&(f+=s)}var _=t.length-3;p=t[_],d=t[_+1],v=t[_+2],(y=0===i?p:d)>=r&&y<=n&&Lt(u,p,d,v),_=u.length-3,a&&_>=3&&(u[_]!==u[0]||u[_+1]!==u[1])&&Lt(u,u[0],u[1],u[2]),u.length&&e.push(u)}function St(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Ct(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=c),f>o.maxY&&(o.maxY=f)}return o}function Bt(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");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=r&&s<=i&&l>=n&&l<=a&&c.push(t[d]);else{var v=Math.floor((p+h)/2);s=e[2*v],l=e[2*v+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[v]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(u.push(p),u.push(v-1),u.push(g)),(0===f?i>=s:a>=l)&&(u.push(v+1),u.push(h),u.push(g))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},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 u=o.pop(),c=o.pop(),f=o.pop();if(c-f<=a)for(var h=f;h<=c;h++)et(e[2*h],e[2*h+1],r,n)<=l&&s.push(t[h]);else{var p=Math.floor((f+c)/2),d=e[2*p],v=e[2*p+1];et(d,v,r,n)<=l&&s.push(t[p]);var g=(u+1)%2;(0===u?r-i<=d:n-i<=v)&&(o.push(f),o.push(p-1),o.push(g)),(0===u?r+i>=d:n+i>=v)&&(o.push(p+1),o.push(c),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)}},ot.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(lt);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=rt(n,dt,vt,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-a)}return this.trees[this.options.minZoom]=rt(n,dt,vt,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(ft(t[0]),ht(t[3]),ft(t[2]),ht(t[1])),i=[],a=0;a1&&console.time("creation"),h=this.tiles[f]=Ft(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 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 v,g,m,y,x,b,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,A=1+_;v=g=m=y=null,x=Tt(t,c,r-_,r+k,0,h.minX,h.maxX,l),b=Tt(t,c,r+w,r+A,0,h.minX,h.maxX,l),t=null,x&&(v=Tt(x,c,n-_,n+k,1,h.minY,h.maxY,l),g=Tt(x,c,n+w,n+A,1,h.minY,h.maxY,l),x=null),b&&(m=Tt(b,c,n-_,n+k,1,h.minY,h.maxY,l),y=Tt(b,c,n+w,n+A,1,h.minY,h.maxY,l),b=null),u>1&&console.timeEnd("clipping"),s.push(v||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(m||[],e+1,2*r+1,2*n),s.push(y||[],e+1,2*r+1,2*n+1)}}},jt.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,u=t,c=e,f=r;!l&&u>0;)u--,c=Math.floor(c/2),f=Math.floor(f/2),l=this.tiles[Vt(u,c,f)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,f),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,f,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?zt(this.tiles[s],i):null):null};var Ht=function(e){function r(t,r,n){e.call(this,t,r,Ut),n&&(this.loadGeoJSON=n)}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 t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams,this.loadGeoJSON(r,function(n,i){if(n||!i)return e(n);if("object"!=typeof i)return e(new Error("Input data is not a valid GeoJSON object."));!function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(O(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=I(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(O(I,e))),t}(e,r);default:return e}}(i,!0);try{t._geoJSONIndex=r.cluster?function(t){return new ot(t)}(r.superclusterOptions).load(i.features):function(t,e){return new jt(t,e)}(i,r.geojsonVtOptions)}catch(n){return e(n)}t.loaded={};var a={};if(r.request&&r.request.collectResourceTiming){var o=w(r.request.url);o&&(a.resourceTiming={},a.resourceTiming[r.source]=JSON.parse(JSON.stringify(o)))}e(null,a)})}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded,i=t.uid;return n&&n[i]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r}(A),qt=function(e){var r=this;this.self=e,this.actor=new t.default$7(e,this),this.layerIndexes={},this.workerSourceTypes={vector:A,geojson:Ht},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isLoaded())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText}};return qt.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},qt.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},qt.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},qt.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},qt.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},qt.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},qt.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},qt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},qt.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},qt.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},qt.prototype.loadRTLTextPlugin=function(e,r,n){try{t.plugin.isLoaded()||(this.self.importScripts(r),n(t.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+r)))}catch(t){n(t.toString())}},qt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},qt.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var i={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](i,this.getLayerIndex(t))}return this.workerSources[t][e][r]},qt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new T),this.demWorkerSources[t][e]},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&new qt(self),qt}),i(0,function(t){var e=t.createCommonjsModule(function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()&&"Uint8ClampedArray"in window&&function(t){return void 0===r[t]&&(r[t]=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t)),r[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),r=t.default.performance&&t.default.performance.now?t.default.performance.now.bind(t.default.performance):Date.now.bind(Date),n=t.default.requestAnimationFrame||t.default.mozRequestAnimationFrame||t.default.webkitRequestAnimationFrame||t.default.msRequestAnimationFrame,i=t.default.cancelAnimationFrame||t.default.mozCancelAnimationFrame||t.default.webkitCancelAnimationFrame||t.default.msCancelAnimationFrame,a={now:r,frame:function(t){return n(t)},cancelFrame:function(t){return i(t)},getImageData:function(e){var r=t.default.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(0,0,e.width,e.height)},hardwareConcurrency:t.default.navigator.hardwareConcurrency||4,get devicePixelRatio(){return t.default.devicePixelRatio},supportsWebp:!1};if(t.default.document){var o=t.default.document.createElement("img");o.onload=function(){a.supportsWebp=!0},o.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="}var s={create:function(e,r,n){var i=t.default.document.createElement(e);return r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(e,r){return t.default.document.createElementNS(e,r)}},l=t.default.document?t.default.document.documentElement.style:null;function u(t){if(!l)return null;for(var e=0;e=0?0:e.button},s.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var g={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null},m="See https://www.mapbox.com/api-documentation/#access-tokens";function y(t,e){var r=T(g.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!g.REQUIRE_ACCESS_TOKEN)return M(t);if(!(e=e||g.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+m);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+m);return t.params.push("access_token="+e),M(t)}function x(t){return 0===t.indexOf("mapbox:")}var b=function(t,e){if(!x(t))return t;var r=T(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),y(r,e)},_=function(t,e,r,n){var i=T(t);return x(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,y(i,n)):(i.path+=""+e+r,M(i))},w=/(\.(png|jpg)\d*)(?=$)/,k=function(t,e,r){if(!e||!x(e))return t;var n=T(t),i=a.devicePixelRatio>=2||512===r?"@2x":"",o=a.supportsWebp?".webp":"$1";return n.path=n.path.replace(w,""+i+o),function(t){for(var e=0;e=0?1.2:1))}function R(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else{var l=a.requests[s];l||(l=a.requests[s]=[],B.loadGlyphRange(r,s,n.url,n.requestTransform,function(t,e){if(e)for(var r in e)a.glyphs[+r]=e[+r];for(var n=0,i=l;nthis.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};G.prototype.wrap=function(){return new G(t.wrap(this.lng,-180,180),this.lat)},G.prototype.toArray=function(){return[this.lng,this.lat]},G.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},G.prototype.toBounds=function(t){var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new W(new G(this.lng-r,this.lat-e),new G(this.lng+r,this.lat+e))},G.convert=function(t){if(t instanceof G)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new G(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new G(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, or an array of [, ]")};var W=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]))};W.prototype.setNorthEast=function(t){return this._ne=t instanceof G?new G(t.lng,t.lat):G.convert(t),this},W.prototype.setSouthWest=function(t){return this._sw=t instanceof G?new G(t.lng,t.lat):G.convert(t),this},W.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof G)e=t,r=t;else{if(!(t instanceof W))return Array.isArray(t)?t.every(Array.isArray)?this.extend(W.convert(t)):this.extend(G.convert(t)):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 G(e.lng,e.lat),this._ne=new G(r.lng,r.lat)),this},W.prototype.getCenter=function(){return new G((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},W.prototype.getSouthWest=function(){return this._sw},W.prototype.getNorthEast=function(){return this._ne},W.prototype.getNorthWest=function(){return new G(this.getWest(),this.getNorth())},W.prototype.getSouthEast=function(){return new G(this.getEast(),this.getSouth())},W.prototype.getWest=function(){return this._sw.lng},W.prototype.getSouth=function(){return this._sw.lat},W.prototype.getEast=function(){return this._ne.lng},W.prototype.getNorth=function(){return this._ne.lat},W.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},W.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},W.prototype.isEmpty=function(){return!(this._sw&&this._ne)},W.convert=function(t){return!t||t instanceof W?t:new W(t)};var Y=function(t,e,r){this.bounds=W.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24};Y.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},Y.prototype.contains=function(t){var e=Math.floor(this.lngX(this.bounds.getWest(),t.z)),r=Math.floor(this.latY(this.bounds.getNorth(),t.z)),n=Math.ceil(this.lngX(this.bounds.getEast(),t.z)),i=Math.ceil(this.latY(this.bounds.getSouth(),t.z));return t.x>=e&&t.x=r&&t.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)return r.fire(new t.ErrorEvent(e));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._updateWorkerData=function(e){var r,n,i=this,a=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(a.request=this.map._transformRequest((r=o,(n=t.default.document.createElement("a")).href=r,n.href),t.ResourceType.Source),a.request.collectResourceTiming=this._collectResourceTiming):a.data=JSON.stringify(o),this.workerID=this.dispatcher.send(this.type+"."+a.source+".loadData",a,function(t,r){i._removed||r&&r.abandoned||(i._loaded=!0,r&&r.resourceTiming&&r.resourceTiming[i.id]&&(i._resourceTiming=r.resourceTiming[i.id].slice(0)),i.dispatcher.send(i.type+"."+a.source+".coalesce",null,null,i.workerID),e(t))},this.workerID)},r.prototype.loadTile=function(t,e){var r=this,n=void 0===t.workerID?"loadTile":"reloadTile",i={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:a.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(n,i,function(i,a){return t.unloadVectorData(),t.aborted?e(null):i?e(i):(t.loadVectorData(a,r.map.painter,"reloadTile"===n),e(null))},this.workerID)},r.prototype.abortTile=function(t){t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},r.prototype.onRemove=function(){this._removed=!0,this.dispatcher.send("removeSource",{type:this.type,source:this.id},null,this.workerID)},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),K=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Q=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Q.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u>s.z,u=new t.default$1(s.x*l,s.y*l),c=new t.default$1(u.x+l,u.y+l),f=this.segments.prepareSegment(4,n,i);n.emplaceBack(u.x,u.y,u.x,u.y),n.emplaceBack(c.x,u.y,c.x,u.y),n.emplaceBack(u.x,c.y,u.x,c.y),n.emplaceBack(c.x,c.y,c.x,c.y);var h=f.vertexLength;i.emplaceBack(h,h+1,h+2),i.emplaceBack(h+1,h+2,h+3),f.vertexLength+=4,f.primitiveLength+=2}this.maskedBoundsBuffer=r.createVertexBuffer(n,K.members),this.maskedIndexBuffer=r.createIndexBuffer(i)}},st.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},st.prototype.setExpiryData=function(e){var r=this.expirationTime;if(e.cacheControl){var n=t.parseCacheControl(e.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var i=Date.now(),a=!1;if(this.expirationTime>i)a=!1;else if(r)if(this.expirationTimethis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},lt.prototype.has=function(t){return t.wrapped().key in this.data},lt.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},lt.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},lt.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},lt.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},lt.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};var ut=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};ut.prototype.unbindVAO=function(){this.context.extVertexArrayObject&&this.context.bindVertexArrayOES.set(null)},ut.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},ut.prototype.updateData=function(t){var e=this.context.gl;this.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},ut.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var ct={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},ft=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};ft.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},ft.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},ft.prototype.enableAttributes=function(t,e){for(var r=0;r1||(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.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},r.prototype._findLoadedChildren=function(t,e,r){var n=!1;for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.hasData()||a.tileID.overscaledZ<=t.overscaledZ||a.tileID.overscaledZ>e)){var o=Math.pow(2,a.tileID.canonical.z-t.canonical.z);if(Math.floor(a.tileID.canonical.x/o)===t.canonical.x&&Math.floor(a.tileID.canonical.y/o)===t.canonical.y)for(r[i]=a.tileID,n=!0;a&&a.tileID.overscaledZ-1>t.overscaledZ;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);if(!s)break;(a=this._tiles[s.key])&&a.hasData()&&(delete r[i],r[s.key]=s)}}}return n},r.prototype.findLoadedParent=function(t,e,r){for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n);if(!i)return;var a=String(i.key),o=this._tiles[a];if(o&&o.hasData())return r[a]=i,o;if(this._cache.has(i))return r[a]=i,this._cache.get(i)}},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 o,s=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),l=Math.max(s-r.maxOverzooming,this._source.minzoom),u=Math.max(s+r.maxUnderzooming,this._source.minzoom),c=this._updateRetainedTiles(i,s),f={};if(Zt(this._source.type))for(var h=Object.keys(c),p=0;p=a.now())){n._findLoadedChildren(v,u,c)&&(c[d]=v);var m=n.findLoadedParent(v,l,f);m&&n._addTile(m.tileID)}}for(o in f)c[o]||(n._coveredTiles[o]=!0);for(o in f)c[o]=f[o];for(var y=t.keysDifference(this._tiles,c),x=0;xthis._source.maxzoom){var h=l.children(this._source.maxzoom)[0],p=this.getTile(h);p&&p.hasData()?n[h.key]=h:f=!1}else{this._findLoadedChildren(l,o,n);for(var d=l.children(this._source.maxzoom),v=0;v=a;--g){var m=l.scaledTo(g);if(i[m.key])break;if(i[m.key]=!0,!(u=this.getTile(m))&&c&&(u=this._addTile(m)),u&&(n[m.key]=m,c=u.wasRequested(),u.hasData()))break}}}return n},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e);var n=Boolean(r);return n||(r=new st(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout(function(){r._reloadTile(t,"expired"),delete r._timers[t]},n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()?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){for(var n=[],i=this.getIds(),a=1/0,o=1/0,s=-1/0,l=-1/0,u=e[0].zoom,c=0;c=0&&m[1].y+g>=0){for(var y=[],x=0;x=a.now())return!0}return!1},r}(t.Evented);function Xt(e,r){var n=r.zoomTo(e.canonical.z);return new t.default$1((n.column-(e.canonical.x+e.wrap*Math.pow(2,e.canonical.z)))*t.default$8,(n.row-e.canonical.y)*t.default$8)}function Zt(t){return"raster"===t||"image"===t||"video"===t}function $t(){return new t.default.Worker(Sn.workerUrl)}Yt.maxOverzooming=10,Yt.maxUnderzooming=3;var Jt,Kt=function(){this.active={}};function Qt(e,r){var n={};for(var i in e)"ref"!==i&&(n[i]=e[i]);return t.default$18.forEach(function(t){t in r&&(n[t]=r[t])}),n}function te(t){t=t.slice();for(var e=Object.create(null),r=0;rthis.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var o=0;o0:a},ue.prototype._queryCircle=function(t,e,r,n){var i=t-r,a=t+r,o=e-r,s=e+r;if(a<0||i>this.width||s<0||o>this.height)return!n&&[];var l=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(i,o,a,s,this._queryCellCircle,l,u),n?l.length>0:l},ue.prototype.query=function(t,e,r,n){return this._query(t,e,r,n,!1)},ue.prototype.hitTest=function(t,e,r,n){return this._query(t,e,r,n,!0)},ue.prototype.hitTestCircle=function(t,e,r){return this._queryCircle(t,e,r,!0)},ue.prototype._queryCell=function(t,e,r,n,i,a,o){var s=o.seenUids,l=this.boxCells[i];if(null!==l)for(var u=this.bboxes,c=0,f=l;c=u[p+0]&&n>=u[p+1]){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[h],x1:u[p],y1:u[p+1],x2:u[p+2],y2:u[p+3]})}}}var d=this.circleCells[i];if(null!==d)for(var v=this.circles,g=0,m=d;go*o+s*s},ue.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 u=(o-i)/2,c=Math.abs(e-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var f=l-s,h=c-u;return f*f+h*h<=r*r};var ce=t.default$19.layout;function fe(e,r,n,i,a){var o=t.mat4.identity(new Float32Array(16));return r?(t.mat4.identity(o),t.mat4.scale(o,o,[1/a,1/a,1]),n||t.mat4.rotateZ(o,o,i.angle)):(t.mat4.scale(o,o,[i.width/2,-i.height/2,1]),t.mat4.translate(o,o,[1,-1,0]),t.mat4.multiply(o,o,e)),o}function he(e,r,n,i,a){var o=t.mat4.identity(new Float32Array(16));return r?(t.mat4.multiply(o,o,e),t.mat4.scale(o,o,[a,a,1]),n||t.mat4.rotateZ(o,o,-i.angle)):(t.mat4.scale(o,o,[1,-1,1]),t.mat4.translate(o,o,[-1,-1,0]),t.mat4.scale(o,o,[2/i.width,2/i.height,1])),o}function pe(e,r){var n=[e.x,e.y,0,1];ke(n,n,r);var i=n[3];return{point:new t.default$1(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function de(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ve(e,r,n,i,a,o,s,l){var u=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom,ce.properties[i?"text-size":"icon-size"]),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,v=n.transform.width/n.transform.height,g=!1,m=0;mMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function ye(e,r,n,i,a,o,s,l,u,c,f,h,p,d){var v,g=r/24,m=e.lineOffsetX*r,y=e.lineOffsetY*r;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,_=e.lineStartIndex+e.lineLength,w=ge(g,l,m,y,n,f,h,e,u,o,p,!1);if(!w)return{notEnoughRoom:!0};var k=pe(w.first.point,s).point,A=pe(w.last.point,s).point;if(i&&!n){var T=me(e.writingMode,k,A,d);if(T)return T}v=[w.first];for(var M=e.glyphStartIndex+1;M0?L.point:xe(h,C,E,1,a),I=me(e.writingMode,E,O,d);if(I)return I}var P=be(g*l.getoffsetX(e.glyphStartIndex),m,y,n,f,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,p,!1);if(!P)return{notEnoughRoom:!0};v=[P]}for(var D=0,z=v;D0?1:-1,g=0;i&&(v*=-1,g=Math.PI),v<0&&(g+=Math.PI);for(var m=v>0?l+s:l+s+1,y=m,x=a,b=a,_=0,w=0,k=Math.abs(d);_+w<=k;){if((m+=v)=u)return null;if(b=x,void 0===(x=h[m])){var A=new t.default$1(c.getx(m),c.gety(m)),T=pe(A,f);if(T.signedDistanceFromCamera>0)x=h[m]=T.point;else{var M=m-v;x=xe(0===_?o:new t.default$1(c.getx(M),c.gety(M)),A,b,k-_+1,f)}}_+=w,w=b.dist(x)}var E=(k-_)/w,S=x.sub(b),C=S.mult(E)._add(b);return C._add(S._unit()._perp()._mult(n*v)),{point:C,angle:g+Math.atan2(x.y-b.y,x.x-b.x),tileDistance:p?{prevTileDistance:m-v===y?0:c.gettileUnitDistanceFromAnchor(m-v),lastSegmentViewportDistance:k-_}:null}}var _e=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function we(t,e){for(var r=0;rM)Te(e,E,!1);else{var I=this.projectPoint(c,S,C),P=L*k;if(d.length>0){var D=I.x-d[d.length-4],z=I.y-d[d.length-3];if(P*P*2>D*D+z*z&&E+8-T&&R=this.screenRightBoundary||n<100||e>this.screenBottomBoundary};var Ee=t.default$19.layout,Se=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};Se.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var Ce=function(t,e,r,n,i){this.text=new Se(t?t.text:null,e,r,i),this.icon=new Se(t?t.icon:null,e,n,i)};Ce.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Le=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},Oe=function(t,e){this.transform=t.clone(),this.collisionIndex=new Ae(this.transform),this.placements={},this.opacities={},this.stale=!1,this.fadeDuration=e,this.retainedQueryData={}};function Ie(t,e,r){t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0)}Oe.prototype.placeLayerTile=function(e,r,n,i){var a=r.getBucket(e),o=r.latestFeatureIndex;if(a&&o&&e.id===a.layerIds[0]){var s=r.collisionBoxArray,l=a.layers[0].layout,u=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/t.default$8,f=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),h=fe(f,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,Me(r,1,this.transform.zoom)),p=fe(f,"map"===l.get("icon-pitch-alignment"),"map"===l.get("icon-rotation-alignment"),this.transform,Me(r,1,this.transform.zoom));this.retainedQueryData[a.bucketInstanceId]=new function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID),this.placeLayerBucket(a,f,h,p,u,c,n,i,s)}},Oe.prototype.placeLayerBucket=function(e,r,n,i,a,o,s,l,u){for(var c=e.layers[0].layout,f=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom,Ee.properties["text-size"]),h=!e.hasTextData()||c.get("text-optional"),p=!e.hasIconData()||c.get("icon-optional"),d=0,v=e.symbolInstances;d0,x=x&&b.offscreen);var T=g.collisionArrays.textCircles;if(T){var M=e.text.placedSymbolArray.get(g.placedTextSymbolIndices[0]),E=t.evaluateSizeForFeature(e.textSizeData,f,M);_=this.collisionIndex.placeCollisionCircles(T,c.get("text-allow-overlap"),a,o,g.key,M,e.lineVertexArray,e.glyphOffsetArray,E,r,n,s,"map"===c.get("text-pitch-alignment")),m=c.get("text-allow-overlap")||_.circles.length>0,x=x&&_.offscreen}g.collisionArrays.iconFeatureIndex&&(A=g.collisionArrays.iconFeatureIndex),g.collisionArrays.iconBox&&(y=(w=this.collisionIndex.placeCollisionBox(g.collisionArrays.iconBox,c.get("icon-allow-overlap"),o,r)).box.length>0,x=x&&w.offscreen),h||p?p?h||(y=y&&m):m=y&&m:y=m=y&&m,m&&b&&this.collisionIndex.insertCollisionBox(b.box,c.get("text-ignore-placement"),e.bucketInstanceId,k),y&&w&&this.collisionIndex.insertCollisionBox(w.box,c.get("icon-ignore-placement"),e.bucketInstanceId,A),m&&_&&this.collisionIndex.insertCollisionCircles(_.circles,c.get("text-ignore-placement"),e.bucketInstanceId,k),this.placements[g.crossTileID]=new Le(m,y,x||e.justReloaded),l[g.crossTileID]=!0}}e.justReloaded=!1},Oe.prototype.commit=function(t,e){this.commitTime=e;var r=!1,n=t&&0!==this.fadeDuration?(this.commitTime-t.commitTime)/this.fadeDuration:1,i=t?t.opacities:{};for(var a in this.placements){var o=this.placements[a],s=i[a];s?(this.opacities[a]=new Ce(s,n,o.text,o.icon),r=r||o.text!==s.text.placed||o.icon!==s.icon.placed):(this.opacities[a]=new Ce(null,n,o.text,o.icon,o.skipFade),r=r||o.text||o.icon)}for(var l in i){var u=i[l];if(!this.opacities[l]){var c=new Ce(u,n,!1,!1);c.isHidden()||(this.opacities[l]=c,r=r||u.text.placed||u.icon.placed)}}r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},Oe.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,i=e;n0||s.numVerticalGlyphVertices>0,f=s.numIconVertices>0;if(c){for(var h=je(u.text),p=(s.numGlyphVertices+s.numVerticalGlyphVertices)/4,d=0;dt},Oe.prototype.setStale=function(){this.stale=!0};var Pe=Math.pow(2,25),De=Math.pow(2,24),ze=Math.pow(2,17),Re=Math.pow(2,16),Fe=Math.pow(2,9),Be=Math.pow(2,8),Ne=Math.pow(2,1);function je(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*Pe+e*De+r*ze+e*Re+r*Fe+e*Be+r*Ne+e}var Ve=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};Ve.prototype.continuePlacement=function(t,e,r,n,i){for(;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=e[t[n._currentPlacementIndex]],l=n.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(n._inProgressLayer||(n._inProgressLayer=new Ve),n._inProgressLayer.continuePlacement(r[s.source],n.placement,n._showCollisionBoxes,s,o))return;delete n._inProgressLayer}n._currentPlacementIndex--}this._done=!0},Ue.prototype.commit=function(t,e){return this.placement.commit(t,e),this.placement};var He=512/t.default$8/2,qe=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0,i=e;nt.overscaledZ)for(var l in s){var u=s[l];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,a)}else{var c=s[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,a)}}for(var f=0,h=e.symbolInstances;f1?"@2x":"";function u(){if(s)n(s);else if(i&&o){var e=a.getImageData(o),r={};for(var l in i){var u=i[l],c=u.width,f=u.height,h=u.x,p=u.y,d=u.sdf,v=u.pixelRatio,g=new t.RGBAImage({width:c,height:f});t.RGBAImage.copy(e,g,{x:h,y:p},{x:0,y:0},{width:c,height:f}),r[l]={data:g,pixelRatio:v,sdf:d}}n(null,r)}}t.getJSON(r(_(e,l,".json"),t.ResourceType.SpriteJSON),function(t,e){s||(s=t,i=e,u())}),t.getImage(r(_(e,l,".png"),t.ResourceType.SpriteImage),function(t,e){s||(s=t,o=e,u())})}(e.sprite,this.map._transformRequest,function(e,r){if(e)n.fire(new t.ErrorEvent(e));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n.fire(new t.Event("data",{dataType:"style"}))}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=te(this.stylesheet.layers);this._order=o.map(function(t){return t.id}),this._layers={};for(var s=0,l=o;s0)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.fire(new t.Event("data",{dataType:"style"}))},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.fire(new t.Event("data",{dataType:"style"}))},r.prototype.addSource=function(e,r,n){var i=this;if(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 Yt(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){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 if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone(e),e=t.extend(e,{source:i})),!this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n)){var a=t.default$22(e);this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}});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){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)}}},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._updatedLayers[e],delete this._updatedPaintProps[e]}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.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){this._checkLoaded();var n=this.getLayer(e);if(n){if(!t.default$10(n.filter,r))return null==r?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(t.validateStyle.filter,"layers."+n.id+".filter",r)||(n.filter=t.clone(r),this._updateLayer(n)))}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(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?t.default$10(i.getLayoutProperty(r),n)||(i.setLayoutProperty(r,n),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(t,e){return this.getLayer(t).getLayoutProperty(e)},r.prototype.setPaintProperty=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.default$10(i.getPaintProperty(r),n)){var a=i._transitionablePaint._values[r].value.isDataDriven();i.setPaintProperty(r,n),(i._transitionablePaint._values[r].value.isDataDriven()||a)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[e]=!0}}else 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.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){var e=this;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._order.map(function(t){return e._layers[t].serialize()})},function(t){return void 0!==t})},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenRenderedFeatures=function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0,a=t;i 0.5) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n gl_FragColor *= .1;\n }\n}",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field boxes in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n gl_Position.xy += a_extrude * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n}\n"},collisionCircle:{fragmentSource:"uniform float u_overscale_factor;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n float alpha = 0.5;\n\n // Red = collision, hide label\n vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n color *= .2;\n }\n\n float extrude_scale_length = length(v_extrude_scale);\n float extrude_length = length(v_extrude) * extrude_scale_length;\n float stroke_width = 15.0 * extrude_scale_length / u_overscale_factor;\n float radius = v_radius * extrude_scale_length;\n\n float distance_to_edge = abs(extrude_length - radius);\n float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n gl_FragColor = opacity_t * color;\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field circles in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur\n gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n v_extrude = a_extrude * padding_factor;\n v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n vec3 normal = a_normal_ed.xyz;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec3 normal = a_normal_ed.xyz;\n float edgedistance = a_normal_ed.w;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},hillshadePrepare:{fragmentSource:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_image, coord) * 255.0;\n return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0;\n}\n\nvoid main() {\n vec2 epsilon = 1.0 / u_dimension;\n\n // queried pixels:\n // +-----------+\n // | | | |\n // | a | b | c |\n // | | | |\n // +-----------+\n // | | | |\n // | d | e | f |\n // | | | |\n // +-----------+\n // | | | |\n // | g | h | i |\n // | | | |\n // +-----------+\n\n float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n float e = getElevation(v_pos, 0.0);\n float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n // here we divide the x and y slopes by 8 * pixel size\n // where pixel size (aka meters/pixel) is:\n // circumference of the world / (pixels per tile * number of tiles)\n // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n // we want to vertically exaggerate the hillshading though, because otherwise\n // it is barely noticeable at low zooms. to do this, we multiply this by some\n // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value\n // Here we use a=0.3 which works out to the expression below. see \n // nickidlugash's awesome breakdown for more info\n // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556\n float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n vec2 deriv = vec2(\n (c + f + f + i) - (a + d + d + g),\n (g + h + h + i) - (a + b + b + c)\n ) / pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom);\n\n gl_FragColor = clamp(vec4(\n deriv.x / 2.0 + 0.5,\n deriv.y / 2.0 + 0.5,\n 1.0,\n 1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (a_texture_pos / 8192.0) / 2.0 + 0.25;\n}\n"},hillshade:{fragmentSource:"uniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n vec4 pixel = texture2D(u_image, v_pos);\n\n vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n // to account for mercator projection distortion. see #4807 for details\n float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n // We also multiply the slope by an arbitrary z-factor of 1.25\n float slope = atan(1.25 * length(deriv) / scaleFactor);\n float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n float intensity = u_light.x;\n // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n float azimuth = u_light.y + PI;\n\n // We scale the slope exponentially based on intensity, using a calculation similar to\n // the exponential interpolation function in the style spec:\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228\n // so that higher intensity values create more opaque hillshading.\n float base = 1.875 - intensity * 1.75;\n float maxValue = 0.5 * PI;\n float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n // so that the accent color's rate of change eases in while the shade color's eases out.\n float accent = cos(scaledSlope);\n // We multiply both the accent and shade color by a clamped intensity value\n // so that intensities >= 0.5 do not additionally affect the color values\n // while intensity values < 0.5 make the overall color more transparent.\n vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_texture_pos / 8192.0;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_linesofar;\n\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\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\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},lineGradient:{fragmentSource:"\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nuniform sampler2D u_image;\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n // For gradient lines, v_lineprogress is the ratio along the entire line,\n // scaled to [0, 2^15), and the gradient ramp is stored in a texture.\n vec4 color = texture2D(u_image, vec2(v_lineprogress, 0.5));\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n// the attribute conveying progress along a line is scaled to [0, 2^15)\n#define MAX_LINE_DISTANCE 32767.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\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\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\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_lineprogress = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n\n // v_normal.y is 0 at the midpoint of the line, -1 at the lower edge, 1 at the upper edge\n // we clamp the line width outset to be between 0 and half the pattern height plus padding (2.0)\n // to ensure we don't sample outside the designated symbol on the sprite sheet.\n // 0.5 is added to shift the component to be bounded between 0 and 1 for interpolation of\n // the texture coordinate\n float y_a = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (u_pattern_size_a.y + 2.0) / 2.0) / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (u_pattern_size_b.y + 2.0) / 2.0) / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\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\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\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\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\n\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\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\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\n\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\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = opacity * v_fade_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\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\n\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\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\n\n vec2 tex = v_data0.xy;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n float fade_opacity = v_data1[2];\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n lowp float dist = texture2D(u_texture, tex).a;\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n gl_FragColor = color * (alpha * opacity * fade_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\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\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\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\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n v_data0 = vec2(tex.x, tex.y);\n v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);\n}\n"}},tr=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,er=function(t){var e=Qe[t],r={};e.fragmentSource=e.fragmentSource.replace(tr,function(t,e,n,i,a){return r[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+n+" "+i+" "+a+";\n#else\nuniform "+n+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+n+" "+i+" "+a+" = u_"+a+";\n#endif\n"}),e.vertexSource=e.vertexSource.replace(tr,function(t,e,n,i,a){var o="float"===i?"vec2":"vec4";return r[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float a_"+a+"_t;\nattribute "+n+" "+o+" a_"+a+";\nvarying "+n+" "+i+" "+a+";\n#else\nuniform "+n+" "+i+" u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+o+"(a_"+a+", a_"+a+"_t);\n#else\n "+n+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float a_"+a+"_t;\nattribute "+n+" "+o+" a_"+a+";\n#else\nuniform "+n+" "+i+" u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+n+" "+i+" "+a+" = unpack_mix_"+o+"(a_"+a+", a_"+a+"_t);\n#else\n "+n+" "+i+" "+a+" = u_"+a+";\n#endif\n"})};for(var rr in Qe)er(rr);var nr=Qe,ir=function(t,e,r,n){var i=t.gl;this.program=i.createProgram();var o=r.defines().concat("#define DEVICE_PIXEL_RATIO "+a.devicePixelRatio.toFixed(1));n&&o.push("#define OVERDRAW_INSPECTOR;");var s=o.concat(nr.prelude.fragmentSource,e.fragmentSource).join("\n"),l=o.concat(nr.prelude.vertexSource,e.vertexSource).join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,s),i.compileShader(u),i.attachShader(this.program,u);var c=i.createShader(i.VERTEX_SHADER);i.shaderSource(c,l),i.compileShader(c),i.attachShader(this.program,c);for(var f=r.layoutAttributes||[],h=0;h>16,s>>16),n.uniform2f(r.uniforms.u_pixel_coord_lower,65535&o,65535&s)};function mr(t,e,r,n,i){if(!dr(r.paint.get("fill-pattern"),t))for(var a=!0,o=0,s=n;o0){var l=a.now(),u=(l-e.timeAdded)/s,c=r?(l-r.timeAdded)/s:-1,f=n.getSource(),h=o.coveringZoomLevel({tileSize:f.tileSize,roundZoom:f.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),d=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-c,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}function Sr(e,r,n){var i=e.context,o=i.gl;i.lineWidth.set(1*a.devicePixelRatio);var s=n.posMatrix,l=e.useProgram("debug");i.setDepthMode(Ht.disabled),i.setStencilMode(qt.disabled),i.setColorMode(e.colorModeForRenderPass()),o.uniformMatrix4fv(l.uniforms.u_matrix,!1,s),o.uniform4f(l.uniforms.u_color,1,0,0,1),e.debugVAO.bind(i,l,e.debugBuffer,[]),o.drawArrays(o.LINE_STRIP,0,e.debugBuffer.length);for(var u=function(t,e,r,n){n=n||1;var i,a,o,s,l,u,c,f,h=[];for(i=0,a=t.length;i":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},Lr={symbol:function(t,e,r,n){if("translucent"===t.renderPass){var i=t.context;i.setStencilMode(qt.disabled),i.setColorMode(t.colorModeForRenderPass()),0!==r.paint.get("icon-opacity").constantOr(1)&&ur(t,e,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright")),0!==r.paint.get("text-opacity").constantOr(1)&&ur(t,e,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright")),e.map.showCollisionBoxes&&function(t,e,r,n){or(t,e,r,n,!1),or(t,e,r,n,!0)}(t,e,r,n)}},circle:function(t,e,r,n){if("translucent"===t.renderPass){var i=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),o=r.paint.get("circle-stroke-opacity");if(0!==i.constantOr(1)||0!==a.constantOr(1)&&0!==o.constantOr(1)){var s=t.context,l=s.gl;s.setDepthMode(t.depthModeForSublayer(0,Ht.ReadOnly)),s.setStencilMode(qt.disabled),s.setColorMode(t.colorModeForRenderPass());for(var u=!0,c=0;c0?1-1/(1.001-i):-i),s.uniform1f(u.uniforms.u_contrast_factor,(a=r.paint.get("raster-contrast"))>0?1/(1-a):1+a),s.uniform3fv(u.uniforms.u_spin_weights,function(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]}(r.paint.get("raster-hue-rotate"))),s.uniform1f(u.uniforms.u_buffer_scale,1),s.uniform1i(u.uniforms.u_image0,0),s.uniform1i(u.uniforms.u_image1,1);for(var c=n.length&&n[0].overscaledZ,f=0,h=n;fe.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function Pr(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,h=a;hl.dy&&(o=s,s=l,l=o),s.dy>u.dy&&(o=s,s=u,u=o),l.dy>u.dy&&(o=l,l=u,u=o),s.dy&&Pr(u,s,n,i,a),l.dy&&Pr(u,l,n,i,a)}Or.prototype.resize=function(t,e){var r=this.context.gl;if(this.width=t*a.devicePixelRatio,this.height=e*a.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n=0;this.currentLayer--){var m=n.style._layers[s[n.currentLayer]];m.source!==(v&&v.id)&&(g=[],(v=n.style.sourceCaches[m.source])&&(n.clearStencil(),g=v.getVisibleCoordinates(),v.getSource().isTileClipped&&n._renderTileClippingMasks(g))),n.renderLayer(n,v,m,g)}this.renderPass="translucent";var y,x=[];for(this.currentLayer=0,this.currentLayer;this.currentLayer0?e.pop():null},Or.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new ir(this.context,nr[t],e,this._showOverdrawInspector)),this.cache[r]},Or.prototype.useProgram=function(t,e){var r=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.context.program.set(r.program),r};var zr=t.default$20.vec4,Rr=t.default$20.mat4,Fr=t.default$20.mat2,Br=function(t,e,r){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new G(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},Nr={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},x:{configurable:!0},y:{configurable:!0},point:{configurable:!0}};Br.prototype.clone=function(){var t=new Br(this._minZoom,this._maxZoom,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._calcMatrices(),t},Nr.minZoom.get=function(){return this._minZoom},Nr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Nr.maxZoom.get=function(){return this._maxZoom},Nr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Nr.renderWorldCopies.get=function(){return this._renderWorldCopies},Nr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Nr.worldSize.get=function(){return this.tileSize*this.scale},Nr.centerPoint.get=function(){return this.size._div(2)},Nr.size.get=function(){return new t.default$1(this.width,this.height)},Nr.bearing.get=function(){return-this.angle/Math.PI*180},Nr.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=Fr.create(),Fr.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Nr.pitch.get=function(){return this._pitch/Math.PI*180},Nr.pitch.set=function(e){var r=t.clamp(e,0,60)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Nr.fov.get=function(){return this._fov/Math.PI*180},Nr.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())},Nr.zoom.get=function(){return this._zoom},Nr.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())},Nr.center.get=function(){return this._center},Nr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Br.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},Br.prototype.getVisibleUnwrappedCoordinates=function(e){var r=this.pointCoordinate(new t.default$1(0,0),0),n=this.pointCoordinate(new t.default$1(this.width,0),0),i=Math.floor(r.column),a=Math.floor(n.column),o=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var s=i;s<=a;s++)0!==s&&o.push(new t.UnwrappedTileID(s,e));return o},Br.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=this.pointCoordinate(this.centerPoint,r),a=new t.default$1(i.column-.5,i.row-.5);return function(e,r,n,i){void 0===i&&(i=!0);var a=1<=0&&l<=a)for(u=r;uo&&(i=o-v)}if(this.lngRange){var g=this.x,m=u.x/2;g-ml&&(n=l-m)}void 0===n&&void 0===i||(this.center=this.unproject(new t.default$1(void 0!==n?n:this.x,void 0!==i?i:this.y))),this._unmodified=c,this._constraining=!1}},Br.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),n=this.x,i=this.y,a=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),o=new Float64Array(16);Rr.perspective(o,this._fov,this.width/this.height,1,a),Rr.scale(o,o,[1,-1,1]),Rr.translate(o,o,[0,0,-this.cameraToCenterDistance]),Rr.rotateX(o,o,this._pitch),Rr.rotateZ(o,o,this.angle),Rr.translate(o,o,[-n,-i,0]);var s=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));Rr.scale(o,o,[1,1,s,1]),this.projMatrix=o;var l=this.width%2/2,u=this.height%2/2,c=Math.cos(this.angle),f=Math.sin(this.angle),h=n-Math.round(n)+c*l+f*u,p=i-Math.round(i)+c*u+f*l,d=new Float64Array(o);if(Rr.translate(d,d,[h>.5?h-1:h,p>.5?p-1:p,0]),this.alignedProjMatrix=d,o=Rr.create(),Rr.scale(o,o,[this.width/2,-this.height/2,1]),Rr.translate(o,o,[1,-1,0]),this.pixelMatrix=Rr.multiply(new Float64Array(16),o,this.projMatrix),!(o=Rr.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=o,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Br.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.default$1(0,0)).zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return zr.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Object.defineProperties(Br.prototype,Nr);var jr=function(){var e,r,n,i;t.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),r=!1,n=0,i=function(){n=0,r&&(e(),n=setTimeout(i,300),r=!1)},function(){return r=!0,n||i(),n})};jr.prototype.addTo=function(e){return this._map=e,t.default.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},jr.prototype.remove=function(){return t.default.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},jr.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(e.lng*i)/i,o=Math.round(e.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),u="";return u+=t?"#/"+a+"/"+o+"/"+r:"#"+r+"/"+o+"/"+a,(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+="/"+Math.round(l)),u},jr.prototype._onHashChange=function(){var e=t.default.location.hash.replace("#","").split("/");return e.length>=3&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},jr.prototype._updateHashUnthrottled=function(){var e=this.getHashString();t.default.history.replaceState(t.default.history.state,"",e)};var Vr=function(e){function r(r,n,i,a){void 0===a&&(a={});var o=s.mousePos(n.getCanvasContainer(),i),l=n.unproject(o);e.call(this,r,t.extend({point:o,lngLat:l,originalEvent:i},a)),this._defaultPrevented=!1,this.target=n}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var n={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,n),r}(t.Event),Ur=function(e){function r(r,n,i){var a=s.touchPos(n.getCanvasContainer(),i),o=a.map(function(t){return n.unproject(t)}),l=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new t.default$1(0,0)),u=n.unproject(l);e.call(this,r,{points:a,point:l,lngLats:o,lngLat:u,originalEvent:i}),this._defaultPrevented=!1}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var n={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,n),r}(t.Event),Hr=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),qr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};qr.prototype.isEnabled=function(){return!!this._enabled},qr.prototype.isActive=function(){return!!this._active},qr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},qr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},qr.prototype.onWheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.default.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=a.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.isActive()||this._start(e)),e.preventDefault()}},qr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},qr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e})),this._finishTimeout&&clearTimeout(this._finishTimeout);var r=s.mousePos(this._el,e);this._around=G.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},qr.prototype._onScrollFrame=function(){var e=this;if(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?1/450:.01,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var s=!1;if("wheel"===this._type){var l=Math.min((a.now()-this._lastWheelEventTime)/200,1),u=this._easing(l);r.zoom=t.number(this._startZoom,this._targetZoom,u),l<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):s=!0}else r.zoom=this._targetZoom,s=!0;r.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),s&&(this._active=!1,this._finishTimeout=setTimeout(function(){e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom},200))}},qr.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(a.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),s=.27/Math.sqrt(o*o+1e-4)*.01,l=Math.sqrt(.0729-s*s);r=t.bezier(s,l,.25,1)}return this._prevEase={start:a.now(),duration:e,easing:r},r};var Gr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};Gr.prototype.isEnabled=function(){return!!this._enabled},Gr.prototype.isActive=function(){return!!this._active},Gr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Gr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Gr.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.default.document.addEventListener("mousemove",this._onMouseMove,!1),t.default.document.addEventListener("keydown",this._onKeyDown,!1),t.default.document.addEventListener("mouseup",this._onMouseUp,!1),s.disableDrag(),this._startPos=s.mousePos(this._el,e),this._active=!0)},Gr.prototype._onMouseMove=function(t){var e=this._startPos,r=s.mousePos(this._el,t);this._box||(this._box=s.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),i=Math.max(e.x,r.x),a=Math.min(e.y,r.y),o=Math.max(e.y,r.y);s.setTransform(this._box,"translate("+n+"px,"+a+"px)"),this._box.style.width=i-n+"px",this._box.style.height=o-a+"px"},Gr.prototype._onMouseUp=function(e){if(0===e.button){var r=this._startPos,n=s.mousePos(this._el,e),i=(new W).extend(this._map.unproject(r)).extend(this._map.unproject(n));this._finish(),s.suppressClick(),r.x===n.x&&r.y===n.y?this._fireEvent("boxzoomcancel",e):this._map.fitBounds(i,{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e,boxZoomBounds:i}))}},Gr.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},Gr.prototype._finish=function(){this._active=!1,t.default.document.removeEventListener("mousemove",this._onMouseMove,!1),t.default.document.removeEventListener("keydown",this._onKeyDown,!1),t.default.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(s.remove(this._box),this._box=null),s.enableDrag()},Gr.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Wr=t.bezier(0,0,.25,1),Yr=function(e,r){this._map=e,this._el=r.element||e.getCanvasContainer(),this._state="disabled",this._button=r.button||"right",this._bearingSnap=r.bearingSnap||0,this._pitchWithRotate=!1!==r.pitchWithRotate,t.bindAll(["_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};Yr.prototype.isEnabled=function(){return"disabled"!==this._state},Yr.prototype.isActive=function(){return"active"===this._state},Yr.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},Yr.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Yr.prototype.onMouseDown=function(e){if("enabled"===this._state){if("right"===this._button){if(this._eventButton=s.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==s.mouseButton(e))return;this._eventButton=0}s.disableDrag(),t.default.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.default.document.addEventListener("mouseup",this._onMouseUp),t.default.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[a.now(),this._map.getBearing()]],this._previousPos=s.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},Yr.prototype._onMouseMove=function(t){this._lastMoveEvent=t,this._pos=s.mousePos(this._el,t),"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame))},Yr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform,r=this._previousPos,n=this._pos,i=.8*(r.x-n.x),o=-.5*(r.y-n.y),s=e.bearing-i,l=e.pitch-o,u=this._inertia,c=u[u.length-1];this._drainInertiaBuffer(),u.push([a.now(),this._map._normalizeBearing(s,c[1])]),e.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",t),e.pitch=l),this._fireEvent("rotate",t),this._fireEvent("move",t),delete this._lastMoveEvent,this._previousPos=this._pos}},Yr.prototype._onMouseUp=function(t){if(s.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",s.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},Yr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Yr.prototype._unbind=function(){t.default.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.default.document.removeEventListener("mouseup",this._onMouseUp),t.default.removeEventListener("blur",this._onBlur),s.enableDrag()},Yr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._previousPos},Yr.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,a=function(){Math.abs(n)180&&(p=180);var d=p/180;u+=f*p*(d/2),Math.abs(r._normalizeBearing(u,0))0&&e-t[0][0]>160;)t.shift()};var Xr=t.bezier(0,0,.3,1),Zr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};Zr.prototype.isEnabled=function(){return"disabled"!==this._state},Zr.prototype.isActive=function(){return"active"===this._state},Zr.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},Zr.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Zr.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==s.mouseButton(e)||(s.addEventListener(t.default.document,"mousemove",this._onMove,{capture:!0}),s.addEventListener(t.default.document,"mouseup",this._onMouseUp),this._start(e)))},Zr.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(s.addEventListener(t.default.document,"touchmove",this._onMove,{capture:!0,passive:!1}),s.addEventListener(t.default.document,"touchend",this._onTouchEnd),this._start(e)))},Zr.prototype._start=function(e){t.default.addEventListener("blur",this._onBlur),this._state="pending",this._previousPos=s.mousePos(this._el,e),this._inertia=[[a.now(),this._previousPos]]},Zr.prototype._onMove=function(t){this._lastMoveEvent=t,t.preventDefault(),this._pos=s.mousePos(this._el,t),this._drainInertiaBuffer(),this._inertia.push([a.now(),this._pos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",t),this._fireEvent("movestart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame))},Zr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._previousPos),this._pos),this._fireEvent("drag",t),this._fireEvent("move",t),this._previousPos=this._pos,delete this._lastMoveEvent}},Zr.prototype._onMouseUp=function(t){if(0===s.mouseButton(t))switch(this._state){case"active":this._state="enabled",s.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Zr.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Zr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Zr.prototype._unbind=function(){s.removeEventListener(t.default.document,"touchmove",this._onMove,{capture:!0,passive:!1}),s.removeEventListener(t.default.document,"touchend",this._onTouchEnd),s.removeEventListener(t.default.document,"mousemove",this._onMove,{capture:!0}),s.removeEventListener(t.default.document,"mouseup",this._onMouseUp),s.removeEventListener(t.default,"blur",this._onBlur)},Zr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._previousPos,delete this._pos},Zr.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var r=e[e.length-1],n=e[0],i=r[1].sub(n[1]),a=(r[0]-n[0])/1e3;if(0===a||r[1].equals(n[1]))this._fireEvent("moveend",t);else{var o=i.mult(.3/a),s=o.mag();s>1400&&(s=1400,o._unit()._mult(s));var l=s/750,u=o.mult(-l/2);this._map.panBy(u,{duration:1e3*l,easing:Xr,noMoveStart:!0},{originalEvent:t})}}},Zr.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Zr.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=a.now();t.length>0&&e-t[0][0]>160;)t.shift()};var $r=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function Jr(t){return t*(2-t)}$r.prototype.isEnabled=function(){return!!this._enabled},$r.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},$r.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},$r.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,n=0,i=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(a=1,t.preventDefault());break;default:return}var o=this._map,s=o.getZoom(),l={duration:300,delayEndEvents:500,easing:Jr,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:o.getBearing()+15*r,pitch:o.getPitch()+10*n,offset:[100*-i,100*-a],center:o.getCenter()};o.easeTo(l,{originalEvent:t})}};var Kr=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};Kr.prototype.isEnabled=function(){return!!this._enabled},Kr.prototype.isActive=function(){return!!this._active},Kr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Kr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Kr.prototype.onTouchStart=function(t){var e=this;this.isEnabled()&&(t.points.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._zoom(t)):this._tapped=setTimeout(function(){e._tapped=null},300)))},Kr.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},Kr.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},Kr.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var Qr=t.bezier(0,0,.15,1),tn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};tn.prototype.isEnabled=function(){return!!this._enabled},tn.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},tn.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},tn.prototype.disableRotation=function(){this._rotationDisabled=!0},tn.prototype.enableRotation=function(){this._rotationDisabled=!1},tn.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=s.mousePos(this._el,e.touches[0]),n=s.mousePos(this._el,e.touches[1]);this._startVec=r.sub(n),this._gestureIntent=void 0,this._inertia=[],s.addEventListener(t.default.document,"touchmove",this._onMove,{passive:!1}),s.addEventListener(t.default.document,"touchend",this._onEnd)}},tn.prototype._getTouchEventData=function(t){var e=s.mousePos(this._el,t.touches[0]),r=s.mousePos(this._el,t.touches[1]),n=e.sub(r);return{vec:n,center:e.add(r).div(2),scale:n.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*n.angleWith(this._startVec)/Math.PI}},tn.prototype._onMove=function(e){if(2===e.touches.length){var r=this._getTouchEventData(e),n=r.vec,i=r.scale,a=r.bearing;if(!this._gestureIntent){var o=Math.abs(1-i)>.15;Math.abs(a)>10?this._gestureIntent="rotate":o&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=n)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},tn.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var r=this._map.transform;this._startScale||(this._startScale=r.scale,this._startBearing=r.bearing);var n=this._getTouchEventData(this._lastTouchEvent),i=n.center,o=n.bearing,s=n.scale,l=r.pointLocation(i),u=r.locationPoint(l);"rotate"===e&&(r.bearing=this._startBearing+o),r.zoom=r.scaleZoom(this._startScale*s),r.setLocationAtPoint(l,u),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([a.now(),s,i])}},tn.prototype._onEnd=function(e){s.removeEventListener(t.default.document,"touchmove",this._onMove,{passive:!1}),s.removeEventListener(t.default.document,"touchend",this._onEnd);var r=this._gestureIntent,n=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var i=this._inertia,a=this._map;if(i.length<2)a.snapToNorth({},{originalEvent:e});else{var o=i[i.length-1],l=i[0],u=a.transform.scaleZoom(n*o[1]),c=a.transform.scaleZoom(n*l[1]),f=u-c,h=(o[0]-l[0])/1e3,p=o[2];if(0!==h&&u!==c){var d=.15*f/h;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var v=1e3*Math.abs(d/(12*.15)),g=u+d*v/2e3;g<0&&(g=0),a.easeTo({zoom:g,duration:v,easing:Qr,around:this._aroundCenter?a.getCenter():a.unproject(p),noMoveStart:!0},{originalEvent:e})}else a.snapToNorth({},{originalEvent:e})}}},tn.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=a.now();t.length>2&&e-t[0][0]>160;)t.shift()};var en={scrollZoom:qr,boxZoom:Gr,dragRotate:Yr,dragPan:Zr,keyboard:$r,doubleClickZoom:Kr,touchZoomRotate:tn},rn=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return this.transform.center},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.default$1.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())e?1:0}),["bottom","left","right","top"]))return t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'"),this;e=W.convert(e);var a=[(r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2],o=Math.min(r.padding.right,r.padding.left),s=Math.min(r.padding.top,r.padding.bottom);r.offset=[r.offset[0]+a[0],r.offset[1]+a[1]];var l=t.default$1.convert(r.offset),u=this.transform,c=u.project(e.getNorthWest()),f=u.project(e.getSouthEast()),h=f.sub(c),p=(u.width-2*o-2*Math.abs(l.x))/h.x,d=(u.height-2*s-2*Math.abs(l.y))/h.y;return d<0||p<0?(t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."),this):(r.center=u.unproject(c.add(f).div(2)),r.zoom=Math.min(u.scaleZoom(u.scale*Math.min(p,d)),r.maxZoom),r.bearing=0,r.linear?this.easeTo(r,n):this.flyTo(r,n))},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,i=!1,a=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=G.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),i&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),a&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),o&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this.stop(),!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate&&(e.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?+e.zoom:a,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:s,f=i.centerPoint.add(t.default$1.convert(e.offset)),h=i.pointLocation(f),p=G.convert(e.center||h);this._normalizeCenter(p);var d,v,g=i.project(h),m=i.project(p).sub(g),y=i.zoomScale(l-a);return e.around&&(d=G.convert(e.around),v=i.locationPoint(d)),this._zooming=l!==a,this._rotating=o!==u,this._pitching=c!==s,this._prepareEase(r,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(e){if(n._zooming&&(i.zoom=t.number(a,l,e)),n._rotating&&(i.bearing=t.number(o,u,e)),n._pitching&&(i.pitch=t.number(s,c,e)),d)i.setLocationAtPoint(d,v);else{var h=i.zoomScale(i.zoom-a),p=l>a?Math.min(2,y):Math.max(.5,y),x=Math.pow(p,1-e),b=i.unproject(g.add(m.mult(e*x)).mult(h));i.setLocationAtPoint(i.renderWorldCopies?b.wrap():b,f)}n._fireMoveEvents(r)},function(){e.delayEndEvents?n._easeEndTimeoutID=setTimeout(function(){return n._afterEase(r)},e.delayEndEvents):n._afterEase(r)},e),this},r.prototype._prepareEase=function(e,r){this._moving=!0,r||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._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){var r=this._zooming,n=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,r&&this.fire(new t.Event("zoomend",e)),n&&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;this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?t.clamp(+e.zoom,i.minZoom,i.maxZoom):a,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:s,f=i.zoomScale(l-a),h=i.centerPoint.add(t.default$1.convert(e.offset)),p=i.pointLocation(h),d=G.convert(e.center||p);this._normalizeCenter(d);var v=i.project(p),g=i.project(d).sub(v),m=e.curve,y=Math.max(i.width,i.height),x=y/f,b=g.mag();if("minZoom"in e){var _=t.clamp(Math.min(e.minZoom,a,l),i.minZoom,i.maxZoom),w=y/i.zoomScale(_-a);m=Math.sqrt(w/b*2)}var k=m*m;function A(t){var e=(x*x-y*y+(t?-1:1)*k*k*b*b)/(2*(t?x:y)*k*b);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function M(t){return(Math.exp(t)+Math.exp(-t))/2}var E=A(0),S=function(t){return M(E)/M(E+m*t)},C=function(t){return y*((M(E)*(T(e=E+m*t)/M(e))-T(E))/k)/b;var e},L=(A(1)-E)/m;if(Math.abs(b)<1e-6||!isFinite(L)){if(Math.abs(y-x)<1e-6)return this.easeTo(e,r);var O=xe.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=o!==u,this._pitching=c!==s,this._prepareEase(r,!1),this._ease(function(e){var l=e*L,f=1/S(l);i.zoom=a+i.scaleZoom(f),n._rotating&&(i.bearing=t.number(o,u,e)),n._pitching&&(i.pitch=t.number(s,c,e));var p=i.unproject(v.add(g.mult(C(l))).mult(f));i.setLocationAtPoint(i.renderWorldCopies?p.wrap():p,h),n._fireMoveEvents(r)},function(){return n._afterEase(r)},e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},r.prototype._ease=function(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<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),nn=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};nn.prototype.getDefaultPosition=function(){return"bottom-right"},nn.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),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},nn.prototype.onRemove=function(){s.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},nn.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:g.ACCESS_TOKEN}];if(t){var r=e.reduce(function(t,r,n){return r.value&&(t+=r.key+"="+r.value+(n=0)return!1;return!0})).length?(this._container.innerHTML=t.join(" | "),this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null}},nn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var an=function(){t.bindAll(["_updateLogo"],this)};an.prototype.onAdd=function(t){this._map=t,this._container=s.create("div","mapboxgl-ctrl");var e=s.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._container},an.prototype.onRemove=function(){s.remove(this._container),this._map.off("sourcedata",this._updateLogo)},an.prototype.getDefaultPosition=function(){return"bottom-left"},an.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},an.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}};var on=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};on.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},on.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 minZoom");var n=new Br(e.minZoom,e.maxZoom,e.renderWorldCopies);r.call(this,n,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new on;var i=e.transformRequest;if(this._transformRequest=i?function(t,e){return i(t,e)||{url:t}}:function(t){return{url:t}},"string"==typeof e.container){var a=t.default.document.getElementById(e.container);if(!a)throw new Error("Container '"+e.container+"' not found.");this._container=a}else{if(!(e.container instanceof ln))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),void 0!==t.default&&(t.default.addEventListener("online",this._onWindowOnline,!1),t.default.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),n=null,i=!1;for(var a in en)t[a]=new en[a](t,e),e.interactive&&e[a]&&t[a].enable(e[a]);s.addEventListener(r,"mouseout",function(e){t.fire(new Vr("mouseout",t,e))}),s.addEventListener(r,"mousedown",function(r){i=!0;var n=new Vr("mousedown",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(r),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(r),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(r))}),s.addEventListener(r,"mouseup",function(e){var r=t.dragRotate.isActive();n&&!r&&t.fire(new Vr("contextmenu",t,n)),n=null,i=!1,t.fire(new Vr("mouseup",t,e))}),s.addEventListener(r,"mousemove",function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var n=e.toElement||e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Vr("mousemove",t,e))}}),s.addEventListener(r,"mouseover",function(e){for(var n=e.toElement||e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Vr("mouseover",t,e))}),s.addEventListener(r,"touchstart",function(r){var n=new Ur("touchstart",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r),t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(n))},{passive:!1}),s.addEventListener(r,"touchmove",function(e){t.fire(new Ur("touchmove",t,e))},{passive:!1}),s.addEventListener(r,"touchend",function(e){t.fire(new Ur("touchend",t,e))}),s.addEventListener(r,"touchcancel",function(e){t.fire(new Ur("touchcancel",t,e))}),s.addEventListener(r,"click",function(e){t.fire(new Vr("click",t,e))}),s.addEventListener(r,"dblclick",function(e){var r=new Vr("dblclick",t,e);t.fire(r),r.defaultPrevented||t.doubleClickZoom.onDblClick(r)}),s.addEventListener(r,"contextmenu",function(e){var r=t.dragRotate.isActive();i||r?i&&(n=e):t.fire(new Vr("contextmenu",t,e)),e.preventDefault()}),s.addEventListener(r,"wheel",function(e){var r=new Hr("wheel",t,e);t.fire(r),r.defaultPrevented||t.scrollZoom.onWheel(e)},{passive:!1})}(this,e),this._hash=e.hash&&(new jr).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this.resize(),e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new nn),this.addControl(new an,e.logoPosition),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}r&&(n.__proto__=r),n.prototype=Object.create(r&&r.prototype),n.prototype.constructor=n;var i={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0}};return n.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),n=this._controlPositions[e];return-1!==e.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this},n.prototype.removeControl=function(t){return t.onRemove(this),this},n.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];return this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e))},n.prototype.getBounds=function(){var e=new W(this.transform.pointLocation(new t.default$1(0,this.transform.height)),this.transform.pointLocation(new t.default$1(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(e.extend(this.transform.pointLocation(new t.default$1(this.transform.size.x,0))),e.extend(this.transform.pointLocation(new t.default$1(0,this.transform.size.y)))),e},n.prototype.getMaxBounds=function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new W([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null},n.prototype.setMaxBounds=function(t){if(t){var e=W.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null==t&&(this.transform.lngRange=null,this.transform.latRange=null,this._update());return this},n.prototype.setMinZoom=function(t){if((t=null==t?0:t)>=0&&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")},n.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},n.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update(),this},n.prototype.getMaxZoom=function(){return this.transform.maxZoom},n.prototype.project=function(t){return this.transform.locationPoint(G.convert(t))},n.prototype.unproject=function(e){return this.transform.pointLocation(t.default$1.convert(e))},n.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},n.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isActive()},n.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},n.prototype.on=function(t,e,n){var i,a=this;if(void 0===n)return r.prototype.on.call(this,t,e);var o=function(){if("mouseenter"===t||"mouseover"===t){var r=!1;return{layer:e,listener:n,delegates:{mousemove:function(i){var o=a.getLayer(e)?a.queryRenderedFeatures(i.point,{layers:[e]}):[];o.length?r||(r=!0,n.call(a,new Vr(t,a,i.originalEvent,{features:o}))):r=!1},mouseout:function(){r=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){(a.getLayer(e)?a.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,n.call(a,new Vr(t,a,r.originalEvent)))},mouseout:function(e){o&&(o=!1,n.call(a,new Vr(t,a,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(i={},i[t]=function(t){var r=a.getLayer(e)?a.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,n.call(a,t),delete t.features)},i)}}();for(var s in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)a.on(s,o.delegates[s]);return this},n.prototype.off=function(t,e,n){if(void 0===n)return r.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var i=this._delegatedListeners[t],a=0;a180;){var o=r.locationPoint(t);if(o.x>=0&&o.y>=0&&o.x<=r.width&&o.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}pn.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},pn.prototype.onAdd=function(t){return this._map=t,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Yr(t,{button:"left",element:this._compass}),this._handler.enable()),this._container},pn.prototype.onRemove=function(){s.remove(this._container),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),this._handler.disable(),delete this._handler),delete this._map},pn.prototype._createButton=function(t,e,r){var n=s.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",r),n};var vn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function gn(t,e,r){var n=t.classList;for(var i in vn)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var mn=function(e){if((arguments[0]instanceof t.default.HTMLElement||2===arguments.length)&&(e=t.extend({element:e},arguments[1])),t.bindAll(["_update","_onMapClick"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",e&&e.element)this._element=e.element,this._offset=t.default$1.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=s.create("div");var r=s.createNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"height","41px"),r.setAttributeNS(null,"width","27px"),r.setAttributeNS(null,"viewBox","0 0 27 41");var n=s.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"stroke","none"),n.setAttributeNS(null,"stroke-width","1"),n.setAttributeNS(null,"fill","none"),n.setAttributeNS(null,"fill-rule","evenodd");var i=s.createNS("http://www.w3.org/2000/svg","g");i.setAttributeNS(null,"fill-rule","nonzero");var a=s.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000");for(var o=0,l=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];o5280?An(e,u,h/5280,"mi"):An(e,u,h,"ft")}else r&&"nautical"===r.unit?An(e,u,f/1852,"nm"):An(e,u,f,"m")}function An(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:1)),l=s/r;"m"===n&&s>=1e3&&(s/=1e3,n="km"),t.style.width=e*l+"px",t.innerHTML=s+n}wn.prototype.getDefaultPosition=function(){return"bottom-left"},wn.prototype._onMove=function(){kn(this._map,this._container,this.options)},wn.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},wn.prototype.onRemove=function(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},wn.prototype.setUnit=function(t){this.options.unit=t,kn(this._map,this._container,this.options)};var Tn=function(){this._fullscreen=!1,t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.default.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.default.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.default.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.default.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};Tn.prototype.onAdd=function(e){return this._map=e,this._mapContainer=this._map.getContainer(),this._container=s.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._container},Tn.prototype.onRemove=function(){s.remove(this._container),this._map=null,t.default.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Tn.prototype._checkFullscreenSupport=function(){return!!(t.default.document.fullscreenEnabled||t.default.document.mozFullScreenEnabled||t.default.document.msFullscreenEnabled||t.default.document.webkitFullscreenEnabled)},Tn.prototype._setupUI=function(){var e=this._fullscreenButton=s.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);e.setAttribute("aria-label","Toggle fullscreen"),e.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.default.document.addEventListener(this._fullscreenchange,this._changeIcon)},Tn.prototype._isFullscreen=function(){return this._fullscreen},Tn.prototype._changeIcon=function(){(t.default.document.fullscreenElement||t.default.document.mozFullScreenElement||t.default.document.webkitFullscreenElement||t.default.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},Tn.prototype._onClickFullscreen=function(){this._isFullscreen()?t.default.document.exitFullscreen?t.default.document.exitFullscreen():t.default.document.mozCancelFullScreen?t.default.document.mozCancelFullScreen():t.default.document.msExitFullscreen?t.default.document.msExitFullscreen():t.default.document.webkitCancelFullScreen&&t.default.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()};var Mn={closeButton:!0,closeOnClick:!0},En=function(e){function r(r){e.call(this),this.options=t.extend(Object.create(Mn),r),t.bindAll(["_update","_onClickClose"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.addTo=function(e){return this._map=e,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this.fire(new t.Event("open")),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&s.remove(this._content),this._container&&(s.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=G.convert(t),this._pos=null,this._update(),this},r.prototype.setText=function(e){return this.setDOMContent(t.default.document.createTextNode(e))},r.prototype.setHTML=function(e){var r,n=t.default.document.createDocumentFragment(),i=t.default.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype._createContent=function(){this._content&&s.remove(this._content),this._content=s.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=s.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._onClickClose))},r.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=s.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=s.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content)),this._map.transform.renderWorldCopies&&(this._lngLat=dn(this._lngLat,this._pos,this._map.transform));var e=this._pos=this._map.project(this._lngLat),r=this.options.anchor,n=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.default$1(0,0),top:new t.default$1(0,r),"top-left":new t.default$1(n,n),"top-right":new t.default$1(-n,n),bottom:new t.default$1(0,-r),"bottom-left":new t.default$1(n,-n),"bottom-right":new t.default$1(-n,-n),left:new t.default$1(r,0),right:new t.default$1(-r,0)}}if(r instanceof t.default$1||Array.isArray(r)){var i=t.default$1.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.default$1.convert(r.center||[0,0]),top:t.default$1.convert(r.top||[0,0]),"top-left":t.default$1.convert(r["top-left"]||[0,0]),"top-right":t.default$1.convert(r["top-right"]||[0,0]),bottom:t.default$1.convert(r.bottom||[0,0]),"bottom-left":t.default$1.convert(r["bottom-left"]||[0,0]),"bottom-right":t.default$1.convert(r["bottom-right"]||[0,0]),left:t.default$1.convert(r.left||[0,0]),right:t.default$1.convert(r.right||[0,0])}}return e(new t.default$1(0,0))}(this.options.offset);if(!r){var i,a=this._container.offsetWidth,o=this._container.offsetHeight;i=e.y+n.bottom.ythis._map.transform.height-o?["bottom"]:[],e.xthis._map.transform.width-a/2&&i.push("right"),r=0===i.length?"bottom":i.join("-")}var l=e.add(n[r]).round();s.setTransform(this._container,vn[r]+" translate("+l.x+"px,"+l.y+"px)"),gn(this._container,r,"popup")}},r.prototype._onClickClose=function(){this.remove()},r}(t.Evented),Sn={version:"0.45.0",supported:e,workerCount:Math.max(Math.floor(a.hardwareConcurrency/2),1),setRTLTextPlugin:t.setRTLTextPlugin,Map:cn,NavigationControl:pn,GeolocateControl:bn,AttributionControl:nn,ScaleControl:wn,FullscreenControl:Tn,Popup:En,Marker:mn,Style:Je,LngLat:G,LngLatBounds:W,Point:t.default$1,Evented:t.Evented,config:g,get accessToken(){return g.ACCESS_TOKEN},set accessToken(t){g.ACCESS_TOKEN=t},workerUrl:""};return Sn}),n})}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],422:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1<p[1][2]&&(m[0]=-m[0]),p[0][2]>p[2][0]&&(m[1]=-m[1]),p[1][0]>p[0][1]&&(m[2]=-m[2]),!0}},{"./normalize":424,"gl-mat4/clone":258,"gl-mat4/create":259,"gl-mat4/determinant":260,"gl-mat4/invert":264,"gl-mat4/transpose":275,"gl-vec3/cross":329,"gl-vec3/dot":334,"gl-vec3/length":344,"gl-vec3/normalize":351}],424:[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}},{}],425:[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(),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=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!h||!p||(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),i(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),0))}},{"gl-mat4/determinant":260,"gl-vec3/lerp":345,"mat4-decompose":423,"mat4-recompose":426,"quat-slerp":478}],426:[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":259,"gl-mat4/fromRotationTranslation":262,"gl-mat4/identity":263,"gl-mat4/multiply":266,"gl-mat4/scale":273,"gl-mat4/translate":274}],427:[function(t,e,r){"use strict";e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],428:[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"),u=t("gl-mat4/lookAt"),c=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,u=0;u<16;++u)o[u]=s[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,p=!0,u=0;u<16;++u)h[u]=s[l++];for(var d=this.nextMatrix,u=0;u<16;++u)d[u]=s[l++],p=p&&h[u]===d[u];if(c<1e-6||p)for(var u=0;u<16;++u)o[u]=h[u];else i(o,h,d,(t-e[r])/c)}var v=this.computedUp;v[0]=o[1],v[1]=o[5],v[2]=o[9],f(v,v);var g=this.computedInverse;a(g,o);var m=this.computedEye,y=g[15];m[0]=g[12]/y,m[1]=g[13]/y,m[2]=g[14]/y;for(var x=this.computedCenter,b=Math.exp(this.computedRadius[0]),u=0;u<3;++u)x[u]=m[u]-o[2+4*u]*b}},d.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)}for(var r=new Array(s.length+o.length-2),f=0,i=0,h=o.length;i0;--p)r[f++]=s[p];return r};var n=t("robust-orientation")[3]},{"robust-orientation":497}],430:[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 u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==i||c!==a||l(s))&&(r=0|t,i=u||0,a=c||0,e&&e(r,i,a,o))}function c(t){u(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)?u(0,t):u(r,t)}function d(t){u(r|n.buttons(t),t)}function v(t){u(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",v),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)))}g();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",v),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 i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=t("mouse-event")},{"mouse-event":432}],431:[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,a=t.clientX||0,o=t.clientY||0,s=(i=e)===window||i===document||i===document.body?n:i.getBoundingClientRect();return r[0]=a-s.left,r[1]=o-s.top,r}},{}],432:[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){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 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||[],C=new Array(M),L=0;L=0?C[L]=!0:C[L]=!1;return function(t,e,r,M,E,S){var C=S.length,L=E.length;if(L<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var O="extractContour"+E.join("_"),I=[],P=[],D=[],z=0;z0&&N.push(l(z,E[R-1])+"*"+s(E[R-1])),P.push(d(z,E[R])+"=("+N.join("-")+")|0")}for(var z=0;z=0;--z)j.push(s(E[z]));P.push(w+"=("+j.join("*")+")|0",b+"=mallocUint32("+w+")",x+"=mallocUint32("+w+")",k+"=0"),P.push(v(0)+"=0");for(var R=1;R<1<0;A=A-1&d)w.push(x+"["+k+"+"+m(A)+"]");w.push(y(0));for(var A=0;A=0;--e)G(e,0);for(var r=[],e=0;e0){",p(E[e]),"=1;"),t(e-1,r|1<=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 u=".lo("+a.join()+").hi("+o.join()+")";if(0===a.length&&(u=""),i>0){n.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");n.push("){grad",i,"(src.pick(",s.join(),")",u);for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push(",dst.pick(",s.join(),",",l,")",u);n.push(");")}for(var l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",h.join(),")-src.get(",p.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>1){diff(",f,",src.pick(",h.join(),")",u,",src.pick(",p.join(),")",u,");}else{zero(",f,");};");break;case"mirror":0===i?n.push("dst.set(",s.join(),",",c,",0);"):n.push("zero(",f,");");break;case"wrap":var d=s.slice(),v=s.slice();e[l]<0?(d[c]="s["+c+"]-2",v[c]="0"):(d[c]="s["+c+"]-1",v[c]="1"),0===i?n.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",d.join(),")-src.get(",v.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>2){diff(",f,",src.pick(",d.join(),")",u,",src.pick(",v.join(),")",u,");}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 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: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":139}],440:[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":441,ndarray:445}],441:[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":139}],442:[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",h,"*n",h].join("")):s.push(["d",d,"=s",d].join("")),h=d);var f=t.length-1-l;0!==f&&(p>0?s.push(["e",f,"=s",f,"-e",p,"*n",p,",f",f,"=",u[f],"-f",p,"*n",p].join("")):s.push(["e",f,"=s",f,",f",f,"=",u[f]].join("")),p=f)}r.push("var "+s.join(","));var v=["0","n0-1","data","offset"].concat(o(t.length));r.push(["if(n0<=",i,"){","insertionSort(",v.join(","),")}else{","quickSort(",v.join(","),")}"].join("")),r.push("}return "+n);var g=new Function("insertionSort","quickSort",r.join("\n")),m=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 u=[],c=1;c1){r.push("dptr=0;sptr=ptr");for(var c=t.length-1;c>=0;--c){var p=t[c];0!==p&&r.push(["for(i",p,"=0;i",p,"b){break __l}"].join(""));for(var c=t.length-1;c>=1;--c)r.push("sptr+=e"+c,"dptr+=f"+c,"}");r.push("dptr=cptr;sptr=cptr-s0");for(var c=t.length-1;c>=0;--c){var p=t[c];0!==p&&r.push(["for(i",p,"=0;i",p,"=0;--c){var p=t[c];0!==p&&r.push(["for(i",p,"=0;i",p,"scratch)){",h("cptr",f("cptr-s0")),"cptr-=s0","}",h("cptr","scratch"));if(r.push("}"),t.length>1&&s&&r.push("free(scratch)"),r.push("} return "+n),s){var d=new Function("malloc","free",r.join("\n"));return d(s[0],s[1])}var d=new Function(r.join("\n"));return d()}(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=a(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=[],p=1;p=0;--a){var o=t[a];0!==o&&n.push(["for(i",o,"=0;i",o,"1)for(var 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(var 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&&u&&n.push("free(pivot1)","free(pivot2)")}function b(e,r){var i="el"+e,a="el"+r;if(t.length>1){var o="__l"+ ++c;y(o,[i,a],!1,["comp=",v("ptr0"),"-",v("ptr1"),"\n","if(comp>0){tmp0=",i,";",i,"=",a,";",a,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else n.push(["if(",v(d(i)),">",v(d(a)),"){tmp0=",i,";",i,"=",a,";",a,"=tmp0}"].join(""))}function _(e,r){t.length>1?m([e,r],!1,g("ptr0",v("ptr1"))):n.push(g(d(e),v(d(r))))}function w(e,r,i){if(t.length>1){var a="__l"+ ++c;y(a,[r],!0,[e,"=",v("ptr0"),"-pivot",i,"[pivot_ptr]\n","if(",e,"!==0){break ",a,"}"].join(""))}else n.push([e,"=",v(d(r)),"-pivot",i].join(""))}function k(e,r){t.length>1?m([e,r],!1,["tmp=",v("ptr0"),"\n",g("ptr0",v("ptr1")),"\n",g("ptr1","tmp")].join("")):n.push(["ptr0=",d(e),"\n","ptr1=",d(r),"\n","tmp=",v("ptr0"),"\n",g("ptr0",v("ptr1")),"\n",g("ptr1","tmp")].join(""))}function A(e,r,i){t.length>1?(m([e,r,i],!1,["tmp=",v("ptr0"),"\n",g("ptr0",v("ptr1")),"\n",g("ptr1",v("ptr2")),"\n",g("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=",v("ptr0"),"\n",g("ptr0",v("ptr1")),"\n",g("ptr1",v("ptr2")),"\n",g("ptr2","tmp")].join(""))}function T(t,e){k(t,e),n.push("--"+e)}function M(e,r,i){t.length>1?m([e,r],!0,[g("ptr0",v("ptr1")),"\n",g("ptr1",["pivot",i,"[pivot_ptr]"].join(""))].join("")):n.push(g(d(e),v(d(r))),g(d(r),"pivot"+i))}function E(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 S(e,r,i){t.length>1?(n.push(["__l",++c,":while(true){"].join("")),m([e],!0,["if(",v("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",c,"}"].join("")),n.push(i,"}")):n.push(["while(",v(d(e)),"===pivot",r,"){",i,"}"].join(""))}if(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?m(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",v("ptr1"),"\n","pivot2[pivot_ptr]=",v("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",v("ptr0"),"\n","y=",v("ptr2"),"\n","z=",v("ptr4"),"\n",g("ptr5","x"),"\n",g("ptr6","y"),"\n",g("ptr7","z")].join("")):n.push(["pivot1=",v(d("el2")),"\n","pivot2=",v(d("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",v(d("el1")),"\n","y=",v(d("el3")),"\n","z=",v(d("el5")),"\n",g(d("index1"),"x"),"\n",g(d("index3"),"y"),"\n",g(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){"),k("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){"),A("k","less","great"),n.push("break"),n.push("}else{"),T("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){"),k("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){"),k("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){var C=new Function("insertionSort","malloc","free",n.join("\n"));return C(r,u[0],u[1])}return(C=new Function("insertionSort",n.join("\n")))(r)}(t,e,m);return g(m,y)}},{"typedarray-pool":532}],443:[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":442}],444:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_3_arg4_)}",args:[{name:"_inline_3_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_4_arg2_(this_warped,_inline_4_arg0_),_inline_4_arg1_=_inline_4_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_4_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_4_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_7_arg2_(this_warped,_inline_7_arg0_),_inline_7_arg1_=_inline_7_arg3_(_inline_7_arg4_,this_warped[0])}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_(_inline_10_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":142,"ndarray-linear-interpolate":438}],445:[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("+c.join(",")+",v){"),i?a.push("return this.data.set("+f+",v)}"):a.push("return this.data["+f+"]=v}"),a.push("proto.get=function "+r+"_get("+c.join(",")+"){"),i?a.push("return this.data.get("+f+")}"):a.push("return this.data["+f+"]}"),a.push("proto.index=function "+r+"_index(",c.join(),"){return "+f+"}"),a.push("proto.hi=function "+r+"_hi("+c.join(",")+"){return new "+r+"(this.data,"+l.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+l.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=l.map(function(t){return"a"+t+"=this.shape["+t+"]"}),v=l.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+v.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,"+l.map(function(t){return"a"+t}).join(",")+","+l.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+c.join(",")+"){var "+l.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+l.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");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,"+l.map(function(t){return"shape["+t+"]"}).join(",")+","+l.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",a.join("\n"));return o(u[t],s)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t){var o=u.array[0];return o([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var c=s-1,f=1;c>=0;--c)r[c]=f,f*=e[c]}if(void 0===n){n=0;for(var c=0;c>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},{"double-bits":161}],447:[function(t,e,r){var n=Math.PI,i=u(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,u,c,f,h,p){if(p)k=p[0],A=p[1],_=p[2],w=p[3];else{var d=l(t,e,-o);t=d.x,e=d.y,d=l(f,h,-o),f=d.x,h=d.y;var v=(t-f)/2,g=(e-h)/2,m=v*v/(r*r)+g*g/(a*a);m>1&&(m=Math.sqrt(m),r*=m,a*=m);var y=r*r,x=a*a,b=(u==c?-1:1)*Math.sqrt(Math.abs((y*x-y*g*g-x*v*v)/(y*g*g+x*v*v)));b==1/0&&(b=1);var _=b*r*g/a+(t+f)/2,w=b*-a*v/r+(e+h)/2,k=Math.asin(((e-w)/a).toFixed(9)),A=Math.asin(((h-w)/a).toFixed(9));(k=t<_?n-k:k)<0&&(k=2*n+k),(A=f<_?n-A:A)<0&&(A=2*n+A),c&&k>A&&(k-=2*n),!c&&A>k&&(A-=2*n)}if(Math.abs(A-k)>i){var T=A,M=f,E=h;A=k+i*(c&&A>k?1:-1),f=_+r*Math.cos(A),h=w+a*Math.sin(A);var S=s(f,h,r,a,o,0,c,M,E,[A,T,_,w])}var C=Math.tan((A-k)/4),L=4/3*r*C,O=4/3*a*C,I=[2*t-(t+L*Math.sin(k)),2*e-(e-O*Math.cos(k)),f+L*Math.sin(A),h-O*Math.cos(A),f,h];if(p)return I;S&&(I=I.concat(S));for(var P=0;P7&&(r.push(m.splice(0,7)),m.unshift("C"));break;case"S":var x=p,b=d;"C"!=e&&"S"!=e||(x+=x-n,b+=b-i),m=["C",x,b,m[1],m[2],m[3],m[4]];break;case"T":"Q"==e||"T"==e?(f=2*p-f,h=2*d-h):(f=p,h=d),m=o(p,d,f,h,m[1],m[2]);break;case"Q":f=m[1],h=m[2],m=o(p,d,m[1],m[2],m[3],m[4]);break;case"L":m=a(p,d,m[1],m[2]);break;case"H":m=a(p,d,m[1],d);break;case"V":m=a(p,d,p,m[1]);break;case"Z":m=a(p,d,l,c)}e=y,p=m[m.length-2],d=m[m.length-1],m.length>4?(n=m[m.length-4],i=m[m.length-3]):(n=p,i=d),r.push(m)}return r}},{}],448:[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)for(var b=i[u],_=1/Math.sqrt(g*y),x=0;x<3;++x){var w=(x+1)%3,k=(x+2)%3;b[x]+=_*(m[w]*v[k]-m[k]*v[w])}}for(var o=0;oa)for(var _=1/Math.sqrt(A),x=0;x<3;++x)b[x]*=_;else for(var 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(var u=0;u<3;++u)h[u]*=p;i[o]=h}return i}},{}],449:[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;c0){var f=Math.sqrt(u+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 p=Math.max(e,i,c);f=Math.sqrt(2*p-u+1),e>=p?(t[0]=.5*f,t[1]=.5*(a+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):i>=p?(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}},{}],457:[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 a=new f(r,e,Math.log(n));return a.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&a.lookAt(0,t.eye,t.center,t.up),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 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],a=e[2],i=e[3],o=c(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 p=f.prototype;p.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},p.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;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 c=0,f=0;f<3;++f)c+=r[l+4*f]*a[f];r[12+l]=-c}},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},p.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},p.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},p.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],c=l(i,o,s);i/=c,o/=c,s/=c;var u=a[0],f=a[4],p=a[8],h=u*i+f*o+p*s,d=l(u-=i*h,f-=o*h,p-=s*h);u/=d,f/=d,p/=d;var g=a[2],v=a[6],m=a[10],y=g*i+v*o+m*s,x=g*u+v*f+m*p,b=l(g-=y*i+x*u,v-=y*o+x*f,m-=y*s+x*p);g/=b,v/=b,m/=b;var _=u*e+i*r,w=f*e+o*r,k=p*e+s*r;this.center.move(t,_,w,k);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+n),this.radius.set(t,Math.log(T))},p.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],u=a[1],f=a[5],p=a[9],h=a[2],d=a[6],g=a[10],v=e*i+r*u,m=e*o+r*f,y=e*s+r*p,x=-(d*y-g*m),b=-(g*v-h*y),_=-(h*m-d*v),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),k=c(x,b,_,w);k>1e-6?(x/=k,b/=k,_/=k,w/=k):(x=b=_=0,w=1);var T=this.computedRotation,A=T[0],M=T[1],E=T[2],S=T[3],C=A*w+S*x+M*_-E*b,L=M*w+S*b+E*x-A*_,O=E*w+S*_+A*b-M*x,P=S*w-A*x-M*b-E*_;if(n){x=h,b=d,_=g;var I=Math.sin(n)/l(x,b,_);x*=I,b*=I,_*=I,P=P*(w=Math.cos(e))-(C=C*w+P*x+L*_-O*b)*x-(L=L*w+P*b+O*x-C*_)*b-(O=O*w+P*_+C*b-L*x)*_}var D=c(C,L,O,P);D>1e-6?(C/=D,L/=D,O/=D,P/=D):(C=L=O=0,P=1),this.rotation.set(t,C,L,O,P)},p.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]),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])},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.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 a=n[15];if(Math.abs(a)>1e-6){var i=n[12]/a,l=n[13]/a,c=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,c-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},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;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.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]}},p.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":456,"filtered-vector":228,"gl-mat4/fromQuat":264,"gl-mat4/invert":267,"gl-mat4/lookAt":268}],458:[function(t,e,r){ +"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;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;var n=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==n.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l0){var f=Math.sqrt(c+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,u),f=Math.sqrt(2*h-c+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}},{}],451:[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 i=new f(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};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 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],i=e[2],a=e[3],o=u(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;c(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 u=0,f=0;f<3;++f)u+=r[l+4*f]*i[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 i=this.computedMatrix,a=i[1],o=i[5],s=i[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=i[0],f=i[4],h=i[8],p=c*a+f*o+h*s,d=l(c-=a*p,f-=o*p,h-=s*p);c/=d,f/=d,h/=d;var v=i[2],g=i[6],m=i[10],y=v*a+g*o+m*s,x=v*c+g*f+m*h,b=l(v-=y*a+x*c,g-=y*o+x*f,m-=y*s+x*h);v/=b,g/=b,m/=b;var _=c*e+a*r,w=f*e+o*r,k=h*e+s*r;this.center.move(t,_,w,k);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+n),this.radius.set(t,Math.log(A))},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],c=i[1],f=i[5],h=i[9],p=i[2],d=i[6],v=i[10],g=e*a+r*c,m=e*o+r*f,y=e*s+r*h,x=-(d*y-v*m),b=-(v*g-p*y),_=-(p*m-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),k=u(x,b,_,w);k>1e-6?(x/=k,b/=k,_/=k,w/=k):(x=b=_=0,w=1);var A=this.computedRotation,T=A[0],M=A[1],E=A[2],S=A[3],C=T*w+S*x+M*_-E*b,L=M*w+S*b+E*x-T*_,O=E*w+S*_+T*b-M*x,I=S*w-T*x-M*b-E*_;if(n){x=p,b=d,_=v;var P=Math.sin(n)/l(x,b,_);x*=P,b*=P,_*=P,w=Math.cos(e),I=I*w-(C=C*w+I*x+L*_-O*b)*x-(L=L*w+I*b+O*x-C*_)*b-(O=O*w+I*_+C*b-L*x)*_}var D=u(C,L,O,I);D>1e-6?(C/=D,L/=D,O/=D,I/=D):(C=L=O=0,I=1),this.rotation.set(t,C,L,O,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]),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 i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,u=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,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 i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":450,"filtered-vector":225,"gl-mat4/fromQuat":261,"gl-mat4/invert":264,"gl-mat4/lookAt":265}],452:[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":501}],459:[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},{}],460:[function(t,e,r){"use strict";var n=t("pick-by-alias");e.exports=function(t){var e;return 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),e}},{"pick-by-alias":466}],461:[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,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,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":416,"typedarray-pool":543}],466:[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[u][r][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var p=i[f][r],h=0;h0&&(o=d,s=g,l=f)}return a?s:(o&&c(o,l),s)}function f(t,r){var a=i[r][t][0],o=[t];c(a,r);for(var s=a[1^r];;){for(;s!==t;)o.push(s),s=u(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,p=o[1],h=u(l,f,!0);if(n(e[l],e[f],e[p],e[h])<0)break;o.push(t),s=u(l,f)}return o}function p(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){i[0][o].length;var g=f(o,h);p(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":128}],468:[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 c=o.pop();a[c]=!1;var u=r[c];for(s=0;s0}))).length,v=new Array(g),m=new Array(g);for(h=0;h0;){var B=R.pop(),N=S[B];l(N,(function(t,e){return t-e}));var j,V=N.length,U=F[B];if(0===U){var H=d[B];j=[H]}for(h=0;h=0||(F[q]=1^U,R.push(q),0===U&&(z(H=d[q])||(H.reverse(),j.push(H))))}0===U&&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"),c=t("./lib/trim-leaves");function u(t,e){for(var r=new Array(t),n=0;n>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?g=new(f(e.dtype))(m):e.dtype&&(g=e.dtype,Array.isArray(g)&&(g.length=m));for(var y=0;yr||s>h){for(var p=0;pr+a||M>l||E=L||o===s)){var c=x[i];void 0===s&&(s=c.length);for(var u=o;u=v&&p<=y&&h>=m&&h<=k&&O.push(f)}var d=b[i],g=d[4*o+0],_=d[4*o+1],w=d[4*o+2],T=d[4*o+3],C=function(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}(d,o+1),P=.5*a,I=i+1;e(r,n,P,I,g,_||w||T||C),e(r,n+P,P,I,_,w||T||C),e(r+P,n,P,I,w,T||C),e(r+P,n+P,P,I,T,C)}}}(0,0,1,0,0,1),O},g;function C(t,e,r){for(var n=1,a=.5,i=.5,o=.5,s=0;s0&&e[a]===r[0]))return 1;i=t[a-1]}for(var s=1;i;){var l=i.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,i=i.right}else if(c>0)i=i.left;else{if(!(c<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("(\\"+i+r+"(?![0-9]))","g"),t[0]+"$1"+t[1])}),e})});var o=new RegExp("\\"+i+"([0-9]+)");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]+)"),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},{}],454:[function(t,e,r){"use strict";var n=t("pick-by-alias");e.exports=function(t){var e;return 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),e}},{"pick-by-alias":460}],455:[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,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]}r=r||new Array(t);var n,i,a,o=1;for(r[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":410,"typedarray-pool":532}],460:[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[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=a[f][r],p=0;p0&&(o=d,s=v,l=f)}return i?s:(o&&u(o,l),s)}function f(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=c(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=c(l,f,!0);if(n(e[l],e[f],e[h],e[p])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(var o=0;o0;){a[0][o].length;var v=f(o,p);h(d,v)?d.push.apply(d,v):(d.length>0&&l.push(d),d=v)}d.length>0&&l.push(d)}return l};var n=t("compare-angle")},{"compare-angle":120}],462:[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 u=o.pop();i[u]=!1;for(var c=r[u],s=0;s0})).length,g=new Array(v),m=new Array(v),p=0;p0;){var N=F.pop(),j=C[N];l(j,function(t,e){return t-e});var V,U=j.length,H=B[N];if(0===H){var k=d[N];V=[k]}for(var p=0;p=0)&&(B[q]=1^H,F.push(q),0===H)){var k=d[q];R(k)||(k.reverse(),V.push(k))}}0===H&&r.push(V)}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"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n>>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 m=0;mr){for(var h=0;hl||M>u||E=L||o===s)){var c=y[a];void 0===s&&(s=c.length);for(var f=o;f=g&&p<=w&&d>=m&&d<=k&&O.push(h)}var v=x[a],b=v[4*o+0],_=v[4*o+1],A=v[4*o+2],S=v[4*o+3],I=function(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}(v,o+1),P=.5*i,D=a+1;e(r,n,P,D,b,_||A||S||I),e(r,n+P,P,D,_,A||S||I),e(r+P,n,P,D,A,S||I),e(r+P,n+P,P,D,S,I)}}}(0,0,1,0,0,1),O},d;function S(t,e,r){for(var n=1,i=.5,a=.5,o=.5,s=0;s0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(u>0)a=a.left;else{if(!(u<0))return 0;s=1,a=a.right}}return s}}(m.slabs,m.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}},{}],477:[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 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 p=e.pointsSame(o,c),h=e.pointsSame(s,u);if(p&&h)return n;var d=!p&&e.pointBetween(o,c,u),g=!h&&e.pointBetween(s,c,u);if(p)return g?l(n,s):l(t,u),n;d&&(h||(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=[];!i.isEmpty();){var p=i.getHead();if(r&&r.vert(p.pt[0]),p.isStart){r&&r.segmentNew(p.seg,p.primary);var h=c(p),d=h.before?h.before.ev:null,g=h.after?h.after.ev:null;function v(){if(d){var t=u(p,d);if(t)return t}return!!g&&u(p,g)}r&&r.tempStatus(p.seg,!!d&&d.seg,!!g&&g.seg);var m,y,x=v();if(x&&(t?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=p.seg.myFill,r&&r.segmentUpdate(x.seg),p.other.remove(),p.remove()),i.getHead()!==p){r&&r.rewind(p.seg);continue}t?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=g?g.seg.myFill.above:a,p.seg.myFill.above=y?!p.seg.myFill.below:p.seg.myFill.below):null===p.seg.otherFill&&(m=g?p.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:p.primary?o:a,p.seg.otherFill={above:m,below:m}),r&&r.status(p.seg,!!d&&d.seg,!!g&&g.seg),p.other.status=h.insert(n.node({ev:p}))}else{var b=p.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(),!p.primary){var _=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=_}f.push(p.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=c?(T=1,y=c+2*p+d):y=p*(T=-p/c)+d):(T=0,h>=0?(A=0,y=d):-h>=f?(A=1,y=f+2*h+d):y=h*(A=-h/f)+d);else if(A<0)A=0,p>=0?(T=0,y=d):-p>=c?(T=1,y=c+2*p+d):y=p*(T=-p/c)+d;else{var M=1/k;y=(T*=M)*(c*T+u*(A*=M)+2*p)+A*(u*T+f*A+2*h)+d}else T<0?(b=f+h)>(x=u+p)?(_=b-x)>=(w=c-2*u+f)?(T=1,A=0,y=c+2*p+d):y=(T=_/w)*(c*T+u*(A=1-T)+2*p)+A*(u*T+f*A+2*h)+d:(T=0,b<=0?(A=1,y=f+2*h+d):h>=0?(A=0,y=d):y=h*(A=-h/f)+d):A<0?(b=c+p)>(x=u+h)?(_=b-x)>=(w=c-2*u+f)?(A=1,T=0,y=f+2*h+d):y=(T=1-(A=_/w))*(c*T+u*A+2*p)+A*(u*T+f*A+2*h)+d:(A=0,b<=0?(T=1,y=c+2*p+d):p>=0?(T=0,y=d):y=p*(T=-p/c)+d):(_=f+h-u-p)<=0?(T=0,A=1,y=f+2*h+d):_>=(w=c-2*u+f)?(T=1,A=0,y=c+2*p+d):y=(T=_/w)*(c*T+u*(A=1-T)+2*p)+A*(u*T+f*A+2*h)+d;var E=1-T-A;for(l=0;l1)for(var r=1;r0){var c=t[r-1];if(0===n(s,c)&&i(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":113,"compare-cell":129,"compare-oriented-cell":130}],491:[function(t,e,r){"use strict";var n=t("array-bounds"),a=t("color-normalize"),i=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){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,c,h,d,g,v,m=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)}),h=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=t.buffer({usage:"static",type:"float",data:p}),k(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:h,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:v,stride:24,offset:0},lineOffset:{buffer:v,stride:24,offset:8},capOffset:{buffer:v,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:p.length}),s(b,{update:k,draw:_,destroy:T,regl:t,gl:m,canvas:m.canvas,groups:x}),b;function b(t){t?k(t):null===t&&T(),_()}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 k(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)),i(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 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}},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?t.shaders.rect(e):"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"}),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=i({},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 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=u(["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 sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\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) * pixelRatio;\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"]),d&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}y.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},y.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},y.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=l(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var p={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(p):e.elements=s.elements(p)}return a({data:g.float(t),usage:"dynamic"}),i({data:g.fract(t),usage:"dynamic"}),c({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=[],o=0,l=Math.min(e.length,r.count);o=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},y.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 h(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=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];if(r.length){for(var a=0;aT))&&(s.lower||!(k>>=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)||Y(t.data))}function c(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={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.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)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,a=-1,o=0,p=0;Array.isArray(t)||Y(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=$[t.usage]),"primitive"in t&&(n=rt[t.primitive]),"count"in t&&(a=0|t.count),"type"in t&&(p=u[t.type]),"length"in t?o=0|t.length:(o=a,5123===p||5122===p?o*=2:5125!==p&&5124!==p||(o*=4))),i(f,e,r,n,a,o,p)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new a(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 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,h(r,n[a]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(i.getTotalTextureSize=function(){var t=0;return Object.keys(mt).forEach((function(e){t+=mt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=a.texInfo;O.call(r);var i=C();return"number"==typeof t?M(i,0|t,"number"==typeof e?0|e:0|t):t?(P(r,t),E(i,t)):M(i,1,1),r.genMipmaps&&(i.mipmask=(i.width<<1)-1),a.mipmask=i.mipmask,c(a,i),a.internalformat=i.internalformat,n.width=i.width,n.height=i.height,z(a),S(i,3553),I(r,3553),R(),L(i),o.profile&&(a.stats.size=k(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 D(3553);return mt[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 c(o,a),o.width=0,o.height=0,h(o,t),o.width=o.width||(a.width>>i)-e,o.height=o.height||(a.height>>i)-r,z(a),d(o,3553,e,r,i),R(),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,z(a);for(var l,c=a.channels,u=a.type,f=0;a.mipmask>>f;++f){var p=i>>f,h=s>>f;if(!p||!h)break;l=G.zero.allocType(u,p*h*c),t.texImage2D(3553,f,a.format,p,h,0,a.format,a.type,l),l&&G.zero.freeType(l)}return R(),o.profile&&(a.stats.size=k(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=p.texInfo;for(O.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(P(l,t),u(p,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(g[s],p),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(c(p,g[0]),p.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,p.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,z(p),s=0;6>s;++s)S(g[s],34069+s);for(I(l,34067),R(),o.profile&&(p.stats.size=k(p.internalformat,p.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[p.internalformat],f.type=et[p.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)L(g[s]);return f}var p=new D(34067);mt[p.id]=p,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 c(i,p),i.width=0,i.height=0,h(i,e),i.width=i.width||(p.width>>a)-r,i.height=i.height||(p.height>>a)-n,z(p),d(i,34069+t,r,n,a),R(),T(i),f},f.resize=function(e){if((e|=0)!==p.width){f.width=p.width=e,f.height=p.height=e,z(p);for(var r=0;6>r;++r)for(var n=0;p.mipmask>>n;++n)t.texImage2D(34069+r,n,p.format,e>>n,e>>n,0,p.format,p.type,null);return R(),o.profile&&(p.stats.size=k(p.internalformat,p.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=p,o.profile&&(f.stats=p.stats),f.destroy=function(){p.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);I(e.texInfo,e.target)}))}}}function A(t,e,r,n,a,i){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function c(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function u(t){var e=3553,r=null,n=null,a=t;return"object"==typeof t&&(a=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=a._reglType)?r=a:"textureCube"===t?r=a:"renderbuffer"===t&&(n=a,e=36161),new o(e,r,n)}function f(t,e,r,i,s){return r?((t=n.create2D({width:t,height:e,format:i,type:s}))._texture.refCount=0,new o(3553,t,null)):((t=a.create({width:t,height:e,format:i}))._renderbuffer.refCount=0,new o(36161,null,t))}function p(t){return t&&(t.texture||t.renderbuffer)}function h(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r),t.width=e,t.height=r)}function d(){this.id=k++,T[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function g(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function v(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,i.framebufferCount--,delete T[e.id]}function m(e){var n;t.bindFramebuffer(36160,e.framebuffer);var a=e.colorAttachments;for(n=0;na;++a){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(T).forEach(v)},restore:function(){x.cur=null,x.next=null,x.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){function a(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function i(t,e){for(var r=0;rt&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return p.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={},p.forEach((function(e){t.deleteProgram(e.program)})),p.length=0,f={},r.shaderCount=0},program:function(t,e,n){var a=f[e];a||(a=f[e]={});var i=a[t];return i||(i=new s(e,t),r.shaderCount++,l(i),a[t]=i,p.push(i)),i},restore:function(){c={},u={};for(var t=0;t"+e+"?"+a+".constant["+e+"]:0;"})).join(""),"}}else{","if(",o,"(",a,".buffer)){",u,"=",s,".createStream(",34962,",",a,".buffer);","}else{",u,"=",s,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",i.glTypes,"[",a,".type]:",u,".dtype;",l.normalized,"=!!",a,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),o}function A(t,e,r,n,a){var o=_(t),s=function(t,e,r){function n(t){if(t in a){var r=a[t];t=!0;var n,o,s=0|r.x,l=0|r.y;return"width"in r?n=0|r.width:t=!1,"height"in r?o=0|r.height:t=!1,new D(!t&&e&&e.thisDep,!t&&e&&e.contextDep,!t&&e&&e.propDep,(function(t,e){var a=t.shared.context,i=n;"width"in r||(i=e.def(a,".","framebufferWidth","-",s));var c=o;return"height"in r||(c=e.def(a,".","framebufferHeight","-",l)),[s,l,i,c]}))}if(t in i){var c=i[t];return t=F(c,(function(t,e){var r=t.invoke(e,c),n=t.shared.context,a=e.def(r,".x|0"),i=e.def(r,".y|0");return[a,i,e.def('"width" in ',r,"?",r,".width|0:","(",n,".","framebufferWidth","-",a,")"),r=e.def('"height" in ',r,"?",r,".height|0:","(",n,".","framebufferHeight","-",i,")")]})),e&&(t.thisDep=t.thisDep||e.thisDep,t.contextDep=t.contextDep||e.contextDep,t.propDep=t.propDep||e.propDep),t}return e?new D(e.thisDep,e.contextDep,e.propDep,(function(t,e){var r=t.shared.context;return[0,0,e.def(r,".","framebufferWidth"),e.def(r,".","framebufferHeight")]})):null}var a=t.static,i=t.dynamic;if(t=n("viewport")){var o=t;t=new D(t.thisDep,t.contextDep,t.propDep,(function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,".viewportWidth",r[2]),e.set(n,".viewportHeight",r[3]),r}))}return{viewport:t,scissor_box:n("scissor.box")}}(t,o),l=k(t),c=function(t,e){var r=t.static,n=t.dynamic,a={};return nt.forEach((function(t){function e(e,i){if(t in r){var s=e(r[t]);a[o]=R((function(){return s}))}else if(t in n){var l=n[t];a[o]=F(l,(function(t,e){return i(t,e,t.invoke(e,l))}))}}var o=m(t);switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return e((function(t){return t}),(function(t,e,r){return r}));case"depth.func":return e((function(t){return kt[t]}),(function(t,e,r){return e.def(t.constants.compareFuncs,"[",r,"]")}));case"depth.range":return e((function(t){return t}),(function(t,e,r){return[e.def("+",r,"[0]"),e=e.def("+",r,"[1]")]}));case"blend.func":return e((function(t){return[wt["srcRGB"in t?t.srcRGB:t.src],wt["dstRGB"in t?t.dstRGB:t.dst],wt["srcAlpha"in t?t.srcAlpha:t.src],wt["dstAlpha"in t?t.dstAlpha:t.dst]]}),(function(t,e,r){function n(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}t=t.constants.blendFuncs;var a=n("src","RGB"),i=n("dst","RGB"),o=(a=e.def(t,"[",a,"]"),e.def(t,"[",n("src","Alpha"),"]"));return[a,i=e.def(t,"[",i,"]"),o,t=e.def(t,"[",n("dst","Alpha"),"]")]}));case"blend.equation":return e((function(t){return"string"==typeof t?[J[t],J[t]]:"object"==typeof t?[J[t.rgb],J[t.alpha]]:void 0}),(function(t,e,r){var n=t.constants.blendEquations,a=e.def(),i=e.def();return(t=t.cond("typeof ",r,'==="string"')).then(a,"=",i,"=",n,"[",r,"];"),t.else(a,"=",n,"[",r,".rgb];",i,"=",n,"[",r,".alpha];"),e(t),[a,i]}));case"blend.color":return e((function(t){return i(4,(function(e){return+t[e]}))}),(function(t,e,r){return i(4,(function(t){return e.def("+",r,"[",t,"]")}))}));case"stencil.mask":return e((function(t){return 0|t}),(function(t,e,r){return e.def(r,"|0")}));case"stencil.func":return e((function(t){return[kt[t.cmp||"keep"],t.ref||0,"mask"in t?t.mask:-1]}),(function(t,e,r){return[t=e.def('"cmp" in ',r,"?",t.constants.compareFuncs,"[",r,".cmp]",":",7680),e.def(r,".ref|0"),e=e.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return e((function(e){return["stencil.opBack"===t?1029:1028,Tt[e.fail||"keep"],Tt[e.zfail||"keep"],Tt[e.zpass||"keep"]]}),(function(e,r,n){function a(t){return r.def('"',t,'" in ',n,"?",i,"[",n,".",t,"]:",7680)}var i=e.constants.stencilOps;return["stencil.opBack"===t?1029:1028,a("fail"),a("zfail"),a("zpass")]}));case"polygonOffset.offset":return e((function(t){return[0|t.factor,0|t.units]}),(function(t,e,r){return[e.def(r,".factor|0"),e=e.def(r,".units|0")]}));case"cull.face":return e((function(t){var e=0;return"front"===t?e=1028:"back"===t&&(e=1029),e}),(function(t,e,r){return e.def(r,'==="front"?',1028,":",1029)}));case"lineWidth":return e((function(t){return t}),(function(t,e,r){return r}));case"frontFace":return e((function(t){return At[t]}),(function(t,e,r){return e.def(r+'==="cw"?2304:2305')}));case"colorMask":return e((function(t){return t.map((function(t){return!!t}))}),(function(t,e,r){return i(4,(function(t){return"!!"+r+"["+t+"]"}))}));case"sample.coverage":return e((function(t){return["value"in t?t.value:1,!!t.invert]}),(function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e=e.def("!!",r,".invert")]}))}})),a}(t),u=w(t),f=s.viewport;return f&&(c.viewport=f),(s=s[f=m("scissor.box")])&&(c[f]=s),(o={framebuffer:o,draw:l,shader:u,state:c,dirty:s=0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,g,v,s],");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[d,v,m,g+"<<(("+m+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[d,g,v]+");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,p=n.draw,h=function(){var a=p.elements,i=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(t,i)):a=i.def(f,".","elements"),a&&i("if("+a+")"+u+".bindBuffer(34963,"+a+".buffer.buffer);"),a}(),d=a("primitive"),g=a("offset"),v=function(){var a=p.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("}");$&&(s=a("instances"),l=t.instancing);var m=h+".type",y=p.elements&&z(p.elements);$&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),i(),r("}else if(",s,"<0){"),o(),r("}")):i():o()}function H(t,e,r,n,a){return a=(e=b()).proc("body",a),$&&(e.instancing=a.def(e.shared.extensions,".angle_instanced_arrays")),t(e,a,r,n),e.compile().body}function q(t,e,r,n){L(t,e),N(t,e,r,n.attributes,(function(){return!0})),j(t,e,r,n.uniforms,(function(){return!0})),V(t,e,e,r)}function G(t,e,r,n){function a(){return!0}t.batchId="a1",L(t,e),N(t,e,r,n.attributes,a),j(t,e,r,n.uniforms,a),V(t,e,e,r)}function W(t,e,r,n){function a(t){return t.contextDep&&o||t.propDep}function i(t){return!a(t)}L(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&&E(t,u,r.framebuffer),C(t,u,r.state,a),r.profile&&a(r.profile)&&B(t,u,r,!1,!0),n?(N(t,c,r,n.attributes,i),N(t,u,r,n.attributes,a),j(t,c,r,n.uniforms,i),j(t,u,r,n.uniforms,a),V(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 H(G,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function Y(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),I(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){a.set(i.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,a))})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,a),i=t.scopeAttrib(e);Object.keys(new Z).forEach((function(t){a.set(i,"."+t,n[t])}))})),n("vert"),n("frag"),0=--this.refCount&&o(this)},a.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,i=0,u=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&&(u=s[e.format])):"number"==typeof e?(n=0|e,i="number"==typeof r?0|r:n):e||(n=i=1),n!==c.width||i!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=i,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,i),a.profile&&(c.stats.size=vt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new i(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,i=0|r||n;return n===c.width&&i===c.height?o:(o.width=c.width=n,o.height=c.height=i,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,i),a.profile&&(c.stats.size=vt[c.format]*c.width*c.height),o)},o._reglType="renderbuffer",o._renderbuffer=c,a.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)}}},yt=[];yt[6408]=4,yt[6407]=3;var xt=[];xt[5121]=1,xt[5126]=4,xt[36193]=2;var bt=["x","y","z","w"],_t="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),wt={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},Tt={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},Mt=new D(!1,!1,!1,(function(){}));return function(t){function e(){if(0===Z.length)w&&w.update(),Q=null;else{Q=H.next(e),f();for(var t=Z.length-1;0<=t;--t){var r=Z[t];r&&r(O,null,0)}v.flush(),w&&w.update()}}function r(){!Q&&0=Z.length&&n()}}}}function u(){var t=Y.viewport,e=Y.scissor_box;t[0]=t[1]=e[0]=e[1]=0,O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=t[2]=e[2]=v.drawingBufferWidth,O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=t[3]=e[3]=v.drawingBufferHeight}function f(){O.tick+=1,O.time=g(),u(),G.procs.poll()}function p(){u(),G.procs.refresh(),w&&w.update()}function g(){return(q()-k)/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)tt(j({framebuffer:t.framebuffer.faces[e]},t),l);else tt(t,l);else l(0,t)},prop:U.define.bind(null,1),context:U.define.bind(null,2),this:U.define.bind(null,3),draw:s({}),buffer:function(t){return I.create(t,34962,!1,!1)},elements:function(t){return D.create(t,!1)},texture:R.create2D,cube:R.createCube,renderbuffer:F.create,framebuffer:V.create,framebufferCube:V.createCube,attributes:m,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=J;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 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;if(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},{}],471:[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 c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);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),p=e.pointsSame(s,c);if(h&&p)return n;var d=!h&&e.pointBetween(o,u,c),v=!p&&e.pointBetween(s,u,c);if(h)return v?l(n,s):l(t,c),n;d&&(p||(v?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=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var p=u(h),d=p.before?p.before.ev:null,v=p.after?p.after.ev:null;function g(){if(d){var t=c(h,d);if(t)return t}return!!v&&c(h,v)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!v&&v.seg);var m,y,x=g();if(x&&(t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(x.seg),h.other.remove(),h.remove()),a.getHead()!==h){r&&r.rewind(h.seg);continue}t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=v?v.seg.myFill.above:i,h.seg.myFill.above=y?!h.seg.myFill.below:h.seg.myFill.below):null===h.seg.otherFill&&(m=v?h.primary===v.primary?v.seg.otherFill.above:v.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:m,below:m}),r&&r.status(h.seg,!!d&&d.seg,!!v&&v.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)&&c(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=u?(A=1,y=u+2*h+d):y=h*(A=-h/u)+d):(A=0,p>=0?(T=0,y=d):-p>=f?(T=1,y=f+2*p+d):y=p*(T=-p/f)+d);else if(T<0)T=0,h>=0?(A=0,y=d):-h>=u?(A=1,y=u+2*h+d):y=h*(A=-h/u)+d;else{var M=1/k;y=(A*=M)*(u*A+c*(T*=M)+2*h)+T*(c*A+f*T+2*p)+d}else A<0?(b=f+p)>(x=c+h)?(_=b-x)>=(w=u-2*c+f)?(A=1,T=0,y=u+2*h+d):y=(A=_/w)*(u*A+c*(T=1-A)+2*h)+T*(c*A+f*T+2*p)+d:(A=0,b<=0?(T=1,y=f+2*p+d):p>=0?(T=0,y=d):y=p*(T=-p/f)+d):T<0?(b=u+h)>(x=c+p)?(_=b-x)>=(w=u-2*c+f)?(T=1,A=0,y=f+2*p+d):y=(A=1-(T=_/w))*(u*A+c*T+2*h)+T*(c*A+f*T+2*p)+d:(T=0,b<=0?(A=1,y=u+2*h+d):h>=0?(A=0,y=d):y=h*(A=-h/u)+d):(_=f+p-c-h)<=0?(A=0,T=1,y=f+2*p+d):_>=(w=u-2*c+f)?(A=1,T=0,y=u+2*h+d):y=(A=_/w)*(u*A+c*(T=1-A)+2*h)+T*(c*A+f*T+2*p)+d;for(var E=1-A-T,l=0;l1)for(var r=1;r0){var u=t[r-1];if(0===n(s,u)&&a(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":105,"compare-cell":121,"compare-oriented-cell":122}],485:[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"),u=t("to-float32"),c=u.float32,f=u.fract32;e.exports=function(t,e){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,u,p,d,v,g,m=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)}),u=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:h}),k(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:u,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:v,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:k,draw:_,destroy:A,regl:t,gl:m,canvas:m.canvas,groups:x}),b;function b(t){t?k(t):null===t&&A(),_()}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 k(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,u){var c=x[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||(x[u]=c={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(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 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}var s=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});return{fill:s,rect:i,miter:e}},g.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},g.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()},g.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>g.precisionThreshold||e.scale[1]*e.viewport.height>g.precisionThreshold?t.shaders.rect(e):"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=g.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))}),this},g.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"}),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({},g.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 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=c(["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 sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\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) * pixelRatio;\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"]),d&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}y.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},y.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},y.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=l(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=s.elements(h)}return i({data:v.float(t),usage:"dynamic"}),a({data:v.fract(t),usage:"dynamic"}),u({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=[],o=0,l=Math.min(e.length,r.count);o=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},y.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=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;nA))&&(s.lower||!(k>>=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)||Y(t.data))}function u(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={},u=0,c={uint8:5121,uint16:5123};e.oes_element_index_uint&&(c.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)u(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)||Y(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&&(i=0|t.count),"type"in t&&(h=c[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 u(),f.primType=4,f.vertCount=0,f.type=5121;return s}var u=r.create(null,34963,!0),f=new i(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 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 v(t){for(var e=G.allocType(5123,t.length),r=0;r>>31<<15,a=(n<<1>>>24)-127,n=n>>13&1023;e[r]=-24>a?i:-14>a?i+(n+1024>>-14-a):15>=i,r.height>>=i,p(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(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(mt).forEach(function(e){t+=mt[e].stats.size}),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;O.call(r);var a=C();return"number"==typeof t?M(a,0|t,"number"==typeof e?0|e:0|t):t?(I(r,t),E(a,t)):M(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,u(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,z(i),S(a,3553),P(r,3553),R(),L(a),o.profile&&(i.stats.size=k(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 D(3553);return mt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=m();return u(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,z(i),d(o,3553,e,r,a),R(),A(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,z(i);for(var l,u=i.channels,c=i.type,f=0;i.mipmask>>f;++f){var h=a>>f,p=s>>f;if(!h||!p)break;l=G.zero.allocType(c,h*p*u),t.texImage2D(3553,f,i.format,h,p,0,i.format,i.type,l),l&&G.zero.freeType(l)}return R(),o.profile&&(i.stats.size=k(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(O.call(l),s=0;6>s;++s)v[s]=C();if("number"!=typeof t&&t){if("object"==typeof t)if(e)E(v[0],t),E(v[1],e),E(v[2],r),E(v[3],n),E(v[4],i),E(v[5],a);else if(I(l,t),c(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)u(v[s],h),E(v[s],t[s]);else for(s=0;6>s;++s)E(v[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(v[s],t,t);for(u(h,v[0]),h.mipmask=l.genMipmaps?(v[0].width<<1)-1:v[0].mipmask,h.internalformat=v[0].internalformat,f.width=v[0].width,f.height=v[0].height,z(h),s=0;6>s;++s)S(v[s],34069+s);for(P(l,34067),R(),o.profile&&(h.stats.size=k(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)L(v[s]);return f}var h=new D(34067);mt[h.id]=h,a.cubeCount++;var v=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=m();return u(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,z(h),d(a,34069+t,r,n,i),R(),A(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,z(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=k(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);P(e.texInfo,e.target)})}}}function T(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function u(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function c(t){var e=3553,r=null,n=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?r=i:"textureCube"===t?r=i:"renderbuffer"===t&&(n=i,e=36161),new o(e,r,n)}function f(t,e,r,a,s){return r?((t=n.create2D({width:t,height:e,format:a,type:s}))._texture.refCount=0,new o(3553,t,null)):((t=i.create({width:t,height:e,format:a}))._renderbuffer.refCount=0,new o(36161,null,t))}function h(t){return t&&(t.texture||t.renderbuffer)}function p(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r),t.width=e,t.height=r)}function d(){this.id=k++,A[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function v(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function g(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,a.framebufferCount--,delete A[e.id]}function m(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;ni;++i){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(A).forEach(g)},restore:function(){x.cur=null,x.next=null,x.dirty=!0,X(A).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){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;rt&&(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(t,e,n){var i=f[e];i||(i=f[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a),i[t]=a,h.push(a)),a},restore:function(){u={},c={};for(var t=0;t"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",c,"=",s,".createStream(",34962,",",i,".buffer);","}else{",c,"=",s,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",c,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",c,");","}"),l})}),o}function T(t,e,r,n,i){var o=_(t),s=function(t,e,r){function n(t){if(t in i){var r=i[t];t=!0;var n,o,s=0|r.x,l=0|r.y;return"width"in r?n=0|r.width:t=!1,"height"in r?o=0|r.height:t=!1,new D(!t&&e&&e.thisDep,!t&&e&&e.contextDep,!t&&e&&e.propDep,function(t,e){var i=t.shared.context,a=n;"width"in r||(a=e.def(i,".","framebufferWidth","-",s));var u=o;return"height"in r||(u=e.def(i,".","framebufferHeight","-",l)),[s,l,a,u]})}if(t in a){var u=a[t];return t=F(u,function(t,e){var r=t.invoke(e,u),n=t.shared.context,i=e.def(r,".x|0"),a=e.def(r,".y|0"),o=e.def('"width" in ',r,"?",r,".width|0:","(",n,".","framebufferWidth","-",i,")"),r=e.def('"height" in ',r,"?",r,".height|0:","(",n,".","framebufferHeight","-",a,")");return[i,a,o,r]}),e&&(t.thisDep=t.thisDep||e.thisDep,t.contextDep=t.contextDep||e.contextDep,t.propDep=t.propDep||e.propDep),t}return e?new D(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".","framebufferWidth"),e.def(r,".","framebufferHeight")]}):null}var i=t.static,a=t.dynamic;if(t=n("viewport")){var o=t;t=new D(t.thisDep,t.contextDep,t.propDep,function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,".viewportWidth",r[2]),e.set(n,".viewportHeight",r[3]),r})}return{viewport:t,scissor_box:n("scissor.box")}}(t,o),l=k(t),u=function(t,e){var r=t.static,n=t.dynamic,i={};return nt.forEach(function(t){function e(e,a){if(t in r){var s=e(r[t]);i[o]=R(function(){return s})}else if(t in n){var l=n[t];i[o]=F(l,function(t,e){return a(t,e,t.invoke(e,l))})}}var o=m(t);switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return e(function(t){return t},function(t,e,r){return r});case"depth.func":return e(function(t){return kt[t]},function(t,e,r){return e.def(t.constants.compareFuncs,"[",r,"]")});case"depth.range":return e(function(t){return t},function(t,e,r){return[e.def("+",r,"[0]"),e=e.def("+",r,"[1]")]});case"blend.func":return e(function(t){return[wt["srcRGB"in t?t.srcRGB:t.src],wt["dstRGB"in t?t.dstRGB:t.dst],wt["srcAlpha"in t?t.srcAlpha:t.src],wt["dstAlpha"in t?t.dstAlpha:t.dst]]},function(t,e,r){function n(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}t=t.constants.blendFuncs;var i=n("src","RGB"),a=n("dst","RGB"),o=(i=e.def(t,"[",i,"]"),e.def(t,"[",n("src","Alpha"),"]"));return[i,a=e.def(t,"[",a,"]"),o,t=e.def(t,"[",n("dst","Alpha"),"]")]});case"blend.equation":return e(function(t){return"string"==typeof t?[$[t],$[t]]:"object"==typeof t?[$[t.rgb],$[t.alpha]]:void 0},function(t,e,r){var n=t.constants.blendEquations,i=e.def(),a=e.def();return(t=t.cond("typeof ",r,'==="string"')).then(i,"=",a,"=",n,"[",r,"];"),t.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),e(t),[i,a]});case"blend.color":return e(function(t){return a(4,function(e){return+t[e]})},function(t,e,r){return a(4,function(t){return e.def("+",r,"[",t,"]")})});case"stencil.mask":return e(function(t){return 0|t},function(t,e,r){return e.def(r,"|0")});case"stencil.func":return e(function(t){return[kt[t.cmp||"keep"],t.ref||0,"mask"in t?t.mask:-1]},function(t,e,r){return[t=e.def('"cmp" in ',r,"?",t.constants.compareFuncs,"[",r,".cmp]",":",7680),e.def(r,".ref|0"),e=e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case"stencil.opFront":case"stencil.opBack":return e(function(e){return["stencil.opBack"===t?1029:1028,At[e.fail||"keep"],At[e.zfail||"keep"],At[e.zpass||"keep"]]},function(e,r,n){function i(t){return r.def('"',t,'" in ',n,"?",a,"[",n,".",t,"]:",7680)}var a=e.constants.stencilOps;return["stencil.opBack"===t?1029:1028,i("fail"),i("zfail"),i("zpass")]});case"polygonOffset.offset":return e(function(t){return[0|t.factor,0|t.units]},function(t,e,r){return[e.def(r,".factor|0"),e=e.def(r,".units|0")]});case"cull.face":return e(function(t){var e=0;return"front"===t?e=1028:"back"===t&&(e=1029),e},function(t,e,r){return e.def(r,'==="front"?',1028,":",1029)});case"lineWidth":return e(function(t){return t},function(t,e,r){return r});case"frontFace":return e(function(t){return Tt[t]},function(t,e,r){return e.def(r+'==="cw"?2304:2305')});case"colorMask":return e(function(t){return t.map(function(t){return!!t})},function(t,e,r){return a(4,function(t){return"!!"+r+"["+t+"]"})});case"sample.coverage":return e(function(t){return["value"in t?t.value:1,!!t.invert]},function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e=e.def("!!",r,".invert")]})}}),i}(t),c=w(t),f=s.viewport;return f&&(u.viewport=f),f=m("scissor.box"),(s=s[f])&&(u[f]=s),s=0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,v,g,s],");")}p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(c+".drawElements("+[d,g,m,v+"<<(("+m+"-5121)>>1)"]+");")}function e(){r(c+".drawArrays("+[d,v,g]+");")}p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,u=t.shared,c=u.gl,f=u.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)):i=a.def(f,".","elements"),i&&a("if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),d=i("primitive"),v=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("}");K&&(s=i("instances"),l=t.instancing);var m=p+".type",y=h.elements&&z(h.elements);K&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function H(t,e,r,n,i){return e=b(),i=e.proc("body",i),K&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function q(t,e,r,n){L(t,e),N(t,e,r,n.attributes,function(){return!0}),j(t,e,r,n.uniforms,function(){return!0}),V(t,e,e,r)}function G(t,e,r,n){function i(){return!0}t.batchId="a1",L(t,e),N(t,e,r,n.attributes,i),j(t,e,r,n.uniforms,i),V(t,e,e,r)}function W(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}L(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,i),r.profile&&i(r.profile)&&B(t,c,r,!1,!0),n?(N(t,u,r,n.attributes,a),N(t,c,r,n.attributes,i),j(t,u,r,n.uniforms,a),j(t,c,r,n.uniforms,i),V(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 H(G,t,r,e,2)}),"(",n,");}",u,".call(this,a0[",s,"],",s,");"))}function Y(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),P(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)}),B(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){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new Z).forEach(function(t){i.set(a,"."+t,n[t])})}),n("vert"),n("frag"),0=--this.refCount&&o(this)},i.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,a=0,c=32854;if("object"==typeof e&&e?("shape"in e?(a=e.shape,n=0|a[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&&(c=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==u.width||a!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=a,u.format=c,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,c,n,a),i.profile&&(u.stats.size=gt[u.format]*u.width*u.height),o.format=l[u.format],o}var u=new a(t.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===u.width&&a===u.height?o:(o.width=u.width=n,o.height=u.height=a,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,u.format,n,a),i.profile&&(u.stats.size=gt[u.format]*u.width*u.height),o)},o._reglType="renderbuffer",o._renderbuffer=u,i.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)}}},yt=[];yt[6408]=4,yt[6407]=3;var xt=[];xt[5121]=1,xt[5126]=4,xt[36193]=2;var bt=["x","y","z","w"],_t="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),wt={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},Tt={cw:2304,ccw:2305},Mt=new D(!1,!1,!1,function(){});return function(t){function e(){if(0===Z.length)w&&w.update(),Q=null;else{Q=H.next(e),f();for(var t=Z.length-1;0<=t;--t){var r=Z[t];r&&r(O,null,0)}g.flush(),w&&w.update()}}function r(){!Q&&0=Z.length&&n()}}}}function c(){var t=Y.viewport,e=Y.scissor_box;t[0]=t[1]=e[0]=e[1]=0,O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){O.tick+=1,O.time=v(),c(),G.procs.poll()}function h(){c(),G.procs.refresh(),w&&w.update()}function v(){return(q()-k)/1e3}if(!(t=i(t)))return null;var g=t.gl,m=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)tt(j({framebuffer:t.framebuffer.faces[e]},t),l);else tt(t,l);else l(0,t)},prop:U.define.bind(null,1),context:U.define.bind(null,2),this:U.define.bind(null,3),draw:s({}),buffer:function(t){return P.create(t,34962,!1,!1)},elements:function(t){return D.create(t,!1)},texture:R.create2D,cube:R.createCube,renderbuffer:F.create,framebuffer:V.create,framebufferCube:V.createCube,attributes:m,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=$;break;case"restore":r=J;break;case"destroy":r=K}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)}},{}],502:[function(t,r,n){(function(t){r.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[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 f(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",u(c(t)),")};return robustDeterminant",t].join(""))(a,i,n,o)}var p=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;p.length>1;return["sum(",c(t.slice(0,e)),",",c(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 f(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 o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",c(t.slice(0,e)),",",c(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:p(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],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],p=r[2]-n[2],d=i*c,g=o*l,v=o*s,m=a*c,y=a*l,x=i*s,b=u*(d-g)+f*(v-m)+p*(y-x),_=7771561172376103e-31*((Math.abs(d)+Math.abs(g))*Math.abs(u)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:h(t,e,r,n)}];function g(t){var e=d[t.length];return e||(e=d[t.length]=f(t.length)),e.apply(void 0,t)}!function(){for(;d.length<=s;)d.push(f(d.length));for(var t=[],r=["slow"],n=0;n<=s;++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<=s;++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);return!(s>0&&l>0||s<0&&l<0)&&(0!==i||0!==o||0!==s||0!==l||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),c=r[a],u=n[a],f=Math.min(c,u);if(Math.max(c,u)=n?(a=f,(l+=1)=n?(a=f,(l+=1)0?1:0}},{}],515:[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":96,"reduce-simplicial-complex":490}],516:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(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 u(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<>>u&1&&c.push(a[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=m(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(!(r>=0&&e0){var t=T[0];return v(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=T[t];return c[r]===e?t:(c[r]=-1/0,b(t),_(),c[r]=e,b((M+=1)-1))}function k(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 T=[],A=new Array(i);for(f=0;f>1;f>=0;--f)x(f);for(;;){var E=_();if(E<0||c[E]>r)break;k(E)}var S=[];for(f=0;f=0&&r>=0&&e!==r){var n=A[e],a=A[r];n!==a&&L.push([n,a])}})),a.unique(a.normalize(L)),{positions:S,edges:L}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":508,"simplicial-complex":520}],523:[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),c=n(r,i,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,i),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 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]),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],a=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),a=-1;if(r&&(a=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,a=u.value):(a=u.value,s=u.key))}var f=this.horizontal[e];if(f.length>0){var p=n.ge(f,t[1],l);if(p=f.length)return a;h=f[p]}}if(h.start)if(s){var d=i(s[0],s[1],[t[0],h.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(a=h.index)}else a=h.index;else h.y!==t[1]&&(a=h.index)}}}return a}},{"./lib/order-segments":523,"binary-search-bounds":92,"functional-red-black-tree":232,"robust-orientation":508}],525:[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&&u<0){var f=o(s,u,l,a);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())),a=u}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&&c<0)&&r.push(o(a,c,s,n)),c>=0&&r.push(s.slice()),n=c}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&&c<0)&&r.push(o(a,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{"robust-dot-product":505,"robust-sum":513}],526:[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(r){return function(r,n){var a,i,o,s,l,c,u,f,p,h=1,d=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?p="":(p=f?"+":"-",a=a.toString().replace(t.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+a).length,l=s.width&&u>0?c.repeat(u):"",g+=s.align?p+a+l:"0"===c?p+l+a:l+p+a)}return g}(function(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}(r),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}var a=Object.create(null);void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],527:[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=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("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;s0;){e=c[c.length-1];var h=t[e];if(i[e]=0&&s[e].push(o[g])}i[e]=d}else{if(n[e]===r[e]){var v=[],m=[],y=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(a[x]=!1,v.push(x),m.push(s[x]),y+=s[x].length,o[x]=f.length,x===e){l.length=d;break}}f.push(v);var b=new Array(y);for(d=0;d c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){"),c=0;c<1<<(1<128&&c%128==0){f.length>0&&p.push("}}");var h="vExtra"+f.length;i.push("case ",c>>>7,":",h,"(m&0x7f,",l.join(),");break;"),p=["function ",h,"(m,",l.join(),"){switch(m){"],f.push(p)}p.push("case ",127&c,":");for(var d=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+v[b]+"*c");var M=d[b].length/y*.5,E=.5+m[b]/y*.5;T.push("d"+b+"-"+E+"-"+M+"*("+d[b].join("+")+A+")/("+g[b].join("+")+")")}p.push("a.push([",T.join(),"]);","break;")}i.push("}},"),f.length>0&&p.push("}}");var S=[];for(c=0;c<1<1&&(i=1),i<-1&&(i=-1),a*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,p=t.xAxisRotation,h=void 0===p?0:p,d=t.largeArcFlag,g=void 0===d?0:d,v=t.sweepFlag,m=void 0===v?0:v,y=[];if(0===u||0===f)return[];var x=Math.sin(h*a/360),b=Math.cos(h*a/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 k=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);k>1&&(u*=Math.sqrt(k),f*=Math.sqrt(k));var T=function(t,e,r,n,i,o,l,c,u,f,p,h){var d=Math.pow(i,2),g=Math.pow(o,2),v=Math.pow(p,2),m=Math.pow(h,2),y=d*g-d*m-g*v;y<0&&(y=0),y/=d*m+g*v;var x=(y=Math.sqrt(y)*(l===c?-1:1))*i/o*h,b=y*-o/i*p,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,k=(p-x)/i,T=(h-b)/o,A=(-p-x)/i,M=(-h-b)/o,E=s(1,0,k,T),S=s(k,T,A,M);return 0===c&&S>0&&(S-=a),1===c&&S<0&&(S+=a),[_,w,E,S]}(e,r,l,c,u,f,g,m,x,b,_,w),A=n(T,4),M=A[0],E=A[1],S=A[2],C=A[3],L=Math.abs(C)/(a/4);Math.abs(1-L)<1e-7&&(L=1);var O=Math.max(Math.ceil(L),1);C/=O;for(var P=0;Pe[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":62,assert:69,"is-svg-path":425,"normalize-svg-path":532,"parse-svg-path":461}],532:[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,p=0,h=0,d=0,g=t.length;d4?(o=v[v.length-4],s=v[v.length-3]):(o=p,s=h),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":530}],533:[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"),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");var r,f;e||(e={}),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 p=Math.min(r,f),h=e.stroke||0,d=e.viewbox||e.viewBox||a(t),g=[r/(d[2]-d[0]),f/(d[3]-d[1])],v=Math.min(g[0]||0,g[1]||0)/2;if(u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",h&&("number"!=typeof h&&(h=1),u.strokeStyle=h>0?"white":"black",u.lineWidth=Math.abs(h)),u.translate(.5*r,.5*f),u.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);u.fill(m),h&&u.stroke(m)}else{var y=i(t);o(u,y),u.fill(),h&&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*p})}},{"bitmap-sdf":94,"draw-svg-path":169,"is-svg-path":425,"parse-svg-path":461,"svg-path-bounds":531}],534:[function(t,e,r){(function(r){"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 h=new Float32Array(u),d=0,g=-.5*f;for(p=0;p1&&(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=L(t,360),e=L(e,100),r=L(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),f=!0,p="hsl"),e.hasOwnProperty("a")&&(i=e.a)),i=C(i),{ok:f,format:e.format||p,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=L(t,255),e=L(e,255),r=L(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 M(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=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=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 p(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=[I(i(t).toString(16)),I(i(e).toString(16)),I(i(r).toString(16)),I(z(n))];return 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)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):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*L(this._r,255))+"%",g:i(100*L(this._g,255))+"%",b:i(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%)":"rgba("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[p(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(m,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(v,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(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,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(),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,o,s,l=c.readability(t,e);switch(a=!1,(i=r,o=((i=i||{level:"AA",size:"small"}).level||"AA").toUpperCase(),s=(i.size||"small").toLowerCase(),"AA"!==o&&"AAA"!==o&&(o="AA"),"small"!==s&&"large"!==s&&(s="small"),n={level:o,size:s}).level+n.size){case"AAsmall":case"AAAlarge":a=l>=4.5;break;case"AAlarge":a=l>=3;break;case"AAAsmall":a=l>=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 E=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(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 L(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 P(t){return parseInt(t,16)}function I(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function z(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(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 V(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],536:[function(t,e,r){"use strict";e.exports=a,e.exports.float32=e.exports.float=a,e.exports.fract32=e.exports.fract=function(t){if(t.length){for(var e=a(t),r=0,n=e.length;rf&&(f=l[0]),l[1]p&&(p=l[1])}function a(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(a);break;case"Point":n(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(n)}}if(!e){var i,o,s=r(t),l=new Array(2),c=1/0,u=c,f=-c,p=-c;for(o in t.arcs.forEach((function(t){for(var e=-1,r=t.length;++ef&&(f=l[0]),l[1]p&&(p=l[1])})),t.objects)a(t.objects[o]);e=t.bbox=[c,u,f,p]}return e},a=function(t,e){for(var r,n=t.length,a=n-e;a<--n;)r=t[a],t[a++]=t[n],t[n]=r};function i(t,e){var r=e.id,n=e.bbox,a=null==e.properties?{}:e.properties,i=o(t,e);return null==r&&null==n?{type:"Feature",properties:a,geometry:i}:null==n?{type:"Feature",id:r,properties:a,geometry:i}:{type:"Feature",id:r,bbox:n,properties:a,geometry:i}}function o(t,e){var n=r(t),i=t.arcs;function o(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],o=0,s=r.length;o1)n=function(t,e,r){var n,a=[],i=[];function o(t){var e=t<0?~t:t;(i[e]||(i[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}return function t(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(l)}(e.arcs)}}(e),i.forEach(null==r?function(t){a.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&a.push(t[0].i)}),a}(0,e,r);else for(a=0,n=new Array(i=t.arcs.length);a1)for(var i,o,c=1,u=l(a[0]);cu&&(o=a[0],a[0]=a[c],a[c]=o,u=i);return a}))}}var u=function(t,e){for(var r=0,n=t.length;r>>1;t[a]=2))throw new Error("n must be ≥2");if(t.transform)throw new Error("already quantized");var r,a=n(t),i=a[0],o=(a[2]-i)/(e-1)||1,s=a[1],l=(a[3]-s)/(e-1)||1;function c(t){t[0]=Math.round((t[0]-i)/o),t[1]=Math.round((t[1]-s)/l)}function u(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"Point":c(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(c)}}for(r in t.arcs.forEach((function(t){for(var e,r,n,a=1,c=1,u=t.length,f=t[0],p=f[0]=Math.round((f[0]-i)/o),h=f[1]=Math.round((f[1]-s)/l);aMath.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 p(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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var h=p.prototype;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[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])]},h.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),u=0;for(i=0;i<3;++i)r[i]-=e[i]*a/n,u+=r[i]*r[i],e[i]/=l;var f=Math.sqrt(u);for(i=0;i<3;++i)r[i]/=f;var p=this.computedToward;o(p,e,r),s(p,p);var h=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],g=this.computedAngle[1],v=Math.cos(d),m=Math.sin(d),y=Math.cos(g),x=Math.sin(g),b=this.computedCenter,_=v*y,w=m*y,k=x,T=-v*x,A=-m*x,M=y,E=this.computedEye,S=this.computedMatrix;for(i=0;i<3;++i){var C=_*r[i]+w*p[i]+k*e[i];S[4*i+1]=T*r[i]+A*p[i]+M*e[i],S[4*i+2]=C,S[4*i+3]=0}var L=S[1],O=S[5],P=S[9],I=S[2],D=S[6],z=S[10],R=O*z-P*D,F=P*I-L*z,B=L*D-O*I,N=c(R,F,B);for(R/=N,F/=N,B/=N,S[0]=R,S[4]=F,S[8]=B,i=0;i<3;++i)E[i]=b[i]+S[2+4*i]*h;for(i=0;i<3;++i){u=0;for(var j=0;j<3;++j)u+=S[i+4*j]*E[j];S[12+i]=-u}S[15]=1},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};var d=[0,0,0];h.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var a=this.computedMatrix;d[0]=a[2],d[1]=a[6],d[2]=a[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)a[4*c]=o[c],a[4*c+1]=s[c],a[4*c+2]=l[c];for(i(a,a,n,d),c=0;c<3;++c)o[c]=a[4*c],s[c]=a[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},h.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=c(i,o,s);i/=l,o/=l,s/=l;var u=a[0],f=a[4],p=a[8],h=u*i+f*o+p*s,d=c(u-=i*h,f-=o*h,p-=s*h),g=(u/=d)*e+i*r,v=(f/=d)*e+o*r,m=(p/=d)*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))},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.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 p=Math.abs(s),h=Math.abs(l),d=Math.abs(f),g=Math.max(p,h,d);p===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 v=c(s,l,f);s/=v,l/=v,f/=v}var m,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*f,k=c(x-=s*w,b-=l*w,_-=f*w),T=l*(_/=k)-f*(b/=k),A=f*(x/=k)-s*_,M=s*b-l*x,E=c(T,A,M);if(T/=E,A/=E,M/=E,this.center.jump(t,q,G,W),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,x,b,_),2===i){var S=e[1],C=e[5],L=e[9],O=S*x+C*b+L*_,P=S*T+C*A+L*M;m=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(P,O)}else{var I=e[2],D=e[6],z=e[10],R=I*s+D*l+z*f,F=I*x+D*b+z*_,B=I*T+D*A+z*M;m=Math.asin(u(R)),y=Math.atan2(B,F)}this.angle.jump(t,y,m),this.recalcMatrix(t);var N=e[2],j=e[6],V=e[10],U=this.computedMatrix;a(U,e);var H=U[15],q=U[12]/H,G=U[13]/H,W=U[14]/H,Y=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*Y,G-j*Y,W-V*Y)},h.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},h.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},h.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.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=c(a,i,o);if(!(s<1e-6)){a/=s,i/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],p=e[2]-r[2],h=c(l,f,p);if(!(h<1e-6)){l/=h,f/=h,p/=h;var d=this.computedRight,g=d[0],v=d[1],m=d[2],y=a*g+i*v+o*m,x=c(g-=y*a,v-=y*i,m-=y*o);if(!(x<.01&&(x=c(g=i*p-o*f,v=o*l-a*p,m=a*f-i*l))<1e-6)){g/=x,v/=x,m/=x,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(h));var b=i*m-o*v,_=o*g-a*m,w=a*v-i*g,k=c(b,_,w),T=a*l+i*f+o*p,A=g*l+v*f+m*p,M=(b/=k)*l+(_/=k)*f+(w/=k)*p,E=Math.asin(u(T)),S=Math.atan2(M,A),C=this.angle._state,L=C[C.length-1],O=C[C.length-2];L%=2*Math.PI;var P=Math.abs(L+2*Math.PI-S),I=Math.abs(L-S),D=Math.abs(L-2*Math.PI-S);P0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(f(t),0,t)}function h(t){return new Uint16Array(f(2*t),0,t)}function d(t){return new Uint32Array(f(4*t),0,t)}function g(t){return new Int8Array(f(t),0,t)}function v(t){return new Int16Array(f(2*t),0,t)}function m(t){return new Int32Array(f(4*t),0,t)}function y(t){return new Float32Array(f(4*t),0,t)}function x(t){return new Float64Array(f(8*t),0,t)}function b(t){return o?new Uint8ClampedArray(f(t),0,t):p(t)}function _(t){return new DataView(f(t),0,t)}function w(t){t=a.nextPow2(t);var e=a.log2(t),n=c[e];return n.length>0?n.pop():new r(t)}n.free=function(t){if(r.isBuffer(t))c[a.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,n=0|a.log2(e);l[n].push(t)}},n.freeUint8=n.freeUint16=n.freeUint32=n.freeInt8=n.freeInt16=n.freeInt32=n.freeFloat32=n.freeFloat=n.freeFloat64=n.freeDouble=n.freeUint8Clamped=n.freeDataView=function(t){u(t.buffer)},n.freeArrayBuffer=u,n.freeBuffer=function(t){c[a.log2(t.length)].push(t)},n.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return p(t);case"uint16":return h(t);case"uint32":return d(t);case"int8":return g(t);case"int16":return v(t);case"int32":return m(t);case"float":case"float32":return y(t);case"double":case"float64":return x(t);case"uint8_clamped":return b(t);case"buffer":return w(t);case"data":case"dataview":return _(t);default:return null}return null},n.mallocArrayBuffer=f,n.mallocUint8=p,n.mallocUint16=h,n.mallocUint32=d,n.mallocInt8=g,n.mallocInt16=v,n.mallocInt32=m,n.mallocFloat32=n.mallocFloat=y,n.mallocFloat64=n.mallocDouble=x,n.mallocUint8Clamped=b,n.mallocDataView=_,n.mallocBuffer=w,n.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,l[t].length=0,c[t].length=0}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":93,buffer:106,dup:171}],544:[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)),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",w(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(k=0;k-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,l-s),n=n.replace("?px ",F())),A+=.25*C*(l-s)}if(!0===o.superscripts){var c=t.indexOf(d),f=r.indexOf(d),h=c>-1?parseInt(t[1+c]):0,g=f>-1?parseInt(r[1+f]):0;h!==g&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,g-h),n=n.replace("?px ",F())),A-=.25*C*(g-h)}if(!0===o.bolds){var v=t.indexOf(u)>-1,y=r.indexOf(u)>-1;!v&&y&&(n=x?n.replace("italic ","italic bold "):"bold "+n),v&&!y&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(p)>-1,b=r.indexOf(p)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w",i="",o=a.length,s=i.length,l=e[0]===d||e[0]===m,c=0,u=-s;c>-1&&-1!==(c=r.indexOf(a,c))&&-1!==(u=r.indexOf(i,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 p=n[f].indexOf(e[0]);-1===p?n[f]+=e:l&&(n[f]=n[f].substr(0,p+1)+(1+parseInt(n[f][p+1]))+n[f].substr(p+2))}var h=c+o,g=r.substr(h,u-h).indexOf(a);c=-1!==g?g:u+s}return n}function b(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function _(t,e,r,n){var a=b(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:x((function(e){var n=y(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:x((function(n,a){var i,o=y(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:x((function(n){var a,i,o=y(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))}))}})};g.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 g||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 g),a.set(t,e)),this}:function(t,e){if(i)try{n.set(t,e)}catch(r){a||(a=new g),a.set___(t,e)}else n.set(t,e);return this},Object.create(g.prototype,{get___:{value:x((function(t,e){return a?n.has(t)?n.get(t):a.get___(t,e):n.get(t,e)}))},has___:{value:x((function(t){return n.has(t)||!!a&&a.has___(t)}))},set___:{value:x(e)},delete___:{value:x((function(t){var e=!!n.delete(t);return a&&a.delete___(t)||e}))},permitHostObjects___:{value:x((function(t){if(t!==v)throw new Error("bogus call to permitHostObjects___");i=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=g.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=g)}function v(t){t.permitHostObjects___&&t.permitHostObjects___(v)}function m(t){return!(t.substr(0,l.length)==l&&"___"===t.substr(t.length-3))}function y(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[c];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,c,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function x(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."))}}()},{}],551:[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":552}],552:[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}},{}],553:[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":551}],554:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":234}],555:[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(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].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=p[o-p[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 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 c,u=f[o.year-f[0]],h=u>>13;c=h?o.month>h?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var d=0;d>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=p[a.year-p[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=p[i.year-p[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=f[i.year-f[0]];for(h=0;h<13;h++){var g=d&1<<12-h?30:29;if(l>13;return!v||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":569,"object-assign":455}],558:[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":569,"object-assign":455}],559:[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)?30: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":569,"object-assign":455}],560:[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īs","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":569,"object-assign":455}],561:[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":569,"object-assign":455}],562:[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(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s(20+(t-=this.jdEpoch),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":569,"object-assign":455}],563:[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":569,"object-assign":455}],564:[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),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":569,"object-assign":455}],566:[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);return t=this._t2gYear(e.year()),i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return t=this._t2gYear(a.year()),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);return t=this._t2gYear(a.year()),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":569,"object-assign":455}],567:[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);return t=this._t2gYear(e.year()),i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return t=this._t2gYear(a.year()),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);return t=this._t2gYear(a.year()),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":569,"object-assign":455}],568:[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āthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","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":569,"object-assign":455}],569:[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":455}],570:[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,f=r.monthNamesShort||this.local.monthNamesShort,p=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=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)},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,i){for(var o=y(t,i)?n:r,s=0;s-1){h=1,d=g;for(var S=this.daysInMonth(p,h);d>S;S=this.daysInMonth(p,h))h++,d-=S}return f>-1?this.fromJD(f):this.newDate(p,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":569,"object-assign":455}],571:[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":147}],572:[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":571}],573:[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}]},{}],574:[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;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"}}})},{"../../plot_api/plot_template":754,"../../plots/cartesian/constants":770,"../../plots/font_attributes":790,"./arrow_paths":573}],575:[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);e._extremes={},r&&s(e,r),n&&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"],f=t["_"+i+"padminus"],p={x:1,y:-1}[i]*t[i+"shift"],h=3*t.arrowsize*t.arrowwidth||0,d=h+p,g=h-p,v=3*t.startarrowsize*t.arrowwidth||0,m=v+p,y=v-p;if(c===l){var x=a.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:g}),b=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,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":716,"../../plots/cartesian/axes":764,"./draw":580}],576:[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,f=[],p=[],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),f={},p=t._fullLayout.annotations;if(c.length||u.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var q=!1,G=["x","y"],W=0;W1)&&(tt===Q?((ct=et.r2fraction(e["a"+$]))<0||ct>1)&&(q=!0):q=!0),Y=et._offset+et.r2p(e[$]),J=.5}else"x"===$?(Z=e[$],Y=b.l+b.w*Z):(Z=1-e[$],Y=b.t+b.h*Z),J=e.showarrow?.5:Z;if(e.showarrow){lt.head=Y;var ut=e["a"+$];K=nt*V(.5,e.xanchor)-at*V(.5,e.yanchor),tt===Q?(lt.tail=et._offset+et.r2p(ut),X=K):(lt.tail=Y+ut,X=K+ut),lt.text=lt.tail+K;var ft=x["x"===$?"width":"height"];if("paper"===Q&&(lt.head=o.constrain(lt.head,1,ft-1)),"pixel"===tt){var pt=-Math.max(lt.tail-3,lt.text),ht=Math.min(lt.tail+3,lt.text)-ft;pt>0?(lt.tail+=pt,lt.text+=pt):ht>0&&(lt.tail-=ht,lt.text-=ht)}lt.tail+=st,lt.head+=st}else X=K=it*V(J,ot),lt.text=Y+K;lt.text+=st,K+=st,X+=st,e["_"+$+"padplus"]=it/2+X,e["_"+$+"padminus"]=it/2-X,e["_"+$+"size"]=it,e["_"+$+"shift"]=K}if(q)I.remove();else{var dt=0,gt=0;if("left"!==e.align&&(dt=(w-m)*("center"===e.align?.5:1)),"top"!==e.valign&&(gt=(P-y)*("middle"===e.valign?.5:1)),u)n.select("svg").attr({x:R+dt-1,y:R+gt}).call(c.setClipUrl,B?M:null,t);else{var vt=R+gt-d.top,mt=R+dt-d.left;U.call(f.positionText,mt,vt).call(c.setClipUrl,B?M:null,t)}N.select("rect").call(c.setRect,R,R,w,P),F.call(c.setRect,D/2,D/2,z-D,j-D),I.call(c.setTranslate,Math.round(E.x.text-z/2),Math.round(E.y.text-j/2)),L.attr({transform:"rotate("+S+","+E.x.text+","+E.y.text+")"});var yt,xt=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=E.x.head,f=E.y.head,p=E.x.tail+r,d=E.y.tail+n,m=E.x.text+r,y=E.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),M=o.apply2DTransform2(x),O=+F.attr("width"),P=+F.attr("height"),D=m-.5*O,z=D+O,R=y-.5*P,B=R+P,N=[[D,R,D,B],[D,B,z,B],[z,B,z,R],[z,R,D,R]].map(M);if(!N.reduce((function(t,e){return t^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){N.forEach((function(t){var e=o.segmentsIntersect(p,d,u,f,t[0],t[1],t[2],t[3]);e&&(p=e.x,d=e.y)}));var j=e.arrowwidth,V=e.arrowcolor,U=e.arrowside,H=C.append("g").style({opacity:l.opacity(V)}).classed("annotation-arrow-g",!0),q=H.append("path").attr("d","M"+p+","+d+"L"+u+","+f).style("stroke-width",j+"px").call(l.stroke,l.rgb(V));if(g(q,U,e),_.annotationPosition&&q.node().parentNode&&!i){var G=u,W=f;if(e.standoff){var Y=Math.sqrt(Math.pow(u-p,2)+Math.pow(f-d,2));G+=e.standoff*(p-u)/Y,W+=e.standoff*(d-f)/Y}var X,Z,J=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(p-G)+","+(d-W),transform:"translate("+G+","+W+")"}).style("stroke-width",j+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");h.init({element:J.node(),gd:t,prepFn:function(){var t=c.getTranslate(I);X=t.x,Z=t.y,s&&s.autorange&&k(s._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(t,r){var n=w(X,Z),a=n[0]+t,i=n[1]+r;I.call(c.setTranslate,a,i),T("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/b.w),T("y",v?v.p2r(v.r2p(e.y)+r):e.y-r/b.h),e.axref===e.xref&&T("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&T("ay",v.p2r(v.r2p(e.ay)+r)),H.attr("transform","translate("+t+","+r+")"),L.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&xt(0,0),O&&h.init({element:I.node(),gd:t,prepFn:function(){yt=L.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?T("ax",s.p2r(s.r2p(e.ax)+t)):T("ax",e.ax+t),e.ayref===e.yref?T("ay",v.p2r(v.r2p(e.ay)+r)):T("ay",e.ay+r),xt(t,r);else{if(i)return;var a,o;if(s)a=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/b.w,c=e.x+(e._xshift-e.xshift)/b.w-l/2;a=h.align(c+t/b.w,l,0,1,e.xanchor)}if(v)o=v.p2r(v.r2p(e.y)+r);else{var u=e._ysize/b.h,f=e.y-(e._yshift+e.yshift)/b.h-u/2;o=h.align(f-r/b.h,u,0,1,e.yanchor)}T("x",a),T("y",o),s&&v||(n=h.getCursor(s?.5:a,v?.5:o,e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+r+")"+yt}),p(I,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",H(n))},doneFn:function(){p(I),a.call("_guiRelayout",t,A());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,v=e.indexOf("end")>=0,m=f.backoff*h+r.standoff,y=p.backoff*d+r.startstandoff;if("line"===u.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var x=o.x-s.x,b=o.y-s.y;if(c=(l=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void O();if(m){if(m*m>x*x+b*b)return void O();var _=m*Math.cos(l),w=m*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>x*x+b*b)return void O();var k=y*Math.cos(l),T=y*Math.sin(l);o.x-=k,o.y-=T,t.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var A=u.getTotalLength(),M="";if(A1){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":813,"../annotations/draw":580}],587:[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)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+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||l).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()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,l))),(a.isDark()?e?a.lighten(e):l:r?a.darken(r):s).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=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 Z=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));W*=Z*c.roundUp(X/Z,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=W}G.domain=[U+N,U+R-N],G.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var J,K=t.select("."+T.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),$=t.select("."+T.cbaxis),Q=0;function tt(n,a){var i={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+T.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),d.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+F)*l.w,n=G.title.font.size;t="top"===A?(1-(U+R-N))*l.h+l.t+3+.75*n:(1-(U+N))*l.h+l.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=t.select("."+T.cbtitle),o=i.select("text"),u=[-e.outlinewidth/2,e.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)*_),f?(Q=p.bBox(f).height)>h&&(u[1]-=(Q-h)/2):o.node()&&!o.classed(T.jsPlaceholder)&&(Q=p.bBox(o.node()).height),Q){if(Q+=5,"top"===A)G.domain[1]-=Q/l.h,u[1]*=-1;else{G.domain[0]+=Q/l.h;var d=g.lineCount(o);u[1]+=(1-d)*h}i.attr("transform","translate("+u+")"),G.setScale()}}t.selectAll("."+T.cbfills+",."+T.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-G.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-l.t)+")");var m=t.select("."+T.cbfills).selectAll("rect."+T.cbfill).data(O);m.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),m.exit().remove();var y=M.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));m.each((function(t,i){var o=[0===i?M[0]:(O[i]+O[i-1])/2,i===O.length-1?M[1]:(O[i]+O[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var s=n.select(this).attr({x:j,width:Math.max(I,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=S(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+T.cblines).selectAll("path."+T.cbline).data(v.color&&v.width?P:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+j+","+(Math.round(G.c2p(t))+v.width/2%1)+"h"+I).call(p.lineGroupStyle,v.width,E(t),v.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var b=j+I+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(G),k=s.makeTransFn(G),C=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,w):w,layer:$,path:s.makeTickPath(G,b,C),transFn:k}),s.drawLabels(r,G,{vals:w,layer:$,transFn:k,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));tt("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=I+e.outlinewidth/2+p.bBox($.node()).width;if((J=K.select("text")).node()&&!J.classed(T.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-j-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=H-q;t.select("."+T.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:q-B,width:Math.max(s,2),height:Math.max(c+2*B,2)}).call(h.fill,e.bgcolor).call(h.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+T.cboutline).attr({x:j,y:q+e.ypad+("top"===A?Q:0),width:Math.max(I,2),height:Math.max(c-2*e.ypad-Q,2)}).call(h.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var u=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-u)+","+l.t+")");var f={},d=w[e.yanchor],g=k[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=c*d,f.b=c*g):(f.t=f.b=0,f.yt=e.y+e.len*d,f.yb=e.y-e.len*g);var v=w[e.xanchor],m=k[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=s*v,f.r=s*m;else{var y=s-I;f.l=y*v,f.r=y*m,f.xl=e.x-e.thickness*v,f.xr=e.x+e.thickness*m}i.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,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+" translate("+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":685,"../../lib":716,"../../lib/extend":707,"../../lib/setcursor":736,"../../lib/svg_text_utils":740,"../../plots/cartesian/axes":764,"../../plots/cartesian/axis_defaults":766,"../../plots/cartesian/layout_attributes":776,"../../plots/cartesian/position_defaults":779,"../../plots/plots":825,"../../registry":845,"../color":591,"../colorscale/helpers":602,"../dragelement":609,"../drawing":612,"../titles":678,"./constants":593,d3:164,tinycolor2:535}],596:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":716}],597:[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":592,"./defaults":594,"./draw":595,"./has_colorbar":596}],598:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("./scales.js").scales;function o(t){return"`"+t+"`"}Object.keys(i),e.exports=function(t,e){t=t||"";var r,s=(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"===s,u="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,f=e.editTypeOverride||"",p=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(p+(r={z:"z",c:"color"}[s]));var h=s+"auto",d=s+"min",g=s+"max",v=s+"mid",m=(o(p+h),o(p+d),o(p+g),{});m[d]=m[g]=void 0;var y={};y[h]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(x.color.anim=!0)),x[h]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[d]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},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":732,"../colorbar/attributes":592,"./scales.js":606}],599:[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,f=i(u),p=!1!==f.auto,h=f.min,d=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===h?h=v():p&&(h=u._colorAx&&n(h)?Math.min(h,v()):v()),void 0===d?d=m():p&&(d=u._colorAx&&n(d)?Math.max(d,m()):m()),p&&void 0!==g&&(d-g>g-h?h=g-(d-g):d-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":716,"./helpers":602,"fast-isnumeric":227}],600:[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}},{}],608:[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":716}],609:[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 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,p,h,d,g,v=t.gd,m=1,y=v._context.doubleClickDelay,x=t.element;v._mouseDownTime||(v._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=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,h),!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)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=u},{"../../lib":716,"../../plots/cartesian/constants":770,"./align":607,"./cursor":608,"./unhover":610,"has-hover":411,"has-passive-events":412,"mouse-event-offset":437}],610:[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&&!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":705,"../../lib/events":706,"../../lib/throttle":741,"../fx/constants":624}],611:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],612:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,h=t("../../constants/interactions").DESELECTDIM,d=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={},m=t("../fx/helpers").appendArrayPointValue;v.font=function(t,e,r,n){c.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(s.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,a){t.call(v.setPosition,e,r).call(v.setSize,n,a)},v.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform","translate("+i+","+o+")"),!0)},v.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);v.translatePoint(t,a,e,r)}))},v.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,s=i.xcalendar,l=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){v.hideOutsideRangePoint(t,n.select(this),r,a,s,l)}))}))}},v.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";s.stroke(e,n||i.color),v.dashLine(e,l,o)},v.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,l=a||i.dash||"";n.select(this).call(s.stroke,r||i.color).call(v.dashLine,l,o)}))},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.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},v.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var y=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(y).forEach((function(t){var e=y[t];v.symbolList=v.symbolList.concat([e.n,t,e.n+100,t+"-open"]),v.symbolNames[e.n]=t,v.symbolFuncs[e.n]=e.f,e.needLine&&(v.symbolNeedLines[e.n]=!0),e.noDot?v.symbolNoDot[e.n]=!0:v.symbolList=v.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(v.symbolNoFill[e.n]=!0)}));var x=v.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function _(t,e){var r=t%100;return v.symbolFuncs[r](e)+(t>=200?b:"")}v.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=x||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};v.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=A[a],p=new Array(u),h=0;h=100,e.attr("d",_(u,l))}var f,p,h,d=!1;if(t.so)h=o.outlierwidth,p=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;h=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,p="mlc"in t?t.mlcc=n.lineScale(t.mlc):c.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=s.defaultLine,d=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,f).style({"stroke-width":(h||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:h)+"px");var m=i.gradient,y=t.mgt;if(y?d=!0:y=m&&m.type,Array.isArray(y)&&(y=y[0],A[y]||(y=0)),y&&"none"!==y){var x=t.mgc;x?d=!0:x=m.color;var b=r.uid;d&&(b+="-"+t.i),v.gradient(e,a,b,y,[[0,x],[1,f]],"fill")}else s.fill(e,f);h&&s.stroke(e,p)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=d.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&c.extendFlat(e,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},s=n.marker||{},l=a.opacity,u=i.opacity,f=s.opacity,p=void 0!==u,d=void 0!==f;(c.isArrayOrTypedArray(l)||p||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?p?u:e:d?f:h*e});var g=a.color,v=i.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=a.size,x=i.size,b=s.size,_=void 0!==x,w=void 0!==b;return o.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},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,c=i.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?c||e:u||(c?e:s.addOpacity(e,h))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.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){s.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",_(v.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}v.textPointStyle=function(t,e,r,a){if(t.size()){var i;if(e.selectedpoints){var o=v.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate;a&&(s=!1),t.each((function(t){var a=n.select(this),o=c.extractOption(t,e,s?"txt":"tx",s?"texttemplate":"text");if(o||0===o){if(s){var l={};m(l,e,t.i),o=c.texttemplateString(o,{},r._fullLayout._d3locale,l,t,e._meta||{})}var f=t.tp||e.textposition,p=S(t,e),h=i?i(t):t.tc||e.textfont.color;a.call(v.font,t.tf||e.textfont.family,p,h).text(o).call(u.convertToTspans,r).call(E,f,p,t.mrc)}else a.remove()}))}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=S(t,e);s.fill(a,i),E(a,o,l,t.mrc2||t.mrc)}))}};var C=.5;function L(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,C/2),u=Math.pow(s*s+l*l,C/2),f=(u*u*i-c*c*s)*a,p=(u*u*o-c*c*l)*a,h=3*u*(c+u),d=3*c*(c+u);return[[n.round(e[0]+(h&&f/h),2),n.round(e[1]+(h&&p/h),2)],[n.round(e[0]-(d&&f/d),2),n.round(e[1]-(d&&p/d),2)]]}v.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&&(v.savedBBoxes={},I=0),r&&(v.savedBBoxes[r]=m),I++,c.extendFlat({},m)},v.setClipUrl=function(t,e,r){t.attr("clip-path",z(e,r))},v.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}},v.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+=" translate("+e+", "+r+")").trim(),t[a]("transform",i),i},v.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}},v.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.*/;v.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*$/;v.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?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),a.attr("transform",t.join(" "))}}))}},{"../../constants/alignment":685,"../../constants/interactions":691,"../../constants/xmlns_namespaces":693,"../../lib":716,"../../lib/svg_text_utils":740,"../../registry":845,"../../traces/scatter/make_bubble_size_func":1133,"../../traces/scatter/subtypes":1140,"../color":591,"../colorscale":603,"../fx/helpers":626,"./symbol_defs":613,d3:164,"fast-isnumeric":227,tinycolor2:535}],613:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,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}}},{d3:164}],614:[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"}}}},{}],615:[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),f=0;f0;e.each((function(e){var f,p=e[0].trace,h=p.error_x||{},d=p.error_y||{};p.ids&&(f=function(t){return t.id});var g=o.hasMarkers(p)&&p.marker.maxdisplayed>0;d.visible||h.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){h.visible||v.selectAll("path.xerror").remove(),d.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(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)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}(t,l,c);if(!g||t.vis){var i,o=e.select("path.yerror");if(d.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=d.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()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0),o.attr("d",i)}else o.remove();var p=e.select("path.xerror");if(h.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(h.copy_ystyle?d:h).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),p.size()?u&&(p=p.transition().duration(s.duration).ease(s.easing)):p=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0),p.attr("d",i)}else p.remove()}}))}}))}},{"../../traces/scatter/subtypes":1140,"../drawing":612,d3:164,"fast-isnumeric":227}],620:[function(t,e,r){"use strict";var n=t("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":591,d3:164}],621:[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":707,"../../plots/font_attributes":790,"./layout_attributes":630}],622:[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||Q<0||Q>w[0]._length)return p.unhoverRaw(t,e)}else $="xpx"in e?e.xpx:_[0]._length/2,Q="ypx"in e?e.ypx:w[0]._length/2;if(e.pointerX=$+_[0]._offset,e.pointerY=Q+w[0]._offset,I="xval"in e?g.flat(l,e.xval):g.p2c(_,$),D="yval"in e?g.flat(l,e.yval):g.p2c(w,Q),!a(I[0])||!a(D[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var et=1/0;for(R=0;RG&&(X.splice(0,G),et=X[0].distance),m&&0!==Y&&0===X.length){q.distance=Y,q.index=!1;var ot=B._module.hoverPoints(q,U,H,"closest",u._hoverlayer);if(ot&&(ot=ot.filter((function(t){return t.spikeDistance<=Y}))),ot&&ot.length){var st,lt=ot.filter((function(t){return t.xa.showspikes}));if(lt.length){var ct=lt[0];a(ct.x0)&&a(ct.y0)&&(st=ht(ct),(!J.vLinePoint||J.vLinePoint.spikeDistance>st.spikeDistance)&&(J.vLinePoint=st))}var ut=ot.filter((function(t){return t.ya.showspikes}));if(ut.length){var ft=ut[0];a(ft.x0)&&a(ft.y0)&&(st=ht(ft),(!J.hLinePoint||J.hLinePoint.spikeDistance>st.spikeDistance)&&(J.hLinePoint=st))}}}}function pt(t,e){for(var r,n=null,a=1/0,i=0;i1||X.length>1)||"closest"===P&&K&&X.length>1,Mt=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Et={hovermode:P,rotateLabels:At,bgColor:Mt,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},St=A(X,Et,t);if(function(t,e,r){var n,a,i,o,s,l,c,u=0,f=1,p=t.size(),h=new Array(p),d=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 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--)}}}for(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&&(f=-1),h[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?x:1)/2,pmin:0,pmax:a?r.width:r.height}]})),h.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));!n&&u<=p;){for(u++,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),h.splice(o+1,1),c=0,s=v.length-1;s>=0;s--)c+=v[s].dp;for(i=c/v.length,s=v.length-1;s>=0;s--)v[s].dp-=i;n=!1}else o++}h.forEach(g)}for(o=h.length-1;o>=0;o--){var _=h[o];for(s=_.length-1;s>=0;s--){var w=_[s],k=w.datum;k.offset=w.dp,k.del=w.del}}}(St,At?"xa":"ya",u),M(St,At),e.target&&e.target.tagName){var Ct=d.getComponentMethod("annotations","hasClickToShow")(t,_t);c(n.select(e.target),Ct?"pointer":"")}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,bt)&&(bt&&t.emit("plotly_unhover",{event:e,points:bt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:I,yvals:D}))}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=t.map((function(t){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,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),i=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):i,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:i,outerContainer:o},l=A(a,s,e.gd),c=0,u=0;return l.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 A(t,e,r){var a=r._fullLayout,i=e.hovermode,s=e.rotateLabels,c=e.bgColor,p=e.container,h=e.outerContainer,d=e.commonLabelOpts||{},g=e.fontFamily||v.HOVERFONT,y=e.fontSize||v.HOVERFONTSIZE,x=t[0],b=x.xa,_=x.ya,A="y"===i?"yLabel":"xLabel",M=x[A],E=(String(M)||"").split(" ")[0],S=h.node().getBoundingClientRect(),C=S.top,O=S.width,P=S.height,I=void 0!==M&&x.distance<=e.hoverdistance&&("x"===i||"y"===i);if(I){var D,z,R=!0;for(D=0;Da.width-P?(T=a.width-P,s.attr("d","M"+(P-w)+",0L"+P+","+O+w+"v"+O+(2*k+L.height)+"H-"+P+"V"+O+w+"H"+(P-2*w)+"Z")):s.attr("d","M0,0L"+w+","+O+w+"H"+(k+L.width/2)+"v"+O+(2*k+L.height)+"H-"+(k+L.width/2)+"V"+O+w+"H-"+w+"Z")}else{var I,D,z;"right"===_.side?(I="start",D=1,z="",T=b._offset+b._length):(I="end",D=-1,z="-",T=b._offset),S=_._offset+(x.y0+x.y1)/2,c.attr("text-anchor",I),s.attr("d","M0,0L"+z+w+","+w+"V"+(k+L.height/2)+"h"+z+(2*k+L.width)+"V-"+(k+L.height/2)+"H"+z+w+"V-"+w+"Z");var R,F=L.height/2,B=C-L.top-F,N="clip"+a._uid+"commonlabel"+_._id;if(T"),void 0!==t.yLabel&&(h+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(h+=(h?"z: ":"")+t.zLabel)):I&&t[i+"Label"]===M?h=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(h=t.yLabel):h=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(h+=(h?"
":"")+t.text),void 0!==t.extraText&&(h+=(h?"
":"")+t.extraText),""!==h||t.hovertemplate||(""===p&&e.remove(),h=p);var _=a._d3locale,A=t.hovertemplate||!1,E=t.hovertemplateLabels||t,S=t.eventData[0]||{};A&&(h=(h=o.hovertemplateString(A,E,_,S,t.trace._meta)).replace(T,(function(e,r){return p=L(r,t.nameLength),""})));var D=e.select("text.nums").call(u.font,t.fontFamily||g,t.fontSize||y,t.fontColor||b).text(h).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),z=e.select("text.name"),R=0,F=0;if(p&&p!==h){z.call(u.font,t.fontFamily||g,t.fontSize||y,x).text(p).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var B=z.node().getBoundingClientRect();R=B.width+2*k,F=B.height+2*k}else z.remove(),e.select("rect").remove();e.select("path").style({fill:v,stroke:b});var N,j,V=D.node().getBoundingClientRect(),U=t.xa._offset+(t.x0+t.x1)/2,H=t.ya._offset+(t.y0+t.y1)/2,q=Math.abs(t.x1-t.x0),G=Math.abs(t.y1-t.y0),W=V.width+w+k+R;if(t.ty0=C-V.top,t.bx=V.width+2*k,t.by=Math.max(V.height+2*k,F),t.anchor="start",t.txwidth=V.width,t.tx2width=R,t.offset=0,s)t.pos=U,N=H+G/2+W<=P,j=H-G/2-W>=0,"top"!==t.idealAlign&&N||!j?N?(H+=G/2,t.anchor="start"):t.anchor="middle":(H-=G/2,t.anchor="end");else if(t.pos=H,N=U+q/2+W<=O,j=U-q/2-W>=0,"left"!==t.idealAlign&&N||!j)if(N)U+=q/2,t.anchor="start";else{t.anchor="middle";var Y=W/2,X=U+Y-O,Z=U-Y;X>0&&(U-=X),Z<0&&(U+=-Z)}else U-=q/2,t.anchor="end";D.attr("text-anchor",t.anchor),R&&z.attr("text-anchor",t.anchor),e.attr("transform","translate("+U+","+H+")"+(s?"rotate("+m+")":""))})),N}function M(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),i=t.anchor,o="end"===i?-1:1,s={start:1,end:-1,middle:0}[i],c=s*(w+k),f=c+s*(t.txwidth+k),p=0,h=t.offset;"middle"===i&&(c-=t.tx2width/2,f+=t.txwidth/2+k),e&&(h*=-_,p=t.offset*b),r.select("path").attr("d","middle"===i?"M-"+(t.bx/2+t.tx2width/2)+","+(h-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*w+p)+","+(w+h)+"v"+(t.by/2-w)+"h"+o*t.bx+"v-"+t.by+"H"+(o*w+p)+"V"+(h-w)+"Z");var d=c+p,g=h+t.ty0-t.by/2+k,v=t.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),d="middle"===i?-t.bx/2-t.tx2width/2+k:-t.bx-k):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),d="middle"===i?t.bx/2-t.tx2width/2-k:t.bx+k)),a.call(l.positionText,d,g),t.tx2width&&(r.select("text.name").call(l.positionText,f+s*k+p,h+t.ty0-t.by/2+k),r.select("rect").call(u.setRect,f+(s-1)*t.tx2width/2+p,h-t.by/2-1,t.tx2width,t.by+2))}))}function E(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:h.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:h.hoverLabelText(t.ya,t.yLabelVal),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=h.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+h.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var p=h.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+p+" / -"+h.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+p,"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 S(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,p=!!e.hLinePoint,d=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),d||p){var g=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(p){var v,m,y=e.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 x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,k=a.spikethickness,T=a.spikecolor||_,A=h.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,b=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)),x=l.l+M*l.w,b=l.l+E*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k,stroke:T,"stroke-dasharray":u.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==a.side?k:-k),cy:m,r:k,fill:T}).classed("spikeline",!0)}if(d){var S,C,L=e.vLinePoint;n=L&&L.xa,a=L&&L.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+L.x,C=a._offset+L.y);var O,P,I=i.readability(L.color,g)<1.5?f.contrast(g):L.color,D=n.spikemode,z=n.spikethickness,R=n.spikecolor||I,F=h.getPxPosition(t,n);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(O=F,P=C),-1!==D.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),O=l.t+(1-N)*l.h,P=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:P,"stroke-width":z,stroke:R,"stroke-dasharray":u.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:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.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 C(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function L(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":716,"../../lib/events":706,"../../lib/override_cursor":727,"../../lib/svg_text_utils":740,"../../plots/cartesian/axes":764,"../../registry":845,"../color":591,"../dragelement":609,"../drawing":612,"./constants":624,"./helpers":626,d3:164,"fast-isnumeric":227,tinycolor2:535}],628:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){r("hoverlabel.bgcolor",(a=a||{}).bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font),r("hoverlabel.align",a.align)}},{"../../lib":716}],629:[function(t,e,r){"use strict";var n=t("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":716,"../dragelement":609,"./attributes":621,"./calc":622,"./click":623,"./constants":624,"./defaults":625,"./helpers":626,"./hover":627,"./layout_attributes":630,"./layout_defaults":631,"./layout_global_defaults":632,d3:164}],630:[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","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,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":790,"./constants":624}],631:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}var o,s=i("clickmode");"select"===i("dragmode")&&i("selectdirection"),e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){p||h||d||"independent"===T("pattern")&&(p=!0),v._hasSubplotGrid=p;var x,b,_="top to bottom"===T("roworder"),w=p?.2:.1,k=p?.3:.1;g&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),v._domains={x:u("x",T,w,x,y),y:u("y",T,k,b,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,u,p=t.grid||{},h=e._subplots,d=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(d){var x=p.subplots||[];l=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v,m,y,x=i.newContainer(e,"legend");b("uirevision",e.uirevision),!1!==g&&(b("bgcolor",e.paper_bgcolor),b("bordercolor"),b("borderwidth"),a.coerceFont(b,"font",e.font),"h"===b("orientation")?(v=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(m=1.1,y="bottom"):(m=-.1,y="top")):(v=1.02,m=1,y="auto"),b("traceorder",p),l.isGrouped(e.legend)&&b("tracegroupgap"),b("itemsizing"),b("itemclick"),b("itemdoubleclick"),b("x",v),b("xanchor"),b("y",m),b("yanchor",y),b("valign"),a.noneOrAll(c,x,["x","y"]))}function b(t,e){return a.coerce(c,x,o,t,e)}}},{"../../lib":716,"../../plot_api/plot_template":754,"../../plots/layout_attributes":816,"../../registry":845,"./attributes":639,"./helpers":645}],642:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=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"),p=t("./handle_click"),h=t("./constants"),d=t("../../constants/alignment"),g=d.LINE_SPACING,v=d.FROM_TL,m=d.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=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};i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l)&&(1===n?e._clickTimeout=setTimeout((function(){p(r,t,n)}),t._context.doubleClickDelay):2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&p(r,t,n)))}function w(t,e){var r=t.data()[0][0],n=e._fullLayout,i=n.legend,s=r.trace,l=o.traceIs(s,"pie-like"),u=s.index,p=e._context.edits.legendText&&!l,d=i._maxNameLength,v=l?r.label:s.name;s._meta&&(v=a.templateString(v,s._meta));var m=a.ensureSingle(t,"text","legendtext");function y(r){f.convertToTspans(r,e,(function(){!function(t,e){var r=t.data()[0][0];if(r.trace.showlegend){var n,a,i=t.select("g[class*=math-group]"),o=i.node(),s=e._fullLayout.legend.font.size*g;if(o){var l=c.bBox(o);n=l.height,a=l.width,c.setTranslate(i,0,n/4)}else{var u=t.select(".legendtext"),p=f.lineCount(u),d=u.node();n=s*p,a=d?c.bBox(d).width:0;var v=s*(.3+(1-p)/2);f.positionText(u,h.textGap,v)}r.lineHeight=s,r.height=Math.max(n,16)+3,r.width=a}else t.remove()}(t,e)}))}m.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,n.legend.font).text(p?k(v,d):v),f.positionText(m,h.textGap,0),p?m.call(f.makeEditable,{gd:e,text:v}).call(y).on("edit",(function(t){this.text(k(t,d)).call(y);var n=r.trace._fullInput||{},i={};if(o.hasTransform(n,"groupby")){var s=o.getTransformIndices(n,"groupby"),l=s[s.length-1],c=a.keyedContainer(n,"transforms["+l+"].styles","target","value.name");c.set(r.trace._group,t),i=c.constructUpdate()}else i.name=t;return o.call("_guiRestyle",e,i,u)})):y(m)}function k(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){t.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));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){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function M(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var s=e.legend,f=e.showlegend&&y(t.calcdata,s),p=e.hiddenlabels||[];if(!e.showlegend||!f.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),i.autoMargin(t,"legend");var d=a.ensureSingle(e._infolayer,"g","legend",(function(t){t.attr("pointer-events","all")})),g=a.ensureSingleById(e._topdefs,"clipPath",r,(function(t){t.append("rect")})),k=a.ensureSingle(d,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));k.call(u.stroke,s.bordercolor).call(u.fill,s.bgcolor).style("stroke-width",s.borderwidth+"px");var E=a.ensureSingle(d,"g","scrollbox"),S=a.ensureSingle(d,"rect","scrollbar",(function(t){t.attr(h.scrollBarEnterAttrs).call(u.fill,h.scrollBarColor)})),C=E.selectAll("g.groups").data(f);C.enter().append("g").attr("class","groups"),C.exit().remove();var L=C.selectAll("g.traces").data(a.identity);L.enter().append("g").attr("class","traces"),L.exit().remove(),L.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==p.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t)})).call(x,t).each((function(){n.select(this).call(T,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r){var a=t._fullLayout,i=a.legend,o=a._size,s=b.isVertical(i),l=b.isGrouped(i),u=i.borderwidth,f=2*u,p=h.textGap,d=h.itemGap,g=2*(u+d),v=M(i),m=i.y<0||0===i.y&&"top"===v,y=i.y>1||1===i.y&&"bottom"===v;i._maxHeight=Math.max(m||y?a.height/2:o.h,30);var x=0;if(i._width=0,i._height=0,s)r.each((function(t){var e=t[0].height;c.setTranslate(this,u,d+u+i._height+e/2),i._height+=e,i._width=Math.max(i._width,t[0].width)})),x=p+i._width,i._width+=d+p+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 _=A(i),w=i.x<0||0===i.x&&"right"===_,k=i.x>1||1===i.x&&"left"===_,T=y||m,E=a.width/2;i._maxWidth=Math.max(w?T&&"left"===_?o.l+o.w:E:k?T&&"right"===_?o.r+o.w:E:o.w,2*p);var S=0,C=0;r.each((function(t){var e=t[0].width+p;S=Math.max(S,e),C+=e})),x=null;var L=0;if(l){var O=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;c.setTranslate(this,0,d+u+n/2+e),e+=n,t=Math.max(t,p+r[0].width)})),O=Math.max(O,e);var r=t+d;r+u+P>i._maxWidth&&(L=Math.max(L,P),P=0,I+=O+i.tracegroupgap,O=e),c.setTranslate(this,P,I),P+=r})),i._width=Math.max(L,P)+u,i._height=I+O+g}else{var D=r.size(),z=C+f+(D-1)*di._maxWidth&&(L=Math.max(L,N),F=0,B+=R,i._height+=R,R=0),c.setTranslate(this,u+F,d+u+e/2+B),N=F+r+d,F+=n,R=Math.max(R,e)})),z?(i._width=F+f,i._height=R+g):(i._width=Math.max(L,N)+f,i._height+=R+g)}}i._width=Math.ceil(i._width),i._height=Math.ceil(i._height),i._effHeight=Math.min(i._height,i._maxHeight);var j=t._context.edits,V=j.legendText||j.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=V?p:x||p+t[0].width;s||(a+=d/2),c.setRect(e,0,-r/2,a,r)}))}(t,C,L)},function(){if(!function(t){var e=t._fullLayout.legend,r=A(e),n=M(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 u,f,p,y,x=e._size,b=s.borderwidth,w=x.l+x.w*s.x-v[A(s)]*s._width,T=x.t+x.h*(1-s.y)-v[M(s)]*s._effHeight;if(e.margin.autoexpand){var C=w,L=T;w=a.constrain(w,0,e.width-s._width),T=a.constrain(T,0,e.height-s._effHeight),w!==C&&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(c.setTranslate(d,w,T),S.on(".drag",null),d.on("wheel",null),s._height<=s._maxHeight||t._context.staticPlot)k.attr({width:s._width-b,height:s._effHeight-b,x:b/2,y:b/2}),c.setTranslate(E,0,0),g.select("rect").attr({width:s._width-2*b,height:s._effHeight-2*b,x:b,y:b}),c.setClipUrl(E,r,t),c.setRect(S,0,0,0,0),delete s._scrollY;else{var O,P,I,D=Math.max(h.scrollBarMinHeight,s._effHeight*s._effHeight/s._height),z=s._effHeight-D-2*h.scrollBarMargin,R=s._height-s._effHeight,F=z/R,B=Math.min(s._scrollY||0,R);k.attr({width:s._width-2*b+h.scrollBarWidth+h.scrollBarMargin,height:s._effHeight-b,x:b/2,y:b/2}),g.select("rect").attr({width:s._width-2*b+h.scrollBarWidth+h.scrollBarMargin,height:s._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(E,r,t),V(B,D,F),d.on("wheel",(function(){V(B=a.constrain(s._scrollY+n.event.deltaY/z*R,0,R),D,F),0!==B&&B!==R&&n.event.preventDefault()}));var N=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;O="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,I=B})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(P="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,V(B=function(t,e,r){var n=(r-e)/F+t;return a.constrain(n,0,R)}(I,O,P),D,F))}));S.call(N);var j=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(O=t.changedTouches[0].clientY,I=B)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(P=t.changedTouches[0].clientY,V(B=function(t,e,r){var n=(e-r)/F+t;return a.constrain(n,0,R)}(I,O,P),D,F))}));E.call(j)}t._context.edits.legendPosition&&(d.classed("cursor-move",!0),l.init({element:d.node(),gd:t,prepFn:function(){var t=c.getTranslate(d);p=t.x,y=t.y},moveFn:function(t,e){var r=p+t,n=y+e;c.setTranslate(d,r,n),u=l.align(r,0,x.l,x.l+x.w,s.xanchor),f=l.align(n,0,x.t+x.h,x.t,s.yanchor)},doneFn:function(){void 0!==u&&void 0!==f&&o.call("_guiRelayout",t,{"legend.x":u,"legend.y":f})},clickFn:function(r,n){var a=e._infolayer.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,d,a,r,n)}}))}function V(e,r,n){s._scrollY=t._fullLayout.legend._scrollY=e,c.setTranslate(E,0,-e),c.setRect(S,s._width,h.scrollBarMargin+e*n,h.scrollBarWidth,r),g.select("rect").attr("y",b+e)}}],t)}}},{"../../constants/alignment":685,"../../lib":716,"../../lib/events":706,"../../lib/svg_text_utils":740,"../../plots/plots":825,"../../registry":845,"../color":591,"../dragelement":609,"../drawing":612,"./constants":640,"./get_legend_data":643,"./handle_click":644,"./helpers":645,"./style":647,d3:164}],643:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},s=[],l=!1,c={},u=0,f=0;function p(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;s.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=e.width}return v?n:Math.min(a,r)}function y(t,e,r){var i=t[0].trace,o=i.marker||{},l=o.line||{},c=r?i.type===r&&i.visible:a.traceIs(i,"bar"),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(c?[t]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(t){var e=n.select(this),r=t[0],a=m(r.mlw,o.line,g,h);e.style("stroke-width",a+"px").call(s.fill,r.mc||o.color),a&&s.stroke(e,r.mlc||l.color)}))}function x(t,e,r){var o=t[0],s=o.trace,l=r?s.type===r&&s.visible:a.traceIs(s,r),f=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(f.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),f.exit().remove(),f.size()){var p=(s.marker||{}).line,d=m(u(p.width,o.pts),p,g,h),v=i.minExtend(s,{marker:{line:{width:d}}});v.marker.line.color=p.color;var y=i.minExtend(o,{trace:v});c(f,y,v)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var c={top:1,bottom:-1}[o]*(.5*(s-l+3));a.attr("transform","translate(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 u=a.selectAll("g.legendsymbols").data([t]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var e=t[0].trace,r=[];"waterfall"===e.type&&e.visible&&(r=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 a=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(r);a.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),a.exit().remove(),a.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=m(void 0,a.line,g,h);r.attr("d",t[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(t){y(t,this,"funnel")})).each((function(t){y(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.traceIs(r,"box-violin")&&r.visible?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=m(void 0,r.line,g,h);t.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(t,r.line.color)}else{var c=i.minExtend(r,{marker:{size:v?f:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,e)}}))})).each((function(t){x(t,this,"funnelarea")})).each((function(t){x(t,this,"pie")})).each((function(t){var r,a,s=t[0],c=s.trace,u=c.visible&&c.fill&&"none"!==c.fill,f=l.hasLines(c),h=c.contours,g=!1,v=!1;if(h){var y=h.coloring;"lines"===y?g=!0:f="none"===y||"heatmap"===y||h.showlines,"constraint"===h.type?u="="!==h._operation:"fill"!==y&&"heatmap"!==y||(v=!0)}var x=l.hasMarkers(c)||l.hasText(c),b=u||v,_=f||g,w=x||!b?"M5,0":_?"M5,-2":"M5,-3",k=n.select(this),T=k.select(".legendfill").selectAll("path").data(u||v?[t]:[]);if(T.enter().append("path").classed("js-fill",!0),T.exit().remove(),T.attr("d",w+"h30v6h-30z").call(u?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+c.uid;o.gradient(t,e,r,"horizontalreversed",c.colorscale,"fill")}}),f||g){var A=m(void 0,c.line,d,p);a=i.minExtend(c,{line:{width:A}}),r=[i.minExtend(s,{trace:a})]}var M=k.select(".legendlines").selectAll("path").data(f||g?[r]:[]);M.enter().append("path").classed("js-line",!0),M.exit().remove(),M.attr("d",w+(g?"l30,0.0001":"h30")).call(f?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+c.uid;o.lineGroupStyle(t),o.gradient(t,e,r,"horizontalreversed",c.colorscale,"stroke")}})})).each((function(t){var r,a,s=t[0],c=s.trace,u=l.hasMarkers(c),d=l.hasText(c),g=l.hasLines(c);function m(t,e,r,n){var a=i.nestedProperty(c,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 y(t){return t[0]}if(u||d||g){var x={},b={};if(u){x.mc=m("marker.color",y),x.mx=m("marker.symbol",y),x.mo=m("marker.opacity",i.mean,[.2,1]),x.mlc=m("marker.line.color",y),x.mlw=m("marker.line.width",i.mean,[0,5],h),b.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var _=m("marker.size",i.mean,[2,16],f);x.ms=_,b.marker.size=_}g&&(b.line={width:m("line.width",y,[0,10],p)}),d&&(x.tx="Aa",x.tp=m("textposition",y),x.ts=10,x.tc=m("textfont.color",y),x.tf=m("textfont.family",y)),r=[i.minExtend(s,x)],(a=i.minExtend(c,b)).selectedpoints=null}var w=n.select(this).select("g.legendpoints"),k=w.selectAll("path.scatterpts").data(u?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),k.exit().remove(),k.call(o.pointStyle,a,e),u&&(r[0].mrc=3);var T=w.selectAll("g.pointtext").data(d?r:[]);T.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),T.exit().remove(),T.selectAll("text").call(o.textPointStyle,a,e,!0)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[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","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=m(void 0,i.line,g,h);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[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","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],l=m(void 0,i.line,g,h);a.style("fill","none").call(o.dashLine,i.line.dash,l),l&&s.stroke(a,i.line.color)}))}))}},{"../../lib":716,"../../registry":845,"../../traces/pie/helpers":1096,"../../traces/pie/style_one":1102,"../../traces/scatter/subtypes":1140,"../color":591,"../drawing":612,d3:164}],648:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),s=t("../../fonts/ploticon"),l=o._,c=e.exports={};function u(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=i.list(t,null,!0),p=c._cartesianSpikesEnabled;if("zoom"===s){var h,d="in"===l?.5:2,g=(1+d)/2,v=(1-d)/2;for(a=0;a1?(A=["toggleHover"],M=["resetViews"]):p?(T=["zoomInGeo","zoomOutGeo"],A=["hoverClosestGeo"],M=["resetGeo"]):f?(A=["hoverClosest3d"],M=["resetCameraDefault3d","resetCameraLastSave3d"]):m?(A=["toggleHover"],M=["resetViewMapbox"]):g?A=["hoverClosestGl2d"]:h?A=["hoverClosestPie"]:x?(A=["hoverClosestCartesian","hoverCompareCartesian"],M=["resetViewSankey"]):A=["toggleHover"],u&&(A=["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;i0?p+c:c;return{ppad:c,ppadplus:u?d:g,ppadminus:u?g: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,f,p=1/0,h=-1/0,d=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lh&&(h=f)));return h>=p?[p,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;o10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:z?H(r.xanchor)+r.x0:H(r.x0),cy:R?q(r.yanchor)-r.y0:q(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:z?H(r.xanchor)+r.x1:H(r.x1),cy:R?q(r.yanchor)-r.y1:q(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():e,X={element:Y.node(),gd:t,prepFn:function(n){z&&(_=H(r.xanchor)),R&&(w=q(r.yanchor)),"path"===r.type?O=r.path:(m=z?r.x0:H(r.x0),y=R?r.y0:q(r.y0),x=z?r.x1:H(r.x1),b=R?r.y1:q(r.y1)),mb?(k=y,E="y0",T=b,S="y1"):(k=b,E="y1",T=y,S="y0"),Z(n),$(h,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),c="";"paper"===n||o.autorange||(c+=n),"paper"===a||l.autorange||(c+=a),s.setClipUrl(t,c?"clip"+r._fullLayout._uid+c:null,r)}(e,r,t),X.moveFn="move"===P?J:K},doneFn:function(){u(e),Q(h),d(e,t,r),n.call("_guiRelayout",t,N.getUpdateObj())},clickFn:function(){Q(h)}};function Z(t){if(F)P="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=X.element.getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top,i=t.clientX-r.left,o=t.clientY-r.top,s=!B&&n>I&&a>D&&!t.shiftKey?c.getCursor(i/n,1-o/a):"move";u(e,s),P=s.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,s=i;z?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(H(t)+n)},V&&"date"===V.type&&(o=p.encodeDate(o))),R?j("yanchor",r.yanchor=W(w+a)):(s=function(t){return W(q(t)+a)},U&&"date"===U.type&&(s=p.encodeDate(s))),j("path",r.path=v(O,o,s))}else z?j("xanchor",r.xanchor=G(_+n)):(j("x0",r.x0=G(m+n)),j("x1",r.x1=G(x+n))),R?j("yanchor",r.yanchor=W(w+a)):(j("y0",r.y0=W(y+a)),j("y1",r.y1=W(b+a)));e.attr("d",g(t,r)),$(h,r)}function K(n,a){if(B){var i=function(t){return t},o=i,s=i;z?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(H(t)+n)},V&&"date"===V.type&&(o=p.encodeDate(o))),R?j("yanchor",r.yanchor=W(w+a)):(s=function(t){return W(q(t)+a)},U&&"date"===U.type&&(s=p.encodeDate(s))),j("path",r.path=v(O,o,s))}else if(F){if("resize-over-start-point"===P){var l=m+n,c=R?y-a:y+a;j("x0",r.x0=z?l:G(l)),j("y0",r.y0=R?c:W(c))}else if("resize-over-end-point"===P){var u=x+n,f=R?b-a:b+a;j("x1",r.x1=z?u:G(u)),j("y1",r.y1=R?f:W(f))}}else{var d=~P.indexOf("n")?k+a:k,N=~P.indexOf("s")?T+a:T,Y=~P.indexOf("w")?A+n:A,X=~P.indexOf("e")?M+n:M;~P.indexOf("n")&&R&&(d=k-a),~P.indexOf("s")&&R&&(N=T-a),(!R&&N-d>D||R&&d-N>D)&&(j(E,r[E]=R?d:W(d)),j(S,r[S]=R?N:W(N))),X-Y>I&&(j(C,r[C]=z?Y:G(Y)),j(L,r[L]=z?X:G(X)))}e.attr("d",g(t,r)),$(h,r)}function $(t,e){(z||R)&&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=H(z?e.xanchor:a.midRange(r?[e.x0,e.x1]:p.extractPathCoords(e.path,f.paramIsX))),o=q(R?e.yanchor:a.midRange(r?[e.y0,e.y1]:p.extractPathCoords(e.path,f.paramIsY)));if(i=p.roundPositionForSharpStrokeRendering(i,1),o=p.roundPositionForSharpStrokeRendering(o,1),z&&R){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()}c.init(X),Y.node().onmousemove=Z}(t,x,r,e,h)}}function d(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");s.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function g(t,e){var r,n,o,s,l,c,u,h,d=e.type,g=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),m=t._fullLayout._size;if(g?(r=p.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},v?(o=p.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return m.t+m.h*(1-t)},"path"===d)return g&&"date"===g.type&&(n=p.decodeDate(n)),v&&"date"===v.type&&(s=p.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(f.segmentRE,(function(t){var n=0,c=t.charAt(0),u=f.paramIsX[c],p=f.paramIsY[c],h=f.numParams[c],d=t.substr(1).replace(f.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>h&&(t="X"),t}));return n>h&&(d=d.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+d}))}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,c=y+e.x1}else l=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var x=s(e.yanchor);u=x-e.y0,h=x-e.y1}else u=s(e.y0),h=s(e.y1);if("line"===d)return"M"+l+","+u+"L"+c+","+h;if("rect"===d)return"M"+l+","+u+"H"+c+"V"+h+"H"+l+"Z";var b=(l+c)/2,_=(u+h)/2,w=Math.abs(b-l),k=Math.abs(_-u),T="A"+w+","+k,A=b+w+","+_;return"M"+A+T+" 0 1,1 "+b+","+(_-k)+T+" 0 0,1 "+A+"Z"}function v(t,e,r){return t.replace(f.segmentRE,(function(t){var n=0,a=t.charAt(0),i=f.paramIsX[a],o=f.paramIsY[a],s=f.numParams[a];return a+t.substr(1).replace(f.paramRE,(function(t){return n>=s?t:(i[n]?t=e(t):o[n]&&(t=r(t)),n++,t)}))}))}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*u.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function E(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function S(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",u.railTouchRectClass,(function(n){n.call(T,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.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*u.railInset,a=s.ensureSingle(t,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[u.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,g(e))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+u.groupClassName).data(r,v);l.enter().append("g").classed(u.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||f<0){var v={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[x.side];e.attr("transform","translate("+v+")")}}}return D.call(z),P&&(E?D.on(".opacity",null):(T=0,A=!0,D.text(m).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)}))),D.call(u.makeEditable,{gd:t}).on("edit",(function(e){void 0!==y?o.call("_guiRestyle",t,v,e,y):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(z)})).on("input",(function(t){this.text(t||" ").call(u.positionText,b.x,b.y)}))),D.classed("js-placeholder",A),w}}},{"../../constants/alignment":685,"../../constants/interactions":691,"../../lib":716,"../../lib/svg_text_utils":740,"../../plots/plots":825,"../../registry":845,"../color":591,"../drawing":612,d3:164,"fast-isnumeric":227}],679:[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":707,"../../plot_api/edit_types":747,"../../plot_api/plot_template":754,"../../plots/font_attributes":790,"../../plots/pad_attributes":824,"../color/attributes":590}],680:[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:"◄",right:"►",up:"▲",down:"▼"}}},{}],681:[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":716,"../../plots/array_container_defaults":760,"./attributes":679,"./constants":680}],682:[function(t,e,r){"use strict";var n=t("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,f=t("./constants"),p=t("./scrollbox");function h(t){return t._index}function d(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,c(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,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,p={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},h={width:l.headerWidth,height:l.headerHeight};i.call(y,a,u,t).call(M,a,p,h),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.classed("user-select-none",!0).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(d(r,a)?-1:a._index)),m(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(k,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,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),p=u.enter().append("g").classed(c,!0),h=u.exit();"dropdown"===o.type?(p.attr("opacity","0").transition().attr("opacity","1"),h.transition().attr("opacity","0").remove()):h.remove();var d=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:d=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+d+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={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,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}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,o),u.call(_,o)}))})),u.call(_,o),x?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.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,p=a._dims,h=a.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(i)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,h);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,E=d,S=v+m;S+M>c&&(S=c-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:A,height:M}),this._hbarXMin=E+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=m>k,O=s.barWidth+2*s.barPad,P=s.barLength+2*s.barPad,I=d+g,D=v;I+O>l&&(I=l-O);var z=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),L?(this.vbar=z.attr({rx:s.barRadius,ry:s.barRadius,x:I,y:D,width:O,height:P}),this._vbarYMin=D+P/2,this._vbarTranslateMax=k-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=L?f+O+.5:f+.5,N=p-.5,j=T?h+M+.5:h+.5,V=o._topdefs.selectAll("#"+R).data(T||L?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",R).append("rect"),T||L?(this._clipRect=V.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: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||L){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 H=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(H),L&&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(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":716,"../color":591,"../drawing":612,d3:164}],685:[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"}}},{}],686:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}},{}],687:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],688:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],689:[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]}},{}],690:[function(t,e,r){"use strict";e.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},{}],691:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],692:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}},{}],693:[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}},{}],694:[function(t,e,r){"use strict";r.version="1.51.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],697:[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}},{}],698:[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 f(t,e,r,n,a,i,c){a=a||0,i=i||0;var u,f,p,h,d,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(u=0,f=o,p=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":723}],699:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}: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(u(+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:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),m=t.charAt(0);!c||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),k=t.match(w?x:y);if(!k)return u;var T=k[1],A=k[3]||"1",M=Number(k[5]||1),E=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===T.length)return u;var L;T=Number(T);try{var O=v.getComponentMethod("calendars","getCal")(e);if(w){var P="i"===A.charAt(A.length-1);A=parseInt(A,10),L=O.newDate(T,O.toMonthIndex(T,A,P),M)}else L=O.newDate(T,Number(A),M)}catch(t){return u}return L?(L.toJD()-g)*f+E*p+S*h+C*d:u}T=2===T.length?(Number(T)+2e3-b)%100+b:Number(T),A-=1;var I=new Date(Date.UTC(2e3,A,M,E,S));return I.setUTCFullYear(T),I.getUTCMonth()!==A?u:I.getUTCDate()!==M?u:I.getTime()+C*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 k=90*f,T=3*p,A=5*h;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 u;e||(e=0);var i,o,s,c,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/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 u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(i.time.format("%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 E=/%\d?f/g;function S(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(_(n))try{t=v.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=_(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/p),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"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var L=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 c=new Date(t+L);return c.setUTCMonth(c.getUTCMonth()+e)+n-L},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u0&&(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||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,c){if(s(t,e,r,n,a,i,o,c))return 0;var u=r-t,f=n-e,p=o-a,h=c-i,d=u*u+f*f,g=p*p+h*h,v=Math.min(l(u,f,d,a-t,i-e),l(u,f,d,o-t,c-e),l(p,h,g,t-a,e-i),l(p,h,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)),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)),p={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=p,p},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(),f=u;function p(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=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 h=p(c);h;){if((c+=h+r)>f)return;h=p(c)}for(h=p(f);h;){if(c>(f-=h+r))return;h=p(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(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,f=0,p=0,h=s;f0?h=a:p=a,f++}return i}},{"./mod":723}],713:[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,c=i(s),u=1;function f(t,e){var r=t;return r[3]*=e,r}function p(t){if(n(t))return c;var e=i(t);return e.length?e:c}function h(t){return n(t)?t:u}e.exports={formatColor:function(t,e,r){var n,a,s,d,g,v=t.color,m=l(v),y=l(e),x=o.extractOpts(t),b=[];if(n=void 0!==x.colorscale?o.makeColorScaleFuncFromTrace(t):p,a=m?function(t,e){return void 0===t[e]?c:i(n(t[e]))}:p,s=y?function(t,e){return void 0===t[e]?u:h(t[e])}:h,m||y)for(var _=0;_o?s:a(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&a(t)&&t>=0&&t%1==0},l.noop=t("./noop"),l.identity=t("./identity"),l.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))},l.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},l.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o=Math.pow(2,r)?a>10?(l.warn("randstr failed uniqueness"),c):t(e,r,n,(a||0)+1):c},l.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},l.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},l.syncOrAsync=function(t,e,r){var n;function a(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.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},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){return C.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")}))};var L={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return I.apply(L,arguments)};var O={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return I.apply(O,arguments)};var P=/^[:|\|]/;function I(t,e,r){var a=this,i=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,s,c){var u,f,p,h;for(p=3;p=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 D=2e9;l.seedPseudoRandom=function(){D=2e9},l.pseudoRandom=function(){var t=D;return D=(69069*D+1)%4294967296,Math.abs(D-t)<429496729?l.pseudoRandom():D/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(a))return n(a);var i=l.extractOption(t,e,"tx","text");return l.isValidTextValue(i)?n(i):void 0},l.isValidTextValue=function(t){return t||0===t},l.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;n2)return c[e]=2|c[e],p.set(t,null);if(f){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;ee/2?t-Math.round(t/e)*e:t}}},{}],724:[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),o=0;oi||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,f,p,h,d,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(p,m)))if(cu||Math.abs(n(o,p))>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()),{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":692,"./matrix":722}],729:[function(t,r,n){(function(e){"use strict";var n=t("./show_no_webgl_msg"),a=t("regl");r.exports=function(t,r){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||e.devicePixelRatio,extensions:r||[]})}catch(t){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,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":737,regl:500}],730:[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(t.framework&&t.framework.isPolar)t.framework.undo();else 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,u,f=0,p=e.length,h=0,d=p>1?(e[p-1]-e[0])/(p-1):1;for(u=d>=0?r?o:s:r?c:l,t+=1e-9*d*(r?-1:1)*(d>=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=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,a=e[n]-e[0]||1,i=a/(n||1)/1e4,o=[e[0]],s=0;se[s]+i&&(a=Math.min(a,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:a}},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":699,"fast-isnumeric":227}],739:[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":121}],740:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,M){var E=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&E.match(l),L=n.select(t.node().parentNode);if(!L.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",L.selectAll("svg."+O).remove(),L.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":E,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),i={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(u,"\\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)}))}(C[2],i,(function(n,a,i){L.selectAll("svg."+O).remove(),L.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void e();var l=L.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":E,"data-math":"Y"});l.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=s(u,"width"),p=s(u,"height"),h=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=-(r||s(t,"height"))/4;"y"===O[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,d-p/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===O[0]?o.attr({x:t.attr("x"),y:d-p/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:d}):o.attr({x:h,y:+t.attr("y")+d-p/2}),M&&M.call(t,l),e(l)}))}))):P(),t}function P(){L.empty()||(O=t.attr("class")+"-math",L.select("svg."+O).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,s=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:c*o+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var s=1;s 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 L=e.split(m),O=0;O|>|>)/g,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"},d="​",g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,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,k=/(^|[\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,c=0;ca?o.push(u.substr(0,d-a)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var M={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},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)){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,e,r){var n,a,i,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},i="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=S,r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each((function(){var t=n.select(this);function a(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var i=a("x",e),o=a("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:i,y:o})}))},r.makeEditable=function(t,e){var r=e.gd,a=e.delegate,i=n.dispatch("edit","input","cancel"),o=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");function s(){var a,s,c,u,f;a=n.select(r).select(".svg-container"),s=a.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12),void 0===(f=e.text)&&(f=t.attr("data-unformatted")),s.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(f).call(C(t,a,e)).on("blur",(function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,a=n.select(this).attr("class");(e=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(t,o)})).on("focus",(function(){var t=this;r._editing=!0,n.select(document).on("mouseup",(function(){if(n.event.target===t)return!1;document.activeElement===s.node()&&s.node().blur()}))})).on("keyup",(function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",(function(){return!1})).transition().remove(),i.cancel.call(t,this.textContent)):(i.input.call(t,this.textContent),n.select(this).call(C(t,a,e)))})).on("keydown",(function(){13===n.event.which&&this.blur()})).call(l),t.style({opacity:0});var p,h=o.attr("class");(p=h?"."+h.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(p).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,i,"on")}},{"../constants/alignment":685,"../constants/xmlns_namespaces":693,"../lib":716,d3:164}],741:[function(t,e,r){"use strict";var n={};function a(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var i=n[t],o=Date.now();if(!i){for(var s in n)n[s].tsi.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)}},{}],742:[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":227}],743:[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":792,"topojson-client":538}],744:[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"}}},{}],745:[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"}}},{}],746:[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,p=(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&&i.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 i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(p(v,m),h(t),!0)}var x,b,_,w,k,T,A,M,E=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],L=u(m,f).get(),O=[],P=-1,I=C.length;for(x=0;xC.length-(A?0:1))i.warn("index out of range",f,_);else if(void 0!==T)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?O.push(_):A?("add"===T&&(T={}),C.splice(_,0,T),L&&L.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===P&&(P=_);else for(b=0;b=0;x--)C.splice(O[x],1),L&&L.splice(O[x],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(p(v,m),d!==a){var D;if(-1===P)D=E;else{for(I=Math.max(C.length,I),D=[],x=0;x=P);x++)D.push(_);for(x=P;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 z(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]),D(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&D(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 D(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,f,p=o.isPlainObject(n),h=[];for(var d in Array.isArray(r)||(r=[r]),r=I(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 q(t,e,r){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(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=J(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[p.previousPromises];i.layoutReplot?s.push(T.layoutReplot):Object.keys(n).length&&(G(t,i,a)||p.supplyDefaults(t),i.legend&&s.push(T.doLegend),i.layoutstyle&&s.push(T.layoutStyles),i.axrange&&W(s,a.rangesAltered),i.ticks&&s.push(T.doTicksRelayout),i.modebar&&s.push(T.doModeBar),i.camera&&s.push(T.doCamera),i.colorbars&&s.push(T.doColorBars),s.push(C)),s.push(p.rehover,p.redrag),c.add(t,q,[t,a.undoit],q,[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 G(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,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==i){var u=n[d.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function W(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),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(b,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function J(t,e){var r,n,a,i=t.layout,l=t._fullLayout,c=l._guiEditing,p=j(l._preGUI,c),h=Object.keys(e),g=d.list(t),v=o.extendDeepAll({},e),m={};for(H(e),h=Object.keys(e),n=0;n0&&"string"!=typeof I.parts[z];)z--;var R=I.parts[z],F=I.parts[z-1]+"."+R,B=I.parts.slice(0,z).join("."),V=s(t.layout,B).get(),U=s(l,B).get(),q=I.get();if(void 0!==D){T[P]=D,E[P]="reverse"===R?D:N(q);var G=f.getLayoutValObject(l,I.parts);if(G&&G.impliedEdits&&null!==D)for(var W in G.impliedEdits)S(o.relativeAttr(P,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(P))if(D){S("autosize",null);var J="height"===P?"width":"height";S(J,l[J])}else l[P]=t._initialAutoSize[P];else if("autosize"===P)S("width",D?null:l.width),S("height",D?null:l.height);else if(F.match(Y))O(F),s(l,B+"._inputRange").set(null);else if(F.match(X)){O(F),s(l,B+"._inputRange").set(null);var $=s(l,B).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(Z)&&s(l,B+"._inputDomain").set(null);if("type"===R){var Q=V,tt="linear"===U.type&&"log"===D,et="log"===U.type&&"linear"===D;if(tt||et){if(Q&&Q.range)if(U.autorange)tt&&(Q.range=Q.range[1]>Q.range[0]?[1,2]:[2,1]);else{var rt=Q.range[0],nt=Q.range[1];tt?(rt<=0&&nt<=0&&S(B+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),S(B+".range[0]",Math.log(rt)/Math.LN10),S(B+".range[1]",Math.log(nt)/Math.LN10)):(S(B+".range[0]",Math.pow(10,rt)),S(B+".range[1]",Math.pow(10,nt)))}else S(B+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete l[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,U,D,S),u.getComponentMethod("images","convertCoords")(t,U,D,S)}else S(B+".autorange",!0),S(B+".range",null);s(l,B+"._inputRange").set(null)}else if(R.match(M)){var at=s(l,P).get(),it=(D||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,at,it,S),u.getComponentMethod("images","convertCoords")(t,at,it,S)}var ot=w.containerArrayMatch(P);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=G||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(D)?E[P]=null:w.isRemoveVal(D)?E[P]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(_,lt),m[r]||(m[r]={});var ct=m[r][n];ct||(ct=m[r][n]={}),ct[st]=D,delete e[P]}else"reverse"===R?(V.range?V.range.reverse():(S(B+".autorange",!0),V.range=[1,0]),U.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===P&&("lasso"===D||"select"===D)&&"lasso"!==q&&"select"!==q?_.plot=!0:l._has("gl2d")?_.plot=!0:G?A.update(_,G):_.calc=!0,I.set(D))}}for(r in m)w.applyContainerArrayChanges(t,p(i,r),m[r],_,p)||(_.plot=!0);var ut=l._axisConstraintGroups||[];for(C in L)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function at(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 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,p.transition(t,e.frame.data,e.frame.layout,k.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&&f()};e()}var d,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=[],x=null==e,b=Array.isArray(e);if(x||b||!o.isPlainObject(e)){if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&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=(u[g]||d[g]||{}).name,m=e[n].name,y=u[v]||d[v];v&&m&&"number"==typeof m&&y&&Ee.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=p.modifyFrames,u=p.modifyFrames,f=[t,s],h=[t,i];return c&&c.add(t,l,f,u,h),p.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],u=r.deleteTraces,f=t,p=[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(!k(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function k(t){return t===Math.round(t)&&t>=0}function T(){var t,e,r={};for(t in d(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 if("area"===t.type)a=u[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var p=f.basePlotModule;p&&p.attributes&&(a=p.attributes[o])}a||(a=i[o])}return w(a,e,s)},r.getLayoutValObject=function(t,e){return w(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var c;for(r=0;r=a&&(r._input||{})._templateitemname;s&&(o=a);var l,c=e+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][i]=s)}function f(t,e){s?n.nestedProperty(l[c],t).set(e):l[c+"."+t]=e}function p(){var t=l;return u(),t}return u(),{modifyBase:function(t,e){l[t]=e},modifyItem:f,getUpdateObj:p,applyUpdate:function(e,r){e&&f(e,r);var a=p();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":716,"../plots/attributes":761}],755:[function(t,e,r){"use strict";var n=t("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"),f=t("../components/modebar"),p=t("../plots/cartesian/axes"),h=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),g=d.enforce,v=d.clean,m=t("../plots/cartesian/autorange").doAutoRange,y="start",x="middle",b="end";function _(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&i[0]e[0])return!0}return!1}function w(t){var e,a,s,u,d,g,v=t._fullLayout,m=v._size,y=m.p,x=p.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(c.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 b(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-y-n:e._offset+e._length+y+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+y+n:e._offset-y-n:m.l+m.w*(t.position||0)+n%1}for(e=0;ek?u.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else u.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&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&v(i)&&t(i,o)}}({data:h,layout:p},""),u.length)return u.map(m)}},{"../lib":716,"../plots/attributes":761,"../plots/plots":825,"./plot_config":752,"./plot_schema":753,"./plot_template":754}],757:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../lib"),o=t("../snapshot/helpers"),s=t("../snapshot/tosvg"),l=t("../snapshot/svgtoimg"),c={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],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,u,f,p;function h(t){return!(t in e)||i.validate(e[t],c[t])}if(e=e||{},i.isPlainObject(t)?(r=t.data||[],u=t.layout||{},f=t.config||{},p={}):(t=i.getGraphDiv(t),r=i.extendDeep([],t.data),u=i.extendDeep({},t.layout),f=t._context,p=t._fullLayout||{}),!h("width")&&null!==e.width||!h("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!h("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var d={};function g(t,r){return i.coerce(e,d,c,t,r)}var v=g("format"),m=g("width"),y=g("height"),x=g("scale"),b=g("setBackground"),_=g("imageDataOnly"),w=document.createElement("div");w.style.position="absolute",w.style.left="-5000px",document.body.appendChild(w);var k=i.extendFlat({},u);m?k.width=m:null===e.width&&n(p.width)&&(k.width=p.width),y?k.height=y:null===e.height&&n(p.height)&&(k.height=p.height);var T=i.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:b}),A=o.getRedrawFunc(w);function M(){return new Promise((function(t){setTimeout(t,o.getDelay(w._fullLayout))}))}function E(){return new Promise((function(t,e){var r=s(w,v,x),n=w._fullLayout.width,c=w._fullLayout.height;if(a.purge(w),document.body.removeChild(w),"svg"===v)return t(_?r:o.encodeSVG(r));var u=document.createElement("canvas");u.id=i.randstr(),l({format:v,width:n,height:c,scale:x,canvas:u,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.plot(w,r,k,T).then(A).then(M).then(E).then((function(e){t(function(t){return _?t.replace(o.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":716,"../snapshot/helpers":849,"../snapshot/svgtoimg":851,"../snapshot/tosvg":853,"./plot_api":751,"fast-isnumeric":227}],758:[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 f=Object.keys(t),p=0;px.length&&a.push(d("unused",i,m.concat(x.length)));var T,A,M,E,S,C=x.length,L=Array.isArray(k);if(L&&(C=Math.min(C,k.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(d("unused",i,m.concat(A,x[A].length)));var O=x[A].length;for(T=0;T<(L?Math.min(O,k[A].length):O);T++)M=L?k[A][T]:k,E=y[A][T],S=x[A][T],n.validate(E,M)?S!==E&&S!==+E&&a.push(d("dynamic",i,m.concat(A,T),E,S)):a.push(d("value",i,m.concat(A,T),E))}else a.push(d("array",i,m.concat(A),y[A]));else for(A=0;A1&&h.push(d("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((b=A-o(v)-o(m))>M?_/b>E&&(y=v,x=m,E=_/b):_/A>E&&(y={val:v.val,pad:0},x={val:m.val,pad:0},E=_/A));if(p===h){var S=p-1,C=p+1;if(k)if(0===p)i=[0,1];else{var L=(p>0?f:u).reduce((function(t,e){return Math.max(t,o(e))}),0),O=p/(1-Math.min(.5,L/A));i=p>0?[0,O]:[O,0]}else i=T?[Math.max(0,S),Math.max(1,C)]:[S,C]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):T&&(y.val-E*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),E=(x.val-y.val)/(A-o(y)-o(x)),i=[y.val-E*o(y),x.val+E*o(x)];return d&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function c(t,e){var r,n,a,i=e._id,o=t._fullData,s=t._fullLayout,l=[],c=[];function p(t,e){for(r=0;r=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 h(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var i=e._anchorAxis;if(i&&i.rangeslider){var l=i.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),i._input.rangeslider[e._name]=a.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={}),t._m||t.setScale();var a,o,s,l,c,p,d,g,v,m=[],y=[],x=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,k=!1,T=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return k=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),E=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=P;a--)O(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":692,"../../lib":716,"../../registry":845,"fast-isnumeric":227}],764:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../components/titles"),u=t("../../components/color"),f=t("../../components/drawing"),p=t("./layout_attributes"),h=t("./clean_ticks"),d=t("../../constants/numerical"),g=d.ONEAVGYEAR,v=d.ONEAVGMONTH,m=d.ONEDAY,y=d.ONEHOUR,x=d.ONEMIN,b=d.ONESEC,_=d.MINUS_SIGN,w=d.BADNUM,k=t("../../constants/alignment"),T=k.MID_SHIFT,A=k.CAP_SHIFT,M=k.LINE_SPACING,E=k.OPPOSITE_SIDE,S=e.exports={};S.setConvert=t("./set_convert");var C=t("./axis_autotype"),L=t("./axis_ids");S.id2name=L.id2name,S.name2id=L.name2id,S.cleanId=L.cleanId,S.list=L.list,S.listIds=L.listIds,S.getFromId=L.getFromId,S.getFromTrace=L.getFromTrace;var O=t("./autorange");S.getAutoRange=O.getAutoRange,S.findExtremes=O.findExtremes,S.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]||i),i||(i=a),u[c]={valType:"enumerated",values:l.concat(i?[i]:[]),dflt:a},s.coerce(t,e,u,c)},S.coercePosition=function(t,e,r,n,a,i){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(a,i);else{var c=S.getFromId(e,n);l=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(l)},S.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:S.getFromId(e,r).cleanPos)(t)},S.redrawComponents=function(t,e){e=e||S.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},S.saveRangeInitial=function(t,e){for(var r=S.list(t,"",!0),n=!1,a=0;a.3*p||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=S.tickIncrement(t,"M6","reverse")+1.5*m:i.exactMonths>.8?t=S.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var l=S.tickIncrement(t,r);if(l<=n)return l}return t}(x,t,y,c,i)),v=x;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:e.c2r(x,0,i),end:e.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(t){var e=s.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type||"multicategory"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=s.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),S.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),H(t)},S.calcTicks=function(t){S.prepTicks(t);var e=s.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=s.simpleMap(t.range,t.r2l),i=1.0001*a[0]-1e-4*a[1],o=1.0001*a[1]-1e-4*a[0],l=Math.min(i,o),c=Math.max(i,o),u=0;Array.isArray(r)||(r=[]);var f="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var p=0;pl&&h=n:f<=n)&&!(o.length>u||f===c);f=S.tickIncrement(f,t.dtick,i,t.calendar)){c=f;var p=!1;l&&f!==(0|f)&&(p=!0),o.push({minor:p,value:f})}ot(t)&&360===Math.abs(e[1]-e[0])&&o.pop(),t._tmax=(o[o.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(o.length),d=0;d10||"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>=x&&i<=16||e>=y)t._tickround="M";else if(e>=b&&i<=19||e>=x)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);Math.abs(c)>3&&(W(t.exponentformat)&&!Y(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function q(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}}S.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);var i=2*e;i>g?(e/=g,r=n(10),t.dtick="M"+12*U(e,r,z)):i>v?(e/=v,t.dtick="M"+U(e,1,R)):i>m?(t.dtick=U(e,m,B),t.tick0=s.dateTick0(t.calendar,!0)):i>y?t.dtick=U(e,y,R):i>x?t.dtick=U(e,x,F):i>b?t.dtick=U(e,b,F):(r=n(10),t.dtick=U(e,r,z))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+U(e,r,z)}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))):ot(t)?(t.tick0=0,r=1,t.dtick=U(e,r,V)):(t.tick0=0,r=n(10),t.dtick=U(e,r,z));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return 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?j:N,f=t+.01*o,p=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(e)},S.tickFirst=function(t){var e=t.r2l||Number,r=s.simpleMap(t.range,e),i=r[1]"+l,t._prevDateHead=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);if("never"===i&&(i=""),n&&"L"!==u&&(o="L3",u="L"),c||"L"===u)e.text=X(Math.pow(10,l),t,i,n);else if(a(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),p=Math.abs(f),h=t.exponentformat;"power"===h||W(h)&&Y(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+p+"",e.fontSize*=1.25):("e"===h||"E"===h)&&p>2?e.text="1"+h+(f>0?"+":_)+p:(e.text=X(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),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):ot(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=X(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=X(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="π":e.text=o[0]+"π":e.text=["",o[0],"","⁄","",o[1],"","π"].join(""),l&&(e.text=_+e.text)}}}}(t,o,r,c,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=X(e.x,t,a,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 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},S.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return S.hoverLabelText(t,e)+" - "+S.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=S.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+a:a};var G=["f","p","n","μ","m","","k","M","G","T"];function W(t){return"SI"===t||"B"===t}function Y(t){return t>14||t<-15}function X(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=S.getTickFormat(e),f=e.separatethousands;if(n){var p={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};H(p),o=(Number(p._tickround)||0)+4,c=p._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,_);var h,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+h+"":"B"===l&&9===c?t+="B":W(l)&&(t+=G[c/3+5])),i?_+t:t}function Z(t,e){for(var r=[],n={},a=0;a1&&r=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-u: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?u-r.top:0,f),h.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?u-r.left:0,f):(n[l]=e._depth=Math.max(r.height>0?r.right-u:0,f),h.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[h[0]],e.title.text!==p._dfltTitle[d]&&(n[l]+=K(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]+=f),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[h[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][h[1]]))}X&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,tt(e),n),i.autoMargin(t,et(e),a),i.autoMargin(t,rt(e),s)})),r.skipTitle||X&&"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;e.title.hasOwnProperty("standoff")?r=e._depth+e.title.standoff+K(e):(r="multicategory"===e.type?e._depth:10+1.5*o+(e.linewidth?e.linewidth-1:0),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 s,l,u,p,h=S.getPxPosition(t,e);if("x"===i?(l=e._offset+e._length/2,u="top"===e.side?h-r:h+r):(u=e._offset+e._length/2,l="right"===e.side?h+r:h-r,s={rotate:"-90",offset:0}),"multicategory"!==e.type){var d=e._selections[e._id+"tick"];if(p={selection:d,side:e.side},d&&d.node()&&d.node().parentNode){var g=f.getTranslate(d.node().parentNode);p.offsetLeft=g.x,p.offsetTop=g.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:s,attributes:{x:l,y:u,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(W)}},S.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},S.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},S.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},S.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),i="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(i&&(o+=t.ticklen),r&&"outside"===t.ticks){var c=s.deg2rad(r);o=t.ticklen*Math.cos(c)+1,l=t.ticklen*Math.sin(c)}t.showticklabels&&(i||t.showline)&&(o+=.2*t.tickfont.size);var u,f,p,h,d={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(h="bottom"===t.side?1:-1,u=l*h,f=e+o*h,p="bottom"===t.side?1:-.2,d.xFn=function(t){return t.dx+u},d.yFn=function(t){return t.dy+f+t.fontSize*p},d.anchorFn=function(t,e){return a(e)&&0!==e&&180!==e?e*h<0?"end":"start":"middle"},d.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(h="right"===t.side?1:-1,u=o,f=-l*h,p=90===Math.abs(t.tickangle)?.5:0,d.xFn=function(t){return t.dx+e+(u+t.fontSize*p)*h},d.yFn=function(t){return t.dy+f+t.fontSize*T},d.anchorFn=function(e,r){return a(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},d.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),d},S.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],J);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.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&&S.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;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;nl*x)||k)for(r=0;rI&&RO&&(O=R);h/=(O-L)/(2*P),L=c.l2r(L),O=c.l2r(O),c.range=c._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function D(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","translate("+r+", "+n+")").attr("d",a+"Z")}function z(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function R(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"),F(t,e,a,i)}function F(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 B(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function N(t){E&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),E=!1)}function j(t){return"lasso"===t||"select"===t}function V(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,M)/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 U(t,e,r,n){for(var a,i,o,l,c=!1,u={},f={},p=0;p-1&&w(a,t,X,Z,e.id,Et),i.indexOf("event")>-1&&f.click(t,a,e.id);else if(1===r&&ht){var s=E?G:F,c="s"===E||"w"===S?0:1,u=s._name+".range["+c+"]",p=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(s,c),h="left",d="middle";if(s.fixedrange)return;E?(d="n"===E?"top":"bottom","right"===s.side&&(h="right")):"e"===S&&(h="right"),t._context.showAxisRangeEntryBoxes&&n.select(vt).call(l.makeEditable,{gd:t,immediate:!0,background:t._fullLayout.paper_bgcolor,text:String(p),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:h,verticalAlign:d}).on("edit",(function(e){var r=s.d2r(e);void 0!==r&&o.call("_guiRelayout",t,u,r)}))}}function Lt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,e+mt)),a=Math.max(0,Math.min(Q,r+yt)),i=Math.abs(n-mt),o=Math.abs(a-yt);function s(){kt="",xt.r=xt.l,xt.t=xt.b,At.attr("d","M0,0Z")}if(xt.l=Math.min(mt,n),xt.r=Math.max(mt,n),xt.t=Math.min(yt,a),xt.b=Math.max(yt,a),tt.isSubplotConstrained)i>M||o>M?(kt="xy",i/$>o/Q?(o=i*Q/$,yt>a?xt.t=yt-o:xt.b=yt+o):(i=o*$/Q,mt>n?xt.l=mt-i:xt.r=mt+i),At.attr("d",V(xt))):s();else if(et.isSubplotConstrained)if(i>M||o>M){kt="xy";var l=Math.min(xt.l/$,(Q-xt.b)/Q),c=Math.max(xt.r/$,(Q-xt.t)/Q);xt.l=l*$,xt.r=c*$,xt.b=(1-l)*Q,xt.t=(1-c)*Q,At.attr("d",V(xt))}else s();else!nt||og[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":716,"fast-isnumeric":227}],780:[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)]}},{"../../constants/alignment":685}],781:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/color"),o=t("../../components/fx"),s=t("../../lib"),l=t("../../lib/polygon"),c=t("../../lib/throttle"),u=t("../../components/fx/helpers").makeEventData,f=t("./axis_ids").getFromId,p=t("../../lib/clear_gl_canvases"),h=t("../../plot_api/subroutines").redrawReglTraces,d=t("./constants"),g=d.MINSELECT,v=l.filter,m=l.tester;function y(t){return t._id}function x(t,e,r,n,a,i,o){var s,l,c,u,f,p,h,d,g,v=e._hoverdata,m=e._fullLayout.clickmode.indexOf("event")>-1,y=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){k(t,e,i);var x=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)&&(p=E(x))){for(o&&o.remove(),g=0;g0?"M"+a.join("M")+"Z":"M0,0Z",e.attr("d",n)}function E(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,a=n.length>0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function S(t,e,r){var n,i,o,s;for(n=0;n-1&&x(e,E,a.xaxes,a.yaxes,a.subplot,a,G),"event"===r&&E.emit("plotly_selected",void 0);o.click(E,e)})).catch(s.error)},a.doneFn=function(){Y.remove(),c.done(X).then((function(){c.clear(X),a.gd.emit("plotly_selected",_),h&&a.selectionDefs&&(h.subtract=q,a.selectionDefs.push(h),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,p)),a.doneFnCompleted&&a.doneFnCompleted(Z)})).catch(s.error)}},clearSelect:L,selectOnClick:x}},{"../../components/color":591,"../../components/fx":629,"../../components/fx/helpers":626,"../../lib":716,"../../lib/clear_gl_canvases":701,"../../lib/polygon":728,"../../lib/throttle":741,"../../plot_api/subroutines":755,"../../registry":845,"./axis_ids":767,"./constants":770,polybooljs:474}],782:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=i.cleanNumber,s=i.ms2DateTime,l=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=t("../../constants/numerical"),p=f.FP_SAFE,h=f.BADNUM,d=f.LOG_CLIP,g=t("./constants"),v=t("./axis_ids");function m(t){return Math.pow(10,t)}function y(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function x(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*d*Math.abs(n-a))}return h}function b(e,r,n){var o=l(e,n||t.calendar);if(o===h){if(!a(e))return h;e=+e;var s=Math.floor(10*i.mod(e+.05,1)),c=Math.round(e-s/10);o=l(new Date(c))+s/10}return o}function _(e,r,n){return s(e,r,n||t.calendar)}function w(e){return t._categories[Math.round(e)]}function k(e){if(y(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 h}function T(e){if(t._categoriesMap)return t._categoriesMap[e]}function A(t){var e=T(t);return void 0!==e?e:a(t)?+t:void 0}function M(e){return a(e)?n.round(t._b+t._m*e,2):h}function E(e){return(e-t._b)/t._m}t.c2l="log"===t.type?x:c,t.l2c="log"===t.type?m:c,t.l2p=M,t.p2l=E,t.c2p="log"===t.type?function(t,e){return M(x(t,e))}:M,t.p2c="log"===t.type?function(t){return m(E(t))}:E,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=E,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return x(o(t),e)},t.r2d=t.r2c=function(t){return m(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=c,t.c2r=x,t.l2d=m,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return m(E(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=E,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=b,t.c2d=t.c2r=t.l2d=t.l2r=_,t.d2p=t.r2p=function(e,r,n){return t.l2p(b(e,0,n))},t.p2d=t.p2r=function(t,e,r){return _(E(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,h,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=k,t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=A,t.r2c=function(e){var r=A(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=A,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(E(t))},t.r2p=t.d2p,t.p2r=E,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=A,t.r2c=function(e){var r=A(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=T,t.l2r=t.c2r=c,t.r2l=A,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(E(t))},t.r2p=t.d2p,t.p2r=E,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:c(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(a=0;ap&&(s[n]=p),s[0]===s[1]){var c=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=c,s[1]+=c}}else i.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=v.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],o),l=t.r2l(t[i][1],o);if("y"===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/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,a,o,s,l=t.type,c="date"===l&&e[r+"calendar"];if(r in e){if(n=e[r],s=e._length||i.minRowLength(n),i.isTypedArray(n)&&("linear"===l||"log"===l)){if(s===n.length)return n;if(n.subarray)return n.subarray(0,s)}if("multicategory"===l)return function(t,e){for(var r=new Array(e),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,c=a._length,u=l._length,f=!!e.xr1,p=!!e.yr1,h=[];if(f){var d=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=d[1]-d[0],m=g[1]-g[0];h[0]=(d[0]*(1-r)+r*g[0]-d[0])/(d[1]-d[0])*c,h[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(d[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(d[1]*(1-r)+r*g[1])}else h[0]=0,h[2]=c;if(p){var y=i.simpleMap(e.yr0,l.r2l),x=i.simpleMap(e.yr1,l.r2l),b=y[1]-y[0],_=x[1]-x[0];h[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,h[3]=u*(1-r+r*_/b),l.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[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=f?c/h[2]:1,k=p?u/h[3]:1,T=f?h[0]:0,A=p?h[1]:0,M=f?h[0]/h[2]*c:0,E=p?h[1]/h[3]*u:0,S=a._offset-M,C=l._offset-E;n.clipRect.call(o.setTranslate,T,A).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}s.redrawComponents(t)}},{"../../components/drawing":612,"../../lib":716,"../../registry":845,"./axes":764,d3:164}],787:[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("type",(s.splomStash||{}).type)&&(function(t,e){if("-"===t.type){var r=t._id,s=r.charAt(0);-1!==r.indexOf("scene")&&(r=s);var l=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,r,s);if(l)if("histogram"!==l.type||s!=={v:"y",h:"x"}[l.orientation||"v"]){var c,u=s+"calendar",f=l[u],p={noMultiCategory:!n(l,"cartesian")||n(l,"noMultiCategory")};if(o(l,s)){var h=i(l),d=[];for(c=0;c0?".":"")+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"],f=0;fa*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],a=t[1][1]-t[0][1],i=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),i&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),a/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(a-s*(o[1][1]+o[0][1]))/2;return i&&r.clipExtent(i),r.scale(150*s).translate([l,c])},r.precision(g.precision),a&&r.clipAngle(a-g.clipPad),r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var f=[[r.l+r.w*o.x[0],r.t+r.h*(1-o.y[1])],[r.l+r.w*o.x[1],r.t+r.h*(1-o.y[0])]],p=e.lonaxis,h=e.lataxis,d=function(t,e){var r=g.clipPad,n=t[0]+r,a=t[1]-r,i=e[0]+r,o=e[1]-r;n>0&&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]]]}}(p.range,h.range);u.fitExtent(f,d);var v=this.bounds=u.getBounds(d),m=this.fitScale=u.scale(),y=u.translate();if(!isFinite(v[0][0])||!isFinite(v[0][1])||!isFinite(v[1][0])||!isFinite(v[1][1])||isNaN(y[0])||isNaN(y[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},k=0;k-1&&h(n.event,i,[r.xaxis],[r.yaxis],r.id,g),c.indexOf("event")>-1&&l.click(i,n.event))}))}function v(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},x.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(s.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"},u.setConvert(t.mockAxis,r)},x.saveViewInitial=function(t){var e=t.center||{},r=t.projection,n=r.rotation||{};t._isScoped?this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale}:t._isClipped?this.viewInitial={"projection.scale":r.scale,"projection.rotation.lon":n.lon,"projection.rotation.lat":n.lat}:this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale,"projection.rotation.lon":n.lon}},x.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?"translate("+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":591,"../../components/dragelement":609,"../../components/drawing":612,"../../components/fx":629,"../../lib":716,"../../lib/topojson_utils":743,"../../registry":845,"../cartesian/axes":764,"../cartesian/select":781,"../plots":825,"./constants":792,"./projections":797,"./zoom":798,d3:164,"topojson-client":538}],794:[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[o]={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[o],s=0;s0&&w<0&&(w+=360);var k,T,A,M=(_+w)/2;if(!c){var E=u?s.projRotate:[M,0,0];k=r("projection.rotation.lon",E[0]),r("projection.rotation.lat",E[1]),r("projection.rotation.roll",E[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}c?(T=-96.6,A=38.7):(T=u?M:k,A=(b[0]+b[1])/2),r("center.lon",T),r("center.lat",A),f&&r("projection.parallels",s.projParallels||[0,60]),r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==i)&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:i,handleDefaults:s,partition:"y"})}},{"../subplot_defaults":839,"./constants":792,"./layout_attributes":795}],797:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map((function(t){return r(t,n)}))};if(!c.hasOwnProperty(e.type))return null;var a=c[e.type];return t.geo.stream(e,n(a)),a.result()}t.geo.project=function(t,e){var a=e.stream;if(!a)throw new Error("not yet supported");return(t&&n.hasOwnProperty(t.type)?n[t.type]:r)(t,a)};var n={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map((function(t){return e(t,r)}))}}},a=[],i=[],o={point:function(t,e){a.push([t,e])},result:function(){var t=a.length?a.length<2?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a}:null;return a=[],t}},s={lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){a.length&&(i.push(a),a=[])},result:function(){var t=i.length?i.length<2?{type:"LineString",coordinates:i[0]}:{type:"MultiLineString",coordinates:i}:null;return i=[],t}},l={polygonStart:u,lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){var t=a.length;if(t){do{a.push(a[0].slice())}while(++t<4);i.push(a),a=[]}},polygonEnd:u,result:function(){if(!i.length)return null;var t=[],e=[];return i.forEach((function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^h>n&&r<(p-c)*(n-u)/(h-u)+c&&(a=!a)}return a}(t[0],r))return t.push(e),!0}))||t.push([e])})),i=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},c={Point:o,MultiPoint:o,LineString:s,MultiLineString:s,Polygon:l,MultiPolygon:l,Sphere:l};function u(){}var f=1e-6,p=f*f,h=Math.PI,d=h/2,g=(Math.sqrt(h),h/180),v=180/h;function m(t){return t>1?d:t<-1?-d:Math.asin(t)}function y(t){return t>1?0:t<-1?h:Math.acos(t)}var x=t.geo.projection,b=t.geo.projectionMutator;function _(t,e){var r=(2+d)*Math.sin(e);e/=2;for(var n=0,a=1/0;n<10&&Math.abs(a)>f;n++){var i=Math.cos(e);e-=a=(e+Math.sin(e)*(i+2)-r)/(2*i*(1+i))}return[2/Math.sqrt(h*(4+h))*t*(1+Math.cos(e)),2*Math.sqrt(h/(4+h))*Math.sin(e)]}t.geo.interrupt=function(e){var r,n=[[[[-h,0],[0,d],[h,0]]],[[[-h,0],[0,-d],[h,0]]]];function a(t,r){for(var a=r<0?-1:1,i=n[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],a*r>a*i[o][0][1]?i[o][0][1]:r)[0],l}function i(){r=n.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],a=e(t[2][0],t[2][1])[0],i=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return i>o&&(r=i,i=o,o=r),[[n,i],[a,o]]}))}))}e.invert&&(a.invert=function(t,i){for(var o=r[+(i<0)],s=n[+(i<0)],l=0,u=o.length;l=0;--a){var p;o=180*(p=n[1][a])[0][0]/h,s=180*p[0][1]/h,c=180*p[1][1]/h,u=180*p[2][0]/h,f=180*p[2][1]/h,r.push(l([[u-e,f-e],[u-e,c+e],[o+e,c+e],[o+e,s-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}(),i)},a},o.lobes=function(t){return arguments.length?(n=t.map((function(t){return t.map((function(t){return[[t[0][0]*h/180,t[0][1]*h/180],[t[1][0]*h/180,t[1][1]*h/180],[t[2][0]*h/180,t[2][1]*h/180]]}))})),i(),o):n.map((function(t){return t.map((function(t){return[[180*t[0][0]/h,180*t[0][1]/h],[180*t[1][0]/h,180*t[1][1]/h],[180*t[2][0]/h,180*t[2][1]/h]]}))}))},o},_.invert=function(t,e){var r=.5*e*Math.sqrt((4+h)/h),n=m(r),a=Math.cos(n);return[t/(2/Math.sqrt(h*(4+h))*(1+a)),m((n+r*(a+2))/(2+d))]},(t.geo.eckert4=function(){return x(_)}).raw=_;var w=t.geo.azimuthalEqualArea.raw;function k(t,e){if(arguments.length<2&&(e=t),1===e)return w;if(e===1/0)return T;function r(r,n){var a=w(r/e,n);return a[0]*=t,a}return r.invert=function(r,n){var a=w.invert(r/t,n);return a[0]*=e,a},r}function T(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function A(t,e){return[3*t/(2*h)*Math.sqrt(h*h/3-e*e),e]}function M(t,e){return[t,1.25*Math.log(Math.tan(h/4+.4*e))]}function E(t){return function(e){var r,n=t*Math.sin(e),a=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>f&&--a>0);return e/2}}T.invert=function(t,e){var r=2*m(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=b(k),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=k,A.invert=function(t,e){return[2/3*h*t/Math.sqrt(h*h/3-e*e),e]},(t.geo.kavrayskiy7=function(){return x(A)}).raw=A,M.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*h]},(t.geo.miller=function(){return x(M)}).raw=M,E(h);var S=function(t,e,r){var n=E(r);function a(r,a){return[t*r*Math.cos(a=n(a)),e*Math.sin(a)]}return a.invert=function(n,a){var i=m(a/e);return[n/(t*Math.cos(i)),m((2*i+Math.sin(2*i))/r)]},a}(Math.SQRT2/d,Math.SQRT2,h);function C(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(t.geo.mollweide=function(){return x(S)}).raw=S,C.invert=function(t,e){var r,n=e,a=25;do{var i=n*n,o=i*i;n-=r=(n*(1.007226+i*(.015085+o*(.028874*i-.044475-.005916*o)))-e)/(1.007226+i*(.045255+o*(.259866*i-.311325-.005916*11*o)))}while(Math.abs(r)>f&&--a>0);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return x(C)}).raw=C;var L=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function O(t,e){var r,n=Math.min(18,36*Math.abs(e)/h),a=Math.floor(n),i=n-a,o=(r=L[a])[0],s=r[1],l=(r=L[++a])[0],c=r[1],u=(r=L[Math.min(19,++a)])[0],f=r[1];return[t*(l+i*(u-o)/2+i*i*(u-2*l+o)/2),(e>0?d:-d)*(c+i*(f-s)/2+i*i*(f-2*c+s)/2)]}function P(t,e){return[t*Math.cos(e),e]}function I(t,e){var r,n=Math.cos(e),a=(r=y(n*Math.cos(t/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(t)*a,Math.sin(e)*a]}function D(t,e){var r=I(t,e);return[(r[0]+t/d)/2,(r[1]+e)/2]}L.forEach((function(t){t[1]*=1.0144})),O.invert=function(t,e){var r=e/d,n=90*r,a=Math.min(18,Math.abs(n/5)),i=Math.max(0,Math.floor(a));do{var o=L[i][1],s=L[i+1][1],l=L[Math.min(19,i+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,h=u/c,m=f*(1-h*f*(1-2*h*f));if(m>=0||1===i){n=(e>=0?5:-5)*(m+a);var y,x=50;do{m=(a=Math.min(18,Math.abs(n)/5))-(i=Math.floor(a)),o=L[i][1],s=L[i+1][1],l=L[Math.min(19,i+2)][1],n-=(y=(e>=0?d:-d)*(s+m*(l-o)/2+m*m*(l-2*s+o)/2)-e)*v}while(Math.abs(y)>p&&--x>0);break}}while(--i>=0);var b=L[i][0],_=L[i+1][0],w=L[Math.min(19,i+2)][0];return[t/(_+m*(w-b)/2+m*m*(w-2*_+b)/2),n*g]},(t.geo.robinson=function(){return x(O)}).raw=O,P.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return x(P)}).raw=P,I.invert=function(t,e){if(!(t*t+4*e*e>h*h+f)){var r=t,n=e,a=25;do{var i,o=Math.sin(r),s=Math.sin(r/2),l=Math.cos(r/2),c=Math.sin(n),u=Math.cos(n),p=Math.sin(2*n),d=c*c,g=u*u,v=s*s,m=1-g*l*l,x=m?y(u*l)*Math.sqrt(i=1/m):i=0,b=2*x*u*s-t,_=x*c-e,w=i*(g*v+x*u*l*d),k=i*(.5*o*p-2*x*c*s),T=.25*i*(p*s-x*c*g*o),A=i*(d*l+x*v*u),M=k*T-A*w;if(!M)break;var E=(_*k-b*A)/M,S=(b*T-_*w)/M;r-=E,n-=S}while((Math.abs(E)>f||Math.abs(S)>f)&&--a>0);return[r,n]}},(t.geo.aitoff=function(){return x(I)}).raw=I,D.invert=function(t,e){var r=t,n=e,a=25;do{var i,o=Math.cos(n),s=Math.sin(n),l=Math.sin(2*n),c=s*s,u=o*o,p=Math.sin(r),h=Math.cos(r/2),g=Math.sin(r/2),v=g*g,m=1-u*h*h,x=m?y(o*h)*Math.sqrt(i=1/m):i=0,b=.5*(2*x*o*g+r/d)-t,_=.5*(x*s+n)-e,w=.5*i*(u*v+x*o*h*c)+.5/d,k=i*(p*l/4-x*s*g),T=.125*i*(l*g-x*s*u*p),A=.5*i*(c*h+x*v*o)+.5,M=k*T-A*w,E=(_*k-b*A)/M,S=(b*T-_*w)/M;r-=E,n-=S}while((Math.abs(E)>f||Math.abs(S)>f)&&--a>0);return[r,n]},(t.geo.winkel3=function(){return x(D)}).raw=D}},{}],798:[function(t,e,r){"use strict";var n=t("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 f(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],f={},p={};function h(t,e){f[n+"."+t]=a.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,f);var r=a.nestedProperty(u,t);r.get()!==e&&(r.set(e),a.nestedProperty(l,t).set(e),p[n+"."+t]=e)}r(h),h("projection.scale",e.scale()/t.fitScale),o.emit("plotly_relayout",p)}function p(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),f(t,e,a)})),r}function h(t,e){var r,a,i,o,s,p,h,d,g,v=u(0,e),m=2;function y(t){return e.invert(t)}function x(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 v.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),a=e.rotate(),i=e.translate(),o=a,s=y(r)})).on("zoom",(function(){if(p=n.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>m||Math.abs(n[1]-t[1])>m}(r))return v.scale(e.scale()),void v.translate(e.translate());e.scale(n.event.scale),e.translate([i[0],n.event.translate[1]]),s?y(p)&&(d=y(p),h=[o[0]+(d[0]-s[0]),a[1],a[2]],e.rotate(h),o=h):s=y(r=p),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,x)})),v}function d(t,e){var r,a={r:e.rotate(),k:e.scale()},i=u(0,e),o=function(t){for(var e=0,r=arguments.length,a=[];++ed?(i=(f>0?90:-90)-h,a=0):(i=Math.asin(f/d)*s-h,a=Math.sqrt(d*d-f*f));var g=180-i-2*h,v=(Math.atan2(p,u)-Math.atan2(c,a))*s,m=(Math.atan2(p,u)-Math.atan2(c,-a))*s;return b(r[0],r[1],i,v)<=b(r[0],r[1],g,m)?[i,v,r[2]]:[g,m,r[2]]}function b(t,e,r,n){var a=_(r-t),i=_(n-e);return Math.sqrt(a*a+i*i)}function _(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 k(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 T(t,e){for(var r=0,n=0,a=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(i)*_*(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)/_*(i>=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?(i=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],i||s?(i&&(v(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(v(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]=a),Math.abs(c.dragStart[0]-n).999&&(v="turntable"):v="turntable")}else v="turntable";r("dragmode",v),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var a=e._basePlotModules.length>1;o(t,e,r,{type:u,attributes:l,handleDefaults:f,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":591,"../../../lib":716,"../../../registry":845,"../../get_data":799,"../../subplot_defaults":839,"./axis_defaults":807,"./layout_attributes":810}],810:[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":716,"../../../lib/extend":707,"../../domain":789,"./axis_attributes":806}],811:[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":739}],812:[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[i[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 p=u.nticks||a.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/p)}for(var h=n.calcTicks(u),d=0;d/g," "));l[c]=h,u.tickmode=f}}for(e.ticks=l,c=0;c<3;++c)for(o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]),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],a=new Array(n.length),i=0;i")):"isosurface"===e.type||"volume"===e.type?(w.valueLabel=p.tickText(t.mockAxis,t.mockAxis.d2l(u.traceCoordinate[3]),"hover").text,M.push("value: "+w.valueLabel),u.textLabel&&M.push(u.textLabel),y=M.join("
")):y=u.textLabel;var E={x:u.traceCoordinate[0],y:u.traceCoordinate[1],z:u.traceCoordinate[2],data:b._input,fullData:b,curveNumber:b.index,pointNumber:_};h.appendArrayPointValue(E,b,_),e._module.eventData&&(E=b._module.eventData(E,u,b,{},_));var S={points:[E]};t.fullSceneLayout.hovermode&&h.loneHover({trace:b,x:(.5+.5*m[0]/m[3])*i,y:(.5-.5*m[1]/m[3])*o,xLabel:w.xLabel,yLabel:w.yLabel,zLabel:w.zLabel,text:y,name:c.name,color:h.castHoverOption(b,_,"bgcolor")||c.color,borderColor:h.castHoverOption(b,_,"bordercolor"),fontFamily:h.castHoverOption(b,_,"font.family"),fontSize:h.castHoverOption(b,_,"font.size"),fontColor:h.castHoverOption(b,_,"font.color"),nameLength:h.castHoverOption(b,_,"namelength"),textAlign:h.castHoverOption(b,_,"align"),hovertemplate:f.castOption(b,_,"hovertemplate"),hovertemplateLabels:f.extendFlat({},E,w),eventData:[E]},{container:n,gd:r}),u.buttons&&u.distance<5?r.emit("plotly_click",S):r.emit("plotly_hover",S),s=S}else h.loneUnhover(n),r.emit("plotly_unhover",s);t.drawAnnotations(t)}function _(t,e,r){if(t.initializeGLCamera(),!function(t,e,r,i,o){var c={canvas:i,gl:o,container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:e,pixelRatio:r};if(t.staticMode){if(!(a||(n=document.createElement("canvas"),a=l({canvas:n,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");c.pixelRatio=t.pixelRatio,c.gl=a,c.canvas=n}var u=0;try{t.glplot=s(c)}catch(e){u++;try{t.glplot=s(c)}catch(t){u++}}return u<2}(t,t.camera,t.pixelRatio,e,r))return g(t);var i=t.graphDiv,o=i.layout,u=function(){var e={};return t.isCameraChanged(o)&&(e[t.id+".camera"]=t.getCamera()),t.isAspectChanged(o)&&(e[t.id+".aspectratio"]=t.glplot.getAspectratio()),e},f=function(t){if(!1!==t.fullSceneLayout.dragmode){var e=u();t.saveLayout(o),t.graphDiv.emit("plotly_relayout",e)}};return t.glplot.canvas.addEventListener("mouseup",(function(){f(t)})),t.glplot.canvas.addEventListener("wheel",(function(e){if(i._context._scrollZoom.gl3d){if(t.glplot.camera._ortho){var r=e.deltaX>e.deltaY?1.1:1/1.1,n=t.glplot.getAspectratio();t.glplot.setAspectratio({x:r*n.x,y:r*n.y,z:r*n.z})}f(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=u();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(e){i&&i.emit&&i.emit("plotly_webglcontextlost",{event:e,layer:t.id})}),!1),t.glplot.camera=t.camera,t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=b.bind(null,t),t.traces={},t.make4thDimension(),!0}function w(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.position="absolute",a.style.top=a.style.left="0px",a.style.width=a.style.height="100%",a.style["z-index"]=20,a.style["pointer-events"]="none",r.appendChild(a),this.svgContainer=a,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=m(e,e[this.id]),this.spikeOptions=y(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=this.pixelRatio||t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=u.getComponentMethod("annotations3d","convert"),this.drawAnnotations=u.getComponentMethod("annotations3d","draw"),_(this)}var k=w.prototype;k.initializeGLCamera=function(){var t=this.fullSceneLayout.camera,e="orthographic"===t.projection.type;this.camera=o(this.container,{center:[t.center.x,t.center.y,t.center.z],eye:[t.eye.x,t.eye.y,t.eye.z],up:[t.up.x,t.up.y,t.up.z],_ortho:e,zoomMin:.01,zoomMax:100,mode:"orbit"})},k.recoverContext=function(){var t=this,e=this.glplot.gl,r=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame((function n(){e.isContextLost()?requestAnimationFrame(n):_(t,r,e)?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")}))};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],c=e[o+"calendar"],u=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var p,h=0;h<(u||l.length);h++)if(f.isArrayOrTypedArray(l[h]))for(var d=0;dg[1][i])g[0][i]=-1,g[1][i]=1;else{var S=g[1][i]-g[0][i];g[0][i]-=S/32,g[1][i]+=S/32}if("reversed"===s.autorange){var C=g[0][i];g[0][i]=g[1][i],g[1][i]=C}}else{var L=s.range;g[0][i]=s.r2l(L[0]),g[1][i]=s.r2l(L[1])}g[0][i]===g[1][i]&&(g[0][i]-=1,g[1][i]+=1),v[i]=g[1][i]-g[0][i],this.glplot.bounds[0][i]=g[0][i]*p[i],this.glplot.bounds[1][i]=g[1][i]*p[i]}var O,P=[1,1,1];for(i=0;i<3;++i){var I=m[l=(s=c[T[i]]).type];P[i]=Math.pow(I.acc,1/I.count)/p[i]}if("auto"===c.aspectmode)O=Math.max.apply(null,P)/Math.min.apply(null,P)<=4?P:[1,1,1];else if("cube"===c.aspectmode)O=[1,1,1];else if("data"===c.aspectmode)O=P;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var D=c.aspectratio;O=[D.x,D.y,D.z]}c.aspectratio.x=u.aspectratio.x=O[0],c.aspectratio.y=u.aspectratio.y=O[1],c.aspectratio.z=u.aspectratio.z=O[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z});var z=c.domain||null,R=e._size||null;if(z&&R){var F=this.container.style;F.position="absolute",F.left=R.l+z.x[0]*R.w+"px",F.top=R.t+(1-z.y[1])*R.h+"px",F.width=R.w*(z.x[1]-z.x[0])+"px",F.height=R.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},k.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.glplot.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"}};var t},k.setViewport=function(t){var e,r=t.camera;this.glplot.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);var n="orthographic"===r.projection.type;if(n!==this.glplot.camera._ortho){this.glplot.redraw();var a=this.glplot.clearColor;this.glplot.gl.clearColor(a[0],a[1],a[2],a[3]),this.glplot.gl.clear(this.glplot.gl.DEPTH_BUFFER_BIT|this.glplot.gl.COLOR_BUFFER_BIT),this.glplot.dispose(),_(this),this.glplot.camera._ortho=n}},k.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},k.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},k.saveLayout=function(t){var e,r,n,a,i,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),p=l||c;if(p){var h={};l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),h[this.id+".camera"]=n),c&&(a=this.glplot.getAspectratio(),o=(i=f.nestedProperty(t,this.id+".aspectratio")).get(),h[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,h),l&&(r.set(e),f.nestedProperty(s,this.id+".camera").set(e)),c&&(i.set(a),f.nestedProperty(s,this.id+".aspectratio").set(a),this.glplot.redraw())}return p},k.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 c=this.id+".camera.up",p={x:0,y:0,z:1},h={};h[c]=p;var d=n.layout;u.call("_storeDirectGUIEdit",d,a._preGUI,h),i.up=p,f.nestedProperty(d,c).set(p)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},k.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);for(var o=0,s=a-1;o© OpenStreetMap
',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:'© CARTO',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:'© CARTO',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:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',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:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',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, under CC BY SA.',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}]}},a=Object.keys(n);e.exports={requiredVersion:"1.3.2",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:n,styleValuesNonMapbox:a,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.3.2."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",a.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\')'}}},{}],818:[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":716}],819:[function(t,e,r){"use strict";var n=t("mapbox-gl"),a=t("../../lib"),i=t("../../plots/get_data").getSubplotCalcData,o=t("../../constants/xmlns_namespaces"),s=t("d3"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./mapbox"),f=r.constants=t("./constants");function p(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,o=e._subplots.mapbox;if(n.version!==f.requiredVersion)throw new Error(f.wrongVersionErrorMsg);var s=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,o);n.accessToken=s;for(var l=0;lx/2){var b=g.split("|").join("
");m.text(b).attr("data-unformatted",b).call(c.convertToTspans,t),y=l.bBox(m.node())}m.attr("transform","translate(-3, "+(8-y.height)+")"),v.insert("rect",".static-attribution").attr({x:-y.width-6,y:-y.height-3,width:y.width+6,height:y.height+3,fill:"rgba(255, 255, 255, 0.75)"});var _=1;y.width+6>x&&(_=x/(y.width+6));var w=[n.l+n.w*u.x[1],n.t+n.h*(1-u.y[0])];v.attr("transform","translate("+w[0]+","+w[1]+") scale("+_+")")}},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 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})}return{layout:e,paint:r}}s.update=function(t){this.visible?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=l(t)},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.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,l(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};return"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=t.sourceattribution),a}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e,r=this.subplot,n=c(t),a=this.subplot.belowLookup["layout-"+this.index];if("traces"===a)for(var o=r.getMapLayers(),s=0;s1)for(r=0;r-1&&f(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&i.click(n,e.originalEvent)}}},g.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,i=t.dragmode;a="select"===i?function(t,r){(t.range={})[e.id]=[l([r.xmin,r.ymin]),l([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(l)};var s=e.dragOptions;e.dragOptions=o.extendDeep(s||{},{element:e.div,gd:n,plotinfo:{id:e.id,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),"select"===i||"lasso"===i?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){u(t,r,n,e.dragOptions,i)},c.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 l(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},g.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])},g.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"),u=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(){m.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()&&u.text()?" - ":"")}},m.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL,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=m.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var b=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],_=["year","month","dayMonth","dayMonthYear"];function w(t,e){var r=t._context.locale,n=!1,a={};function o(t){for(var r=!0,i=0;i1&&P.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&P.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),m.linkSubplots(f,s,u,a),m.cleanPlot(f,s,u,a),a._zoomlayer&&!t._dragging&&a._zoomlayer.selectAll(".select-outline").remove(),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),i=Math.round(f*i)}}var p=m.layoutAttributes.width.min,h=m.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}),m.sanitizeMargins(r)},m.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o,s,c=i.componentsRegistry,u=e._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(s=c[a]).includeBasePlot&&s.includeBasePlot(t,e);for(var p in u.length||u.push(f),e._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[p].sort(l.subplotSort);for(o=0;o.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,p=void 0!==r.yb?r.yb:r.y;a[e]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:p,size:r.b+o},t:{val:f,size:r.t+o}},i[e]=1}else delete a[e],delete i[e];if(!n._replotting)return m.doAutoMargin(t)}},m.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),M(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,c=n.r,u=n.t,f=n.b,p=e.width,h=e.height,d=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var v in d)g[v]||delete d[v];for(var y in d.base={l:{val:0,size:s},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},d){var x=d[y].l||{},b=d[y].b||{},_=x.val,w=x.size,k=b.val,T=b.size;for(var A in d){if(a(w)&&d[A].r){var E=d[A].r.val,S=d[A].r.size;if(E>_){var C=(w*E+(S-p)*_)/(E-_),L=(S*(1-_)+(w-p)*(1-E))/(E-_);C>=0&&L>=0&&p-(C+L)>0&&C+L>s+c&&(s=C,c=L)}}if(a(T)&&d[A].t){var O=d[A].t.val,P=d[A].t.size;if(O>k){var I=(T*O+(P-h)*k)/(O-k),D=(P*(1-k)+(T-h)*(1-O))/(O-k);I>=0&&D>=0&&h-(D+I)>0&&I+D>f+u&&(f=I,u=D)}}}}}if(r.l=Math.round(s),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(p)-r.l-r.r,r.h=Math.round(h)-r.t-r.b,!e._replotting&&m.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var z=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 i.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){var e;s++,n||s!==o||(e=a,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)))}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(a,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}m.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},m.graphJson=function(t,e,r,n,a){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&m.supplyDefaults(t);var i=a?t._fullData:t.data,o=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function c(t){if("function"==typeof t)return null;if(l.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=c(t[e])}return a}return Array.isArray(t)?t.map(c):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var u={data:(i||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};return e||(u.layout=c(o)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),s&&(u.frames=c(s)),"object"===n?u:JSON.stringify(u)},m.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(i=n.calc(t,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,d[e]=i}}for(L(c,p),a=0;a1e-10?t:0}function p(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:f,pathPolygon:function(t,e,r,n,a,i){return"M"+p(u(t,e,r,n),a,i).join("L")},pathPolygonAnnulus:function(t,e,r,n,a,i,o){var s,l;t=0?p.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);A&&!T&&(S=0);var C=E.slice();M&&T&&(C[1]+=S);var L=p.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),p.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var O=p.angularAxis.ticksStep||(C[1]-C[0])/(L*(p.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),C[2]||(C[2]=O);var P=n.range.apply(this,C);if(P=P.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===p.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=M?S:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),D=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));t=n.select(D)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var z,R=t.select(".chart-group"),F={fill:"none",stroke:p.tickColor},B={"font-size":p.font.size,"font-family":p.font.family,fill:p.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(t,e){return" "+t+" 0 "+p.font.outlineColor})).join(",")};if(p.showLegend){z=t.select(".legend-group").attr({transform:"translate("+[x,p.margin.top]+")"}).style({display:"block"});var N=h.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:h.map((function(t,e){return t.name||"Element"+e})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:z,elements:N,reverseOrder:p.legend.reverseOrder})})();var j=z.node().getBBox();x=Math.min(p.width-j.width-p.margin.left-p.margin.right,p.height-p.margin.top-p.margin.bottom)/2,x=Math.max(10,x),_=[p.margin.left+x,p.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),z.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else z=t.select(".legend-group").style({display:"none"});t.attr({width:p.width,height:p.height}).style({opacity:p.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var V=[(p.width-(p.margin.left+p.margin.right+2*x+(j?j.width:0)))/2,(p.height-(p.margin.top+p.margin.bottom+2*x))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),t.select(".outer-group").attr("transform","translate("+V+")"),p.title&&p.title.text){var U=t.select("g.title-group text").style(B).text(p.title.text),H=U.node().getBBox();U.attr({x:_[0]-H.width/2,y:_[1]-x-20})}var q=t.select(".radial.axis-group");if(p.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:x}).style(F);var W=t.select("circle.background-circle").attr({r:x}).style({fill:p.backgroundColor,stroke:p.stroke});function Y(t,e){return s(t)%360+p.orientation}if(p.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(X).attr({transform:"rotate("+p.radialAxis.orientation+")"}),q.selectAll(".domain").style(F),q.selectAll("g>text").text((function(t,e){return this.textContent+p.radialAxis.ticksSuffix})).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===p.radialAxis.tickOrientation?"rotate("+-p.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(P),J=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+Y(t)+")"}}).style({display:p.angularAxis.visible?"block":"none"}),Z.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",(function(t,e){return e%(p.minorTicks+1)==0})).classed("minor",(function(t,e){return!(e%(p.minorTicks+1)==0)})).style(F),J.selectAll(".minor").style({stroke:p.minorTickColor}),Z.select("line.grid-line").attr({x1:p.tickLength?x-p.tickLength:0,x2:x}).style({display:p.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(B);var K=Z.select("text.axis-text").attr({x:x+p.labelOffset,dy:i+"em",transform:function(t,e){var r=Y(t),n=x+p.labelOffset,a=p.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:p.angularAxis.labelsVisible?"block":"none"}).text((function(t,e){return e%(p.minorTicks+1)!=0?"":w?w[t]+p.angularAxis.ticksSuffix:t+p.angularAxis.ticksSuffix})).style(B);p.angularAxis.rewriteTicks&&K.text((function(t,e){return e%(p.minorTicks+1)!=0?"":p.angularAxis.rewriteTicks(this.textContent,e)}));var $=n.max(R.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));z.attr({transform:"translate("+[x+$,p.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(h);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),h[0]||Q){var et=[];h.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=p.orientation,n.direction=p.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return void 0!==t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.forEach((function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map((function(t,e){return a(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var at,it,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,hasTick:!0})();if(!T){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(W).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-p.orientation)%360;at=s.invert(n);var a=o.util.convertToCartesian(x+12,r+180);lt.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var pt=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(W).radius;pt.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(W).radius);var a=o.util.convertToCartesian(n,p.radialAxis.orientation);ct.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){pt.style({opacity:0}),ut.hide(),lt.hide(),ct.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var a=n.select(this),i=this.style.fill,s="black",l=this.style.opacity||1;if(a.attr({"data-opacity":l}),i&&"none"!==i){a.attr({"data-fill":i}),s=n.hsl(i).darker().toString(),a.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};T&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),p=t.node().getBoundingClientRect(),h=[f.left+f.width/2-V[0]-p.left,f.top+f.height/2-V[1]-p.top];ut.config({color:s}).text(u),ut.move(h)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),s=n.hsl(i).darker().toString(),a.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()})).on("mouseout.tooltip",(function(t,e){ut.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},config:function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)})),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},getLiveConfig:function(){return u},getinputConfig:function(){return c},radialScale:function(t){return r},angularScale:function(t){return s},svg:function(){return t}};return n.rebind(p,f,"on"),p},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach((function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)}));var s={t:i,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,a,i)},"stroke-width":function(t,e){return d["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,a,i)},opacity:function(t,e){return d.opacity(r,a,i)},display:function(t,e){return d.display(r,a,i)}})}};var f=e.angularScale.range(),p=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,h=n.svg.arc().startAngle((function(t){return-p/2})).endAngle((function(t){return p/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));c.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:h,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return void 0===t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(t,e){return t}));v.enter().append("path").attr({class:"mark"}),v.style(d).each(c[e.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)})),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||void 0===e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=u?e.height:c*o.length,p=s.classed("legend-group",!0).selectAll("svg").data([0]),h=p.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});h.append("g").classed("legend-axis",!0),h.append("g").classed("legend-marks",!0);var d=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(d).range(l),v=n.scale[u?"linear":"ordinal"]().domain(d)[u?"range":"rangePoints"]([0,f]);if(u){var m=p.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),p.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=p.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=p.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=i.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var p=i.padding,h=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},g=h.width+2*p+l,v=h.height+2*p;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[i.hasTick?0:l,0],[l,v/4],[l,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-v/2+2*p]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(i,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=a({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n})),!e&&t.layout&&"stack"===t.layout.barmode)){var i=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=a({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach((function(t,e){u[c[l.indexOf(t.key)]]=t.value})),s.margin=u}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r}};return t}},{"../../../constants/alignment":685,"../../../lib":716,d3:164}],835:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,r,a,i,u,f=new s;function p(r,s){return s&&(u=s),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return p.isPolar=!0,p.svg=function(){return a.svg()},p.getConfig=function(){return e},p.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},p.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},p.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},p.undo=function(){f.undo()},p.redo=function(){f.redo()},p},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=l(o,t.layout)}},{"../../../components/color":591,"../../../lib":716,"./micropolar":834,"./undo_manager":836,d3:164}],836:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function a(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r=90||s>90&&l>=450?1:u<=0&&p<=0?0:Math.max(u,p),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&&p>=0?0:Math.min(u,p),n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f),[e,r,n,a]}(p),x=y[2]-y[0],b=y[3]-y[1],_=f/u,w=Math.abs(b/x);_>w?(h=u,m=(f-(d=u*w))/n.h/2,g=[o[0],o[1]],v=[c[0]+m,c[1]-m]):(d=f,m=(u-(h=f/w))/n.w/2,g=[o[0]+m,o[1]-m],v=[c[0],c[1]]),this.xLength2=h,this.yLength2=d,this.xDomain2=g,this.yDomain2=v;var k=this.xOffset2=n.l+n.w*g[0],T=this.yOffset2=n.t+n.h*(1-v[1]),A=this.radius=h/x,M=this.innerRadius=e.hole*A,E=this.cx=k-A*y[0],L=this.cy=T+A*y[3],O=this.cxx=E-k,P=this.cyy=L-T;this.radialAxis=this.mockAxis(t,e,a,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[a.side],domain:[M/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:g}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:v});var I=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",I).attr("transform",R(O,P)),r.frontplot.attr("transform",R(k,T)).call(l.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",I).attr("transform",R(E,L)).call(s.fill,e.bgcolor)},P.mockAxis=function(t,e,r,n){var a=o.extendFlat({},r,n);return p(a,e,t),a},P.mockCartesianAxis=function(t,e,r){var n=this,a=r._id,i=o.extendFlat({type:"linear"},r);f(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},P.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,a=e.radialaxis;n.setScale(),h(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")]},P.updateRadialAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,l=r.innerRadius,c=r.cx,f=r.cy,p=e.radialaxis,h=S(e.sector[0],360),d=r.radialAxis,g=l90&&h<=270&&(d.tickangle=180);var v=function(t){return"translate("+(d.l2p(t.x)+l)+",0)"},m=I(p);if(r.radialTickLayout!==m&&(a["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=m),g){d.setScale();var y=u.calcTicks(d),x=u.clipEnds(d,y),b=u.getTickSigns(d)[2];u.drawTicks(n,d,{vals:y,layer:a["radial-axis"],path:u.makeTickPath(d,0,b),transFn:v,crisp:!1}),u.drawGrid(n,d,{vals:x,layer:a["radial-grid"],path:function(t){return r.pathArc(d.r2p(t.x)+l)},transFn:o.noop,crisp:!1}),u.drawLabels(n,d,{vals:y,layer:a["radial-axis"],transFn:v,labelFns:u.makeLabelFns(d,0)})}var _=r.radialAxisAngle=r.vangles?L(D(C(p.angle),r.vangles)):p.angle,w=R(c,f),k=w+F(-_);z(a["radial-axis"],g&&(p.showticklabels||p.ticks),{transform:k}),z(a["radial-grid"],g&&p.showgrid,{transform:w}),z(a["radial-line"].select("line"),g&&p.showline,{x1:l,y1:0,x2:i,y2:0,transform:k}).attr("stroke-width",p.linewidth).call(s.stroke,p.linecolor)},P.updateRadialAxisTitle=function(t,e,r){var n=this.gd,a=this.radius,i=this.cx,o=this.cy,s=e.radialaxis,c=this.id+"title",u=void 0!==r?r:this.radialAxisAngle,f=C(u),p=Math.cos(f),h=Math.sin(f),d=0;if(s.title){var g=l.bBox(this.layers["radial-axis"].node()).height,v=s.title.font.size;d="counterclockwise"===s.side?-g-.4*v:g+.8*v}this.layers["radial-axis-title"]=m.draw(n,c,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:E(n,"Click to enter radial axis title"),attributes:{x:i+a/2*p+d*h,y:o-a/2*h+d*p,"text-anchor":"middle"},transform:{rotate:-u}})},P.updateAngularAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,l=r.innerRadius,c=r.cx,f=r.cy,p=e.angularaxis,h=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",p.rotation),h.setGeometry(),h.setScale();var d=function(t){return h.t2g(t.x)};"linear"===h.type&&"radians"===h.thetaunit&&(h.tick0=L(h.tick0),h.dtick=L(h.dtick));var g=function(t){return R(c+i*Math.cos(t),f-i*Math.sin(t))},v=u.makeLabelFns(h,0).labelStandoff,m={xFn:function(t){var e=d(t);return Math.cos(e)*v},yFn:function(t){var e=d(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(v+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*T)},anchorFn:function(t){var e=d(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=d(t);return-.5*(1+Math.sin(n))*r}},y=I(p);r.angularTickLayout!==y&&(a["angular-axis"].selectAll("."+h._id+"tick").remove(),r.angularTickLayout=y);var x,b=u.calcTicks(h);if("linear"===e.gridshape?(x=b.map(d),o.angleDelta(x[0],x[1])<0&&(x=x.slice().reverse())):x=null,r.vangles=x,"category"===h.type&&(b=b.filter((function(t){return o.isAngleInsideSector(d(t),r.sectorInRad)}))),h.visible){var _="inside"===h.ticks?-1:1,w=(h.linewidth||1)/2;u.drawTicks(n,h,{vals:b,layer:a["angular-axis"],path:"M"+_*w+",0h"+_*h.ticklen,transFn:function(t){var e=d(t);return g(e)+F(-L(e))},crisp:!1}),u.drawGrid(n,h,{vals:b,layer:a["angular-grid"],path:function(t){var e=d(t),r=Math.cos(e),n=Math.sin(e);return"M"+[c+l*r,f-l*n]+"L"+[c+i*r,f-i*n]},transFn:o.noop,crisp:!1}),u.drawLabels(n,h,{vals:b,layer:a["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return g(d(t))},labelFns:m})}z(a["angular-line"].select("path"),p.showline,{d:r.pathSubplot(),transform:R(c,f)}).attr("stroke-width",p.linewidth).call(s.stroke,p.linecolor)},P.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},P.updateMainDrag=function(t){var e=this,r=e.gd,o=e.layers,s=t._zoomlayer,l=A.MINZOOM,c=A.OFFEDGE,u=e.radius,f=e.innerRadius,p=e.cx,h=e.cy,m=e.cxx,_=e.cyy,w=e.sectorInRad,k=e.vangles,T=e.radialAxis,E=M.clampTiny,S=M.findXYatLength,C=M.findEnclosingVertexAngles,L=A.cornerHalfWidth,O=A.cornerLen/2,P=d.makeDragger(o,"path","maindrag","crosshair");n.select(P).attr("d",e.pathSubplot()).attr("transform",R(p,h));var I,D,z,F,B,N,j,V,U,H={element:P,gd:r,subplot:e.id,plotinfo:{id:e.id,xaxis:e.xaxis,yaxis:e.yaxis},xaxes:[e.xaxis],yaxes:[e.yaxis]};function q(t,e){return Math.sqrt(t*t+e*e)}function G(t,e){return q(t-m,e-_)}function W(t,e){return Math.atan2(_-e,t-m)}function Y(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function X(t,r){if(0===t)return e.pathSector(2*L);var n=O/t,a=r-n,i=r+n,o=Math.max(0,Math.min(t,u)),s=o-L,l=o+L;return"M"+Y(s,a)+"A"+[s,s]+" 0,0,0 "+Y(s,i)+"L"+Y(l,i)+"A"+[l,l]+" 0,0,1 "+Y(l,a)+"Z"}function Z(t,r,n){if(0===t)return e.pathSector(2*L);var a,i,o=Y(t,r),s=Y(t,n),l=E((o[0]+s[0])/2),c=E((o[1]+s[1])/2);if(l&&c){var u=c/l,f=-1/u,p=S(L,u,l,c);a=S(O,f,p[0][0],p[0][1]),i=S(O,f,p[1][0],p[1][1])}else{var h,d;c?(h=O,d=L):(h=L,d=O),a=[[l-h,c-d],[l+h,c-d]],i=[[l-h,c+d],[l+h,c+d]]}return"M"+a.join("L")+"L"+i.reverse().join("L")+"Z"}function J(t,e){return e=Math.max(Math.min(e,u),f),tl?(t-1&&1===t&&x(n,r,[e.xaxis],[e.yaxis],e.id,H),a.indexOf("event")>-1&&v.click(r,n,e.id)}H.prepFn=function(t,n,i){var o=r._fullLayout.dragmode,l=P.getBoundingClientRect();if(I=n-l.left,D=i-l.top,k){var c=M.findPolygonOffset(u,w[0],w[1],k);I+=m+c[0],D+=_+c[1]}switch(o){case"zoom":H.moveFn=k?tt:$,H.clickFn=nt,H.doneFn=et,function(){z=null,F=null,B=e.pathSubplot(),N=!1;var t=r._fullLayout[e.id];j=a(t.bgcolor).getLuminance(),(V=d.makeZoombox(s,j,p,h,B)).attr("fill-rule","evenodd"),U=d.makeCorners(s,p,h),b(r)}();break;case"select":case"lasso":y(t,n,i,H,o)}},P.onmousemove=function(t){v.hover(r,t,e.id),r._fullLayout._lasthover=P,r._fullLayout._hoversubplot=e.id},P.onmouseout=function(t){r._dragging||g.unhover(r,t)},g.init(H)},P.updateRadialDrag=function(t,e,r){var a=this,s=a.gd,l=a.layers,c=a.radius,u=a.innerRadius,f=a.cx,p=a.cy,h=a.radialAxis,v=A.radialDragBoxSize,m=v/2;if(h.visible){var y,x,_,T=C(a.radialAxisAngle),M=h._rl,E=M[0],S=M[1],O=M[r],P=.75*(M[1]-M[0])/(1-e.hole)/c;r?(y=f+(c+m)*Math.cos(T),x=p-(c+m)*Math.sin(T),_="radialdrag"):(y=f+(u-m)*Math.cos(T),x=p-(u-m)*Math.sin(T),_="radialdrag-inner");var I,B,N,j=d.makeRectDragger(l,_,"crosshair",-m,-m,v,v),V={element:j,gd:s};z(n.select(j),h.visible&&u0==(r?N>E: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*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,g.min=0,v.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=f[e._name];function o(r,n){return i.coerce(t,e,a,r,n)}o("uirevision",n.uirevision),e.type="linear";var p=o("color"),h=p!==a.color.dflt?p:r.font.color,d=e._name.charAt(0).toUpperCase(),g="Component "+d,v=o("title.text",g);e._hovertitle=v===g?v:d,i.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*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:p,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:f,handleDefaults:h,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":591,"../../lib":716,"../../plot_api/plot_template":754,"../cartesian/line_grid_defaults":778,"../cartesian/tick_label_defaults":783,"../cartesian/tick_mark_defaults":784,"../cartesian/tick_value_defaults":785,"../subplot_defaults":839,"./layout_attributes":842}],844:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),s=o._,l=t("../../components/color"),c=t("../../components/drawing"),u=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,p=t("../plots"),h=t("../cartesian/axes"),d=t("../../components/dragelement"),g=t("../../components/fx"),v=t("../../components/titles"),m=t("../cartesian/select").prepSelect,y=t("../cartesian/select").selectOnClick,x=t("../cartesian/select").clearSelect,b=t("../cartesian/constants");function _(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=_;var w=_.prototype;w.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},w.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var a=0;ak*x?a=(i=x)*k:i=(a=y)/k,o=v*a/y,s=m*i/x,r=e.l+e.w*d-a/2,n=e.t+e.h*(1-g)-i/2,p.x0=r,p.y0=n,p.w=a,p.h=i,p.sum=b,p.xaxis={type:"linear",range:[_+2*T-b,b-_-2*w],domain:[d-o/2,d+o/2],_id:"x"},u(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:[_,b-w-T],domain:[g-s/2,g+s/2],_id:"y"},u(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var A=p.yaxis.domain[0],M=p.aaxis=f({},t.aaxis,{range:[_,b-w-T],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*k],anchor:"free",position:0,_id:"y",_length:a});u(M,p.graphDiv._fullLayout),M.setScale();var E=p.baxis=f({},t.baxis,{range:[b-_-T,w],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});u(E,p.graphDiv._fullLayout),E.setScale();var S=p.caxis=f({},t.caxis,{range:[b-_-w,T],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*k],anchor:"free",position:0,_id:"y",_length:a});u(S,p.graphDiv._fullLayout),S.setScale();var C="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDef.select("path").attr("d",C),p.layers.plotbg.select("path").attr("d",C);var L="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDefRelative.select("path").attr("d",L);var O="translate("+r+","+n+")";p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",O),p.clipDefRelative.select("path").attr("transform",null);var P="translate("+(r-E._offset)+","+(n+i)+")";p.layers.baxis.attr("transform",P),p.layers.bgrid.attr("transform",P);var I="translate("+(r+a/2)+","+n+")rotate(30)translate(0,"+-M._offset+")";p.layers.aaxis.attr("transform",I),p.layers.agrid.attr("transform",I);var D="translate("+(r+a/2)+","+n+")rotate(-30)translate(0,"+-S._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+i)+"l"+a/2+",-"+i:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",E.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(l.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",S.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),c.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},w.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 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"]=v.draw(e,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:s(e,"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"]=v.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(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"]=v.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(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"}})}},w.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=h.calcTicks(t),f=h.clipEnds(t,u),p=h.makeTransFn(t),d=h.getTickSigns(t)[2],g=o.deg2rad(30),v=d*(t.linewidth||1)/2,m=d*t.ticklen,y=this.w,x=this.h,b="b"===a?"M0,"+v+"l"+Math.sin(g)*m+","+Math.cos(g)*m:"M"+v+",0l"+Math.cos(g)*m+","+-Math.sin(g)*m,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[a];h.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:s,path:b,transFn:p,crisp:!1}),h.drawGrid(r,t,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:p,crisp:!1}),h.drawLabels(r,t,{vals:u,layer:s,transFn:p,labelFns:h.makeLabelFns(t,0,30)})};var T=b.MINZOOM/2+.87,A="m-0.87,.5h"+T+"v3h-"+(T+5.2)+"l"+(T/2+2.6)+",-"+(.87*T+4.5)+"l2.6,1.5l-"+T/2+","+.87*T+"Z",M="m0.87,.5h-"+T+"v3h"+(T+5.2)+"l-"+(T/2+2.6)+",-"+(.87*T+4.5)+"l-2.6,1.5l"+T/2+","+.87*T+"Z",E="m0,1l"+T/2+","+.87*T+"l2.6,-1.5l-"+(T/2+2.6)+",-"+(.87*T+4.5)+"l-"+(T/2+2.6)+","+(.87*T+4.5)+"l2.6,1.5l"+T/2+",-"+.87*T+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",C=!0;function L(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}w.initInteractions=function(){var t,e,r,n,u,f,p,h,v,_,w=this,T=w.layers.plotbg.select("path").node(),O=w.graphDiv,P=O._fullLayout._zoomlayer,I={element:T,gd:O,plotinfo:{id:w.id,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(i,o,s){I.xaxes=[w.xaxis],I.yaxes=[w.yaxis];var c=O._fullLayout.dragmode;I.minDrag="lasso"===c?1:void 0,"zoom"===c?(I.moveFn=N,I.clickFn=z,I.doneFn=j,function(i,o,s){var c=T.getBoundingClientRect();t=o-c.left,e=s-c.top,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,n=w.aaxis.range[1]-r.a,f=a(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),p="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",h=!1,v=P.append("path").attr("class","zoombox").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:f>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",p),_=P.append("path").attr("class","zoombox-corners").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),x(O)}(0,o,s)):"pan"===c?(I.moveFn=V,I.clickFn=z,I.doneFn=U,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,x(O)):"select"!==c&&"lasso"!==c||m(i,o,s,I,c)}};function D(t){var e={};return e[w.id+".aaxis.min"]=t.a,e[w.id+".baxis.min"]=t.b,e[w.id+".caxis.min"]=t.c,e}function z(t,e){var r=O._fullLayout.clickmode;L(O),2===t&&(O.emit("plotly_doubleclick",null),i.call("_guiRelayout",O,D({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&y(e,O,[w.xaxis],[w.yaxis],w.id,I),r.indexOf("event")>-1&&g.click(O,e,w.id)}function R(t,e){return 1-e/w.h}function F(t,e){return 1-(t+(w.h-e)/Math.sqrt(3))/w.w}function B(t,e){return(t-(w.h-e)/Math.sqrt(3))/w.w}function N(a,i){var o=t+a,s=e+i,l=Math.max(0,Math.min(1,R(0,e),R(0,s))),c=Math.max(0,Math.min(1,F(t,e),F(o,s))),d=Math.max(0,Math.min(1,B(t,e),B(o,s))),g=(l/2+d)*w.w,m=(1-l/2-c)*w.w,y=(g+m)/2,x=m-g,T=(1-l)*w.h,C=T-x/k;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),_.transition().style("opacity",1).duration(200),h=!0),O.emit("plotly_relayouting",D(u))}function j(){L(O),u!==r&&(i.call("_guiRelayout",O,D(u)),C&&O.data&&O._context.showTips&&(o.notifier(s(O,"Double-click to zoom back out"),"long"),C=!1))}function V(t,e){var n=t/w.xaxis._m,a=e/w.yaxis._m,i=[(u={a:r.a-a,b:r.b+(n+a)/2,c:r.c-(n-a)/2}).a,u.b,u.c].sort(),o=i.indexOf(u.a),s=i.indexOf(u.b),l=i.indexOf(u.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),u={a:i[o],b:i[s],c:i[l]},e=(r.a-u.a)*w.yaxis._m,t=(r.c-u.c-r.b+u.b)*w.xaxis._m);var f="translate("+(w.x0+t)+","+(w.y0+e)+")";w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var p="translate("+-t+","+-e+")";w.clipDefRelative.select("path").attr("transform",p),w.aaxis.range=[u.a,w.sum-u.b-u.c],w.baxis.range=[w.sum-u.a-u.c,u.b],w.caxis.range=[w.sum-u.a-u.b,u.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,w),O.emit("plotly_relayouting",D(u))}function U(){i.call("_guiRelayout",O,D(u))}T.onmousemove=function(t){g.hover(O,t,w.id),O._fullLayout._lasthover=T,O._fullLayout._hoversubplot=w.id},T.onmouseout=function(t){O._dragging||d.unhover(O,t)},d.init(I)}},{"../../components/color":591,"../../components/dragelement":609,"../../components/drawing":612,"../../components/fx":629,"../../components/titles":678,"../../lib":716,"../../lib/extend":707,"../../registry":845,"../cartesian/axes":764,"../cartesian/constants":770,"../cartesian/select":781,"../cartesian/set_convert":782,"../plots":825,d3:164,tinycolor2:535}],845:[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"),f=l.extendFlat,p=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])n.log("Plot type "+e+" already registered.");else for(var a in m(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(a,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(f[h[r]].title={text:""});for(r=0;rpath, .legendlines>path, .cbfill").each((function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(l,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(l,"TOBESTRIPPED"))})),"pdf"!==e&&"eps"!==e||p.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),p.node().setAttributeNS(s.xmlns,"xmlns",s.svg),p.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===e&&r&&(p.attr("width",r*d),p.attr("height",r*g),p.attr("viewBox","0 0 "+d+" "+g));var _=(new window.XMLSerializer).serializeToString(p.node());return _=(_=(_=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,(function(t){return"<"===t?"<":"&rt;"===t?">":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()}));return e.remove(),r}(_)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":591,"../components/drawing":612,"../constants/xmlns_namespaces":693,"../lib":716,d3:164}],854:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r0&&f.s>0||(c=!1)}o._extremes[t._id]=s.findExtremes(t,l,{tozero:!c,padded:!0})}}function m(t){for(var e=t.traces,r=0;rf+c||!n(u))}for(var h=0;h0&&_.s>0||(m=!1)}}g._extremes[t._id]=s.findExtremes(t,v,{tozero:!m,padded:y})}}function x(t){return t._id.charAt(0)}e.exports={crossTraceCalc:function(t,e){for(var r=e.xaxis,n=e.yaxis,a=t._fullLayout,i=t._fullData,s=t.calcdata,l=[],c=[],f=0;fi))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}function T(t){return"auto"===t?0:t}function A(t,e,r,n,a,i){var o=!!i.isHorizontal,s=!!i.constrained,l=i.angle||0,c=i.anchor||0,u=a.width,f=a.height,p=Math.abs(e-t),h=Math.abs(n-r),d=p>2*y&&h>2*y?y:0;p-=2*d,h-=2*d;var g=!1;if(!("auto"===l)||u<=p&&f<=h||!(u>p||f>h)||(u>h||f>p)&&u2*y?y:0:p>2*y?y:0;var d=1;l&&(d=s?Math.min(1,h/f):Math.min(1,p/u));var g=T(c);o+=.5*(d*(s?f:u)*Math.abs(Math.sin(Math.PI/180*g))+d*(s?u:f)*Math.abs(Math.cos(Math.PI/180*g)));var v=(t+e)/2,m=(r+n)/2;return s?v=e-o*_(e,t):m=n+o*_(r,n),{textX:(a.left+a.right)/2,textY:(a.top+a.bottom)/2,targetX:v,targetY:m,scale:d,rotate:g}}e.exports={plot:function(t,e,r,h,d,x){var T=e.xaxis,E=e.yaxis,S=t._fullLayout;d||(d={mode:S.barmode,norm:S.barmode,gap:S.bargap,groupgap:S.bargroupgap});var C=i.makeTraceGroups(h,r,"trace bars").each((function(r){var c=n.select(this),h=r[0].trace,S="waterfall"===h.type,C="funnel"===h.type,L="bar"===h.type||C,O=0;S&&h.connector.visible&&"between"===h.connector.mode&&(O=h.connector.line.width/2);var P="h"===h.orientation,I=i.ensureSingle(c,"g","points"),D=b(h),z=I.selectAll("g.point").data(i.identity,D);z.enter().append("g").classed("point",!0),z.exit().remove(),z.each((function(c,b){var S,C,I=n.select(this),D=function(t,e,r,n){var a=[],i=[],o=n?e:r,s=n?r:e;return a[0]=o.c2p(t.s0,!0),i[0]=s.c2p(t.p0,!0),a[1]=o.c2p(t.s1,!0),i[1]=s.c2p(t.p1,!0),n?[a,i]:[i,a]}(c,T,E,P),z=D[0][0],R=D[0][1],F=D[1][0],B=D[1][1],N=!(z!==R&&F!==B&&a(z)&&a(R)&&a(F)&&a(B));if(N&&L&&p.getLineWidth(h,c)&&(P?R-z==0:B-F==0)&&(N=!1),c.isBlank=N,N&&P&&(R=z),N&&!P&&(B=F),O&&!N&&(P?(z-=_(z,R)*O,R+=_(z,R)*O):(F-=_(F,B)*O,B+=_(F,B)*O)),"waterfall"===h.type){if(!N){var j=h[c.dir].marker;S=j.line.width,C=j.color}}else S=p.getLineWidth(h,c),C=c.mc||h.marker.color;var V=n.round(S/2%1,2);function U(t){return 0===d.gap&&0===d.groupgap?n.round(Math.round(t)-V,2):t}if(!t._context.staticPlot){var H=s.opacity(C)<1||S>.01?U:function(t,e){return Math.abs(t-e)>=2?U(t):t>e?Math.ceil(t):Math.floor(t)};z=H(z,R),R=H(R,z),F=H(F,B),B=H(B,F)}var q=w(i.ensureSingle(I,"path"),d,x);if(q.style("vector-effect","non-scaling-stroke").attr("d","M"+z+","+F+"V"+B+"H"+R+"V"+F+"Z").call(l.setClipUrl,e.layerClipId,t),k(d)){var G=l.makePointStyleFns(h);l.singlePointStyle(c,q,h,G,t)}!function(t,e,r,n,a,s,c,h,d,x,b){var _,k=e.xaxis,T=e.yaxis,E=t._fullLayout;function S(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+_,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var C=n[0].trace,L="h"===C.orientation,O=function(t,e,r,n,a){var o,s=e[0].trace;return 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="h"===o.orientation,c="waterfall"===o.type,f="funnel"===o.type;function p(t){return u(l?n:a,+t,!0).text}var h,d=e[r],g={};g.label=d.p,g.labelLabel=(h=d.p,u(l?a:n,h,!0).text);var v=i.castOption(o,d.i,"text");(0===v||v)&&(g.text=v),g.value=d.s,g.valueLabel=p(d.s);var y={};m(y,o,d.i),c&&(g.delta=+d.rawS||d.s,g.deltaLabel=p(g.delta),g.final=d.v,g.finalLabel=p(g.final),g.initial=g.final-g.delta,g.initialLabel=p(g.initial)),f&&(g.value=d.s,g.valueLabel=p(g.value),g.percentInitial=d.begR,g.percentInitialLabel=i.formatPercent(d.begR),g.percentPrevious=d.difR,g.percentPreviousLabel=i.formatPercent(d.difR),g.percentTotal=d.sumR,g.percenTotalLabel=i.formatPercent(d.sumR));var x=i.castOption(o,d.i,"customdata");return x&&(g.customdata=x),i.texttemplateString(s,g,t._d3locale,y,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 f,p,h=a.textinfo,d=t[e],g=h.split("+"),v=[],m=function(t){return-1!==g.indexOf(t)};if(m("label")&&v.push((p=t[e].p,u(o?n:r,p,!0).text)),m("text")&&(0===(f=i.castOption(a,d.i,"text"))||f)&&v.push(f),s){var y=+d.rawS||d.s,x=d.v,b=x-y;m("initial")&&v.push(c(b)),m("delta")&&v.push(c(y)),m("final")&&v.push(c(x))}if(l){m("value")&&v.push(c(d.s));var _=0;m("percent initial")&&_++,m("percent previous")&&_++,m("percent total")&&_++;var w=_>1;m("percent initial")&&(f=i.formatPercent(d.begR),w&&(f+=" of initial"),v.push(f)),m("percent previous")&&(f=i.formatPercent(d.difR),w&&(f+=" of previous"),v.push(f)),m("percent total")&&(f=i.formatPercent(d.sumR),w&&(f+=" of total"),v.push(f))}return v.join("
")}(e,r,n,a):p.getValue(s.text,r),p.coerceString(g,o)}(E,n,a,k,T);_=function(t,e){var r=p.getValue(t.textposition,e);return p.coerceEnumerated(v,r)}(C,a);var P="stack"===x.mode||"relative"===x.mode,I=n[a],D=!P||I._outmost;if(O&&"none"!==_&&(!I.isBlank&&s!==c&&h!==d||"auto"!==_&&"inside"!==_)){var z=E.font,R=f.getBarColor(n[a],C),F=f.getInsideTextFont(C,a,z,R),B=f.getOutsideTextFont(C,a,z),N=r.datum();L?"log"===k.type&&N.s0<=0&&(s=k.range[0]=U*(Y/H):Y>=H*(W/U);U>0&&H>0&&(X||Z||J)?_="inside":(_="outside",j.remove(),j=null)}else _="inside";if(!j){var K=(j=S(r,O,"outside"===_?B:F)).attr("transform");if(j.attr("transform",""),V=l.bBox(j.node()),U=V.width,H=V.height,j.attr("transform",K),U<=0||H<=0)return void j.remove()}"outside"===_?(G="both"===C.constraintext||"outside"===C.constraintext,q=i.getTextTransform(M(s,c,h,d,V,{isHorizontal:L,constrained:G,angle:C.textangle}))):(G="both"===C.constraintext||"inside"===C.constraintext,q=i.getTextTransform(A(s,c,h,d,V,{isHorizontal:L,constrained:G,angle:C.textangle,anchor:C.insidetextanchor}))),w(j,x,b).attr("transform",q)}else r.select("text").remove()}(t,e,I,r,b,z,R,F,B,d,x),e.layerClipId&&l.hideOutsideRangePoint(c,I.select("text"),T,E,h.xcalendar,h.ycalendar)}));var R=!1===h.cliponaxis;l.setClipUrl(c,R?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,C,e,d)},toMoveInsideBar:A,toMoveOutsideBar:M}},{"../../components/color":591,"../../components/drawing":612,"../../components/fx/helpers":626,"../../lib":716,"../../lib/svg_text_utils":740,"../../plots/cartesian/axes":764,"../../registry":845,"./attributes":855,"./constants":857,"./helpers":860,"./style":868,d3:164,"fast-isnumeric":227}],866:[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){h(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:d,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.extendFlat({},g(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):(h(r,a,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:m,getOutsideTextFont:y,getBarColor:b}},{"../../components/color":591,"../../components/drawing":612,"../../lib":716,"../../registry":845,"./attributes":855,"./helpers":860,d3:164}],869:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),a(t,"marker")&&i(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":591,"../../components/colorscale/defaults":601,"../../components/colorscale/helpers":602}],870:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../lib/extend").extendFlat,i=t("../scatterpolar/attributes"),o=t("../bar/attributes");e.exports={r:i.r,theta:i.theta,r0:i.r0,dr:i.dr,theta0:i.theta0,dtheta:i.dtheta,thetaunit:i.thetaunit,base:a({},o.base,{}),offset:a({},o.offset,{}),width:a({},o.width,{}),text:a({},o.text,{}),hovertext:a({},o.hovertext,{}),marker:o.marker,hoverinfo:i.hoverinfo,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../lib/extend":707,"../../plots/template_attributes":840,"../bar/attributes":855,"../scatterpolar/attributes":1184}],871:[function(t,e,r){"use strict";var n=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/calc"),i=t("../bar/arrays_to_calcdata"),o=t("../bar/cross_trace_calc").setGroupPositions,s=t("../scatter/calc_selection"),l=t("../../registry").traceIs,c=t("../../lib").extendFlat;e.exports={calc:function(t,e){for(var r=t._fullLayout,o=e.subplot,l=r[o].radialaxis,c=r[o].angularaxis,u=l.makeCalcdata(e,"r"),f=c.makeCalcdata(e,"theta"),p=e._length,h=new Array(p),d=u,g=f,v=0;vp.range[1]&&(x+=Math.PI),n.getClosest(c,(function(t){return g(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?v+Math.min(1,Math.abs(t.thetag1-t.thetag0)/m)-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 _=a.extendFlat({},b,{r:b.s,theta:b.p});return o(b,u,t),s(_,u,f,t),t.hovertemplate=u.hovertemplate,t.color=i(u,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":629,"../../lib":716,"../../plots/polar/helpers":827,"../bar/hover":861,"../scatterpolar/hover":1187}],874:[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"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":828,"../bar/select":866,"../bar/style":868,"../scatter/marker_colorbar":1134,"./attributes":870,"./calc":871,"./defaults":872,"./hover":873,"./layout_attributes":875,"./layout_defaults":876,"./plot":877}],875:[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"}}},{}],876:[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 f=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,a,c,u,f,e,r)}: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=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(a(o)&&a(s)&&a(h)&&a(d)&&o!==s&&h!==d){var g=u.c2g(t.s1),v=(h+d)/2;t.ct=[l.c2p(g*Math.cos(v)),c.c2p(g*Math.sin(v))],e=p(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":612,"../../lib":716,"../../plots/polar/helpers":827,d3:164,"fast-isnumeric":227}],878:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../bar/attributes"),i=t("../../components/color/attributes"),o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../lib/extend").extendFlat,l=n.marker,c=l.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"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),hovertemplate:o({}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:s({},l.symbol,{arrayOk:!1,editType:"plot"}),opacity:s({},l.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:s({},l.size,{arrayOk:!1,editType:"calc"}),color:s({},l.color,{arrayOk:!1,editType:"style"}),line:{color:s({},c.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:s({},c.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,offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":590,"../../lib/extend":707,"../../plots/template_attributes":840,"../bar/attributes":855,"../scatter/attributes":1117}],879:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=a._,o=t("../../plots/cartesian/axes");function s(t,e,r){var n={text:"tx",hovertext:"htx"};for(var a in n)Array.isArray(e[a])&&(t[n[a]]=e[a][r])}function l(t,e){return t.v-e.v}function c(t){return t.v}e.exports=function(t,e){var r,u,f,p,h,d=t._fullLayout,g=o.getFromId(t,e.xaxis||"x"),v=o.getFromId(t,e.yaxis||"y"),m=[],y="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(u=g,f="x",p=v,h="y"):(u=v,f="y",p=g,h="x");var x,b=u.makeCalcdata(e,f),_=function(t,e,r,i,o){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||a.isDateTime(t.name)&&"date"===r.type)?t.name:o;var l="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]);return i.map((function(){return l}))}(e,h,p,b,d[y]),w=a.distinctVals(_),k=w.vals,T=w.minDiff/2,A=function(t,e){for(var r=t.length,n=new Array(r+1),a=0;a=0&&Cx.uf};for(r=0;r0){var P=E[r].sort(l),I=P.map(c),D=I.length;(x={}).pos=k[r],x.pts=P,x[h]=x.pos,x[f]=x.pts.map((function(t){return t.v})),x.min=I[0],x.max=I[D-1],x.mean=a.mean(I,D),x.sd=a.stdev(I,D,x.mean),x.q1=a.interp(I,.25),x.med=a.interp(I,.5),x.q3=a.interp(I,.75),x.lf=Math.min(x.q1,I[Math.min(a.findBin(2.5*x.q1-1.5*x.q3,I,!0)+1,D-1)]),x.uf=Math.max(x.q3,I[Math.max(a.findBin(2.5*x.q3-1.5*x.q1,I),0)]),x.lo=4*x.q1-3*x.q3,x.uo=4*x.q3-3*x.q1;var z=1.57*(x.q3-x.q1)/Math.sqrt(D);x.ln=x.med-z,x.un=x.med+z,x.pts2=P.filter(O),m.push(x)}!function(t,e){if(a.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(m[0].t={num:d[y],dPos:T,posLetter:h,valLetter:f,labels:{med:i(t,"median:"),min:i(t,"min:"),q1:i(t,"q1:"),q3:i(t,"q3:"),max:i(t,"max:"),mean:"sd"===e.boxmean?i(t,"mean ± σ:"):i(t,"mean:"),lf:i(t,"lower fence:"),uf:i(t,"upper fence:")}},d[y]++,m):[{t:{empty:!0}}]}},{"../../lib":716,"../../plots/cartesian/axes":764,"fast-isnumeric":227}],880:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../plots/cartesian/axis_ids").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,f=e._fullLayout,p=o._id,h=p.charAt(0),d=[],g=0;for(s=0;s1,b=1-f[t+"gap"],_=1-f[t+"groupgap"];for(s=0;s0){var q=S.pointpos,G=S.jitter,W=S.marker.size/2,Y=0;q+G>=0&&((Y=U*(q+G))>M?(H=!0,j=W,B=Y):Y>R&&(j=W,B=M)),Y<=M&&(B=M);var X=0;q-G<=0&&((X=-U*(q-G))>E?(H=!0,V=W,N=X):X>F&&(V=W,N=E)),X<=E&&(N=E)}else B=M,N=E;var Z=new Array(c.length);for(l=0;lt.lo&&(_.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,l,c)}function u(t,e,r,i){var o,s,l=e.pos,c=e.val,u=i.bPos,f=i.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],s=i.bdPos[1]):(o=i.bdPos,s=i.bdPos);var h=t.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(t){var e=l.c2l(t.pos+u,!0),a=l.l2p(e)+f,i=l.l2p(e-o)+f,h=l.l2p(e+s)+f,d=c.c2p(t.mean,!0),g=c.c2p(t.mean-t.sd,!0),v=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+d+","+i+"V"+h+("sd"===p?"m0,0L"+g+","+a+"L"+d+","+i+"L"+v+","+a+"Z":"")):n.select(this).attr("d","M"+i+","+d+"H"+h+("sd"===p?"m0,0L"+a+","+g+"L"+i+","+d+"L"+a+","+v+"Z":""))}))}e.exports={plot:function(t,e,r,i){var o=e.xaxis,s=e.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(t){var e,r,a=n.select(this),i=t[0],f=i.t,p=i.trace;f.wdPos=f.bdPos*p.whiskerwidth,!0!==p.visible||f.empty?a.remove():("h"===p.orientation?(e=s,r=o):(e=o,r=s),l(a,{pos:e,val:r},p,f),c(a,{x:o,y:s},p,f),u(a,{pos:e,val:r},p,f))}))},plotBoxAndWhiskers:l,plotPoints:c,plotBoxMean:u}},{"../../components/drawing":612,"../../lib":716,d3:164}],888:[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,P=C>0?Math.ceil:Math.floor,I=C>0?Math.min:Math.max,D=C>0?Math.max:Math.min,z=O(E+L),R=P(S-L),F=[[f=M(E)]];for(i=z;i*C=0;a--)i[u-a]=t[f][a],o[u-a]=e[f][a];for(s.push({x:i,y:o,bicubic:l}),a=f,i=[],o=[];a>=0;a--)i[f-a]=t[a][0],o[f-a]=e[a][0];return s.push({x:i,y:o,bicubic:c}),s}},{}],902:[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,f,p,h,d,g,v,m,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],k=b._boundarylines=[],T=t["_"+r],A=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var M=t._xctrl,E=t._yctrl,S=M[0].length,C=M.length,L=t._a.length,O=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var P=b.smoothing?3:1;function I(n){var a,i,o,s,l,c,u,f,h,d,g,v,m=[],y=[],x={};if("b"===e)for(i=t.b2j(n),o=Math.floor(Math.max(0,Math.min(O-2,i))),s=i-o,x.length=O,x.crossLength=L,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),m.push(l[0]+h[0]/3),y.push(l[1]+h[1]/3),d=t.dxydi([],a-1,o,1,s),m.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),m.push(f[0]),y.push(f[1]),l=f;else for(a=t.a2i(n),c=Math.floor(Math.max(0,Math.min(L-2,a))),u=a-c,x.length=L,x.crossLength=O,x.xy=function(e){return t.evalxy([],a,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(g=t.dxydj([],c,i-1,u,0),m.push(l[0]+g[0]/3),y.push(l[1]+g[1]/3),v=t.dxydj([],c,i-1,u,1),m.push(f[0]-v[0]/3),y.push(f[1]-v[1]/3)),m.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=p,x.x=m,x.y=y,x.smoothing=A.smoothing,x}function D(n){var a,i,o,s,l,c=[],u=[],f={};if(f.length=x.length,f.crossLength=T.length,"b"===e)for(o=Math.max(0,Math.min(O-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)},a=0;ax.length-1||_.push(a(D(o),{color:b.gridcolor,width:b.gridwidth}));for(p=u;px.length-1||g<0||g>x.length-1))for(v=x[s],m=x[g],i=0;ix[x.length-1]||w.push(a(I(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&k.push(a(D(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(a(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],f=c[1],p=u;p<=f;p++)h=b.tick0+b.dtick*p,_.push(a(I(h),{color:b.gridcolor,width:b.gridwidth}));for(p=u-1;px[x.length-1]||w.push(a(I(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&k.push(a(I(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(a(I(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":707,"../../plots/cartesian/axes":764}],903:[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}}},{}],917:[function(t,e,r){"use strict";var n=t("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=t("../../constants/alignment");function f(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),f="M"+o(c,u,a.smoothing);n.select(this).attr("d",f).style("stroke-width",a.width).style("stroke",a.color).style("fill","none")})),u.exit().remove()}function p(t,e,r,i,o,c,u,f){var p=c.selectAll("text."+f).data(u);p.enter().append("text").classed(f,!0);var h=0,d={};return p.each((function(o,c){var u;if("auto"===o.axis.tickangle)u=s(i,e,r,o.xy,o.dxy);else{var f=(o.axis.tickangle+180)*Math.PI/180;u=s(i,e,r,o.xy,[Math.cos(f),Math.sin(f)])}c||(d={angle:u.angle,flip:u.flip});var p=(o.endAnchor?-1:1)*u.flip,g=n.select(this).attr({"text-anchor":p>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","translate("+u.p[0]+","+u.p[1]+") rotate("+u.angle+")translate("+o.axis.labelpadding*p+","+.3*v.height+")"),h=Math.max(h,v.width+o.axis.labelpadding)})),p.exit().remove(),d.maxExtent=h,d}e.exports=function(t,e,r,a){var l=e.xaxis,u=e.yaxis,h=t._fullLayout._clips;c.makeTraceGroups(a,r,"trace").each((function(e){var r=n.select(this),a=e[0],d=a.trace,v=d.aaxis,m=d.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",d.opacity),f(l,u,x,0,"a",v._gridlines),f(l,u,x,0,"b",m._gridlines),f(l,u,y,0,"a",v._minorgridlines),f(l,u,y,0,"b",m._minorgridlines),f(l,u,b,0,"a-boundary",v._boundarylines),f(l,u,b,0,"b-boundary",m._boundarylines);var w=p(t,l,u,d,0,_,v._labels,"a-label"),k=p(t,l,u,d,0,_,m._labels,"b-label");!function(t,e,r,n,a,i,o,l){var u,f,p,h,d=c.aggNums(Math.min,null,r.a),v=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+v),f=m,p=r.ab2xy(u,f,!0),h=r.dxyda_rough(u,f),void 0===o.angle&&c.extendFlat(o,s(r,a,i,p,r.dxydb_rough(u,f))),g(t,e,r,0,p,h,r.aaxis,a,i,o,"a-title"),u=d,f=.5*(m+y),p=r.ab2xy(u,f,!0),h=r.dxydb_rough(u,f),void 0===l.angle&&c.extendFlat(l,s(r,a,i,p,r.dxyda_rough(u,f))),g(t,e,r,0,p,h,r.baxis,a,i,l,"b-title")}(t,_,d,0,l,u,w,k),function(t,e,r,n,a){var s,l,u,f,p=r.select("#"+t._clipPathId);p.size()||(p=r.append("clipPath").classed("carpetclip",!0));var h=c.ensureSingle(p,"path","carpetboundary"),d=e.clipsegments,g=[];for(f=0;f90&&v<270,y=n.select(this);y.text(u.title.text).call(l.convertToTspans,t),m&&(x=(-l.lineCount(y)+d)*h*i-x),y.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+x+")").classed("user-select-none",!0).attr("text-anchor","middle").call(a.font,u.title.font)})),y.exit().remove()}},{"../../components/drawing":612,"../../constants/alignment":685,"../../lib":716,"../../lib/svg_text_utils":740,"./makepath":914,"./map_1d_array":915,"./orient_text":916,d3:164}],918:[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,f=t.aaxis,p=t.baxis,h=e[0],d=e[c-1],g=r[0],v=r[u-1],m=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=m*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;h-=x,d+=x,g-=b,v+=b,t.isVisible=function(t,e){return t>h&&tg&&ed||ev},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,f.smoothing,p.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,f.smoothing,p.smoothing),t.dxydi=s([t._xctrl,t._yctrl],f.smoothing,p.smoothing),t.dxydj=l([t._xctrl,t._yctrl],f.smoothing,p.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 f,p,h,d,g=0,v=0,m=[];ne[c-1]?(f=c-2,p=1,g=(n-e[c-1])/(e[c-1]-e[c-2])):p=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ar[u-1]?(h=u-2,d=1,v=(a-r[u-1])/(r[u-1]-r[u-2])):d=s-(h=Math.max(0,Math.min(u-2,Math.floor(s)))),g&&(t.dxydi(m,f,h,p,d),l[0]+=m[0]*g,l[1]+=m[1]*g),v&&(t.dxydj(m,f,h,p,d),l[0]+=m[0]*v,l[1]+=m[1]*v)}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=m*(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=y*(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":735,"./compute_control_points":906,"./constants":907,"./create_i_derivative_evaluator":908,"./create_j_derivative_evaluator":909,"./create_spline_evaluator":910}],919:[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 f(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",T,"after",A,"iterations"),t}},{"../../lib":716}],920:[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":716}],921:[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"},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()},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":590,"../../components/colorscale/attributes":598,"../../lib/extend":707,"../../plots/attributes":761,"../../plots/template_attributes":840,"../scattergeo/attributes":1156}],922:[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 f=0;f")}}(t,f,o,p.mockAxis),[t]}},{"../../lib":716,"../../plots/cartesian/axes":764,"./attributes":921}],926:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),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"],meta:{}}},{"../../plots/geo":794,"../heatmap/colorbar":1e3,"./attributes":921,"./calc":922,"./defaults":923,"./event_data":924,"./hover":925,"./plot":927,"./select":928,"./style":929}],927:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../lib/polygon"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("./style").style;function c(t,e){for(var r=t[0].trace,n=t.length,a=o(r,e),i=0;i0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===l||"FJI"===l?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 o=i.tester(r);o.pts.pop(),c.push(o)}:function(t){c.push(i.tester(t))},o.type){case"MultiPolygon":for(r=0;ro&&(o=c,e=l)}else e=r;return i.default(e).geometry.coordinates}(s),e.fIn=t,e.fOut=s,m.push(s)}else o.log(["Location with id",e.loc,"does not have a valid GeoJSON geometry,","choroplethmapbox traces only support *Polygon* and *MultiPolygon* geometries."].join(" "))}delete v[t.id]}switch(o.isArrayOrTypedArray(k.opacity)&&(x=function(t){var e=t.mo;return n(e)?+o.constrain(e,0,1):0}),o.isArrayOrTypedArray(T.color)&&(b=function(t){return t.mlc}),o.isArrayOrTypedArray(T.width)&&(_=function(t){return t.mlw}),d.type){case"FeatureCollection":var M=d.features;for(g=0;g=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":817,"./convert":931}],935:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l={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"]})};s(l,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(t){l[t]=i[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,e.exports=l},{"../../components/colorscale/attributes":598,"../../lib/extend":707,"../../plots/attributes":761,"../../plots/template_attributes":840,"../mesh3d/attributes":1058}],936:[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,c=0;co.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&&p===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(h[0],h[1]),p=Math.max(h[0],h[1]),fc&&(n.prefixBoundary=!0)}}}},{}],943:[function(t,e,r){"use strict";var n=t("../../components/colorscale").extractOpts,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 f=n(e);r._fillgradient=e.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:i(o),size:l}}}},{"../../components/colorscale":603,"./end_plus":951,"./make_color_map":956}],944:[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}}},{}],945:[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,f){var p,h,d,g=e.contours,v=r("contours.operation");g._operation=c[v],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),"="===v?p=g.showlines=!0:(p=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),p&&(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,f)}},{"../../components/color":591,"../../constants/filter_ops":688,"./label_defaults":955,"fast-isnumeric":227}],946:[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":688,"fast-isnumeric":227}],947:[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")}},{}],948:[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":716,"./constraint_mapping":946,"./end_plus":951}],951:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],952:[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,[n,i]}(f,r,e),h=[s(t,e,[-p[0],-p[1]])],d=t.z.length,g=t.z[0].length,v=e.slice(),m=p.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(p[0]||p[1])<0?0:1],t.crossings[u]=a.SADDLEREMAINDER[f]):delete t.crossings[u],!(p=a.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}h.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],u=e.join(","),i(h[h.length-1],h[h.length-2],o,l)&&h.pop();var y=p[0]&&(e[0]<0||e[0]>g-2)||p[1]&&(e[1]<0||e[1]>d-2);if(e[0]===v[0]&&e[1]===v[1]&&p[0]===m[0]&&p[1]===m[1]||r&&y)break;f=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,k,T,A,M,E,S,C,L,O,P,I,D=i(h[0],h[h.length-1],o,l),z=0,R=.2*t.smoothing,F=[],B=0;for(c=1;c=B;c--)if((x=F[c])=B&&x+F[b]M&&E--,t.edgepaths[E]=C.concat(h,S));break}U||(t.edgepaths[M]=h.concat(S))}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,i,o,s,l,c,u,f,p=t[0].z,h=p.length,d=p[0].length,g=2===h||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):a.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){a.log("unclosed perimeter path");break}p=s,(d=-1===h.indexOf(p))&&(p=h[0],f+="Z")}for(p=0;pn.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(f)+Math.cos(c)*o);if(p<1||h<1)return 1/0;var d=m.EDGECOST*(1/(p-1)+1/(h-1));d+=m.ANGLECOST*c*c;for(var g=s-u,v=l-f,y=s+u,x=l+f,b=0;b2*m.MAXCOST)break;h&&(s/=2),l=(o=c-s/2)+1.5*s}if(p<=m.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var a=e.width/2,i=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),f=a*u,p=i*c,h=a*c,d=-i*u,g=[[o-f-p,s-h-d],[o+f-p,s+h-d],[o+f+p,s+h+d],[o-f+p,s-h+d]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(g)},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,f=r.end,p=t._input.contours;u>f&&(r.start=p.start=f,f=r.end=p.end=u,u=r.start),r.size>0||(c=u===f?1:i(u,f,t.ncontours).dtick,p.size=r.size=c)}}},{"../../lib":716,"../../plots/cartesian/axes":764}],960:[function(t,e,r){"use strict";var n=t("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,f=!u&&"lines"===i.coloring,p=!u&&"fill"===i.coloring,h=f||p?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(a.lineGroupStyle,s.width,f?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||(f?h(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(p){var g;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===g&&(g=t.level),h(t.level+.5*l)})),void 0===g&&(g=c),e.selectAll("g.contourbg path").style("fill",h(g-.5*l))}})),i(t)}},{"../../components/drawing":612,"../heatmap/style":1009,"./make_color_map":956,d3:164}],961:[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":601,"./label_defaults":955}],962:[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":598,"../../lib/extend":707,"../contour/attributes":940,"../heatmap/attributes":997}],963:[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"),f=t("../carpet/lookup_carpetid"),p=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 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 g=function(t,e){var r,u,f,p,h,d,g,v=e._carpetTrace,m=v.aaxis,y=v.baxis;m._minDtick=0,y._minDtick=0,a.isArray1D(e.z)&&i(e,m,y,"a","b",["z"]),r=e._a=e._a||e.a,p=e._b=e._b||e.b,r=r?m.makeCalcdata(e,"_a"):[],p=p?y.makeCalcdata(e,"_b"):[],u=e.a0||0,f=e.da||1,h=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=a.maxRowLength(g),b="scaled"===e.xtype?"":r,_=c(e,b,u,f,x,m),w="scaled"===e.ytype?"":p,k=c(e,w,h,d,g.length,y),T={a:_,b:k,z:g};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:g,containerStr:"",cLetter:"z"}),[T]}(t,e);return p(e,e._z),g}}},{"../../components/colorscale/calc":599,"../../lib":716,"../carpet/lookup_carpetid":913,"../contour/set_contours":959,"../heatmap/clean_2d_array":999,"../heatmap/convert_column_xyz":1001,"../heatmap/find_empties":1003,"../heatmap/interp2d":1006,"../heatmap/make_bound_array":1007,"./defaults":964}],964:[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":716,"../contour/constraint_defaults":945,"../contour/contours_defaults":947,"../contour/style_defaults":961,"../heatmap/xyz_defaults":1011,"./attributes":962}],965:[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":775,"../contour/colorbar":943,"../contour/style":960,"./attributes":962,"./calc":963,"./defaults":964,"./plot":966}],966:[function(t,e,r){"use strict";var n=t("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"),f=t("../contour/constants"),p=t("../contour/convert_to_constraints"),h=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),g=t("../carpet/lookup_carpetid"),v=t("../carpet/axis_aligned_line");function m(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 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),k=r[0],T=k.trace,A=T._carpetTrace=g(t,T),M=t.calcdata[A.index][0];if(A.visible&&"legendonly"!==A.visible){var E=k.a,S=k.b,C=T.contours,L=h(C,e,k),O="constraint"===C.type,P=C._operation,I=O?"="===P?"lines":"fill":C.coloring,D=[[E[0],S[S.length-1]],[E[E.length-1],S[S.length-1]],[E[E.length-1],S[0]],[E[0],S[0]]];l(L);var z=1e-8*(E[E.length-1]-E[0]),R=1e-8*(S[S.length-1]-S[0]);c(L,z,R);var F,B,N,j,V=L;"constraint"===C.type&&(V=p(L,P)),function(t,e){var r,n,a,i,o,s,l,c,u;for(r=0;r=0;j--)F=M.clipsegments[j],B=a([],F.x,_.c2p),N=a([],F.y,w.c2p),B.reverse(),N.reverse(),U.push(i(B,N,F.bicubic));var H="M"+U.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,f,p,h=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);h.enter().append("path"),h.exit().remove();var d=[];for(p=0;p=0&&(p=C,d=g):Math.abs(f[1]-p[1])=0&&(p=C,d=g):s.log("endpt to newendpt is not vert. or horz.",f,p,C)}if(d>=0)break;y+=E(f,p),f=p}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(b=-1===x.indexOf(u))&&(u=x[0],y+=E(f,p)+"Z",f=null)}for(u=0;ug&&(n.max=g),n.len=n.max-n.min}function v(t,e){var r,n=0;return(Math.abs(t[0]-l)<.1||Math.abs(t[0]-c)<.1)&&(r=y(a.dxydb_rough(t[0],t[1],.1)),n=Math.max(n,i*x(e,r)/2)),(Math.abs(t[1]-u)<.1||Math.abs(t[1]-f)<.1)&&(r=y(a.dxyda_rough(t[0],t[1],.1)),n=Math.max(n,i*x(e,r)/2)),n}}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var a=Math.min(Math.ceil(n.len/P),f.LABELMAX),i=0;i0?+h[u]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:m},properties:y})}}var b=o.extractOpts(e),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)k.push(_[u][0],_[u][1]);var T=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return a.extendFlat(c.heatmap.paint,{"heatmap-weight":d?T:1/(b.max-b.min),"heatmap-color":k,"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":591,"../../components/colorscale":603,"../../constants/numerical":692,"../../lib":716,"../../lib/geojson_utils":711,"fast-isnumeric":227}],970:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}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"),a(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":601,"../../lib":716,"./attributes":967}],971:[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}},{}],972:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover");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=a.tickText(f,f.c2l(u.z),"hover").text}return s.extraText=function(t,e,r){if(!t.hovertemplate){var a=(e.hi||t.hoverinfo).split("+"),i=-1!==a.indexOf("all"),o=-1!==a.indexOf("lon"),s=-1!==a.indexOf("lat"),l=e.lonlat,c=[];return i||o&&s?c.push("("+u(l[0])+", "+u(l[1])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(i||-1!==a.indexOf("text"))&&n.fillText(e,t,c),c.join("
")}function u(t){return t+"°"}}(c,u,l[0].t.labels),[s]}}},{"../../lib":716,"../../plots/cartesian/axes":764,"../scattermapbox/hover":1180}],973:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),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,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":817,"./convert":969}],975:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),s.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;return n(a)?a:n(i)&&o?i:void 0}(c,f),[s]}}},{"../../components/color":591,"../../lib":716,"../bar/hover":861}],983:[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":775,"../bar/select":866,"./attributes":976,"./calc":977,"./cross_trace_calc":979,"./defaults":980,"./event_data":981,"./hover":982,"./layout_attributes":984,"./layout_defaults":985,"./plot":986,"./style":987}],984:[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"}}},{}],985:[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=l.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",l.selectedpoints&&!t.selected?o:1)}})),s(r,l,t),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 t=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":591,"../../components/drawing":612,"../../constants/interactions":691,"../bar/style":868,d3:164}],988:[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":707,"../../plots/attributes":761,"../../plots/domain":789,"../../plots/template_attributes":840,"../pie/attributes":1091}],989:[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":825}],990:[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":1093}],991:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText;e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,a,r,i)}var c,u=l("values"),f=n.isArrayOrTypedArray(u),p=l("labels");if(Array.isArray(p)?(c=p.length,f&&(c=Math.min(c,u.length))):f&&(c=u.length,l("label0"),l("dlabel")),c){e._length=c,l("marker.line.width")&&l("marker.line.color",s.paper_bgcolor),l("marker.colors"),l("scalegroup");var h,d=l("text"),g=l("texttemplate");if(g||(h=l("textinfo",Array.isArray(d)?"text+percent":"percent")),l("hovertext"),l("hovertemplate"),g||h&&"none"!==h){var v=l("textposition");o(t,e,s,l,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(e,s,l),l("title.text")&&(l("title.position"),n.coerceFont(l,"title.font",s.font)),l("aspectratio"),l("baseratio")}else e.visible=!1}},{"../../lib":716,"../../plots/domain":789,"../bar/defaults":859,"./attributes":988}],992:[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":1102,"./attributes":988,"./base_plot":989,"./calc":990,"./defaults":991,"./layout_attributes":993,"./layout_defaults":994,"./plot":995,"./style":996}],993:[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":1098}],994:[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":716,"./layout_attributes":993}],995:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../../lib"),o=t("../../lib/svg_text_utils"),s=t("../bar/plot").toMoveInsideBar,l=t("../pie/helpers"),c=t("../pie/plot"),u=c.attachFxHandlers,f=c.determineInsideTextFont,p=c.layoutAreas,h=c.prerenderTitles,d=c.positionTitleOutside;function g(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._fullLayout;h(e,t),p(e,r._size),i.makeTraceGroups(r._funnelarealayer,e,"trace").each((function(e){var p=n.select(this),h=e[0],v=h.trace;!function(t){if(t.length){var e=t[0],r=e.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o,s,l=Math.pow(a,2),c=e.vTotal,u=c,f=c*l/(1-l)/c,p=[];for(p.push(S()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var h=s.v/u;f+=h,p.push(S())}var d=1/0,g=-1/0;for(o=0;o-1;o--)if(!(s=t[o]).hidden){var M=p[A+=1][0],E=p[A][1];s.TL=[-M,E],s.TR=[M,E],s.BL=k,s.BR=T,s.pxmid=(_=s.TR,w=s.BR,[.5*(_[0]+w[0]),.5*(_[1]+w[1])]),k=s.TL,T=s.TR}}function S(){var t,e={x:t=Math.sqrt(f),y:-t};return[e.x,e.y]}}(e),p.each((function(){var p=n.select(this).selectAll("g.slice").data(e);p.enter().append("g").classed("slice",!0),p.exit().remove(),p.each((function(r){if(r.hidden)n.select(this).selectAll("path,g").remove();else{r.pointNumber=r.i,r.curveNumber=v.index;var p=h.cx,d=h.cy,m=n.select(this),y=m.selectAll("path.surface").data([r]);y.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),m.call(u,t,e);var x="M"+(p+r.TR[0])+","+(d+r.TR[1])+g(r.TR,r.BR)+g(r.BR,r.BL)+g(r.BL,r.TL)+"Z";y.attr("d",x),c.formatSliceLabel(t,r,h);var b=l.castOption(v.textposition,r.pts),_=m.selectAll("g.slicetext").data(r.text&&"none"!==b?[0]:[]);_.enter().append("g").classed("slicetext",!0),_.exit().remove(),_.each((function(){var e=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)}));e.text(r.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,f(v,r,t._fullLayout.font)).call(o.convertToTspans,t);var l,c,u,h=a.bBox(e.node()),g=Math.min(r.BL[1],r.BR[1]),m=Math.max(r.TL[1],r.TR[1]);c=Math.max(r.TL[0],r.BL[0]),u=Math.min(r.TR[0],r.BR[0]),l=i.getTextTransform(s(c,u,g,m,h,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})),e.attr("transform","translate("+p+","+d+")"+l)}))}}));var m=n.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);m.enter().append("g").classed("titletext",!0),m.exit().remove(),m.each((function(){var e=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),s=v.title.text;v._meta&&(s=i.templateString(s,v._meta)),e.text(s).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,v.title.font).call(o.convertToTspans,t);var l=d(h,r._size);e.attr("transform","translate("+l.x+","+l.y+")"+(l.scale<1?"scale("+l.scale+")":"")+"translate("+l.tx+","+l.ty+")")}))}))}))}},{"../../components/drawing":612,"../../lib":716,"../../lib/svg_text_utils":740,"../bar/plot":865,"../pie/helpers":1096,"../pie/plot":1100,d3:164}],996:[function(t,e,r){"use strict";var n=t("d3"),a=t("../pie/style_one");e.exports=function(t){t._fullLayout._funnelarealayer.selectAll(".trace").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)}))}))}},{"../pie/style_one":1102,d3:164}],997:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../components/colorscale/attributes"),o=(t("../../constants/docs").FORMAT_LINK,t("../../lib/extend").extendFlat);e.exports=o({z:{valType:"data_array",editType:"calc"},x:o({},n.x,{impliedEdits:{xtype:"array"}}),x0:o({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:o({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:o({},n.y,{impliedEdits:{ytype:"array"}}),y0:o({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:o({},n.dy,{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"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:a()},{transforms:void 0},i("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":598,"../../constants/docs":687,"../../lib/extend":707,"../../plots/template_attributes":840,"../scatter/attributes":1117}],998:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),l=t("./convert_column_xyz"),c=t("./clean_2d_array"),u=t("./interp2d"),f=t("./find_empties"),p=t("./make_bound_array");e.exports=function(t,e){var r,h,d,g,v,m,y,x,b,_=i.getFromId(t,e.xaxis||"x"),w=i.getFromId(t,e.yaxis||"y"),k=n.traceIs(e,"contour"),T=n.traceIs(e,"histogram"),A=n.traceIs(e,"gl2d"),M=k?"best":e.zsmooth;if(_._minDtick=0,w._minDtick=0,T)r=(b=o(t,e)).x,h=b.x0,d=b.dx,g=b.y,v=b.y0,m=b.dy,y=b.z;else{var E=e.z;a.isArray1D(E)?(l(e,_,w,"x","y",["z"]),r=e._x,g=e._y,E=e._z):(r=e._x=e.x?_.makeCalcdata(e,"x"):[],g=e._y=e.y?w.makeCalcdata(e,"y"):[]),h=e.x0,d=e.dx,v=e.y0,m=e.dy,y=c(E,e,_,w),(k||e.connectgaps)&&(e._emptypoints=f(y),u(y,e._emptypoints))}function S(t){M=e._input.zsmooth=e.zsmooth=!1,a.warn('cannot use zsmooth: "fast": '+t)}if("fast"===M)if("log"===_.type||"log"===w.type)S("log axis found");else if(!T){if(r.length){var C=(r[r.length-1]-r[0])/(r.length-1),L=Math.abs(C/100);for(x=0;xL){S("x scale is not linear");break}}if(g.length&&"fast"===M){var O=(g[g.length-1]-g[0])/(g.length-1),P=Math.abs(O/100);for(x=0;xP){S("y scale is not linear");break}}}var I=a.maxRowLength(y),D="scaled"===e.xtype?"":r,z=p(e,D,h,d,I,_),R="scaled"===e.ytype?"":g,F=p(e,R,v,m,y.length,w);A||(e._extremes[_._id]=i.findExtremes(_,z),e._extremes[w._id]=i.findExtremes(w,F));var B={x:z,y:F,z:y,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(D&&D.length===z.length-1&&(B.xCenter=D),R&&R.length===F.length-1&&(B.yCenter=R),T&&(B.xRanges=b.xRanges,B.yRanges=b.yRanges,B.pts=b.pts),k||s(t,e,{vals:y,cLetter:"z"}),k&&e.contours&&"heatmap"===e.contours.coloring){var N={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};B.xfill=p(N,D,h,d,I,_),B.yfill=p(N,R,v,m,y.length,w)}return[B]}},{"../../components/colorscale/calc":599,"../../lib":716,"../../plots/cartesian/axes":764,"../../registry":845,"../histogram2d/calc":1029,"./clean_2d_array":999,"./convert_column_xyz":1001,"./find_empties":1003,"./interp2d":1006,"./make_bound_array":1007}],999:[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,f,p;function h(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(i=p[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],p.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],u.push(l[i])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":716}],1004:[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,c){var u,f,p,h,d=t.cd[0],g=d.trace,v=t.xa,m=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,k=d.zmask,T=g.zhoverformat,A=y,M=x;if(!1!==t.index){try{p=Math.round(t.index[1]),h=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>=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(c){var E;for(A=[2*y[0]-y[1]],E=1;Eg&&(m=Math.max(m,Math.abs(t[i][o]-d)/(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":716}],1007:[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,f=[],p=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 g=e.length;if(!(g<=o))return p?e.slice(0,o):e.slice(0,o+1);if(p||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;)p=h.c2p(k[y]),y--;for(p0;)m=d.c2p(T[y]),y--;if(m0&&(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,p=-.1*e,h=t-p,d=r[0],g=r[1],v=Math.min(f(d+p,d+h,n,i),f(g+p,g+h,n,i)),m=Math.min(f(d+c,d+p,n,i),f(g+c,g+p,n,i));if(v>m&&mo){var y=s===a?1:6,x=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 c=n.d2c(o,0,i);if(cr.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,h)),D.start=r.l2r(j),F||a.nestedProperty(e,m+".start").set(D.start)}var V=b.end,U=r.r2l(I.end),H=void 0!==U;if((b.endFound||H)&&U!==r.r2l(V)){var q=H?U:a.aggNums(Math.max,null,d);D.end=r.l2r(q),H||a.nestedProperty(e,m+".start").set(D.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[m]=a.extendFlat({},e[m]||{}),delete e._input[G],delete e[G]),[D,d]}e.exports={calc:function(t,e){var r,i,h,d,g=[],v=[],m=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=p(t,e,m,y),k=w[0],T=w[1],A="string"==typeof k.size,M=[],E=A?M:k,S=[],C=[],L=[],O=0,P=e.histnorm,I=e.histfunc,D=-1!==P.indexOf("density");_.enabled&&D&&(P=P.replace(/ ?density$/,""),D=!1);var z,R="max"===I||"min"===I?null:0,F=l.count,B=c[P],N=!1,j=function(t){return m.r2c(t,0,b)};for(a.isArrayOrTypedArray(e[x])&&"count"!==I&&(z=e[x],N="avg"===I,F=l[I]),r=j(k.start),h=j(k.end)+(r-o.tickIncrement(r,k.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())}}(v,_.direction,_.currentbin);var X=Math.min(g.length,v.length),Z=[],J=0,K=X-1;for(r=0;r=J;r--)if(v[r]){K=r;break}for(r=J;r<=K;r++)if(n(g[r])&&n(v[r])){var $={p:g[r],s:v[r],b:0};_.enabled||($.pts=L[r],H?$.ph0=$.ph1=L[r].length?T[L[r][0]]:g[r]:($.ph0=V(M[r]),$.ph1=V(M[r+1],!0))),Z.push($)}return 1===Z.length&&(Z[0].width1=o.tickIncrement(Z[0].p,k.size,!1,b)-Z[0].p),s(Z,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(Z,e,W),Z},calcAllAutoBins:p}},{"../../lib":716,"../../plots/cartesian/axes":764,"../../registry":845,"../bar/arrays_to_calcdata":854,"./average":1016,"./bin_functions":1018,"./bin_label_vals":1019,"./norm_functions":1027,"fast-isnumeric":227}],1021:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],1022:[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=a.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,p,h,d,g,v,m=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 k(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=m[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&&(m[r]={traces:[t],dirs:[i],axType:s,calendar:t[i+"calendar"]||""}),t["_"+i+"bingroup"]=r}for(d=0;dE&&k.splice(E,k.length-E),M.length>E&&M.splice(E,M.length-E);var S=[],C=[],L=[],O="string"==typeof w.size,P="string"==typeof A.size,I=[],D=[],z=O?I:w,R=P?D:A,F=0,B=[],N=[],j=e.histnorm,V=e.histfunc,U=-1!==j.indexOf("density"),H="max"===V||"min"===V?null:0,q=i.count,G=o[j],W=!1,Y=[],X=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==V&&(W="avg"===V,q=i[V]);var J=w.size,K=x(w.start),$=x(w.end)+(K-a.tickIncrement(K,J,!1,m))/1e6;for(r=K;r<$;r=a.tickIncrement(r,J,!1,m))C.push(H),I.push(r),W&&L.push(0);I.push(r);var Q,tt=C.length,et=(r-K)/tt,rt=(Q=K+et/2,g.c2r(Q,0,m)),nt=A.size,at=b(A.start),it=b(A.end)+(at-a.tickIncrement(at,nt,!1,y))/1e6;for(r=at;r=0&&h=0&&d0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u=Math.floor((e-o.x0)/s.dx),f=Math.floor(Math.abs(r-o.y0)/s.dy);if(o.z[f][u]){var p,h=o.hi||s.hoverinfo;if(h){var d=h.split("+");-1!==d.indexOf("all")&&(d=["color"]),-1!==d.indexOf("color")&&(p=!0)}var g,v=s.colormodel,m=v.length,y=s._scaler(o.z[f][u]),x=i.colormodel[v].suffix,b=[];(s.hovertemplate||p)&&(b.push("["+[y[0]+x[0],y[1]+x[1],y[2]+x[2]].join(", ")),4===m&&b.push(", "+y[3]+x[3]),b.push("]"),b=b.join(""),t.extraText=v.toUpperCase()+": "+b),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[f])?g=s.hovertext[f][u]:Array.isArray(s.text)&&Array.isArray(s.text[f])&&(g=s.text[f][u]);var _=c.c2p(o.y0+(f+.5)*s.dy),w=o.x0+(u+.5)*s.dx,k=o.y0+(f+.5)*s.dy,T="["+o.z[f][u].slice(0,s.colormodel.length).join(", ")+"]";return[a.extendFlat(t,{index:[f,u],x0:l.c2p(o.x0+u*s.dx),x1:l.c2p(o.x0+(u+1)*s.dx),y0:_,y1:_,color:y,xVal:w,xLabelVal:w,yVal:k,yLabelVal:k,zLabelVal:T,text:g,hovertemplateLabels:{zLabel:T,colorLabel:b,"color[0]Label":y[0]+x[0],"color[1]Label":y[1]+x[1],"color[2]Label":y[2]+x[2],"color[3]Label":y[3]+x[3]}})]}}}},{"../../components/fx":629,"../../lib":716,"./constants":1039}],1043:[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":775,"./attributes":1037,"./calc":1038,"./defaults":1040,"./event_data":1041,"./hover":1042,"./plot":1044,"./style":1045}],1044:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../constants/xmlns_namespaces"),o=t("./constants");e.exports=function(t,e,r,s){var l=e.xaxis,c=e.yaxis;a.makeTraceGroups(s,r,"im").each((function(t){var e,r,s,u,f,p,h=n.select(this),d=t[0],g=d.trace,v=d.z,m=d.x0,y=d.y0,x=d.w,b=d.h,_=g.dx,w=g.dy;for(p=0;void 0===e&&p0;)r=l.c2p(m+p*_),p--;for(p=0;void 0===u&&p0;)f=c.c2p(y+p*w),p--;r0}function x(t){t.each((function(t){d.stroke(n.select(this),t.line.color)})).each((function(t){d.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function b(t,e,r){var n=t._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),o={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return a.coerce(i,o,h,t,e)}return f(i,o,l,s,n),p(i,o,l,s),o}function _(t,e){return"translate("+t+","+e+")"}function w(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function k(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(c.convertToTspans,a).call(s.font,e),s.bBox(o.node())}function T(t,e,r,n,i,o){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=a.aggNums(o,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,f){var p,h=t._fullLayout;y(r)&&f&&(p=f()),a.makeTraceGroups(h._indicatorlayer,e,"trace").each((function(e){var f,A,M,E,S,C=e[0].trace,L=n.select(this),O=C._hasGauge,P=C._isAngular,I=C._isBullet,D=C.domain,z={w:h._size.w*(D.x[1]-D.x[0]),h:h._size.h*(D.y[1]-D.y[0]),l:h._size.l+h._size.w*D.x[0],r:h._size.r+h._size.w*(1-D.x[1]),t:h._size.t+h._size.h*(1-D.y[1]),b:h._size.b+h._size.h*D.y[0]},R=z.l+z.w/2,F=z.t+z.h/2,B=Math.min(z.w/2,z.h),N=l.innerRadius*B,j=C.align||"center";if(A=F,O){if(P&&(f=R,A=F+B/2,M=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*N)}),I){var V=l.bulletPadding,U=1-l.bulletNumberDomainSize+V;f=z.l+(U+(1-U)*v[j])*z.w,M=function(t){return w(t,(l.bulletNumberDomainSize-V)*z.w,z.h)}}}else f=z.l+v[j]*z.w,M=function(t){return w(t,z.w,z.h)};!function(t,e,r,i){var o,l,f,p=r[0].trace,h=i.numbersX,x=i.numbersY,w=p.align||"center",A=g[w],M=i.transitionOpts,E=i.onComplete,S=a.ensureSingle(e,"g","numbers"),C=[];p._hasNumber&&C.push("number"),p._hasDelta&&(C.push("delta"),"left"===p.delta.position&&C.reverse());var L=S.selectAll("text").data(C);function O(e,r,n,a){if(!e.match("s")||n>=0==a>=0||r(n).slice(-1).match(m)||r(a).slice(-1).match(m))return r;var i=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=b(t,{tickformat:i});return function(t){return Math.abs(t)<1?u.tickText(o,t).text:r(t)}}L.enter().append("text"),L.attr("text-anchor",(function(){return A})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),L.exit().remove();var P,I=p.mode+p.align;if(p._hasDelta&&(P=function(){var e=b(t,{tickformat:p.delta.valueformat},p._range);e.setScale(),u.prepTicks(e);var a=function(t){return u.tickText(e,t).text},i=function(t){return p.delta.relative?t.relativeDelta:t.delta},o=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?p.delta.increasing.symbol:p.delta.decreasing.symbol)+e(t)},f=function(t){return t.delta>=0?p.delta.increasing.color:p.delta.decreasing.color};void 0===p._deltaLastValue&&(p._deltaLastValue=i(r[0]));var h=S.select("text.delta");function g(){h.text(o(i(r[0]),a)).call(d.fill,f(r[0])).call(c.convertToTspans,t)}return h.call(s.font,p.delta.font).call(d.fill,f({delta:p._deltaLastValue})),y(M)?h.transition().duration(M.duration).ease(M.easing).tween("text",(function(){var t=n.select(this),e=i(r[0]),s=p._deltaLastValue,l=O(p.delta.valueformat,a,s,e),c=n.interpolateNumber(s,e);return p._deltaLastValue=e,function(e){t.text(o(c(e),l)),t.call(d.fill,f({delta:c(e)}))}})).each("end",(function(){g(),E&&E()})).each("interrupt",(function(){g(),E&&E()})):g(),l=k(o(i(r[0]),a),p.delta.font,A,t),h}(),I+=p.delta.position+p.delta.font.size+p.delta.font.family+p.delta.valueformat,I+=p.delta.increasing.symbol+p.delta.decreasing.symbol,f=l),p._hasNumber&&(function(){var e=b(t,{tickformat:p.number.valueformat},p._range);e.setScale(),u.prepTicks(e);var a=function(t){return u.tickText(e,t).text},i=p.number.suffix,l=p.number.prefix,f=S.select("text.number");function h(){var e="number"==typeof r[0].y?l+a(r[0].y)+i:"-";f.text(e).call(s.font,p.number.font).call(c.convertToTspans,t)}y(M)?f.transition().duration(M.duration).ease(M.easing).each("end",(function(){h(),E&&E()})).each("interrupt",(function(){h(),E&&E()})).attrTween("text",(function(){var t=n.select(this),e=n.interpolateNumber(r[0].lastY,r[0].y);p._lastValue=r[0].y;var o=O(p.number.valueformat,a,r[0].lastY,r[0].y);return function(r){t.text(l+o(e(r))+i)}})):h(),o=k(l+a(r[0].y)+i,p.number.font,A,t)}(),I+=p.number.font.size+p.number.font.family+p.number.valueformat+p.number.suffix+p.number.prefix,f=o),p._hasDelta&&p._hasNumber){var D,z,R=[(o.left+o.right)/2,(o.top+o.bottom)/2],F=[(l.left+l.right)/2,(l.top+l.bottom)/2],B=.75*p.delta.font.size;"left"===p.delta.position&&(D=T(p,"deltaPos",0,-1*(o.width*v[p.align]+l.width*(1-v[p.align])+B),I,Math.min),z=R[1]-F[1],f={width:o.width+l.width+B,height:Math.max(o.height,l.height),left:l.left+D,right:o.right,top:Math.min(o.top,l.top+z),bottom:Math.max(o.bottom,l.bottom+z)}),"right"===p.delta.position&&(D=T(p,"deltaPos",0,o.width*(1-v[p.align])+l.width*v[p.align]+B,I,Math.max),z=R[1]-F[1],f={width:o.width+l.width+B,height:Math.max(o.height,l.height),left:o.left,right:l.right+D,top:Math.min(o.top,l.top+z),bottom:Math.max(o.bottom,l.bottom+z)}),"bottom"===p.delta.position&&(D=null,z=l.height,f={width:Math.max(o.width,l.width),height:o.height+l.height,left:Math.min(o.left,l.left),right:Math.max(o.right,l.right),top:o.bottom-o.height,bottom:o.bottom+l.height}),"top"===p.delta.position&&(D=null,z=o.top,f={width:Math.max(o.width,l.width),height:o.height+l.height,left:Math.min(o.left,l.left),right:Math.max(o.right,l.right),top:o.bottom-o.height-l.height,bottom:o.bottom}),P.attr({dx:D,dy:z})}(p._hasNumber||p._hasDelta)&&S.attr("transform",(function(){var t=i.numbersScaler(f);I+=t[2];var e,r=T(p,"numbersScale",1,t[0],I,Math.min);p._scaleNumbers||(r=1),e=p._isAngular?x-r*f.bottom:x-r*(f.top+f.bottom)/2,p._numbersTop=r*f.top+e;var n=f[w];"center"===w&&(n=(f.left+f.right)/2);var a=h-r*n;return _(a=T(p,"numbersTranslate",0,a,I,Math.max),e)+" scale("+r+")"}))}(t,L,e,{numbersX:f,numbersY:A,numbersScaler:M,transitionOpts:r,onComplete:p}),O&&(E={range:C.gauge.axis.range,color:C.gauge.bgcolor,line:{color:C.gauge.bordercolor,width:0},thickness:1},S={range:C.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:C.gauge.bordercolor,width:C.gauge.borderwidth},thickness:1});var H=L.selectAll("g.angular").data(P?e:[]);H.exit().remove();var q=L.selectAll("g.angularaxis").data(P?e:[]);q.exit().remove(),P&&function(t,e,r,a){var s,l,c,f,p=r[0].trace,h=a.size,d=a.radius,g=a.innerRadius,v=a.gaugeBg,m=a.gaugeOutline,w=[h.l+h.w/2,h.t+h.h/2+d/2],k=a.gauge,T=a.layer,A=a.transitionOpts,M=a.onComplete,E=Math.PI/2;function S(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((g+d)/2-t/2*(d-g)).outerRadius((g+d)/2+t/2*(d-g)).startAngle(-E)}function L(t){t.attr("d",(function(t){return C(t.thickness).startAngle(S(t.range[0])).endAngle(S(t.range[1]))()}))}k.enter().append("g").classed("angular",!0),k.attr("transform",_(w[0],w[1])),T.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),T.selectAll("g.xangularaxistick,path,text").remove(),(s=b(t,p.gauge.axis)).type="linear",s.range=p.gauge.axis.range,s._id="xangularaxis",s.setScale();var O=function(t){return(s.range[0]-t.x)/(s.range[1]-s.range[0])*Math.PI+Math.PI},P={},I=u.makeLabelFns(s,0).labelStandoff;P.xFn=function(t){var e=O(t);return Math.cos(e)*I},P.yFn=function(t){var e=O(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(I+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*o)},P.anchorFn=function(t){var e=O(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},P.heightFn=function(t,e,r){var n=O(t);return-.5*(1+Math.sin(n))*r};var D=function(t){return _(w[0]+d*Math.cos(t),w[1]-d*Math.sin(t))};if(c=function(t){return D(O(t))},l=u.calcTicks(s),f=u.getTickSigns(s)[2],s.visible){f="inside"===s.ticks?-1:1;var z=(s.linewidth||1)/2;u.drawTicks(t,s,{vals:l,layer:T,path:"M"+f*z+",0h"+f*s.ticklen,transFn:function(t){var e=O(t);return D(e)+"rotate("+-i(e)+")"}}),u.drawLabels(t,s,{vals:l,layer:T,transFn:c,labelFns:P})}var R=[v].concat(p.gauge.steps),F=k.selectAll("g.bg-arc").data(R);F.enter().append("g").classed("bg-arc",!0).append("path"),F.select("path").call(L).call(x),F.exit().remove();var B=C(p.gauge.bar.thickness),N=k.selectAll("g.value-arc").data([p.gauge.bar]);N.enter().append("g").classed("value-arc",!0).append("path");var j,V,U,H=N.select("path");y(A)?(H.transition().duration(A.duration).ease(A.easing).each("end",(function(){M&&M()})).each("interrupt",(function(){M&&M()})).attrTween("d",(j=B,V=S(r[0].lastY),U=S(r[0].y),function(){var t=n.interpolate(V,U);return function(e){return j.endAngle(t(e))()}})),p._lastValue=r[0].y):H.attr("d","number"==typeof r[0].y?B.endAngle(S(r[0].y)):"M0,0Z"),H.call(x),N.exit().remove(),R=[];var q=p.gauge.threshold.value;q&&R.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=k.selectAll("g.threshold-arc").data(R);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(L).call(x),G.exit().remove();var W=k.selectAll("g.gauge-outline").data([m]);W.enter().append("g").classed("gauge-outline",!0).append("path"),W.select("path").call(L).call(x),W.exit().remove()}(t,0,e,{radius:B,innerRadius:N,gauge:H,layer:q,size:z,gaugeBg:E,gaugeOutline:S,transitionOpts:r,onComplete:p});var G=L.selectAll("g.bullet").data(I?e:[]);G.exit().remove();var W=L.selectAll("g.bulletaxis").data(I?e:[]);W.exit().remove(),I&&function(t,e,r,n){var a,i,o,s,c,f=r[0].trace,p=n.gauge,h=n.layer,g=n.gaugeBg,v=n.gaugeOutline,m=n.size,_=f.domain,w=n.transitionOpts,k=n.onComplete;p.enter().append("g").classed("bullet",!0),p.attr("transform","translate("+m.l+", "+m.t+")"),h.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),h.selectAll("g.xbulletaxistick,path,text").remove();var T=m.h,A=f.gauge.bar.thickness*T,M=_.x[0],E=_.x[0]+(_.x[1]-_.x[0])*(f._hasNumber||f._hasDelta?1-l.bulletNumberDomainSize:1);function S(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)*T})).attr("height",(function(t){return t.thickness*T}))}(a=b(t,f.gauge.axis))._id="xbulletaxis",a.domain=[M,E],a.setScale(),i=u.calcTicks(a),o=u.makeTransFn(a),s=u.getTickSigns(a)[2],c=m.t+m.h,a.visible&&(u.drawTicks(t,a,{vals:"inside"===a.ticks?u.clipEnds(a,i):i,layer:h,path:u.makeTickPath(a,c,s),transFn:o}),u.drawLabels(t,a,{vals:i,layer:h,transFn:o,labelFns:u.makeLabelFns(a,c)}));var C=[g].concat(f.gauge.steps),L=p.selectAll("g.bg-bullet").data(C);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(S).call(x),L.exit().remove();var O=p.selectAll("g.value-bullet").data([f.gauge.bar]);O.enter().append("g").classed("value-bullet",!0).append("rect"),O.select("rect").attr("height",A).attr("y",(T-A)/2).call(x),y(w)?O.select("rect").transition().duration(w.duration).ease(w.easing).each("end",(function(){k&&k()})).each("interrupt",(function(){k&&k()})).attr("width",Math.max(0,a.c2p(Math.min(f.gauge.axis.range[1],r[0].y)))):O.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(f.gauge.axis.range[1],r[0].y))):0),O.exit().remove();var P=r.filter((function(){return f.gauge.threshold.value})),I=p.selectAll("g.threshold-bullet").data(P);I.enter().append("g").classed("threshold-bullet",!0).append("line"),I.select("line").attr("x1",a.c2p(f.gauge.threshold.value)).attr("x2",a.c2p(f.gauge.threshold.value)).attr("y1",(1-f.gauge.threshold.thickness)/2*T).attr("y2",(1-(1-f.gauge.threshold.thickness)/2)*T).call(d.stroke,f.gauge.threshold.line.color).style("stroke-width",f.gauge.threshold.line.width),I.exit().remove();var D=p.selectAll("g.gauge-outline").data([v]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(S).call(x),D.exit().remove()}(t,0,e,{gauge:G,layer:W,size:z,gaugeBg:E,gaugeOutline:S,transitionOpts:r,onComplete:p});var Y=L.selectAll("text.title").data(e);Y.exit().remove(),Y.enter().append("text").classed("title",!0),Y.attr("text-anchor",(function(){return I?g.right:g[C.title.align]})).text(C.title.text).call(s.font,C.title.font).call(c.convertToTspans,t),Y.attr("transform",(function(){var t,e=z.l+z.w*v[C.title.align],r=l.titlePadding,n=s.bBox(Y.node());return O?(P&&(t=C.gauge.axis.visible?s.bBox(q.node()).top-r-n.bottom:z.t+z.h/2-B/2-n.bottom-r),I&&(t=A-(n.top+n.bottom)/2,e=z.l-l.bulletPadding*z.w)):t=C._numbersTop-r-n.bottom,_(e,t)}))}))}},{"../../components/color":591,"../../components/drawing":612,"../../constants/alignment":685,"../../lib":716,"../../lib/svg_text_utils":740,"../../plots/cartesian/axes":764,"../../plots/cartesian/axis_defaults":766,"../../plots/cartesian/layout_attributes":776,"../../plots/cartesian/position_defaults":779,"./constants":1049,d3:164}],1053:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,c=e.exports=l(s({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()},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,lightposition:i.lightposition,lighting:i.lighting,flatshading:i.flatshading,contour:i.contour,hoverinfo:s({},o.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":598,"../../lib/extend":707,"../../plot_api/edit_types":747,"../../plots/attributes":761,"../../plots/template_attributes":840,"../mesh3d/attributes":1058}],1054:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length);for(var r=1/0,a=-1/0,i=e.value.length,o=0;o0;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 R(e,r,n){C();var a,i,o,s=[r],l=[n];if(k>=1)s=[r],l=[n];else if(k>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[h]:S(d,g,v);p[h]=y>-1?y:O(d,g,v,z(e,m))}a=p[0],i=p[1],o=p[2],t._i.push(a),t._j.push(i),t._k.push(o),++f}}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 N(t){var e=.001*(E-M);return t>=M-e&&t<=E+e}function j(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}var V=3;function U(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 N(e[0][3])&&N(e[1][3])&&N(e[2][3])?(R(t,e,r),!0):iMath.abs(k-A)?[T,k]:[k,A];Q(e,S[0],S[1])}}var C=[[Math.min(M,A),Math.max(M,A)],[Math.min(T,E),Math.max(T,E)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(c.push(x.id),"x"===e?f.push([x.distRatio,0,0]):"y"===e?f.push([0,x.distRatio,0]):f.push([0,0,x.distRatio]))}else l=nt(1,"x"===e?g-1:"y"===e?v-1:m-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++),l.length>0&&(r[a]="x"===e?Z(null,l,i,o,r[a]):"y"===e?J(null,l,i,o,r[a]):K(null,l,i,o,r[a]),a++)}var b=t.caps[e];b.show&&b.fill&&(I(b.fill),r[a]="x"===e?Z(null,[0,g-1],i,o,r[a]):"y"===e?J(null,[0,v-1],i,o,r[a]):K(null,[0,m-1],i,o,r[a]),a++)}})),0===f&&L(),t._x=x,t._y=b,t._z=_,t._intensity=w,t._Xs=p,t._Ys=h,t._Zs=d}(),t}p.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._x[e],n=this.data._y[e],a=this.data._z[e],i=this.data._Ys.length,o=this.data._Zs.length,s=u(r,this.data._Xs).id,l=u(n,this.data._Ys).id,c=u(a,this.data._Zs).id,f=t.index=c+o*l+o*i*s;t.traceCoordinate=[this.data._x[f],this.data._y[f],this.data._z[f],this.data.value[f]];var p=this.data.hovertext||this.data.text;return Array.isArray(p)&&void 0!==p[f]?t.textLabel=p[f]:p&&(t.textLabel=p),!0}},p.update=function(t){var e=this.scene,r=e.fullSceneLayout;function n(t,e,r,n){return e.map((function(e){return t.d2l(e,0,n)*r}))}this.data=h(t);var a={positions:l(n(r.xaxis,t._x,e.dataScale[0],t.xcalendar),n(r.yaxis,t._y,e.dataScale[1],t.ycalendar),n(r.zaxis,t._z,e.dataScale[2],t.zcalendar)),cells:l(t._i,t._j,t._k),lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:o(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},c=s(t);a.vertexIntensity=t._intensity,a.vertexIntensityBounds=[c.min,c.max],a.colormap=i(t),this.mesh.update(a)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports={findNearestOnAxis:u,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,a=n({gl:r}),i=new f(t,a,e.uid);return a._trace=i,i.update(e),t.glplot.add(a),i}}},{"../../components/colorscale":603,"../../lib":716,"../../lib/gl_format_color":713,"../../lib/str2rgbarray":739,"../../plots/gl3d/zip3":815,"gl-mesh3d":282}],1056:[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 c=i("x"),u=i("y"),f=i("z"),p=i("value");c&&c.length&&u&&u.length&&f&&f.length&&p&&p.length?(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),["x","y","z"].forEach((function(t){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,0,a,(function(r,a){return n.coerce(t,e,i,r,a)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":601,"../../lib":716,"../../registry":845,"./attributes":1053}],1057:[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"],meta:{}}},{"../../plots/gl3d":804,"./attributes":1053,"./calc":1054,"./convert":1055,"./defaults":1056}],1058:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../surface/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({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"}),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",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:i.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},i.contours.x.show,{}),color:i.contours.x.color,width:i.contours.x.width,editType:"calc"},lightposition:{x:s({},i.lightposition.x,{dflt:1e5}),y:s({},i.lightposition.y,{dflt:1e5}),z:s({},i.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({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"},i.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"})})},{"../../components/colorscale/attributes":598,"../../lib/extend":707,"../../plots/attributes":761,"../../plots/template_attributes":840,"../surface/attributes":1231}],1059:[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":599}],1060:[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"),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 p=f.prototype;function h(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}p.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;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}},p.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,p=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||!v(t.i,f)||!v(t.j,f)||!v(t.k,f))return;n=u(g(t.i),g(t.j),g(t.k))}else n=0===t.alphahull?o(p):t.alphahull>0?i(t.alphahull,p):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],i=e.length,o=0;ov):g=k>b,v=k;var T=l(b,_,w,k);T.pos=x,T.yc=(b+k)/2,T.i=y,T.dir=g?"increasing":"decreasing",T.x=T.pos,T.y=[w,_],h&&(T.tx=e.text[y]),d&&(T.htx=e.hovertext[y]),m.push(T)}else m.push({pos:x,empty:!0})}return e._extremes[s._id]=i.findExtremes(s,n.concat(f,u),{padded:!0}),m.length&&(m[0].t={labels:{open:a(t,"open:")+" ",high:a(t,"high:")+" ",low:a(t,"low:")+" ",close:a(t,"close:")+" "}}),m}e.exports={calc:function(t,e){var r=i.getFromId(t,e.xaxis),a=i.getFromId(t,e.yaxis),o=function(t,e,r){var a=r._minDiff;if(!a){var i,o=t._fullData,s=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(s,b):((y=a.extendFlat({},p)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(s,b),y.name="",f.push(y),v[b]=y)}return f}function p(t,e,r,a){var i=t.cd,o=t.ya,l=i[0].trace,f=i[0].t,p=u(t,e,r,a);if(!p)return[];var h=i[p.index],d=p.index=h.i,g=h.dir;function v(t){return f.labels[t]+n.hoverLabelText(o,l[t][d])}var m=h.hi||l.hoverinfo,y=m.split("+"),x="all"===m,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[v("open"),v("high"),v("low"),v("close")+" "+c[g]]:[];return _&&s(h,l,w),p.extraText=w.join("
"),p.y0=p.y1=o.c2p(h.yc,!0),[p]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?f(t,e,r,n):p(t,e,r,n)},hoverSplit:f,hoverOnPoints:p}},{"../../components/color":591,"../../components/fx":629,"../../constants/delta.js":686,"../../lib":716,"../../plots/cartesian/axes":764}],1067:[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":775,"./attributes":1063,"./calc":1064,"./defaults":1065,"./hover":1066,"./plot":1069,"./select":1070,"./style":1071}],1068:[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 f=Math.min(s.length,l.length,c.length,u.length);return o&&(f=Math.min(f,a.minRowLength(o))),e._length=f,f}}},{"../../lib":716,"../../registry":845}],1069:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib");e.exports=function(t,e,r,i){var o=e.xaxis,s=e.yaxis;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 l=i.tickLen,c=e.selectAll("path").data(a.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=o.c2p(t.pos,!0),r=o.c2p(t.pos-l,!0),n=o.c2p(t.pos+l,!0);return"M"+r+","+s.c2p(t.o,!0)+"H"+e+"M"+e+","+s.c2p(t.h,!0)+"V"+s.c2p(t.l,!0)+"M"+n+","+s.c2p(t.c,!0)+"H"+e}))}}))}},{"../../lib":716,d3:164}],1070:[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,f){function p(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,f,p);o(e,f,p),Array.isArray(h)&&h.length||(e.visible=!1),c(e,h,"values",d),p("hoveron"),p("hovertemplate"),p("arrangement"),p("bundlecolors"),p("sortpaths"),p("counts");var g={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(p,"labelfont",g);var v={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(p,"tickfont",v)}},{"../../components/colorscale/defaults":601,"../../components/colorscale/helpers":602,"../../lib":716,"../../plots/array_container_defaults":760,"../../plots/domain":789,"../parcoords/merge_length":1088,"./attributes":1072}],1076:[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":1072,"./base_plot":1073,"./calc":1074,"./defaults":1075,"./plot":1078}],1077:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plot_api/plot_api"),i=t("../../components/fx"),o=t("../../lib"),s=t("../../components/drawing"),l=t("tinycolor2"),c=t("../../lib/svg_text_utils");function u(t,e,r,a){var i=t.map(z.bind(0,e,r)),l=a.selectAll("g.parcatslayer").data([null]);l.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var u=l.selectAll("g.trace.parcats").data(i,f),v=u.enter().append("g").attr("class","trace parcats");u.attr("transform",(function(t){return"translate("+t.x+", "+t.y+")"})),v.append("g").attr("class","paths");var m=u.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),f);m.attr("fill",(function(t){return t.model.color}));var b=m.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);x(b),m.attr("d",(function(t){return t.svgD})),b.empty()||m.sort(h),m.exit().remove(),m.on("mouseover",d).on("mouseout",g).on("click",y),v.append("g").attr("class","dimensions");var k=u.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),f);k.enter().append("g").attr("class","dimension"),k.attr("transform",(function(t){return"translate("+t.x+", 0)"})),k.exit().remove();var T=k.selectAll("g.category").data((function(t){return t.categories}),f),A=T.enter().append("g").attr("class","category");T.attr("transform",(function(t){return"translate(0, "+t.y+")"})),A.append("rect").attr("class","catrect").attr("pointer-events","none"),T.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),_(A);var M=T.selectAll("rect.bandrect").data((function(t){return t.bands}),f);M.each((function(){o.raiseToTop(this)})),M.attr("fill",(function(t){return t.color}));var P=M.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);M.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"})),w(P),M.exit().remove(),A.append("text").attr("class","catlabel").attr("pointer-events","none");var I=e._fullLayout.paper_bgcolor;T.select("text.catlabel").attr("text-anchor",(function(t){return p(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",I+" -1px 1px 2px, "+I+" 1px 1px 2px, "+I+" 1px -1px 2px, "+I+" -1px -1px 2px").style("fill","rgb(0, 0, 0)").attr("x",(function(t){return p(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){s.font(n.select(this),t.parcatsViewModel.categorylabelfont),c.convertToTspans(n.select(this),e)})),A.append("text").attr("class","dimlabel"),T.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){s.font(n.select(this),t.parcatsViewModel.labelfont)})),T.selectAll("rect.bandrect").on("mouseover",E).on("mouseout",S),T.exit().remove(),k.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",C).on("drag",L).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 f(t){return t.key}function p(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function h(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),C=n.mouse(f)[0];i.loneHover({trace:p,x:_-d.left+g.left,y:w-d.top+g.top,text:S,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:k,idealAlign:C<_?"right":"left",hovertemplate:(p.line||{}).hovertemplate,hovertemplateLabels:M,eventData:[{data:p._input,fullData:p,count:T,probability:A}]},{container:h._hoverlayer.node(),outerContainer:h._paper.node(),gd:f})}}}function g(t){if(!t.parcatsViewModel.dragDimension&&(x(n.select(this)),i.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),t.parcatsViewModel.pathSelection.sort(h),-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var e=v(t),r=m(t);t.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:e,event:n.event,constraints:r})}}function v(t){for(var e=[],r=P(t.parcatsViewModel),n=0;n1&&c.displayInd===l.dimensions.length-1?(r=o.left,a="left"):(r=o.left+o.width,a="right");var p=s.model.count,h=s.model.categoryLabel,d=p/s.parcatsViewModel.model.count,g={countLabel:p,categoryLabel:h,probabilityLabel:d.toFixed(3)},v=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&v.push(["Count:",g.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&v.push(["P("+g.categoryLabel+"):",g.probabilityLabel].join(" "));var m=v.join("
");return{trace:u,x:r-t.left,y:f-t.top,text:m,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:u.hovertemplate,hovertemplateLabels:g,eventData:[{data:u._input,fullData:u,count:p,category:h,probability:d}]}}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,s=a._paperdiv.node().getBoundingClientRect(),c=t.parcatsViewModel.hoveron;"color"===c?(function(t){var e=n.select(t).datum(),r=k(e);b(r),r.each((function(){o.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){o.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),A(this,"plotly_hover",n.event)):(function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=k(t);b(e),e.each((function(){o.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),T(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===c?e=M(s,this):"color"===c?e=function(t,e){var r,a,i=e.getBoundingClientRect(),o=n.select(e).datum(),s=o.categoryViewModel,c=s.parcatsViewModel,u=c.model.dimensions[s.model.dimensionInd],f=c.trace,p=i.y+i.height/2;c.dimensions.length>1&&u.displayInd===c.dimensions.length-1?(r=i.left,a="left"):(r=i.left+i.width,a="right");var h=s.model.categoryLabel,d=o.parcatsViewModel.model.count,g=0;o.categoryViewModel.bands.forEach((function(t){t.color===o.color&&(g+=t.count)}));var v=s.model.count,m=0;c.pathSelection.each((function(t){t.model.color===o.color&&(m+=t.model.count)}));var y=g/d,x=g/m,b=g/v,_={countLabel:d,categoryLabel:h,probabilityLabel:y.toFixed(3)},w=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&w.push(["Count:",_.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(w.push("P(color ∩ "+h+"): "+_.probabilityLabel),w.push("P("+h+" | color): "+x.toFixed(3)),w.push("P(color | "+h+"): "+b.toFixed(3)));var k=w.join("
"),T=l.mostReadable(o.color,["black","white"]);return{trace:f,x:r-t.left,y:p-t.top,text:k,color:o.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:T,fontSize:10,idealAlign:a,hovertemplate:f.hovertemplate,hovertemplateLabels:_,eventData:[{data:f._input,fullData:f,category:h,count:d,probability:y,categorycount:v,colorcount:m,bandcolorcount:g}]}}(s,this):"dimension"===c&&(e=function(t,e){var r=[];return n.select(e.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){r.push(M(t,this))})),r}(s,this)),e&&i.loneHover(e,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r}))}}function S(t){var e=t.parcatsViewModel;e.dragDimension||(x(e.pathSelection),_(e.dimensionSelection.selectAll("g.category")),w(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),i.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(h),-1!==e.hoverinfoItems.indexOf("skip"))||("color"===t.parcatsViewModel.hoveron?A(this,"plotly_unhover",n.event):T(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,o.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){i.model.dragX=n.event.x;var p=t.parcatsViewModel.dimensions[r],h=t.parcatsViewModel.dimensions[a];void 0!==p&&i.model.dragXh.x&&(i.model.displayInd=h.model.displayInd,h.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=i.model.displayInd}B(t.parcatsViewModel),F(t.parcatsViewModel),D(t.parcatsViewModel),I(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=P(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 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})),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"}}-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?A(t.potentialClickBand,"plotly_click",n.event.sourceEvent):T(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,B(t.parcatsViewModel),F(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){D(t.parcatsViewModel,!0),I(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function P(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+a)+" "+l[s]+","+(e[s]+a)+" "+(t[s]+r[s])+","+(e[s]+a),u+="l-"+r[s]+",0 ";return u+="Z"}function F(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 f(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=f(e),a=f(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 p=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})),g=0;g0?d*(m.count/h):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(n-1):0)*a;var i,o,s,l,c,u=[],f=t.model.maxCats,p=e.categories.length,h=e.count,d=t.height-8*(f-1),g=8*(f-p)/2,v=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(v.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:g,bands:[],parcatsViewModel:t},g=g+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){u(r,t,n,e)}},{"../../components/drawing":612,"../../components/fx":629,"../../lib":716,"../../lib/svg_text_utils":740,"../../plot_api/plot_api":751,d3:164,tinycolor2:535}],1078:[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":1077}],1079:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/layout_attributes"),i=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:i({editType:"plot"}),tickfont:i({editType:"plot"}),rangefont:i({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},a.tickvals,{editType:"plot"}),ticktext:s({},a.ticktext,{editType:"plot"}),tickformat:s({},a.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:"number",editType:"plot"},{valType:"number",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":598,"../../lib/extend":707,"../../plot_api/plot_template":754,"../../plots/cartesian/layout_attributes":776,"../../plots/domain":789,"../../plots/font_attributes":790}],1080:[function(t,e,r){"use strict";var n=t("./constants"),a=t("d3"),i=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=n.bar.snapRatio;function c(t,e){return t*(1-l)+e*l}var u=n.bar.snapClose;function f(t,e){return t*(1-u)+e*u}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 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,p=i;a*pe){p=r;break}}if(i=u,isNaN(i)&&(i=isNaN(f)||isNaN(p)?isNaN(f)?p: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[i],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 _(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 w(t,e){var r=b(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 k(t){t.on("mousemove",(function(t){a.event.preventDefault(),t.parent.inBrushDrag||w(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||m()})).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=b(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]:i,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){_(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,i=r.svgBrush;i._dragging||(w(t,e),_(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,m(),!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&&A(r)):A(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(c?[i.newExtent]:[]),i.extent.length||A(r),i.brushCallback(e),c?x(t.parentNode,s):(s(),x(t.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function T(t,e){return t[0]-e[0]}function A(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function M(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 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(T)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=M(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){var e=t.selectAll("."+n.cn.axisBrush).data(o,i);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(h).call(d).style("pointer-events","auto").attr("transform","translate(0 "+n.verticalPadding+")"),e.call(k).attr("height",(function(t){return t.height-n.verticalPadding}));var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",(function(t){return t.height})).call(y);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(y)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?M(t.sort(T)):[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":716,"../../lib/gup":714,"./constants":1083,d3:164}],1081:[function(t,e,r){"use strict";var n=t("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.width,height:this.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":693,"../../plots/get_data":799,"./plot":1090,d3:164}],1082:[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"),d.splice(f));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:h}),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,u);o(e,l,u),Array.isArray(g)&&g.length||(e.visible=!1),p(e,g,"values",v);var m={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",m),n.coerceFont(u,"tickfont",m),n.coerceFont(u,"rangefont",m),u("labelangle"),u("labelside")}},{"../../components/colorscale/defaults":601,"../../components/colorscale/helpers":602,"../../lib":716,"../../plots/array_container_defaults":760,"../../plots/cartesian/axes":764,"../../plots/domain":789,"./attributes":1079,"./axisbrush":1080,"./constants":1083,"./merge_length":1088}],1085:[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":716}],1086:[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":1079,"./base_plot":1081,"./calc":1082,"./defaults":1084,"./plot":1090}],1087:[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 sampler2D mask, palette;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\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(mask,\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=1e-6,c=2048,u=new Uint8Array(4),f=new Uint8Array(4),p={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(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 d(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:u})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(t,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*c,i.offset=2*l*n,e(i),l*n+c>>8*e)%256/255}function m(t,e,r){for(var n=new Array(8*e),a=0,i=0;if&&(f=t[a].dim1.canvasX,o=a);0===s&&h(A,0,0,r.canvasWidth,r.canvasHeight);var p=function(t){var e,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!t&&na._length&&(E=E.slice(0,a._length));var S,C=a.tickvals;function L(t,e){return{val:t,text:S[e]}}function O(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){S=a.ticktext,Array.isArray(S)&&S.length?S.length>C.length?S=S.slice(0,C.length):C.length>S.length&&(C=C.slice(0,S.length)):S=C.map(n.format(a.tickformat));for(var P=1;P=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,p={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==D&&(u?a.hover(p):a.unhover&&a.unhover(p),D=f)}})),I.style("opacity",(function(t){return t.pick?0:1})),u.style("background","rgba(255, 255, 255, 0)");var z=u.selectAll("."+g.cn.parcoords).data(T,f);z.exit().remove(),z.enter().append("g").classed(g.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),z.attr("transform",(function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"}));var R=z.selectAll("."+g.cn.parcoordsControlView).data(p,f);R.enter().append("g").classed(g.cn.parcoordsControlView,!0),R.attr("transform",(function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"}));var F=R.selectAll("."+g.cn.yAxis).data((function(t){return t.dimensions}),f);F.enter().append("g").classed(g.cn.yAxis,!0),R.each((function(t){L(F,t)})),I.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=m(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)}})),F.attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),F.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;k.linePickActive(!1),t.x=Math.max(-g.overdrag,Math.min(t.model.width+g.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,F.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})),L(F,e),F.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),n.select(this).attr("transform","translate("+t.x+", 0)"),F.each((function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!A(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,L(F,e),n.select(this).attr("transform",(function(t){return"translate("+t.x+", 0)"})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!A(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),k.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),F.exit().remove();var B=F.selectAll("."+g.cn.axisOverlays).data(p,f);B.enter().append("g").classed(g.cn.axisOverlays,!0),B.selectAll("."+g.cn.axis).remove();var N=B.selectAll("."+g.cn.axis).data(p,f);N.enter().append("g").classed(g.cn.axis,!0),N.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 d.isOrdinal(t)?e:O(t.model.dimensions[t.visibleIndex],e)})).scale(r)),l.font(N.selectAll("text"),t.model.tickFont)})),N.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),N.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=B.selectAll("."+g.cn.axisHeading).data(p,f);j.enter().append("g").classed(g.cn.axisHeading,!0);var V=j.selectAll("."+g.cn.axisTitle).data(p,f);V.enter().append("text").classed(g.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),V.text((function(t){return t.label})).each((function(e){var r=n.select(this);l.font(r,e.model.labelFont),s.convertToTspans(r,t)})).attr("transform",(function(t){var e=C(t.model.labelAngle,t.model.labelSide),r=g.axisTitleOffset;return(e.dir>0?"":"translate(0,"+(2*r+t.model.height)+")")+"rotate("+e.degrees+")translate("+-r*e.dx+","+-r*e.dy+")"})).attr("text-anchor",(function(t){var e=C(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 U=B.selectAll("."+g.cn.axisExtent).data(p,f);U.enter().append("g").classed(g.cn.axisExtent,!0);var H=U.selectAll("."+g.cn.axisExtentTop).data(p,f);H.enter().append("g").classed(g.cn.axisExtentTop,!0),H.attr("transform","translate(0,"+-g.axisExtentOffset+")");var q=H.selectAll("."+g.cn.axisExtentTopText).data(p,f);q.enter().append("text").classed(g.cn.axisExtentTopText,!0).call(S),q.text((function(t){return P(t,!0)})).each((function(t){l.font(n.select(this),t.model.rangeFont)}));var G=U.selectAll("."+g.cn.axisExtentBottom).data(p,f);G.enter().append("g").classed(g.cn.axisExtentBottom,!0),G.attr("transform",(function(t){return"translate(0,"+(t.model.height+g.axisExtentOffset)+")"}));var W=G.selectAll("."+g.cn.axisExtentBottomText).data(p,f);W.enter().append("text").classed(g.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(S),W.text((function(t){return P(t,!1)})).each((function(t){l.font(n.select(this),t.model.rangeFont)})),v.ensureAxisBrush(B)}},{"../../components/colorscale":603,"../../components/drawing":612,"../../lib":716,"../../lib/gup":714,"../../lib/svg_text_utils":740,"../../plots/cartesian/axes":764,"./axisbrush":1080,"./constants":1083,"./helpers":1085,"./lines":1087,"color-rgba":123,d3:164}],1090:[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={},c={},u={},f=r._size;e.forEach((function(e,r){var n=e[0].trace;c[r]=n.index;var a=u[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[c[e]]._fullInput.uid];if(void 0===f[s]){var p=i.constraintrange;f[s]=p||null}var h=t._fullData[c[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,h.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete h.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(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]]},[u[e]]])}})}}},{"../../lib/prepare_regl":729,"./helpers":1085,"./parcoords":1089}],1091:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),a=t("../../plots/domain").attributes,i=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=i({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,{}),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:a({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":590,"../../lib/extend":707,"../../plots/attributes":761,"../../plots/domain":789,"../../plots/font_attributes":790,"../../plots/template_attributes":840}],1092:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",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":825}],1093:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("tinycolor2"),o=t("../../components/color"),s={};function l(t){return function(e,r){return!!e&&!!(e=i(e)).isValid()&&(e=o.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function c(t,e){var r,n=JSON.stringify(t),a=e[n];if(!a){for(a=t.slice(),r=0;r"),name:p.hovertemplate||-1!==h.indexOf("name")?p.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:u.castOption(b.bgcolor,t.pts)||t.color,borderColor:u.castOption(b.bordercolor,t.pts),fontFamily:u.castOption(_.family,t.pts),fontSize:u.castOption(_.size,t.pts),fontColor:u.castOption(_.color,t.pts),nameLength:u.castOption(b.namelength,t.pts),textAlign:u.castOption(b.align,t.pts),hovertemplate:u.castOption(p.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[f(t,p)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[f(t,p)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,a=e._fullData[o.index],s=n.select(this).datum();o._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[f(s,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,a=e._fullData[o.index];e._dragging||!1===r.hovermode||(e._hoverdata=[f(t,a)],i.click(e,n.event))}))}function d(t,e,r){var n=u.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=u.castOption(t._input.textfont.color,e.pts));var a=u.castOption(t.insidetextfont.family,e.pts)||u.castOption(t.textfont.family,e.pts)||r.family,i=u.castOption(t.insidetextfont.size,e.pts)||u.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:a,size:i}}function g(t,e){for(var r,n,a=0;a=1)return c;var u=a+1/(2*Math.tan(i)),f=l*Math.min(1/(Math.sqrt(u*u+.5)+u),o/(Math.sqrt(a*a+o/2)+a)),p={scale:2*f/t.height,rCenter:Math.cos(f/l)-f*a/l,rotate:(180/Math.PI*e.midangle+720)%180-90},h=1/a,d=h+1/(2*Math.tan(i)),g=l*Math.min(1/(Math.sqrt(d*d+.5)+d),o/(Math.sqrt(h*h+o/2)+h)),v={scale:2*g/t.width,rCenter:Math.cos(g/l)-g/a/l,rotate:(180/Math.PI*e.midangle+810)%180-90},m=v.scale>p.scale?v:p;return c.scale<1&&m.scale>c.scale?m:c}function m(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function y(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 x(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),-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)),f=e.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,s.tx+=t.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,s.tx-=t.titleBox.width/2),r=f/t.titleBox.width,n=b(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function b(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 _(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 w(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 b=function(t){return{label:t.label,value:t.v,valueLabel:u.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:u.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(a,t.i,"customdata")}}(e),_=u.getFirstFilled(a.text,e.pts);(p(_)||""===_)&&(b.text=_),e.text=l.texttemplateString(x,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}e.exports={plot:function(t,e){var r=t._fullLayout,i=r._size;g(e,t),w(e,i);var f=l.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var r=n.select(this),f=e[0],p=f.trace;!function(t){var e,r,n,a=t[0],i=a.trace,o=i.rotation*Math.PI/180,s=2*Math.PI/a.vTotal,l="px0",c="px1";if("counterclockwise"===i.direction){for(e=0;ea.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-i.hole,r.rInscribed=m(r,a))}(e),r.attr("stroke-linejoin","round"),r.each((function(){var g=n.select(this).selectAll("g.slice").data(e);g.enter().append("g").classed("slice",!0),g.exit().remove();var m=[[[],[]],[[],[]]],b=!1;g.each((function(r){if(r.hidden)n.select(this).selectAll("path,g").remove();else{r.pointNumber=r.i,r.curveNumber=p.index,m[r.pxmid[1]<0?0:1][r.pxmid[0]<0?0:1].push(r);var a=f.cx,i=f.cy,o=n.select(this),g=o.selectAll("path.surface").data([r]);if(g.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),o.call(h,t,e),p.pull){var x=+u.castOption(p.pull,r.pts)||0;x>0&&(a+=x*r.pxmid[0],i+=x*r.pxmid[1])}r.cxFinal=a,r.cyFinal=i;var _=p.hole;if(r.v===f.vTotal){var w="M"+(a+r.px0[0])+","+(i+r.px0[1])+S(r.px0,r.pxmid,!0,1)+S(r.pxmid,r.px0,!0,1)+"Z";_?g.attr("d","M"+(a+_*r.px0[0])+","+(i+_*r.px0[1])+S(r.px0,r.pxmid,!1,_)+S(r.pxmid,r.px0,!1,_)+"Z"+w):g.attr("d",w)}else{var T=S(r.px0,r.px1,!0,1);if(_){var A=1-_;g.attr("d","M"+(a+_*r.px1[0])+","+(i+_*r.px1[1])+S(r.px1,r.px0,!1,_)+"l"+A*r.px0[0]+","+A*r.px0[1]+T+"Z")}else g.attr("d","M"+a+","+i+"l"+r.px0[0]+","+r.px0[1]+T+"Z")}k(t,r,f);var M=u.castOption(p.textposition,r.pts),E=o.selectAll("g.slicetext").data(r.text&&"none"!==M?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each((function(){var e=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)}));e.text(r.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,"outside"===M?function(t,e,r){var n=u.castOption(t.outsidetextfont.color,e.pts)||u.castOption(t.textfont.color,e.pts)||r.color,a=u.castOption(t.outsidetextfont.family,e.pts)||u.castOption(t.textfont.family,e.pts)||r.family,i=u.castOption(t.outsidetextfont.size,e.pts)||u.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:a,size:i}}(p,r,t._fullLayout.font):d(p,r,t._fullLayout.font)).call(c.convertToTspans,t);var o,h=s.bBox(e.node());"outside"===M?o=y(h,r):(o=v(h,r,f),"auto"===M&&o.scale<1&&(e.call(s.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(h=s.bBox(e.node())),o=y(h,r)));var g=a+r.pxmid[0]*o.rCenter+(o.x||0),m=i+r.pxmid[1]*o.rCenter+(o.y||0);o.outside&&(r.yLabelMin=m-h.height/2,r.yLabelMid=m,r.yLabelMax=m+h.height/2,r.labelExtraX=0,r.labelExtraY=0,b=!0),e.attr("transform","translate("+g+","+m+")"+(o.scale<1?"scale("+o.scale+")":"")+(o.rotate?"rotate("+o.rotate+")":"")+"translate("+-(h.left+h.right)/2+","+-(h.top+h.bottom)/2+")")}))}function S(t,e,n,a){var i=a*(e[0]-t[0]),o=a*(e[1]-t[1]);return"a"+a*f.r+","+a*f.r+" 0 "+r.largeArc+(n?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=l.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,p.title.font).call(c.convertToTspans,t),e="middle center"===p.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}}(f):x(f,i),r.attr("transform","translate("+e.x+","+e.y+")"+(e.scale<1?"scale("+e.scale+")":"")+"translate("+e.tx+","+e.ty+")")})),b&&function(t,e){var r,n,a,i,o,s,l,c,f,p,h,d,g;function v(t,e){return t.pxmid[1]-e.pxmid[1]}function m(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var a,c,f,h,d=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?t.yLabelMin:t.yLabelMax,v=n?t.yLabelMax:t.yLabelMin,m=t.cyFinal+o(t.px0[1],t.px1[1]),y=d-g;if(y*l>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c=(u.castOption(e.pull,f.pts)||0)||((t.pxmid[1]-f.pxmid[1])*l>0?(y=f.cyFinal+o(f.px0[1],f.px1[1])-g-t.labelExtraY)*l>0&&(t.labelExtraY+=y):(v+t.labelExtraY-m)*l>0&&(a=3*s*Math.abs(c-p.indexOf(t)),(h=f.cxFinal+i(f.px0[0],f.px1[0])+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=h)))}for(n=0;n<2;n++)for(a=n?v:m,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),f=t[1-n][r],p=f.concat(c),d=[],h=0;hMath.abs(f)?s+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(i+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()}))}(g,p),b&&p.automargin){var w=s.bBox(r.node()),T=p.domain,A=i.w*(T.x[1]-T.x[0]),M=i.h*(T.y[1]-T.y[0]),E=(.5*A-f.r)/i.w,S=(.5*M-f.r)/i.h;a.autoMargin(t,"pie."+p.uid+".automargin",{xl:T.x[0]-E,xr:T.x[1]+E,yb:T.y[0]-S,yt:T.y[1]+S,l:Math.max(f.cx-f.r-w.left,0),r:Math.max(w.right-(f.cx+f.r),0),b:Math.max(w.bottom-(f.cy+f.r),0),t:Math.max(f.cy-f.r-w.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:k,transformInsideText:v,determineInsideTextFont:d,positionTitleOutside:x,prerenderTitles:g,layoutAreas:w,attachFxHandlers:h}},{"../../components/color":591,"../../components/drawing":612,"../../components/fx":629,"../../lib":716,"../../lib/svg_text_utils":740,"../../plots/plots":825,"./event_data":1095,"./helpers":1096,d3:164}],1101:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").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)}))}))}},{"./style_one":1102,d3:164}],1102:[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":591,"./helpers":1096}],1103:[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":1117}],1104:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),i=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,p=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(f){if(n=f,e=f.length>>>1,p)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(h)r=h;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=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;null===y&&(y=c.length<100||u.length<100),this.pointcloudOptions.blend=y,v[3]*=m,this.pointcloudOptions.borderColor=v;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,k=b/2||.5;t._extremes[_._id]=i(_,[d[0],d[2]],{ppad:k}),t._extremes[w._id]=i(w,[d[1],d[3]],{ppad:k})},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":739,"../../plots/cartesian/autorange":763,"../scatter/get_trace_color":1126,"gl-pointcloud2d":294}],1105:[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":716,"./attributes":1103}],1106:[function(t,e,r){"use strict";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":802,"../scatter3d/calc":1144,"./attributes":1103,"./convert":1104,"./defaults":1105}],1107:[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,f=t("../../lib/extend").extendFlat,p=t("../../plot_api/edit_types").overrideAll;t("../../constants/docs").FORMAT_LINK,(e.exports=p({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"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),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},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},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":590,"../../components/colorscale/attributes":598,"../../components/fx/attributes":621,"../../constants/docs":687,"../../lib/extend":707,"../../plot_api/edit_types":747,"../../plot_api/plot_template":754,"../../plots/attributes":761,"../../plots/domain":789,"../../plots/font_attributes":790,"../../plots/template_attributes":840}],1108:[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"),f=t("../../registry");function p(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 p={_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:p,yaxis:h,fillRangeItems:u.noop},subplot:e,xaxes:[p],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;rm&&(m=i.source[e]),i.target[e]>m&&(m=i.target[e]);var y,x=m+1;t.node._count=x;var b=t.node.groups,_={};for(e=0;e0&&s(E,x)&&s(S,x)&&(!_.hasOwnProperty(E)||!_.hasOwnProperty(S)||_[E]!==_[S])){_.hasOwnProperty(S)&&(S=_[S]),_.hasOwnProperty(E)&&(E=_[E]),S=+S,f[E=+E]=f[S]=!0;var C="";i.label&&i.label[e]&&(C=i.label[e]);var L=null;C&&p.hasOwnProperty(C)&&(L=p[C]),c.push({pointNumber:e,label:C,color:u?i.color[e]:i.color,concentrationscale:L,source:E,target:S,value:+M}),A.source.push(E),A.target.push(S)}}var O=x+b.length,P=o(r.color),I=[];for(e=0;ex-1,childrenNodes:[],pointNumber:e,label:D,color:P?r.color[e]:r.color})}var z=!1;return function(t,e,r){for(var i=a.init2dArray(t,0),o=0;o1}))}(O,A.source,A.target)&&(z=!0),{circular:z,links:c,nodes:I,groups:b,groupLookup:_}}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":603,"../../lib":716,"../../lib/gup":714,"strongly-connected-components":528}],1110:[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",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1111:[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 f(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,p){function h(r,i){return n.coerce(t,e,a,r,i)}var d=n.extendDeep(p.hoverlabel,t.hoverlabel),g=t.node,v=c.newContainer(e,"node");function m(t,e){return n.coerce(g,v,a.node,t,e)}m("label"),m("groups"),m("x"),m("y"),m("pad"),m("thickness"),m("line.color"),m("line.width"),m("hoverinfo",t.hoverinfo),l(g,v,m,d),m("hovertemplate");var y=p.colorway;m("color",v.label.map((function(t,e){return i.addOpacity(function(t){return y[t%y.length]}(e),.8)})));var x=t.link||{},b=c.newContainer(e,"link");function _(t,e){return n.coerce(x,b,a.link,t,e)}_("label"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,k=o(p.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(k,b.value.length)),u(x,b,{name:"colorscales",handleItemDefaults:f}),s(e,p,h),h("orientation"),h("valueformat"),h("valuesuffix"),v.x.length&&v.y.length&&(w="freeform"),h("arrangement",w),n.coerceFont(h,"textfont",n.extendFlat({},p.font)),e._length=null}},{"../../components/color":591,"../../components/fx/hoverlabel_defaults":628,"../../lib":716,"../../plot_api/plot_template":754,"../../plots/array_container_defaults":760,"../../plots/domain":789,"./attributes":1107,tinycolor2:535}],1112:[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":1107,"./base_plot":1108,"./calc":1109,"./defaults":1111,"./plot":1113,"./select.js":1115}],1113:[function(t,e,r){"use strict";var n=t("d3"),a=t("./render"),i=t("../../components/fx"),o=t("../../components/color"),s=t("../../lib"),l=t("./constants").cn,c=s._;function u(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 h(t){n.select(t).select("text.name").style("fill","black")}function d(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("."+l.sankeyLink).filter(d(e)).call(y.bind(0,e,r,!1))}function m(t,e,r){e&&r&&f(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(x.bind(0,e,r,!1))}function y(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("."+l.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("."+l.sankeyNode).filter(g(t)).call(v)}function x(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),a&&f(e,t).selectAll("."+l.sankeyLink).filter((function(t){return t.link.label===a})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&f(e,t).selectAll(l.sankeyNode).filter(g(t)).call(m)}function b(t,e){var r=t.hoverlabel||{},n=s.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,s=r._paper,f=r._size,d=0;d"),color:b(s,"bgcolor")||o.addOpacity(d.color,1),borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),nameLength:b(s,"namelength"),textAlign:b(s,"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:m,eventData:[a.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});p(y,.85),h(y)}}},unhover:function(e,a,o){!1!==t._fullLayout.hovermode&&(n.select(e).call(m,a,o),"skip"!==a.node.trace.node.hoverinfo&&(a.node.fullData=a.node.trace,t.emit("plotly_unhover",{event:n.event,points:[a.node]})),i.loneUnhover(r._hoverlayer.node()))},select:function(e,r,a){var o=r.node;o.originalEvent=n.event,t._hoverdata=[o],n.select(e).call(m,r,a),i.click(t,{target:!0})}}})}},{"../../components/color":591,"../../components/fx":629,"../../lib":716,"./constants":1110,"./render":1114,d3:164}],1114:[function(t,e,r){"use strict";var n=t("./constants"),a=t("d3"),i=t("tinycolor2"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("@plotly/d3-sankey"),c=t("@plotly/d3-sankey-circular"),u=t("d3-force"),f=t("../../lib"),p=t("../../lib/gup"),h=p.keyFun,d=p.repeat,g=p.unwrap,v=t("d3-interpolate").interpolateNumber,m=t("../../registry");function y(t,e,r){var a,o=g(e),s=o.trace,u=s.domain,p="h"===s.orientation,h=s.node.pad,d=s.node.thickness,v=t.width*(u.x[1]-u.x[0]),m=t.height*(u.y[1]-u.y[0]),y=o._nodes,x=o._links,b=o.circular;(a=b?c.sankeyCircular().circularLinkGap(0):l.sankey()).iterations(n.sankeyIterations).size(p?[v,m]:[m,v]).nodeWidth(d).nodePadding(h).nodeId((function(t){return t.pointNumber})).nodes(y).links(x);var _,w,k,T=a();for(var A in a.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(_=0;_o+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}(y=T.nodes)),a.update(T)}return{circular:b,key:r,trace:s,guid:f.randstr(),horizontal:p,width:v,height:m,nodePad:s.node.pad,nodeLineColor:s.node.line.color,nodeLineWidth:s.node.line.width,linkLineColor:s.link.line.color,linkLineWidth:s.link.line.width,valueFormat:s.valueformat,valueSuffix:s.valuesuffix,textFont:s.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:p?m:v,dragPerpendicular:p?v:m,arrangement:s.arrangement,sankey:a,graph:T,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function x(t,e,r){var n=i(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:o.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:b,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function b(){var t=.5;return function(e){if(e.link.circular)return r=e.link,n=r.width/2,a=r.circularPathData,"top"===r.circularLinkType?"M "+a.targetX+" "+(a.targetY+n)+" L"+a.rightInnerExtent+" "+(a.targetY+n)+"A"+(a.rightLargeArcRadius+n)+" "+(a.rightSmallArcRadius+n)+" 0 0 1 "+(a.rightFullExtent-n)+" "+(a.targetY-a.rightSmallArcRadius)+"L"+(a.rightFullExtent-n)+" "+a.verticalRightInnerExtent+"A"+(a.rightLargeArcRadius+n)+" "+(a.rightLargeArcRadius+n)+" 0 0 1 "+a.rightInnerExtent+" "+(a.verticalFullExtent-n)+"L"+a.leftInnerExtent+" "+(a.verticalFullExtent-n)+"A"+(a.leftLargeArcRadius+n)+" "+(a.leftLargeArcRadius+n)+" 0 0 1 "+(a.leftFullExtent+n)+" "+a.verticalLeftInnerExtent+"L"+(a.leftFullExtent+n)+" "+(a.sourceY-a.leftSmallArcRadius)+"A"+(a.leftLargeArcRadius+n)+" "+(a.leftSmallArcRadius+n)+" 0 0 1 "+a.leftInnerExtent+" "+(a.sourceY+n)+"L"+a.sourceX+" "+(a.sourceY+n)+"L"+a.sourceX+" "+(a.sourceY-n)+"L"+a.leftInnerExtent+" "+(a.sourceY-n)+"A"+(a.leftLargeArcRadius-n)+" "+(a.leftSmallArcRadius-n)+" 0 0 0 "+(a.leftFullExtent-n)+" "+(a.sourceY-a.leftSmallArcRadius)+"L"+(a.leftFullExtent-n)+" "+a.verticalLeftInnerExtent+"A"+(a.leftLargeArcRadius-n)+" "+(a.leftLargeArcRadius-n)+" 0 0 0 "+a.leftInnerExtent+" "+(a.verticalFullExtent+n)+"L"+a.rightInnerExtent+" "+(a.verticalFullExtent+n)+"A"+(a.rightLargeArcRadius-n)+" "+(a.rightLargeArcRadius-n)+" 0 0 0 "+(a.rightFullExtent+n)+" "+a.verticalRightInnerExtent+"L"+(a.rightFullExtent+n)+" "+(a.targetY-a.rightSmallArcRadius)+"A"+(a.rightLargeArcRadius-n)+" "+(a.rightSmallArcRadius-n)+" 0 0 0 "+a.rightInnerExtent+" "+(a.targetY-n)+"L"+a.targetX+" "+(a.targetY-n)+"Z":"M "+a.targetX+" "+(a.targetY-n)+" L"+a.rightInnerExtent+" "+(a.targetY-n)+"A"+(a.rightLargeArcRadius+n)+" "+(a.rightSmallArcRadius+n)+" 0 0 0 "+(a.rightFullExtent-n)+" "+(a.targetY+a.rightSmallArcRadius)+"L"+(a.rightFullExtent-n)+" "+a.verticalRightInnerExtent+"A"+(a.rightLargeArcRadius+n)+" "+(a.rightLargeArcRadius+n)+" 0 0 0 "+a.rightInnerExtent+" "+(a.verticalFullExtent+n)+"L"+a.leftInnerExtent+" "+(a.verticalFullExtent+n)+"A"+(a.leftLargeArcRadius+n)+" "+(a.leftLargeArcRadius+n)+" 0 0 0 "+(a.leftFullExtent+n)+" "+a.verticalLeftInnerExtent+"L"+(a.leftFullExtent+n)+" "+(a.sourceY+a.leftSmallArcRadius)+"A"+(a.leftLargeArcRadius+n)+" "+(a.leftSmallArcRadius+n)+" 0 0 0 "+a.leftInnerExtent+" "+(a.sourceY-n)+"L"+a.sourceX+" "+(a.sourceY-n)+"L"+a.sourceX+" "+(a.sourceY+n)+"L"+a.leftInnerExtent+" "+(a.sourceY+n)+"A"+(a.leftLargeArcRadius-n)+" "+(a.leftSmallArcRadius-n)+" 0 0 1 "+(a.leftFullExtent-n)+" "+(a.sourceY+a.leftSmallArcRadius)+"L"+(a.leftFullExtent-n)+" "+a.verticalLeftInnerExtent+"A"+(a.leftLargeArcRadius-n)+" "+(a.leftLargeArcRadius-n)+" 0 0 1 "+a.leftInnerExtent+" "+(a.verticalFullExtent-n)+"L"+a.rightInnerExtent+" "+(a.verticalFullExtent-n)+"A"+(a.rightLargeArcRadius-n)+" "+(a.rightLargeArcRadius-n)+" 0 0 1 "+(a.rightFullExtent+n)+" "+a.verticalRightInnerExtent+"L"+(a.rightFullExtent+n)+" "+(a.targetY+a.rightSmallArcRadius)+"A"+(a.rightLargeArcRadius-n)+" "+(a.rightSmallArcRadius-n)+" 0 0 1 "+a.rightInnerExtent+" "+(a.targetY+n)+"L"+a.targetX+" "+(a.targetY+n)+"Z";var r,n,a,i=e.link.source.x1,o=e.link.target.x0,s=v(i,o),l=s(t),c=s(1-t),u=e.link.y0-e.link.width/2,f=e.link.y0+e.link.width/2,p=e.link.y1-e.link.width/2,h=e.link.y1+e.link.width/2;return"M"+i+","+u+"C"+l+","+u+" "+c+","+p+" "+o+","+p+"L"+o+","+h+"C"+c+","+h+" "+l+","+f+" "+i+","+f+"Z"}}function _(t,e){var r=i(e.color),a=n.nodePadAcross,s=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var l=e.dx,c=Math.max(.5,e.dy),u="node_"+e.pointNumber;return e.group&&(u=f.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:u,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(l),visibleHeight:c,zoneX:-a,zoneY:-s,zoneWidth:l+2*a,zoneHeight:c+2*s,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:o.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,u].join("_"),interactionState:t.interactionState,figure:t}}function w(t){t.attr("transform",(function(t){return"translate("+t.node.x0.toFixed(3)+", "+t.node.y0.toFixed(3)+")"}))}function k(t){t.call(w)}function T(t,e){t.call(k),e.attr("d",b())}function A(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function M(t){return t.link.width>1||t.linkLineWidth>0}function E(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function S(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function C(t){return a.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+n.nodeTextOffsetHorizontal:n.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-n.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-n.nodeTextOffsetHorizontal,0]])}function L(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function O(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function P(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function I(t){return t.horizontal&&t.left?"100%":"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 z(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,a){!function(t){for(var e=0;e0&&a.forceLayouts[e].alpha(0)}}(0,e,i,r)).stop()}(0,o,a),function(t,e,r,a,i){window.requestAnimationFrame((function o(){var s;for(s=0;s0)window.requestAnimationFrame(o);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+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),T(t.filter(B(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e5?t.node.label:""})).attr("text-anchor",(function(t){return t.horizontal&&t.left?"end":"start"})),H.transition().ease(n.ease).duration(n.duration).attr("startOffset",I).style("fill",P)}},{"../../components/color":591,"../../components/drawing":612,"../../lib":716,"../../lib/gup":714,"../../registry":845,"./constants":1110,"@plotly/d3-sankey":56,"@plotly/d3-sankey-circular":55,d3:164,"d3-force":157,"d3-interpolate":159,tinycolor2:535}],1115:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=[],n=t.cd[0].trace,a=n._sankey.graph.nodes,i=0;is&&A[v].gap;)v--;for(y=A[v].s,d=A.length-1;d>v;d--)A[d].s=y;for(;sM[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}}}}}},{}],1124:[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("./stack_defaults"),u=t("./marker_defaults"),f=t("./line_defaults"),p=t("./line_shape_defaults"),h=t("./text_defaults"),d=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,i,r,a)}var m=l(t,e,g,v);if(m||(e.visible=!1),e.visible){var y=c(t,e,g,v),x=!y&&mG!=(F=P[L][1])>=G&&(D=P[L-1][0],z=P[L][0],F-R&&(I=D+(z-D)*(G-R)/(F-R),V=Math.min(V,I),U=Math.max(U,I)));V=Math.max(V,0),U=Math.min(U,p._length);var W=s.defaultLine;return s.opacity(f.fillcolor)?W=f.fillcolor:s.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:U,y0:G,y1:G,color:W,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":591,"../../components/fx":629,"../../lib":716,"../../registry":845,"./get_trace_color":1126}],1128:[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"),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":775,"./arrays_to_calcdata":1116,"./attributes":1117,"./calc":1118,"./cross_trace_calc":1122,"./cross_trace_defaults":1123,"./defaults":1124,"./hover":1127,"./marker_colorbar":1134,"./plot":1136,"./select":1137,"./style":1139,"./subtypes":1140}],1129:[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":601,"../../components/colorscale/helpers":602,"../../lib":716}],1130:[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,f=t("./constants");e.exports=function(t,e){var r,n,i,p,h,d,g,v,m,y,x,b,_,w,k,T,A,M,E=e.xaxis,S=e.yaxis,C="log"===E.type,L="log"===S.type,O=E._length,P=S._length,I=e.connectGaps,D=e.baseTolerance,z=e.shape,R="linear"===z,F=e.fill&&"none"!==e.fill,B=[],N=f.minTolerance,j=t.length,V=new Array(j),U=0;function H(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;L&&l===a&&(i*=Math.abs(E._m*P*(E._m>0?o:s)/(S._m*O*(S._m>0?o:s)))),i*=1e3}if(l===a){if(L&&(l=S.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function q(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]);return c&&((i&&o?c>0==i[t]>o[t]?i:o:i||o)[t]+=c),s}}function ct(t){var e=t[0],r=t[1],n=e===V[U-1][0],a=r===V[U-1][1];if(!n||!a)if(U>1){var i=e===V[U-2][0],o=r===V[U-2][1];n&&(e===et||e===rt)&&i?o?U--:V[U-1]=t:a&&(r===nt||r===at)&&o?i?U--:V[U-1]=t:V[U++]=t}else V[U++]=t}function ut(t){V[U-1][0]!==t[0]&&V[U-1][1]!==t[1]&&ct([Z,J]),ct(t),K=null,Z=J=0}function ft(t){if(A=t[0]/O,M=t[1]/P,Y=t[0]rt?rt:0,X=t[1]at?at:0,Y||X){if(U)if(K){var e=Q(K,t);e.length>1&&(ut(e[0]),V[U++]=e[1])}else $=Q(V[U-1],t)[0],V[U++]=$;else V[U++]=[Y||t[0],X||t[1]];var r=V[U-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(K&&(Z!==Y&&J!==X?ct(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||Y,J||X]):Z&&J&&ct([Z,J])),ct([Y,X])):Z-Y&&J-X&&ct([Y||Z,X||J]),K=t,Z=Y,J=X}else K&&ut(Q(K,t)[0]),V[U++]=t;var n,a,i,o}for("linear"===z||"spline"===z?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&&W(o,t)G(d,pt))break;i=d,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,p=d,g=!1):_=t.length||!d)break;ft(d),n=d}}else ft(p)}K&&ct([Z||K[0],J||K[1]]),B.push(V.slice(0,U))}return B}},{"../../constants/numerical":692,"../../lib":716,"./constants":1121}],1131:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1132:[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,f=-1,p=0,h=-1;for(i=0;i=0?l=h:(l=h=p,p++),l0?Math.max(e,a):0}}},{"fast-isnumeric":227}],1134:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1135:[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),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),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",f&&!Array.isArray(f)&&e.marker.color!==f?f: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":591,"../../components/colorscale/defaults":601,"../../components/colorscale/helpers":602,"./subtypes":1140}],1136:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),p=t("../../lib/polygon").tester;function h(t,e,r,f,h,d,g){var v;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,u=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(l.range,l.r2c)),p=a[0].trace;if(c.hasMarkers(p)){var h=p.marker.maxdisplayed;if(0!==h){var d=a.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/h),v=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(d),T=o(k,"g","errorbars"),A=o(k,"g","lines"),M=o(k,"g","points"),E=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(t,T,r,g),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var O,P,I="",D=[],z=_._prevtrace;z&&(I=z._prevRevpath||"",C=z._nextFill,D=z._polygons);var R,F,B,N,j,V,U,H="",q="",G=[],W=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.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}),U=_._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 Y=A.selectAll(".js-line").data(G);y(Y.exit()).style("opacity",0).remove(),Y.each(W(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(Y,r.layerClipId,t),G.length?(S?(S.datum(f),N&&V&&(L?("y"===L?N[1]=V[1]=b.c2p(0,!0):"x"===L&&(N[0]=V[0]=x.c2p(0,!0)),y(S).attr("d","M"+V+"L"+N+"L"+H.substr(1)).call(l.singleFillStyle)):y(S).attr("d",H+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&H&&I?("tonext"===_.fill?y(C).attr("d",H+"Z"+I+"Z").call(l.singleFillStyle):y(C).attr("d",H+"L"+I.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(D)):(Z(C),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(S?Z(S):C&&Z(C),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),E.datum(f),function(e,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),p=c.hasText(u),h=tt(u),d=et,g=et;if(f||p){var v=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?K:J:_&&!w&&(v=$),f&&(d=v),p&&(g=v)}var k,T=(o=e.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,u,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=l.makePointStyleFns(u)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,x,b)?(l.singlePointStyle(e,i,u,k,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,x,b,u.xcalendar,u.ycalendar),u.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,h)).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,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,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 K(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,p,d=!i,g=!!i&&i.duration>0,v=f(t,e,r);(u=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),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),g?(c&&(p=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){p&&p()})).each("interrupt",(function(){p&&p()})).each((function(){a.selectAll("g.trace").each((function(r,n){h(t,n,e,r,v,this,i)}))}))):u.each((function(r,n){h(t,n,e,r,v,this,i)})),d&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":612,"../../lib":716,"../../lib/polygon":728,"../../registry":845,"./line_points":1130,"./link_traces":1132,"./subtypes":1140,d3:164}],1137:[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=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var p=a.c2l(u);a._lowerLogErrorBound||(a._lowerLogErrorBound=p),a._lowerErrorBound=Math.min(a._lowerLogErrorBound,p)}}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 b(t,e){return e(4*t)}function _(t){return h[t]}function w(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",p||h);for(var d=["x","y","z"],g=0;g<3;++g){var v="projection."+d[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,p||h||r,{axis:"z"}),m(t,e,p||h||r,{axis:"y",inherit:"z"}),m(t,e,p||h||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":716,"../../registry":845,"../scatter/line_defaults":1129,"../scatter/marker_defaults":1135,"../scatter/subtypes":1140,"../scatter/text_defaults":1141,"./attributes":1143}],1148:[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":690,"../../plots/gl3d":804,"./attributes":1143,"./calc":1144,"./convert":1146,"./defaults":1147}],1149:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/attributes"),i=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({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:i()}},{"../../components/colorscale/attributes":598,"../../lib/extend":707,"../../plots/attributes":761,"../../plots/template_attributes":840,"../scatter/attributes":1117}],1150:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=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,p=e._length,h=new Array(p),d=!1;for(c=0;c")}return o}function k(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,_.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":716,"../scatter/hover":1127}],1154:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),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":775,"../scatter/marker_colorbar":1134,"../scatter/select":1137,"../scatter/style":1139,"./attributes":1149,"./calc":1150,"./defaults":1151,"./event_data":1152,"./hover":1153,"./plot":1155}],1155:[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,f={xaxis:a.getFromId(t,u.xaxis||"x"),yaxis:a.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,f,r,o),s=0;s")}function h(t){return t+"°"}}(u,v,t,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}},{"../../components/fx":629,"../../constants/numerical":692,"../../lib":716,"../../plots/cartesian/axes":764,"../scatter/get_trace_color":1126,"./attributes":1156}],1161:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./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":794,"../scatter/marker_colorbar":1134,"../scatter/style":1139,"./attributes":1156,"./calc":1157,"./defaults":1158,"./event_data":1159,"./hover":1160,"./plot":1162,"./select":1163,"./style":1164}],1162:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");function f(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=o(r,e),a=r.locationmode,l=0;l=g,k=2*_,T={},A=y.makeCalcdata(e,"x"),M=x.makeCalcdata(e,"y"),E=new Array(k);for(r=0;r<_;r++)o=A[r],s=M[r],E[2*r]=o===d?NaN:o,E[2*r+1]=s===d?NaN:s;if("log"===y.type)for(r=0;r1&&a.extendFlat(s.line,p.linePositions(t,r,n)),s.errorX||s.errorY){var l=p.errorBarPositions(t,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}return s.text&&(a.extendFlat(s.text,{positions:n},p.textPosition(t,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},p.textPosition(t,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},p.textPosition(t,r,s.text,s.markerUnsel))),s}(t,0,e,E,A,M),O=h(t,b);return u(m,e),w?L.marker&&(C=2*(L.marker.sizeAvg||Math.max(L.marker.size,3))):C=l(e,_),c(t,e,y,x,A,M,C),L.errorX&&v(e,y,L.errorX),L.errorY&&v(e,x,L.errorY),L.fill&&!O.fill2d&&(O.fill2d=!0),L.marker&&!O.scatter2d&&(O.scatter2d=!0),L.line&&!O.line2d&&(O.line2d=!0),!L.errorX&&!L.errorY||O.error2d||(O.error2d=!0),L.text&&!O.glText&&(O.glText=!0),L.marker&&(L.marker.snap=_),O.lineOptions.push(L.line),O.errorXOptions.push(L.errorX),O.errorYOptions.push(L.errorY),O.fillOptions.push(L.fill),O.markerOptions.push(L.marker),O.markerSelectedOptions.push(L.markerSel),O.markerUnselectedOptions.push(L.markerUnsel),O.textOptions.push(L.text),O.textSelectedOptions.push(L.textSel),O.textUnselectedOptions.push(L.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),T._scene=O,T.index=O.count,T.x=A,T.y=M,T.positions=E,O.count++,[{x:!1,y:!1,t:T,trace:e}]}},{"../../constants/numerical":692,"../../lib":716,"../../plots/cartesian/autorange":763,"../../plots/cartesian/axis_ids":767,"../scatter/calc":1118,"../scatter/colorscale_calc":1120,"./constants":1167,"./convert":1168,"./scene_update":1174,"point-cluster":470}],1167:[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]}}},{}],1168:[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"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),p=t("../scatter/make_bubble_size_func"),h=t("./constants"),d=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 m(t,e){var r,a=t._length,i=t.textfont,o=t.textposition,l=Array.isArray(o)?o:[o],c=i.color,u=i.size,f=i.family,p={},h=t.texttemplate;if(h){p.text=[];var d=Array.isArray(h),g=d?Math.min(h.length,a):a,m=d?function(t){return h[t]}:function(){return h},y=e._fullLayout._d3locale;for(r=0;rh.TOO_MANY_POINTS?"rect":f.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var p=n[0],d=n[1];for(a=0;a1?l[a]:l[0]:l,d=Array.isArray(c)?c.length>1?c[a]:c[0]:c,v=g[h],m=g[d],y=u?u/.8+1:0,x=-m*y-.5*m;o.offset[a]=[v*y/p,x/p]}}return o}}},{"../../components/drawing":612,"../../components/fx/helpers":626,"../../constants/interactions":691,"../../lib":716,"../../lib/gl_format_color":713,"../../plots/cartesian/axis_ids":767,"../../registry":845,"../scatter/make_bubble_size_func":1133,"../scatter/subtypes":1140,"./constants":1167,"color-normalize":121,"fast-isnumeric":227,"svg-path-sdf":533}],1169:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("../scatter/constants"),s=t("../scatter/subtypes"),l=t("../scatter/xy_defaults"),c=t("../scatter/marker_defaults"),u=t("../scatter/line_defaults"),f=t("../scatter/fillcolor_defaults"),p=t("../scatter/text_defaults");e.exports=function(t,e,r,h){function d(r,a){return n.coerce(t,e,i,r,a)}var g=!!t.marker&&/-open/.test(t.marker.symbol),v=s.isBubble(t),m=l(t,e,h,d);if(m){var y=m-1;c--)s=x[a[c]],l=b[a[c]],u=m.c2p(s)-_,f=y.c2p(l)-w,(p=Math.sqrt(u*u+f*f))v.glText.length){var _=x-v.glText.length;for(h=0;h<_;h++)v.glText.push(new o(b))}else if(xr&&(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,x),v.fill2d&&(v.fillOptions=v.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,c=v.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(v.fillOrder[e]=u);var f,p,h=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(d[p+1]);)p-=2;0!==d[f+1]&&(h=[d[f],0]),h=h.concat(d.slice(f,p+2)),0!==d[p+1]&&(h=h.concat([d[p],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(d[p]);)p-=2;0!==d[f]&&(h=[0,d[f+1]]),h=h.concat(d.slice(f,p+2)),0!==d[p]&&(h=h.concat([0,d[p+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(h=[],a=0,i=0;i-1;for(h=0;h=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-h;if(n.getClosest(l,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=a.modHalf(e[0],360),i=e[1],o=p.project([n,i]),l=o.x-u.c2p([d,i]),c=o.y-f.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 g=l[t.index],v=g.lonlat,m=[a.modHalf(v[0],360)+h,v[1]],y=u.c2p(m),x=f.c2p(m),b=g.mrc||1;return t.x0=y-b,t.x1=y+b,t.y0=x-b,t.y1=x+b,t.color=i(c,g),t.extraText=function(t,e,r){if(!t.hovertemplate){var n=(e.hi||t.hoverinfo).split("+"),a=-1!==n.indexOf("all"),i=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,c=[];return a||i&&s?c.push("("+u(l[0])+", "+u(l[1])+")"):i?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(a||-1!==n.indexOf("text"))&&o(e,t,c),c.join("
")}function u(t){return t+"°"}}(c,g,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":629,"../../constants/numerical":692,"../../lib":716,"../scatter/get_trace_color":1126}],1181:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),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":819,"../scatter/marker_colorbar":1134,"../scattergeo/calc":1157,"./attributes":1176,"./defaults":1178,"./event_data":1179,"./hover":1180,"./plot":1182,"./select":1183}],1182:[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,a){var i=n(t,e,r,a);if(i&&!1!==i[0].index){var s=i[0];if(void 0===s.index)return i;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,o(c,u,l,s),s.hovertemplate=u.hovertemplate,i}},makeHoverPointText:o}},{"../../lib":716,"../../plots/cartesian/axes":764,"../scatter/hover":1127}],1188:[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"),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":828,"../scatter/marker_colorbar":1134,"../scatter/select":1137,"../scatter/style":1139,"./attributes":1184,"./calc":1185,"./defaults":1186,"./hover":1187,"./plot":1189}],1189:[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=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,h,_)),y.text&&(l.extendFlat(y.text,{positions:_},s.textPosition(t,h,y.text,y.marker)),l.extendFlat(y.textSel,{positions:_},s.textPosition(t,h,y.text,y.markerSel)),l.extendFlat(y.textUnsel,{positions:_},s.textPosition(t,h,y.text,y.markerUnsel))),y.fill&&!p.fill2d&&(p.fill2d=!0),y.marker&&!p.scatter2d&&(p.scatter2d=!0),y.line&&!p.line2d&&(p.line2d=!0),y.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(y.line),p.fillOptions.push(y.fill),p.markerOptions.push(y.marker),p.markerSelectedOptions.push(y.markerSel),p.markerUnselectedOptions.push(y.markerUnsel),p.textOptions.push(y.text),p.textSelectedOptions.push(y.textSel),p.textUnselectedOptions.push(y.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),d.x=w,d.y=k,d.rawx=w,d.rawy=k,d.r=v,d.theta=m,d.positions=_,d._scene=p,d.index=p.count,p.count++}})),i(t,e,r)}}},{"../../lib":716,"../scattergl/constants":1167,"../scattergl/convert":1168,"../scattergl/plot":1173,"../scattergl/scene_update":1174,"fast-isnumeric":227,"point-cluster":470}],1196:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../plots/template_attributes").texttemplateAttrs,i=t("../scatter/attributes"),o=t("../../plots/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../components/drawing/attributes").dash,c=t("../../lib/extend").extendFlat,u=i.marker,f=i.line,p=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({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:a({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},i.hovertext,{}),line:{color:f.color,width:f.width,dash:l,shape:c({},f.shape,{values:["linear","spline"]}),smoothing:f.smoothing,editType:"calc"},connectgaps:i.connectgaps,cliponaxis:i.cliponaxis,fill:c({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i.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:p.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:i.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":598,"../../components/drawing/attributes":611,"../../lib/extend":707,"../../plots/attributes":761,"../../plots/template_attributes":840,"../scatter/attributes":1117}],1197:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=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,p,h,d,g=t._fullLayout[e.subplot].sum,v=e.sum||g,m={a:e.a,b:e.b,c:e.c};for(r=0;r"),s.hovertemplate=d.hovertemplate,o}function y(t,e){v.push(t._hovertitle+": "+e)}}},{"../../plots/cartesian/axes":764,"../scatter/hover":1127}],1201:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),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":841,"../scatter/marker_colorbar":1134,"../scatter/select":1137,"../scatter/style":1139,"./attributes":1196,"./calc":1197,"./defaults":1198,"./event_data":1199,"./hover":1200,"./plot":1202}],1202:[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":1136}],1203:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../scattergl/attributes"),s=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template").templatedArray,c=t("../../lib/extend").extendFlat,u=n.marker,f=u.line,p=c(a("marker.line",{editTypeOverride:"calc"}),{width:c({},f.width,{editType:"calc"}),editType:"calc"}),h=c(a("marker"),{symbol:u.symbol,size:c({},u.size,{editType:"markerSize"}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,colorbar:u.colorbar,line:p,editType:"calc"});function d(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[t],editType:"plot"}}}h.color.editType=h.cmin.editType=h.cmax.editType="style",e.exports={dimensions:l("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:c({},o.text,{}),hovertext:c({},o.hovertext,{}),hovertemplate:i(),marker:h,xaxes:d("x"),yaxes:d("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:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}},{"../../components/colorscale/attributes":598,"../../lib/extend":707,"../../plot_api/plot_template":754,"../../plots/cartesian/constants":770,"../../plots/template_attributes":840,"../scatter/attributes":1117,"../scattergl/attributes":1165}],1204:[function(t,e,r){"use strict";var n=t("regl-line2d"),a=t("../../registry"),i=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,u="splom";function f(t,e,r){for(var n=r.matrixOptions.data.length,a=e._visibleDims,i=r.viewOpts.ranges=new Array(n),o=0;op?2*(b.sizeAvg||Math.max(b.size,3)):i(e,x),h=0;hi&&l?r._splomSubplots[E]=1:a-1,A=!0;if("lasso"===y||"select"===y||p.selectedpoints||T){var M=p._length;if(p.selectedpoints){d.selectBatch=p.selectedpoints;var E=p.selectedpoints,S={};for(s=0;sd[m-1]?"-":"+")+"x")).replace("y",(g[0]>g[m-1]?"-":"+")+"y")).replace("z",(v[0]>v[m-1]?"-":"+")+"z");var V=function(){m=0,B=[],N=[],j=[]};(!m||m2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function h(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,a=t.dataScale,u=e._len,f={};function d(t,e){var n=r[e],o=a[c[e]];return i.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"),v=d(e._Ys,"yaxis"),m=d(e._Zs,"zaxis");f.meshgrid=[g,v,m],f.gridFill=e._gridFill;var y=e._slen;if(y)f.startingPositions=l(d(e.starts.x.slice(0,y),"xaxis"),d(e.starts.y.slice(0,y),"yaxis"),d(e.starts.z.slice(0,y),"zaxis"));else{for(var x=v[0],b=p(g),_=p(m),w=new Array(b.length*_.length),k=0,T=0;T=0};v?(r=Math.min(g.length,y.length),l=function(t){return T(g[t])&&A(t)},u=function(t){return String(g[t])}):(r=Math.min(m.length,y.length),l=function(t){return T(m[t])&&A(t)},u=function(t){return String(m[t])}),b&&(r=Math.min(r,x.length));for(var M=0;M1){for(var L=i.randstr(),O=0;O<_.length;O++)""===_[O].pid&&(_[O].pid=L);_.unshift({hasMultipleRoots:!0,id:L,pid:"",label:""})}}else{var P,I=[];for(P in w)k[P]||I.push(P);if(1!==I.length)return i.warn("Multiple implied roots, cannot build "+e.type+" hierarchy.");P=I[0],_.unshift({hasImpliedRoot:!0,id:P,pid:"",label:P})}try{h=n.stratify().id((function(t){return t.id})).parentId((function(t){return t.pid}))(_)}catch(t){return i.warn("Failed to build "+e.type+" hierarchy. Error: "+t.message)}var D=n.hierarchy(h),z=!1;if(b)switch(e.branchvalues){case"remainder":D.sum((function(t){return t.data.v}));break;case"total":D.each((function(t){var e=t.data.data,r=e.v;if(t.children){var n=t.children.reduce((function(t,e){return t+e.data.data.v}),0);if((e.hasImpliedRoot||e.hasMultipleRoots)&&(r=n),r"),name:T||I("name")?l.name:void 0,color:k("hoverlabel.bgcolor")||y.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:T,hovertemplateLabels:L,eventData:[f(a,l,p.eventDataKeys)]};v&&(R.x0=E-a.rInscribed*a.rpx1,R.x1=E+a.rInscribed*a.rpx1,R.idealAlign=a.pxmid[0]<0?"left":"right"),m&&(R.x=E,R.idealAlign=E<0?"left":"right"),o.loneHover(R,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r}),d._hasHoverLabel=!0}if(m){var F=t.select("path.surface");p.styleOne(F,a,l,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:[f(a,l,p.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:[f(s,i,p.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(a._hoverlayer.node()),d._hasHoverLabel=!1),m){var l=t.select("path.surface");p.styleOne(l,s,i,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,i=r._fullData[d.index];if(!1===l.triggerHandler(r,"plotly_"+d.type+"click",{points:[f(t,i,p.eventDataKeys)],event:n.event})||v&&(c.isHierarchyRoot(t)||c.isLeaf(t)))e.hovermode&&(r._hoverdata=[f(t,i,p.eventDataKeys)],o.click(r,n.event));else if(!r._dragging&&!r._transitioning){a.call("_storeDirectGUIEdit",i,e._tracePreGUI[i.uid],{level:i.level});var s=c.getPtId(t),u=c.isEntry(t)?c.findEntryWithChild(g,s):c.findEntryWithLevel(g,s),h={data:[{level:c.getPtId(u)}],traces:[d.index]},m={frame:{redraw:!1,duration:p.transitionTime},transition:{duration:p.transitionTime,easing:p.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),a.call("animate",r,h,m)}}))}},{"../../components/fx":629,"../../components/fx/helpers":626,"../../lib":716,"../../lib/events":706,"../../registry":845,"../pie/helpers":1096,"./helpers":1225,d3:164}],1225:[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":591,"../../lib":716,"../../lib/setcursor":736,"../pie/helpers":1096}],1226:[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":1134,"./attributes":1219,"./base_plot":1220,"./calc":1221,"./defaults":1223,"./layout_attributes":1227,"./layout_defaults":1228,"./plot":1229,"./style":1230}],1227:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1228:[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":716,"./layout_attributes":1227}],1229:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-hierarchy"),i=t("../../components/drawing"),o=t("../../lib"),s=t("../../lib/svg_text_utils"),l=t("../pie/plot").transformInsideText,c=t("./style").styleOne,u=t("./fx"),f=t("./constants"),p=t("./helpers");function h(t,e,h,d){var g=t._fullLayout,v=p.hasTransition(d),m=n.select(h).selectAll("g.slice"),y=e[0],x=y.trace,b=y.hierarchy,_=p.findEntryWithLevel(b,x.level),w=p.getMaxDepth(x),k=g._size,T=x.domain,A=k.w*(T.x[1]-T.x[0]),M=k.h*(T.y[1]-T.y[0]),E=.5*Math.min(A,M),S=y.cx=k.l+k.w*(T.x[1]+T.x[0])/2,C=y.cy=k.t+k.h*(1-T.y[0])-M/2;if(!_)return m.remove();var L=null,O={};v&&m.each((function(t){O[p.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!L&&p.isEntry(t)&&(L=t)}));var P=function(t){return a.partition().size([2*Math.PI,t.height+1])(t)}(_).descendants(),I=_.height+1,D=0,z=w;y.hasMultipleRoots&&p.isHierarchyRoot(_)&&(P=P.slice(1),I-=1,D=1,z+=1),P=P.filter((function(t){return t.y1<=z}));var R=Math.min(I,w),F=function(t){return(t-D)/R*E},B=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},N=function(t){return o.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,S,C)},j=function(t){return S+t.pxmid[0]*t.transform.rCenter+(t.transform.x||0)},V=function(t){return C+t.pxmid[1]*t.transform.rCenter+(t.transform.y||0)};(m=m.data(P,p.getPtId)).enter().append("g").classed("slice",!0),v?m.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=p.getPtId(t),a=O[r],i=O[p.getPtId(_)];if(i){var o=t.x1>i.x1?2*Math.PI:0;e=t.rpx1U?2*Math.PI:0;e={x0:i,x1:i}}else e={rpx0:E,rpx1:E},o.extendFlat(e,G(t));else e={rpx0:0,rpx1:0};else e={x0:0,x1:0};return n.interpolate(e,a)}(t);return function(t){return N(e(t))}})):d.attr("d",N),h.call(u,_,t,e,{eventDataKeys:f.eventDataKeys,transitionTime:f.CLICK_TRANSITION_TIME,transitionEasing:f.CLICK_TRANSITION_EASING}).call(p.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),d.call(c,a,x);var m=o.ensureSingle(h,"g","slicetext"),b=o.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)}));b.text(r.formatSliceLabel(a,_,x,e,g)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,p.determineTextFont(x,a,g.font)).call(s.convertToTspans,t);var w=i.bBox(b.node());a.transform=l(w,a,y),a.translateX=j(a),a.translateY=V(a);var k=function(t,e){return"translate("+t.translateX+","+t.translateY+")"+(t.transform.scale<1?"scale("+t.transform.scale+")":"")+(t.transform.rotate?"rotate("+t.transform.rotate+")":"")+"translate("+-(e.left+e.right)/2+","+-(e.top+e.bottom)/2+")"};v?b.transition().attrTween("transform",(function(t){var e=function(t){var e,r=O[p.getPtId(t)],a=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{scale:0,rotate:a.rotate,rCenter:a.rCenter,x:a.x,y:a.y}},L)if(t.parent)if(U){var i=t.x1>U?2*Math.PI:0;e.x0=e.x1=i}else o.extendFlat(e,G(t));else e.x0=e.x1=0;else e.x0=e.x1=0;var s=n.interpolate(e.rpx1,t.rpx1),l=n.interpolate(e.x0,t.x0),c=n.interpolate(e.x1,t.x1),u=n.interpolate(e.transform.scale,a.scale),f=n.interpolate(e.transform.rotate,a.rotate),h=0===a.rCenter?3:0===e.transform.rCenter?1/3:1,d=n.interpolate(e.transform.rCenter,a.rCenter);return function(t){var e=s(t),r=l(t),n=c(t),i=function(t){return d(Math.pow(t,h))}(t),o={pxmid:B(e,(r+n)/2),transform:{rCenter:i,x:a.x,y:a.y}};return{rpx1:s(t),translateX:j(o),translateY:V(o),transform:{scale:u(t),rotate:f(t),rCenter:i}}}}(t);return function(t){return k(e(t),w)}})):b.attr("transform",k(a,w))}))}r.plot=function(t,e,r,a){var i,o,s=t._fullLayout._sunburstlayer,l=!r,c=p.hasTransition(r);(i=s.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(),c?(a&&(o=a()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){s.selectAll("g.trace").each((function(e){h(t,e,this,r)}))}))):i.each((function(e){h(t,e,this,r)})),l&&i.exit().remove()},r.formatSliceLabel=function(t,e,r,n,a){var i=r.texttemplate,s=r.textinfo;if(!(i||s&&"none"!==s))return"";var l=a.separators,c=n[0],u=t.data.data,f=c.hierarchy,h=p.isHierarchyRoot(t),d=p.getParent(f,t),g=p.getValue(t);if(!i){var v,m=s.split("+"),y=function(t){return-1!==m.indexOf(t)},x=[];if(y("label")&&u.label&&x.push(u.label),u.hasOwnProperty("v")&&y("value")&&x.push(p.formatValue(u.v,l)),!h){y("current path")&&x.push(p.getPath(t.data));var b=0;y("percent parent")&&b++,y("percent entry")&&b++,y("percent root")&&b++;var _=b>1;if(b){var w,k=function(t){v=p.formatPercent(w,l),_&&(v+=" of "+t),x.push(v)};y("percent parent")&&!h&&(w=g/p.getValue(d),k("parent")),y("percent entry")&&(w=g/p.getValue(e),k("entry")),y("percent root")&&(w=g/p.getValue(f),k("root"))}}return y("text")&&(v=o.castOption(r,u.i,"text"),o.isValidTextValue(v)&&x.push(v)),x.join("
")}var T=o.castOption(r,u.i,"texttemplate");if(!T)return"";var A={};u.label&&(A.label=u.label),u.hasOwnProperty("v")&&(A.value=u.v,A.valueLabel=p.formatValue(u.v,l)),A.currentPath=p.getPath(t.data),h||(A.percentParent=g/p.getValue(d),A.percentParentLabel=p.formatPercent(A.percentParent,l),A.parent=p.getPtLabel(d)),A.percentEntry=g/p.getValue(e),A.percentEntryLabel=p.formatPercent(A.percentEntry,l),A.entry=p.getPtLabel(e),A.percentRoot=g/p.getValue(f),A.percentRootLabel=p.formatPercent(A.percentRoot,l),A.root=p.getPtLabel(f),u.hasOwnProperty("color")&&(A.color=u.color);var M=o.castOption(r,u.i,"text");return(o.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=o.castOption(r,u.i,"customdata"),o.texttemplateString(T,A,a._d3locale,A,r._meta||{})}},{"../../components/drawing":612,"../../lib":716,"../../lib/svg_text_utils":740,"../pie/plot":1100,"./constants":1222,"./fx":1224,"./helpers":1225,"./style":1230,d3:164,"d3-hierarchy":158}],1230:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../lib");function o(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){t._fullLayout._sunburstlayer.selectAll(".trace").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(o,t,r)}))}))},styleOne:o}},{"../../components/color":591,"../../lib":716,d3:164}],1231:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;function c(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 u=e.exports=l(s({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:i(),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},a("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})},hoverinfo:s({},o.hoverinfo)}),"calc","nested");u.x.editType=u.y.editType=u.z.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/color":591,"../../components/colorscale/attributes":598,"../../lib/extend":707,"../../plot_api/edit_types":747,"../../plots/attributes":761,"../../plots/template_attributes":840}],1232:[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":599}],1233:[function(t,e,r){"use strict";var n=t("gl-surface3d"),a=t("ndarray"),i=t("ndarray-homography"),o=t("ndarray-fill"),s=t("../../lib").isArrayOrTypedArray,l=t("../../lib/gl_format_color").parseColorScale,c=t("../../lib/str2rgbarray"),u=t("../../components/colorscale").extractOpts,f=t("../heatmap/interp2d"),p=t("../heatmap/find_empties");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 d=h.prototype;d.getXat=function(t,e,r,n){var a=s(this.data.x)?s(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?a:n.d2l(a,0,r)},d.getYat=function(t,e,r,n){var a=s(this.data.y)?s(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?a:n.d2l(a,0,r)},d.getZat=function(t,e,r,n){var a=this.data.z[e][t];return null===a&&this.data.connectgaps&&this.data._interpolatedZ&&(a=this.data._interpolatedZ[e][t]),void 0===r?a:n.d2l(a,0,r)},d.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),a=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,a],t.traceCoordinate=[this.getXat(n,a),this.getYat(n,a),this.getZat(n,a)],t.dataCoordinate=[this.getXat(n,a,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,a,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,a,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var i=0;i<3;i++){var o=t.dataCoordinate[i];null!=o&&(t.dataCoordinate[i]*=this.scene.dataScale[i])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[a]&&void 0!==s[a][n]?t.textLabel=s[a][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var g=[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 v(t,e){if(t0){r=g[n];break}return r}function x(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),a=1,i=0;iw;)r--,r/=y(r),++r<_&&(r=w);var n=Math.round(r/t);return n>1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],o=t[0].shape[1],s=0|Math.floor(t[0].shape[0]*e+1),l=0|Math.floor(t[0].shape[1]*r+1),c=1+n+1,u=1+o+1,f=a(new Float32Array(c*u),[c,u]),p=0;p0&&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]",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"}}},{}],1240:[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 g=d.concat(h(r).map((function(){return c((d[0]||[""]).length)}))),v=e.domain,m=Math.floor(t._fullLayout._size.w*(v.x[1]-v.x[0])),y=Math.floor(t._fullLayout._size.h*(v.y[1]-v.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=p(b,y-_+n.uplift),k=f(p(x,_),[]),T=f(w,k),A={},M=e._fullInput.columnorder.concat(h(r.map((function(t,e){return e})))),E=g.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})),S=E.reduce(s,0);E=E.map((function(t){return t/S*m}));var C=Math.max(o(e.header.line.width),o(e.cells.line.width)),L={key:e.uid+t._context.staticPlot,translateX:v.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-v.y[1]),size:t._fullLayout._size,width:m,maxLineWidth:C,height:y,columnOrder:M,groupHeight:y,rowBlocks:T,headerRowBlocks:k,scrollY:0,cells:a({},e.cells,{values:r}),headerCells:a({},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:E[e]}}))};return L.columns.forEach((function(t){t.calcdata=L,t.x=u(t)})),L}},{"../../lib/extend":707,"./constants":1239,"fast-isnumeric":227}],1241:[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":707}],1242:[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&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var f,p,h=u?"":_(t.calcdata.cells.prefix,e,r)||"",d=u?"":_(t.calcdata.cells.suffix,e,r)||"",g=u?null:_(t.calcdata.cells.format,e,r)||null,v=h+(g?a.format(g)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(f=b(v)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===f?b(v):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var m=(" "===n.wrapSplitCharacter?v.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){return"translate(0 "+(I(t.rowBlocks,t.page)-t.scrollY)+")"})),t&&(S(t,r,e,c,n.prevPages,n,0),S(t,r,e,c,n.prevPages,n,1),m(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 f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(k);return M(t,f,l),s.scrollY===u}}function S(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]}));y(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(),x(o.select("."+n.cn.cellText),r,t,i),a.select(e.parentNode.parentNode).call(P)}}function L(t,e,r,i,o){return function(){if(!o.settledY){var s=a.select(e.parentNode),l=R(o),c=o.key-l.firstRowIndex,u=l.rows[c].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:u,p=Math.max(f,u);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+n.cn.columnCell).call(P),M(null,t.filter(k),0),m(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"translate("+O(o,a.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+i+")"})),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 P(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+D(e,1/0)}),0);return"translate(0 "+(D(R(t),t.key)+e)+")"})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=R(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function I(t,e){for(var r=0,n=e-1;n>=0;n--)r+=z(t[n]);return r}function D(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: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"},domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":598,"../../lib/extend":707,"../../plots/domain":789,"../../plots/template_attributes":840,"../pie/attributes":1091,"../sunburst/attributes":1219,"./constants":1248}],1246:[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":825}],1247:[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":1221}],1248:[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}},{}],1249:[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,f=c.handleDefaults;e.exports=function(t,e,r,c){function p(r,i){return n.coerce(t,e,a,r,i)}var h=p("labels"),d=p("parents");if(h&&h.length&&d&&d.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var v=p("text");p("texttemplate"),e.texttemplate||p("textinfo",Array.isArray(v)?"text+label":"label"),p("hovertext"),p("hovertemplate"),s(t,e,c,p,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var m=-1!==e.textposition.indexOf("bottom");p("marker.line.width")&&p("marker.line.color",c.paper_bgcolor);var y=p("marker.colors"),x=e._hasColorscale=u(t,"marker","colors");x?f(t,e,c,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(y||[]).length);var b=2*e.textfont.size;p("marker.pad.t",m?b/4:b),p("marker.pad.l",b/4),p("marker.pad.r",b/4),p("marker.pad.b",m?b:b/4),x&&f(t,e,c,p,{prefix:"marker.",cLetter:"c"}),e._hovered={marker:{line:{width:2,color:i.contrast(c.paper_bgcolor)}}},p("pathbar.visible")&&(n.coerceFont(p,"pathbar.textfont",c.font),p("pathbar.thickness",e.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),o(e,c,p),e._length=null}else e.visible=!1}},{"../../components/color":591,"../../components/colorscale":603,"../../lib":716,"../../plots/domain":789,"../bar/constants":857,"../bar/defaults":859,"./attributes":1245}],1250:[function(t,e,r){"use strict";var n=t("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"),f=t("../sunburst/fx");e.exports=function(t,e,r,p,h){var d=h.barDifY,g=h.width,v=h.height,m=h.viewX,y=h.viewY,x=h.pathSlice,b=h.toMoveInsideSlice,_=h.strTransform,w=h.hasTransition,k=h.handleSlicesExit,T=h.makeUpdateSliceInterpolator,A=h.makeUpdateTextInterpolator,M={},E=t._fullLayout,S=e[0],C=S.trace,L=S.hierarchy,O=g/C._entryDepth,P=u.listPath(r.data,"id"),I=s(L.copy(),[g,v],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(I=I.filter((function(t){var e=P.indexOf(t.data.id);return-1!==e&&(t.x0=O*e,t.x1=O*(e+1),t.y0=d,t.y1=d+v,t.onPathbar=!0,!0)}))).reverse(),(p=p.data(I,u.getPtId)).enter().append("g").classed("pathbar",!0),k(p,!0,M,[g,v],x),p.order();var D=p;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._hoverX=m(s.x1-v/2),s._hoverY=y(s.y1-v/2);var p=n.select(this),h=a.ensureSingle(p,"path","surface",(function(t){t.style("pointer-events","all")}));w?h.transition().attrTween("d",(function(t){var e=T(t,!0,M,[g,v]);return function(t){return x(e(t))}})):h.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,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),h.call(l,s,C,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=a.ensureSingle(p,"g","slicetext"),k=a.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)}));k.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,u.determineTextFont(C,s,E.font,C.pathdir)).call(o.convertToTspans,t),s.textBB=i.bBox(k.node()),s.transform=b(s,{onPathbar:!0}),u.isOutsideText(C,s)&&(s.transform.targetY-=u.getOutsideTextFontKey("size",C,s,E.font)-u.getInsideTextFontKey("size",C,s,E.font)),w?k.transition().attrTween("transform",(function(t){var e=A(t,!0,M,[g,v]);return function(t){return _(e(t))}})):k.attr("transform",_(s))}))}},{"../../components/drawing":612,"../../lib":716,"../../lib/svg_text_utils":740,"../sunburst/fx":1224,"../sunburst/helpers":1225,"./constants":1248,"./partition":1255,"./style":1257,d3:164}],1251:[function(t,e,r){"use strict";var n=t("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"),f=t("../sunburst/fx"),p=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,h,d){var g=d.width,v=d.height,m=d.viewX,y=d.viewY,x=d.pathSlice,b=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,k=d.handleSlicesExit,T=d.makeUpdateSliceInterpolator,A=d.makeUpdateTextInterpolator,M=d.prevEntry,E=t._fullLayout,S=e[0].trace,C=-1!==S.textposition.indexOf("left"),L=-1!==S.textposition.indexOf("right"),O=-1!==S.textposition.indexOf("bottom"),P=!O&&!S.marker.pad.t||O&&!S.marker.pad.b,I=s(r,[g,v],{packing:S.tiling.packing,squarifyratio:S.tiling.squarifyratio,flipX:S.tiling.flip.indexOf("x")>-1,flipY:S.tiling.flip.indexOf("y")>-1,pad:{inner:S.tiling.pad,top:S.marker.pad.t,left:S.marker.pad.l,right:S.marker.pad.r,bottom:S.marker.pad.b}}).descendants(),D=1/0,z=-1/0;I.forEach((function(t){var e=t.depth;e>=S._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),S._maxVisibleLayers=isFinite(z)?z-D+1:0,h.enter().append("g").classed("slice",!0),k(h,!1,{},[g,v],x),h.order();var R=null;if(w&&M){var F=u.getPtId(M);h.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:v}},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){var h=u.isHeader(s,S);s._hoverX=m(s.x1-S.marker.pad.r),s._hoverY=y(O?s.y1-S.marker.pad.b/2:s.y0+S.marker.pad.t/2);var d=n.select(this),k=a.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events","all")}));w?k.transition().attrTween("d",(function(t){var e=T(t,!1,B(),[g,v]);return function(t){return x(e(t))}})):k.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}),k.call(l,s,S,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h?P?"":u.getPtLabel(s)||"":p(s,r,S,e,E)||"";var M=a.ensureSingle(d,"g","slicetext"),I=a.ensureSingle(M,"text","",(function(t){t.attr("data-notex",1)}));I.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",L?"end":C||h?"start":"middle").call(i.font,u.determineTextFont(S,s,E.font)).call(o.convertToTspans,t),s.textBB=i.bBox(I.node()),s.transform=b(s,{isHeader:h}),w?I.transition().attrTween("transform",(function(t){var e=A(t,!1,B(),[g,v]);return function(t){return _(e(t))}})):I.attr("transform",_(s))})),R}},{"../../components/drawing":612,"../../lib":716,"../../lib/svg_text_utils":740,"../sunburst/fx":1224,"../sunburst/helpers":1225,"../sunburst/plot":1229,"./constants":1248,"./partition":1255,"./style":1257,d3:164}],1252:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"treemap",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":1134,"./attributes":1245,"./base_plot":1246,"./calc":1247,"./defaults":1249,"./layout_attributes":1253,"./layout_defaults":1254,"./plot":1256,"./style":1257}],1253:[function(t,e,r){"use strict";e.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1254:[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("treemapcolorway",e.colorway),r("extendtreemapcolors")}},{"../../lib":716,"./layout_attributes":1253}],1255:[function(t,e,r){"use strict";var n=t("d3-hierarchy");e.exports=function(t,e,r){var a,i=r.flipX,o=r.flipY,s="dice-slice"===r.packing,l=r.pad[o?"bottom":"top"],c=r.pad[i?"right":"left"],u=r.pad[i?"left":"right"],f=r.pad[o?"top":"bottom"];s&&(a=c,c=l,l=a,a=u,u=f,f=a);var p=n.treemap().tile(function(t,e){switch(t){case"squarify":return n.treemapSquarify.ratio(e);case"binary":return n.treemapBinary;case"dice":return n.treemapDice;case"slice":return n.treemapSlice;default:return n.treemapSliceDice}}(r.packing,r.squarifyratio)).paddingInner(r.pad.inner).paddingLeft(c).paddingRight(u).paddingTop(l).paddingBottom(f).size(s?[e[1],e[0]]:e)(t);return(s||i||o)&&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?E+L:-(C+L):0,P={x0:S,x1:S,y0:O,y1:O+C},I=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{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}},D=null,z={},R={},F=null,B=function(t,e){return e?z[p(t)]:R[p(t)]},N=function(t,e,r,n){if(e)return z[p(v)]||P;var a=R[g.level]||r;return function(t){return t.data.depth-m.data.depth=(n-=v.r-s)){var m=(r+n)/2;r=m-s,n=m+s}var y;u?a<(y=i-v.b)&&y"===K?(l.x-=i,c.x-=i,u.x-=i,f.x-=i):"/"===K?(u.x-=i,f.x-=i,o.x-=i/2,s.x-=i/2):"\\"===K?(l.x-=i,c.x-=i,o.x-=i/2,s.x-=i/2):"<"===K&&(o.x-=i,s.x-=i),J(l),J(f),J(o),J(c),J(u),J(s),"M"+X(l.x,l.y)+"L"+X(c.x,c.y)+"L"+X(s.x,s.y)+"L"+X(u.x,u.y)+"L"+X(f.x,f.y)+"L"+X(o.x,o.y)+"Z"},toMoveInsideSlice:$,makeUpdateSliceInterpolator:tt,makeUpdateTextInterpolator:et,handleSlicesExit:rt,hasTransition:w,strTransform:nt})}e.exports=function(t,e,r,i){var o,s,l=t._fullLayout._treemaplayer,c=!r;(o=l.selectAll("g.trace.treemap").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("treemap",!0),o.order(),a(r)?(i&&(s=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){s&&s()})).each("interrupt",(function(){s&&s()})).each((function(){l.selectAll("g.trace").each((function(e){h(t,e,this,r)}))}))):o.each((function(e){h(t,e,this,r)})),c&&o.exit().remove()}},{"../../lib":716,"../bar/constants":857,"../bar/plot":865,"../sunburst/helpers":1225,"./constants":1248,"./draw_ancestors":1250,"./draw_descendants":1251,d3:164}],1257:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../lib"),o=t("../sunburst/helpers");function s(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,f=u.i,p=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&&"rgba(0,0,0,0)"===p)d=0,s="rgba(0,0,0,0)",l=0;else if(s=i.castOption(r,f,"marker.line.color")||a.defaultLine,l=i.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var g=r.marker.depthfade;if(g){var v,m=a.combine(a.addOpacity(r._backgroundColor,.75),p);if(!0===g){var y=o.getMaxDepth(r);v=isFinite(y)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else v=e.data.depth-r._entryDepth,r._atRootLevel||v++;if(v>0)for(var x=0;x0){var y,x,b,_,w,k=t.xa,T=t.ya;"h"===p.orientation?(w=e,y="y",b=T,x="x",_=k):(w=r,y="x",b=k,x="y",_=T);var A=f[t.index];if(w>=A.span[0]&&w<=A.span[1]){var M=n.extendFlat({},t),E=_.c2p(w,!0),S=o.getKdeValue(A,p,w),C=o.getPositionOnKdePath(A,p,E),L=b._offset,O=b._length;M[y+"0"]=C[0],M[y+"1"]=C[1],M[x+"0"]=M[x+"1"]=E,M[x+"Label"]=x+": "+a.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+S.toFixed(3),M.spikeDistance=m[0].spikeDistance;var P=y+"Spike";M[P]=m[0][P],m[0].spikeDistance=void 0,m[0][P]=void 0,M.hovertemplate=!1,v.push(M),(u={stroke:t.color})[y+"1"]=n.constrain(L+C[0],L,L+O),u[y+"2"]=n.constrain(L+C[1],L,L+O),u[x+"1"]=u[x+"2"]=_._offset+E}}d&&(v=v.concat(m))}-1!==h.indexOf("points")&&(c=i.hoverOnPoints(t,e,r));var I=l.selectAll(".violinline-"+p.uid).data(u?[0]:[]);return I.enter().append("line").classed("violinline-"+p.uid,!0).attr("stroke-width",1.5),I.exit().remove(),I.attr(u),"closest"===s?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":716,"../../plots/cartesian/axes":764,"../box/hover":883,"./helpers":1262}],1264:[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":775,"../box/defaults":881,"../box/select":888,"../scatter/style":1139,"./attributes":1258,"./calc":1259,"./cross_trace_calc":1260,"./defaults":1261,"./hover":1263,"./layout_attributes":1265,"./layout_defaults":1266,"./plot":1267,"./style":1268}],1265:[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":716,"../box/layout_attributes":885}],1266:[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":716,"../box/layout_defaults":886,"./layout_attributes":1265}],1267:[function(t,e,r){"use strict";var n=t("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,f=e.xaxis,p=e.yaxis;function h(t){var e=s(t,{xaxis:f,yaxis:p,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,g=s.bdPos,v=e[s.valLetter+"axis"],m=e[s.posLetter+"axis"],y="both"===c.side,x=y||"positive"===c.side,b=y||"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(t){var e,r,a,i,o,l,f,p,_=n.select(this),w=t.density,k=w.length,T=m.c2l(t.pos+d,!0),A=m.l2p(T);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(k),o=0;o")),c.color=function(t,e){var r=t[e.dir].marker,n=r.color,i=r.line.color,o=r.line.width;return a(n)?n:a(i)&&o?i:void 0}(f,d),[c]}function w(t){return n(h,t)}}},{"../../components/color":591,"../../constants/delta.js":686,"../../plots/cartesian/axes":764,"../bar/hover":861}],1280:[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":775,"../bar/select":866,"./attributes":1273,"./calc":1274,"./cross_trace_calc":1276,"./defaults":1277,"./event_data":1278,"./hover":1279,"./layout_attributes":1281,"./layout_defaults":1282,"./plot":1283,"./style":1284}],1281:[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"}}},{}],1282:[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&&(g+=f?"M"+u[0]+","+h[1]+"V"+h[0]:"M"+u[1]+","+h[0]+"H"+u[0]),"between"!==p&&(r.isSum||o path").each((function(t){if(!t.isBlank){var e=l[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",l.selectedpoints&&!t.selected?o:1)}})),s(r,l,t),r.selectAll(".lines").each((function(){var t=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":591,"../../components/drawing":612,"../../constants/interactions":691,"../bar/style":868,d3:164}],1285:[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,a=e.c2d;switch(r){case"count":return f;case"first":return p;case"last":return h;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 p(t)>s};case">=":return function(t){return p(t)>=s};case"[]":return function(t){var e=p(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=p(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=p(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=p(t);return es[1]};case"](":return function(t){var e=p(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=p(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(p(t))};case"}{":return function(t){return-1===s.indexOf(p(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),p),x={},b={},_=0;d?(v=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(v=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=x[t.astr][e];t.get().push(r)}),T(v);for(var w=o(e.transforms,r),k=0;k1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(i=0;iConsensus",en:"Consensus",id:"".concat(i.default.maxBy(r,"id").id+1,"")},u=(0,o.getConsensus)(t);a=[].concat(s(e),[u]),l=[].concat(s(r),[c])}return{sequencesArray:a,sequencesInfo:l}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.xhr=e.seqs=e.parser=e.newick=e.matrix=e.gff=e.fasta=e.clustal=void 0;var n=u(r(76)),a=u(r(96)),i=u(r(98)),o=u(r(100)),s=u(r(101)),l=u(r(46)),c=u(r(50));function u(t){return t&&t.__esModule?t:{default:t}}e.clustal=n.default,e.fasta=a.default,e.gff=i.default,e.matrix=o.default,e.newick=s.default,e.parser=l.default,e.seqs=c.default;var f=r(53);e.xhr=f;var p="imported";"undefined"!=typeof IO_VERSION&&(p=IO_VERSION);e.version=p},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(46)),a=i(r(50));function i(t){return t&&t.__esModule?t:{default:t}}var o;e.default=o={parse:function(t){var e=[];if("[object Array]"===Object.prototype.toString.call(t))var r=t;else r=t.split("\n");if(!1===r[0].slice(0,6))throw new Error("Invalid CLUSTAL Header");for(var n=0,i=1,o=0;n=e.length){var f=a.default.getMeta(c.trim());c=f.name;var p=new a.default.model(u,c,o);p.ids=f.ids||{},p.details=f.details||{};var h=Object.keys(p.ids);h.length>0&&(p.id=p.ids[h[0]]),e.push(p)}else e[o].seq+=u;o++}else console.log("parse error",s)}}else i=1;else i=1}return e}},n.default.mixin(o)},function(t,e,r){(function(e){var r;r="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=r}).call(this,r(45))},function(t,e){t.exports=function(t){var e=r.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var r=Object.prototype.toString},function(t,e,r){var n=r(80),a=r(94);t.exports=function(t){if(!t)return{};var e={};return a(n(t).split("\n"),(function(t){var r,a=t.indexOf(":"),i=n(t.slice(0,a)).toLowerCase(),o=n(t.slice(a+1));void 0===e[i]?e[i]=o:(r=e[i],"[object Array]"===Object.prototype.toString.call(r)?e[i].push(o):e[i]=[e[i],o])})),e}},function(t,e,r){"use strict";var n=r(48),a=r(54),i=r(55),o=r(56),s=r(93),l=n.call(Function.call,o());a(l,{getPolyfill:o,implementation:i,shim:s}),t.exports=l},function(t,e,r){"use strict";var n="Function.prototype.bind called on incompatible ",a=Array.prototype.slice,i=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==i.call(e))throw new TypeError(n+e);for(var r,o=a.call(arguments,1),s=function(){if(this instanceof r){var n=e.apply(this,o.concat(a.call(arguments)));return Object(n)===n?n:this}return e.apply(t,o.concat(a.call(arguments)))},l=Math.max(0,e.length-o.length),c=[],u=0;u0&&!n.call(t,0))for(var g=0;g0)for(var v=0;v=0&&"[object Function]"===n.call(t.callee)),r}},function(t,e,r){"use strict";var n=r(85),a=n("%Object%"),i=n("%TypeError%"),o=n("%String%"),s=r(86),l=r(87),c=r(88),u=r(89),f=r(49),p=r(90),h=r(92),d={ToPrimitive:p,ToBoolean:function(t){return!!t},ToNumber:function(t){return+t},ToInteger:function(t){var e=this.ToNumber(t);return s(e)?0:0!==e&&l(e)?c(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(s(e)||0===e||!l(e))return 0;var r=c(e)*Math.floor(Math.abs(e));return u(r,65536)},ToString:function(t){return o(t)},ToObject:function(t){return this.CheckObjectCoercible(t),a(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new i(e||"Cannot call method on "+t);return t},IsCallable:f,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:s(t)&&s(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0},IsPropertyDescriptor:function(t){if("Object"!==this.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(h(t,r)&&!e[r])return!1;var n=h(t,"[[Value]]"),a=h(t,"[[Get]]")||h(t,"[[Set]]");if(n&&a)throw new i("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new i("Desc must be a Property Descriptor");return!(!h(t,"[[Get]]")&&!h(t,"[[Set]]"))},IsDataDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new i("Desc must be a Property Descriptor");return!(!h(t,"[[Value]]")&&!h(t,"[[Writable]]"))},IsGenericDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new i("Desc must be a Property Descriptor");return!this.IsAccessorDescriptor(t)&&!this.IsDataDescriptor(t)},FromPropertyDescriptor:function(t){if(void 0===t)return t;if(!this.IsPropertyDescriptor(t))throw new i("Desc must be a Property Descriptor");if(this.IsDataDescriptor(t))return{value:t["[[Value]]"],writable:!!t["[[Writable]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};if(this.IsAccessorDescriptor(t))return{get:t["[[Get]]"],set:t["[[Set]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};throw new i("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(t){if("Object"!==this.Type(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(h(t,"enumerable")&&(e["[[Enumerable]]"]=this.ToBoolean(t.enumerable)),h(t,"configurable")&&(e["[[Configurable]]"]=this.ToBoolean(t.configurable)),h(t,"value")&&(e["[[Value]]"]=t.value),h(t,"writable")&&(e["[[Writable]]"]=this.ToBoolean(t.writable)),h(t,"get")){var r=t.get;if(void 0!==r&&!this.IsCallable(r))throw new TypeError("getter must be a function");e["[[Get]]"]=r}if(h(t,"set")){var n=t.set;if(void 0!==n&&!this.IsCallable(n))throw new i("setter must be a function");e["[[Set]]"]=n}if((h(e,"[[Get]]")||h(e,"[[Set]]"))&&(h(e,"[[Value]]")||h(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}};t.exports=d},function(t,e,r){"use strict";var n=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=Object.getPrototypeOf||function(t){return t.__proto__},o=void 0,s="undefined"==typeof Uint8Array?void 0:i(Uint8Array),l={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":a?i([][Symbol.iterator]()):void 0,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":void 0,"$ %AsyncFunction%":void 0,"$ %AsyncFunctionPrototype%":void 0,"$ %AsyncGenerator%":void 0,"$ %AsyncGeneratorFunction%":void 0,"$ %AsyncGeneratorPrototype%":void 0,"$ %AsyncIteratorPrototype%":o&&a&&Symbol.asyncIterator?o[Symbol.asyncIterator]():void 0,"$ %Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"==typeof DataView?void 0:DataView,"$ %DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"$ %Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"$ %Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"$ %Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":void 0,"$ %GeneratorFunction%":void 0,"$ %GeneratorPrototype%":void 0,"$ %Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"$ %Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"$ %Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"$ %Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"$ %Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"$ %Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":a?i(i([][Symbol.iterator]())):void 0,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":"undefined"==typeof Map?void 0:Map,"$ %MapIteratorPrototype%":"undefined"!=typeof Map&&a?i((new Map)[Symbol.iterator]()):void 0,"$ %MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"==typeof Promise?void 0:Promise,"$ %PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"$ %PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"$ %Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"$ %Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"$ %Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"$ %Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"==typeof Set?void 0:Set,"$ %SetIteratorPrototype%":"undefined"!=typeof Set&&a?i((new Set)[Symbol.iterator]()):void 0,"$ %SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"$ %SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":a?i(""[Symbol.iterator]()):void 0,"$ %StringPrototype%":String.prototype,"$ %Symbol%":a?Symbol:void 0,"$ %SymbolPrototype%":a?Symbol.prototype:void 0,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":n,"$ %TypedArray%":s,"$ %TypedArrayPrototype%":s?s.prototype:void 0,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"$ %Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"$ %WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"$ %WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"$ %WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype};t.exports=function(t,e){if(arguments.length>1&&"boolean"!=typeof e)throw new TypeError('"allowMissing" argument must be a boolean');var r="$ "+t;if(!(r in l))throw new SyntaxError("intrinsic "+t+" does not exist!");if(void 0===l[r]&&!e)throw new TypeError("intrinsic "+t+" exists, but is not available. Please file an issue!");return l[r]}},function(t,e){t.exports=Number.isNaN||function(t){return t!=t}},function(t,e){var r=Number.isNaN||function(t){return t!=t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},function(t,e){t.exports=function(t){return t>=0?1:-1}},function(t,e){t.exports=function(t,e){var r=t%e;return Math.floor(r>=0?r:r+e)}},function(t,e,r){"use strict";var n=Object.prototype.toString,a=r(91),i=r(49),o=function(t){var e;if((e=arguments.length>1?arguments[1]:"[object Date]"===n.call(t)?String:Number)===String||e===Number){var r,o,s=e===String?["toString","valueOf"]:["valueOf","toString"];for(o=0;o1?o(t,arguments[1]):o(t)}},function(t,e){t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,r){"use strict";var n=r(48);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,r){"use strict";var n=r(54),a=r(56);t.exports=function(){var t=a();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},function(t,e,r){"use strict";var n=r(49),a=Object.prototype.toString,i=Object.prototype.hasOwnProperty,o=function(t,e,r){for(var n=0,a=t.length;n=3&&(i=r),"[object Array]"===a.call(t)?o(t,e,i):"string"==typeof t?s(t,e,i):l(t,e,i)}},function(t,e){t.exports=function(){for(var t={},e=0;e"===i[0]||";"===i[0]){var o=i.slice(1).trim(),l=r(o.trim());o=l.name;var c=l.id||e.length,u=new n.default.model("",l.name,c);u.ids=l.ids||{},u.details=l.details||{},e.push(u)}else u.seq+=i}return e},write:function(t,e){for(var r="",a=0;a"+i.name+"\n",r+=n.default.splitNChars(i.seq,80).join("\n"),r+="\n"}return r}},i.default.mixin(s)},function(t,e,r){"use strict";function n(t,e,r){for(var n=[],a=ti;a?o++:o--)n.push(o);return n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){t=t||{};for(var e=n(0,arguments.length,!1),r=0;r=0)break;var s=o.split(/\t/),l=s[0].trim();if("GFF"===l)break;if(2===s.length)if("startgroup"===l)e=s[1].trim();else{if("endgroup"===l){e="";continue}r[s[0]]=a.parseColor(s[1])}else if(s.length>=5){var c=a.parseLine(s);e&&(c.attributes.Parent=e),i.push(c)}}return{offset:n,colors:r,features:i}},a.parseColor=function(t){return t.indexOf(",")>=0?(0,n.rgbToHex)(t.split(",").map((function(t){return parseInt(t)}))):6===t.length&&parseInt(t.charAt(0),16)<=16&&"bisque"!==t?"#"+t:t},a.parseLine=function(t){var e={attributes:{}};return e.attributes.Name=t[0].trim(),e.seqname=t[1].trim(),e.start=parseInt(t[3]),e.end=parseInt(t[4]),e.feature=t[5].trim(),"ID_NOT_SPECIFIED"===e.seqname&&(e.seqname=t[2].trim()),e}},function(t,e,r){"use strict";var n,a=r(46),i=(n=a)&&n.__esModule?n:{default:n};var o=function t(e){return this.constructor!=t?new t(e):(this.matrix={},this.parsingOrder=[],null!=e&&this.parse(e),this)};i.default.mixin(o),t.exports=o,o.prototype.parse=function(t){return t.split("\n").forEach(function(t){this.parseLine(t)}.bind(this)),this.buildMatrix(),this.matrix},o.read=function(t,e){return(new o).read(t,e)},o.parse=function(t){return(new o).parse(t)},o.prototype.parseLine=function(t){var e=t.charAt(0);if("#"!==e){this.parsingOrder.push(e);for(var r=t.substring(1).split(/\s+/).filter((function(t){return t.length>0})).map((function(t){return parseInt(t)})),n={},a=0;a=0;t--){var e=this.parsingOrder[t],r=this.matrix[e];for(var n in r)this.matrix[n][e]=r[n]}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseNhx=e.parse=void 0;var n=i(r(102)),a=i(r(103));function i(t){return t&&t.__esModule?t:{default:t}}var o={};o.parse=n.default,o.parseNhx=a.default,e.default=o,e.parse=n.default,e.parseNhx=a.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=[],r={},n=t.split(/\s*(;|\(|\)|,|:)\s*/),a=0;a1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n.default.isString(t)?(e=x[t]||g.default,b.includes(t)?(r="#ffffff",a=1):(r="#444444",a=.75)):(e=t,r="#ffffff",a=1),i&&(r=i),o&&(a=o);var s=_(e),l=s.colormap,c=s.colorscale;return{colormap:l,colorscale:c,textcolor:r,opacity:a}}},function(t,e,r){"use strict";t.exports={A:"#00a35c",R:"#00fc03",N:"#00eb14",D:"#00eb14",C:"#0000ff",Q:"#00f10e",E:"#00f10e",G:"#009d62",H:"#00d52a",I:"#0054ab",L:"#007b84",K:"#00ff00",M:"#009768",F:"#008778",P:"#00e01f",S:"#00d52a",T:"#00db24",W:"#00a857",Y:"#00e619",V:"#005fa0",B:"#00eb14",X:"#00b649",Z:"#00f10e"}},function(t,e,r){"use strict";t.exports={A:"#BBBBBB",B:"grey",C:"yellow",D:"red",E:"red",F:"magenta",G:"brown",H:"#00FFFF",I:"#BBBBBB",J:"#fff",K:"#00FFFF",L:"#BBBBBB",M:"#BBBBBB",N:"green",O:"#fff",P:"brown",Q:"green",R:"#00FFFF",S:"green",T:"green",U:"#fff",V:"#BBBBBB",W:"magenta",X:"grey",Y:"magenta",Z:"grey","-":"grey"}},function(t,e,r){"use strict";t.exports={A:"orange",B:"#fff",C:"green",D:"red",E:"red",F:"blue",G:"orange",H:"red",I:"green",J:"#fff",K:"red",L:"green",M:"green",N:"#fff",O:"#fff",P:"orange",Q:"#fff",R:"red",S:"orange",T:"orange",U:"#fff",V:"green",W:"blue",X:"#fff",Y:"blue",Z:"#fff"}},function(t,e,r){"use strict";t.exports={A:"#80a0f0",R:"#f01505",N:"#00ff00",D:"#c048c0",C:"#f08080",Q:"#00ff00",E:"#c048c0",G:"#f09048",H:"#15a4a4",I:"#80a0f0",L:"#80a0f0",K:"#f01505",M:"#80a0f0",F:"#80a0f0",P:"#ffff00",S:"#00ff00",T:"#00ff00",W:"#80a0f0",Y:"#15a4a4",V:"#80a0f0",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,r){"use strict";t.exports={A:"#e718e7",R:"#6f906f",N:"#1be41b",D:"#778877",C:"#23dc23",Q:"#926d92",E:"#ff00ff",G:"#00ff00",H:"#758a75",I:"#8a758a",L:"#ae51ae",K:"#a05fa0",M:"#ef10ef",F:"#986798",P:"#00ff00",S:"#36c936",T:"#47b847",W:"#8a758a",Y:"#21de21",V:"#857a85",B:"#49b649",X:"#758a75",Z:"#c936c9"}},function(t,e,r){"use strict";t.exports={A:"#ad0052",B:"#0c00f3",C:"#c2003d",D:"#0c00f3",E:"#0c00f3",F:"#cb0034",G:"#6a0095",H:"#1500ea",I:"#ff0000",J:"#fff",K:"#0000ff",L:"#ea0015",M:"#b0004f",N:"#0c00f3",O:"#fff",P:"#4600b9",Q:"#0c00f3",R:"#0000ff",S:"#5e00a1",T:"#61009e",U:"#fff",V:"#f60009",W:"#5b00a4",X:"#680097",Y:"#4f00b0",Z:"#0c00f3"}},function(t,e,r){"use strict";t.exports={A:" orange",B:" #fff",C:" green",D:" red",E:" red",F:" green",G:" orange",H:" magenta",I:" green",J:" #fff",K:" red",L:" green",M:" green",N:" magenta",O:" #fff",P:" green",Q:" magenta",R:" red",S:" orange",T:" orange",U:" #fff",V:" green",W:" green",X:" #fff",Y:" green",Z:" #fff"}},function(t,e,r){"use strict";t.exports={A:" #77dd88",B:" #fff",C:" #99ee66",D:" #55bb33",E:" #55bb33",F:" #9999ff",G:" #77dd88",H:" #5555ff",I:" #66bbff",J:" #fff",K:" #ffcc77",L:" #66bbff",M:" #66bbff",N:" #55bb33",O:" #fff",P:" #eeaaaa",Q:" #55bb33",R:" #ffcc77",S:" #ff4455",T:" #ff4455",U:" #fff",V:" #66bbff",W:" #9999ff",X:" #fff",Y:" #9999ff",Z:" #fff"}},function(t,e,r){"use strict";t.exports={A:" #64F73F",C:" #FFB340",G:" #EB413C",T:" #3C88EE",U:" #3C88EE"}},function(t,e,r){"use strict";t.exports={A:" #FF83FA",C:" #40E0D0",G:" #FF83FA",R:" #FF83FA",T:" #40E0D0",U:" #40E0D0",Y:" #40E0D0"}},function(t,e,r){"use strict";t.exports={A:"#5858a7",R:"#6b6b94",N:"#64649b",D:"#2121de",C:"#9d9d62",Q:"#8c8c73",E:"#0000ff",G:"#4949b6",H:"#60609f",I:"#ecec13",L:"#b2b24d",K:"#4747b8",M:"#82827d",F:"#c2c23d",P:"#2323dc",S:"#4949b6",T:"#9d9d62",W:"#c0c03f",Y:"#d3d32c",V:"#ffff00",B:"#4343bc",X:"#797986",Z:"#4747b8"}},function(t,e,r){"use strict";t.exports={A:"#ccff00",R:"#0000ff",N:"#cc00ff",D:"#ff0000",C:"#ffff00",Q:"#ff00cc",E:"#ff0066",G:"#ff9900",H:"#0066ff",I:"#66ff00",L:"#33ff00",K:"#6600ff",M:"#00ff00",F:"#00ff66",P:"#ffcc00",S:"#ff3300",T:"#ff6600",W:"#00ccff",Y:"#00ffcc",V:"#99ff00",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,r){"use strict";t.exports={A:"#2cd3d3",R:"#708f8f",N:"#ff0000",D:"#e81717",C:"#a85757",Q:"#3fc0c0",E:"#778888",G:"#ff0000",H:"#708f8f",I:"#00ffff",L:"#1ce3e3",K:"#7e8181",M:"#1ee1e1",F:"#1ee1e1",P:"#f60909",S:"#e11e1e",T:"#738c8c",W:"#738c8c",Y:"#9d6262",V:"#07f8f8",B:"#f30c0c",X:"#7c8383",Z:"#5ba4a4"}},function(t,e,r){"use strict";t.exports={A:"#ffafaf",R:"#6464ff",N:"#00ff00",D:"#ff0000",C:"#ffff00",Q:"#00ff00",E:"#ff0000",G:"#ff00ff",H:"#6464ff",I:"#ffafaf",L:"#ffafaf",K:"#6464ff",M:"#ffafaf",F:"#ffc800",P:"#ff00ff",S:"#00ff00",T:"#00ff00",W:"#ffc800",Y:"#ffc800",V:"#ffafaf",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DropdownSelect=e.Caption=void 0;var n,a=o(r(1)),i=((n=r(0))&&n.__esModule,o(r(162)));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}function s(){return(s=Object.assign||function(t){for(var e=1;e=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}var c=function(t){return a.default.createElement("div",{style:{marginTop:-8,marginBottom:-8}},a.default.createElement("p",{style:{fontSize:12,fontColor:"#444444"}},t.children))};e.Caption=c;e.DropdownSelect=function(t){var e=t.caption,r=t.isCreatable,n=t.outerStyle,o=l(t,["caption","isCreatable","outerStyle"]);return a.default.createElement("div",{style:n},e&&a.default.createElement(c,null,e),!e&&a.default.createElement(c,null," "),r&&a.default.createElement(i.Creatable,s({allowCreate:!0},o)),!r&&a.default.createElement(i.default,o))}},function(t,e,r){"use strict";(function(t){r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return s}));var n=r(161),a=void 0!==t?t:{},i=Object(n.a)(a),o=(i.flush,i.hydrate,i.cx,i.merge,i.getRegisteredStyles,i.injectGlobal),s=(i.keyframes,i.css);i.sheet,i.caches}).call(this,r(45))},function(t,e,r){t.exports=function(){"use strict";return function(t){function e(e){if(e)try{t(e+"}")}catch(t){}}return function(r,n,a,i,o,s,l,c,u,f){switch(r){case 1:if(0===u&&64===n.charCodeAt(0))return t(n+";"),"";break;case 2:if(0===c)return n+"/*|*/";break;case 3:switch(c){case 102:case 112:return t(a[0]+n),"";default:return n+(0===f?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(e)}}}}()},function(t,e,r){(function(e){for(var n=r(123),a="undefined"==typeof window?e:window,i=["moz","webkit"],o="AnimationFrame",s=a["request"+o],l=a["cancel"+o]||a["cancelRequest"+o],c=0;!s&&c1)for(var r=1;r=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}(this.props,[]);return function(t){u.forEach((function(e){return delete t[e]}))}(a),a.className=this.props.inputClassName,a.id=this.state.inputId,a.style=r,o.default.createElement("div",{className:this.props.className,style:e},this.renderStyles(),o.default.createElement("input",n({},a,{ref:this.inputRef})),o.default.createElement("div",{ref:this.sizerRef,style:c},t),this.props.placeholder?o.default.createElement("div",{ref:this.placeHolderSizerRef,style:c},this.props.placeholder):null)}}]),e}(i.Component);d.propTypes={className:s.default.string,defaultValue:s.default.any,extraWidth:s.default.oneOfType([s.default.number,s.default.string]),id:s.default.string,injectStyles:s.default.bool,inputClassName:s.default.string,inputRef:s.default.func,inputStyle:s.default.object,minWidth:s.default.oneOfType([s.default.number,s.default.string]),onAutosize:s.default.func,onChange:s.default.func,placeholder:s.default.string,placeholderIsMinWidth:s.default.bool,style:s.default.object,value:s.default.any},d.defaultProps={minWidth:1,injectStyles:!0},e.default=d},function(t,e,r){"use strict";var n=s(r(127)),a=s(r(132)),i=s(r(63)),o=s(r(60));function s(t){return t&&t.__esModule?t:{default:t}}t.exports={Transition:o.default,TransitionGroup:i.default,ReplaceTransition:a.default,CSSTransition:n.default}},function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;!function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}e.default=t}(r(0));var n=s(r(128)),a=s(r(131)),i=s(r(1)),o=s(r(60));r(62);function s(t){return t&&t.__esModule?t:{default:t}}function l(){return(l=Object.assign||function(t){for(var e=1;e=0||(a[r]=t[r]);return a}(t,["children","in"]),o=n.default.Children.toArray(e),s=o[0],l=o[1];return delete a.onEnter,delete a.onEntering,delete a.onEntered,delete a.onExit,delete a.onExiting,delete a.onExited,n.default.createElement(i.default,a,r?n.default.cloneElement(s,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):n.default.cloneElement(l,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},o}(n.default.Component);s.propTypes={};var l=s;e.default=l,t.exports=e.default},function(t,e,r){"use strict";e.__esModule=!0,e.getChildMapping=a,e.mergeChildMappings=i,e.getInitialChildMapping=function(t,e){return a(t.children,(function(r){return(0,n.cloneElement)(r,{onExited:e.bind(null,r),in:!0,appear:o(r,"appear",t),enter:o(r,"enter",t),exit:o(r,"exit",t)})}))},e.getNextChildMapping=function(t,e,r){var s=a(t.children),l=i(e,s);return Object.keys(l).forEach((function(a){var i=l[a];if((0,n.isValidElement)(i)){var c=a in e,u=a in s,f=e[a],p=(0,n.isValidElement)(f)&&!f.props.in;!u||c&&!p?u||!c||p?u&&c&&(0,n.isValidElement)(f)&&(l[a]=(0,n.cloneElement)(i,{onExited:r.bind(null,i),in:f.props.in,exit:o(i,"exit",t),enter:o(i,"enter",t)})):l[a]=(0,n.cloneElement)(i,{in:!1}):l[a]=(0,n.cloneElement)(i,{onExited:r.bind(null,i),in:!0,exit:o(i,"exit",t),enter:o(i,"enter",t)})}})),l};var n=r(1);function a(t,e){var r=Object.create(null);return t&&n.Children.map(t,(function(t){return t})).forEach((function(t){r[t.key]=function(t){return e&&(0,n.isValidElement)(t)?e(t):t}(t)})),r}function i(t,e){function r(r){return r in e?e[r]:t[r]}t=t||{},e=e||{};var n,a=Object.create(null),i=[];for(var o in t)o in e?i.length&&(a[o]=i,i=[]):i.push(o);var s={};for(var l in e){if(a[l])for(n=0;n=4;)e=1540483477*(65535&(e=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(e>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(e=1540483477*(65535&(e^=e>>>24))+((1540483477*(e>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:n^=(255&t.charCodeAt(a+2))<<16;case 2:n^=(255&t.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),((n^=n>>>15)>>>0).toString(36)};var o=function(t){function e(t,e,n){var a=e.trim().split(d);e=a;var i=a.length,o=t.length;switch(o){case 0:case 1:var s=0;for(t=0===o?"":t[0]+" ";sn&&(n=(e=e.trim()).charCodeAt(0)),n){case 38:return e.replace(g,"$1"+t.trim());case 58:return t.trim()+e.replace(g,"$1"+t.trim());default:if(0<1*r&&0l.charCodeAt(8))break;case 115:o=o.replace(l,"-webkit-"+l)+";"+o;break;case 207:case 102:o=o.replace(l,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0h)&&(N=(U=U.replace(" ",":")).length),01?a-1:0),o=1;o=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function E(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?E(t):e}function C(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e-1}function z(t){return D(t)?window.pageYOffset:t.scrollTop}function R(t,e){D(t)?window.scrollTo(0,e):t.scrollTop=e}function F(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:L,a=z(t),i=e-a,o=10,s=0;!function e(){var l,c=i*((l=(l=s+=o)/r-1)*l*l+1)+a;R(t,c),s=h)return{placement:"bottom",maxHeight:e};if(k>=h&&!o)return i&&F(l,T,160),{placement:"bottom",maxHeight:e};if(!o&&k>=n||o&&_>=n)return i&&F(l,T,160),{placement:"bottom",maxHeight:o?_-y:k-y};if("auto"===a||o){var M=e,E=o?b:w;return E>=n&&(M=Math.min(E-y-s.controlHeight,e)),{placement:"top",maxHeight:M}}if("bottom"===a)return R(l,T),{placement:"bottom",maxHeight:e};break;case"top":if(b>=h)return{placement:"top",maxHeight:e};if(w>=h&&!o)return i&&F(l,A,160),{placement:"top",maxHeight:e};if(!o&&w>=n||o&&b>=n){var S=e;return(!o&&w>=n||o&&b>=n)&&(S=o?b-x:w-x),i&&F(l,A,160),{placement:"top",maxHeight:S}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(a,'".'))}return c}var j=function(t){return"auto"===t?"bottom":t},V=function(t){function e(){var t,r;m(this,e);for(var n=arguments.length,a=new Array(n),i=0;i-1}},nt=function(t){return a.a.createElement("span",_({className:Object(s.a)({label:"a11yText",zIndex:9999,border:0,clip:"rect(1px, 1px, 1px, 1px)",height:1,width:1,position:"absolute",overflow:"hidden",padding:0,whiteSpace:"nowrap",backgroundColor:"red",color:"blue"})},t))},at=function(t){function e(){return m(this,e),S(this,T(e).apply(this,arguments))}return k(e,t),x(e,[{key:"render",value:function(){var t=this.props,e=(t.in,t.out,t.onExited,t.appear,t.enter,t.exit,t.innerRef),r=(t.emotion,M(t,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return a.a.createElement("input",_({ref:e},r,{className:Object(s.a)({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"})}))}}]),e}(n.Component),it=function(t){function e(){return m(this,e),S(this,T(e).apply(this,arguments))}return k(e,t),x(e,[{key:"componentDidMount",value:function(){this.props.innerRef(Object(l.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),e}(n.Component),ot=["boxSizing","height","overflow","paddingRight","position"],st={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function lt(t){t.preventDefault()}function ct(t){t.stopPropagation()}function ut(){var t=this.scrollTop,e=this.scrollHeight,r=t+this.offsetHeight;0===t?this.scrollTop=1:r===e&&(this.scrollTop=t-1)}function ft(){return"ontouchstart"in window||navigator.maxTouchPoints}var pt=!("undefined"==typeof window||!window.document||!window.document.createElement),ht=0,dt=function(t){function e(){var t,r;m(this,e);for(var n=arguments.length,a=new Array(n),i=0;i0,d=u-f-c,g=!1;d>e&&r.isBottom&&(i&&i(t),r.isBottom=!1),h&&r.isTop&&(s&&s(t),r.isTop=!1),h&&e>d?(a&&!r.isBottom&&a(t),p.scrollTop=u,g=!0,r.isBottom=!0):!h&&-e>c&&(o&&!r.isTop&&o(t),p.scrollTop=0,g=!0,r.isTop=!0),g&&r.cancelScroll(t)})),b(E(E(r)),"onWheel",(function(t){r.handleEventDelta(t,t.deltaY)})),b(E(E(r)),"onTouchStart",(function(t){r.touchStart=t.changedTouches[0].clientY})),b(E(E(r)),"onTouchMove",(function(t){var e=r.touchStart-t.changedTouches[0].clientY;r.handleEventDelta(t,e)})),b(E(E(r)),"getScrollTarget",(function(t){r.scrollTarget=t})),r}return k(e,t),x(e,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(t){t&&(t.scrollHeight<=t.clientHeight||("function"==typeof t.addEventListener&&t.addEventListener("wheel",this.onWheel,!1),"function"==typeof t.addEventListener&&t.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof t.addEventListener&&t.addEventListener("touchmove",this.onTouchMove,!1)))}},{key:"stopListening",value:function(t){t.scrollHeight<=t.clientHeight||("function"==typeof t.removeEventListener&&t.removeEventListener("wheel",this.onWheel,!1),"function"==typeof t.removeEventListener&&t.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof t.removeEventListener&&t.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return a.a.createElement(it,{innerRef:this.getScrollTarget},this.props.children)}}]),e}(n.Component),mt=function(t){function e(){return m(this,e),S(this,T(e).apply(this,arguments))}return k(e,t),x(e,[{key:"render",value:function(){var t=this.props,e=t.isEnabled,r=M(t,["isEnabled"]);return e?a.a.createElement(vt,r):this.props.children}}]),e}(n.Component);b(mt,"defaultProps",{isEnabled:!0});var yt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.isSearchable,n=e.isMulti,a=e.label,i=e.isDisabled;switch(t){case"menu":return"Use Up and Down to choose options".concat(i?"":", press Enter to select the currently focused option",", press Escape to exit the menu, press Tab to select the option and exit the menu.");case"input":return"".concat(a||"Select"," is focused ").concat(r?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},xt=function(t,e){var r=e.value,n=e.isDisabled;if(r)switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"select-option":return"option ".concat(r,n?" is disabled. Select another option.":", selected.")}},bt=function(t){return!!t.isDisabled},_t=function(t){function e(){return m(this,e),S(this,T(e).apply(this,arguments))}return k(e,t),x(e,[{key:"render",value:function(){var t=this.props,e=t.children,r=t.className,n=t.cx,i=t.isMulti,o=t.getStyles,l=t.hasValue;return a.a.createElement("div",{className:n(Object(s.a)(o("valueContainer",this.props)),{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":l},r)},e)}}]),e}(n.Component),wt=function(t){var e=t.size,r=M(t,["size"]);return a.a.createElement("svg",_({height:e,width:e,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:Object(s.a)({display:"inline-block",fill:"currentColor",lineHeight:1,stroke:"currentColor",strokeWidth:0})},r))},kt=function(t){return a.a.createElement(wt,_({size:20},t),a.a.createElement("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Tt=function(t){return a.a.createElement(wt,_({size:20},t),a.a.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},At=function(t){var e=t.isFocused,r=t.theme,n=r.spacing.baseUnit,a=r.colors;return{label:"indicatorContainer",color:e?a.neutral60:a.neutral20,display:"flex",padding:2*n,transition:"color 150ms",":hover":{color:e?a.neutral80:a.neutral40}}},Mt=At,Et=At,St=!1,Ct=function(t){var e=t.color,r=t.delay,n=t.offset;return a.a.createElement("span",{className:Object(s.a)({animationDuration:"1s",animationDelay:"".concat(r,"ms"),animationIterationCount:"infinite",animationName:"react-select-loading-indicator",animationTimingFunction:"ease-in-out",backgroundColor:e,borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":null,height:"1em",verticalAlign:"top",width:"1em"})})},Lt=function(t){var e=t.className,r=t.cx,n=t.getStyles,i=t.innerProps,o=t.isFocused,l=t.isRtl,c=t.theme.colors,u=o?c.neutral80:c.neutral20;return St||(Object(s.b)("@keyframes ","react-select-loading-indicator","{0%,80%,100%{opacity:0;}40%{opacity:1;}};"),St=!0),a.a.createElement("div",_({},i,{className:r(Object(s.a)(n("loadingIndicator",t)),{indicator:!0,"loading-indicator":!0},e)}),a.a.createElement(Ct,{color:u,delay:0,offset:l}),a.a.createElement(Ct,{color:u,delay:160,offset:!0}),a.a.createElement(Ct,{color:u,delay:320,offset:!l}))};Lt.defaultProps={size:4};var Ot=function(t){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:t?0:1,outline:0,padding:0,color:"inherit"}},Pt=function(t){var e=t.children,r=t.innerProps;return a.a.createElement("div",r,e)},It=Pt,Dt=Pt,zt=function(t){function e(){return m(this,e),S(this,T(e).apply(this,arguments))}return k(e,t),x(e,[{key:"render",value:function(){var t=this.props,e=t.children,r=t.innerProps;return a.a.createElement("div",r,e||a.a.createElement(kt,{size:14}))}}]),e}(n.Component),Rt=function(t){function e(){return m(this,e),S(this,T(e).apply(this,arguments))}return k(e,t),x(e,[{key:"render",value:function(){var t=this.props,e=t.children,r=t.className,n=t.components,i=t.cx,o=t.data,l=t.getStyles,c=t.innerProps,u=t.isDisabled,f=t.removeProps,p=t.selectProps,h=n.Container,d=n.Label,g=n.Remove,v=w({className:i(Object(s.a)(l("multiValue",this.props)),{"multi-value":!0,"multi-value--is-disabled":u},r)},c),m={className:i(Object(s.a)(l("multiValueLabel",this.props)),{"multi-value__label":!0},r)},y=w({className:i(Object(s.a)(l("multiValueRemove",this.props)),{"multi-value__remove":!0},r)},f);return a.a.createElement(h,{data:o,innerProps:v,selectProps:p},a.a.createElement(d,{data:o,innerProps:m,selectProps:p},e),a.a.createElement(g,{data:o,innerProps:y,selectProps:p}))}}]),e}(n.Component);b(Rt,"defaultProps",{cropWithEllipsis:!0});var Ft={ClearIndicator:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles,o=t.innerProps;return a.a.createElement("div",_({},o,{className:n(Object(s.a)(i("clearIndicator",t)),{indicator:!0,"clear-indicator":!0},r)}),e||a.a.createElement(kt,null))},Control:function(t){var e=t.children,r=t.cx,n=t.getStyles,i=t.className,o=t.isDisabled,l=t.isFocused,c=t.innerRef,u=t.innerProps,f=t.menuIsOpen;return a.a.createElement("div",_({ref:c,className:r(Object(s.a)(n("control",t)),{control:!0,"control--is-disabled":o,"control--is-focused":l,"control--menu-is-open":f},i)},u),e)},DropdownIndicator:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles,o=t.innerProps;return a.a.createElement("div",_({},o,{className:n(Object(s.a)(i("dropdownIndicator",t)),{indicator:!0,"dropdown-indicator":!0},r)}),e||a.a.createElement(Tt,null))},DownChevron:Tt,CrossIcon:kt,Group:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles,o=t.Heading,l=t.headingProps,c=t.label,u=t.theme,f=t.selectProps;return a.a.createElement("div",{className:n(Object(s.a)(i("group",t)),{group:!0},r)},a.a.createElement(o,_({},l,{selectProps:f,theme:u,getStyles:i,cx:n}),c),a.a.createElement("div",null,e))},GroupHeading:function(t){var e=t.className,r=t.cx,n=t.getStyles,i=t.theme,o=(t.selectProps,M(t,["className","cx","getStyles","theme","selectProps"]));return a.a.createElement("div",_({className:r(Object(s.a)(n("groupHeading",w({theme:i},o))),{"group-heading":!0},e)},o))},IndicatorsContainer:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles;return a.a.createElement("div",{className:n(Object(s.a)(i("indicatorsContainer",t)),{indicators:!0},r)},e)},IndicatorSeparator:function(t){var e=t.className,r=t.cx,n=t.getStyles,i=t.innerProps;return a.a.createElement("span",_({},i,{className:r(Object(s.a)(n("indicatorSeparator",t)),{"indicator-separator":!0},e)}))},Input:function(t){var e=t.className,r=t.cx,n=t.getStyles,i=t.innerRef,o=t.isHidden,l=t.isDisabled,c=t.theme,u=(t.selectProps,M(t,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return a.a.createElement("div",{className:Object(s.a)(n("input",w({theme:c},u)))},a.a.createElement(d.a,_({className:r(null,{input:!0},e),inputRef:i,inputStyle:Ot(o),disabled:l},u)))},LoadingIndicator:Lt,Menu:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles,o=t.innerRef,l=t.innerProps,c=n(Object(s.a)(i("menu",t)),{menu:!0},r);return a.a.createElement("div",_({className:c},l,{ref:o}),e)},MenuList:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles,o=t.isMulti,l=t.innerRef;return a.a.createElement("div",{className:n(Object(s.a)(i("menuList",t)),{"menu-list":!0,"menu-list--is-multi":o},r),ref:l},e)},MenuPortal:Y,LoadingMessage:W,NoOptionsMessage:G,MultiValue:Rt,MultiValueContainer:It,MultiValueLabel:Dt,MultiValueRemove:zt,Option:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles,o=t.isDisabled,l=t.isFocused,c=t.isSelected,u=t.innerRef,f=t.innerProps;return a.a.createElement("div",_({ref:u,className:n(Object(s.a)(i("option",t)),{option:!0,"option--is-disabled":o,"option--is-focused":l,"option--is-selected":c},r)},f),e)},Placeholder:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles,o=t.innerProps;return a.a.createElement("div",_({className:n(Object(s.a)(i("placeholder",t)),{placeholder:!0},r)},o),e)},SelectContainer:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles,o=t.innerProps,l=t.isDisabled,c=t.isRtl;return a.a.createElement("div",_({className:n(Object(s.a)(i("container",t)),{"--is-disabled":l,"--is-rtl":c},r)},o),e)},SingleValue:function(t){var e=t.children,r=t.className,n=t.cx,i=t.getStyles,o=t.isDisabled,l=t.innerProps;return a.a.createElement("div",_({className:n(Object(s.a)(i("singleValue",t)),{"single-value":!0,"single-value--is-disabled":o},r)},l),e)},ValueContainer:_t},Bt=function(t){return w({},Ft,t.components)},Nt={clearIndicator:Et,container:function(t){var e=t.isDisabled;return{label:"container",direction:t.isRtl?"rtl":null,pointerEvents:e?"none":null,position:"relative"}},control:function(t){var e=t.isDisabled,r=t.isFocused,n=t.theme,a=n.colors,i=n.borderRadius,o=n.spacing;return{label:"control",alignItems:"center",backgroundColor:e?a.neutral5:a.neutral0,borderColor:e?a.neutral10:r?a.primary:a.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:r?a.primary:a.neutral30}}},dropdownIndicator:Mt,group:function(t){var e=t.theme.spacing;return{paddingBottom:2*e.baseUnit,paddingTop:2*e.baseUnit}},groupHeading:function(t){var e=t.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*e.baseUnit,paddingRight:3*e.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(t){var e=t.isDisabled,r=t.theme,n=r.spacing.baseUnit,a=r.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:e?a.neutral10:a.neutral20,marginBottom:2*n,marginTop:2*n,width:1}},input:function(t){var e=t.isDisabled,r=t.theme,n=r.spacing,a=r.colors;return{margin:n.baseUnit/2,paddingBottom:n.baseUnit/2,paddingTop:n.baseUnit/2,visibility:e?"hidden":"visible",color:a.neutral80}},loadingIndicator:function(t){var e=t.isFocused,r=t.size,n=t.theme,a=n.colors,i=n.spacing.baseUnit;return{label:"loadingIndicator",color:e?a.neutral60:a.neutral20,display:"flex",padding:2*i,transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"}},loadingMessage:q,menu:function(t){var e,r=t.placement,n=t.theme,a=n.borderRadius,i=n.spacing,o=n.colors;return b(e={label:"menu"},function(t){return t?{bottom:"top",top:"bottom"}[t]:"bottom"}(r),"100%"),b(e,"backgroundColor",o.neutral0),b(e,"borderRadius",a),b(e,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),b(e,"marginBottom",i.menuGutter),b(e,"marginTop",i.menuGutter),b(e,"position","absolute"),b(e,"width","100%"),b(e,"zIndex",1),e},menuList:function(t){var e=t.maxHeight,r=t.theme.spacing.baseUnit;return{maxHeight:e,overflowY:"auto",paddingBottom:r,paddingTop:r,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(t){var e=t.rect,r=t.offset,n=t.position;return{left:e.left,position:n,top:r,width:e.width,zIndex:1}},multiValue:function(t){var e=t.theme,r=e.spacing,n=e.borderRadius;return{label:"multiValue",backgroundColor:e.colors.neutral10,borderRadius:n/2,display:"flex",margin:r.baseUnit/2,minWidth:0}},multiValueLabel:function(t){var e=t.theme,r=e.borderRadius,n=e.colors,a=t.cropWithEllipsis;return{borderRadius:r/2,color:n.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:a?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(t){var e=t.theme,r=e.spacing,n=e.borderRadius,a=e.colors;return{alignItems:"center",borderRadius:n/2,backgroundColor:t.isFocused&&a.dangerLight,display:"flex",paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}}},noOptionsMessage:H,option:function(t){var e=t.isDisabled,r=t.isFocused,n=t.isSelected,a=t.theme,i=a.spacing,o=a.colors;return{label:"option",backgroundColor:n?o.primary:r?o.primary25:"transparent",color:e?o.neutral20:n?o.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:n?o.primary:o.primary50}}},placeholder:function(t){var e=t.theme,r=e.spacing;return{label:"placeholder",color:e.colors.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(t){var e=t.isDisabled,r=t.theme,n=r.spacing,a=r.colors;return{label:"singleValue",color:e?a.neutral40:a.neutral80,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,maxWidth:"calc(100% - ".concat(2*n.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(t){var e=t.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(e.baseUnit/2,"px ").concat(2*e.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};function jt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=w({},t);return Object.keys(e).forEach((function(n){t[n]?r[n]=function(r,a){return e[n](t[n](r,a),a)}:r[n]=e[n]})),r}var Vt={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Ut={backspaceRemovesValue:!0,blurInputOnSelect:B(),captureMenuScroll:!B(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:rt(),formatGroupLabel:function(t){return t.label},getOptionLabel:function(t){return t.label},getOptionValue:function(t){return t.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:bt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(t){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var e=t.count;return"".concat(e," result").concat(1!==e?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0},Ht=1,qt=function(t){function e(t){var r;m(this,e),b(E(E(r=S(this,T(e).call(this,t)))),"state",{ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,isComposing:!1,menuOptions:{render:[],focusable:[]},selectValue:[]}),b(E(E(r)),"blockOptionHover",!1),b(E(E(r)),"clearFocusValueOnUpdate",!1),b(E(E(r)),"commonProps",void 0),b(E(E(r)),"components",void 0),b(E(E(r)),"hasGroups",!1),b(E(E(r)),"initialTouchX",0),b(E(E(r)),"initialTouchY",0),b(E(E(r)),"inputIsHiddenAfterUpdate",void 0),b(E(E(r)),"instancePrefix",""),b(E(E(r)),"openAfterFocus",!1),b(E(E(r)),"scrollToFocusedOptionOnUpdate",!1),b(E(E(r)),"userIsDragging",void 0),b(E(E(r)),"controlRef",null),b(E(E(r)),"getControlRef",(function(t){r.controlRef=t})),b(E(E(r)),"focusedOptionRef",null),b(E(E(r)),"getFocusedOptionRef",(function(t){r.focusedOptionRef=t})),b(E(E(r)),"menuListRef",null),b(E(E(r)),"getMenuListRef",(function(t){r.menuListRef=t})),b(E(E(r)),"inputRef",null),b(E(E(r)),"getInputRef",(function(t){r.inputRef=t})),b(E(E(r)),"cacheComponents",(function(t){r.components=Bt({components:t})})),b(E(E(r)),"focus",r.focusInput),b(E(E(r)),"blur",r.blurInput),b(E(E(r)),"onChange",(function(t,e){var n=r.props;(0,n.onChange)(t,w({},e,{name:n.name}))})),b(E(E(r)),"setValue",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",n=arguments.length>2?arguments[2]:void 0,a=r.props,i=a.closeMenuOnSelect,o=a.isMulti;r.onInputChange("",{action:"set-value"}),i&&(r.inputIsHiddenAfterUpdate=!o,r.onMenuClose()),r.clearFocusValueOnUpdate=!0,r.onChange(t,{action:e,option:n})})),b(E(E(r)),"selectOption",(function(t){var e=r.props,n=e.blurInputOnSelect,a=e.isMulti,i=r.state.selectValue;if(a)if(r.isOptionSelected(t,i)){var o=r.getOptionValue(t);r.setValue(i.filter((function(t){return r.getOptionValue(t)!==o})),"deselect-option",t),r.announceAriaLiveSelection({event:"deselect-option",context:{value:r.getOptionLabel(t)}})}else r.isOptionDisabled(t,i)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t),isDisabled:!0}}):(r.setValue([].concat(C(i),[t]),"select-option",t),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t)}}));else r.isOptionDisabled(t,i)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t),isDisabled:!0}}):(r.setValue(t,"select-option"),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t)}}));n&&r.blurInput()})),b(E(E(r)),"removeValue",(function(t){var e=r.state.selectValue,n=r.getOptionValue(t);r.onChange(e.filter((function(t){return r.getOptionValue(t)!==n})),{action:"remove-value",removedValue:t}),r.announceAriaLiveSelection({event:"remove-value",context:{value:t?r.getOptionLabel(t):""}}),r.focusInput()})),b(E(E(r)),"clearValue",(function(){var t=r.props.isMulti;r.onChange(t?[]:null,{action:"clear"})})),b(E(E(r)),"popValue",(function(){var t=r.state.selectValue,e=t[t.length-1];r.announceAriaLiveSelection({event:"pop-value",context:{value:e?r.getOptionLabel(e):""}}),r.onChange(t.slice(0,t.length-1),{action:"pop-value",removedValue:e})})),b(E(E(r)),"getOptionLabel",(function(t){return r.props.getOptionLabel(t)})),b(E(E(r)),"getOptionValue",(function(t){return r.props.getOptionValue(t)})),b(E(E(r)),"getStyles",(function(t,e){var n=Nt[t](e);n.boxSizing="border-box";var a=r.props.styles[t];return a?a(n,e):n})),b(E(E(r)),"getElementId",(function(t){return"".concat(r.instancePrefix,"-").concat(t)})),b(E(E(r)),"getActiveDescendentId",(function(){var t=r.props.menuIsOpen,e=r.state,n=e.menuOptions,a=e.focusedOption;if(a&&t){var i=n.focusable.indexOf(a),o=n.render[i];return o&&o.key}})),b(E(E(r)),"announceAriaLiveSelection",(function(t){var e=t.event,n=t.context;r.setState({ariaLiveSelection:xt(e,n)})})),b(E(E(r)),"announceAriaLiveContext",(function(t){var e=t.event,n=t.context;r.setState({ariaLiveContext:yt(e,w({},n,{label:r.props["aria-label"]}))})})),b(E(E(r)),"onMenuMouseDown",(function(t){0===t.button&&(t.stopPropagation(),t.preventDefault(),r.focusInput())})),b(E(E(r)),"onMenuMouseMove",(function(t){r.blockOptionHover=!1})),b(E(E(r)),"onControlMouseDown",(function(t){var e=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==t.target.tagName&&r.onMenuClose():e&&r.openMenu("first"):(e&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==t.target.tagName&&t.preventDefault()})),b(E(E(r)),"onDropdownIndicatorMouseDown",(function(t){if(!(t&&"mousedown"===t.type&&0!==t.button||r.props.isDisabled)){var e=r.props,n=e.isMulti,a=e.menuIsOpen;r.focusInput(),a?(r.inputIsHiddenAfterUpdate=!n,r.onMenuClose()):r.openMenu("first"),t.preventDefault(),t.stopPropagation()}})),b(E(E(r)),"onClearIndicatorMouseDown",(function(t){t&&"mousedown"===t.type&&0!==t.button||(r.clearValue(),t.stopPropagation(),r.openAfterFocus=!1,setTimeout((function(){return r.focusInput()})))})),b(E(E(r)),"onScroll",(function(t){"boolean"==typeof r.props.closeMenuOnScroll?t.target instanceof HTMLElement&&D(t.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(t)&&r.props.onMenuClose()})),b(E(E(r)),"onCompositionStart",(function(){r.setState({isComposing:!0})})),b(E(E(r)),"onCompositionEnd",(function(){r.setState({isComposing:!1})})),b(E(E(r)),"onTouchStart",(function(t){var e=t.touches.item(0);e&&(r.initialTouchX=e.clientX,r.initialTouchY=e.clientY,r.userIsDragging=!1)})),b(E(E(r)),"onTouchMove",(function(t){var e=t.touches.item(0);if(e){var n=Math.abs(e.clientX-r.initialTouchX),a=Math.abs(e.clientY-r.initialTouchY);r.userIsDragging=n>5||a>5}})),b(E(E(r)),"onTouchEnd",(function(t){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(t.target)&&r.menuListRef&&!r.menuListRef.contains(t.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)})),b(E(E(r)),"onControlTouchEnd",(function(t){r.userIsDragging||r.onControlMouseDown(t)})),b(E(E(r)),"onClearIndicatorTouchEnd",(function(t){r.userIsDragging||r.onClearIndicatorMouseDown(t)})),b(E(E(r)),"onDropdownIndicatorTouchEnd",(function(t){r.userIsDragging||r.onDropdownIndicatorMouseDown(t)})),b(E(E(r)),"handleInputChange",(function(t){var e=t.currentTarget.value;r.inputIsHiddenAfterUpdate=!1,r.onInputChange(e,{action:"input-change"}),r.onMenuOpen()})),b(E(E(r)),"onInputFocus",(function(t){var e=r.props,n=e.isSearchable,a=e.isMulti;r.props.onFocus&&r.props.onFocus(t),r.inputIsHiddenAfterUpdate=!1,r.announceAriaLiveContext({event:"input",context:{isSearchable:n,isMulti:a}}),r.setState({isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1})),b(E(E(r)),"onInputBlur",(function(t){r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(t),r.onInputChange("",{action:"input-blur"}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))})),b(E(E(r)),"onOptionHover",(function(t){r.blockOptionHover||r.state.focusedOption===t||r.setState({focusedOption:t})})),b(E(E(r)),"shouldHideSelectedOptions",(function(){var t=r.props,e=t.hideSelectedOptions,n=t.isMulti;return void 0===e?n:e})),b(E(E(r)),"onKeyDown",(function(t){var e=r.props,n=e.isMulti,a=e.backspaceRemovesValue,i=e.escapeClearsValue,o=e.inputValue,s=e.isClearable,l=e.isDisabled,c=e.menuIsOpen,u=e.onKeyDown,f=e.tabSelectsValue,p=e.openMenuOnFocus,h=r.state,d=h.isComposing,g=h.focusedOption,v=h.focusedValue,m=h.selectValue;if(!(l||"function"==typeof u&&(u(t),t.defaultPrevented))){switch(r.blockOptionHover=!0,t.key){case"ArrowLeft":if(!n||o)return;r.focusValue("previous");break;case"ArrowRight":if(!n||o)return;r.focusValue("next");break;case"Delete":case"Backspace":if(o)return;if(v)r.removeValue(v);else{if(!a)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(d)return;if(t.shiftKey||!c||!f||!g||p&&r.isOptionSelected(g,m))return;r.selectOption(g);break;case"Enter":if(229===t.keyCode)break;if(c){if(!g)return;if(d)return;r.selectOption(g);break}return;case"Escape":c?(r.inputIsHiddenAfterUpdate=!1,r.onInputChange("",{action:"menu-close"}),r.onMenuClose()):s&&i&&r.clearValue();break;case" ":if(o)return;if(!c){r.openMenu("first");break}if(!g)return;r.selectOption(g);break;case"ArrowUp":c?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":c?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!c)return;r.focusOption("pageup");break;case"PageDown":if(!c)return;r.focusOption("pagedown");break;case"Home":if(!c)return;r.focusOption("first");break;case"End":if(!c)return;r.focusOption("last");break;default:return}t.preventDefault()}}));var n=t.value;r.cacheComponents=o(r.cacheComponents,K).bind(E(E(r))),r.cacheComponents(t.components),r.instancePrefix="react-select-"+(r.props.instanceId||++Ht);var a=I(n),i=r.buildMenuOptions(t,a);return r.state.menuOptions=i,r.state.selectValue=a,r}return k(e,t),x(e,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,r=e.options,n=e.value,a=e.inputValue;if(this.cacheComponents(t.components),t.value!==n||t.options!==r||t.inputValue!==a){var i=I(t.value),o=this.buildMenuOptions(t,i),s=this.getNextFocusedValue(i),l=this.getNextFocusedOption(o.focusable);this.setState({menuOptions:o,selectValue:i,focusedOption:l,focusedValue:s})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(t){var e,r,n,a,i,o=this.props,s=o.isDisabled,l=o.menuIsOpen,c=this.state.isFocused;(c&&!s&&t.isDisabled||c&&l&&!t.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(e=this.menuListRef,r=this.focusedOptionRef,n=e.getBoundingClientRect(),a=r.getBoundingClientRect(),i=r.offsetHeight/3,a.bottom+i>n.bottom?R(e,Math.min(r.offsetTop+r.clientHeight-e.offsetHeight+i,e.scrollHeight)):a.top-i-1&&(o=s)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.onMenuOpen(),this.setState({focusedValue:null,focusedOption:r.focusable[o]}),this.announceAriaLiveContext({event:"menu"})}},{key:"focusValue",value:function(t){var e=this.props,r=e.isMulti,n=e.isSearchable,a=this.state,i=a.selectValue,o=a.focusedValue;if(r){this.setState({focusedOption:null});var s=i.indexOf(o);o||(s=-1,this.announceAriaLiveContext({event:"value"}));var l=i.length-1,c=-1;if(i.length){switch(t){case"previous":c=0===s?0:-1===s?l:s-1;break;case"next":s>-1&&s0&&void 0!==arguments[0]?arguments[0]:"first",e=this.props.pageSize,r=this.state,n=r.focusedOption,a=r.menuOptions,i=a.focusable;if(i.length){var o=0,s=i.indexOf(n);n||(s=-1,this.announceAriaLiveContext({event:"menu"})),"up"===t?o=s>0?s-1:i.length-1:"down"===t?o=(s+1)%i.length:"pageup"===t?(o=s-e)<0&&(o=0):"pagedown"===t?(o=s+e)>i.length-1&&(o=i.length-1):"last"===t&&(o=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[o],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:bt(i[o])}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Vt):w({},Vt,this.props.theme):Vt}},{key:"getCommonProps",value:function(){var t=this.clearValue,e=this.getStyles,r=this.setValue,n=this.selectOption,a=this.props,i=a.classNamePrefix,o=a.isMulti,s=a.isRtl,l=a.options,c=this.state.selectValue,u=this.hasValue();return{cx:P.bind(null,i),clearValue:t,getStyles:e,getValue:function(){return c},hasValue:u,isMulti:o,isRtl:s,options:l,selectOption:n,setValue:r,selectProps:a,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(t){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var e=this.state,r=e.focusedValue,n=e.selectValue.indexOf(r);if(n>-1){if(t.indexOf(r)>-1)return r;if(n-1?e:t[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var t=this.props,e=t.isClearable,r=t.isMulti;return void 0===e?r:e}},{key:"isOptionDisabled",value:function(t,e){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(t,e)}},{key:"isOptionSelected",value:function(t,e){var r=this;if(e.indexOf(t)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(t,e);var n=this.getOptionValue(t);return e.some((function(t){return r.getOptionValue(t)===n}))}},{key:"filterOption",value:function(t,e){return!this.props.filterOption||this.props.filterOption(t,e)}},{key:"formatOptionLabel",value:function(t,e){if("function"==typeof this.props.formatOptionLabel){var r=this.props.inputValue,n=this.state.selectValue;return this.props.formatOptionLabel(t,{context:e,inputValue:r,selectValue:n})}return this.getOptionLabel(t)}},{key:"formatGroupLabel",value:function(t){return this.props.formatGroupLabel(t)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"buildMenuOptions",value:function(t,e){var r=this,n=t.inputValue,a=void 0===n?"":n,i=t.options,o=function(t,n){var i=r.isOptionDisabled(t,e),o=r.isOptionSelected(t,e),s=r.getOptionLabel(t),l=r.getOptionValue(t);if(!(r.shouldHideSelectedOptions()&&o||!r.filterOption({label:s,value:l,data:t},a))){var c=i?void 0:function(){return r.onOptionHover(t)},u=i?void 0:function(){return r.selectOption(t)},f="".concat(r.getElementId("option"),"-").concat(n);return{innerProps:{id:f,onClick:u,onMouseMove:c,onMouseOver:c,tabIndex:-1},data:t,isDisabled:i,isSelected:o,key:f,label:s,type:"option",value:l}}};return i.reduce((function(t,e,n){if(e.options){r.hasGroups||(r.hasGroups=!0);var a=e.options.map((function(e,r){var a=o(e,"".concat(n,"-").concat(r));return a&&t.focusable.push(e),a})).filter(Boolean);if(a.length){var i="".concat(r.getElementId("group"),"-").concat(n);t.render.push({type:"group",key:i,data:e,options:a})}}else{var s=o(e,"".concat(n));s&&(t.render.push(s),t.focusable.push(e))}return t}),{render:[],focusable:[]})}},{key:"constructAriaLiveMessage",value:function(){var t=this.state,e=t.ariaLiveContext,r=t.selectValue,n=t.focusedValue,a=t.focusedOption,i=this.props,o=i.options,s=i.menuIsOpen,l=i.inputValue,c=i.screenReaderStatus,u=n?function(t){var e=t.focusedValue,r=t.getOptionLabel,n=t.selectValue;return"value ".concat(r(e)," focused, ").concat(n.indexOf(e)+1," of ").concat(n.length,".")}({focusedValue:n,getOptionLabel:this.getOptionLabel,selectValue:r}):"",f=a&&s?function(t){var e=t.focusedOption,r=t.getOptionLabel,n=t.options;return"option ".concat(r(e)," focused").concat(e.isDisabled?" disabled":"",", ").concat(n.indexOf(e)+1," of ").concat(n.length,".")}({focusedOption:a,getOptionLabel:this.getOptionLabel,options:o}):"",p=function(t){var e=t.inputValue,r=t.screenReaderMessage;return"".concat(r).concat(e?" for search term "+e:"",".")}({inputValue:l,screenReaderMessage:c({count:this.countOptions()})});return"".concat(u," ").concat(f," ").concat(p," ").concat(e)}},{key:"renderInput",value:function(){var t=this.props,e=t.isDisabled,r=t.isSearchable,n=t.inputId,i=t.inputValue,o=t.tabIndex,s=this.components.Input,l=this.state.inputIsHidden,c=n||this.getElementId("input");if(!r)return a.a.createElement(at,{id:c,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:L,onFocus:this.onInputFocus,readOnly:!0,disabled:e,tabIndex:o,value:""});var u={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]},f=this.commonProps,p=f.cx,h=f.theme,d=f.selectProps;return a.a.createElement(s,_({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:p,getStyles:this.getStyles,id:c,innerRef:this.getInputRef,isDisabled:e,isHidden:l,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:d,spellCheck:"false",tabIndex:o,theme:h,type:"text",value:i},u))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,e=this.components,r=e.MultiValue,n=e.MultiValueContainer,i=e.MultiValueLabel,o=e.MultiValueRemove,s=e.SingleValue,l=e.Placeholder,c=this.commonProps,u=this.props,f=u.controlShouldRenderValue,p=u.isDisabled,h=u.isMulti,d=u.inputValue,g=u.placeholder,v=this.state,m=v.selectValue,y=v.focusedValue,x=v.isFocused;if(!this.hasValue()||!f)return d?null:a.a.createElement(l,_({},c,{key:"placeholder",isDisabled:p,isFocused:x}),g);if(h)return m.map((function(e){var s=e===y;return a.a.createElement(r,_({},c,{components:{Container:n,Label:i,Remove:o},isFocused:s,isDisabled:p,key:t.getOptionValue(e),removeProps:{onClick:function(){return t.removeValue(e)},onTouchEnd:function(){return t.removeValue(e)},onMouseDown:function(t){t.preventDefault(),t.stopPropagation()}},data:e}),t.formatOptionLabel(e,"value"))}));if(d)return null;var b=m[0];return a.a.createElement(s,_({},c,{data:b,isDisabled:p}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.components.ClearIndicator,e=this.commonProps,r=this.props,n=r.isDisabled,i=r.isLoading,o=this.state.isFocused;if(!this.isClearable()||!t||n||!this.hasValue()||i)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return a.a.createElement(t,_({},e,{innerProps:s,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var t=this.components.LoadingIndicator,e=this.commonProps,r=this.props,n=r.isDisabled,i=r.isLoading,o=this.state.isFocused;if(!t||!i)return null;return a.a.createElement(t,_({},e,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:o}))}},{key:"renderIndicatorSeparator",value:function(){var t=this.components,e=t.DropdownIndicator,r=t.IndicatorSeparator;if(!e||!r)return null;var n=this.commonProps,i=this.props.isDisabled,o=this.state.isFocused;return a.a.createElement(r,_({},n,{isDisabled:i,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var t=this.components.DropdownIndicator;if(!t)return null;var e=this.commonProps,r=this.props.isDisabled,n=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return a.a.createElement(t,_({},e,{innerProps:i,isDisabled:r,isFocused:n}))}},{key:"renderMenu",value:function(){var t=this,e=this.components,r=e.Group,n=e.GroupHeading,i=e.Menu,o=e.MenuList,s=e.MenuPortal,l=e.LoadingMessage,c=e.NoOptionsMessage,u=e.Option,f=this.commonProps,p=this.state,h=p.focusedOption,d=p.menuOptions,g=this.props,v=g.captureMenuScroll,m=g.inputValue,y=g.isLoading,x=g.loadingMessage,b=g.minMenuHeight,w=g.maxMenuHeight,k=g.menuIsOpen,T=g.menuPlacement,A=g.menuPosition,E=g.menuPortalTarget,S=g.menuShouldBlockScroll,C=g.menuShouldScrollIntoView,L=g.noOptionsMessage,O=g.onMenuScrollToTop,P=g.onMenuScrollToBottom;if(!k)return null;var I,D=function(e){var r=h===e.data;return e.innerRef=r?t.getFocusedOptionRef:void 0,a.a.createElement(u,_({},f,e,{isFocused:r}),t.formatOptionLabel(e.data,"menu"))};if(this.hasOptions())I=d.render.map((function(e){if("group"===e.type){e.type;var i=M(e,["type"]),o="".concat(e.key,"-heading");return a.a.createElement(r,_({},f,i,{Heading:n,headingProps:{id:o},label:t.formatGroupLabel(e.data)}),e.options.map((function(t){return D(t)})))}if("option"===e.type)return D(e)}));else if(y){var z=x({inputValue:m});if(null===z)return null;I=a.a.createElement(l,f,z)}else{var R=L({inputValue:m});if(null===R)return null;I=a.a.createElement(c,f,R)}var F={minMenuHeight:b,maxMenuHeight:w,menuPlacement:T,menuPosition:A,menuShouldScrollIntoView:C},B=a.a.createElement(V,_({},f,F),(function(e){var r=e.ref,n=e.placerProps,s=n.placement,l=n.maxHeight;return a.a.createElement(i,_({},f,F,{innerRef:r,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:y,placement:s}),a.a.createElement(mt,{isEnabled:v,onTopArrive:O,onBottomArrive:P},a.a.createElement(gt,{isEnabled:S},a.a.createElement(o,_({},f,{innerRef:t.getMenuListRef,isLoading:y,maxHeight:l}),I))))}));return E||"fixed"===A?a.a.createElement(s,_({},f,{appendTo:E,controlElement:this.controlRef,menuPlacement:T,menuPosition:A}),B):B}},{key:"renderFormField",value:function(){var t=this,e=this.props,r=e.delimiter,n=e.isDisabled,i=e.isMulti,o=e.name,s=this.state.selectValue;if(o&&!n){if(i){if(r){var l=s.map((function(e){return t.getOptionValue(e)})).join(r);return a.a.createElement("input",{name:o,type:"hidden",value:l})}var c=s.length>0?s.map((function(e,r){return a.a.createElement("input",{key:"i-".concat(r),name:o,type:"hidden",value:t.getOptionValue(e)})})):a.a.createElement("input",{name:o,type:"hidden"});return a.a.createElement("div",null,c)}var u=s[0]?this.getOptionValue(s[0]):"";return a.a.createElement("input",{name:o,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?a.a.createElement(nt,{"aria-live":"assertive"},a.a.createElement("p",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),a.a.createElement("p",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var t=this.components,e=t.Control,r=t.IndicatorsContainer,n=t.SelectContainer,i=t.ValueContainer,o=this.props,s=o.className,l=o.id,c=o.isDisabled,u=o.menuIsOpen,f=this.state.isFocused,p=this.commonProps=this.getCommonProps();return a.a.createElement(n,_({},p,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:f}),this.renderLiveRegion(),a.a.createElement(e,_({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:f,menuIsOpen:u}),a.a.createElement(i,_({},p,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),a.a.createElement(r,_({},p,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),e}(n.Component);b(qt,"defaultProps",Ut);var Gt={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},Wt=function(t){var e,r;return r=e=function(e){function r(){var t,e;m(this,r);for(var n=arguments.length,a=new Array(n),i=0;i1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r=String(t).toLowerCase(),n=String(e.value).toLowerCase(),a=String(e.label).toLowerCase();return n===r||a===r},$t=w({allowCreateWhileLoading:!1,createOptionPosition:"last"},{formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,e,r){return!(!t||e.some((function(e){return Kt(t,e)}))||r.some((function(e){return Kt(t,e)})))},getNewOptionData:function(t,e){return{label:e,value:t,__isNew__:!0}}}),Qt=function(t){var e,r;return r=e=function(e){function r(t){var e;m(this,r),b(E(E(e=S(this,T(r).call(this,t)))),"select",void 0),b(E(E(e)),"onChange",(function(t,r){var n=e.props,a=n.getNewOptionData,i=n.inputValue,o=n.isMulti,s=n.onChange,l=n.onCreateOption,c=n.value;if("select-option"!==r.action)return s(t,r);var u=e.state.newOption,f=Array.isArray(t)?t:[t];if(f[f.length-1]!==u)s(t,r);else if(l)l(i);else{var p=a(i,i),h={action:"create-option"};s(o?[].concat(C(I(c)),[p]):p,h)}}));var n=t.options||[];return e.state={newOption:void 0,options:n},e}return k(r,e),x(r,[{key:"componentWillReceiveProps",value:function(t){var e=t.allowCreateWhileLoading,r=t.createOptionPosition,n=t.formatCreateLabel,a=t.getNewOptionData,i=t.inputValue,o=t.isLoading,s=t.isValidNewOption,l=t.value,c=t.options||[],u=this.state.newOption;u=s(i,I(l),c)?a(i,n(i)):void 0,this.setState({newOption:u,options:!e&&o||!u?c:"first"===r?[u].concat(C(c)):[].concat(C(c),[u])})}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"render",value:function(){var e=this,r=_({},this.props),n=this.state.options;return a.a.createElement(t,_({},r,{ref:function(t){e.select=t},options:n,onChange:this.onChange}))}}]),r}(n.Component),b(e,"defaultProps",$t),r},te=Wt(Qt(qt)),ee=Wt(Qt(qt)),re=Xt(ee),ne=function(t){return function(e){e.in,e.onExited,e.appear,e.enter,e.exit;var r=M(e,["in","onExited","appear","enter","exit"]);return a.a.createElement(t,r)}},ae=function(t){var e=t.component,r=t.duration,n=void 0===r?1:r,i=t.in,o=(t.onExited,M(t,["component","duration","in","onExited"])),s={entering:{opacity:0},entered:{opacity:1,transition:"opacity ".concat(n,"ms")},exiting:{opacity:0},exited:{opacity:0}};return a.a.createElement(g.Transition,{mountOnEnter:!0,unmountOnExit:!0,in:i,timeout:n},(function(t){var r={style:w({},s[t])};return a.a.createElement(e,_({innerProps:r},o))}))},ie=260,oe=function(t){function e(){var t,r;m(this,e);for(var n=arguments.length,a=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=Bt({components:t}),r=e.Input,n=e.MultiValue,a=e.Placeholder,i=e.SingleValue,o=e.ValueContainer,s=M(e,["Input","MultiValue","Placeholder","SingleValue","ValueContainer"]);return w({Input:ne(r),MultiValue:se(n),Placeholder:le(a),SingleValue:ce(i),ValueContainer:ue(o)},s)},pe=fe(),he=(pe.Input,pe.MultiValue,pe.Placeholder,pe.SingleValue,pe.ValueContainer,o(fe,K)),de=Wt(qt);e.default=de},function(t,e,r){"use strict";var n=r(9),a=Object(n.a)((function(t,e){for(var r={},n={},a=0,i=t.length;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)}},{}],491:[function(t,r,n){(function(t){r.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],492:[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],s=(r=a+o)-a,l=o-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;i>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e)}function c(t){var e=new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",u(function(t){for(var e=new Array(t),r=0;r>1;return["sum(",u(t.slice(0,e)),",",u(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 f(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 o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",u(t.slice(0,e)),",",u(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=3.3306690738754716e-16*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],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*u,v=o*l,g=o*s,m=i*u,y=i*l,x=a*s,b=c*(d-v)+f*(g-m)+h*(y-x),_=(Math.abs(d)+Math.abs(v))*Math.abs(c)+(Math.abs(g)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(h),w=7.771561172376103e-16*_;return b>w||-b>w?b:p(t,e,r,n)}];!function(){for(;d.length<=s;)d.push(f(d.length));for(var t=[],r=["slow"],n=0;n<=s;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=s;++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);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||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),u=r[i],c=n[i],f=Math.min(u,c),h=Math.max(u,c);if(h=n?(i=f,(l+=1)=n?(i=f,(l+=1)0?1:0}},{}],504:[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":88,"reduce-simplicial-complex":484}],505:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(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(var 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 c(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<>>c&1&&u.push(i[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 x(t){for(var e=m(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0){var n=m(r);if(e0){var t=A[0];return g(0,E-1),E-=1,x(0),t}return-1}function w(t,e){var r=A[t];return u[r]===e?t:(u[r]=-1/0,b(t),_(),u[r]=e,b((E+=1)-1))}function k(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),T[e]>=0&&w(T[e],v(e)),T[r]>=0&&w(T[r],v(r))}}for(var A=[],T=new Array(a),f=0;f>1;f>=0;--f)x(f);for(;;){var S=_();if(S<0||u[S]>r)break;k(S)}for(var C=[],f=0;f=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&O.push([n,i])}}),i.unique(i.normalize(O)),{positions:C,edges:O}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":497,"simplicial-complex":509}],512:[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),u=n(r,a,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,a),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 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]),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],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=c(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=c(t.right,e);if(l)return l;t=t.left}}return r}function f(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}l.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 l=c(this.slabs[e-1],t);l&&(s?o(l.key,s)>0&&(s=l.key,i=l.value):(i=l.value,s=l.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],u);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":512,"binary-search-bounds":84,"functional-red-black-tree":229,"robust-orientation":497}],514:[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=n-e,a=-e/i;a<0?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),u=0;u0||i>0&&c<0){var f=o(s,c,l,i);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())),i=c}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&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}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&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},{"robust-dot-product":494,"robust-sum":502}],515:[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(r){return function(r,n){var i,a,o,s,l,u,c,f,h,p=1,d=r.length,v="";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)?v+=i:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",i=i.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+i).length,l=s.width&&c>0?u.repeat(c):"",v+=s.align?h+i+l:"0"===u?h+l+i:l+h+i)}return v}(function(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}(r),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}var i=Object.create(null);void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],516:[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=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("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],o=a.split(e);if(r.escape){for(var s=[],l=0;l0;){e=u[u.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[v])}a[e]=d}else{if(n[e]===r[e]){for(var g=[],m=[],y=0,d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),m.push(s[x]),y+=s[x].length,o[x]=f.length,x===e){l.length=d;break}}f.push(g);for(var b=new Array(y),d=0;d c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(var u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var p="vExtra"+f.length;a.push("case ",u>>>7,":",p,"(m&0x7f,",l.join(),");break;"),h=["function ",p,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var d=new Array(r),v=new Array(r),g=new Array(r),m=new Array(r),y=0,x=0;xx)&&!(u&1<<_)!=!(u&1<0&&(T="+"+g[b]+"*c");var M=d[b].length/y*.5,E=.5+m[b]/y*.5;A.push("d"+b+"-"+E+"-"+M+"*("+d[b].join("+")+T+")/("+v[b].join("+")+")")}h.push("a.push([",A.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");for(var S=[],u=0;u<1<1&&(l=1),l<-1&&(l=-1),i*Math.acos(l)};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,p=void 0===h?0:h,d=t.largeArcFlag,v=void 0===d?0:d,g=t.sweepFlag,m=void 0===g?0:g,y=[];if(0===c||0===f)return[];var x=Math.sin(p*i/360),b=Math.cos(p*i/360),_=b*(e-l)/2+x*(r-u)/2,w=-x*(e-l)/2+b*(r-u)/2;if(0===_&&0===w)return[];c=Math.abs(c),f=Math.abs(f);var k=Math.pow(_,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(f,2);k>1&&(c*=Math.sqrt(k),f*=Math.sqrt(k));var A=function(t,e,r,n,a,o,l,u,c,f,h,p){var d=Math.pow(a,2),v=Math.pow(o,2),g=Math.pow(h,2),m=Math.pow(p,2),y=d*v-d*m-v*g;y<0&&(y=0),y/=d*m+v*g;var x=(y=Math.sqrt(y)*(l===u?-1:1))*a/o*p,b=y*-o/a*h,_=f*x-c*b+(t+r)/2,w=c*x+f*b+(e+n)/2,k=(h-x)/a,A=(p-b)/o,T=(-h-x)/a,M=(-p-b)/o,E=s(1,0,k,A),S=s(k,A,T,M);return 0===u&&S>0&&(S-=i),1===u&&S<0&&(S+=i),[_,w,E,S]}(e,r,l,u,c,f,v,m,x,b,_,w),T=n(A,4),M=T[0],E=T[1],S=T[2],C=T[3],L=Math.abs(C)/(i/4);Math.abs(1-L)<1e-7&&(L=1);var O=Math.max(Math.ceil(L),1);C/=O;for(var I=0;Ie[2]&&(e[2]=u[c+0]),u[c+1]>e[3]&&(e[3]=u[c+1]);return e}},{"abs-svg-path":53,assert:61,"is-svg-path":419,"normalize-svg-path":521,"parse-svg-path":455}],521:[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,p=0,d=0,v=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":519}],522:[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"),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");var r,f;e||(e={}),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),p=e.stroke||0,d=e.viewbox||e.viewBox||i(t),v=[r/(d[2]-d[0]),f/(d[3]-d[1])],g=Math.min(v[0]||0,v[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,r,f),c.fillStyle="white",p&&("number"!=typeof p&&(p=1),c.strokeStyle=p>0?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*r,.5*f),c.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 m=new Path2D(t);c.fill(m),p&&c.stroke(m)}else{var y=a(t);o(c,y),c.fill(),p&&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":86,"draw-svg-path":162,"is-svg-path":419,"parse-svg-path":455,"svg-path-bounds":520}],523:[function(t,e,r){(function(r){"use strict";e.exports=function t(e,r,i){var i=i||{},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);for(var p=new Float32Array(c),d=0,v=-.5*f,h=0;h1&&(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=L(t,360),e=L(e,100),r=L(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,f,p),d=!0,v="hsl"),e.hasOwnProperty("a")&&(c=e.a)),c=C(c),{ok:d,format:e.format||v,r:o(255,s(u.r,0)),g:o(255,s(u.g,0)),b:o(255,s(u.b,0)),a:c}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.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=c.ok,this._tc_id=i++}function c(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+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,i,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=C(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=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=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=[P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16)),P(z(n))];return 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)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):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*L(this._r,255))+"%",g:a(100*L(this._g,255))+"%",b:a(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%)":"rgba("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(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="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(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,i=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"hex4"===t||"hex8"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return 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(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(v,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(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,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]:D(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(),i=u(e).toRgb(),a=r/100,o={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};return u(o)},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a,o,s,l=u.readability(t,e);switch(i=!1,(a=r,o=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase(),s=(a.size||"small").toLowerCase(),"AA"!==o&&"AAA"!==o&&(o="AA"),"small"!==s&&"large"!==s&&(s="small"),n={level:o,size:s}).level+n.size){case"AAsmall":case"AAAlarge":i=l>=4.5;break;case"AAlarge":i=l>=3;break;case"AAAsmall":i=l>=7}return i},u.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 c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?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 L(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 I(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function z(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 V(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],525:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t){if(t.length){for(var e=i(t),r=0,n=e.length;rf&&(f=l[0]),l[1]h&&(h=l[1])}function i(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(i);break;case"Point":n(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(n)}}if(!e){var a,o,s=r(t),l=new Array(2),u=1/0,c=u,f=-u,h=-u;for(o in t.arcs.forEach(function(t){for(var e=-1,r=t.length;++ef&&(f=l[0]),l[1]h&&(h=l[1])}),t.objects)i(t.objects[o]);e=t.bbox=[u,c,f,h]}return e},i=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r};function a(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,a=o(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:a}:null==n?{type:"Feature",id:r,properties:i,geometry:a}:{type:"Feature",id:r,bbox:n,properties:i,geometry:a}}function o(t,e){var n=r(t),a=t.arcs;function o(t,e){e.length&&e.pop();for(var r=a[t<0?~t:t],o=0,s=r.length;o1)n=function(t,e,r){var n,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}return function t(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":e.arcs.forEach(l)}}(e),a.forEach(null==r?function(t){i.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,o,u=1,c=l(i[0]);uc&&(o=i[0],i[0]=i[u],i[u]=o,c=a);return i})}}var c=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be ≥2");if(t.transform)throw new Error("already quantized");var r,i=n(t),a=i[0],o=(i[2]-a)/(e-1)||1,s=i[1],l=(i[3]-s)/(e-1)||1;function u(t){t[0]=Math.round((t[0]-a)/o),t[1]=Math.round((t[1]-s)/l)}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":u(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(u)}}for(r in t.arcs.forEach(function(t){for(var e,r,n,i=1,u=1,c=t.length,f=t[0],h=f[0]=Math.round((f[0]-a)/o),p=f[1]=Math.round((f[1]-s)/l);iMath.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(var 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 u=0;u<16;++u)this.computedMatrix[u]=.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];for(var l=Math.sqrt(n),c=0,a=0;a<3;++a)r[a]-=e[a]*i/n,c+=r[a]*r[a],e[a]/=l;for(var f=Math.sqrt(c),a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);for(var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],v=this.computedAngle[1],g=Math.cos(d),m=Math.sin(d),y=Math.cos(v),x=Math.sin(v),b=this.computedCenter,_=g*y,w=m*y,k=x,A=-g*x,T=-m*x,M=y,E=this.computedEye,S=this.computedMatrix,a=0;a<3;++a){var C=_*r[a]+w*h[a]+k*e[a];S[4*a+1]=A*r[a]+T*h[a]+M*e[a],S[4*a+2]=C,S[4*a+3]=0}var L=S[1],O=S[5],I=S[9],P=S[2],D=S[6],z=S[10],R=O*z-I*D,F=I*P-L*z,B=L*D-O*P,N=u(R,F,B);R/=N,F/=N,B/=N,S[0]=R,S[4]=F,S[8]=B;for(var a=0;a<3;++a)E[a]=b[a]+S[2+4*a]*p;for(var a=0;a<3;++a){for(var c=0,j=0;j<3;++j)c+=S[a+4*j]*E[j];S[12+a]=-c}S[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,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];a(i,i,n,d);for(var u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+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=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],h=i[8],p=c*a+f*o+h*s,d=u(c-=a*p,f-=o*p,h-=s*p),v=(c/=d)*e+a*r,g=(f/=d)*e+o*r,m=(h/=d)*e+s*r;this.center.move(t,v,g,m);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),v=Math.max(h,p,d);h===v?(s=s<0?-1:1,l=f=0):d===v?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var g=u(s,l,f);s/=g,l/=g,f/=g}var m,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*f,k=u(x-=s*w,b-=l*w,_-=f*w),A=l*(_/=k)-f*(b/=k),T=f*(x/=k)-s*_,M=s*b-l*x,E=u(A,T,M);if(A/=E,T/=E,M/=E,this.center.jump(t,q,G,W),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,x,b,_),2===a){var S=e[1],C=e[5],L=e[9],O=S*x+C*b+L*_,I=S*A+C*T+L*M;m=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,O)}else{var P=e[2],D=e[6],z=e[10],R=P*s+D*l+z*f,F=P*x+D*b+z*_,B=P*A+D*T+z*M;m=Math.asin(c(R)),y=Math.atan2(B,F)}this.angle.jump(t,y,m),this.recalcMatrix(t);var N=e[2],j=e[6],V=e[10],U=this.computedMatrix;i(U,e);var H=U[15],q=U[12]/H,G=U[13]/H,W=U[14]/H,Y=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*Y,G-j*Y,W-V*Y)},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=u(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=u(l,f,h);if(!(p<1e-6)){l/=p,f/=p,h/=p;var d=this.computedRight,v=d[0],g=d[1],m=d[2],y=i*v+a*g+o*m,x=u(v-=y*i,g-=y*a,m-=y*o);if(!(x<.01&&(x=u(v=a*h-o*f,g=o*l-i*h,m=i*f-a*l))<1e-6)){v/=x,g/=x,m/=x,this.up.set(t,i,a,o),this.right.set(t,v,g,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=a*m-o*g,_=o*v-i*m,w=i*g-a*v,k=u(b,_,w),A=i*l+a*f+o*h,T=v*l+g*f+m*h,M=(b/=k)*l+(_/=k)*f+(w/=k)*h,E=Math.asin(c(A)),S=Math.atan2(M,T),C=this.angle._state,L=C[C.length-1],O=C[C.length-2];L%=2*Math.PI;var I=Math.abs(L+2*Math.PI-S),P=Math.abs(L-S),D=Math.abs(L-2*Math.PI-S);I0?r.pop():new ArrayBuffer(t)}function h(t){return new Uint8Array(f(t),0,t)}function p(t){return new Uint16Array(f(2*t),0,t)}function d(t){return new Uint32Array(f(4*t),0,t)}function v(t){return new Int8Array(f(t),0,t)}function g(t){return new Int16Array(f(2*t),0,t)}function m(t){return new Int32Array(f(4*t),0,t)}function y(t){return new Float32Array(f(4*t),0,t)}function x(t){return new Float64Array(f(8*t),0,t)}function b(t){return o?new Uint8ClampedArray(f(t),0,t):h(t)}function _(t){return new DataView(f(t),0,t)}function w(t){t=i.nextPow2(t);var e=i.log2(t),n=u[e];return n.length>0?n.pop():new r(t)}n.free=function(t){if(r.isBuffer(t))u[i.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,n=0|i.log2(e);l[n].push(t)}},n.freeUint8=n.freeUint16=n.freeUint32=n.freeInt8=n.freeInt16=n.freeInt32=n.freeFloat32=n.freeFloat=n.freeFloat64=n.freeDouble=n.freeUint8Clamped=n.freeDataView=function(t){c(t.buffer)},n.freeArrayBuffer=c,n.freeBuffer=function(t){u[i.log2(t.length)].push(t)},n.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return h(t);case"uint16":return p(t);case"uint32":return d(t);case"int8":return v(t);case"int16":return g(t);case"int32":return m(t);case"float":case"float32":return y(t);case"double":case"float64":return x(t);case"uint8_clamped":return b(t);case"buffer":return w(t);case"data":case"dataview":return _(t);default:return null}return null},n.mallocArrayBuffer=f,n.mallocUint8=h,n.mallocUint16=p,n.mallocUint32=d,n.mallocInt8=v,n.mallocInt16=g,n.mallocInt32=m,n.mallocFloat32=n.mallocFloat=y,n.mallocFloat64=n.mallocDouble=x,n.mallocUint8Clamped=b,n.mallocDataView=_,n.mallocBuffer=w,n.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,l[t].length=0,u[t].length=0}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":85,buffer:98,dup:164}],533:[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)),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",w(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(k=0;k-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,l-s),n=n.replace("?px ",F())),T+=.25*C*(l-s)}if(!0===o.superscripts){var u=t.indexOf(d),f=r.indexOf(d),p=u>-1?parseInt(t[1+u]):0,v=f>-1?parseInt(r[1+f]):0;p!==v&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,v-p),n=n.replace("?px ",F())),T-=.25*C*(v-p)}if(!0===o.bolds){var g=t.indexOf(c)>-1,y=r.indexOf(c)>-1;!g&&y&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!y&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(h)>-1,b=r.indexOf(h)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=e[0]===d||e[0]===m,u=0,c=-s;u>-1&&-1!==(u=r.indexOf(i,u))&&-1!==(c=r.indexOf(a,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 p=u+o,v=r.substr(p,c-p),g=v.indexOf(i);u=-1!==g?g:c+s}return n}function b(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function _(t,e,r,n){var i=b(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:x(function(e){var n=y(e);return n?r in n:t.indexOf(e)>=0})},set___:{value:x(function(n,i){var a,o=y(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:x(function(n){var i,a,o=y(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))})}})};v.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 v||b();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 v),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new v),i.set___(t,e)}else n.set(t,e);return this},Object.create(v.prototype,{get___:{value:x(function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)})},has___:{value:x(function(t){return n.has(t)||!!i&&i.has___(t)})},set___:{value:x(e)},delete___:{value:x(function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e})},permitHostObjects___:{value:x(function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0})}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=v.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=v)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function m(t){return!(t.substr(0,l.length)==l&&"___"===t.substr(t.length-3))}function y(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[u];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,u,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function x(t){return t.prototype=null,Object.freeze(t)}function b(){p||"undefined"==typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],540:[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":541}],541:[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}},{}],542:[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":540}],543:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":231}],544:[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(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][i-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+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(),i=this.toChineseMonth(r,n),a=["一","二","三","四","五","六","七","八","九","十","十一","十二"][i-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}var a=this.toMonthIndex(t,n,r);return a},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t),a=r&&e!==i;if(a||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&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t),i=r?12:11;if(e<0||e>i)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13;return r},isIntercalaryMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(i=a.newDate(l,u,c)).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]],i=r>>13,a=i?12:11;if(e>a)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);var o=r&1<<12-e?30:29;return o},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="number"==typeof t&&t>=1888&&t<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var u="number"==typeof e&&e>=1&&e<=12;if(!u)throw new Error("Lunar month outside range 1 - 12");var c,p="number"==typeof r&&r>=1&&r<=30;if(!p)throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(c=!1,a=n):(c=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:c}}s=o.day-1;var d,v=f[o.year-f[0]],g=v>>13;d=g?o.month>g?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var m=0;m>9&4095,(x>>5&15)-1,(31&x)+s);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.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{var o="number"==typeof t&&t>=1888&&t<=2111;if(!o)throw new Error("Solar year outside range 1888-2111");var s="number"==typeof e&&e>=1&&e<=12;if(!s)throw new Error("Solar month outside range 1 - 12");var l="number"==typeof r&&r>=1&&r<=31;if(!l)throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var u=h[i.year-h[0]],c=i.year<<9|i.month<<5|i.day;a.year=c>=u?i.year:i.year-1,u=h[a.year-h[0]];var p,d=new Date(u>>9&4095,(u>>5&15)-1,31&u),v=new Date(i.year,i.month-1,i.day);p=Math.round((v-d)/864e5);var g,m=f[a.year-f[0]];for(g=0;g<13;g++){var y=m&1<<12-g?30:29;if(p>13;return!x||g=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":558,"object-assign":449}],547:[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),t=e.year()+(e.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,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":558,"object-assign":449}],548:[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){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return t=e.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)?30: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(var 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":558,"object-assign":449}],549:[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īs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(11*e.year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,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(),r=i.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":558,"object-assign":449}],550:[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),t=e.year()<0?e.year()+1:e.year();return t%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,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),r=e+1524,n=Math.floor((r-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((r-i)/30.6001),o=a-Math.floor(a<14?1:13),s=n-Math.floor(o>2?4716:4715),l=r-i-Math.floor(30.6001*a);return s<=0&&s--,this.newDate(s,o,l)}}),n.calendars.julian=a},{"../main":558,"object-assign":449}],551:[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){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=e.year();var r=Math.floor(t/400);t%=400,t+=t<0?400:0;var i=Math.floor(t/20);return r+"."+i+"."+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){var i=this._validate(t,e,r,n.local.invalidDate);return i.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),a=i.toJD(),o=this._toHaab(a),s=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[o[0]-1],haabMonth:o[0],haabDay:o[1],tzolkinDayName:this.local.tzolkinMonths[s[0]-1],tzolkinDay:s[0],tzolkinTrecena:s[1]}},_toHaab:function(t){var e=o(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s(20+(t-=this.jdEpoch),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":558,"object-assign":449}],552:[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();t<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":558,"object-assign":449}],553:[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){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);if(t=e.year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var r=0,i=this.minMonth;i<=12;i++)r+=this.NEPALI_CALENDAR_DATA[t][i];return r},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 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+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance(),r=e.fromJD(t),i=r.year(),a=r.dayOfYear(),o=i+56;this._createMissingCalendarData(o);for(var s=9,l=this.NEPALI_CALENDAR_DATA[o][0],u=this.NEPALI_CALENDAR_DATA[o][s]-l+1;a>u;)++s>12&&(s=1,o++),u+=this.NEPALI_CALENDAR_DATA[o][s];var c=this.NEPALI_CALENDAR_DATA[o][s]-(u-a);return this.newDate(o,s,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;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 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=a,n.calendars.jalali=a},{"../main":558,"object-assign":449}],555:[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":558,"object-assign":449}],556:[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":558,"object-assign":449}],557:[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āthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","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),i=r.toJD()-24e5+.5,a=0,s=0;si)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 i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292,s=i.day()+o[a-1]-1;return s+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,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(t=null!=t.year?t.year:t,i=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":558,"object-assign":449}],558:[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(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(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(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 a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return e.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+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),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,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new i;u.cdate=a,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":449}],559:[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,u=r.dayNames||this.local.dayNames,c=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(T).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(T));return T+=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=v;for(var S=this.daysInMonth(h,p);d>S;S=this.daysInMonth(h,p))p++,d-=S}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":558,"object-assign":449}],560:[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":139}],561:[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":560}],562:[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}]},{}],563:[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;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"}}})},{"../../plot_api/plot_template":741,"../../plots/cartesian/constants":757,"../../plots/font_attributes":777,"./arrow_paths":562}],564:[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);e._extremes={},r&&s(e,r),n&&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"],u=t["a"+a+"ref"],c=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,v=p-h,g=3*t.startarrowsize*t.arrowwidth||0,m=g+h,y=g-h;if(u===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:v}),b=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,m),ppadminus:Math.max(f,v,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.annotations);if(r.length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":703,"../../plots/cartesian/axes":751,"./draw":569}],565:[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,u,c=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),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(u.length||c.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var q=!1,G=["x","y"],W=0;W1)&&(tt===Q?((ut=et.r2fraction(e["a"+K]))<0||ut>1)&&(q=!0):q=!0),Y=et._offset+et.r2p(e[K]),$=.5}else"x"===K?(Z=e[K],Y=b.l+b.w*Z):(Z=1-e[K],Y=b.t+b.h*Z),$=e.showarrow?.5:Z;if(e.showarrow){lt.head=Y;var ct=e["a"+K];J=nt*H(.5,e.xanchor)-it*H(.5,e.yanchor),tt===Q?(lt.tail=et._offset+et.r2p(ct),X=J):(lt.tail=Y+ct,X=J+ct),lt.text=lt.tail+J;var ft=x["x"===K?"width":"height"];if("paper"===Q&&(lt.head=o.constrain(lt.head,1,ft-1)),"pixel"===tt){var ht=-Math.max(lt.tail-3,lt.text),pt=Math.min(lt.tail+3,lt.text)-ft;ht>0?(lt.tail+=ht,lt.text+=ht):pt>0&&(lt.tail-=pt,lt.text-=pt)}lt.tail+=st,lt.head+=st}else J=at*H($,ot),X=J,lt.text=Y+J;lt.text+=st,J+=st,X+=st,e["_"+K+"padplus"]=at/2+X,e["_"+K+"padminus"]=at/2-X,e["_"+K+"size"]=at,e["_"+K+"shift"]=J}if(t._dragging||!q){var dt=0,vt=0;if("left"!==e.align&&(dt=(I-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(vt=(z-w)*("middle"===e.valign?.5:1)),d)c.select("svg").attr({x:R+dt-1,y:R+vt}).call(u.setClipUrl,B?M:null,t);else{var gt=R+vt-m.top,mt=R+dt-m.left;U.call(f.positionText,mt,gt).call(u.setClipUrl,B?M:null,t)}N.select("rect").call(u.setRect,R,R,I,z),F.call(u.setRect,D/2,D/2,j-D,V-D),P.call(u.setTranslate,Math.round(E.x.text-j/2),Math.round(E.y.text-V/2)),L.attr({transform:"rotate("+S+","+E.x.text+","+E.y.text+")"});var yt,xt=function(r,n){C.selectAll(".annotation-arrow-g").remove();var c=E.x.head,f=E.y.head,h=E.x.tail+r,d=E.y.tail+n,m=E.x.text+r,y=E.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),M=o.apply2DTransform2(x),O=+F.attr("width"),I=+F.attr("height"),D=m-.5*O,z=D+O,R=y-.5*I,B=R+I,N=[[D,R,D,B],[D,B,z,B],[z,B,z,R],[z,R,D,R]].map(M);if(!N.reduce(function(t,e){return t^!!o.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){N.forEach(function(t){var e=o.segmentsIntersect(h,d,c,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)});var j=e.arrowwidth,V=e.arrowcolor,U=e.arrowside,H=C.append("g").style({opacity:l.opacity(V)}).classed("annotation-arrow-g",!0),q=H.append("path").attr("d","M"+h+","+d+"L"+c+","+f).style("stroke-width",j+"px").call(l.stroke,l.rgb(V));if(v(q,U,e),_.annotationPosition&&q.node().parentNode&&!a){var G=c,W=f;if(e.standoff){var Y=Math.sqrt(Math.pow(c-h,2)+Math.pow(f-d,2));G+=e.standoff*(h-c)/Y,W+=e.standoff*(d-f)/Y}var X,Z,$=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-G)+","+(d-W),transform:"translate("+G+","+W+")"}).style("stroke-width",j+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:$.node(),gd:t,prepFn:function(){var t=u.getTranslate(P);X=t.x,Z=t.y,s&&s.autorange&&k(s._name+".autorange",!0),g&&g.autorange&&k(g._name+".autorange",!0)},moveFn:function(t,r){var n=w(X,Z),i=n[0]+t,a=n[1]+r;P.call(u.setTranslate,i,a),A("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/b.w),A("y",g?g.p2r(g.r2p(e.y)+r):e.y-r/b.h),e.axref===e.xref&&A("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&A("ay",g.p2r(g.r2p(e.ay)+r)),H.attr("transform","translate("+t+","+r+")"),L.attr({transform:"rotate("+S+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&xt(0,0),O&&p.init({element:P.node(),gd:t,prepFn:function(){yt=L.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?A("ax",s.p2r(s.r2p(e.ax)+t)):A("ax",e.ax+t),e.ayref===e.yref?A("ay",g.p2r(g.r2p(e.ay)+r)):A("ay",e.ay+r),xt(t,r);else{if(a)return;var i,o;if(s)i=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/b.w,u=e.x+(e._xshift-e.xshift)/b.w-l/2;i=p.align(u+t/b.w,l,0,1,e.xanchor)}if(g)o=g.p2r(g.r2p(e.y)+r);else{var c=e._ysize/b.h,f=e.y-(e._yshift+e.yshift)/b.h-c/2;o=p.align(f-r/b.h,c,0,1,e.yanchor)}A("x",i),A("y",o),s&&g||(n=p.getCursor(s?.5:i,g?.5:o,e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+r+")"+yt}),h(P,n)},doneFn:function(){h(P),i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}else P.remove()}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,g=e.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=h.backoff*d+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var x=o.x-s.x,b=o.y-s.y;if(l=Math.atan2(b,x),u=l+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void I();if(m){if(m*m>x*x+b*b)return void I();var _=m*Math.cos(l),w=m*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>x*x+b*b)return void I();var k=y*Math.cos(l),A=y*Math.sin(l);o.x-=k,o.y-=A,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var T=c.getTotalLength(),M="";if(T1){u=!0;break}}u?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":800,"../annotations/draw":569}],576:[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)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+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).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()},a.contrast=function(t,e,r){var i=n(t);1!==i.getAlpha()&&(i=n(a.combine(t,l)));var o=i.isDark()?e?i.lighten(e):l:r?i.darken(r):s;return o.toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var Z=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));W*=Z*u.roundUp(X/Z,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=W}G.domain=[U+N,U+R-N],G.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var $,J=t.select("."+A.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),K=t.select("."+A.cbaxis),Q=0;function tt(n,i){var a={propContainer:G,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(),d.draw(r,n,c(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var t,r=l.l+(e.x+F)*l.w,n=G.title.font.size;t="top"===T?(1-(U+R-N))*l.h+l.t+3+.75*n:(1-(U+N))*l.h+l.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var a=t.select("."+A.cbtitle),o=a.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],f=a.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(Q=h.bBox(f).height)>p&&(c[1]-=(Q-p)/2):o.node()&&!o.classed(A.jsPlaceholder)&&(Q=h.bBox(o.node()).height),Q){if(Q+=5,"top"===T)G.domain[1]-=Q/l.h,c[1]*=-1;else{G.domain[0]+=Q/l.h;var d=v.lineCount(o);c[1]+=(1-d)*p}a.attr("transform","translate("+c+")"),G.setScale()}}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-G.domain[1]))+")"),K.attr("transform","translate(0,"+Math.round(-l.t)+")");var m=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).data(O);m.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),m.exit().remove();var y=M.map(G.c2p).map(Math.round).sort(function(t,e){return t-e});m.each(function(t,a){var o=[0===a?M[0]:(O[a]+O[a-1])/2,a===O.length-1?M[1]:(O[a]+O[a+1])/2].map(G.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var s=n.select(this).attr({x:j,width:Math.max(P,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=S(t).replace("e-","");s.attr("fill",i(l).toHexString())}});var x=t.select("."+A.cblines).selectAll("path."+A.cbline).data(g.color&&g.width?I:[]);x.enter().append("path").classed(A.cbline,!0),x.exit().remove(),x.each(function(t){n.select(this).attr("d","M"+j+","+(Math.round(G.c2p(t))+g.width/2%1)+"h"+P).call(h.lineGroupStyle,g.width,E(t),g.dash)}),K.selectAll("g."+G._id+"tick,path").remove();var b=j+P+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(G),k=s.makeTransFn(G),C=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,w):w,layer:K,path:s.makeTickPath(G,b,C),transFn:k}),s.drawLabels(r,G,{vals:w,layer:K,transFn:k,labelFns:s.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(T)){var t=G.title.font.size,e=G._offset+G._length/2,i=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));tt("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:T,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=P+e.outlinewidth/2+h.bBox(K.node()).width;if(($=J.select("text")).node()&&!$.classed(A.jsPlaceholder)){var i,o=J.select(".h"+G._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(T)?h.bBox(o).width:h.bBox(J.node()).right-j-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=H-q;t.select("."+A.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:q-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:j,y:q+e.ypad+("top"===T?Q:0),width:Math.max(P,2),height:Math.max(u-2*e.ypad-Q,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var f={},d=w[e.yanchor],v=k[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=u*d,f.b=u*v):(f.t=f.b=0,f.yt=e.y+e.len*d,f.yb=e.y-e.len*v);var g=w[e.xanchor],m=k[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=s*g,f.r=s*m;else{var y=s-P;f.l=y*g,f.r=y*m,f.xl=e.x-e.thickness*g,f.xr=e.x+e.thickness*m}a.autoMargin(r,e._id,f)}],r)}e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+A.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return c(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function u(){"function"==typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var f=0;fv-p?p=v-(d-v):d-v=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":703,"./helpers":591,"fast-isnumeric":224}],589:[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,u=new Array(l),c=0;c4/3-s?o:s}},{}],597:[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":703}],598:[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=t("../../constants/interactions"),u=e.exports={};u.align=t("./align"),u.getCursor=t("./cursor");var c=t("./unhover");function f(){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)}u.unhover=c.wrapped,u.unhoverRaw=c.raw,u.init=function(t){var e,r,n,c,p,d,v,g,m=t.gd,y=1,x=l.DBLCLICKDELAY,b=t.element;m._mouseDownTime||(m._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=w,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=w,b.addEventListener("touchstart",w,{passive:!1})):b.ontouchstart=w;var _=t.clampFn||function(t,e,r){return Math.abs(t)x&&(y=Math.max(y-1,1)),m._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(y,d),!g){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)}v.dispatchEvent(r)}m._dragging=!1,m._dragged=!1}else m._dragged=!1}},u.coverSlip=f},{"../../constants/interactions":679,"../../lib":703,"../../plots/cartesian/constants":757,"./align":596,"./cursor":597,"./unhover":599,"has-hover":405,"has-passive-events":406,"mouse-event-offset":431}],599:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/get_graph_div"),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&&!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/events":692,"../../lib/get_graph_div":699,"../../lib/throttle":728,"../fx/constants":613}],600:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],601:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment"),p=h.LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,v=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),m=e.exports={};m.font=function(t,e,r,n){u.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(s.fill,n)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,i){t.call(m.setPosition,e,r).call(m.setSize,n,i)},m.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},m.translatePoints=function(t,e,r){t.each(function(t){var i=n.select(this);m.translatePoint(t,i,e,r)})},m.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},m.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each(function(e){var a=e[0].trace,s=a.xcalendar,l=a.ycalendar,u=o.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each(function(t){m.hideOutsideRangePoint(t,n.select(this),r,i,s,l)})})}},m.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),m.dashLine(e,l,o)},m.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(m.dashLine,l,o)})},m.dashLine=function(t,e,r){r=+r||0,e=m.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.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},m.singleFillStyle=function(t){var e=n.select(t.node()),r=e.data(),i=(((r[0]||[])[0]||{}).trace||{}).fillcolor;i&&t.call(s.fill,i)},m.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)})};var y=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach(function(t){var e=y[t];m.symbolList=m.symbolList.concat([e.n,t,e.n+100,t+"-open"]),m.symbolNames[e.n]=t,m.symbolFuncs[e.n]=e.f,e.needLine&&(m.symbolNeedLines[e.n]=!0),e.noDot?m.symbolNoDot[e.n]=!0:m.symbolList=m.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(m.symbolNoFill[e.n]=!0)});var x=m.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function _(t,e){var r=t%100;return m.symbolFuncs[r](e)+(t>=200?b:"")}m.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=m.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=x||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},A=n.format("~.1f"),T={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};m.gradient=function(t,e,r,i,o,l){for(var c=o.length,f=T[i],h=new Array(c),p=0;p=100,e.attr("d",_(c,l))}var f,h,p,d=!1;if(t.so)p=o.outlierwidth,h=o.outliercolor,f=a.outliercolor;else{var v=(o||{}).width;p=(t.mlw+1||v+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(f=s.defaultLine,d=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=a.gradient,y=t.mgt;if(y?d=!0:y=g&&g.type,Array.isArray(y)&&(y=y[0],T[y]||(y=0)),y&&"none"!==y){var x=t.mgc;x?d=!0:x=g.color;var b=r.uid;d&&(b+="-"+t.i),m.gradient(e,i,b,y,[[0,x],[1,f]],"fill")}else s.fill(e,f);p&&s.stroke(e,h)}},m.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=m.tryColorscale(r,""),e.lineScale=m.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=v.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,m.makeSelectedPointStyleFns(t)),e},m.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,f=s.opacity,h=void 0!==c,p=void 0!==f;(u.isArrayOrTypedArray(l)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:p?f:d*e});var v=i.color,g=a.color,m=s.color;(g||m)&&(e.selectedColorFn=function(t){var e=t.mcc||v;return t.selected?g||e:m||e});var y=i.size,x=a.size,b=s.size,_=void 0!==x,w=void 0!==b;return o.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},m.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,d))},e},m.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.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){s.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",_(m.symbolNumber(n),a)),e.mrc2=a}),a.length&&t.each(function(t){for(var e=n.select(this),r=0;r0?r:0}m.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=m.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}t.each(function(t){var a=n.select(this),o=u.extractOption(t,e,"tx","text");if(o||0===o){var s=t.tp||e.textposition,l=S(t,e),f=i?i(t):t.tc||e.textfont.color;a.call(m.font,t.tf||e.textfont.family,l,f).text(o).call(c.convertToTspans,r).call(E,s,l,t.mrc)}else a.remove()})}},m.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedTextStyleFns(e);t.each(function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=S(t,e);s.fill(i,a),E(i,o,l,t.mrc2||t.mrc)})}};var C=.5;function L(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],u=Math.pow(a*a+o*o,C/2),c=Math.pow(s*s+l*l,C/2),f=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,p=3*c*(u+c),d=3*u*(u+c);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)]]}m.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&&(m.savedBBoxes={},P=0),r&&(m.savedBBoxes[r]=g),P++,u.extendFlat({},g)},m.setClipUrl=function(t,e,r){t.attr("clip-path",z(e,r))},m.getTranslate=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||0,y:+n[1]||0}},m.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+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},m.getScale=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||1,y:+n[1]||1}},m.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.*/;m.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*$/;m.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?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}})}},{"../../constants/alignment":675,"../../constants/interactions":679,"../../constants/xmlns_namespaces":681,"../../lib":703,"../../lib/svg_text_utils":727,"../../registry":831,"../../traces/scatter/make_bubble_size_func":1091,"../../traces/scatter/subtypes":1098,"../color":580,"../colorscale":592,"./symbol_defs":602,d3:157,"fast-isnumeric":224,tinycolor2:524}],602:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2),o=n.round(.809*t,2);return"M"+e+","+a+"L"+r+","+o+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2),f=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+f+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,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}}},{d3:157}],603:[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"}}}},{}],604:[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]||{},u=l.visible&&-1!==["linear","log"].indexOf(r.type),c=[];if(u){for(var f=s(l),h=0;h0;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 v=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 m=g.enter().append("g").classed("errorbar",!0);c&&m.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)};return 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))),n}(t,l,u);if(!v||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()?c&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0),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()?c&&(h=h.transition().duration(s.duration).ease(s.easing)):h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0),h.attr("d",a)}else h.remove()}})}})}},{"../../traces/scatter/subtypes":1098,"../drawing":601,d3:157,"fast-isnumeric":224}],609:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":580,d3:157}],610:[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":693,"../../plots/font_attributes":777,"./layout_attributes":620}],611:[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.indexw[0]._length||et<0||et>k[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=tt+w[0]._offset,e.pointerY=et+k[0]._offset,z="xval"in e?v.flat(l,e.xval):v.p2c(w,tt),R="yval"in e?v.flat(l,e.yval):v.p2c(k,et),!i(z[0])||!i(R[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var it=1/0;for(B=0;BY&&($.splice(0,Y),it=$[0].distance),y&&0!==Z&&0===$.length){W.distance=Z,W.index=!1;var ut=j._module.hoverPoints(W,q,G,"closest",c._hoverlayer);if(ut&&(ut=ut.filter(function(t){return t.spikeDistance<=Z})),ut&&ut.length){var ct,ft=ut.filter(function(t){return t.xa.showspikes});if(ft.length){var ht=ft[0];i(ht.x0)&&i(ht.y0)&&(ct=gt(ht),(!K.vLinePoint||K.vLinePoint.spikeDistance>ct.spikeDistance)&&(K.vLinePoint=ct))}var pt=ut.filter(function(t){return t.ya.showspikes});if(pt.length){var dt=pt[0];i(dt.x0)&&i(dt.y0)&&(ct=gt(dt),(!K.hLinePoint||K.hLinePoint.spikeDistance>ct.spikeDistance)&&(K.hLinePoint=ct))}}}}function vt(t,e){for(var r,n=null,i=1/0,a=0;a1||$.length>1)||"closest"===D&&Q&&$.length>1,Ot=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),It={hovermode:D,rotateLabels:Lt,bgColor:Ot,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},Pt=T($,It,t);if(function(t,e,r){var n,i,a,o,s,l,u,c=0,f=1,h=t.size(),p=new Array(h);function d(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;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-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(t.each(function(t,n){var i=t[e],a="x"===i._id.charAt(0),o=i.range;!n&&o&&o[0]>o[1]!==a&&(f=-1),p[n]=[{datum:t,i:n,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?x:1)/2,pmin:0,pmax:a?r.width:r.height}]}),p.sort(function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)});!n&&c<=h;){for(c++,n=!0,o=0;o.01&&m.pmin===y.pmin&&m.pmax===y.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=i;for(v.push.apply(v,g),p.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(a=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=a;n=!1}else o++}p.forEach(d)}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}}}(Pt,Lt?"xa":"ya",c),M(Pt,Lt),e.target&&e.target.tagName){var Dt=d.getComponentMethod("annotations","hasClickToShow")(t,Mt);u(n.select(e.target),Dt?"pointer":"")}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,Tt)&&(Tt&&t.emit("plotly_unhover",{event:e,points:Tt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:w,yaxes:k,xvals:z,yvals:R}))}(t,e,r,a)})},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=t.map(function(t){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,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}}),a=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):a,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:o},l=T(i,s,e.gd),u=0,c=0;return l.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 T(t,e,r){var i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,p=e.outerContainer,d=e.commonLabelOpts||{},v=e.fontFamily||g.HOVERFONT,y=e.fontSize||g.HOVERFONTSIZE,x=t[0],b=x.xa,_=x.ya,T="y"===a?"yLabel":"xLabel",M=x[T],E=(String(M)||"").split(" ")[0],S=p.node().getBoundingClientRect(),C=S.top,O=S.width,I=S.height,P=void 0!==M&&x.distance<=e.hoverdistance&&("x"===a||"y"===a);if(P){var D,z,R=!0;for(D=0;D"),void 0!==t.yLabel&&(p+="y: "+t.yLabel+"
"),p+=(p?"z: ":"")+t.zLabel):P&&t[a+"Label"]===M?p=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(p=t.yLabel):p=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(p+=(p?"
":"")+t.text),void 0!==t.extraText&&(p+=(p?"
":"")+t.extraText),""!==p||t.hovertemplate||(""===h&&e.remove(),p=h);var _=i._d3locale,T=t.hovertemplate||!1,E=t.hovertemplateLabels||t,S=t.eventData[0]||{};T&&(p=(p=o.hovertemplateString(T,E,_,S,t.trace._meta)).replace(A,function(e,r){return h=L(r,t.nameLength),""}));var D=e.select("text.nums").call(c.font,t.fontFamily||v,t.fontSize||y,t.fontColor||b).text(p).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),z=e.select("text.name"),R=0,F=0;if(h&&h!==p){z.call(c.font,t.fontFamily||v,t.fontSize||y,x).text(h).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var B=z.node().getBoundingClientRect();R=B.width+2*k,F=B.height+2*k}else z.remove(),e.select("rect").remove();e.select("path").style({fill:g,stroke:b});var N,j,V=D.node().getBoundingClientRect(),U=t.xa._offset+(t.x0+t.x1)/2,H=t.ya._offset+(t.y0+t.y1)/2,q=Math.abs(t.x1-t.x0),G=Math.abs(t.y1-t.y0),W=V.width+w+k+R;if(t.ty0=C-V.top,t.bx=V.width+2*k,t.by=Math.max(V.height+2*k,F),t.anchor="start",t.txwidth=V.width,t.tx2width=R,t.offset=0,s)t.pos=U,N=H+G/2+W<=I,j=H-G/2-W>=0,"top"!==t.idealAlign&&N||!j?N?(H+=G/2,t.anchor="start"):t.anchor="middle":(H-=G/2,t.anchor="end");else if(t.pos=H,N=U+q/2+W<=O,j=U-q/2-W>=0,"left"!==t.idealAlign&&N||!j)if(N)U+=q/2,t.anchor="start";else{t.anchor="middle";var Y=W/2,X=U+Y-O,Z=U-Y;X>0&&(U-=X),Z<0&&(U+=-Z)}else U-=q/2,t.anchor="end";D.attr("text-anchor",t.anchor),R&&z.attr("text-anchor",t.anchor),e.attr("transform","translate("+U+","+H+")"+(s?"rotate("+m+")":""))}),N}function M(t,e){t.each(function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),a=t.anchor,o="end"===a?-1:1,s={start:1,end:-1,middle:0}[a],u=s*(w+k),f=u+s*(t.txwidth+k),h=0,p=t.offset;"middle"===a&&(u-=t.tx2width/2,f+=t.txwidth/2+k),e&&(p*=-_,h=t.offset*b),r.select("path").attr("d","middle"===a?"M-"+(t.bx/2+t.tx2width/2)+","+(p-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*w+h)+","+(w+p)+"v"+(t.by/2-w)+"h"+o*t.bx+"v-"+t.by+"H"+(o*w+h)+"V"+(p-w)+"Z");var d=u+h,v=p+t.ty0-t.by/2+k,g=t.textAlign||"auto";"auto"!==g&&("left"===g&&"start"!==a?(i.attr("text-anchor","start"),d="middle"===a?-t.bx/2-t.tx2width/2+k:-t.bx-k):"right"===g&&"end"!==a&&(i.attr("text-anchor","end"),d="middle"===a?t.bx/2-t.tx2width/2-k:t.bx+k)),i.call(l.positionText,d,v),t.tx2width&&(r.select("text.name").call(l.positionText,f+s*k+h,p+t.ty0-t.by/2+k),r.select("rect").call(c.setRect,f+(s-1)*t.tx2width/2+h,p-t.by/2-1,t.tx2width,t.by+2))})}function E(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 u=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 c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}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:p.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal),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=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+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 S(t,e){var r,n,i=e.container,o=e.fullLayout,s=e.event,l=!!t.hLinePoint,u=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),u||l){var h=f.combine(o.plot_bgcolor,o.paper_bgcolor);if(l){var p,d,v=t.hLinePoint;r=v&&v.xa;var g=(n=v&&v.ya).spikesnap;"cursor"===g?(p=s.pointerX,d=s.pointerY):(p=r._offset+v.x,d=n._offset+v.y);var m,y,x=a.readability(v.color,h)<1.5?f.contrast(h):v.color,b=n.spikemode,_=n.spikethickness,w=n.spikecolor||x,k=n._boundingBox,A=(k.left+k.right)/20){for(var n=[],i=0;i-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!h&&!p&&!d){var x="independent"===T("pattern");x&&(h=!0)}g._hasSubplotGrid=h;var b,_,w="top to bottom"===T("roworder"),k=h?.2:.1,A=h?.3:.1;v&&e._splomGridDflt&&(b=e._splomGridDflt.xside,_=e._splomGridDflt.yside),g._domains={x:c("x",T,k,b,y),y:c("y",T,A,_,m,w)}}else delete e.grid}function T(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,c,h=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,v=r.rows,g=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(d){var x=h.subplots||[];l=r.subplots=new Array(v);var b=1;for(n=0;n1);if(!1!==x||p.uirevision){var b=a.newContainer(e,"legend");if(w("uirevision",e.uirevision),!1!==x){if(w("bgcolor",e.paper_bgcolor),w("bordercolor"),w("borderwidth"),i.coerceFont(w,"font",e.font),w("orientation"),"h"===b.orientation){var _=t.xaxis;n.getComponentMethod("rangeslider","isVisible")(_)?(u=0,f="left",c=1.1,h="bottom"):(u=0,f="left",c=-.1,h="top")}w("traceorder",g),l.isGrouped(e.legend)&&w("tracegroupgap"),w("itemsizing"),w("itemclick"),w("itemdoubleclick"),w("x",u),w("xanchor",f),w("y",c),w("yanchor",h),w("valign"),i.noneOrAll(p,b,["x","y"])}}function w(t,e){return i.coerce(p,b,o,t,e)}}},{"../../lib":703,"../../plot_api/plot_template":741,"../../plots/layout_attributes":803,"../../registry":831,"./attributes":629,"./helpers":635}],632:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=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"),p=t("./constants"),d=t("../../constants/interactions"),v=t("../../constants/alignment"),g=v.LINE_SPACING,m=v.FROM_TL,y=v.FROM_BR,x=t("./get_legend_data"),b=t("./style"),_=t("./helpers"),w=d.DBLCLICKDELAY;function k(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};a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label);var u=s.triggerHandler(t,"plotly_legendclick",l);if(!1!==u)if(1===n)e._clickTimeout=setTimeout(function(){h(r,t,n)},w);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0;var c=s.triggerHandler(t,"plotly_legenddoubleclick",l);!1!==c&&h(r,t,n)}}function A(t,e,r){var n=t.data()[0][0],a=e._fullLayout,s=n.trace,l=o.traceIs(s,"pie-like"),c=s.index,h=e._context.edits.legendText&&!l,d=l?n.label:s.name;s._meta&&(d=i.templateString(d,s._meta));var v=i.ensureSingle(t,"text","legendtext");function m(r){f.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(r.trace.showlegend){var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*g;if(o){var l=u.bBox(o);n=l.height,i=l.width,u.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),h=f.lineCount(c),d=c.node();n=s*h,i=d?u.bBox(d).width:0;var v=s*(.3+(1-h)/2);f.positionText(c,p.textOffsetX,v)}r.lineHeight=s,r.height=Math.max(n,16)+3,r.width=i}else t.remove()}(t,e)})}v.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,a.legend.font).text(h?T(d,r):d),f.positionText(v,p.textOffsetX,0),h?v.call(f.makeEditable,{gd:e,text:d}).call(m).on("edit",function(t){this.text(T(t,r)).call(m);var a=n.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var l=o.getTransformIndices(a,"groupby"),u=l[l.length-1],f=i.keyedContainer(a,"transforms["+u+"].styles","target","value.name");f.set(n.trace._group,t),s=f.constructUpdate()}else s.name=t;return o.call("_guiRestyle",e,s,c)}):m(v)}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 M(t,e){var r,a=1,o=i.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")});o.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimew&&(a=Math.max(a-1,1)),k(e,r,t,a,n.event)}})}function E(t,e,r){var a=t._fullLayout,o=a.legend,s=o.borderwidth,l=_.isGrouped(o),c=0;if(o._width=0,o._height=0,_.isVertical(o))l&&e.each(function(t,e){u.setTranslate(this,0,e*o.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;u.setTranslate(this,s,5+s+o._height+r/2),o._height+=r,o._width=Math.max(o._width,n)}),o._width+=45+2*s,o._height+=10+2*s,l&&(o._height+=(o._lgroupsLength-1)*o.tracegroupgap),c=40;else if(l){var f,h=0,p=0,d=e.data(),v=0;for(f=0;f0?o.tracegroupgap:0,w.push(A),b.push(o._width)}e.each(function(t,e){u.setTranslate(this,b[e],w[e])}),e.each(function(){var t=n.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;u.setTranslate(this,0,5+s+r+n/2),r+=n})});var T=w[w.length-1]+h;o._height=10+2*s+T;var M=Math.max.apply(null,b);o._width=M+p+40,o._width+=2*s}else{var E=0,S=0,C=0,L=0,O=0;r.each(function(t){C=Math.max(40+t[0].width,C),O+=40+t[0].width+5});var I=a._size.w>s+O-5;r.each(function(t){var e=t[0],r=I?40+t[0].width:C;s+L+5+r>a._size.w&&(L=0,E+=S,o._height+=S,S=0),u.setTranslate(this,s+L,5+s+e.height/2+E),o._width+=5+r,L+=5+r,S=Math.max(e.height,S)}),I?o._height=S:o._height+=S,o._width+=2*s,o._height+=10+2*s}o._width=Math.ceil(o._width),o._height=Math.ceil(o._height);var P=t._context.edits.legendText||t._context.edits.legendPosition;r.each(function(t){var e=t[0],r=n.select(this).select(".legendtoggle");u.setRect(r,0,-e.height/2,(P?0:o._width)+c,e.height)})}function S(t){var e=t._fullLayout,r=e.legend,n="left";i.isRightAnchor(r)?n="right":i.isCenterAnchor(r)&&(n="center");var o="top";i.isBottomAnchor(r)?o="bottom":i.isMiddleAnchor(r)&&(o="middle"),a.autoMargin(t,"legend",{x:r.x,y:r.y,l:r._width*m[n],r:r._width*y[n],b:r._height*y[o],t:r._height*m[o]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var s=e.legend,f=e.showlegend&&x(t.calcdata,s),h=e.hiddenlabels||[];if(!e.showlegend||!f.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void a.autoMargin(t,"legend");for(var d=0,v=0;vf?function(t){var e=t._fullLayout.legend,r="left";i.isRightAnchor(e)?r="right":i.isCenterAnchor(e)&&(r="center"),a.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*m[r],r:e._width*y[r],b:0,t:0})}(t):S(t);var h=e._size,d=h.l+h.w*s.x,v=h.t+h.h*(1-s.y);i.isRightAnchor(s)?d-=s._width:i.isCenterAnchor(s)&&(d-=s._width/2),i.isBottomAnchor(s)?v-=s._height:i.isMiddleAnchor(s)&&(v-=s._height/2);var g=s._width,x=h.w;g>x?(d=h.l,g=x):(d+g>c&&(d=c-g),d<0&&(d=0),g=Math.min(c-d,s._width));var b,_,w,A,T=s._height,M=h.h;if(T>M?(v=h.t,T=M):(v+T>f&&(v=f-T),v<0&&(v=0),T=Math.min(f-v,s._height)),u.setTranslate(O,d,v),z.on(".drag",null),O.on("wheel",null),s._height<=T||t._context.staticPlot)P.attr({width:g-s.borderwidth,height:T-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),u.setTranslate(D,0,0),I.select("rect").attr({width:g-2*s.borderwidth,height:T-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth}),u.setClipUrl(D,r,t),u.setRect(z,0,0,0,0),delete s._scrollY;else{var C,B,N=Math.max(p.scrollBarMinHeight,T*T/s._height),j=T-N-2*p.scrollBarMargin,V=s._height-T,U=j/V,H=Math.min(s._scrollY||0,V);P.attr({width:g-2*s.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:T-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),I.select("rect").attr({width:g-2*s.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:T-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth+H}),u.setClipUrl(D,r,t),G(H,N,U),O.on("wheel",function(){G(H=i.constrain(s._scrollY+n.event.deltaY/j*V,0,V),N,U),0!==H&&H!==V&&n.event.preventDefault()});var q=n.behavior.drag().on("dragstart",function(){C=n.event.sourceEvent.clientY,B=H}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||G(H=i.constrain((t.clientY-C)/U+B,0,V),N,U)});z.call(q)}function G(e,r,n){s._scrollY=t._fullLayout.legend._scrollY=e,u.setTranslate(D,0,-e),u.setRect(z,g,p.scrollBarMargin+e*n,p.scrollBarWidth,r),I.select("rect").attr({y:s.borderwidth+e})}t._context.edits.legendPosition&&(O.classed("cursor-move",!0),l.init({element:O.node(),gd:t,prepFn:function(){var t=u.getTranslate(O);w=t.x,A=t.y},moveFn:function(t,e){var r=w+t,n=A+e;u.setTranslate(O,r,n),b=l.align(r,0,h.l,h.l+h.w,s.xanchor),_=l.align(n,0,h.t+h.h,h.t,s.yanchor)},doneFn:function(){void 0!==b&&void 0!==_&&o.call("_guiRelayout",t,{"legend.x":b,"legend.y":_})},clickFn:function(r,n){var i=e._infolayer.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&&k(t,O,i,r,n)}}))}],t)}}},{"../../constants/alignment":675,"../../constants/interactions":679,"../../lib":703,"../../lib/events":692,"../../lib/svg_text_utils":727,"../../plots/plots":812,"../../registry":831,"../color":580,"../dragelement":598,"../drawing":601,"./constants":630,"./get_legend_data":633,"./handle_click":634,"./helpers":635,"./style":637,d3:157}],633:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0;function f(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r0))return 0;i=e.width}return m?n:Math.min(i,r)}function x(t,e,r){var a=t[0].trace,o=a.marker||{},l=o.line||{},u=r?a.type===r&&a.visible:i.traceIs(a,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each(function(t){var e=n.select(this),r=t[0],i=y(r.mlw,o.line,v,p);e.style("stroke-width",i+"px").call(s.fill,r.mc||o.color),i&&s.stroke(e,r.mlc||l.color)})}function b(t,e,r){var o=t[0],s=o.trace,l=r?s.type===r&&s.visible:i.traceIs(s,r),f=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(f.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),f.exit().remove(),f.size()){var h=(s.marker||{}).line,d=y(c(h.width,o.pts),h,v,p),g=a.minExtend(s,{marker:{line:{width:d}}});g.marker.line.color=h.color;var m=a.minExtend(o,{trace:g});u(f,m,g)}}t.each(function(t){var e=n.select(this),r=a.ensureSingle(e,"g","layers");r.style("opacity",t[0].trace.opacity);var i=g.valign,o=t[0].lineHeight,s=t[0].height;if("middle"!==i&&o&&s){var l={top:1,bottom:-1}[i],u=l*(.5*(o-s+3));r.attr("transform","translate(0,"+u+")")}else r.attr("transform",null);var c=r.selectAll("g.legendfill").data([t]);c.enter().append("g").classed("legendfill",!0);var f=r.selectAll("g.legendlines").data([t]);f.enter().append("g").classed("legendlines",!0);var h=r.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 e=t[0].trace,r=[];"waterfall"===e.type&&e.visible&&(r=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 i=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(r);i.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),i.exit().remove(),i.each(function(t){var r=n.select(this),i=e[t[0]].marker,a=y(void 0,i.line,v,p);r.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&r.call(s.stroke,i.line.color)})}).each(function(t){x(t,this,"funnel")}).each(function(t){x(t,this)}).each(function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(i.traceIs(r,"box-violin")&&r.visible?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each(function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var i=y(void 0,r.line,v,p);t.style("stroke-width",i+"px").call(s.fill,r.fillcolor),i&&s.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:m?f:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}})}).each(function(t){b(t,this,"funnelarea")}).each(function(t){b(t,this,"pie")}).each(function(t){var r,i,s=t[0],u=s.trace,c=u.visible&&u.fill&&"none"!==u.fill,f=l.hasLines(u),p=u.contours,v=!1,g=!1;if(p){var m=p.coloring;"lines"===m?v=!0:f="none"===m||"heatmap"===m||p.showlines,"constraint"===p.type?c="="!==p._operation:"fill"!==m&&"heatmap"!==m||(g=!0)}var x=l.hasMarkers(u)||l.hasText(u),b=c||g,_=f||v,w=x||!b?"M5,0":_?"M5,-2":"M5,-3",k=n.select(this),A=k.select(".legendfill").selectAll("path").data(c||g?[t]:[]);if(A.enter().append("path").classed("js-fill",!0),A.exit().remove(),A.attr("d",w+"h30v6h-30z").call(c?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+u.uid;o.gradient(t,e,r,"horizontalreversed",u.colorscale,"fill")}}),f||v){var T=y(void 0,u.line,d,h);i=a.minExtend(u,{line:{width:T}}),r=[a.minExtend(s,{trace:i})]}var M=k.select(".legendlines").selectAll("path").data(f||v?[r]:[]);M.enter().append("path").classed("js-line",!0),M.exit().remove(),M.attr("d",w+(v?"l30,0.0001":"h30")).call(f?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+u.uid;o.lineGroupStyle(t),o.gradient(t,e,r,"horizontalreversed",u.colorscale,"stroke")}})}).each(function(t){var r,i,s=t[0],u=s.trace,c=l.hasMarkers(u),d=l.hasText(u),v=l.hasLines(u);function g(t,e,r,n){var i=a.nestedProperty(u,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(m&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function y(t){return t[0]}if(c||d||v){var x={},b={};if(c){x.mc=g("marker.color",y),x.mx=g("marker.symbol",y),x.mo=g("marker.opacity",a.mean,[.2,1]),x.mlc=g("marker.line.color",y),x.mlw=g("marker.line.width",a.mean,[0,5],p),b.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var _=g("marker.size",a.mean,[2,16],f);x.ms=_,b.marker.size=_}v&&(b.line={width:g("line.width",y,[0,10],h)}),d&&(x.tx="Aa",x.tp=g("textposition",y),x.ts=10,x.tc=g("textfont.color",y),x.tf=g("textfont.family",y)),r=[a.minExtend(s,x)],(i=a.minExtend(u,b)).selectedpoints=null}var w=n.select(this).select("g.legendpoints"),k=w.selectAll("path.scatterpts").data(c?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),k.exit().remove(),k.call(o.pointStyle,i,e),c&&(r[0].mrc=3);var A=w.selectAll("g.pointtext").data(d?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),A.exit().remove(),A.selectAll("text").call(o.textPointStyle,i,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[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","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=y(void 0,a.line,v,p);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[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","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],l=y(void 0,a.line,v,p);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)})})}},{"../../lib":703,"../../registry":831,"../../traces/pie/helpers":1054,"../../traces/pie/style_one":1060,"../../traces/scatter/subtypes":1098,"../color":580,"../drawing":601,d3:157}],638:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),s=t("../../../build/ploticon"),l=o._,u=e.exports={};function c(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=a.list(t,null,!0),h="on";if("zoom"===s){var p,d="in"===l?.5:2,v=(1+d)/2,g=(1-d)/2;for(i=0;i1?(T=["toggleHover"],M=["resetViews"]):h?(A=["zoomInGeo","zoomOutGeo"],T=["hoverClosestGeo"],M=["resetGeo"]):f?(T=["hoverClosest3d"],M=["resetCameraDefault3d","resetCameraLastSave3d"]):m?(T=["toggleHover"],M=["resetViewMapbox"]):v?T=["hoverClosestGl2d"]:p?T=["hoverClosestPie"]:x?(T=["hoverClosestCartesian","hoverCompareCartesian"],M=["resetViewSankey"]):T=["toggleHover"],c&&(T=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),!c&&!v||b||(A=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==M[0]&&(M=["resetScale2d"])),f?E=["zoom3d","pan3d","orbitRotation","tableRotation"]:(c||v)&&!b||g?E=["zoom2d","pan2d"]:m||h?E=["pan2d"]:y&&(E=["zoom2d"]),function(t){for(var e=!1,r=0;r0);if(g){var m=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a0?h+u:u;return{ppad:u,ppadplus:c?d:v,ppadminus:c?v:d}}return{ppad:u}}function c(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,u,c,f,h,p=1/0,d=-1/0,v=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=h)));return d>=p?[p,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;o10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:z?H(r.xanchor)+r.x0:H(r.x0),cy:R?q(r.yanchor)-r.y0:q(r.y0),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:z?H(r.xanchor)+r.x1:H(r.x1),cy:R?q(r.yanchor)-r.y1:q(r.y1),r:a}).style(i).classed("cursor-grab",!0),n}():e,X={element:Y.node(),gd:t,prepFn:function(n){z&&(_=H(r.xanchor)),R&&(w=q(r.yanchor)),"path"===r.type?O=r.path:(m=z?r.x0:H(r.x0),y=R?r.y0:q(r.y0),x=z?r.x1:H(r.x1),b=R?r.y1:q(r.y1)),mb?(k=y,E="y0",A=b,S="y1"):(k=b,E="y1",A=y,S="y0"),Z(n),K(p,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),l=a.getFromId(r,i),u="";"paper"===n||o.autorange||(u+=n),"paper"===i||l.autorange||(u+=i),s.setClipUrl(t,u?"clip"+r._fullLayout._uid+u:null,r)}(e,r,t),X.moveFn="move"===I?$:J},doneFn:function(){c(e),Q(p),d(e,t,r),n.call("_guiRelayout",t,N.getUpdateObj())},clickFn:function(){Q(p)}};function Z(t){if(F)I="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=X.element.getBoundingClientRect(),n=r.right-r.left,i=r.bottom-r.top,a=t.clientX-r.left,o=t.clientY-r.top,s=!B&&n>P&&i>D&&!t.shiftKey?u.getCursor(a/n,1-o/i):"move";c(e,s),I=s.split("-")[0]}}function $(n,i){if("path"===r.type){var a=function(t){return t},o=a,s=a;z?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(H(t)+n)},V&&"date"===V.type&&(o=h.encodeDate(o))),R?j("yanchor",r.yanchor=W(w+i)):(s=function(t){return W(q(t)+i)},U&&"date"===U.type&&(s=h.encodeDate(s))),j("path",r.path=g(O,o,s))}else z?j("xanchor",r.xanchor=G(_+n)):(j("x0",r.x0=G(m+n)),j("x1",r.x1=G(x+n))),R?j("yanchor",r.yanchor=W(w+i)):(j("y0",r.y0=W(y+i)),j("y1",r.y1=W(b+i)));e.attr("d",v(t,r)),K(p,r)}function J(n,i){if(B){var a=function(t){return t},o=a,s=a;z?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(H(t)+n)},V&&"date"===V.type&&(o=h.encodeDate(o))),R?j("yanchor",r.yanchor=W(w+i)):(s=function(t){return W(q(t)+i)},U&&"date"===U.type&&(s=h.encodeDate(s))),j("path",r.path=g(O,o,s))}else if(F){if("resize-over-start-point"===I){var l=m+n,u=R?y-i:y+i;j("x0",r.x0=z?l:G(l)),j("y0",r.y0=R?u:W(u))}else if("resize-over-end-point"===I){var c=x+n,f=R?b-i:b+i;j("x1",r.x1=z?c:G(c)),j("y1",r.y1=R?f:W(f))}}else{var d=~I.indexOf("n")?k+i:k,N=~I.indexOf("s")?A+i:A,Y=~I.indexOf("w")?T+n:T,X=~I.indexOf("e")?M+n:M;~I.indexOf("n")&&R&&(d=k-i),~I.indexOf("s")&&R&&(N=A-i),(!R&&N-d>D||R&&d-N>D)&&(j(E,r[E]=R?d:W(d)),j(S,r[S]=R?N:W(N))),X-Y>P&&(j(C,r[C]=z?Y:G(Y)),j(L,r[L]=z?X:G(X)))}e.attr("d",v(t,r)),K(p,r)}function K(t,e){(z||R)&&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]:h.extractPathCoords(e.path,f.paramIsX))),o=q(R?e.yanchor:i.midRange(r?[e.y0,e.y1]:h.extractPathCoords(e.path,f.paramIsY)));if(a=h.roundPositionForSharpStrokeRendering(a,1),o=h.roundPositionForSharpStrokeRendering(o,1),z&&R){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 u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function Q(t){t.selectAll(".visual-cue").remove()}u.init(X),Y.node().onmousemove=Z}(t,x,r,e,p)}}function d(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");s.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function v(t,e){var r,n,o,s,l,u,c,p,d=e.type,v=a.getFromId(t,e.xref),g=a.getFromId(t,e.yref),m=t._fullLayout._size;if(v?(r=h.shapePositionToRange(v),n=function(t){return v._offset+v.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},g?(o=h.shapePositionToRange(g),s=function(t){return g._offset+g.r2p(o(t,!0))}):s=function(t){return m.t+m.h*(1-t)},"path"===d)return v&&"date"===v.type&&(n=h.decodeDate(n)),g&&"date"===g.type&&(s=h.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(f.segmentRE,function(t){var n=0,u=t.charAt(0),c=f.paramIsX[u],h=f.paramIsY[u],p=f.numParams[u],d=t.substr(1).replace(f.paramRE,function(t){return c[n]?t="pixel"===a?e(s)+Number(t):e(t):h[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>p&&(t="X"),t});return n>p&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+d})}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,u=y+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var x=s(e.yanchor);c=x-e.y0,p=x-e.y1}else c=s(e.y0),p=s(e.y1);if("line"===d)return"M"+l+","+c+"L"+u+","+p;if("rect"===d)return"M"+l+","+c+"H"+u+"V"+p+"H"+l+"Z";var b=(l+u)/2,_=(c+p)/2,w=Math.abs(b-l),k=Math.abs(_-c),A="A"+w+","+k,T=b+w+","+_,M=b+","+(_-k);return"M"+T+A+" 0 1,1 "+M+A+" 0 0,1 "+T+"Z"}function g(t,e,r){return t.replace(f.segmentRE,function(t){var n=0,i=t.charAt(0),a=f.paramIsX[i],o=f.paramIsY[i],s=f.numParams[i],l=t.substr(1).replace(f.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)});return i+l})}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var i=0;i0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function E(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function S(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",c.railTouchRectClass,function(n){n.call(A,e,t,r).style("pointer-events","all")});i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,i=s.ensureSingle(t,"rect",c.railRectClass);i.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,v(e))}if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().each(function(){n.select(this).selectAll("g."+c.groupClassName).each(s)}).remove(),0!==r.length){var l=a.selectAll("g."+c.groupClassName).data(r,g);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var v={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[y.side];e.attr("transform","translate("+v+")")}}}return P.call(D),O&&(M?P.on(".opacity",null):(k=0,A=!0,P.text(g).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)})),P.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==m?o.call("_guiRestyle",t,v,e,m):o.call("_guiRelayout",t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(D)}).on("input",function(t){this.text(t||" ").call(c.positionText,x.x,x.y)})),P.classed("js-placeholder",A),_}};var h=/ [XY][0-9]* /},{"../../constants/interactions":679,"../../lib":703,"../../lib/svg_text_utils":727,"../../plots/plots":812,"../../registry":831,"../color":580,"../drawing":601,d3:157,"fast-isnumeric":224}],669:[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,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"}]},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: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":693,"../../plot_api/edit_types":734,"../../plot_api/plot_template":741,"../../plots/font_attributes":777,"../../plots/pad_attributes":811,"../color/attributes":579}],670:[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:"◄",right:"►",up:"▲",down:"▼"}}},{}],671:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants"),s=o.name,l=a.buttons;function u(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}var s=i(t,e,{name:"buttons",handleItemDefaults:c}),l=o("visible",s.length>0);l&&(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,l,r,i)}var i=r("visible","skip"===t.method||Array.isArray(t.args));i&&(r("method"),r("args"),r("label"),r("execute"))}e.exports=function(t,e){var r={name:s,handleItemDefaults:u};i(t,e,r)}},{"../../lib":703,"../../plots/array_container_defaults":747,"./attributes":669,"./constants":670}],672:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=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 p(t){return t._index}function d(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function v(t,e,r,n,i,a,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&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||m(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,u=i.active,c=i.buttons[u]||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,c,t).call(M,i,h,p);var v=s.ensureSingle(e,"text",f.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])});v.attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",function(){r.call(E,String(d(r,i)?-1:i._index)),m(t,e,r,n,i)}),a.on("mouseover",function(){a.call(w)}),a.on("mouseout",function(){a.call(k,i)}),o.setTranslate(e,l.lx,l.ly)}function m(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,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),p=c.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,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?g=m.headerHeight+f.gapButtonHeader:d=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+d+o.pad.l,y:m.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},A={l:b.x+o.borderwidth,t:b.y+o.borderwidth};c.each(function(s,l){var u=n.select(this);u.call(y,o,s,t).call(M,o,b),u.on("click",function(){n.event.defaultPrevented||(v(t,o,0,e,r,a,l),s.execute&&i.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(k,o),c.call(_,o)})}),c.call(_,o),x?(A.w=Math.max(m.openWidth,m.headerWidth),A.h=b.y-A.t):(A.w=b.x-A.l,A.h=Math.max(m.openHeight,m.headerHeight)),A.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,p=i.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(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 u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),c=0;ck,E=s.barLength+2*s.barPad,S=s.barWidth+2*s.barPad,C=d,L=g+m;L+S>u&&(L=u-S);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(i.fill,s.barColor),M?(this.hbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:C,y:L,width:E,height:S}),this._hbarXMin=C+E/2,this._hbarTranslateMax=k-E):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=m>A,P=s.barWidth+2*s.barPad,D=s.barLength+2*s.barPad,z=d+v,R=g;z+P>l&&(z=l-P);var F=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);F.exit().on(".drag",null).remove(),F.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),I?(this.vbar=F.attr({rx:s.barRadius,ry:s.barRadius,x:z,y:R,width:P,height:D}),this._vbarYMin=R+D/2,this._vbarTranslateMax=A-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var B=this.id,N=c-.5,j=I?f+P+.5:f+.5,V=h-.5,U=M?p+S+.5:p+.5,H=o._topdefs.selectAll("#"+B).data(M||I?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",B).append("rect"),M||I?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(V),width:Math.ceil(j)-Math.floor(N),height:Math.ceil(U)-Math.floor(V)}),this.container.call(a.setClipUrl,B,this.gd),this.bg.attr({x:d,y:g,width:v,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),M||I){var q=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(q);var G=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(G),I&&this.vbar.on(".drag",null).call(G)}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,a=o.constrain(n.event.x,r,i),s=(a-r)/(i-r),l=this.position.w-this._box.w;t=s*l}if(this.vbar){var u=e+this._vbarYMin,c=u+this._vbarTranslateMax,f=o.constrain(n.event.y,u,c),h=(f-u)/(c-u),p=this.position.h-this._box.h;e=h*p}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":703,"../color":580,"../drawing":601,d3:157}],675:[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"}}},{}],676:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],677:[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]}},{}],678:[function(t,e,r){"use strict";e.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},{}],679:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],680:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}},{}],681:[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}},{}],682:[function(t,e,r){"use strict";r.version="1.48.3",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s1/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}},{}],685:[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 u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0]n&&(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,u){i=i||0,a=a||0;var c,f,h,p,d,v=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}v?(c=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":710}],686:[function(t,e,r){"use strict";var n=Array.isArray,i="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}: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(c(+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: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),k=t.match(w?x:y);if(!k)return c;var A=k[1],T=k[3]||"1",M=Number(k[5]||1),E=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(u){if(2===A.length)return c;var L;A=Number(A);try{var O=g.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===T.charAt(T.length-1);T=parseInt(T,10),L=O.newDate(A,O.toMonthIndex(A,T,I),M)}else L=O.newDate(A,Number(T),M)}catch(t){return c}return L?(L.toJD()-v)*f+E*h+S*p+C*d:c}A=2===A.length?(Number(A)+2e3-b)%100+b:Number(A),T-=1;var P=new Date(Date.UTC(2e3,T,M,E,S));return P.setUTCFullYear(A),P.getUTCMonth()!==T?c:P.getUTCDate()!==M?c:P.getTime()+C*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)!==c};var k=90*f,A=3*h,T=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 c;e||(e=0);var a,o,s,u,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var E=Math.floor(w/f)+v,S=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){a=m("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 c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10)),o=a.time.format("%Y-%m-%d")(r),s=r.getHours(),u=r.getMinutes(),h=r.getSeconds(),p=10*r.getUTCMilliseconds()+e;return M(o,s,u,h,p)},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;function S(t,e,r,n){t=t.replace(E,function(t){var r=Math.min(+t.charAt(1)||6,6),n=(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0";return n});var i=new Date(Math.floor(e+.05));if(_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var C=[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=Math.min(l(t/d,60),C[e]),a=(100+i).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return S(e,t,n,i)};var L=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)+v,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()-v)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+L);return u.setUTCMonth(u.getUTCMonth()+e)+n-L},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=_(e)&&g.getComponentMethod("calendars","getCal")(e),c=0;c0&&(i.push(a),a=[])}return a.length>0&&i.push(a),i},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||v<0||v>1?null:{x:t+l*v,y:e+f*v}}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,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,f=n-e,h=o-i,p=u-a,d=c*c+f*f,v=h*h+p*p,g=Math.min(l(c,f,d,i-t,a-e),l(c,f,d,o-t,u-e),l(h,p,v,t-i,e-a),l(h,p,v,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)),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=(4*f.x+l.x+u.x)/6,p=(4*f.y+l.y+u.y)/6,d={x:h,y:p,theta:c};return n[r]=d,d},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,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=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 p=h(u);p;){if((u+=p+r)>f)return;p=h(u)}for(p=h(f);p;){if(u>(f-=p+r))return;p=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&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,u=n.iterationLimit||30,c=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":710}],699:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],700:[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,u=a(s),c=1;function f(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return u;var e=a(t);return e.length?e:u}function p(t){return n(t)?t:c}e.exports={formatColor:function(t,e,r){var n,i,s,d,v,g=t.color,m=l(g),y=l(e),x=o.extractOpts(t),b=[];if(n=void 0!==x.colorscale?o.makeColorScaleFuncFromTrace(t):h,i=m?function(t,e){return void 0===t[e]?u:a(n(t[e]))}:h,s=y?function(t,e){return void 0===t[e]?c:p(t[e])}:p,m||y)for(var _=0;_o?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&i(t)&&t>=0&&t%1==0},l.noop=t("./noop"),l.identity=t("./identity"),l.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))},l.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},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o=Math.pow(2,r)?i>10?(l.warn("randstr failed uniqueness"),c):t(e,r,n,(i||0)+1):c},l.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},l.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,u=new Array(l),c=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]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){var n,i;function a(){return l.syncOrAsync(t,e,r)}for(;t.length;)if(i=t.splice(0,1)[0],(n=i(e))&&n.then)return n.then(a).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n1?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},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)(:[^}]*)?}/g;var M=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,function(t,n){return M.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};var E=/^:/,S=0;l.hovertemplateString=function(t,e,r){var i=arguments,a={};return t.replace(l.TEMPLATE_STRING_REGEX,function(t,o,s){var u,c,f,h;for(f=3;f=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var C=2e9;l.seedPseudoRandom=function(){C=2e9},l.pseudoRandom=function(){var t=C;return C=(69069*C+1)%4294967296,Math.abs(C-t)<429496729?l.pseudoRandom():C/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(i))return n(i);var a=l.extractOption(t,e,"tx","text");return l.isValidTextValue(a)?n(a):void 0},l.isValidTextValue=function(t){return t||0===t},l.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;n2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;ee/2?t-Math.round(t/e)*e:t}}},{}],711:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,l=0,u=e.split(".");l/g),o=0;oa||u===i||us||e&&l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||la||u===i||us)return!1;var c,f,h,p,d,v=r.length,g=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,g)||u>Math.max(h,m)))if(uc||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 u=l+1;u1){var s=t.pop();o(s)}return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":680,"./matrix":709}],716:[function(t,r,n){(function(e){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");r.exports=function(t,r){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||e.devicePixelRatio,extensions:r||[]})}catch(t){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,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":724,regl:489}],717:[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(t.framework&&t.framework.isPolar)t.framework.undo();else 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,c,f=0,h=e.length,p=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(c=d>=0?r?o:s:r?u:l,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=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;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":686,"fast-isnumeric":224}],726:[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":113}],727:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,M){var E=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&E.match(l),L=n.select(t.node().parentNode);if(!L.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",L.selectAll("svg."+O).remove(),L.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":E,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={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(c,"\\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)})}(C[2],a,function(n,i,a){L.selectAll("svg."+O).remove(),L.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return I(),void e();var l=L.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":E,"data-math":"Y"});l.node().appendChild(o.node()),i&&i.node()&&o.node().insertBefore(i.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var f=s(c,"width"),h=s(c,"height"),p=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=r||s(t,"height"),v=-d/4;"y"===O[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,v-h/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===O[0]?o.attr({x:t.attr("x"),y:v-h/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:v}):o.attr({x:p,y:+t.attr("y")+v-h/2}),M&&M.call(t,l),e(l)})})):I(),t}function I(){L.empty()||(O=t.attr("class")+"-math",L.select("svg."+O).remove()),t.text("").style("white-space","pre");var e=function(t,e){e=e.replace(g," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var s=1;s 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)?c():(r=t,l=[{node:t}]);for(var L=e.split(m),O=0;O|>|>)/g,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"},p={sub:"-0.21em",sup:"0.42em"},d="​",v=["http:","https:","mailto:","",void 0,":"],g=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i,b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function A(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var T=/(^|;)\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(m),o=[],s="",l=0,u=0;ui?o.push(c.substr(0,d-i)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var M={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},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)){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,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}r.convertEntities=S,r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",e),o=i("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})})},r.makeEditable=function(t,e){var r=e.gd,i=e.delegate,a=n.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){var i,s,u,c,f;i=n.select(r).select(".svg-container"),s=i.append("div"),u=t.node().style,c=parseFloat(u.fontSize||12),void 0===(f=e.text)&&(f=t.attr("data-unformatted")),s.classed("plugin-editable editable",!0).style({position:"absolute","font-family":u.fontFamily||"Arial","font-size":c,color:e.fill||u.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(f).call(C(t,i,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,i=n.select(this).attr("class");(e=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),a.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===s.node()&&s.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),n.select(this).call(C(t,i,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(l),t.style({opacity:0});var h,p=o.attr("class");(h=p?"."+p.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(h).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,a,"on")}},{"../constants/alignment":675,"../constants/xmlns_namespaces":681,"../lib":703,d3:157}],728:[function(t,e,r){"use strict";var n={};function i(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var a=n[t],o=Date.now();if(!a){for(var s in n)n[s].tsa.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)}},{}],729:[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":224}],730:[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":779,"topojson-client":527}],731:[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"}}},{}],732:[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"}}},{}],733:[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,v=Object.keys(t);for(e=0;e3?(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")),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=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(u(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!v&&(h(g,m),p(t),!0)}var x,b,_,w,k,A,T,M,E=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],L=c(m,f).get(),O=[],I=-1,P=C.length;for(x=0;xC.length-(T?0:1))a.warn("index out of range",f,_);else if(void 0!==A)k.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(A)?O.push(_):T?("add"===A&&(A={}),C.splice(_,0,A),L&&L.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,A),-1===I&&(I=_);else for(b=0;b=0;x--)C.splice(O[x],1),L&&L.splice(O[x],1);if(C.length?S||e.set(C):e.set(null),v)return!1;if(h(g,m),d!==i){var D;if(-1===I)D=E;else{for(P=Math.max(C.length,P),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 z(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]),D(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&D(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,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 D(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,u,c,f,h=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=P(r,t.data.length-1),e)for(var v=0;v-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 q(t,e,r){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(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=$(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(A.layoutReplot):Object.keys(n).length&&(G(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(A.doLegend),a.layoutstyle&&s.push(A.layoutStyles),a.axrange&&W(s,i.rangesAltered),a.ticks&&s.push(A.doTicksRelayout),a.modebar&&s.push(A.doModeBar),a.camera&&s.push(A.doCamera),a.colorbars&&s.push(A.doColorBars),s.push(C)),s.push(h.rehover,h.redrag),u.add(t,q,[t,i.undoit],q,[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 G(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=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function W(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=d.getFromId(t,i);if(r.push(i),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(b,A.doAutoRangeAndConstraints,r,A.drawData,A.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function $(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=j(l._preGUI,u),p=Object.keys(e),v=d.list(t),g=o.extendDeepAll({},e),m={};for(H(e),p=Object.keys(e),n=0;n0&&"string"!=typeof P.parts[R];)R--;var F=P.parts[R],B=P.parts[R-1]+"."+F,V=P.parts.slice(0,R).join("."),U=s(t.layout,V).get(),q=s(l,V).get(),G=P.get();if(void 0!==D){A[I]=D,E[I]="reverse"===F?D:N(G);var W=f.getLayoutValObject(l,P.parts);if(W&&W.impliedEdits&&null!==D)for(var $ in W.impliedEdits)S(o.relativeAttr(I,$),W.impliedEdits[$]);if(-1!==["width","height"].indexOf(I))if(D){S("autosize",null);var K="height"===I?"width":"height";S(K,l[K])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)S("width",D?null:l.width),S("height",D?null:l.height);else if(B.match(Y))O(B),s(l,V+"._inputRange").set(null);else if(B.match(X)){O(B),s(l,V+"._inputRange").set(null);var Q=s(l,V).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else B.match(Z)&&s(l,V+"._inputDomain").set(null);if("type"===F){var tt=U,et="linear"===q.type&&"log"===D,rt="log"===q.type&&"linear"===D;if(et||rt){if(tt&&tt.range)if(q.autorange)et&&(tt.range=tt.range[1]>tt.range[0]?[1,2]:[2,1]);else{var nt=tt.range[0],it=tt.range[1];et?(nt<=0&&it<=0&&S(V+".autorange",!0),nt<=0?nt=it/1e6:it<=0&&(it=nt/1e6),S(V+".range[0]",Math.log(nt)/Math.LN10),S(V+".range[1]",Math.log(it)/Math.LN10)):(S(V+".range[0]",Math.pow(10,nt)),S(V+".range[1]",Math.pow(10,it)))}else S(V+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete l[P.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,D,S),c.getComponentMethod("images","convertCoords")(t,q,D,S)}else S(V+".autorange",!0),S(V+".range",null);s(l,V+"._inputRange").set(null)}else if(F.match(M)){var at=s(l,I).get(),ot=(D||{}).type;ot&&"-"!==ot||(ot="linear"),c.getComponentMethod("annotations","convertCoords")(t,at,ot,S),c.getComponentMethod("images","convertCoords")(t,at,ot,S)}var st=w.containerArrayMatch(I);if(st){r=st.array,n=st.index;var lt=st.property,ut=W||{editType:"calc"};""!==n&&""===lt&&(w.isAddVal(D)?E[I]=null:w.isRemoveVal(D)?E[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(_,ut),m[r]||(m[r]={});var ct=m[r][n];ct||(ct=m[r][n]={}),ct[lt]=D,delete e[I]}else"reverse"===F?(U.range?U.range.reverse():(S(V+".autorange",!0),U.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===D||"select"===D)&&"lasso"!==G&&"select"!==G?_.plot=!0:l._has("gl2d")?_.plot=!0:W?T.update(_,W):_.calc=!0,P.set(D))}}for(r in m){var ft=w.applyContainerArrayChanges(t,h(a,r),m[r],_,h);ft||(_.plot=!0)}var ht=l._axisConstraintGroups||[];for(C in L)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function it(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 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(a,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,k.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,v,g=0;function m(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),_=!x&&!b&&o.isPlainObject(e);if(_)y.push({type:"object",data:m(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&TT)&&M.push(v);y=M}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var v=e[n].name,g=(c[v]||d[v]||{}).name,m=e[n].name,y=c[g]||d[g];g&&m&&"number"==typeof m&&y&&Ee.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(;c[i.name="frame "+t._transitionData._counter++];);if(c[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,c=h.modifyFrames,f=[t,s],p=[t,a];return u&&u.add(t,l,f,c,p),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],c=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(!k(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function k(t){return t===Math.round(t)&&t>=0}function A(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):v(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(t){var n=t[b];n&&(delete t[b],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}})}(t),function(t){!function t(e){for(var r in e)if(v(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n=l.length)return!1;r=(n.transformsRegistry[l[u].type]||{}).attributes,i=r&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var f=t._module;if(f||(f=(n.modules[t.type||a.type.dflt]||{})._module),!f)return!1;if(r=f.attributes,!(i=r&&r[o])){var h=f.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return w(i,e,s)},r.getLayoutValObject=function(t,e){var r=function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r=i&&(r._input||{})._templateitemname;s&&(o=i);var l,u=e+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][a]=s)}function f(t,e){s?n.nestedProperty(l[u],t).set(e):l[u+"."+t]=e}function h(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:f,getUpdateObj:h,applyUpdate:function(e,r){e&&f(e,r);var i=h();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":703,"../plots/attributes":748}],742:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=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"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),v=d.enforce,g=d.clean,m=t("../plots/cartesian/autorange").doAutoRange,y="start",x="middle",b="end";function _(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}function w(t){var e,i,a,s,c,d,v=t._fullLayout,g=v._size,m=g.p,y=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 t._promises.length&&Promise.all(t._promises);function x(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-m-n:e._offset+e._length+m+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+m+n:e._offset-m-n:g.l+g.w*(t.position||0)+n%1}for(e=0;ek?c.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=p(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&d(a)&&t(a,o)}}({data:g,layout:h},""),c.length)return c.map(v)}},{"../lib":703,"../plots/attributes":748,"../plots/plots":812,"./plot_config":739,"./plot_schema":740,"./plot_template":741}],744:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../lib"),o=t("../snapshot/helpers"),s=t("../snapshot/tosvg"),l=t("../snapshot/svgtoimg"),u={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],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}},c=/^data:image\/\w+;base64,/;e.exports=function(t,e){var r,f,h,p;function d(t){return!(t in e)||a.validate(e[t],u[t])}if(e=e||{},a.isPlainObject(t)?(r=t.data||[],f=t.layout||{},h=t.config||{},p={}):(t=a.getGraphDiv(t),r=a.extendDeep([],t.data),f=a.extendDeep({},t.layout),h=t._context,p=t._fullLayout||{}),!d("width")&&null!==e.width||!d("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!d("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function g(t,r){return a.coerce(e,v,u,t,r)}var m=g("format"),y=g("width"),x=g("height"),b=g("scale"),_=g("setBackground"),w=g("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=a.extendFlat({},f);y?A.width=y: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 T=a.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:_}),M=o.getRedrawFunc(k);function E(){return new Promise(function(t){setTimeout(t,o.getDelay(k._fullLayout))})}function S(){return new Promise(function(t,e){var r=s(k,m,b),n=k._fullLayout.width,o=k._fullLayout.height;if(i.purge(k),document.body.removeChild(k),"svg"===m)return t(w?r:"data:image/svg+xml,"+encodeURIComponent(r));var u=document.createElement("canvas");u.id=a.randstr(),l({format:m,width:n,height:o,scale:b,canvas:u,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){i.plot(k,r,A,T).then(M).then(E).then(S).then(function(e){t(function(t){return w?t.replace(c,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":703,"../snapshot/helpers":835,"../snapshot/svgtoimg":837,"../snapshot/tosvg":839,"./plot_api":738,"fast-isnumeric":224}],745:[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,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hx.length&&i.push(p("unused",a,m.concat(x.length)));var A,T,M,E,S,C=x.length,L=Array.isArray(k);if(L&&(C=Math.min(C,k.length)),2===b.dimensions)for(T=0;Tx[T].length&&i.push(p("unused",a,m.concat(T,x[T].length)));var O=x[T].length;for(A=0;A<(L?Math.min(O,k[T].length):O);A++)M=L?k[T][A]:k,E=y[T][A],S=x[T][A],n.validate(E,M)?S!==E&&S!==+E&&i.push(p("dynamic",a,m.concat(T,A),E,S)):i.push(p("value",a,m.concat(T,A),E))}else i.push(p("array",a,m.concat(T),y[T]));else for(T=0;T1&&h.push(p("object","layout"))),i.supplyDefaults(d);for(var v=d._fullData,g=r.length,m=0;m0&&((b=T-o(g)-o(m))>M?_/b>E&&(y=g,x=m,E=_/b):_/T>E&&(y={val:g.val,pad:0},x={val:m.val,pad:0},E=_/T));if(h===p){var S=h-1,C=h+1;if(k)if(0===h)a=[0,1];else{var L=(h>0?f:c).reduce(function(t,e){return Math.max(t,o(e))},0),O=h/(1-Math.min(.5,L/T));a=h>0?[0,O]:[O,0]}else a=A?[Math.max(0,S),Math.max(1,C)]:[S,C]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):A&&(y.val-E*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),E=(x.val-y.val)/(T-o(y)-o(x)),a=[y.val-E*o(y),x.val+E*o(x)];return d&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,i,a=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function p(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var a=e._anchorAxis;if(a&&a.rangeslider){var l=a.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),a._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={}),t._m||t.setScale();var i,o,s,l,u,h,d,v,g,m=[],y=[],x=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,k=!1;function A(t){if(Array.isArray(t))return k=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var T=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),M=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),S=A(r.vpadminus||r.vpad);if(!k){if(v=1/0,g=-1/0,w)for(i=0;i0&&(v=o),o>g&&o-a&&(v=o),o>g&&o=O;i--)L(i);return{min:m,max:y,opts:r}},concatExtremes:u}},{"../../constants/numerical":680,"../../lib":703,"../../registry":831,"fast-isnumeric":224}],751:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),f=t("../../components/drawing"),h=t("./layout_attributes"),p=t("./clean_ticks"),d=t("../../constants/numerical"),v=d.ONEAVGYEAR,g=d.ONEAVGMONTH,m=d.ONEDAY,y=d.ONEHOUR,x=d.ONEMIN,b=d.ONESEC,_=d.MINUS_SIGN,w=d.BADNUM,k=t("../../constants/alignment").MID_SHIFT,A=t("../../constants/alignment").LINE_SPACING,T=e.exports={};T.setConvert=t("./set_convert");var M=t("./axis_autotype"),E=t("./axis_ids");T.id2name=E.id2name,T.name2id=E.name2id,T.cleanId=E.cleanId,T.list=E.list,T.listIds=E.listIds,T.getFromId=E.getFromId,T.getFromTrace=E.getFromTrace;var S=t("./autorange");T.getAutoRange=S.getAutoRange,T.findExtremes=S.findExtremes,T.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||a),a||(a=i),c[u]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,c,u)},T.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var u=T.getFromId(e,n);a=u.fraction2r(a),l=r(i,a),o=u.cleanPos}t[i]=o(l)},T.cleanPosition=function(t,e,r){var n="paper"===r||"pixel"===r?s.ensureNumber:T.getFromId(e,r).cleanPos;return n(t)},T.redrawComponents=function(t,e){e=e||T.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},T.saveRangeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=T.tickIncrement(t,"M6","reverse")+1.5*m:a.exactMonths>.8?t=T.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var l=T.tickIncrement(t,r);if(l<=n)return l}return t}(b,t,x,u,a)),g=b,y=0;g<=c;)g=T.tickIncrement(g,x,!1,a),y++;return{start:e.c2r(b,0,a),end:e.c2r(g,0,a),size:x,_dataSpan:c-u}},T.prepTicks=function(t){var e=s.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type||"multicategory"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=s.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),T.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),j(t)},T.calcTicks=function(t){T.prepTicks(t);var e=s.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),i=s.simpleMap(t.range,t.r2l),a=1.0001*i[0]-1e-4*i[1],o=1.0001*i[1]-1e-4*i[0],l=Math.min(a,o),u=Math.max(a,o),c=0;Array.isArray(r)||(r=[]);var f="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var h=0;hl&&p=n:u<=n)&&!(a.length>l||u===o);u=T.tickIncrement(u,t.dtick,i,t.calendar))o=u,a.push(u);rt(t)&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var c=new Array(a.length),f=0;f10||"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>=x&&a<=16||e>=y)t._tickround="M";else if(e>=b&&a<=19||e>=x)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])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(H(t.exponentformat)&&!q(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function V(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}}T.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);var a=2*e;a>v?(e/=v,r=n(10),t.dtick="M"+12*N(e,r,I)):a>g?(e/=g,t.dtick="M"+N(e,1,P)):a>m?(t.dtick=N(e,m,z),t.tick0=s.dateTick0(t.calendar,!0)):a>y?t.dtick=N(e,y,P):a>x?t.dtick=N(e,x,D):a>b?t.dtick=N(e,b,D):(r=n(10),t.dtick=N(e,r,I))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+N(e,r,I)}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))):rt(t)?(t.tick0=0,r=1,t.dtick=N(e,r,B)):(t.tick0=0,r=n(10),t.dtick=N(e,r,I));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},T.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?F:R,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)},T.tickFirst=function(t){var e=t.r2l||Number,r=s.simpleMap(t.range,e),a=r[1]"+l,t._prevDateHead=l)),e.text=u}(t,a,r,l):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);if("never"===a&&(a=""),n&&"L"!==c&&(o="L3",c="L"),u||"L"===c)e.text=G(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),p=t.exponentformat;"power"===p||H(p)&&q(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+h+"",e.fontSize*=1.25):("e"===p||"E"===p)&&h>2?e.text="1"+p+(f>0?"+":_)+h:(e.text=G(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,a,0,l,d):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,a):"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,a,r):rt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=G(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=G(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="π":e.text=o[0]+"π":e.text=["",o[0],"","⁄","",o[1],"","π"].join(""),l&&(e.text=_+e.text)}}}}(t,a,r,l,d):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=G(e.x,t,i,n)}(t,a,0,l,d),t.tickprefix&&!p(t.showtickprefix)&&(a.text=t.tickprefix+a.text),t.ticksuffix&&!p(t.showticksuffix)&&(a.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};a.xbnd=[v(a.x-.5),v(a.x+t.dtick-.5)]}return a},T.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return T.hoverLabelText(t,e)+" - "+T.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=T.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+i:i};var U=["f","p","n","μ","m","","k","M","G","T"];function H(t){return"SI"===t||"B"===t}function q(t){return t>14||t<-15}function G(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=T.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};j(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,_);var p,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+p+"":"B"===l&&9===u?t+="B":H(l)&&(t+=U[u/3+5])),a?_+t:t}function W(t,e){var r=t._id.charAt(0),n=t._tickAngles[e]||0,i=s.deg2rad(n),a=Math.sin(i),o=Math.cos(i),l=0,u=0;return t._selections[e].each(function(){var t=$(this),e=f.bBox(t.node()),r=e.width,n=e.height;l=Math.max(l,o*r,a*n),u=Math.max(u,a*r,o*n)}),{x:u,y:l}[r]}function Y(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function X(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=E.getFromId(t,e.anchor):"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0}function Z(t,e){var r=t.l2p(e);return r>1&&r=0,a=c(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[i]+=l),e.title.text!==h._dfltTitle[d]&&(r[i]+=e.title.font.size),"x"===d&&u.width>0){var f=u.right-(e._offset+e._length);f>0&&(r.x=1,r.r=f);var p=e._offset-u.left;p>0&&(r.x=0,r.l=p)}else if("y"===d&&u.height>0){var g=u.bottom-(e._offset+e._length);g>0&&(r.y=0,r.b=g);var m=e._offset-u.top;m>0&&(r.y=1,r.t=m)}}a.autoMargin(t,J(e),r)}),r.skipTitle||et&&e._boundingBox&&"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;r="multicategory"===e.type?e._labelLength:10+1.5*o+(e.linewidth?e.linewidth-1:0);var s,l,c,h,p=X(t,e);if("x"===a?(l=e._offset+e._length/2,c="top"===e.side?-r-o*(e.showticklabels?1:0):r+o*(e.showticklabels?1.5:.5),c+=p):(c=e._offset+e._length/2,l="right"===e.side?r+o*(e.showticklabels?1:.5):-r-o*(e.showticklabels?.5:0),l+=p,s={rotate:"-90",offset:0}),"multicategory"!==e.type){var d=e._selections[e._id+"tick"];if(h={selection:d,side:e.side},d&&d.node()&&d.node().parentNode){var v=f.getTranslate(d.node().parentNode);h.offsetLeft=v.x,h.offsetTop=v.y}}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)}),s.syncOrAsync(Z)}function rt(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}},T.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})),i},T.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},T.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},T.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),a="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(a&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(a||t.showline)&&(o+=.2*t.tickfont.size);var c,f,h,p,d={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(p="bottom"===t.side?1:-1,c=l*p,f=e+o*p,h="bottom"===t.side?1:-.2,d.xFn=function(t){return t.dx+c},d.yFn=function(t){return t.dy+f+t.fontSize*h},d.anchorFn=function(t,e){return i(e)&&0!==e&&180!==e?e*p<0?"end":"start":"middle"},d.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(p="right"===t.side?1:-1,c=o,f=-l*p,h=90===Math.abs(t.tickangle)?.5:0,d.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*p},d.yFn=function(t){return t.dy+f+t.fontSize*k},d.anchorFn=function(e,r){return i(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},d.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),d},T.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],Y);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},T.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&&T.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;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;nl*x)||k)for(r=0;rP&&RO&&(O=R);var U=(O-L)/(2*I);p/=U,L=u.l2r(L),O=u.l2r(O),u.range=u._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function D(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","translate("+r+", "+n+")").attr("d",i+"Z")}function z(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function R(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"),F(t,e,i,a)}function F(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 B(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function N(t){E&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),E=!1)}function j(t){return"lasso"===t||"select"===t}function V(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,M)/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 U(t,e,r,n){for(var i,a,o,l,u=!1,c={},f={},h=0;h-1&&w(i,t,X,Z,e.id,Et),a.indexOf("event")>-1&&f.click(t,i,e.id);else if(1===r&&pt){var s=E?G:F,u="s"===E||"w"===S?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(s,u),p="left",d="middle";if(s.fixedrange)return;E?(d="n"===E?"top":"bottom","right"===s.side&&(p="right")):"e"===S&&(p="right"),t._context.showAxisRangeEntryBoxes&&n.select(gt).call(l.makeEditable,{gd:t,immediate:!0,background:t._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:d}).on("edit",function(e){var r=s.d2r(e);void 0!==r&&o.call("_guiRelayout",t,c,r)})}}function Lt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,e+mt)),i=Math.max(0,Math.min(Q,r+yt)),a=Math.abs(n-mt),o=Math.abs(i-yt);function s(){kt="",xt.r=xt.l,xt.t=xt.b,Tt.attr("d","M0,0Z")}if(xt.l=Math.min(mt,n),xt.r=Math.max(mt,n),xt.t=Math.min(yt,i),xt.b=Math.max(yt,i),tt.isSubplotConstrained)a>M||o>M?(kt="xy",a/K>o/Q?(o=a*Q/K,yt>i?xt.t=yt-o:xt.b=yt+o):(a=o*K/Q,mt>n?xt.l=mt-a:xt.r=mt+a),Tt.attr("d",V(xt))):s();else if(et.isSubplotConstrained)if(a>M||o>M){kt="xy";var l=Math.min(xt.l/K,(Q-xt.b)/Q),u=Math.max(xt.r/K,(Q-xt.t)/Q);xt.l=l*K,xt.r=u*K,xt.b=(1-l)*Q,xt.t=(1-u)*Q,Tt.attr("d",V(xt))}else s();else!nt||og[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":703,"fast-isnumeric":224}],767:[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)]}},{"../../constants/alignment":675}],768:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/color"),o=t("../../components/fx"),s=t("../../lib"),l=t("../../lib/polygon"),u=t("../../lib/throttle"),c=t("../../components/fx/helpers").makeEventData,f=t("./axis_ids").getFromId,h=t("../../lib/clear_gl_canvases"),p=t("../../plot_api/subroutines").redrawReglTraces,d=t("./constants"),v=d.MINSELECT,g=l.filter,m=l.tester;function y(t){return t._id}function x(t,e,r,n,i,a,o){var s,l,u,c,f,h,p,d,v,g,m=e._hoverdata,y=e._fullLayout.clickmode,x=y.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(m)){k(t,e,a),s=T(e,r,n,i);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0;if(L?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)&&(p=E(_))){for(o&&o.remove(),g=0;g0?"M"+i.join("M")+"Z":"M0,0Z",e.attr("d",n)}function E(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,i=n.length>0,a=i?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function S(t,e,r){var n,a,o,s;for(n=0;n-1&&x(e,E,i.xaxes,i.yaxes,i.subplot,i,G),"event"===r&&E.emit("plotly_selected",void 0);o.click(E,e)}).catch(s.error)},i.doneFn=function(){Y.remove(),u.done(X).then(function(){u.clear(X),i.gd.emit("plotly_selected",_),p&&i.selectionDefs&&(p.subtract=q,i.selectionDefs.push(p),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,h)),i.doneFnCompleted&&i.doneFnCompleted(Z)}).catch(s.error)}},clearSelect:L,selectOnClick:x}},{"../../components/color":580,"../../components/fx":619,"../../components/fx/helpers":615,"../../lib":703,"../../lib/clear_gl_canvases":688,"../../lib/polygon":715,"../../lib/throttle":728,"../../plot_api/subroutines":742,"../../registry":831,"./axis_ids":754,"./constants":757,polybooljs:468}],769:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=a.cleanNumber,s=a.ms2DateTime,l=a.dateTime2ms,u=a.ensureNumber,c=a.isArrayOrTypedArray,f=t("../../constants/numerical"),h=f.FP_SAFE,p=f.BADNUM,d=f.LOG_CLIP,v=t("./constants"),g=t("./axis_ids");function m(t){return Math.pow(10,t)}function y(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function x(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*d*Math.abs(n-i))}return p}function b(e,r,n){var o=l(e,n||t.calendar);if(o===p){if(!i(e))return p;e=+e;var s=Math.floor(10*a.mod(e+.05,1)),u=Math.round(e-s/10);o=l(new Date(u))+s/10}return o}function _(e,r,n){return s(e,r,n||t.calendar)}function w(e){return t._categories[Math.round(e)]}function k(e){if(y(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 p}function A(e){if(t._categoriesMap)return t._categoriesMap[e]}function T(t){var e=A(t);return void 0!==e?e:i(t)?+t:void 0}function M(e){return i(e)?n.round(t._b+t._m*e,2):p}function E(e){return(e-t._b)/t._m}t.c2l="log"===t.type?x:u,t.l2c="log"===t.type?m:u,t.l2p=M,t.p2l=E,t.c2p="log"===t.type?function(t,e){return M(x(t,e))}:M,t.p2c="log"===t.type?function(t){return m(E(t))}:E,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=E,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return x(o(t),e)},t.r2d=t.r2c=function(t){return m(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=x,t.l2d=m,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return m(E(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=E,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=b,t.c2d=t.c2r=t.l2d=t.l2r=_,t.d2p=t.r2p=function(e,r,n){return t.l2p(b(e,0,n))},t.p2d=t.p2r=function(t,e,r){return _(E(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,p,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=k,t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(E(t))},t.r2p=t.d2p,t.p2r=E,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=A,t.l2r=t.c2r=u,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(E(t))},t.r2p=t.d2p,t.p2r=E,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(i=0;ih&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else a.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=g.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===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/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,o,s,l=t.type,u="date"===l&&e[r+"calendar"];if(r in e){if(n=e[r],s=e._length||a.minRowLength(n),a.isTypedArray(n)&&("linear"===l||"log"===l)){if(s===n.length)return n;if(n.subarray)return n.subarray(0,s)}if("multicategory"===l)return function(t,e){for(var r=new Array(e),n=0;nr.duration?(function(){for(var r={},n=0;n rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,i=n.xaxis,s=n.yaxis,l=e.xr0,u=e.xr1,c=i._length,f=e.yr0,h=e.yr1,p=s._length,d=!!u,v=!!h,g=[];if(d){var m=l[1]-l[0],y=u[1]-u[0];g[0]=(l[0]*(1-r)+r*u[0]-l[0])/(l[1]-l[0])*c,g[2]=c*(1-r+r*y/m),i.range[0]=l[0]*(1-r)+r*u[0],i.range[1]=l[1]*(1-r)+r*u[1]}else g[0]=0,g[2]=c;if(v){var x=f[1]-f[0],b=h[1]-h[0];g[1]=(f[1]*(1-r)+r*h[1]-f[1])/(f[0]-f[1])*p,g[3]=p*(1-r+r*b/x),s.range[0]=f[0]*(1-r)+r*h[0],s.range[1]=f[1]*(1-r)+r*h[1]}else g[1]=0,g[3]=p;o.drawOne(t,i,{skipTitle:!0}),o.drawOne(t,s,{skipTitle:!0}),o.redrawComponents(t,[i._id,s._id]);var _=d?c/g[2]:1,w=v?p/g[3]:1,k=d?g[0]:0,A=v?g[1]:0,T=d?g[0]/g[2]*c:0,M=v?g[1]/g[3]*p:0,E=i._offset-T,S=s._offset-M;n.clipRect.call(a.setTranslate,k,A).call(a.setScale,1/_,1/w),n.plot.call(a.setTranslate,E,S).call(a.setScale,_,w),a.setPointGroupScale(n.zoomScalePts,1/_,1/w),a.setTextPointsScale(n.zoomScaleTxt,1/_,1/w)}o.redrawComponents(t)}},{"../../components/drawing":601,"../../registry":831,"./axes":751,d3:157}],774:[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){var l=r("type",(s.splomStash||{}).type);"-"===l&&(function(t,e){if("-"===t.type){var r=t._id,s=r.charAt(0);-1!==r.indexOf("scene")&&(r=s);var l=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,r,s);if(l)if("histogram"!==l.type||s!=={v:"y",h:"x"}[l.orientation||"v"]){var u,c=s+"calendar",f=l[c],h={noMultiCategory:!n(l,"cartesian")||n(l,"noMultiCategory")};if(o(l,s)){var p=a(l),d=[];for(u=0;u0?".":"")+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 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){a(t,u,s.cache),s.check=function(){if(l){var e=a(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;fi*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,u])},r.precision(v.precision),i&&r.clipAngle(i-v.clipPad),r}(e);c.center([u.lon-l.lon,u.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var f=[[r.l+r.w*o.x[0],r.t+r.h*(1-o.y[1])],[r.l+r.w*o.x[1],r.t+r.h*(1-o.y[0])]],h=e.lonaxis,p=e.lataxis,d=function(t,e){var r=v.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&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]]]}}(h.range,p.range);c.fitExtent(f,d);var g=this.bounds=c.getBounds(d),m=this.fitScale=c.scale(),y=c.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},k=0;k-1&&p(n.event,a,[r.xaxis],[r.yaxis],r.id,v),u.indexOf("event")>-1&&l.click(a,n.event))})}function g(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},x.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(s.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"},c.setConvert(t.mockAxis,r)},x.saveViewInitial=function(t){var e=t.center||{},r=t.projection,n=r.rotation||{};t._isScoped?this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale}:t._isClipped?this.viewInitial={"projection.scale":r.scale,"projection.rotation.lon":n.lon,"projection.rotation.lat":n.lat}:this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale,"projection.rotation.lon":n.lon}},x.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?"translate("+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":580,"../../components/dragelement":598,"../../components/drawing":601,"../../components/fx":619,"../../lib":703,"../../lib/topojson_utils":730,"../../registry":831,"../cartesian/axes":751,"../cartesian/select":768,"../plots":812,"./constants":779,"./projections":784,"./zoom":785,d3:157,"topojson-client":527}],781:[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[o]={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){var e=t._fullLayout,r=t.calcdata,i=e._subplots[o];void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var s=0;s0&&w<0&&(w+=360);var k,A,T,M=(_+w)/2;if(!u){var E=c?s.projRotate:[M,0,0];k=r("projection.rotation.lon",E[0]),r("projection.rotation.lat",E[1]),r("projection.rotation.roll",E[2]),r("showcoastlines",!c)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}if(u?(A=-96.6,T=38.7):(A=c?M:k,T=(b[0]+b[1])/2),r("center.lon",A),r("center.lat",T),f){var S=s.projParallels||[0,60];r("projection.parallels",S)}r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",c&&"usa"!==a)&&(r("countrycolor"),r("countrywidth")),("usa"===a||"north america"===a&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),c||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:a,handleDefaults:s,partition:"y"})}},{"../subplot_defaults":826,"./constants":779,"./layout_attributes":782}],784:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!u.hasOwnProperty(e.type))return null;var i=u[e.type];return t.geo.stream(e,n(i)),i.result()}t.geo.project=function(t,e){var i=e.stream;if(!i)throw new Error("not yet supported");return(t&&n.hasOwnProperty(t.type)?n[t.type]:r)(t,i)};var n={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},i=[],a=[],o={point:function(t,e){i.push([t,e])},result:function(){var t=i.length?i.length<2?{type:"Point",coordinates:i[0]}:{type:"MultiPoint",coordinates:i}:null;return i=[],t}},s={lineStart:c,point:function(t,e){i.push([t,e])},lineEnd:function(){i.length&&(a.push(i),i=[])},result:function(){var t=a.length?a.length<2?{type:"LineString",coordinates:a[0]}:{type:"MultiLineString",coordinates:a}:null;return a=[],t}},l={polygonStart:c,lineStart:c,point:function(t,e){i.push([t,e])},lineEnd:function(){var t=i.length;if(t){do{i.push(i[0].slice())}while(++t<4);a.push(i),i=[]}},polygonEnd:c,result:function(){if(!a.length)return null;var t=[],e=[];return a.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^p>n&&r<(h-u)*(n-c)/(p-c)+u&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),a=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},u={Point:o,MultiPoint:o,LineString:s,MultiLineString:s,Polygon:l,MultiPolygon:l,Sphere:l};function c(){}var f=1e-6,h=f*f,p=Math.PI,d=p/2,v=(Math.sqrt(p),p/180),g=180/p;function m(t){return t>1?d:t<-1?-d:Math.asin(t)}function y(t){return t>1?0:t<-1?p:Math.acos(t)}var x=t.geo.projection,b=t.geo.projectionMutator;function _(t,e){var r=(2+d)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>f;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(p*(4+p))*t*(1+Math.cos(e)),2*Math.sqrt(p/(4+p))*Math.sin(e)]}t.geo.interrupt=function(e){var r,n=[[[[-p,0],[0,d],[p,0]]],[[[-p,0],[0,-d],[p,0]]]];function i(t,r){for(var i=r<0?-1:1,a=n[+(r<0)],o=0,s=a.length-1;oa[o][2][0];++o);var l=e(t-a[o][1][0],r);return l[0]+=e(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}e.invert&&(i.invert=function(t,a){for(var o=r[+(a<0)],s=n[+(a<0)],u=0,c=o.length;u=0;--i){var o=n[1][i],l=180*o[0][0]/p,u=180*o[0][1]/p,c=180*o[1][1]/p,f=180*o[2][0]/p,h=180*o[2][1]/p;r.push(s([[f-e,h-e],[f-e,c+e],[l+e,c+e],[l+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}(),l)},i},a.lobes=function(t){return arguments.length?(n=t.map(function(t){return t.map(function(t){return[[t[0][0]*p/180,t[0][1]*p/180],[t[1][0]*p/180,t[1][1]*p/180],[t[2][0]*p/180,t[2][1]*p/180]]})}),r=n.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),a):n.map(function(t){return t.map(function(t){return[[180*t[0][0]/p,180*t[0][1]/p],[180*t[1][0]/p,180*t[1][1]/p],[180*t[2][0]/p,180*t[2][1]/p]]})})},a},_.invert=function(t,e){var r=.5*e*Math.sqrt((4+p)/p),n=m(r),i=Math.cos(n);return[t/(2/Math.sqrt(p*(4+p))*(1+i)),m((n+r*(i+2))/(2+d))]},(t.geo.eckert4=function(){return x(_)}).raw=_;var w=t.geo.azimuthalEqualArea.raw;function k(t,e){if(arguments.length<2&&(e=t),1===e)return w;if(e===1/0)return A;function r(r,n){var i=w(r/e,n);return i[0]*=t,i}return r.invert=function(r,n){var i=w.invert(r/t,n);return i[0]*=e,i},r}function A(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function T(t,e){return[3*t/(2*p)*Math.sqrt(p*p/3-e*e),e]}function M(t,e){return[t,1.25*Math.log(Math.tan(p/4+.4*e))]}function E(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>f&&--i>0);return e/2}}A.invert=function(t,e){var r=2*m(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=b(k),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=k,T.invert=function(t,e){return[2/3*p*t/Math.sqrt(p*p/3-e*e),e]},(t.geo.kavrayskiy7=function(){return x(T)}).raw=T,M.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*p]},(t.geo.miller=function(){return x(M)}).raw=M,E(p);var S=function(t,e,r){var n=E(r);function i(r,i){return[t*r*Math.cos(i=n(i)),e*Math.sin(i)]}return i.invert=function(n,i){var a=m(i/e);return[n/(t*Math.cos(a)),m((2*a+Math.sin(2*a))/r)]},i}(Math.SQRT2/d,Math.SQRT2,p);function C(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(t.geo.mollweide=function(){return x(S)}).raw=S,C.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>f&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return x(C)}).raw=C;var L=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function O(t,e){var r,n=Math.min(18,36*Math.abs(e)/p),i=Math.floor(n),a=n-i,o=(r=L[i])[0],s=r[1],l=(r=L[++i])[0],u=r[1],c=(r=L[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?d:-d)*(u+a*(f-s)/2+a*a*(f-2*u+s)/2)]}function I(t,e){return[t*Math.cos(e),e]}function P(t,e){var r,n=Math.cos(e),i=(r=y(n*Math.cos(t/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(t)*i,Math.sin(e)*i]}function D(t,e){var r=P(t,e);return[(r[0]+t/d)/2,(r[1]+e)/2]}L.forEach(function(t){t[1]*=1.0144}),O.invert=function(t,e){var r=e/d,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=L[a][1],s=L[a+1][1],l=L[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,f=2*(Math.abs(r)-s)/u,p=c/u,m=f*(1-p*f*(1-2*p*f));if(m>=0||1===a){n=(e>=0?5:-5)*(m+i);var y,x=50;do{i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),m=i-a,o=L[a][1],s=L[a+1][1],l=L[Math.min(19,a+2)][1],n-=(y=(e>=0?d:-d)*(s+m*(l-o)/2+m*m*(l-2*s+o)/2)-e)*g}while(Math.abs(y)>h&&--x>0);break}}while(--a>=0);var b=L[a][0],_=L[a+1][0],w=L[Math.min(19,a+2)][0];return[t/(_+m*(w-b)/2+m*m*(w-2*_+b)/2),n*v]},(t.geo.robinson=function(){return x(O)}).raw=O,I.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return x(I)}).raw=I,P.invert=function(t,e){if(!(t*t+4*e*e>p*p+f)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),l=Math.cos(r/2),u=Math.sin(n),c=Math.cos(n),h=Math.sin(2*n),d=u*u,v=c*c,g=s*s,m=1-v*l*l,x=m?y(c*l)*Math.sqrt(a=1/m):a=0,b=2*x*c*s-t,_=x*u-e,w=a*(v*g+x*c*l*d),k=a*(.5*o*h-2*x*u*s),A=.25*a*(h*s-x*u*v*o),T=a*(d*l+x*g*c),M=k*A-T*w;if(!M)break;var E=(_*k-b*T)/M,S=(b*A-_*w)/M;r-=E,n-=S}while((Math.abs(E)>f||Math.abs(S)>f)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return x(P)}).raw=P,D.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),l=Math.sin(2*n),u=s*s,c=o*o,h=Math.sin(r),p=Math.cos(r/2),v=Math.sin(r/2),g=v*v,m=1-c*p*p,x=m?y(o*p)*Math.sqrt(a=1/m):a=0,b=.5*(2*x*o*v+r/d)-t,_=.5*(x*s+n)-e,w=.5*a*(c*g+x*o*p*u)+.5/d,k=a*(h*l/4-x*s*v),A=.125*a*(l*v-x*s*c*h),T=.5*a*(u*p+x*g*o)+.5,M=k*A-T*w,E=(_*k-b*T)/M,S=(b*A-_*w)/M;r-=E,n-=S}while((Math.abs(E)>f||Math.abs(S)>f)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return x(D)}).raw=D}},{}],785:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},u={cursor:"auto"};function c(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],u=o._fullLayout,c=u[n],f={},h={};function p(t,e){f[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,u._preGUI,f);var r=i.nestedProperty(c,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),o.emit("plotly_relayout",h)}function h(t,e){var r=c(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(u),f(t,e,i)}),r}function p(t,e){var r,i,a,o,s,h,p,d,v,g=c(0,e),m=2;function y(t){return e.invert(t)}function x(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=y(r)}).on("zoom",function(){if(h=n.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>m||Math.abs(n[1]-t[1])>m}(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?y(h)&&(d=y(h),p=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(p),o=p):s=y(r=h),v=!0,t.render();var l=e.rotate(),u=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":u[0],"geo.center.lat":u[1],"geo.projection.rotation.lon":-l[0]})}).on("zoomend",function(){n.select(this).style(u),v&&f(t,e,x)}),g}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=c(0,e),h=function(t){for(var e=0,r=arguments.length,i=[];++ed?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/d)*s-p,i=Math.sqrt(d*d-f*f));var v=180-a-2*p,m=(Math.atan2(h,c)-Math.atan2(u,i))*s,x=(Math.atan2(h,c)-Math.atan2(u,-i))*s,b=g(r[0],r[1],a,m),_=g(r[0],r[1],v,x);return b<=_?[a,m,r[2]]:[v,x,r[2]]}(k,r,S);isFinite(A[0])&&isFinite(A[1])&&isFinite(A[2])||(A=S),e.rotate(A),S=A}}else r=v(e,M=b);h.of(this,arguments)({type:"zoom"})}),T=h.of(this,arguments),p++||T({type:"zoomstart"})}).on("zoomend",function(){var r;n.select(this).style(u),d.call(a,"zoom",null),r=h.of(this,arguments),--p||r({type:"zoomend"}),f(t,e,m)}).on("zoom.redraw",function(){t.render();var r=e.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})}),n.rebind(a,h,"on")}function v(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*o,r=t[1]*o,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function g(t,e,r,n){var i=m(r-t),a=m(n-e);return Math.sqrt(i*i+a*a)}function m(t){return(t%360+540)%360-180}function y(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),u=Math.sin(n);return i[a]=t[a]*l-t[s]*u,i[s]=t[s]*l+t[a]*u,i}function x(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(a)*_*(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)/_*(a>=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?(a=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],a||s?(a&&(g(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(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]=i),Math.abs(u.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:c,attributes:l,handleDefaults:f,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":580,"../../../lib":703,"../../../registry":831,"../../get_data":786,"../../subplot_defaults":826,"./axis_defaults":794,"./layout_attributes":797}],797:[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":703,"../../../lib/extend":693,"../../domain":776,"./axis_attributes":793}],798:[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]}var o=a.prototype;o.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":726}],799:[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[a[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||i.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/h)}for(var p=n.calcTicks(c),d=0;d/g," "));l[u]=p,c.tickmode=f}}e.ticks=l;for(var u=0;u<3;++u){o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(var d=0;d<2;++d)e.bounds[d][u]=t.glplot.bounds[d][u]}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;a")):"isosurface"===e.type||"volume"===e.type?(w.valueLabel=f.tickText(t.mockAxis,t.mockAxis.d2l(p.traceCoordinate[3]),"hover").text,M.push("value: "+w.valueLabel),p.textLabel&&M.push(p.textLabel),x=M.join("
")):x=p.textLabel;var E={x:p.traceCoordinate[0],y:p.traceCoordinate[1],z:p.traceCoordinate[2],data:b._input,fullData:b,curveNumber:b.index,pointNumber:_};h.appendArrayPointValue(E,b,_),e._module.eventData&&(E=b._module.eventData(E,p,b,{},_));var S={points:[E]};t.fullSceneLayout.hovermode&&h.loneHover({trace:b,x:(.5+.5*m[0]/m[3])*a,y:(.5-.5*m[1]/m[3])*o,xLabel:w.xLabel,yLabel:w.yLabel,zLabel:w.zLabel,text:x,name:u.name,color:h.castHoverOption(b,_,"bgcolor")||u.color,borderColor:h.castHoverOption(b,_,"bordercolor"),fontFamily:h.castHoverOption(b,_,"font.family"),fontSize:h.castHoverOption(b,_,"font.size"),fontColor:h.castHoverOption(b,_,"font.color"),nameLength:h.castHoverOption(b,_,"namelength"),textAlign:h.castHoverOption(b,_,"align"),hovertemplate:c.castOption(b,_,"hovertemplate"),hovertemplateLabels:c.extendFlat({},E,w),eventData:[E]},{container:n,gd:r}),p.buttons&&p.distance<5?r.emit("plotly_click",S):r.emit("plotly_hover",S),s=S}else h.loneUnhover(n),r.emit("plotly_unhover",s);t.drawAnnotations(t)}.bind(null,t),t.traces={},t.make4thDimension(),!0}function b(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=g(e,e[this.id]),this.spikeOptions=m(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=this.pixelRatio||t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=u.getComponentMethod("annotations3d","convert"),this.drawAnnotations=u.getComponentMethod("annotations3d","draw"),x(this,this.pixelRatio)}var _=b.prototype;_.initializeGLCamera=function(){var t=this.fullSceneLayout.camera,e="orthographic"===t.projection.type;this.camera=a(this.container,{center:[t.center.x,t.center.y,t.center.z],eye:[t.eye.x,t.eye.y,t.eye.z],up:[t.up.x,t.up.y,t.up.z],_ortho:e,zoomMin:.01,zoomMax:100,mode:"orbit"})},_.recoverContext=function(){var t=this,e=this.glplot.gl,r=this.glplot.canvas,n=this.glplot.camera,i=this.glplot.pixelRatio;this.glplot.dispose(),requestAnimationFrame(function a(){e.isContextLost()?requestAnimationFrame(a):x(t,n,i,r)?t.plot.apply(t,t.plotArgs):c.error("Catastrophic and unrecoverable WebGL error. Context lost.")})};var w=["xaxis","yaxis","zaxis"];function k(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=w[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+"calendar"],f=e["_"+o+"length"];if(c.isArrayOrTypedArray(l))for(var h,p=0;p<(f||l.length);p++)if(c.isArrayOrTypedArray(l[p]))for(var d=0;dv[1][a])v[0][a]=-1,v[1][a]=1;else{var S=v[1][a]-v[0][a];v[0][a]-=S/32,v[1][a]+=S/32}if("reversed"===s.autorange){var C=v[0][a];v[0][a]=v[1][a],v[1][a]=C}}else{var L=s.range;v[0][a]=s.r2l(L[0]),v[1][a]=s.r2l(L[1])}v[0][a]===v[1][a]&&(v[0][a]-=1,v[1][a]+=1),g[a]=v[1][a]-v[0][a],this.glplot.bounds[0][a]=v[0][a]*h[a],this.glplot.bounds[1][a]=v[1][a]*h[a]}var O,I=[1,1,1];for(a=0;a<3;++a){s=u[w[a]],l=s.type;var P=m[l];I[a]=Math.pow(P.acc,1/P.count)/h[a]}if("auto"===u.aspectmode)O=Math.max.apply(null,I)/Math.min.apply(null,I)<=4?I:[1,1,1];else if("cube"===u.aspectmode)O=[1,1,1];else if("data"===u.aspectmode)O=I;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var D=u.aspectratio;O=[D.x,D.y,D.z]}u.aspectratio.x=c.aspectratio.x=O[0],u.aspectratio.y=c.aspectratio.y=O[1],u.aspectratio.z=c.aspectratio.z=O[2],this.glplot.aspect=O;var z=u.domain||null,R=e._size||null;if(z&&R){var F=this.container.style;F.position="absolute",F.left=R.l+z.x[0]*R.w+"px",F.top=R.t+(1-z.y[1])*R.h+"px",F.width=R.w*(z.x[1]-z.x[0])+"px",F.height=R.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},_.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},_.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),A(this.glplot.camera)},_.setCamera=function(t){var e;this.glplot.camera.lookAt.apply(this,[[(e=t).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]]);var r="orthographic"===t.projection.type,n=this.glplot.camera._ortho;if(r!==n){this.glplot.redraw();var i=this.glplot.pixelRatio,a=this.glplot.clearColor;this.glplot.gl.clearColor(a[0],a[1],a[2],a[3]),this.glplot.gl.clear(this.glplot.gl.DEPTH_BUFFER_BIT|this.glplot.gl.COLOR_BUFFER_BIT),this.glplot.dispose(),x(this,i),this.glplot.camera._ortho=r}},_.saveCamera=function(t){var e=this.fullLayout,r=this.getCamera(),n=c.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;function o(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]]}if(void 0===i)a=!0;else{for(var s=0;s<3;s++)for(var l=0;l<3;l++)if(!o(r,i,s,l)){a=!0;break}(!i.projection||r.projection&&r.projection.type!==i.projection.type)&&(a=!0)}if(a){var f={};f[this.id+".camera"]=i,u.call("_storeDirectGUIEdit",t,e._preGUI,f),n.set(r);var h=c.nestedProperty(e,this.id+".camera");h.set(r)}return a},_.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 f=this.id+".camera.up",h={x:0,y:0,z:1},p={};p[f]=h;var d=n.layout;u.call("_storeDirectGUIEdit",d,i._preGUI,p),a.up=h,c.nestedProperty(d,f).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},_.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);for(var o=0,s=i-1;o0)}function l(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})}return{layout:e,paint:r}}o.update=function(t){this.visible?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=s(t)},o.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},o.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},o.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,s(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};return"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles"),i[e]=n,i}(t);e.addSource(this.idSource,r)}},o.updateLayer=function(t){var e=this.map,r=l(t);this.removeLayer(),this.layerType=t.type,s(t)&&e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,minzoom:t.minzoom,maxzoom:t.maxzoom,layout:r.layout,paint:r.paint},t.below)},o.updateStyle=function(t){if(s(t)){var e=l(t);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint)}},o.removeLayer=function(){var t=this.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new a(t,e);return n.update(r),n}},{"../../lib":703,"./convert_text_opts":805}],808:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain").attributes,o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,u=t("../../plot_api/plot_template").templatedArray,c=o({});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var f=e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:u("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:c,textposition:n.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root");f.uirevision={valType:"any",editType:"none"}},{"../../components/color":580,"../../lib":703,"../../plot_api/edit_types":734,"../../plot_api/plot_template":741,"../../traces/scatter/attributes":1075,"../domain":776,"../font_attributes":777}],809:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../subplot_defaults"),a=t("../array_container_defaults"),o=t("./layout_attributes");function s(t,e,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),a(t,e,{name:"layers",handleItemDefaults:l}),e._input=t}function l(t,e){function r(r,i){return n.coerce(t,e,o.layers,r,i)}var i=r("visible");if(i){var a=r("sourcetype");r("source"),"vector"===a&&r("sourcelayer");var s=r("type");r("below"),r("color"),r("opacity"),r("minzoom"),r("maxzoom"),"circle"===s&&r("circle.radius"),"line"===s&&(r("line.width"),r("line.dash")),"fill"===s&&r("fill.outlinecolor"),"symbol"===s&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),n.coerceFont(r,"symbol.textfont"),r("symbol.textposition"),r("symbol.placement"))}}e.exports=function(t,e,r){i(t,e,r,{type:"mapbox",attributes:o,handleDefaults:s,partition:"y",accessToken:e._mapboxAccessToken})}},{"../../lib":703,"../array_container_defaults":747,"../subplot_defaults":826,"./layout_attributes":808}],810:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../components/fx"),a=t("../../lib"),o=t("../../registry"),s=t("../../components/dragelement"),l=t("../cartesian/select").prepSelect,u=t("../cartesian/select").selectOnClick,c=t("./constants"),f=t("./layout_attributes"),h=t("./layers");function p(t){this.id=t.id,this.gd=t.gd,this.container=t.container,this.isStatic=t.staticPlot;var e=t.fullLayout;this.uid=e._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(e),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[]}var d=p.prototype;function v(t){var e=f.style.values,r=f.style.dflt,n={};return a.isPlainObject(t)?(n.id=t.id,n.style=t):"string"==typeof t?(n.id=t,n.style=-1!==e.indexOf(t)?g(t):t):(n.id=r,n.style=g(r)),n.transition={duration:0,delay:0},n}function g(t){return c.styleUrlPrefix+t+"-"+c.styleUrlSuffix}function m(t){return[t.lon,t.lat]}e.exports=function(t){return new p(t)},d.plot=function(t,e,r){var n,i=this,a=e[i.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash=[],i.layerList={}),n=i.map?new Promise(function(r,n){i.updateMap(t,e,r,n)}):new Promise(function(r,n){i.createMap(t,e,r,n)}),r.push(n)},d.createMap=function(t,e,r,a){var s=this,l=s.gd,f=e[s.id],h=s.styleObj=v(f.style);s.accessToken=f.accesstoken;var p=s.map=new n.Map({container:s.div,style:h.style,center:m(f.center),zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,interactive:!s.isStatic,preserveDrawingBuffer:s.isStatic,doubleClickZoom:!1,boxZoom:!1}),d=c.controlContainerClassName,g=s.div.getElementsByClassName(d)[0];if(s.div.removeChild(g),p._canvas.style.left="0px",p._canvas.style.top="0px",s.rejectOnError(a),p.once("load",function(){s.updateData(t),s.updateLayout(e),s.resolveOnRender(r)}),!s.isStatic){var y=!1;p.on("moveend",function(t){if(s.map){if(t.originalEvent||y){var e=l._fullLayout[s.id];o.call("_storeDirectGUIEdit",l.layout,l._fullLayout._preGUI,s.getViewEdits(e));var r=s.getView();e._input.center=e.center=r.center,e._input.zoom=e.zoom=r.zoom,e._input.bearing=e.bearing=r.bearing,e._input.pitch=e.pitch=r.pitch,l.emit("plotly_relayout",s.getViewEdits(r))}y=!1}}),p.on("wheel",function(){y=!0}),p.on("mousemove",function(t){var e=s.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},s.xaxis.p2c=function(){return t.lngLat.lng},s.yaxis.p2c=function(){return t.lngLat.lat},i.hover(l,t,s.id)}),p.on("dragstart",x),p.on("zoomstart",x),p.on("drag",b),p.on("zoom",b),p.on("dblclick",function(){var t=l._fullLayout[s.id];o.call("_storeDirectGUIEdit",l.layout,l._fullLayout._preGUI,s.getViewEdits(t));var e=s.viewInitial;p.setCenter(m(e.center)),p.setZoom(e.zoom),p.setBearing(e.bearing),p.setPitch(e.pitch);var r=s.getView();t._input.center=t.center=r.center,t._input.zoom=t.zoom=r.zoom,t._input.bearing=t.bearing=r.bearing,t._input.pitch=t.pitch=r.pitch,l.emit("plotly_doubleclick",null),l.emit("plotly_relayout",s.getViewEdits(r))}),s.clearSelect=function(){l._fullLayout._zoomlayer.selectAll(".select-outline").remove()},s.onClickInPanFn=function(t){return function(e){var r=l._fullLayout.clickmode;r.indexOf("select")>-1&&u(e.originalEvent,l,[s.xaxis],[s.yaxis],s.id,t),r.indexOf("event")>-1&&i.click(l,e.originalEvent)}}}function x(){i.loneUnhover(e._toppaper)}function b(){var t=s.getView();l.emit("plotly_relayouting",s.getViewEdits(t))}},d.updateMap=function(t,e,r,n){var i=this,a=i.map,o=e[this.id];i.rejectOnError(n);var s=v(o.style);i.styleObj.id!==s.id?(i.styleObj=s,a.setStyle(s.style),a.once("styledata",function(){i.traceHash={},i.updateData(t),i.updateLayout(e),i.resolveOnRender(r)})):(i.updateData(t),i.updateLayout(e),i.resolveOnRender(r))},d.updateData=function(t){var e,r,n,i,a=this.traceHash;for(n=0;n=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"),c=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(){g.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()&&c.text()?" - ":"")}},g.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL,r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),a=i.append("input").attr({type:"text",name:"data"});return a.node().value=g.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var x=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],b=["year","month","dayMonth","dayMonthYear"];function _(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a1&&P.length>1){for(a.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&P.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),g.linkSubplots(f,s,c,i),g.cleanPlot(f,s,c,i),i._zoomlayer&&!t._dragging&&i._zoomlayer.selectAll(".select-outline").remove(),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),a=Math.round(f*a)}}var h=g.layoutAttributes.width.min,p=g.layoutAttributes.height.min;n1,v=!e.height&&Math.abs(r.height-a)>1;(v||d)&&(d&&(r.width=n),v&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),g.sanitizeMargins(r)},g.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,s,u=a.componentsRegistry,c=e._basePlotModules,f=a.subplotsRegistry.cartesian;for(i in u)(s=u[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0);var l=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,c=void 0!==r.yt?r.yt:r.y,f=void 0!==r.yb?r.yb:r.y;i[e]={l:{val:l,size:r.l+o},r:{val:u,size:r.r+o},b:{val:f,size:r.b+o},t:{val:c,size:r.t+o}},a[e]=1}else delete i[e],delete a[e];n._replotting||g.doAutoMargin(t)}},g.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),T(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,f=n.b,h=e.width,p=e.height,d=e._pushmargin,v=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in d)v[m]||delete d[m];for(var y in d.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:f}},d){var x=d[y].l||{},b=d[y].b||{},_=x.val,w=x.size,k=b.val,A=b.size;for(var M in d){if(i(w)&&d[M].r){var E=d[M].r.val,S=d[M].r.size;if(E>_){var C=(w*E+(S-h)*_)/(E-_),L=(S*(1-_)+(w-h)*(1-E))/(E-_);C>=0&&L>=0&&h-(C+L)>0&&C+L>s+u&&(s=C,u=L)}}if(i(A)&&d[M].t){var O=d[M].t.val,I=d[M].t.size;if(O>k){var P=(A*O+(I-p)*k)/(O-k),D=(I*(1-k)+(A-p)*(1-O))/(O-k);P>=0&&D>=0&&p-(D+P)>0&&P+D>f+c&&(f=P,c=D)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(h)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!e._replotting&&g.didMarginChange(o,r))return"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1,a.call("plot",t)};var M=["l","r","t","b","p","w","h"];function E(t,e,r){var n=!1,i=[g.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,g.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise(function(i){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){n=!0}),r.redraw&&t._transitionData._interruptCallbacks.push(function(){return a.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o=0,s=0;function l(){return o++,function(){var e;s++,n||s!==o||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return a.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)))}}r.runFn(l),setTimeout(l())})}],o=l.syncOrAsync(i,t);return o&&o.then||(o=Promise.resolve()),o.then(function(){return t})}g.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},g.graphJson=function(t,e,r,n,i){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&g.supplyDefaults(t);var a=i?t._fullData:t.data,o=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function u(t){if("function"==typeof t)return null;if(l.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=u(t[e])}return i}return Array.isArray(t)?t.map(u):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var c={data:(a||[]).map(function(t){var r=u(t);return e&&delete r.fit,r})};return e||(c.layout=u(o)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=u(s)),"object"===n?c:JSON.stringify(c)},g.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:c,y:c}]),a[0].t||(a[0].t={}),a[0].trace=r,d[e]=a}}for(C(u,h),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:u,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),u=(-o+l)/(2*a),c=(-o-l)/(2*a);return[[u,e*u+i+n],[c,e*c+i+n]]},clampTiny:f,pathPolygon:function(t,e,r,n,i,a){return"M"+h(c(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t=0?h.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);T&&!A&&(S=0);var C=E.slice();M&&A&&(C[1]+=S);var L=h.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),h.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var O=h.angularAxis.ticksStep||(C[1]-C[0])/(L*(h.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),C[2]||(C[2]=O);var I=n.range.apply(this,C);if(I=I.map(function(t,e){return parseFloat(t.toPrecision(12))}),i=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=i.domain(),c.layout.angularAxis.endPadding=M?S:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),D=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(D)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var z,R=t.select(".chart-group"),F={fill:"none",stroke:h.tickColor},B={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){z=t.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var N=p.map(function(t,e){var r=s.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});s.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},s.Legend.defaultConfig().legendConfig,{container:z,elements:N,reverseOrder:h.legend.reverseOrder})})();var j=z.node().getBBox();x=Math.min(h.width-j.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],r.range([0,x]),c.layout.radialAxis.domain=r.domain(),z.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else z=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var V=[(h.width-(h.margin.left+h.margin.right+2*x+(j?j.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),t.select(".outer-group").attr("transform","translate("+V+")"),h.title&&h.title.text){var U=t.select("g.title-group text").style(B).text(h.title.text),H=U.node().getBBox();U.attr({x:_[0]-H.width/2,y:_[1]-x-20})}var q=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:x}).style(F);var W=t.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});function Y(t,e){return i(t)%360+h.orientation}if(h.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(X).attr({transform:"rotate("+h.radialAxis.orientation+")"}),q.selectAll(".domain").style(F),q.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(I),$=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+Y(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Z.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(F),$.selectAll(".minor").style({stroke:h.minorTickColor}),Z.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(B);var J=Z.select("text.axis-text").attr({x:x+h.labelOffset,dy:o+"em",transform:function(t,e){var r=Y(t),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(B);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));z.attr({transform:"translate("+[x+K,h.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||Q){var et=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=i,n.container=tt.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})});var rt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(et),nt=[];rt.forEach(function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map(function(t,e){return[t]})):nt.push(t.values)}),nt.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(s[r].defaultConfig(),t)});s[r]().config(n)()})}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=s.tooltipPanel().config({container:st,fontSize:8})(),ut=s.tooltipPanel().config({container:st,fontSize:8})(),ct=s.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var r=s.util.getMousePos(W).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=i.invert(n);var a=s.util.convertToCartesian(x+12,r+180);lt.text(s.util.round(it)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var n=s.util.getMousePos(W).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(s.util.getMousePos(W).radius);var i=s.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(s.util.round(at)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,o="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),o=n.hsl(a).darker().toString(),i.style({fill:o,opacity:1});var u={t:s.util.round(e[0]),r:s.util.round(e[1])};A&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),p=[f.left+f.width/2-V[0]-h.left,f.top+f.height/2-V[1]-h.top];ct.config({color:o}).text(c),ct.move(p)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),o=n.hsl(a).darker().toString(),i.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()}).on("mouseout.tooltip",function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(u),this},config:function(t){if(!arguments.length)return l;var e=s.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],s.Axis.defaultConfig().data[0]),a(l.data[e],t)}),a(l.layout,s.Axis.defaultConfig().layout),a(l.layout,e.layout),this},getLiveConfig:function(){return c},getinputConfig:function(){return u},radialScale:function(t){return r},angularScale:function(t){return i},svg:function(){return t}};return n.rebind(h,f,"on"),h},s.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},s.util={},s.DATAEXTENT="dataExtent",s.AREA="AreaChart",s.LINE="LinePlot",s.DOT="DotPlot",s.BAR="BarChart",s.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},s.util._extend=function(t,e){for(var r in t)e[r]=t[r]},s.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},s.util.dataFromEquation2=function(t,e){var r=e||6,i=n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return i},s.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},s.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},s.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=s.util.ensureArray(t[e],r)}),t},s.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},s.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},s.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},s.util.arrayLast=function(t){return t[t.length-1]},s.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},s.util.flattenArray=function(t){for(var e=[];!s.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},s.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},s.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},s.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},s.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},s.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,i,a)},"stroke-width":function(t,e){return d["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,i,a)},opacity:function(t,e){return d.opacity(r,i,a)},display:function(t,e){return d.display(r,i,a)}})}};var f=e.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(t){return e.radialScale(l+(t[2]||0))}).outerRadius(function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])});u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return void 0===t[n].data.visible||t[n].data.visible?"block":"none"}},v=n.select(this).selectAll("g.layer").data(o);v.enter().append("g").attr({class:"layer"});var g=v.selectAll("path.mark").data(function(t,e){return t});g.enter().append("path").attr({class:"mark"}),g.style(d).each(u[e.geometryType]),g.exit().remove(),v.exit().remove()})}return i.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),a(t[r],s.PolyChart.defaultConfig()),a(t[r],e)}),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},s.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}};return t},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=function(){return s.PolyChart()},s.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},s.LinePlot=function(){return s.PolyChart()},s.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},s.Legend=function(){var t=s.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map(function(t,r){return[].concat(t).map(function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||void 0===e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=c?e.height:u*o.length,h=s.classed("legend-group",!0),p=h.selectAll("svg").data([0]),d=p.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var v=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(v).range(l),m=n.scale[c?"linear":"ordinal"]().domain(v)[c?"range":"rangePoints"]([0,f]);if(c){var y=p.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);y.enter().append("stop"),y.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),p.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var x=p.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,m(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return g(e)}}),x.exit().remove()}var b=n.svg.axis().scale(m).orient("right"),_=p.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(b);return _.selectAll(".domain").style({fill:"none",stroke:"none"}),_.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),_.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return o[e].name}),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},s.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},s.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+s.tooltipPanel.uid++,l=10,u=function(){var n=(t=i.container.selectAll("g."+o).data([0])).enter().append("g").classed(o,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),u};return u.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(f);var h=i.padding,p=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},v=p.width+2*h+l,g=p.height+2*h;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[i.hasTick?0:l,0],[l,g/4],[l,g/2],[v,g/2],[v,-g/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-g/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return a(i,t),u},u},s.tooltipPanel.uid=1,s.adapter={},s.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=s.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=a({},t.layout),l=[[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],f={};n.entries(o.margin).forEach(function(t,e){f[c[u.indexOf(t.key)]]=t.value}),o.margin=f}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r}};return t}},{"../../../constants/alignment":675,"../../../lib":703,d3:157}],822:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,f=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,f.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){f.undo()},h.redo=function(){f.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":580,"../../../lib":703,"./micropolar":821,"./undo_manager":823,d3:157}],823:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r=90||s>90&&l>=450?1:c<=0&&h<=0?0:Math.max(c,h),e=s<=180&&l>=180||s>180&&l>=540?-1:u>=0&&f>=0?0:Math.min(u,f),r=s<=270&&l>=270||s>270&&l>=630?-1:c>=0&&h>=0?0:Math.min(c,h),n=l>=360?1:u<=0&&f<=0?0:Math.max(u,f),[e,r,n,i]}(h),x=y[2]-y[0],b=y[3]-y[1],_=f/c,w=Math.abs(b/x);_>w?(p=c,m=(f-(d=c*w))/n.h/2,v=[o[0],o[1]],g=[u[0]+m,u[1]-m]):(d=f,m=(c-(p=f/w))/n.w/2,v=[o[0]+m,o[1]-m],g=[u[0],u[1]]),this.xLength2=p,this.yLength2=d,this.xDomain2=v,this.yDomain2=g;var k=this.xOffset2=n.l+n.w*v[0],A=this.yOffset2=n.t+n.h*(1-g[1]),T=this.radius=p/x,M=this.innerRadius=e.hole*T,E=this.cx=k-T*y[0],L=this.cy=A+T*y[3],O=this.cxx=E-k,I=this.cyy=L-A;this.radialAxis=this.mockAxis(t,e,i,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[i.side],domain:[M/n.w,T/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:v}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:g});var P=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",P).attr("transform",R(O,I)),r.frontplot.attr("transform",R(k,A)).call(l.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",P).attr("transform",R(E,L)).call(s.fill,e.bgcolor)},I.mockAxis=function(t,e,r,n){var i=o.extendFlat({anchor:"free",position:0},r,n);return h(i,e,t),i},I.mockCartesianAxis=function(t,e,r){var n=this,i=r._id,a=o.extendFlat({type:"linear"},r);f(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},I.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,i=e.radialaxis;n.setScale(),p(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")]},I.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,l=r.innerRadius,u=r.cx,f=r.cy,h=e.radialaxis,p=S(e.sector[0],360),d=r.radialAxis,v=l90&&p<=270&&(d.tickangle=180);var g=function(t){return"translate("+(d.l2p(t.x)+l)+",0)"},m=P(h);if(r.radialTickLayout!==m&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=m),v){d.setScale();var y=c.calcTicks(d),x=c.clipEnds(d,y),b=c.getTickSigns(d)[2];c.drawTicks(n,d,{vals:y,layer:i["radial-axis"],path:c.makeTickPath(d,0,b),transFn:g,crisp:!1}),c.drawGrid(n,d,{vals:x,layer:i["radial-grid"],path:function(t){return r.pathArc(d.r2p(t.x)+l)},transFn:o.noop,crisp:!1}),c.drawLabels(n,d,{vals:y,layer:i["radial-axis"],transFn:g,labelFns:c.makeLabelFns(d,0)})}var _=r.radialAxisAngle=r.vangles?L(D(C(h.angle),r.vangles)):h.angle,w=R(u,f),k=w+F(-_);z(i["radial-axis"],v&&(h.showticklabels||h.ticks),{transform:k}),z(i["radial-grid"],v&&h.showgrid,{transform:w}),z(i["radial-line"].select("line"),v&&h.showline,{x1:l,y1:0,x2:a,y2:0,transform:k}).attr("stroke-width",h.linewidth).call(s.stroke,h.linecolor)},I.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,u=this.id+"title",c=void 0!==r?r:this.radialAxisAngle,f=C(c),h=Math.cos(f),p=Math.sin(f),d=0;if(s.title){var v=l.bBox(this.layers["radial-axis"].node()).height,g=s.title.font.size;d="counterclockwise"===s.side?-v-.4*g:v+.8*g}this.layers["radial-axis-title"]=m.draw(n,u,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:E(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}})},I.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,l=r.innerRadius,u=r.cx,f=r.cy,h=e.angularaxis,p=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",h.rotation),p.setGeometry(),p.setScale();var d=function(t){return p.t2g(t.x)};"linear"===p.type&&"radians"===p.thetaunit&&(p.tick0=L(p.tick0),p.dtick=L(p.dtick));var v=function(t){return R(u+a*Math.cos(t),f-a*Math.sin(t))},g=c.makeLabelFns(p,0),m=g.labelStandoff,y={xFn:function(t){var e=d(t);return Math.cos(e)*m},yFn:function(t){var e=d(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(m+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*A)},anchorFn:function(t){var e=d(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=d(t);return-.5*(1+Math.sin(n))*r}},x=P(h);r.angularTickLayout!==x&&(i["angular-axis"].selectAll("."+p._id+"tick").remove(),r.angularTickLayout=x);var b,_=c.calcTicks(p);if("linear"===e.gridshape?(b=_.map(d),o.angleDelta(b[0],b[1])<0&&(b=b.slice().reverse())):b=null,r.vangles=b,"category"===p.type&&(_=_.filter(function(t){return o.isAngleInsideSector(d(t),r.sectorInRad)})),p.visible){var w="inside"===p.ticks?-1:1,k=(p.linewidth||1)/2;c.drawTicks(n,p,{vals:_,layer:i["angular-axis"],path:"M"+w*k+",0h"+w*p.ticklen,transFn:function(t){var e=d(t);return v(e)+F(-L(e))},crisp:!1}),c.drawGrid(n,p,{vals:_,layer:i["angular-grid"],path:function(t){var e=d(t),r=Math.cos(e),n=Math.sin(e);return"M"+[u+l*r,f-l*n]+"L"+[u+a*r,f-a*n]},transFn:o.noop,crisp:!1}),c.drawLabels(n,p,{vals:_,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return v(d(t))},labelFns:y})}z(i["angular-line"].select("path"),h.showline,{d:r.pathSubplot(),transform:R(u,f)}).attr("stroke-width",h.linewidth).call(s.stroke,h.linecolor)},I.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},I.updateMainDrag=function(t){var e=this,r=e.gd,o=e.layers,s=t._zoomlayer,l=T.MINZOOM,u=T.OFFEDGE,c=e.radius,f=e.innerRadius,h=e.cx,p=e.cy,m=e.cxx,_=e.cyy,w=e.sectorInRad,k=e.vangles,A=e.radialAxis,E=M.clampTiny,S=M.findXYatLength,C=M.findEnclosingVertexAngles,L=T.cornerHalfWidth,O=T.cornerLen/2,I=d.makeDragger(o,"path","maindrag","crosshair");n.select(I).attr("d",e.pathSubplot()).attr("transform",R(h,p));var P,D,z,F,B,N,j,V,U,H={element:I,gd:r,subplot:e.id,plotinfo:{id:e.id,xaxis:e.xaxis,yaxis:e.yaxis},xaxes:[e.xaxis],yaxes:[e.yaxis]};function q(t,e){return Math.sqrt(t*t+e*e)}function G(t,e){return q(t-m,e-_)}function W(t,e){return Math.atan2(_-e,t-m)}function Y(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function X(t,r){if(0===t)return e.pathSector(2*L);var n=O/t,i=r-n,a=r+n,o=Math.max(0,Math.min(t,c)),s=o-L,l=o+L;return"M"+Y(s,i)+"A"+[s,s]+" 0,0,0 "+Y(s,a)+"L"+Y(l,a)+"A"+[l,l]+" 0,0,1 "+Y(l,i)+"Z"}function Z(t,r,n){if(0===t)return e.pathSector(2*L);var i,a,o=Y(t,r),s=Y(t,n),l=E((o[0]+s[0])/2),u=E((o[1]+s[1])/2);if(l&&u){var c=u/l,f=-1/c,h=S(L,c,l,u);i=S(O,f,h[0][0],h[0][1]),a=S(O,f,h[1][0],h[1][1])}else{var p,d;u?(p=O,d=L):(p=L,d=O),i=[[l-p,u-d],[l+p,u-d]],a=[[l-p,u+d],[l+p,u+d]]}return"M"+i.join("L")+"L"+a.reverse().join("L")+"Z"}function $(t,e){return e=Math.max(Math.min(e,c),f),tl?(t-1&&1===t&&x(n,r,[e.xaxis],[e.yaxis],e.id,H),i.indexOf("event")>-1&&g.click(r,n,e.id)}H.prepFn=function(t,n,a){var o=r._fullLayout.dragmode,l=I.getBoundingClientRect();if(P=n-l.left,D=a-l.top,k){var u=M.findPolygonOffset(c,w[0],w[1],k);P+=m+u[0],D+=_+u[1]}switch(o){case"zoom":H.moveFn=k?tt:K,H.clickFn=nt,H.doneFn=et,function(){z=null,F=null,B=e.pathSubplot(),N=!1;var t=r._fullLayout[e.id];j=i(t.bgcolor).getLuminance(),(V=d.makeZoombox(s,j,h,p,B)).attr("fill-rule","evenodd"),U=d.makeCorners(s,h,p),b(r)}();break;case"select":case"lasso":y(t,n,a,H,o)}},I.onmousemove=function(t){g.hover(r,t,e.id),r._fullLayout._lasthover=I,r._fullLayout._hoversubplot=e.id},I.onmouseout=function(t){r._dragging||v.unhover(r,t)},v.init(H)},I.updateRadialDrag=function(t,e,r){var i=this,s=i.gd,l=i.layers,u=i.radius,c=i.innerRadius,f=i.cx,h=i.cy,p=i.radialAxis,g=T.radialDragBoxSize,m=g/2;if(p.visible){var y,x,_,A=C(i.radialAxisAngle),M=p._rl,E=M[0],S=M[1],O=M[r],I=.75*(M[1]-M[0])/(1-e.hole)/u;r?(y=f+(u+m)*Math.cos(A),x=h-(u+m)*Math.sin(A),_="radialdrag"):(y=f+(c-m)*Math.cos(A),x=h-(c-m)*Math.sin(A),_="radialdrag-inner");var P,B,N,j=d.makeRectDragger(l,_,"crosshair",-m,-m,g,g),V={element:j,gd:s};z(n.select(j),p.visible&&c0==(r?N>E: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,u=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;o=c&&(p.min=0,v.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,v=d.charAt(0).toUpperCase(),g="Component "+v,m=o("title.text",g);e._hovertitle=m===g?m:v,a.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*r.font.size),color:p}),o("min"),u(t,e,o,"linear"),s(t,e,o,"linear",{}),l(t,e,o,{outerTicks:!0});var y=o("showticklabels");y&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),c(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":580,"../../lib":703,"../../plot_api/plot_template":741,"../cartesian/line_grid_defaults":765,"../cartesian/tick_label_defaults":770,"../cartesian/tick_mark_defaults":771,"../cartesian/tick_value_defaults":772,"../subplot_defaults":826,"./layout_attributes":828}],830:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o._,l=t("../../components/color"),u=t("../../components/drawing"),c=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,h=t("../plots"),p=t("../cartesian/axes"),d=t("../../components/dragelement"),v=t("../../components/fx"),g=t("../../components/titles"),m=t("../cartesian/select").prepSelect,y=t("../cartesian/select").selectOnClick,x=t("../cartesian/select").clearSelect,b=t("../cartesian/constants");function _(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=_;var w=_.prototype;w.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},w.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;ik*x?i=(a=x)*k:a=(i=y)/k,o=g*i/y,s=m*a/x,r=e.l+e.w*d-i/2,n=e.t+e.h*(1-v)-a/2,h.x0=r,h.y0=n,h.w=i,h.h=a,h.sum=b,h.xaxis={type:"linear",range:[_+2*A-b,b-_-2*w],domain:[d-o/2,d+o/2],_id:"x"},c(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:[_,b-w-A],domain:[v-s/2,v+s/2],_id:"y"},c(h.yaxis,h.graphDiv._fullLayout),h.yaxis.setScale(),h.yaxis.isPtWithinRange=function(){return!0};var T=h.yaxis.domain[0],M=h.aaxis=f({},t.aaxis,{range:[_,b-w-A],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[T,T+s*k],anchor:"free",position:0,_id:"y",_length:i});c(M,h.graphDiv._fullLayout),M.setScale();var E=h.baxis=f({},t.baxis,{range:[b-_-A,w],side:"bottom",domain:h.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});c(E,h.graphDiv._fullLayout),E.setScale();var S=h.caxis=f({},t.caxis,{range:[b-_-w,A],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[T,T+s*k],anchor:"free",position:0,_id:"y",_length:i});c(S,h.graphDiv._fullLayout),S.setScale();var C="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDef.select("path").attr("d",C),h.layers.plotbg.select("path").attr("d",C);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDefRelative.select("path").attr("d",L);var O="translate("+r+","+n+")";h.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",O),h.clipDefRelative.select("path").attr("transform",null);var I="translate("+(r-E._offset)+","+(n+a)+")";h.layers.baxis.attr("transform",I),h.layers.bgrid.attr("transform",I);var P="translate("+(r+i/2)+","+n+")rotate(30)translate(0,"+-M._offset+")";h.layers.aaxis.attr("transform",P),h.layers.agrid.attr("transform",P);var D="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,"+-S._offset+")";h.layers.caxis.attr("transform",D),h.layers.cgrid.attr("transform",D),h.drawAxes(!0),h.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),h.layers.bline.select("path").attr("d",E.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),h.layers.cline.select("path").attr("d",S.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),h.graphDiv._context.staticPlot||h.initInteractions(),u.setClipUrl(h.layers.frontplot,h._hasClipOnAxisFalse?null:h.clipId,h.graphDiv)},w.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 l=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),u=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;n["a-title"]=g.draw(e,"a"+r,{propContainer:i,propName:this.id+".aaxis.title",placeholder:s(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-i.title.font.size/3-l,"text-anchor":"middle"}}),n["b-title"]=g.draw(e,"b"+r,{propContainer:a,propName:this.id+".baxis.title",placeholder:s(e,"Click to enter Component B title"),attributes:{x:this.x0-u,y:this.y0+this.h+.83*a.title.font.size+u,"text-anchor":"middle"}}),n["c-title"]=g.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+u,y:this.y0+this.h+.83*o.title.font.size+u,"text-anchor":"middle"}})}},w.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",u=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==u&&(s.selectAll("."+a+"tick").remove(),this[l]=u),t.setScale();var c=p.calcTicks(t),f=p.clipEnds(t,c),h=p.makeTransFn(t),d=p.getTickSigns(t)[2],v=o.deg2rad(30),g=d*(t.linewidth||1)/2,m=d*t.ticklen,y=this.w,x=this.h,b="b"===i?"M0,"+g+"l"+Math.sin(v)*m+","+Math.cos(v)*m:"M"+g+",0l"+Math.cos(v)*m+","+-Math.sin(v)*m,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[i];p.drawTicks(r,t,{vals:"inside"===t.ticks?f:c,layer:s,path:b,transFn:h,crisp:!1}),p.drawGrid(r,t,{vals:f,layer:this.layers[i+"grid"],path:_,transFn:h,crisp:!1}),p.drawLabels(r,t,{vals:c,layer:s,transFn:h,labelFns:p.makeLabelFns(t,0,30)})};var A=b.MINZOOM/2+.87,T="m-0.87,.5h"+A+"v3h-"+(A+5.2)+"l"+(A/2+2.6)+",-"+(.87*A+4.5)+"l2.6,1.5l-"+A/2+","+.87*A+"Z",M="m0.87,.5h-"+A+"v3h"+(A+5.2)+"l-"+(A/2+2.6)+",-"+(.87*A+4.5)+"l-2.6,1.5l"+A/2+","+.87*A+"Z",E="m0,1l"+A/2+","+.87*A+"l2.6,-1.5l-"+(A/2+2.6)+",-"+(.87*A+4.5)+"l-"+(A/2+2.6)+","+(.87*A+4.5)+"l2.6,1.5l"+A/2+",-"+.87*A+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",C=!0;function L(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}w.initInteractions=function(){var t,e,r,n,c,f,h,p,g,_,w=this,A=w.layers.plotbg.select("path").node(),O=w.graphDiv,I=O._fullLayout._zoomlayer,P={element:A,gd:O,plotinfo:{id:w.id,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(a,o,s){P.xaxes=[w.xaxis],P.yaxes=[w.yaxis];var u=O._fullLayout.dragmode;P.minDrag="lasso"===u?1:void 0,"zoom"===u?(P.moveFn=N,P.clickFn=z,P.doneFn=j,function(a,o,s){var u=A.getBoundingClientRect();t=o-u.left,e=s-u.top,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},c=r,n=w.aaxis.range[1]-r.a,f=i(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),h="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",p=!1,g=I.append("path").attr("class","zoombox").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:f>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",h),_=I.append("path").attr("class","zoombox-corners").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),x(O)}(0,o,s)):"pan"===u?(P.moveFn=V,P.clickFn=z,P.doneFn=U,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},c=r,x(O)):"select"!==u&&"lasso"!==u||m(a,o,s,P,u)}};function D(t){var e={};return e[w.id+".aaxis.min"]=t.a,e[w.id+".baxis.min"]=t.b,e[w.id+".caxis.min"]=t.c,e}function z(t,e){var r=O._fullLayout.clickmode;L(O),2===t&&(O.emit("plotly_doubleclick",null),a.call("_guiRelayout",O,D({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&y(e,O,[w.xaxis],[w.yaxis],w.id,P),r.indexOf("event")>-1&&v.click(O,e,w.id)}function R(t,e){return 1-e/w.h}function F(t,e){return 1-(t+(w.h-e)/Math.sqrt(3))/w.w}function B(t,e){return(t-(w.h-e)/Math.sqrt(3))/w.w}function N(i,a){var o=t+i,s=e+a,l=Math.max(0,Math.min(1,R(0,e),R(0,s))),u=Math.max(0,Math.min(1,F(t,e),F(o,s))),d=Math.max(0,Math.min(1,B(t,e),B(o,s))),v=(l/2+d)*w.w,m=(1-l/2-u)*w.w,y=(v+m)/2,x=m-v,A=(1-l)*w.h,C=A-x/k;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),_.transition().style("opacity",1).duration(200),p=!0),O.emit("plotly_relayouting",D(c))}function j(){L(O),c!==r&&(a.call("_guiRelayout",O,D(c)),C&&O.data&&O._context.showTips&&(o.notifier(s(O,"Double-click to zoom back out"),"long"),C=!1))}function V(t,e){var n=t/w.xaxis._m,i=e/w.yaxis._m,a=[(c={a:r.a-i,b:r.b+(n+i)/2,c:r.c-(n-i)/2}).a,c.b,c.c].sort(),o={a:a.indexOf(c.a),b:a.indexOf(c.b),c:a.indexOf(c.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),c={a:a[o.a],b:a[o.b],c:a[o.c]},e=(r.a-c.a)*w.yaxis._m,t=(r.c-c.c-r.b+c.b)*w.xaxis._m);var s="translate("+(w.x0+t)+","+(w.y0+e)+")";w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",s);var l="translate("+-t+","+-e+")";w.clipDefRelative.select("path").attr("transform",l),w.aaxis.range=[c.a,w.sum-c.b-c.c],w.baxis.range=[w.sum-c.a-c.c,c.b],w.caxis.range=[w.sum-c.a-c.b,c.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,w),O.emit("plotly_relayouting",D(c))}function U(){a.call("_guiRelayout",O,D(c))}A.onmousemove=function(t){v.hover(O,t,w.id),O._fullLayout._lasthover=A,O._fullLayout._hoversubplot=w.id},A.onmouseout=function(t){O._dragging||d.unhover(O,t)},d.init(P)}},{"../../components/color":580,"../../components/dragelement":598,"../../components/drawing":601,"../../components/fx":619,"../../components/titles":668,"../../lib":703,"../../lib/extend":693,"../../registry":831,"../cartesian/axes":751,"../cartesian/constants":757,"../cartesian/select":768,"../cartesian/set_convert":769,"../plots":812,d3:157,tinycolor2:524}],831:[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/extend"),l=t("./plots/attributes"),u=t("./plots/layout_attributes"),c=s.extendFlat,f=s.extendDeepAll;function h(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])n.log("Plot type "+e+" already registered.");else for(var i in g(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(i,t.name)}(t.basePlotModule);for(var o={},s=0;s-1&&(f[p[r]].title={text:""});for(r=0;rpath, .legendlines>path, .cbfill").each(function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(l,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(l,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),h.node().setAttributeNS(s.xmlns,"xmlns",s.svg),h.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===e&&r&&(h.attr("width",r*d),h.attr("height",r*v),h.attr("viewBox","0 0 "+d+" "+v));var _=(new window.XMLSerializer).serializeToString(h.node());return _=(_=(_=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),r}(_)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":580,"../components/drawing":601,"../constants/xmlns_namespaces":681,"../lib":703,d3:157}],840:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r0&&f.s>0||(u=!1)}o._extremes[t._id]=s.findExtremes(t,l,{tozero:!u,padded:!0})}}function m(t){for(var e=t.traces,r=0;rf+u||!n(c))}for(var p=0;p0&&_.s>0||(m=!1)}}v._extremes[t._id]=s.findExtremes(t,g,{tozero:!m,padded:y})}}function x(t){return t._id.charAt(0)}e.exports={crossTraceCalc:function(t,e){for(var r=e.xaxis,n=e.yaxis,i=t._fullLayout,a=t._fullData,s=t.calcdata,l=[],u=[],f=0;fa;if(!o)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&&N>0,G=B<=U&&N<=H,W=B<=H&&N<=U,Y=M?U>=B*(H/N):H>=N*(U/B);q&&(G||W||Y)?m="inside":(m="outside",R.remove(),R=null)}else m="inside";!R&&(R=A(r,E,"outside"===m?D:P),F=l.bBox(R.node()),B=F.width,N=F.height,B<=0||N<=0)?R.remove():("outside"===m?(V="both"===T.constraintext||"outside"===T.constraintext,j=_(s,u,c,p,F,{isHorizontal:M,constrained:V,angle:T.textangle})):(V="both"===T.constraintext||"inside"===T.constraintext,j=b(s,u,c,p,F,{isHorizontal:M,constrained:V,angle:T.textangle,anchor:T.insidetextanchor})),R.attr("transform",j))}else r.select("text").remove()}function x(t){return"auto"===t?0:t}function b(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,u=a.anchor||0,c=i.width,f=i.height,h=Math.abs(e-t),p=Math.abs(n-r),d=h>2*g&&p>2*g?g:0;h-=2*d,p-=2*d;var v="auto"===l,y=!1;if(!v||c<=h&&f<=p||!(c>h||f>p)||(c>p||f>h)&&c2*g?g:0:h>2*g?g:0;var d=1;l&&(d=s?Math.min(1,p/f):Math.min(1,h/c));var v=x(u),y=Math.abs(Math.sin(Math.PI/180*v)),b=Math.abs(Math.cos(Math.PI/180*v)),_=d*(s?f:c),k=d*(s?c:f);o+=.5*(_*y+k*b);var A=(t+e)/2,T=(r+n)/2;s?A=e-o*m(e,t):T=n+o*m(r,n);var M=(i.left+i.right)/2,E=(i.top+i.bottom)/2;return w(M,E,A,T,d,v)}function w(t,e,r,n,i,a){var o;i<1?o="scale("+i+") ":(i=1,o="");var s=r-i*t,l=n-i*e;return"translate("+s+" "+l+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function k(t,e,r,n){var i,o=t[0].trace;return i=o.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function u(t){var e=o?r:n;return c(e,+t,!0).text}var f,h,p=i.textinfo,d=t[e],v=p.split("+"),g=[],m=function(t){return-1!==v.indexOf(t)};if(m("label")&&g.push((h=t[e].p,c(o?n:r,h,!0).text)),m("text")&&(0===(f=a.castOption(i,d.i,"text"))||f)&&g.push(f),s){var y=+d.rawS||d.s,x=d.v,b=x-y;m("initial")&&g.push(u(b)),m("delta")&&g.push(u(y)),m("final")&&g.push(u(x))}if(l){m("value")&&g.push(u(d.s));var _=0;m("percent initial")&&_++,m("percent previous")&&_++,m("percent total")&&_++;var w=_>1;m("percent initial")&&(f=a.formatPercent(d.begR),w&&(f+=" of initial"),g.push(f)),m("percent previous")&&(f=a.formatPercent(d.difR),w&&(f+=" of previous"),g.push(f)),m("percent total")&&(f=a.formatPercent(d.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(t,e,r,n):h.getValue(o.text,e),h.coerceString(d,i)}e.exports={plot:function(t,e,r,o,c){var f=e.xaxis,h=e.yaxis,p=t._fullLayout;c||(c={mode:p.barmode,norm:p.barmode,gap:p.bargap,groupgap:p.bargroupgap});var d=a.makeTraceGroups(o,r,"trace bars").each(function(r){var o=n.select(this),u=r[0].trace,p="waterfall"===u.type,d="funnel"===u.type,v="bar"===u.type,g=v||d,x=0;p&&u.connector.visible&&"between"===u.connector.mode&&(x=u.connector.line.width/2);var b="h"===u.orientation;e.isRangePlot||(r[0].node3=o);var _=a.ensureSingle(o,"g","points"),w=_.selectAll("g.point").data(a.identity);w.enter().append("g").classed("point",!0),w.exit().remove(),w.each(function(o,p){var d,v,_=n.select(this),w=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),n?[i,a]:[a,i]}(o,f,h,b),k=w[0][0],A=w[0][1],T=w[1][0],M=w[1][1],E=o.isBlank=!(i(k)&&i(A)&&i(T)&&i(M)&&(k!==A||g&&b)&&(T!==M||g&&!b));if(x&&(b?(k-=m(k,A)*x,A+=m(k,A)*x):(T-=m(T,M)*x,M+=m(T,M)*x)),"waterfall"===u.type){if(!E){var S=u[o.dir].marker;d=S.line.width,v=S.color}}else d=(o.mlw+1||u.marker.line.width+1||(o.trace?o.trace.marker.line.width:0)+1)-1,v=o.mc||u.marker.color;var C=n.round(d/2%1,2);function L(t){return 0===c.gap&&0===c.groupgap?n.round(Math.round(t)-C,2):t}if(!t._context.staticPlot){var O=s.opacity(v),I=O<1||d>.01?L:function(t,e){return Math.abs(t-e)>=2?L(t):t>e?Math.ceil(t):Math.floor(t)};k=I(k,A),A=I(A,k),T=I(T,M),M=I(M,T)}a.ensureSingle(_,"path").style("vector-effect","non-scaling-stroke").attr("d",E?"M0,0Z":"M"+k+","+T+"V"+M+"H"+A+"V"+T+"Z").call(l.setClipUrl,e.layerClipId,t),y(t,e,_,r,p,k,A,T,M,c),e.layerClipId&&l.hideOutsideRangePoint(o,_.select("text"),f,h,u.xcalendar,u.ycalendar)});var k=!1===u.cliponaxis;l.setClipUrl(o,k?null:e.layerClipId,t)});u.getComponentMethod("errorbars","plot")(t,d,e)},getTransformToMoveInsideBar:b,getTransformToMoveOutsideBar:_}},{"../../components/color":580,"../../components/drawing":601,"../../lib":703,"../../lib/svg_text_utils":727,"../../plots/cartesian/axes":751,"../../registry":831,"./attributes":841,"./helpers":846,"./style":854,d3:157,"fast-isnumeric":224}],852:[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,u="h"===s.orientation,c=[];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")}),r.selectAll("g.points").each(function(e){var r=n.select(this),i=e[0].trace;p(r,i,t)}),s.getComponentMethod("errorbars","style")(r)},styleTextPoints:d,styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?v(r,n,t):(p(r,n,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_}},{"../../components/color":580,"../../components/drawing":601,"../../lib":703,"../../registry":831,"./attributes":841,"./helpers":846,d3:157}],855:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":580,"../../components/colorscale/defaults":590,"../../components/colorscale/helpers":591}],856:[function(t,e,r){"use strict";var n=t("../../components/fx/hovertemplate_attributes"),i=t("../../lib/extend").extendFlat,a=t("../scatterpolar/attributes"),o=t("../bar/attributes");e.exports={r:a.r,theta:a.theta,r0:a.r0,dr:a.dr,theta0:a.theta0,dtheta:a.dtheta,thetaunit:a.thetaunit,base:i({},o.base,{}),offset:i({},o.offset,{}),width:i({},o.width,{}),text:i({},o.text,{}),hovertext:i({},o.hovertext,{}),marker:o.marker,hoverinfo:a.hoverinfo,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../bar/attributes":841,"../scatterpolar/attributes":1136}],857:[function(t,e,r){"use strict";var n=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/calc"),a=t("../bar/arrays_to_calcdata"),o=t("../bar/cross_trace_calc").setGroupPositions,s=t("../scatter/calc_selection"),l=t("../../registry").traceIs,u=t("../../lib").extendFlat;e.exports={calc:function(t,e){for(var r=t._fullLayout,o=e.subplot,l=r[o].radialaxis,u=r[o].angularaxis,c=l.makeCalcdata(e,"r"),f=u.makeCalcdata(e,"theta"),h=e._length,p=new Array(h),d=c,v=f,g=0;gh.range[1]&&(x+=Math.PI),n.getClosest(u,function(t){return v(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/m)-1+(t.rp1-y)/(t.rp1-t.rp0)-1:1/0},t),!1!==t.index){var b=t.index,_=u[b];t.x0=t.x1=_.ct[0],t.y0=t.y1=_.ct[1];var w=i.extendFlat({},_,{r:_.s,theta:_.p});return o(_,c,t),s(w,c,f,t),t.hovertemplate=c.hovertemplate,t.color=a(c,_),t.xLabelVal=t.yLabelVal=void 0,_.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":619,"../../lib":703,"../../plots/polar/helpers":814,"../bar/hover":847,"../scatterpolar/hover":1139}],860:[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"),style:t("../bar/style").style,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":815,"../bar/select":852,"../bar/style":854,"../scatter/marker_colorbar":1092,"./attributes":856,"./calc":857,"./defaults":858,"./hover":859,"./layout_attributes":861,"./layout_defaults":862,"./plot":863}],861:[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"}}},{}],862:[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?(u=o,c=l):(u=l,c=o);var f=s.findEnclosingVertexAngles(u,t.vangles)[0],h=s.findEnclosingVertexAngles(c,t.vangles)[1],p=[f,(u+c)/2,h];return s.pathPolygonAnnulus(n,i,u,c,p,e,r)}: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(r){var s=r[0].node3=n.select(this),p=a.ensureSingle(s,"g","points"),d=p.selectAll("g.point").data(a.identity);d.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),d.exit().remove(),d.each(function(t){var e,r=n.select(this),o=t.rp0=c.c2p(t.s0),s=t.rp1=c.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 v=c.c2g(t.s1),g=(p+d)/2;t.ct=[l.c2p(v*Math.cos(g)),u.c2p(v*Math.sin(g))],e=h(o,s,p,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)}),o.setClipUrl(s,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)})}},{"../../components/drawing":601,"../../lib":703,"../../plots/polar/helpers":814,d3:157,"fast-isnumeric":224}],864:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../bar/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/hovertemplate_attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=l.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"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),hovertemplate:o({}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:s({},l.symbol,{arrayOk:!1,editType:"plot"}),opacity:s({},l.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:s({},l.size,{arrayOk:!1,editType:"calc"}),color:s({},l.color,{arrayOk:!1,editType:"style"}),line:{color:s({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:s({},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,offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":579,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../bar/attributes":841,"../scatter/attributes":1075}],865:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=i._,o=t("../../plots/cartesian/axes");function s(t,e,r){var n={text:"tx",hovertext:"htx"};for(var i in n)Array.isArray(e[i])&&(t[n[i]]=e[i][r])}function l(t,e){return t.v-e.v}function u(t){return t.v}e.exports=function(t,e){var r,c,f,h,p,d=t._fullLayout,v=o.getFromId(t,e.xaxis||"x"),g=o.getFromId(t,e.yaxis||"y"),m=[],y="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=v,f="x",h=g,p="y"):(c=g,f="y",h=v,p="x");var x,b=c.makeCalcdata(e,f),_=function(t,e,r,a,o){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||i.isDateTime(t.name)&&"date"===r.type)?t.name:o;var l="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]);return a.map(function(){return l})}(e,p,h,b,d[y]),w=i.distinctVals(_),k=w.vals,A=w.minDiff/2,T=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&Cx.uf};for(r=0;r0){var I=E[r].sort(l),P=I.map(u),D=P.length;(x={}).pos=k[r],x.pts=I,x[p]=x.pos,x[f]=x.pts.map(function(t){return t.v}),x.min=P[0],x.max=P[D-1],x.mean=i.mean(P,D),x.sd=i.stdev(P,D,x.mean),x.q1=i.interp(P,.25),x.med=i.interp(P,.5),x.q3=i.interp(P,.75),x.lf=Math.min(x.q1,P[Math.min(i.findBin(2.5*x.q1-1.5*x.q3,P,!0)+1,D-1)]),x.uf=Math.max(x.q3,P[Math.max(i.findBin(2.5*x.q3-1.5*x.q1,P),0)]),x.lo=4*x.q1-3*x.q3,x.uo=4*x.q3-3*x.q1;var z=x.q3-x.q1,R=1.57*z/Math.sqrt(D);x.ln=x.med-R,x.un=x.med+R,x.pts2=I.filter(O),m.push(x)}!function(t,e){if(i.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(m[0].t={num:d[y],dPos:A,posLetter:p,valLetter:f,labels:{med:a(t,"median:"),min:a(t,"min:"),q1:a(t,"q1:"),q3:a(t,"q3:"),max:a(t,"max:"),mean:"sd"===e.boxmean?a(t,"mean ± σ:"):a(t,"mean:"),lf:a(t,"lower fence:"),uf:a(t,"upper fence:")}},d[y]++,m):[{t:{empty:!0}}]}},{"../../lib":703,"../../plots/cartesian/axes":751,"fast-isnumeric":224}],866:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../plots/cartesian/axis_ids").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,u,c=e.calcdata,f=e._fullLayout,h=o._id,p=h.charAt(0),d=[],v=0;for(s=0;s1,_=1-f[t+"gap"],w=1-f[t+"groupgap"];for(s=0;s0;if("positive"===I?(E=k*(O?1:.5),N=G,S=N=T):"negative"===I?(E=N=T,S=k*(O?1:.5),j=G):(E=S=k,N=j=G),Y){var X=C.pointpos,Z=C.jitter,$=C.marker.size/2,J=0;X+Z>=0&&((J=G*(X+Z))>E?(W=!0,H=$,V=J):J>N&&(H=$,V=E)),J<=E&&(V=E);var K=0;X-Z<=0&&((K=-G*(X-Z))>S?(W=!0,q=$,U=K):K>j&&(q=$,U=S)),K<=S&&(U=S)}else V=E,U=S;var Q=new Array(u.length);for(l=0;lt.lo&&(_.so=!0)}return a});d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(a.translatePoints,l,u)}function c(t,e,r,a){var o,s,l=e.pos,u=e.val,c=a.bPos,f=a.bPosPxOffset||0,h=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var p=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each(function(t){var e=l.c2p(t.pos+c,!0)+f,i=l.c2p(t.pos+c-o,!0)+f,a=l.c2p(t.pos+c+s,!0)+f,p=u.c2p(t.mean,!0),d=u.c2p(t.mean-t.sd,!0),v=u.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+p+","+i+"V"+a+("sd"===h?"m0,0L"+d+","+e+"L"+p+","+i+"L"+v+","+e+"Z":"")):n.select(this).attr("d","M"+i+","+p+"H"+a+("sd"===h?"m0,0L"+e+","+d+"L"+i+","+p+"L"+e+","+v+"Z":""))})}e.exports={plot:function(t,e,r,a){var o=e.xaxis,s=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each(function(t){var r,i,a=n.select(this),f=t[0],h=f.t,p=f.trace;e.isRangePlot||(f.node3=a),h.wdPos=h.bdPos*p.whiskerwidth,!0!==p.visible||h.empty?a.remove():("h"===p.orientation?(r=s,i=o):(r=o,i=s),l(a,{pos:r,val:i},p,h),u(a,{x:o,y:s},p,h),c(a,{pos:r,val:i},p,h))})},plotBoxAndWhiskers:l,plotPoints:u,plotBoxMean:c}},{"../../components/drawing":601,"../../lib":703,d3:157}],874:[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,P=L>0?Math.ceil:Math.floor,D=L>0?Math.min:Math.max,z=L>0?Math.max:Math.min,R=I(S+O),F=P(C-O),B=[[f=E(S)]];for(a=R;a*L=0;i--)a[c-i]=t[f][i],o[c-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:u}),s}},{}],888:[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,u,c,f,h,p,d,v,g,m,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],k=b._boundarylines=[],A=t["_"+r],T=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var M=t._xctrl,E=t._yctrl,S=M[0].length,C=M.length,L=t._a.length,O=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function P(n){var i,a,o,s,l,u,c,f,p,d,v,g,m=[],y=[],x={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(O-2,a))),s=a-o,x.length=O,x.crossLength=L,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),m.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),m.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),m.push(f[0]),y.push(f[1]),l=f;else for(i=t.a2i(n),u=Math.floor(Math.max(0,Math.min(L-2,i))),c=i-u,x.length=L,x.crossLength=O,x.xy=function(e){return t.evalxy([],i,e)},x.dxy=function(e,r){return t.dxydj([],u,e,c,r)},a=0;a0&&(v=t.dxydj([],u,a-1,c,0),m.push(l[0]+v[0]/3),y.push(l[1]+v[1]/3),g=t.dxydj([],u,a-1,c,1),m.push(f[0]-g[0]/3),y.push(f[1]-g[1]/3)),m.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=e,x.axis=b,x.crossAxis=T,x.value=n,x.constvar=r,x.index=h,x.x=m,x.y=y,x.smoothing=T.smoothing,x}function D(n){var i,a,o,s,l,u=[],c=[],f={};if(f.length=x.length,f.crossLength=A.length,"b"===e)for(o=Math.max(0,Math.min(O-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(D(o),{color:b.gridcolor,width:b.gridwidth}));for(h=c;hx.length-1||v<0||v>x.length-1))for(g=x[s],m=x[v],a=0;ax[x.length-1]||w.push(i(P(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&k.push(i(D(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(D(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=[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}),c=u[0],f=u[1],h=c;h<=f;h++)p=b.tick0+b.dtick*h,_.push(i(P(p),{color:b.gridcolor,width:b.gridwidth}));for(h=c-1;hx[x.length-1]||w.push(i(P(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&k.push(i(P(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(P(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":693,"../../plots/cartesian/axes":751}],889:[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:u}}},{}],903:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),u=t("../../lib"),c=t("../../constants/alignment");function f(t,e,r,i,s,l){var u="const-"+s+"-lines",c=r.selectAll("."+u).data(l);c.enter().append("path").classed(u,!0).style("vector-effect","non-scaling-stroke"),c.each(function(r){var i=r,s=i.x,l=i.y,u=a([],s,t.c2p),c=a([],l,e.c2p),f="M"+o(u,c,i.smoothing),h=n.select(this);h.attr("d",f).style("stroke-width",i.width).style("stroke",i.color).style("fill","none")}),c.exit().remove()}function h(t,e,r,a,o,u,c,f){var h=u.selectAll("text."+f).data(c);h.enter().append("text").classed(f,!0);var p=0,d={};return h.each(function(o,u){var c;if("auto"===o.axis.tickangle)c=s(a,e,r,o.xy,o.dxy);else{var f=(o.axis.tickangle+180)*Math.PI/180;c=s(a,e,r,o.xy,[Math.cos(f),Math.sin(f)])}u||(d={angle:c.angle,flip:c.flip});var h=(o.endAnchor?-1:1)*c.flip,v=n.select(this).attr({"text-anchor":h>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),g=i.bBox(this);v.attr("transform","translate("+c.p[0]+","+c.p[1]+") rotate("+c.angle+")translate("+o.axis.labelpadding*h+","+.3*g.height+")"),p=Math.max(p,g.width+o.axis.labelpadding)}),h.exit().remove(),d.maxExtent=p,d}e.exports=function(t,e,r,i){var l=e.xaxis,c=e.yaxis,p=t._fullLayout,d=p._clips;u.makeTraceGroups(i,r,"trace").each(function(e){var r=n.select(this),i=e[0],p=i.trace,g=p.aaxis,m=p.baxis,y=u.ensureSingle(r,"g","minorlayer"),x=u.ensureSingle(r,"g","majorlayer"),b=u.ensureSingle(r,"g","boundarylayer"),_=u.ensureSingle(r,"g","labellayer");r.style("opacity",p.opacity),f(l,c,x,0,"a",g._gridlines),f(l,c,x,0,"b",m._gridlines),f(l,c,y,0,"a",g._minorgridlines),f(l,c,y,0,"b",m._minorgridlines),f(l,c,b,0,"a-boundary",g._boundarylines),f(l,c,b,0,"b-boundary",m._boundarylines);var w=h(t,l,c,p,0,_,g._labels,"a-label"),k=h(t,l,c,p,0,_,m._labels,"b-label");!function(t,e,r,n,i,a,o,l){var c,f,h,p,d=u.aggNums(Math.min,null,r.a),g=u.aggNums(Math.max,null,r.a),m=u.aggNums(Math.min,null,r.b),y=u.aggNums(Math.max,null,r.b);c=.5*(d+g),f=m,h=r.ab2xy(c,f,!0),p=r.dxyda_rough(c,f),void 0===o.angle&&u.extendFlat(o,s(r,i,a,h,r.dxydb_rough(c,f))),v(t,e,r,0,h,p,r.aaxis,i,a,o,"a-title"),c=d,f=.5*(m+y),h=r.ab2xy(c,f,!0),p=r.dxydb_rough(c,f),void 0===l.angle&&u.extendFlat(l,s(r,i,a,h,r.dxyda_rough(c,f))),v(t,e,r,0,h,p,r.baxis,i,a,l,"b-title")}(t,_,p,0,l,c,w,k),function(t,e,r,n,i){var s,l,c,f,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var p=u.ensureSingle(h,"path","carpetboundary"),d=e.clipsegments,v=[];for(f=0;f90&&m<270,b=n.select(this);b.text(c.title.text).call(l.convertToTspans,t),y&&(x=(-l.lineCount(b)+d)*p*a-x),b.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+x+")").classed("user-select-none",!0).attr("text-anchor","middle").call(i.font,c.title.font)}),y.exit().remove()}},{"../../components/drawing":601,"../../constants/alignment":675,"../../lib":703,"../../lib/svg_text_utils":727,"./makepath":900,"./map_1d_array":901,"./orient_text":902,d3:157}],904:[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,u=e.length,c=r.length,f=t.aaxis,h=t.baxis,p=e[0],d=e[u-1],v=r[0],g=r[c-1],m=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=m*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,v-=b,g+=b,t.isVisible=function(t,e){return t>p&&tv&&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],u,c,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]),u-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]),u-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),u-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(u-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),c-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(c-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[u-1]|ir[c-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,v=0,g=0,m=[];ne[u-1]?(f=u-2,h=1,v=(n-e[u-1])/(e[u-1]-e[u-2])):(f=Math.max(0,Math.min(u-2,Math.floor(o))),h=o-f),ir[c-1]?(p=c-2,d=1,g=(i-r[c-1])/(r[c-1]-r[c-2])):(p=Math.max(0,Math.min(c-2,Math.floor(s))),d=s-p),v&&(t.dxydi(m,f,p,h,d),l[0]+=m[0]*v,l[1]+=m[1]*v),g&&(t.dxydj(m,f,p,h,d),l[0]+=m[0]*g,l[1]+=m[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=m*(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":722,"./compute_control_points":892,"./constants":893,"./create_i_derivative_evaluator":894,"./create_j_derivative_evaluator":895,"./create_spline_evaluator":896}],905:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],u=t[0].length,c=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",A,"after",T,"iterations"),t}},{"../../lib":703}],906:[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":703}],907:[function(t,e,r){"use strict";var n=t("../../components/fx/hovertemplate_attributes"),i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=i.marker.line;e.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},text:s({},i.text,{}),hovertext:s({},i.hovertext,{}),marker:{line:{color:l.color,width:s({},l.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:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n()},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../scattergeo/attributes":1114}],908:[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");e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=0;u")}}(t,f,o,h.mockAxis),[t]}},{"../../lib":703,"../../plots/cartesian/axes":751,"./attributes":907}],912:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),plot:t("./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"],meta:{}}},{"../../plots/geo":781,"../heatmap/colorbar":975,"./attributes":907,"./calc":908,"./defaults":909,"./event_data":910,"./hover":911,"./plot":913,"./select":914,"./style":915}],913:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../lib/polygon"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("./style").style;function u(t,e){for(var r=t[0].trace,n=t.length,i=o(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===l||"FJI"===l?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 o=a.tester(r);o.pts.pop(),u.push(o)}:function(t){u.push(a.tester(t))},o.type){case"MultiPolygon":for(r=0;r":f.value>h&&(s.prefixBoundary=!0);break;case"<":f.valueh)&&(s.prefixBoundary=!0);break;case"][":a=Math.min.apply(null,f.value),o=Math.max.apply(null,f.value),ah&&(s.prefixBoundary=!0)}}},{}],924:[function(t,e,r){"use strict";var n=t("../../components/colorscale").extractOpts,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,u=o.coloring,c=i(e,{isColorbar:!0});if("heatmap"===u){var f=n(e);r._fillgradient=e.colorscale,r._zrange=[f.min,f.max]}else"fill"===u&&(r._fillcolor=c);r._line={color:"lines"===u?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},{"../../components/colorscale":592,"./end_plus":932,"./make_color_map":937}],925:[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}}},{}],926:[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"),u=l.CONSTRAINT_REDUCTION,c=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,f){var h,p,d,v=e.contours,g=r("contours.operation");if(v._operation=u[g],function(t,e){var r;-1===c.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,v),"="===g?h=v.showlines=!0:(h=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),h){var m=d&&s(d)?o(e.fillcolor,1):l;p=r("line.color",m),r("line.width",2),r("line.dash")}r("line.smoothing"),i(r,a,p,f)}},{"../../components/color":580,"../../constants/filter_ops":676,"./label_defaults":936,"fast-isnumeric":224}],927:[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":676,"fast-isnumeric":224}],928:[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")}},{}],929:[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)})}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":703,"./constraint_mapping":927,"./end_plus":932}],932:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],933:[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,[n,a]}(h,r,e),d=[s(t,e,[-p[0],-p[1]])],v=p.join(","),g=t.z.length,m=t.z[0].length;for(u=0;u<1e4;u++){if(h>20?(h=i.CHOOSESADDLE[h][(p[0]||p[1])<0?0:1],t.crossings[f]=i.SADDLEREMAINDER[h]):delete t.crossings[f],!(p=i.NEWDELTA[h])){n.log("Found bad marching index:",h,e,t.level);break}d.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],a(d[d.length-1],d[d.length-2],o,l)&&d.pop(),f=e.join(",");var y=p[0]&&(e[0]<0||e[0]>m-2)||p[1]&&(e[1]<0||e[1]>g-2),x=f===c&&p.join(",")===v;if(x||r&&y)break;h=t.crossings[f]}1e4===u&&n.log("Infinite loop in contour?");var b,_,w,k,A,T,M,E,S,C,L,O,I,P,D,z=a(d[0],d[d.length-1],o,l),R=0,F=.2*t.smoothing,B=[],N=0;for(u=1;u=N;u--)if((b=B[u])=N&&b+B[_]E&&S--,t.edgepaths[S]=L.concat(d,C));break}H||(t.edgepaths[E]=d.concat(C))}for(E=0;Et?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}e.exports=function(t){var e,r,a,o,s,l,u,c,f,h=t[0].z,p=h.length,d=h[0].length,v=2===p||2===d;for(r=0;rt.level}return r?"M"+e.join("L")+"Z":""}(t,e),h=0,p=t.edgepaths.map(function(t,e){return e}),d=!0;function v(t){return Math.abs(t[1]-e[2][1])<.01}function g(t){return Math.abs(t[0]-e[0][0])<.01}function m(t){return Math.abs(t[0]-e[2][0])<.01}for(;p.length;){for(u=a.smoothopen(t.edgepaths[h],t.smoothing),f+=d?u:u.replace(/^M/,"L"),p.splice(p.indexOf(h),1),r=t.edgepaths[h][t.edgepaths[h].length-1],s=-1,o=0;o<4;o++){if(!r){i.log("Missing end?",h,t);break}for(c=r,Math.abs(c[1]-e[0][1])<.01&&!m(r)?n=e[1]:g(r)?n=e[0]:v(r)?n=e[3]:m(r)&&(n=e[2]),l=0;l=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)/(c+Math.abs(Math.sin(u)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(u)*o);if(h<1||p<1)return 1/0;var d=g.EDGECOST*(1/(h-1)+1/(p-1));d+=g.ANGLECOST*u*u;for(var v=s-c,m=l-f,y=s+c,x=l+f,b=0;b2*g.MAXCOST)break;p&&(s/=2),l=(o=u-s/2)+1.5*s}if(h<=g.MAXCOST)return c},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,u=Math.sin(l),c=Math.cos(l),f=i*c,h=a*u,p=i*u,d=-a*c,v=[[o-f-h,s-p-d],[o+f-h,s+p-d],[o+f+h,s+p+d],[o-f+h,s-p+d]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(v)},r.drawLabels=function(t,e,r,a,s){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(o.convertToTspans,r)}),s){for(var u="",c=0;cr.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 u,c=r.start,f=r.end,h=t._input.contours;c>f&&(r.start=h.start=f,f=r.end=h.end=c,c=r.start),r.size>0||(u=c===f?1:a(c,f,t.ncontours).dtick,h.size=r.size=u)}}},{"../../lib":703,"../../plots/cartesian/axes":751}],941:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",function(t){return t[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,u=a.start,c="constraint"===a.type,f=!c&&"lines"===a.coloring,h=!c&&"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)})}),c)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(h){var v;e.selectAll("g.contourfill path").style("fill",function(t){return void 0===v&&(v=t.level),p(t.level+.5*l)}),void 0===v&&(v=u),e.selectAll("g.contourbg path").style("fill",p(v-.5*l))}}),a(t)}},{"../../components/drawing":601,"../heatmap/style":984,"./make_color_map":937,d3:157}],942:[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"),u="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(u=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,u,o)}},{"../../components/colorscale/defaults":590,"./label_defaults":936}],943:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=i.contours,o=t("../scatter/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,u=o.line;e.exports=l({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:a.type,start:a.start,end:a.end,size:a.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:a.showlines,showlabels:a.showlabels,labelfont:a.labelfont,labelformat:a.labelformat,operation:a.operation,value:a.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:l({},u.color,{}),width:u.width,dash:u.dash,smoothing:l({},u.smoothing,{}),editType:"plot"},transforms:void 0},s("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":587,"../../lib/extend":693,"../contour/attributes":921,"../heatmap/attributes":972,"../scatter/attributes":1075}],944:[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"),u=t("../heatmap/make_bound_array"),c=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),c(d,e,e._defaultColor,t._fullLayout)}var v=function(t,e){var r,c,f,h,p,d,v,g=e._carpetTrace,m=g.aaxis,y=g.baxis;m._minDtick=0,y._minDtick=0,i.isArray1D(e.z)&&a(e,m,y,"a","b",["z"]),r=e._a=e._a||e.a,h=e._b=e._b||e.b,r=r?m.makeCalcdata(e,"_a"):[],h=h?y.makeCalcdata(e,"_b"):[],c=e.a0||0,f=e.da||1,p=e.b0||0,d=e.db||1,v=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(v),s(v,e._emptypoints);var x=i.maxRowLength(v),b="scaled"===e.xtype?"":r,_=u(e,b,c,f,x,m),w="scaled"===e.ytype?"":h,k=u(e,w,p,d,v.length,y),A={a:_,b:k,z:v};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:v,containerStr:"",cLetter:"z"}),[A]}(t,e);return h(e,e._z),v}}},{"../../components/colorscale/calc":588,"../../lib":703,"../carpet/lookup_carpetid":899,"../contour/set_contours":940,"../heatmap/clean_2d_array":974,"../heatmap/convert_column_xyz":976,"../heatmap/find_empties":978,"../heatmap/interp2d":981,"../heatmap/make_bound_array":982,"./defaults":945}],945:[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,u){function c(r,i){return n.coerce(t,e,a,r,i)}if(c("carpet"),t.a&&t.b){var f=i(t,e,c,u,"a","b");if(!f)return void(e.visible=!1);c("text");var h="constraint"===c("contours.type");h?o(t,e,c,u,r,{hasHover:!1}):(s(t,e,c,function(r){return n.coerce2(t,e,a,r)}),l(t,e,c,u,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":703,"../contour/constraint_defaults":926,"../contour/contours_defaults":928,"../contour/style_defaults":942,"../heatmap/xyz_defaults":986,"./attributes":943}],946:[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"],meta:{}}},{"../../plots/cartesian":762,"../contour/colorbar":924,"../contour/style":941,"./attributes":943,"./calc":944,"./defaults":945,"./plot":949}],947:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,u,c){var f,h,p,d,v,g,m,y="",x=e.edgepaths.map(function(t,e){return e}),b=!0,_=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function k(t){return Math.abs(t[1]-r[0][1])=0&&(p=C,v=g):Math.abs(h[1]-p[1])=0&&(p=C,v=g):a.log("endpt to newendpt is not vert. or horz.",h,p,C)}if(v>=0)break;y+=E(h,p),h=p}if(v===e.edgepaths.length){a.log("unclosed perimeter path");break}f=v,(b=-1===x.indexOf(f))&&(f=x[0],y+=E(h,p)+"Z",h=null)}for(f=0;f=0;V--)B=E.clipsegments[V],N=i([],B.x,w.c2p),j=i([],B.y,k.c2p),N.reverse(),j.reverse(),H.push(a(N,j,B.bicubic));var q="M"+H.join("L")+"Z";!function(t,e,r,n,o,l){var u,c,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;hv&&(n.max=v),n.len=n.max-n.min}function g(t,e){var r,n=0;return(Math.abs(t[0]-l)<.1||Math.abs(t[0]-u)<.1)&&(r=x(i.dxydb_rough(t[0],t[1],.1)),n=Math.max(n,a*b(e,r)/2)),(Math.abs(t[1]-c)<.1||Math.abs(t[1]-f)<.1)&&(r=x(i.dxyda_rough(t[0],t[1],.1)),n=Math.max(n,a*b(e,r)/2)),n}}(this,r,t,n,u,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/I),f.LABELMAX),a=0;a"),s.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;return n(i)?i:n(a)&&o?a:void 0}(u,h),[s]}}},{"../../components/color":580,"../../lib":703,"../bar/hover":847}],958:[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":762,"../bar/select":852,"./attributes":951,"./calc":952,"./cross_trace_calc":954,"./defaults":955,"./event_data":956,"./hover":957,"./layout_attributes":959,"./layout_defaults":960,"./plot":961,"./style":962}],959:[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"}}},{}],960:[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?.3:1)}}),o(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":580,"../../components/drawing":601,"../bar/style":854,d3:157}],963:[function(t,e,r){"use strict";var n=t("../pie/attributes"),i=t("../../plots/attributes"),a=t("../../plots/domain").attributes,o=t("../../components/fx/hovertemplate_attributes"),s=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: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"]}),hoverinfo:s({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),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: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"}}},{"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../../plots/domain":776,"../pie/attributes":1049}],964:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/get_data").getModuleCalcData;r.name="funnelarea",r.plot=function(t){var e=n.getModule("funnelarea"),r=i(t.calcdata,e)[0];e.plot(t,r)},r.clean=function(t,e,r,n){var i=n._has&&n._has("funnelarea"),a=e._has&&e._has("funnelarea");i&&!a&&n._funnelarealayer.selectAll("g.trace").remove()}},{"../../plots/get_data":786,"../../registry":831}],965:[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":1051}],966:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText;e.exports=function(t,e,r,s){function l(r,a){return n.coerce(t,e,i,r,a)}var u,c=l("values"),f=n.isArrayOrTypedArray(c),h=l("labels");if(Array.isArray(h)?(u=h.length,f&&(u=Math.min(u,c.length))):f&&(u=c.length,l("label0"),l("dlabel")),u){e._length=u;var p=l("marker.line.width");p&&l("marker.line.color",s.paper_bgcolor),l("marker.colors"),l("scalegroup");var d=l("text"),v=l("textinfo",Array.isArray(d)?"text+percent":"percent");if(l("hovertext"),l("hovertemplate"),v&&"none"!==v){var g=l("textposition");o(t,e,s,l,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(e,s,l);var m=l("title.text");m&&(l("title.position"),n.coerceFont(l,"title.font",s.font)),l("aspectratio"),l("baseratio")}else e.visible=!1}},{"../../lib":703,"../../plots/domain":776,"../bar/defaults":845,"./attributes":963}],967:[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":1060,"./attributes":963,"./base_plot":964,"./calc":965,"./defaults":966,"./layout_attributes":968,"./layout_defaults":969,"./plot":970,"./style":971}],968:[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":1056}],969:[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":703,"./layout_attributes":968}],970:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../lib"),o=t("../../lib/svg_text_utils"),s=t("../bar/plot"),l=s.getTransformToMoveInsideBar,u=t("../pie/helpers"),c=t("../pie/plot"),f=c.attachFxHandlers,h=c.determineInsideTextFont,p=c.layoutAreas,d=c.prerenderTitles,v=c.positionTitleOutside;function g(t,e){var r=e[0]-t[0],n=e[1]-t[1];return"l"+r+","+n}e.exports=function(t,e){var r=t._fullLayout;d(e,t),p(e,r._size),a.makeTraceGroups(r._funnelarealayer,e,"trace").each(function(e){var s=n.select(this),c=e[0],p=c.trace;!function(t){if(t.length){var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),u=e.vTotal,c=u,f=u*l/(1-l)/u,h=[];for(h.push(S()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var p=s.v/c;f+=p,h.push(S())}var d=1/0,v=-1/0;for(o=0;o-1;o--)if(!(s=t[o]).hidden){var M=h[T+=1][0],E=h[T][1];s.TL=[-M,E],s.TR=[M,E],s.BL=k,s.BR=A,s.pxmid=(_=s.TR,w=s.BR,[.5*(_[0]+w[0]),.5*(_[1]+w[1])]),k=s.TL,A=s.TR}}function S(){var t,e={x:t=Math.sqrt(f),y:-t};return[e.x,e.y]}}(e),s.each(function(){var s=n.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove(),s.each(function(r){if(r.hidden)n.select(this).selectAll("path,g").remove();else{r.pointNumber=r.i,r.curveNumber=p.index;var s=c.cx,d=c.cy,v=n.select(this),m=v.selectAll("path.surface").data([r]);m.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),v.call(f,t,e);var y="M"+(s+r.TR[0])+","+(d+r.TR[1])+g(r.TR,r.BR)+g(r.BR,r.BL)+g(r.BL,r.TL)+"Z";m.attr("d",y);var x=u.castOption(p.textposition,r.pts),b=v.selectAll("g.slicetext").data(r.text&&"none"!==x?[0]:[]);b.enter().append("g").classed("slicetext",!0),b.exit().remove(),b.each(function(){var e=a.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)});e.text(r.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,h(p,r,t._fullLayout.font)).call(o.convertToTspans,t);var u,c,f,v=i.bBox(e.node()),g=Math.min(r.BL[1],r.BR[1]),m=Math.max(r.TL[1],r.TR[1]);c=Math.max(r.TL[0],r.BL[0]),f=Math.min(r.TR[0],r.BR[0]),u=l(c,f,g,m,v,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),e.attr("transform","translate("+s+","+d+")"+u)})}});var d=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);d.enter().append("g").classed("titletext",!0),d.exit().remove(),d.each(function(){var e=a.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),s=p.title.text;p._meta&&(s=a.templateString(s,p._meta)),e.text(s).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,p.title.font).call(o.convertToTspans,t);var l=v(c,r._size);e.attr("transform","translate("+l.x+","+l.y+")"+(l.scale<1?"scale("+l.scale+")":"")+"translate("+l.tx+","+l.ty+")")})})})}},{"../../components/drawing":601,"../../lib":703,"../../lib/svg_text_utils":727,"../bar/plot":851,"../pie/helpers":1054,"../pie/plot":1058,d3:157}],971:[function(t,e,r){"use strict";var n=t("d3"),i=t("../pie/style_one");e.exports=function(t){t._fullLayout._funnelarealayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"../pie/style_one":1060,d3:157}],972:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/fx/hovertemplate_attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({z:{valType:"data_array",editType:"calc"},x:o({},n.x,{impliedEdits:{xtype:"array"}}),x0:o({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:o({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:o({},n.y,{impliedEdits:{ytype:"array"}}),y0:o({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:o({},n.dy,{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"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:i()},{transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../scatter/attributes":1075}],973:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),l=t("./convert_column_xyz"),u=t("./clean_2d_array"),c=t("./interp2d"),f=t("./find_empties"),h=t("./make_bound_array");e.exports=function(t,e){var r,p,d,v,g,m,y,x,b,_=a.getFromId(t,e.xaxis||"x"),w=a.getFromId(t,e.yaxis||"y"),k=n.traceIs(e,"contour"),A=n.traceIs(e,"histogram"),T=n.traceIs(e,"gl2d"),M=k?"best":e.zsmooth;if(_._minDtick=0,w._minDtick=0,A)b=o(t,e),r=b.x,p=b.x0,d=b.dx,v=b.y,g=b.y0,m=b.dy,y=b.z;else{var E=e.z;i.isArray1D(E)?(l(e,_,w,"x","y",["z"]),r=e._x,v=e._y,E=e._z):(r=e._x=e.x?_.makeCalcdata(e,"x"):[],v=e._y=e.y?w.makeCalcdata(e,"y"):[]),p=e.x0,d=e.dx,g=e.y0,m=e.dy,y=u(E,e,_,w),(k||e.connectgaps)&&(e._emptypoints=f(y),c(y,e._emptypoints))}function S(t){M=e._input.zsmooth=e.zsmooth=!1,i.warn('cannot use zsmooth: "fast": '+t)}if("fast"===M)if("log"===_.type||"log"===w.type)S("log axis found");else if(!A){if(r.length){var C=(r[r.length-1]-r[0])/(r.length-1),L=Math.abs(C/100);for(x=0;xL){S("x scale is not linear");break}}if(v.length&&"fast"===M){var O=(v[v.length-1]-v[0])/(v.length-1),I=Math.abs(O/100);for(x=0;xI){S("y scale is not linear");break}}}var P=i.maxRowLength(y),D="scaled"===e.xtype?"":r,z=h(e,D,p,d,P,_),R="scaled"===e.ytype?"":v,F=h(e,R,g,m,y.length,w);T||(e._extremes[_._id]=a.findExtremes(_,z),e._extremes[w._id]=a.findExtremes(w,F));var B={x:z,y:F,z:y,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(D&&D.length===z.length-1&&(B.xCenter=D),R&&R.length===F.length-1&&(B.yCenter=R),A&&(B.xRanges=b.xRanges,B.yRanges=b.yRanges,B.pts=b.pts),k||s(t,e,{vals:y,cLetter:"z"}),k&&e.contours&&"heatmap"===e.contours.coloring){var N={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};B.xfill=h(N,D,p,d,P,_),B.yfill=h(N,R,g,m,y.length,w)}return[B]}},{"../../components/colorscale/calc":588,"../../lib":703,"../../plots/cartesian/axes":751,"../../registry":831,"../histogram2d/calc":1004,"./clean_2d_array":974,"./convert_column_xyz":976,"./find_empties":978,"./interp2d":981,"./make_bound_array":982}],974:[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,u,c,f,h;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)a=h[o],r=a[0],i=a[1],(s=((f[[r-1,i]]||v)[2]+(f[[r+1,i]]||v)[2]+(f[[r,i-1]]||v)[2]+(f[[r,i+1]]||v)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{"../../lib":703}],979:[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,u){var c,f,h,p,d=t.cd[0],v=d.trace,g=t.xa,m=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,k=d.zmask,A=v.zhoverformat,T=y,M=x;if(!1!==t.index){try{h=Math.round(t.index[1]),p=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||p<0||p>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(u){var E;for(T=[2*y[0]-y[1]],E=1;Ev&&(m=Math.max(m,Math.abs(t[a][o]-d)/(g-v))))}return m}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":703}],982:[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,u,c,f=[],h=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d"),v=i(e)&&e.length>1;if(v&&!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]],c=1;c0;)h=p.c2p(k[y]),y--;for(h0;)m=d.c2p(A[y]),y--;if(m0&&(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]u?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:u: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),u=d(r,a,s),c=t===i?0:1;return l[c]!==u[c]}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,u=-1.1*e,h=-.1*e,p=t-h,d=r[0],v=r[1],g=Math.min(f(d+h,d+p,n,a),f(v+h,v+p,n,a)),m=Math.min(f(d+u,d+h,n,a),f(v+u,v+h,n,a));if(g>m&&mo){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 u=n.d2c(o,0,a);if(ur.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,p)),D.start=r.l2r(j),F||i.nestedProperty(e,m+".start").set(D.start)}var V=b.end,U=r.r2l(P.end),H=void 0!==U;if((b.endFound||H)&&U!==r.r2l(V)){var q=H?U:i.aggNums(Math.max,null,d);D.end=r.l2r(q),H||i.nestedProperty(e,m+".start").set(D.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[m]=i.extendFlat({},e[m]||{}),delete e._input[G],delete e[G]),[D,d]}e.exports={calc:function(t,e){var r,a,p,d,v=[],g=[],m=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,m,y),k=w[0],A=w[1],T="string"==typeof k.size,M=[],E=T?M:k,S=[],C=[],L=[],O=0,I=e.histnorm,P=e.histfunc,D=-1!==I.indexOf("density");_.enabled&&D&&(I=I.replace(/ ?density$/,""),D=!1);var z,R="max"===P||"min"===P?null:0,F=l.count,B=u[I],N=!1,j=function(t){return m.r2c(t,0,b)};for(i.isArrayOrTypedArray(e[x])&&"count"!==P&&(z=e[x],N="avg"===P,F=l[P]),r=j(k.start),p=j(k.end)+(r-o.tickIncrement(r,k.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 X=Math.min(v.length,g.length),Z=[],$=0,J=X-1;for(r=0;r=$;r--)if(g[r]){J=r;break}for(r=$;r<=J;r++)if(n(v[r])&&n(g[r])){var K={p:v[r],s:g[r],b:0};_.enabled||(K.pts=L[r],H?K.ph0=K.ph1=L[r].length?A[L[r][0]]:v[r]:(K.ph0=V(M[r]),K.ph1=V(M[r+1],!0))),Z.push(K)}return 1===Z.length&&(Z[0].width1=o.tickIncrement(Z[0].p,k.size,!1,b)-Z[0].p),s(Z,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(Z,e,W),Z},calcAllAutoBins:h}},{"../../lib":703,"../../plots/cartesian/axes":751,"../../registry":831,"../bar/arrays_to_calcdata":840,"./average":991,"./bin_functions":993,"./bin_label_vals":994,"./norm_functions":1002,"fast-isnumeric":224}],996:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],997:[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=i.getAxisGroup,u=[{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"}],c=["x","y"];e.exports=function(t,e){var r,f,h,p,d,v,g,m=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 k(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"],u=m[r],c=!0;u&&(s===u.axType&&l===u.calendar?(c=!1,u.traces.push(t),u.dirs.push(a)):(r=o,s!==u.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+u.axType,"axis."].join(" ")),l!==u.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",u.calendar?"on a "+u.calendar+" calendar":"w/o a set calendar"].join(" ")))),c&&(m[r]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=r}for(d=0;dE&&k.splice(E,k.length-E),M.length>E&&M.splice(E,M.length-E);var S=[],C=[],L=[],O="string"==typeof w.size,I="string"==typeof T.size,P=[],D=[],z=O?P:w,R=I?D:T,F=0,B=[],N=[],j=e.histnorm,V=e.histfunc,U=-1!==j.indexOf("density"),H="max"===V||"min"===V,q=H?null:0,G=a.count,W=o[j],Y=!1,X=[],Z=[],$="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";$&&"count"!==V&&(Y="avg"===V,G=a[V]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-i.tickIncrement(K,J,!1,m))/1e6;for(r=K;r=0&&p=0&&d0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function z(t,e){return null===t?e:t}function R(e,r,n){C();var i,a,o,s=[r],l=[n];if(k>=1)s=[r],l=[n];else if(k>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]:S(d,v,g);h[p]=y>-1?y:O(d,v,g,z(e,m))}i=h[0],a=h[1],o=h[2],t._i.push(i),t._j.push(a),t._k.push(o),++f}}function F(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 N(t){var e=.001*(E-M);return t>=M-e&&t<=E+e}function j(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}var V=3;function U(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 N(e[0][3])&&N(e[1][3])&&N(e[2][3])?(R(t,e,r),!0):aC?[A,k]:[k,T];Q(e,I[0],I[1])}}var D=[[Math.min(M,T),Math.max(M,T)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach(function(e){for(var r=[],n=0;n0&&(u.push(x.id),"x"===e?f.push([x.distRatio,0,0]):"y"===e?f.push([0,x.distRatio,0]):f.push([0,0,x.distRatio]))}else l=nt(1,"x"===e?v-1:"y"===e?g-1:m-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++),l.length>0&&(r[i]="x"===e?Z(null,l,a,o,r[i]):"y"===e?$(null,l,a,o,r[i]):J(null,l,a,o,r[i]),i++)}var b=t.caps[e];b.show&&b.fill&&(P(b.fill),r[i]="x"===e?Z(null,[0,v-1],a,o,r[i]):"y"===e?$(null,[0,g-1],a,o,r[i]):J(null,[0,m-1],a,o,r[i]),i++)}}),0===f&&L(),t._x=x,t._y=b,t._z=_,t._intensity=w,t._Xs=h,t._Ys=p,t._Zs=d}(),t}h.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._x[e],n=this.data._y[e],i=this.data._z[e],a=this.data._Ys.length,o=this.data._Zs.length,s=c(r,this.data._Xs).id,l=c(n,this.data._Ys).id,u=c(i,this.data._Zs).id,f=t.index=u+o*l+o*a*s;t.traceCoordinate=[this.data._x[f],this.data._y[f],this.data._z[f],this.data.value[f]];var h=this.data.hovertext||this.data.text;return Array.isArray(h)&&void 0!==h[f]?t.textLabel=h[f]:h&&(t.textLabel=h),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;function n(t,e,r,n){return e.map(function(e){return t.d2l(e,0,n)*r})}this.data=p(t);var i=l(n(r.xaxis,t._x,e.dataScale[0],t.xcalendar),n(r.yaxis,t._y,e.dataScale[1],t.ycalendar),n(r.zaxis,t._z,e.dataScale[2],t.zcalendar)),u=l(t._i,t._j,t._k),c={positions:i,cells:u,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:o(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},f=s(t);c.vertexIntensity=t._intensity,c.vertexIntensityBounds=[f.min,f.max],c.colormap=a(t),this.mesh.update(c)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports={findNearestOnAxis:c,generateIsoMeshes:p,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new f(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../components/colorscale":592,"../../lib":703,"../../lib/gl_format_color":700,"../../lib/str2rgbarray":726,"../../plots/gl3d/zip3":802,"gl-mesh3d":279}],1015:[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 u=a("x"),c=a("y"),f=a("z"),h=a("value");if(u&&u.length&&c&&c.length&&f&&f.length&&h&&h.length){var p=i.getComponentMethod("calendars","handleTraceDefaults");p(t,e,["x","y","z"],n),["x","y","z"].forEach(function(t){var e="caps."+t,r=a(e+".show");r&&a(e+".fill");var n="slices."+t,i=a(n+".show");i&&(a(n+".fill"),a(n+".locations"))});var d=a("spaceframe.show");d&&a("spaceframe.fill");var v=a("surface.show");v&&(a("surface.count"),a("surface.fill"),a("surface.pattern"));var g=a("contour.show");g&&(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}else e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,0,i,function(r,i){return n.coerce(t,e,a,r,i)})},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":590,"../../lib":703,"../../registry":831,"./attributes":1012}],1016:[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"],meta:{}}},{"../../plots/gl3d":791,"./attributes":1012,"./calc":1013,"./convert":1014,"./defaults":1015}],1017:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../components/fx/hovertemplate_attributes"),a=t("../surface/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({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"}),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",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:a.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},a.contours.x.show,{}),color:a.contours.x.color,width:a.contours.x.width,editType:"calc"},lightposition:{x:s({},a.lightposition.x,{dflt:1e5}),y:s({},a.lightposition.y,{dflt:1e5}),z:s({},a.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({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"},a.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"})})},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../surface/attributes":1171}],1018:[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":588}],1019:[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"),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 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.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(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=c(v(t.i),v(t.j),v(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;og):v=k>b,g=k;var A=l(b,_,w,k);A.pos=x,A.yc=(b+k)/2,A.i=y,A.dir=v?"increasing":"decreasing",A.x=A.pos,A.y=[w,_],p&&(A.tx=e.text[y]),d&&(A.htx=e.hovertext[y]),m.push(A)}else m.push({pos:x,empty:!0})}return e._extremes[s._id]=a.findExtremes(s,n.concat(f,c),{padded:!0}),m.length&&(m[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),m}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),o=function(t,e,r){var i=r._minDiff;if(!i){var a,o=t._fullData,s=[];for(i=1/0,a=0;a"+c.labels[k]+n.hoverLabelText(s,A):((w=i.extendFlat({},h)).y0=w.y1=T,w.yLabelVal=A,w.yLabel=c.labels[k]+n.hoverLabelText(s,A),w.name="",f.push(w),b[A]=w)}return f}function f(t,e,r,i){var a=t.cd,o=t.ya,c=a[0].trace,f=a[0].t,h=u(t,e,r,i);if(!h)return[];var p=h.index,d=a[p],v=h.index=d.i,g=d.dir;function m(t){return f.labels[t]+n.hoverLabelText(o,c[t][v])}var y=d.hi||c.hoverinfo,x=y.split("+"),b="all"===y,_=b||-1!==x.indexOf("y"),w=b||-1!==x.indexOf("text"),k=_?[m("open"),m("high"),m("low"),m("close")+" "+l[g]]:[];return w&&s(d,c,k),h.extraText=k.join("
"),h.y0=h.y1=o.c2p(d.yc,!0),[h]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?c(t,e,r,n):f(t,e,r,n)},hoverSplit:c,hoverOnPoints:f}},{"../../components/color":580,"../../components/fx":619,"../../lib":703,"../../plots/cartesian/axes":751}],1026:[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":762,"./attributes":1022,"./calc":1023,"./defaults":1024,"./hover":1025,"./plot":1028,"./select":1029,"./style":1030}],1027:[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"),u=r("low"),c=r("close");r("hoverlabel.split");var f=n.getComponentMethod("calendars","handleTraceDefaults");if(f(t,e,["x"],a),s&&l&&u&&c){var h=Math.min(s.length,l.length,u.length,c.length);return o&&(h=Math.min(h,i.minRowLength(o))),e._length=h,h}}},{"../../lib":703,"../../registry":831}],1028:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.xaxis,s=e.yaxis;i.makeTraceGroups(a,r,"trace ohlc").each(function(t){var r=n.select(this),a=t[0],l=a.t,u=a.trace;if(e.isRangePlot||(a.node3=r),!0!==u.visible||l.empty)r.remove();else{var c=l.tickLen,f=r.selectAll("path").data(i.identity);f.enter().append("path"),f.exit().remove(),f.attr("d",function(t){if(t.empty)return"M0,0Z";var e=o.c2p(t.pos,!0),r=o.c2p(t.pos-c,!0),n=o.c2p(t.pos+c,!0),i=s.c2p(t.o,!0),a=s.c2p(t.h,!0),l=s.c2p(t.l,!0),u=s.c2p(t.c,!0);return"M"+r+","+i+"H"+e+"M"+e+","+a+"V"+l+"M"+n+","+u+"H"+e})}})}},{"../../lib":703,d3:157}],1029:[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;u&&(o="array");var c=r("categoryorder",o);"array"===c?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),u||"array"!==c||(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:c}),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),u(e,p,"values",d),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var v={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(h,"labelfont",v);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":590,"../../components/colorscale/helpers":591,"../../lib":703,"../../plots/array_container_defaults":747,"../../plots/domain":776,"../parcoords/merge_length":1046,"./attributes":1031}],1035:[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":1031,"./base_plot":1032,"./calc":1033,"./defaults":1034,"./plot":1037}],1036:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plot_api/plot_api"),a=t("../../components/fx"),o=t("../../lib"),s=t("../../components/drawing"),l=t("tinycolor2"),u=t("../../lib/svg_text_utils");function c(t,e,r,i){var a=t.map(function(t,e,r){var n,i=r[0],a=e.margin||{l:80,r:80,t:100,b:80},o=i.trace,s=o.domain,l=e.width,u=e.height,c=Math.floor(l*(s.x[1]-s.x[0])),f=Math.floor(u*(s.y[1]-s.y[0])),h=s.x[0]*l+a.l,p=e.height-s.y[1]*e.height+a.t,d=o.line.shape;n="all"===o.hoverinfo?["count","probability"]:(o.hoverinfo||"").split("+");var v={trace:o,key:o.uid,model:i,x:h,y:p,width:c,height:f,hoveron:o.hoveron,hoverinfoItems:n,arrangement:o.arrangement,bundlecolors:o.bundlecolors,sortpaths:o.sortpaths,labelfont:o.labelfont,categorylabelfont:o.tickfont,pathShape:d,dragDimension:null,margin:a,paths:[],dimensions:[],graphDiv:t,traceSelection:null,pathSelection:null,dimensionSelection:null};return i.dimensions&&(R(v),z(v)),v}.bind(0,e,r)),l=i.selectAll("g.parcatslayer").data([null]);l.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var c=l.selectAll("g.trace.parcats").data(a,f),g=c.enter().append("g").attr("class","trace parcats");c.attr("transform",function(t){return"translate("+t.x+", "+t.y+")"}),g.append("g").attr("class","paths");var x=c.select("g.paths"),w=x.selectAll("path.path").data(function(t){return t.paths},f);w.attr("fill",function(t){return t.model.color});var k=w.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(t){return t.model.color}).attr("fill-opacity",0);y(k),w.attr("d",function(t){return t.svgD}),k.empty()||w.sort(p),w.exit().remove(),w.on("mouseover",d).on("mouseout",v).on("click",m),g.append("g").attr("class","dimensions");var A=c.select("g.dimensions"),T=A.selectAll("g.dimension").data(function(t){return t.dimensions},f);T.enter().append("g").attr("class","dimension"),T.attr("transform",function(t){return"translate("+t.x+", 0)"}),T.exit().remove();var O=T.selectAll("g.category").data(function(t){return t.categories},f),I=O.enter().append("g").attr("class","category");O.attr("transform",function(t){return"translate(0, "+t.y+")"}),I.append("rect").attr("class","catrect").attr("pointer-events","none"),O.select("rect.catrect").attr("fill","none").attr("width",function(t){return t.width}).attr("height",function(t){return t.height}),b(I);var P=O.selectAll("rect.bandrect").data(function(t){return t.bands},f);P.each(function(){o.raiseToTop(this)}),P.attr("fill",function(t){return t.color});var D=P.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(t){return t.color}).attr("fill-opacity",0);P.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"}),_(D),P.exit().remove(),I.append("text").attr("class","catlabel").attr("pointer-events","none");var F=e._fullLayout.paper_bgcolor;O.select("text.catlabel").attr("text-anchor",function(t){return h(t)?"start":"end"}).attr("alignment-baseline","middle").style("text-shadow",F+" -1px 1px 2px, "+F+" 1px 1px 2px, "+F+" 1px -1px 2px, "+F+" -1px -1px 2px").style("fill","rgb(0, 0, 0)").attr("x",function(t){return h(t)?t.width+5:-5}).attr("y",function(t){return t.height/2}).text(function(t){return t.model.categoryLabel}).each(function(t){s.font(n.select(this),t.parcatsViewModel.categorylabelfont),u.convertToTspans(n.select(this),e)}),I.append("text").attr("class","dimlabel"),O.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){s.font(n.select(this),t.parcatsViewModel.labelfont)}),O.selectAll("rect.bandrect").on("mouseover",M).on("mouseout",E),O.exit().remove(),T.call(n.behavior.drag().origin(function(t){return{x:t.x,y:0}}).on("dragstart",S).on("drag",C).on("dragend",L)),c.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")}),c.exit().remove()}function f(t){return t.key}function h(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function p(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),E=n.mouse(c)[0];a.loneHover({trace:f,x:y-p.left+d.left,y:b-p.top+d.top,text:M,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:_,idealAlign:E1&&u.displayInd===l.dimensions.length-1?(r=o.left,i="left"):(r=o.left+o.width,i="right");var h=s.model.count,p=s.model.categoryLabel,d=h/s.parcatsViewModel.model.count,v={countLabel:h,categoryLabel:p,probabilityLabel:d.toFixed(3)},g=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&g.push(["Count:",v.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&g.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var m=g.join("
");return{trace:c,x:r-t.left,y:f-t.top,text:m,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:i,hovertemplate:c.hovertemplate,hovertemplateLabels:v,eventData:[{data:c._input,fullData:c,count:h,category:p,probability:d}]}}function M(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){var e=n.mouse(this)[1];if(e<-1)return;var r,i=t.parcatsViewModel.graphDiv,s=i._fullLayout,u=s._paperdiv.node().getBoundingClientRect(),c=t.parcatsViewModel.hoveron;"color"===c?(function(t){var e=n.select(t).datum(),r=w(e);x(r),r.each(function(){o.raiseToTop(this)}),n.select(t.parentNode).selectAll("rect.bandrect").filter(function(t){return t.color===e.color}).each(function(){o.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)})}(this),A(this,"plotly_hover",n.event)):(function(t){n.select(t.parentNode).selectAll("rect.bandrect").each(function(t){var e=w(t);x(e),e.each(function(){o.raiseToTop(this)})}),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),k(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===c?r=T(u,this):"color"===c?r=function(t,e){var r,i,a=e.getBoundingClientRect(),o=n.select(e).datum(),s=o.categoryViewModel,u=s.parcatsViewModel,c=u.model.dimensions[s.model.dimensionInd],f=u.trace,h=a.y+a.height/2;u.dimensions.length>1&&c.displayInd===u.dimensions.length-1?(r=a.left,i="left"):(r=a.left+a.width,i="right");var p=s.model.categoryLabel,d=o.parcatsViewModel.model.count,v=0;o.categoryViewModel.bands.forEach(function(t){t.color===o.color&&(v+=t.count)});var g=s.model.count,m=0;u.pathSelection.each(function(t){t.model.color===o.color&&(m+=t.model.count)});var y=v/d,x=v/m,b=v/g,_={countLabel:d,categoryLabel:p,probabilityLabel:y.toFixed(3)},w=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&w.push(["Count:",_.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(w.push("P(color ∩ "+p+"): "+_.probabilityLabel),w.push("P("+p+" | color): "+x.toFixed(3)),w.push("P(color | "+p+"): "+b.toFixed(3)));var k=w.join("
"),A=l.mostReadable(o.color,["black","white"]);return{trace:f,x:r-t.left,y:h-t.top,text:k,color:o.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:A,fontSize:10,idealAlign:i,hovertemplate:f.hovertemplate,hovertemplateLabels:_,eventData:[{data:f._input,fullData:f,category:p,count:d,probability:y,categorycount:g,colorcount:m,bandcolorcount:v}]}}(u,this):"dimension"===c&&(r=function(t,e){var r=[];return n.select(e.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){r.push(T(t,this))}),r}(u,this)),r&&a.loneHover(r,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i}))}}function E(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(y(e.pathSelection),b(e.dimensionSelection.selectAll("g.category")),_(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(p),-1===e.hoverinfoItems.indexOf("skip"))){var r=t.parcatsViewModel.hoveron;"color"===r?A(this,"plotly_unhover",n.event):k(this,"plotly_unhover",n.event)}}function S(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,o.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}R(t.parcatsViewModel),z(t.parcatsViewModel),P(t.parcatsViewModel),I(t.parcatsViewModel)}}function L(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=O(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 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 u=t.model.categories.slice().sort(function(t,e){return t.displayInd-e.displayInd}),c=u.map(function(t){return t.categoryValue}),f=u.map(function(t){return t.categoryLabel});e["dimensions["+t.model.containerInd+"].categoryarray"]=[c],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?A(t.potentialClickBand,"plotly_click",n.event.sourceEvent):k(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd){var h=t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd];h.model.dragY=null,t.dragCategoryDisplayInd=null}t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,R(t.parcatsViewModel),z(t.parcatsViewModel);var p=n.transition().duration(300).ease("cubic-in-out");p.each(function(){P(t.parcatsViewModel,!0),I(t.parcatsViewModel,!0)}).each("end",function(){(o||s)&&i.restyle(t.parcatsViewModel.graphDiv,e,[r])})}}function O(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)c+="C"+u[s]+","+(e[s+1]+i)+" "+l[s]+","+(e[s]+i)+" "+(t[s]+r[s])+","+(e[s]+i),c+="l-"+r[s]+",0 ";return c+="Z"}function z(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}),u=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&u.push(r.paths[c]);function f(t){var e=t.categoryInds.map(function(t,e){return i[e][t]}),r=o.map(function(t){return e[t]});return r}u.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(u.length),p=e[0].model.count,d=e[0].categories.map(function(t){return t.height}).reduce(function(t,e){return t+e}),v=0;v0?d*(m.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(i-1):0,n=40+r*a;var o,s,l,u,c,f=[],h=t.model.maxCats,p=e.categories.length,d=e.count,v=t.height-8*(h-1),g=8*(h-p)/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?s.count/d*v:0,l={key:s.valueInds[0],model:s,width:16,height:o,y:null!==s.dragY?s.dragY:g,bands:[],parcatsViewModel:t},g=g+o+8,f.push(l);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:n,y:0,width:16,model:e,categories:f,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){c(r,t,n,e)}},{"../../components/drawing":601,"../../components/fx":619,"../../lib":703,"../../lib/svg_text_utils":727,"../../plot_api/plot_api":738,d3:157,tinycolor2:524}],1037:[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":1036}],1038:[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:"calc"}),labelfont:a({editType:"calc"}),tickfont:a({editType:"calc"}),rangefont:a({editType:"calc"}),dimensions:l("dimension",{label:{valType:"string",editType:"calc"},tickvals:s({},i.tickvals,{editType:"calc"}),ticktext:s({},i.ticktext,{editType:"calc"}),tickformat:{valType:"string",dflt:"3s",editType:"calc"},visible:{valType:"boolean",dflt:!0,editType:"calc"},range:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},multiselect:{valType:"boolean",dflt:!0,editType:"calc"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":587,"../../lib/extend":693,"../../plot_api/plot_template":741,"../../plots/cartesian/layout_attributes":763,"../../plots/domain":776,"../../plots/font_attributes":777}],1039:[function(t,e,r){"use strict";var n=t("./constants"),i=t("d3"),a=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=n.bar.snapRatio;function u(t,e){return t*(1-l)+e*l}var c=n.bar.snapClose;function f(t,e){return t*(1-c)+e*c}function h(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,h=a;i*he){p=r;break}}if(o=f,isNaN(o)&&(o=isNaN(h)||isNaN(p)?isNaN(h)?p:h:e-c[h][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(v,e);m&&(s.interval=u[o],s.intervalPix=v,s.region=m)}}if(t.ordinal&&!s.region){var y=t.unitTickvals,x=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&x<=b[1]){s.clickableOrdinalRange=b;break}}}return s}function _(t){t.on("mousemove",function(t){if(i.event.preventDefault(),!t.parent.inBrushDrag){var e=t.height-i.mouse(this)[1]-2*n.verticalPadding,r=b(t,e),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}}).on("mouseleave",function(t){t.parent.inBrushDrag||m()}).call(i.behavior.drag().on("dragstart",function(t){i.event.sourceEvent.stopPropagation();var e=t.height-i.mouse(this)[1]-2*n.verticalPadding,r=t.unitToPaddedPx.invert(e),a=t.brush,o=b(t,e),s=o.interval,l=a.svgBrush;if(l.wasDragged=!1,l.grabbingBar="ns"===o.region,l.grabbingBar){var u=s.map(t.unitToPaddedPx);l.grabPoint=e-u[0]-n.verticalPadding,l.barLength=u[1]-u[0]}l.clickableOrdinalRange=o.clickableOrdinalRange,l.stayingIntervals=t.multiselect&&a.filterSpecified?a.filter.getConsolidated():[],s&&(l.stayingIntervals=l.stayingIntervals.filter(function(t){return t[0]!==s[0]&&t[1]!==s[1]})),l.startExtent=o.region?s["s"===o.region?1:0]:r,t.parent.inBrushDrag=!0,l.brushStartCallback()}).on("drag",function(t){i.event.sourceEvent.stopPropagation();var e=t.height-i.mouse(this)[1]-2*n.verticalPadding,r=t.brush.svgBrush;r.wasDragged=!0,r.grabbingBar?r.newExtent=[e-r.grabPoint,e+r.barLength-r.grabPoint].map(t.unitToPaddedPx.invert):r.newExtent=[r.startExtent,t.unitToPaddedPx.invert(e)].sort(s);var a=Math.max(0,-r.newExtent[0]),o=Math.max(0,r.newExtent[1]-1);r.newExtent[0]+=a,r.newExtent[1]-=o,r.grabbingBar&&(r.newExtent[1]+=a,r.newExtent[0]-=o),t.brush.filterSpecified=!0,r.extent=r.stayingIntervals.concat([r.newExtent]),r.brushCallback(t),x(this.parentNode)}).on("dragend",function(t){var e=i.event;e.sourceEvent.stopPropagation();var r=t.brush,n=r.filter,a=r.svgBrush,o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,m(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&k(r)):k(r),a.brushCallback(t),x(this.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(u?[a.newExtent]:[]),a.extent.length||k(r),a.brushCallback(t),u?x(this.parentNode,s):(s(),x(this.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}))}function w(t,e){return t[0]-e[0]}function k(t){t.filterSpecified=!1,t.svgBrush.extent=[[0,1]]}function A(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 n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){r=n.map(function(t){return t.slice().sort(s)}).sort(w),t=A(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),n=r.slice();e.filter.set(n),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t){var e=t.selectAll("."+n.cn.axisBrush).data(o,a);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(p).call(d).style("pointer-events","auto").attr("transform","translate(0 "+n.verticalPadding+")"),e.call(_).attr("height",function(t){return t.height-n.verticalPadding});var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",function(t){return t.height}).call(y);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(y)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map(function(t){return t.sort(s)}),t=e.multiselect?A(t.sort(w)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map(function(t){var e=[h(0,r,t[0],[]),h(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":703,"../../lib/gup":701,"./constants":1042,d3:157}],1040:[function(t,e,r){"use strict";var n=t("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"),i=r.filter(function(t,e){return e===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");i.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.width,height:this.height})}),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":681,"../../plots/get_data":786,"./plot":1048,d3:157}],1041:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),i=t("../../lib"),a=t("../../lib/gup").wrap;function o(t){return i.isTypedArray(t)?Array.prototype.slice.call(t):t}e.exports=function(t,e){for(var r=0;rc&&(n.log("parcoords traces support up to "+c+" dimensions at the moment"),d.splice(c));var v=s(t,e,{name:"dimensions",handleItemDefaults:h}),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,u,p);o(e,u,p),Array.isArray(v)&&v.length||(e.visible=!1),f(e,v,"values",g);var m={family:u.font.family,size:Math.round(u.font.size/1.2),color:u.font.color};n.coerceFont(p,"labelfont",m),n.coerceFont(p,"tickfont",m),n.coerceFont(p,"rangefont",m)}},{"../../components/colorscale/defaults":590,"../../components/colorscale/helpers":591,"../../lib":703,"../../plots/array_container_defaults":747,"../../plots/domain":776,"./attributes":1038,"./axisbrush":1039,"./constants":1042,"./merge_length":1046}],1044:[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":1038,"./base_plot":1040,"./calc":1041,"./defaults":1043,"./plot":1048}],1045:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\nuniform sampler2D mask;\nuniform float maskHeight;\n\nuniform vec2 colorClamp;\n\nvarying vec4 fragColor;\n\nvec4 unit_1 = vec4(1, 1, 1, 1);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit_1, unit_1);\n}\n\nfloat axisY(\n float x,\n mat4 d[4],\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float y1 = val(d[0], dim1A) + val(d[1], dim1B) + val(d[2], dim1C) + val(d[3], dim1D);\n float y2 = val(d[0], dim2A) + val(d[1], dim2B) + val(d[2], dim2C) + val(d[3], dim2D);\n return y1 * (1.0 - x) + y2 * x;\n}\n\nconst int bitsPerByte = 8;\n\nint mod2(int a) {\n return a - 2 * (a / 2);\n}\n\nint mod8(int a) {\n return a - 8 * (a / 8);\n}\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit_0 = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nbool withinBoundingBox(\n mat4 d[4],\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD\n ) {\n\n return mshow(d[0], loA, hiA) &&\n mshow(d[1], loB, hiB) &&\n mshow(d[2], loC, hiC) &&\n mshow(d[3], loD, hiD);\n}\n\nbool withinRasterMask(mat4 d[4], sampler2D mask, float height) {\n bool result = true;\n int bitInByteStepper;\n float valY, valueY, scaleX;\n int hit, bitmask, valX;\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 bitInByteStepper = mod8(j * 4 + k);\n valX = i * 2 + j / 2;\n valY = d[i][j][k];\n valueY = valY * (height - 1.0) + 0.5;\n scaleX = (float(valX) + 0.5) / 8.0;\n hit = int(texture2D(mask, vec2(scaleX, (valueY + 0.5) / height))[3] * 255.0) / int(pow(2.0, float(bitInByteStepper)));\n result = result && mod2(hit) == 1;\n }\n }\n }\n return result;\n}\n\nvec4 position(\n float depth,\n vec2 resolution, vec2 viewBoxPosition, vec2 viewBoxSize,\n mat4 dims[4],\n float signum,\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D,\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD,\n sampler2D mask, float maskHeight\n ) {\n\n float x = 0.5 * signum + 0.5;\n float y = axisY(x, dims, dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D);\n\n float show = float(\n withinBoundingBox(dims, loA, hiA, loB, hiB, loC, hiC, loD, hiD)\n && withinRasterMask(dims, mask, maskHeight)\n );\n\n vec2 viewBoxXY = viewBoxPosition + viewBoxSize * vec2(x, y);\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n return vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n}\n\nvoid main() {\n\n float prominence = abs(pf[3]);\n\n mat4 p[4];\n p[0] = mat4(p0, p1, p2, p3);\n p[1] = mat4(p4, p5, p6, p7);\n p[2] = mat4(p8, p9, pa, pb);\n p[3] = mat4(pc, pd, pe, abs(pf));\n\n gl_Position = position(\n 1.0 - prominence,\n resolution, viewBoxPosition, viewBoxSize,\n p,\n sign(pf[3]),\n dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD,\n mask, maskHeight\n );\n\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nvarying vec4 fragColor;\n\nvec2 xyProjection = vec2(1, 1);\n\nvec4 unit = vec4(1, 1, 1, 1);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nfloat axisY(\n float x,\n mat4 d[4],\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float y1 = val(d[0], dim1A) + val(d[1], dim1B) + val(d[2], dim1C) + val(d[3], dim1D);\n float y2 = val(d[0], dim2A) + val(d[1], dim2B) + val(d[2], dim2C) + val(d[3], dim2D);\n return y1 * (1.0 - x) + y2 * x;\n}\n\nvec4 position(\n float depth,\n vec2 resolution, vec2 viewBoxPosition, vec2 viewBoxSize,\n mat4 dims[4],\n float signum,\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float x = 0.5 * signum + 0.5;\n float y = axisY(x, dims, dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D);\n\n vec2 viewBoxXY = viewBoxPosition + viewBoxSize * vec2(x, y);\n\n return vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depth,\n 1.0\n );\n}\n\nvoid main() {\n\n float prominence = abs(pf[3]);\n\n mat4 p[4];\n p[0] = mat4(p0, p1, p2, p3);\n p[1] = mat4(p4, p5, p6, p7);\n p[2] = mat4(p8, p9, pa, pb);\n p[3] = mat4(pc, pd, pe, abs(pf));\n\n gl_Position = position(\n 1.0 - prominence,\n resolution, viewBoxPosition, viewBoxSize,\n p,\n sign(pf[3]),\n dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D\n );\n\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D mask;\nuniform float maskHeight;\n\nuniform vec2 colorClamp;\n\nvarying vec4 fragColor;\n\nvec4 unit_1 = vec4(1, 1, 1, 1);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit_1, unit_1);\n}\n\nfloat axisY(\n float x,\n mat4 d[4],\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float y1 = val(d[0], dim1A) + val(d[1], dim1B) + val(d[2], dim1C) + val(d[3], dim1D);\n float y2 = val(d[0], dim2A) + val(d[1], dim2B) + val(d[2], dim2C) + val(d[3], dim2D);\n return y1 * (1.0 - x) + y2 * x;\n}\n\nconst int bitsPerByte = 8;\n\nint mod2(int a) {\n return a - 2 * (a / 2);\n}\n\nint mod8(int a) {\n return a - 8 * (a / 8);\n}\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit_0 = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nbool withinBoundingBox(\n mat4 d[4],\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD\n ) {\n\n return mshow(d[0], loA, hiA) &&\n mshow(d[1], loB, hiB) &&\n mshow(d[2], loC, hiC) &&\n mshow(d[3], loD, hiD);\n}\n\nbool withinRasterMask(mat4 d[4], sampler2D mask, float height) {\n bool result = true;\n int bitInByteStepper;\n float valY, valueY, scaleX;\n int hit, bitmask, valX;\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 bitInByteStepper = mod8(j * 4 + k);\n valX = i * 2 + j / 2;\n valY = d[i][j][k];\n valueY = valY * (height - 1.0) + 0.5;\n scaleX = (float(valX) + 0.5) / 8.0;\n hit = int(texture2D(mask, vec2(scaleX, (valueY + 0.5) / height))[3] * 255.0) / int(pow(2.0, float(bitInByteStepper)));\n result = result && mod2(hit) == 1;\n }\n }\n }\n return result;\n}\n\nvec4 position(\n float depth,\n vec2 resolution, vec2 viewBoxPosition, vec2 viewBoxSize,\n mat4 dims[4],\n float signum,\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D,\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD,\n sampler2D mask, float maskHeight\n ) {\n\n float x = 0.5 * signum + 0.5;\n float y = axisY(x, dims, dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D);\n\n float show = float(\n withinBoundingBox(dims, loA, hiA, loB, hiB, loC, hiC, loD, hiD)\n && withinRasterMask(dims, mask, maskHeight)\n );\n\n vec2 viewBoxXY = viewBoxPosition + viewBoxSize * vec2(x, y);\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n return vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n}\n\nvoid main() {\n\n float prominence = abs(pf[3]);\n\n mat4 p[4];\n p[0] = mat4(p0, p1, p2, p3);\n p[1] = mat4(p4, p5, p6, p7);\n p[2] = mat4(p8, p9, pa, pb);\n p[3] = mat4(pc, pd, pe, abs(pf));\n\n gl_Position = position(\n 1.0 - prominence,\n resolution, viewBoxPosition, viewBoxSize,\n p,\n sign(pf[3]),\n dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD,\n mask, maskHeight\n );\n\n fragColor = vec4(pf.rgb, 1.0);\n}\n"]),s=n(["precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),l=t("../../lib"),u=1e-6,c=1e-7,f=2048,h=64,p=2,d=4,v=8,g=h/v,m=[119,119,119],y=new Uint8Array(4),x=new Uint8Array(4),b={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function _(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 w(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:y})}(t),r.drawCompleted=!0),function s(l){var u;u=Math.min(n,i-l*n),a.offset=p*l*n,a.count=p*u,0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],_(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(e(a),l*n+u>>8*e)%256/255}function A(t,e,r){var n,i,a,o=[];for(i=0;i=h-4?k(a,h-2-o):.5);var s;return i}(d,p,i);!function(t,e,r){for(var n=0;n<16;n++)t["p"+n.toString(16)](A(e,r,n))}(C,d,o),L=E.texture(l.extendFlat({data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?m:a).concat(r))}return n}(r.unitToColor,T,Math.round(255*(T?a:1)))},b))}var P=[0,1],D=[];function z(t,e,n,i,a,o,s,u,c,f,h){var p,d,v,g,m=[t,e],y=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})});for(p=0;p<2;p++)for(g=m[p],d=0;d<4;d++)for(v=0;v<16;v++)y[p][d][v]=v+16*d===g?1:0;var x=r.lines.canvasOverdrag,b=r.domain,_=r.canvasWidth,w=r.canvasHeight,k=l.extendFlat({key:s,resolution:[_,w],viewBoxPosition:[n+x,i],viewBoxSize:[a,o],i:t,ii:e,dim1A:y[0][0],dim1B:y[0][1],dim1C:y[0][2],dim1D:y[0][3],dim2A:y[1][0],dim2B:y[1][1],dim2C:y[1][2],dim2D:y[1][3],colorClamp:P,scissorX:(u===c?0:n+x)+(r.pad.l-x)+r.layoutWidth*b.x[0],scissorWidth:(u===f?_-n+x:a+.5)+(u===c?n+x:0),scissorY:i+r.pad.b+r.layoutHeight*b.y[0],scissorHeight:o,viewportX:r.pad.l-x+r.layoutWidth*b.x[0],viewportY:r.pad.b+r.layoutHeight*b.y[0],viewportWidth:_,viewportHeight:w},h);return k}return{setColorDomain:function(t){P[0]=t[0],P[1]=t[1]},render:function(t,e,n){var i,a,o,s=t.length,l=1/0,u=-1/0;for(i=0;iu&&(u=t[i].dim2.canvasX,o=i),t[i].dim1.canvasXi._length&&(T=T.slice(0,i._length));var M,E=i.tickvals;function S(t,e){return{val:t,text:M[e]}}function C(t,e){return t.val-e.val}if(Array.isArray(E)&&E.length){M=i.ticktext,Array.isArray(M)&&M.length?M.length>E.length?M=M.slice(0,E.length):E.length>M.length&&(E=E.slice(0,M.length)):M=E.map(n.format(i.tickformat));for(var L=1;L=r||s>=i)return;var u=t.lineLayer.readPixel(o,i-1-s),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,h={x:o,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==A&&(c?l.hover(h):l.unhover&&l.unhover(h),A=f)}}),k.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var M=e.selectAll("."+h.cn.parcoords).data(w,u);M.exit().remove(),M.enter().append("g").classed(h.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),M.attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var E=M.selectAll("."+h.cn.parcoordsControlView).data(c,u);E.enter().append("g").classed(h.cn.parcoordsControlView,!0),E.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var S=E.selectAll("."+h.cn.yAxis).data(function(t){return t.dimensions},u);function C(t,e){for(var r=e.panels||(e.panels=[]),n=t.data(),i=n.length-1,a=0;aline").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),O.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var I=L.selectAll("."+h.cn.axisHeading).data(c,u);I.enter().append("g").classed(h.cn.axisHeading,!0);var P=I.selectAll("."+h.cn.axisTitle).data(c,u);P.enter().append("text").classed(h.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),P.attr("transform","translate(0,"+-h.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){o.font(n.select(this),t.model.labelFont)});var D=L.selectAll("."+h.cn.axisExtent).data(c,u);D.enter().append("g").classed(h.cn.axisExtent,!0);var z=D.selectAll("."+h.cn.axisExtentTop).data(c,u);z.enter().append("g").classed(h.cn.axisExtentTop,!0),z.attr("transform","translate(0,"+-h.axisExtentOffset+")");var R=z.selectAll("."+h.cn.axisExtentTopText).data(c,u);function F(t,e){if(t.ordinal)return"";var r=t.domainScale.domain();return n.format(t.tickFormat)(r[e?r.length-1:0])}R.enter().append("text").classed(h.cn.axisExtentTopText,!0).call(_),R.text(function(t){return F(t,!0)}).each(function(t){o.font(n.select(this),t.model.rangeFont)});var B=D.selectAll("."+h.cn.axisExtentBottom).data(c,u);B.enter().append("g").classed(h.cn.axisExtentBottom,!0),B.attr("transform",function(t){return"translate(0,"+(t.model.height+h.axisExtentOffset)+")"});var N=B.selectAll("."+h.cn.axisExtentBottomText).data(c,u);N.enter().append("text").classed(h.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(_),N.text(function(t){return F(t)}).each(function(t){o.font(n.select(this),t.model.rangeFont)}),p.ensureAxisBrush(L)}},{"../../components/colorscale":592,"../../components/drawing":601,"../../lib":703,"../../lib/gup":701,"./axisbrush":1039,"./constants":1042,"./lines":1045,"color-rgba":115,d3:157}],1048:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl");e.exports=function(t,e){var r=t._fullLayout,a=r._toppaper,o=r._paperdiv,s=r._glcontainer,l=i(t);if(l){var u={},c={},f={},h={},p=r._size;e.forEach(function(e,r){var n=e[0].trace;f[r]=n.index;var i=h[r]=n._fullInput.index;u[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()}),n(o,a,s,e,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{filterChanged:function(e,n,i){var a=c[e][n],o=i.map(function(t){return t.slice()}),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[t._fullData[f[e]]._fullInput.uid];if(void 0===l[s]){var u=a.constraintrange;l[s]=u||null}var p=t._fullData[f[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,[h[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){var a=i(r,t,e),o=i(r,t,n);return a-o}}(c[e].filter(n));u[e].sort(a),c[e].filter(function(t){return!n(t)}).sort(function(t){return c[e].indexOf(t)}).forEach(function(t){u[e].splice(u[e].indexOf(t),1),u[e].splice(c[e].indexOf(t),0,t)}),t.emit("plotly_restyle",[{dimensions:[u[e]]},[h[e]]])}})}}},{"../../lib/prepare_regl":716,"./parcoords":1047}],1049:[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("../../components/fx/hovertemplate_attributes"),l=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:"calc"},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:l({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},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:l({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":579,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../../plots/domain":776,"../../plots/font_attributes":777}],1050:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/get_data").getModuleCalcData;r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=i(t.calcdata,e)[0];e.plot(t,r)},r.clean=function(t,e,r,n){var i=n._has&&n._has("pie"),a=e._has&&e._has("pie");i&&!a&&n._pielayer.selectAll("g.trace").remove()}},{"../../plots/get_data":786,"../../registry":831}],1051:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").isArrayOrTypedArray,a=t("tinycolor2"),o=t("../../components/color"),s=t("./helpers"),l=t("../../lib").isValidTextValue,u={};function c(t){return function(e,r){return!!e&&!!(e=a(e)).isValid()&&(e=o.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function f(t,e){var r,n=JSON.stringify(t),i=e[n];if(!i){for(i=t.slice(),r=0;r")}}return o},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,a=n[r+"colorway"],o=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=f(a,u));for(var s=0,l=0;l"),name:h.hovertemplate||-1!==p.indexOf("name")?h.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:u.castOption(b.bgcolor,t.pts)||t.color,borderColor:u.castOption(b.bordercolor,t.pts),fontFamily:u.castOption(_.family,t.pts),fontSize:u.castOption(_.size,t.pts),fontColor:u.castOption(_.color,t.pts),nameLength:u.castOption(b.namelength,t.pts),textAlign:u.castOption(b.align,t.pts),hovertemplate:u.castOption(h.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[c(t,h)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[c(t,h)],event:n.event})}}),t.on("mouseout",function(t){var r=e._fullLayout,a=e._fullData[o.index],s=n.select(this).datum();o._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[c(s,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)}),t.on("click",function(t){var r=e._fullLayout,a=e._fullData[o.index];e._dragging||!1===r.hovermode||(e._hoverdata=[c(t,a)],i.click(e,n.event))})}function h(t,e,r){var n=u.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=u.castOption(t._input.textfont.color,e.pts));var i=u.castOption(t.insidetextfont.family,e.pts)||u.castOption(t.textfont.family,e.pts)||r.family,o=u.castOption(t.insidetextfont.size,e.pts)||u.castOption(t.textfont.size,e.pts)||r.size;return{color:n||a.contrast(e.color),family:i,size:o}}function p(t,e){for(var r,n,i=0;i=1)return u;var c=i+1/(2*Math.tan(a)),f=l*Math.min(1/(Math.sqrt(c*c+.5)+c),o/(Math.sqrt(i*i+o/2)+i)),h={scale:2*f/t.height,rCenter:Math.cos(f/l)-f*i/l,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/i,d=p+1/(2*Math.tan(a)),v=l*Math.min(1/(Math.sqrt(d*d+.5)+d),o/(Math.sqrt(p*p+o/2)+p)),g={scale:2*v/t.width,rCenter:Math.cos(v/l)-v/i/l,rotate:(180/Math.PI*e.midangle+810)%180-90},m=g.scale>h.scale?g:h;return u.scale<1&&m.scale>u.scale?m:u}function v(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function g(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 m(t,e){var r,n=1,i=1,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,r=x(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+r)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+r)*t.r);var l,u,c=(l=t.r,u=t.trace.aspectratio,l/(void 0===u?1:u)),f=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=c,o.x-=(1+r)*c,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=c,o.x+=(1+r)*c,s.tx-=t.titleBox.width/2),n=f/t.titleBox.width,i=y(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(n,i),tx:s.tx,ty:s.ty}}function y(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 x(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 b(t,e){for(var r=[],n=0;n1?(u=r.r,c=u/i.aspectratio):(c=r.r,u=c*i.aspectratio),u*=(1+i.baseratio)/2,l=u*c}o=Math.min(o,l/r.vTotal)}for(n=0;ni.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-a.hole,r.rInscribed=v(r,i))}(e),i.attr("stroke-linejoin","round"),i.each(function(){var i=n.select(this).selectAll("g.slice").data(e);i.enter().append("g").classed("slice",!0),i.exit().remove();var v=[[[],[]],[[],[]]],y=!1;i.each(function(r){if(r.hidden)n.select(this).selectAll("path,g").remove();else{r.pointNumber=r.i,r.curveNumber=p.index,v[r.pxmid[1]<0?0:1][r.pxmid[0]<0?0:1].push(r);var i=c.cx,a=c.cy,m=n.select(this),x=m.selectAll("path.surface").data([r]);if(x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),m.call(f,t,e),p.pull){var b=+u.castOption(p.pull,r.pts)||0;b>0&&(i+=b*r.pxmid[0],a+=b*r.pxmid[1])}r.cxFinal=i,r.cyFinal=a;var _=p.hole;if(r.v===c.vTotal){var w="M"+(i+r.px0[0])+","+(a+r.px0[1])+E(r.px0,r.pxmid,!0,1)+E(r.pxmid,r.px0,!0,1)+"Z";_?x.attr("d","M"+(i+_*r.px0[0])+","+(a+_*r.px0[1])+E(r.px0,r.pxmid,!1,_)+E(r.pxmid,r.px0,!1,_)+"Z"+w):x.attr("d",w)}else{var k=E(r.px0,r.px1,!0,1);if(_){var A=1-_;x.attr("d","M"+(i+_*r.px1[0])+","+(a+_*r.px1[1])+E(r.px1,r.px0,!1,_)+"l"+A*r.px0[0]+","+A*r.px0[1]+k+"Z")}else x.attr("d","M"+i+","+a+"l"+r.px0[0]+","+r.px0[1]+k+"Z")}var T=u.castOption(p.textposition,r.pts),M=m.selectAll("g.slicetext").data(r.text&&"none"!==T?[0]:[]);M.enter().append("g").classed("slicetext",!0),M.exit().remove(),M.each(function(){var e=s.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)});e.text(r.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,"outside"===T?function(t,e,r){var n=u.castOption(t.outsidetextfont.color,e.pts)||u.castOption(t.textfont.color,e.pts)||r.color,i=u.castOption(t.outsidetextfont.family,e.pts)||u.castOption(t.textfont.family,e.pts)||r.family,a=u.castOption(t.outsidetextfont.size,e.pts)||u.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:i,size:a}}(p,r,t._fullLayout.font):h(p,r,t._fullLayout.font)).call(l.convertToTspans,t);var f,v=o.bBox(e.node());"outside"===T?f=g(v,r):(f=d(v,r,c),"auto"===T&&f.scale<1&&(e.call(o.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(v=o.bBox(e.node())),f=g(v,r)));var m=i+r.pxmid[0]*f.rCenter+(f.x||0),x=a+r.pxmid[1]*f.rCenter+(f.y||0);f.outside&&(r.yLabelMin=x-v.height/2,r.yLabelMid=x,r.yLabelMax=x+v.height/2,r.labelExtraX=0,r.labelExtraY=0,y=!0),e.attr("transform","translate("+m+","+x+")"+(f.scale<1?"scale("+f.scale+")":"")+(f.rotate?"rotate("+f.rotate+")":"")+"translate("+-(v.left+v.right)/2+","+-(v.top+v.bottom)/2+")")})}function E(t,e,n,i){var a=i*(e[0]-t[0]),o=i*(e[1]-t[1]);return"a"+i*c.r+","+i*c.r+" 0 "+r.largeArc+(n?" 1 ":" 0 ")+a+","+o}});var x=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);x.enter().append("g").classed("titletext",!0),x.exit().remove(),x.each(function(){var e,i=s.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),a=p.title.text;p._meta&&(a=s.templateString(a,p._meta)),i.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,p.title.font).call(l.convertToTspans,t),e="middle center"===p.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}}(c):m(c,r._size),i.attr("transform","translate("+e.x+","+e.y+")"+(e.scale<1?"scale("+e.scale+")":"")+"translate("+e.tx+","+e.ty+")")}),y&&function(t,e){var r,n,i,a,o,s,l,c,f,h,p,d,v;function g(t,e){return t.pxmid[1]-e.pxmid[1]}function m(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var i,c,f,p,d,v,g=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),m=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,x=t.cyFinal+o(t.px0[1],t.px1[1]),b=g-m;if(b*l>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(c=0;c=(u.castOption(e.pull,f.pts)||0)||((t.pxmid[1]-f.pxmid[1])*l>0?(p=f.cyFinal+o(f.px0[1],f.px1[1]),(b=p-m-t.labelExtraY)*l>0&&(t.labelExtraY+=b)):(y+t.labelExtraY-x)*l>0&&(i=3*s*Math.abs(c-h.indexOf(t)),d=f.cxFinal+a(f.px0[0],f.px1[0]),(v=d+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=v)))}for(n=0;n<2;n++)for(i=n?g:m,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),f=t[1-n][r],h=f.concat(c),d=[],p=0;pMath.abs(h)?u+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(o+t.labelExtraX+c):u+="l"+t.labelExtraX+","+f+"v"+(h-f)+"h"+c}else u+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(a.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:u,fill:"none"})}else r.select("path.textline").remove()})}(i,p)})});setTimeout(function(){i.selectAll("tspan").each(function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)},transformInsideText:d,determineInsideTextFont:h,positionTitleOutside:m,prerenderTitles:p,layoutAreas:b,attachFxHandlers:f}},{"../../components/color":580,"../../components/drawing":601,"../../components/fx":619,"../../lib":703,"../../lib/svg_text_utils":727,"./event_data":1053,"./helpers":1054,d3:157}],1059:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":1060,d3:157}],1060:[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":580,"./helpers":1054}],1061:[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":1075}],1062:[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,u=this.xData=this.pickXData=t.x,c=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 v=i(t.marker.color),g=i(t.marker.border.color),m=t.opacity*t.marker.opacity;v[3]*=m,this.pointcloudOptions.color=v;var y=t.marker.blend;null===y&&(y=u.length<100||c.length<100),this.pointcloudOptions.blend=y,g[3]*=m,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,k=b/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:k}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:k})},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":726,"../../plots/cartesian/autorange":750,"../scatter/get_trace_color":1084,"gl-pointcloud2d":291}],1063:[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":703,"./attributes":1061}],1064:[function(t,e,r){"use strict";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":789,"../scatter3d/calc":1102,"./attributes":1061,"./convert":1062,"./defaults":1063}],1065:[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("../../components/fx/hovertemplate_attributes"),u=t("../../components/colorscale/attributes"),c=t("../../plot_api/plot_template").templatedArray,f=t("../../lib/extend").extendFlat,h=t("../../plot_api/edit_types").overrideAll,p=e.exports=h({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"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),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},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},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:c("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(u().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested");p.transforms=void 0},{"../../components/color/attributes":579,"../../components/colorscale/attributes":587,"../../components/fx/attributes":610,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plot_api/edit_types":734,"../../plot_api/plot_template":741,"../../plots/attributes":748,"../../plots/domain":776,"../../plots/font_attributes":777}],1066:[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"),u=t("../../plots/cartesian/select").prepSelect,c=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:c.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:c.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:h,yaxis:p,fillRangeItems:c.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;rm&&(m=a.source[e]),a.target[e]>m&&(m=a.target[e]);var y,x=m+1;t.node._count=x;var b=t.node.groups,_={};for(e=0;e0&&s(E,x)&&s(S,x)&&(!_.hasOwnProperty(E)||!_.hasOwnProperty(S)||_[E]!==_[S])){_.hasOwnProperty(S)&&(S=_[S]),_.hasOwnProperty(E)&&(E=_[E]),S=+S,f[E=+E]=f[S]=!0;var C="";a.label&&a.label[e]&&(C=a.label[e]);var L=null;C&&h.hasOwnProperty(C)&&(L=h[C]),u.push({pointNumber:e,label:C,color:c?a.color[e]:a.color,concentrationscale:L,source:E,target:S,value:+M}),T.source.push(E),T.target.push(S)}}var O=x+b.length,I=o(r.color),P=[];for(e=0;ex-1,childrenNodes:[],pointNumber:e,label:D,color:I?r.color[e]:r.color})}var z=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1})}(O,T.source,T.target)&&(z=!0),{circular:z,links:u,nodes:P,groups:b,groupLookup:_}}e.exports=function(t,e){var r=u(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":592,"../../lib":703,"../../lib/gup":701,"strongly-connected-components":517}],1068:[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",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1069:[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"),u=t("../../plot_api/plot_template"),c=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),v=t.node,g=u.newContainer(e,"node");function m(t,e){return n.coerce(v,g,i.node,t,e)}m("label"),m("groups"),m("x"),m("y"),m("pad"),m("thickness"),m("line.color"),m("line.width"),m("hoverinfo",t.hoverinfo),l(v,g,m,d),m("hovertemplate");var y=h.colorway;m("color",g.label.map(function(t,e){return a.addOpacity(function(t){return y[t%y.length]}(e),.8)}));var x=t.link||{},b=u.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,k=o(h.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(k,b.value.length)),c(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":580,"../../components/fx/hoverlabel_defaults":617,"../../lib":703,"../../plot_api/plot_template":741,"../../plots/array_container_defaults":747,"../../plots/domain":776,"./attributes":1065,tinycolor2:524}],1070:[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":1065,"./base_plot":1066,"./calc":1067,"./defaults":1069,"./plot":1071,"./select.js":1073}],1071:[function(t,e,r){"use strict";var n=t("d3"),i=t("./render"),a=t("../../components/fx"),o=t("../../components/color"),s=t("../../lib"),l=t("./constants").cn,u=s._;function c(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 p(t){n.select(t).select("text.name").style("fill","black")}function d(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function v(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("."+l.sankeyLink).filter(d(e)).call(y.bind(0,e,r,!1))}function m(t,e,r){e&&r&&f(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(x.bind(0,e,r,!1))}function y(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("."+l.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("."+l.sankeyNode).filter(v(t)).call(g)}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),i&&f(e,t).selectAll("."+l.sankeyLink).filter(function(t){return t.link.label===i}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&f(e,t).selectAll(l.sankeyNode).filter(v(t)).call(m)}function b(t,e){var r=t.hoverlabel||{},n=s.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,s=r._paper,f=r._size,d=0;d"),color:b(s,"bgcolor")||o.addOpacity(d.color,1),borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),nameLength:b(s,"namelength"),textAlign:b(s,"align"),idealAlign:n.event.x"),color:b(o,"bgcolor")||i.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:m,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});h(y,.85),p(y)}}},unhover:function(e,i,o){!1!==t._fullLayout.hovermode&&(n.select(e).call(m,i,o),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),a.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var o=r.node;o.originalEvent=n.event,t._hoverdata=[o],n.select(e).call(m,r,i),a.click(t,{target:!0})}}})}},{"../../components/color":580,"../../components/fx":619,"../../lib":703,"./constants":1068,"./render":1072,d3:157}],1072:[function(t,e,r){"use strict";var n=t("./constants"),i=t("d3"),a=t("tinycolor2"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("@plotly/d3-sankey"),u=t("d3-sankey-circular"),c=t("d3-force"),f=t("../../lib"),h=t("../../lib/gup"),p=h.keyFun,d=h.repeat,v=h.unwrap,g=t("d3-interpolate").interpolateNumber,m=t("../../registry");function y(){var t=.5;return function(e){if(e.link.circular)return r=e.link,n=r.width/2,i=r.circularPathData,"top"===r.circularLinkType?"M "+i.targetX+" "+(i.targetY+n)+" L"+i.rightInnerExtent+" "+(i.targetY+n)+"A"+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent-n)+" "+(i.targetY-i.rightSmallArcRadius)+"L"+(i.rightFullExtent-n)+" "+i.verticalRightInnerExtent+"A"+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+i.rightInnerExtent+" "+(i.verticalFullExtent-n)+"L"+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+"A"+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent+"L"+(i.leftFullExtent+n)+" "+(i.sourceY-i.leftSmallArcRadius)+"A"+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.sourceY+n)+"L"+i.sourceX+" "+(i.sourceY+n)+"L"+i.sourceX+" "+(i.sourceY-n)+"L"+i.leftInnerExtent+" "+(i.sourceY-n)+"A"+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.sourceY-i.leftSmallArcRadius)+"L"+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent+"A"+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+"L"+i.rightInnerExtent+" "+(i.verticalFullExtent+n)+"A"+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent+n)+" "+i.verticalRightInnerExtent+"L"+(i.rightFullExtent+n)+" "+(i.targetY-i.rightSmallArcRadius)+"A"+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 0 "+i.rightInnerExtent+" "+(i.targetY-n)+"L"+i.targetX+" "+(i.targetY-n)+"Z":"M "+i.targetX+" "+(i.targetY-n)+" L"+i.rightInnerExtent+" "+(i.targetY-n)+"A"+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n)+" "+(i.targetY+i.rightSmallArcRadius)+"L"+(i.rightFullExtent-n)+" "+i.verticalRightInnerExtent+"A"+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+i.rightInnerExtent+" "+(i.verticalFullExtent+n)+"L"+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+"A"+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent+"L"+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+"A"+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+"L"+i.sourceX+" "+(i.sourceY-n)+"L"+i.sourceX+" "+(i.sourceY+n)+"L"+i.leftInnerExtent+" "+(i.sourceY+n)+"A"+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+"L"+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent+"A"+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+"L"+i.rightInnerExtent+" "+(i.verticalFullExtent-n)+"A"+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n)+" "+i.verticalRightInnerExtent+"L"+(i.rightFullExtent+n)+" "+(i.targetY+i.rightSmallArcRadius)+"A"+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+i.rightInnerExtent+" "+(i.targetY+n)+"L"+i.targetX+" "+(i.targetY+n)+"Z";var r,n,i,a=e.link.source.x1,o=e.link.target.x0,s=g(a,o),l=s(t),u=s(1-t),c=e.link.y0-e.link.width/2,f=e.link.y0+e.link.width/2,h=e.link.y1-e.link.width/2,p=e.link.y1+e.link.width/2;return"M"+a+","+c+"C"+l+","+c+" "+u+","+h+" "+o+","+h+"L"+o+","+p+"C"+u+","+p+" "+l+","+f+" "+a+","+f+"Z"}}function x(t){t.attr("transform",function(t){return"translate("+t.node.x0.toFixed(3)+", "+t.node.y0.toFixed(3)+")"})}function b(t){t.call(x)}function _(t,e){t.call(b),e.attr("d",y())}function w(t){t.attr("width",function(t){return t.node.x1-t.node.x0}).attr("height",function(t){return t.visibleHeight})}function k(t){return t.link.width>1||t.linkLineWidth>0}function A(t){var e="translate("+t.translateX+","+t.translateY+")";return e+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function T(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function M(t){return i.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+n.nodeTextOffsetHorizontal:n.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-n.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-n.nodeTextOffsetHorizontal,0]])}function E(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function S(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function C(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function L(t){return t.horizontal&&t.left?"100%":"0%"}function O(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 I(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,D(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,i){!function(t){for(var e=0;e0&&i.forceLayouts[e].alpha(0)}}(0,e,a,r)).stop()}(0,o,i),function(t,e,r,i,a){window.requestAnimationFrame(function o(){var s;for(s=0;s0)window.requestAnimationFrame(o);else{var u=r.node.originalX;r.node.x0=u-r.visibleWidth/2,r.node.x1=u+r.visibleWidth/2,P(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),D(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),_(t.filter(z(r)),e))}}).on("dragend",function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;eo+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}(y=A.nodes);!function(t){t.forEach(function(t){var e,r,n,i=0,a=t.length;for(t.sort(function(t,e){return t.y0-e.y0}),n=0;n=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p})}(O)}i.update(A)}return{circular:b,key:r,trace:s,guid:f.randstr(),horizontal:h,width:g,height:m,nodePad:s.node.pad,nodeLineColor:s.node.line.color,nodeLineWidth:s.node.line.width,linkLineColor:s.link.line.color,linkLineWidth:s.link.line.width,valueFormat:s.valueformat,valueSuffix:s.valuesuffix,textFont:s.textfont,translateX:c.x[0]*t.width+t.margin.l,translateY:t.height-c.y[1]*t.height+t.margin.t,dragParallel:h?m:g,dragPerpendicular:h?g:m,arrangement:s.arrangement,sankey:i,graph:A,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}.bind(null,c)),_=e.selectAll("."+n.cn.sankey).data(b,p);_.exit().remove(),_.enter().append("g").classed(n.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").attr("transform",A),_.each(function(e,r){t._fullData[r]._sankey=e;var n="bgsankey-"+e.trace.uid+"-"+r;f.ensureSingle(t._fullLayout._draggers,"rect",n),t._fullData[r]._bgRect=i.select("."+n),t._fullData[r]._bgRect.style("pointer-events","all").attr("width",e.width).attr("height",e.height).attr("x",e.translateX).attr("y",e.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),_.transition().ease(n.ease).duration(n.duration).attr("transform",A);var P=_.selectAll("."+n.cn.sankeyLinks).data(d,p);P.enter().append("g").classed(n.cn.sankeyLinks,!0).style("fill","none");var D=P.selectAll("."+n.cn.sankeyLink).data(function(t){var e=t.graph.links;return e.filter(function(t){return t.value}).map(function(t,e,r){var n=a(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:o.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:y,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}.bind(null,t))},p);D.enter().append("path").classed(n.cn.sankeyLink,!0).call(O,_,h.linkEvents),D.style("stroke",function(t){return k(t)?o.tinyRGB(a(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return k(t)?o.opacity(t.linkLineColor):t.tinyColorAlpha}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}).style("stroke-width",function(t){return k(t)?t.linkLineWidth:1}).attr("d",y()),D.style("opacity",function(){return t._context.staticPlot||g||m?1:0}).transition().ease(n.ease).duration(n.duration).style("opacity",1),D.exit().transition().ease(n.ease).duration(n.duration).style("opacity",0).remove();var z=_.selectAll("."+n.cn.sankeyNodeSet).data(d,p);z.enter().append("g").classed(n.cn.sankeyNodeSet,!0),z.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var R=z.selectAll("."+n.cn.sankeyNode).data(function(t){var e=t.graph.nodes;return function(t){var e,r=[];for(e=0;e5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),U.transition().ease(n.ease).duration(n.duration).attr("startOffset",L).style("fill",C)}},{"../../components/color":580,"../../components/drawing":601,"../../lib":703,"../../lib/gup":701,"../../registry":831,"./constants":1068,"@plotly/d3-sankey":51,d3:157,"d3-force":149,"d3-interpolate":151,"d3-sankey-circular":154,tinycolor2:524}],1073:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.cd,n=[],i=r[0].trace,a=i._sankey.graph.nodes,o=0;os&&T[g].gap;)g--;for(y=T[g].s,d=T.length-1;d>g;d--)T[d].s=y;for(;sM[c]&&c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1082:[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"),u=t("./stack_defaults"),c=t("./marker_defaults"),f=t("./line_defaults"),h=t("./line_shape_defaults"),p=t("./text_defaults"),d=t("./fillcolor_defaults");e.exports=function(t,e,r,v){function g(r,i){return n.coerce(t,e,a,r,i)}var m=l(t,e,v,g);if(m||(e.visible=!1),e.visible){var y=u(t,e,v,g),x=!y&&mG!=F>=G&&(D=I[L-1][0],z=I[L][0],F-R&&(P=D+(z-D)*(G-R)/(F-R),V=Math.min(V,P),U=Math.max(U,P)));V=Math.max(V,0),U=Math.min(U,h._length);var W=s.defaultLine;return s.opacity(f.fillcolor)?W=f.fillcolor:s.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:U,y0:G,y1:G,color:W,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":580,"../../components/fx":619,"../../lib":703,"../../registry":831,"./get_trace_color":1084}],1086:[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"),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":762,"./arrays_to_calcdata":1074,"./attributes":1075,"./calc":1076,"./cross_trace_calc":1080,"./cross_trace_defaults":1081,"./defaults":1082,"./hover":1085,"./marker_colorbar":1092,"./plot":1094,"./select":1095,"./style":1097,"./subtypes":1098}],1087:[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 u=(t.marker||{}).color;if(s("line.color",r),i(t,"line"))a(t,e,o,s,{prefix:"line.",cLetter:"c"});else{var c=!n(u)&&u||r;s("line.color",c)}s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":590,"../../components/colorscale/helpers":591,"../../lib":703}],1088:[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"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,a,h,p,d,v,g,m,y,x,b,_,w,k,A,T,M,E=e.xaxis,S=e.yaxis,C="log"===E.type,L="log"===S.type,O=E._length,I=S._length,P=e.connectGaps,D=e.baseTolerance,z=e.shape,R="linear"===z,F=e.fill&&"none"!==e.fill,B=[],N=f.minTolerance,j=t.length,V=new Array(j),U=0;function H(e){var r=t[e];if(!r)return!1;var n=E.c2p(r.x),a=S.c2p(r.y);if(n===i){if(C&&(n=E.c2p(r.x,!0)),n===i)return!1;L&&a===i&&(n*=Math.abs(E._m*I*(E._m>0?o:s)/(S._m*O*(S._m>0?o:s)))),n*=1e3}if(a===i){if(L&&(a=S.c2p(r.y,!0)),a===i)return!1;a*=1e3}return[n,a]}function q(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&urt||t[1]it)return[c(t[0],et,rt),c(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 u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u),s}}function ut(t){var e=t[0],r=t[1],n=e===V[U-1][0],i=r===V[U-1][1];if(!n||!i)if(U>1){var a=e===V[U-2][0],o=r===V[U-2][1];n&&(e===et||e===rt)&&a?o?U--:V[U-1]=t:i&&(r===nt||r===it)&&o?a?U--:V[U-1]=t:V[U++]=t}else V[U++]=t}function ct(t){V[U-1][0]!==t[0]&&V[U-1][1]!==t[1]&&ut([Z,$]),ut(t),J=null,Z=$=0}function ft(t){if(T=t[0]/O,M=t[1]/I,Y=t[0]rt?rt:0,X=t[1]it?it:0,Y||X){if(U)if(J){var e=Q(J,t);e.length>1&&(ct(e[0]),V[U++]=e[1])}else K=Q(V[U-1],t)[0],V[U++]=K;else V[U++]=[Y||t[0],X||t[1]];var r=V[U-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(J&&(Z!==Y&&$!==X?ut(Z&&$?(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]):[Z||Y,$||X]):Z&&$&&ut([Z,$])),ut([Y,X])):Z-Y&&$-X&&ut([Y||Z,X||$]),J=t,Z=Y,$=X}else J&&ct(Q(J,t)[0]),V[U++]=t;var n,i,a,o}for("linear"===z||"spline"===z?Q=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=u(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&&W(o,t)G(d,ht))break;a=d,(_=m[0]*g[0]+m[1]*g[1])>x?(x=_,h=d,v=!1):_=t.length||!d)break;ft(d),n=d}}else ft(h)}J&&ut([Z||J[0],$||J[1]]),B.push(V.slice(0,U))}return B}},{"../../constants/numerical":680,"../../lib":703,"./constants":1079}],1089:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],1090:[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,u={},c=!1,f=-1,h=0,p=-1;for(a=0;a=0?l=p:(l=p=h,h++),l0?Math.max(e,i):0}}},{"fast-isnumeric":224}],1092:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1093:[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,u){var c,f=o.isBubble(t),h=(t.line||{}).color;if(u=u||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",f?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(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||(c=h&&!Array.isArray(h)&&e.marker.color!==h?h:f?n.background:n.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",f?1:0)),f&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){var p=l("marker.gradient.type");"none"!==p&&l("marker.gradient.color")}}},{"../../components/color":580,"../../components/colorscale/defaults":590,"../../components/colorscale/helpers":591,"./subtypes":1098}],1094:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function p(t,e,r,f,p,d,v){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(u.hasMarkers(h)){var p=h.marker.maxdisplayed;if(0!==p){var d=i.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),v=Math.ceil(d.length/p),g=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 x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(d),A=o(k,"g","errorbars"),T=o(k,"g","lines"),M=o(k,"g","points"),E=o(k,"g","text");if(i.getComponentMethod("errorbars","plot")(t,A,r,v),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),r.isRangePlot||(f[0].node3=k);var O,I,P="",D=[],z=_._prevtrace;z&&(P=z._prevRevpath||"",C=z._nextFill,D=z._polygons);var R,F,B,N,j,V,U,H="",q="",G=[],W=a.noop;if(S=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(C&&C.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=c(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(G.length),g=0;g1){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 i=y(r);i.attr("d",O),l.singleLineStyle(f,i)}}}}}var Y=T.selectAll(".js-line").data(G);y(Y.exit()).style("opacity",0).remove(),Y.each(W(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(Y,r.layerClipId,t),G.length?(S?(S.datum(f),N&&V&&(L?("y"===L?N[1]=V[1]=b.c2p(0,!0):"x"===L&&(N[0]=V[0]=x.c2p(0,!0)),y(S).attr("d","M"+V+"L"+N+"L"+H.substr(1)).call(l.singleFillStyle)):y(S).attr("d",H+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&H&&P?("tonext"===_.fill?y(C).attr("d",H+"Z"+P+"Z").call(l.singleFillStyle):y(C).attr("d",H+"L"+P.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(D)):($(C),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(S?$(S):C&&$(C),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),E.datum(f),function(e,i,a){var o,c,f=a[0].trace,h=u.hasMarkers(f),p=u.hasText(f),d=et(f),v=rt,g=rt;if(h||p){var _=s,w=f.stackgroup,k=w&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][w].stackgaps;f.marker.maxdisplayed||f._needsCull?_=k?K:J:w&&!k&&(_=Q),h&&(v=_),p&&(g=_)}c=e.selectAll("path.point");var A,T=(o=c.data(v,d)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,f,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),h&&(A=l.makePointStyleFns(f)),o.each(function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,x,b)?(l.singlePointStyle(e,a,f,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,x,b,f.xcalendar,f.ycalendar),f.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),c=i.selectAll("g"),(o=c.data(g,d)).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,f.xcalendar,f.ycalendar):e.remove()}),o.selectAll("text").call(l.textPointStyle,f,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,E,f);var X=!1===_.cliponaxis,Z=X?null:r.layerClipId;l.setClipUrl(M,Z,t),l.setClipUrl(E,Z,t)}function $(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 tt(t){return t.id}function et(t){if(t.ids)return tt}function rt(){return!1}}e.exports=function(t,e,r,i,a,u){var c,h,d=!a,v=!!a&&a.duration>0,g=f(t,e,r);if((c=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),c.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,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each(function(t){a[t]=null}).remove(),c.order().each(function(t){a[t]=o(n.select(this),"path","js-fill")})})}(t,c,e),v){u&&(h=u());var m=n.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()});m.each(function(){i.selectAll("g.trace").each(function(r,n){p(t,n,e,r,g,this,a)})})}else c.each(function(r,n){p(t,n,e,r,g,this,a)});d&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":601,"../../lib":703,"../../lib/polygon":715,"../../registry":831,"./line_points":1088,"./link_traces":1090,"./subtypes":1098,d3:157}],1095:[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,u=t.yaxis,c=[],f=s[0].trace,h=!n.hasMarkers(f)&&!n.hasText(f);if(h)return[];if(!1===e)for(r=0;r0){var h=i.c2l(c);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 y(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function x(t,e){return e(4*t)}function b(t){return p[t]}function _(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var v=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",p||d);for(var v=["x","y","z"],g=0;g<3;++g){var m="projection."+v[g];f(m+".show")&&(f(m+".opacity"),f(m+".scale"))}var y=n.getComponentMethod("errorbars","supplyDefaults");y(t,e,p||d||r,{axis:"z"}),y(t,e,p||d||r,{axis:"y",inherit:"z"}),y(t,e,p||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":703,"../../registry":831,"../scatter/line_defaults":1087,"../scatter/marker_defaults":1093,"../scatter/subtypes":1098,"../scatter/text_defaults":1099,"./attributes":1101}],1106:[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"],meta:{}}},{"../../constants/gl3d_markers":678,"../../plots/gl3d":791,"./attributes":1101,"./calc":1102,"./convert":1104,"./defaults":1105}],1107:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/fx/hovertemplate_attributes"),o=t("../../components/colorscale/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:c.width,editType:"calc"},o("marker.line")),gradient:l.gradient,editType:"calc"},o("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../scatter/attributes":1075}],1108:[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 u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var c,f,h=e._length,p=new Array(h),d=!1;for(u=0;u")}return o}function A(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,_.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":703,"../scatter/hover":1085}],1112:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),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":762,"../scatter/marker_colorbar":1092,"../scatter/select":1095,"../scatter/style":1097,"./attributes":1107,"./calc":1108,"./defaults":1109,"./event_data":1110,"./hover":1111,"./plot":1113}],1113:[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,u,c=r[0][0].carpet,f={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,f,r,o),s=0;s")}function d(t){return i.tickText(r,r.c2l(t),"hover").text+"°"}}(c,g,p.mockAxis,u[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":619,"../../constants/numerical":680,"../../lib":703,"../../plots/cartesian/axes":751,"../scatter/get_trace_color":1084,"./attributes":1114}],1119:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./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":781,"../scatter/marker_colorbar":1092,"../scatter/style":1097,"./attributes":1114,"./calc":1115,"./defaults":1116,"./event_data":1117,"./hover":1118,"./plot":1120,"./select":1121,"./style":1122}],1120:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),u=t("../scatter/subtypes"),c=t("./style");function f(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=o(r,e),i=r.locationmode,l=0;lp.TOO_MANY_POINTS?"rect":f.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var h=n[0],d=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(u)?u.length>1?u[i]:u[0]:u,g=v[p],m=v[d],y=c?c/.8+1:0,x=-m*y-.5*m;o.offset[i]=[g*y/h,x/h]}}return o}}},{"../../components/drawing":601,"../../constants/interactions":679,"../../lib":703,"../../lib/gl_format_color":700,"../../plots/cartesian/axis_ids":754,"../../registry":831,"../scatter/make_bubble_size_func":1091,"../scatter/subtypes":1098,"./constants":1124,"color-normalize":113,"fast-isnumeric":224,"svg-path-sdf":522}],1126:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../scatter/constants"),s=t("../scatter/subtypes"),l=t("../scatter/xy_defaults"),u=t("../scatter/marker_defaults"),c=t("../scatter/line_defaults"),f=t("../scatter/fillcolor_defaults"),h=t("../scatter/text_defaults");e.exports=function(t,e,r,p){function d(r,i){return n.coerce(t,e,a,r,i)}var v=!!t.marker&&/-open/.test(t.marker.symbol),g=s.isBubble(t),m=l(t,e,p,d);if(m){var y=m=T,d=2*h,v={},b=s.makeCalcdata(e,"x"),_=l.makeCalcdata(e,"y"),w=new Array(d);for(r=0;r1&&u.extendFlat(o.line,k.linePositions(t,r,n)),o.errorX||o.errorY){var s=k.errorBarPositions(t,r,n,i,a);o.errorX&&u.extendFlat(o.errorX,s.x),o.errorY&&u.extendFlat(o.errorY,s.y)}return o.text&&(u.extendFlat(o.text,{positions:n},k.textPosition(t,r,o.text,o.marker)),u.extendFlat(o.textSel,{positions:n},k.textPosition(t,r,o.text,o.markerSel)),u.extendFlat(o.textUnsel,{positions:n},k.textPosition(t,r,o.text,o.markerUnsel))),o}(t,0,e,w,b,_),O=S(0,c);return y(a,e),p?L.marker&&(C=2*(L.marker.sizeAvg||Math.max(L.marker.size,3))):C=g(e,h),m(t,e,s,l,b,_,C),L.errorX&&E(e,s,L.errorX),L.errorY&&E(e,l,L.errorY),L.fill&&!O.fill2d&&(O.fill2d=!0),L.marker&&!O.scatter2d&&(O.scatter2d=!0),L.line&&!O.line2d&&(O.line2d=!0),!L.errorX&&!L.errorY||O.error2d||(O.error2d=!0),L.text&&!O.glText&&(O.glText=!0),L.marker&&(L.marker.snap=v.tree||T),O.lineOptions.push(L.line),O.errorXOptions.push(L.errorX),O.errorYOptions.push(L.errorY),O.fillOptions.push(L.fill),O.markerOptions.push(L.marker),O.markerSelectedOptions.push(L.markerSel),O.markerUnselectedOptions.push(L.markerUnsel),O.textOptions.push(L.text),O.textSelectedOptions.push(L.textSel),O.textUnselectedOptions.push(L.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),v._scene=O,v.index=O.count,v.x=b,v.y=_,v.positions=w,O.count++,[{x:!1,y:!1,t:v,trace:e}]},plot:function(t,e,r){if(r.length){var o,l,f=t._fullLayout,h=e._scene,p=e.xaxis,v=e.yaxis;if(h)if(c(t,["ANGLE_instanced_arrays","OES_element_index_uint"])){var g=h.count,m=f._glcanvas.data()[0].regl;if(b(t,e,r),h.dirty){if(!0===h.error2d&&(h.error2d=a(m)),!0===h.line2d&&(h.line2d=i(m)),!0===h.scatter2d&&(h.scatter2d=n(m)),!0===h.fill2d&&(h.fill2d=i(m)),!0===h.glText)for(h.glText=new Array(g),o=0;oh.glText.length){var y=g-h.glText.length;for(o=0;or&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t}),h.line2d.update(h.lineOptions)),h.error2d){var w=(h.errorXOptions||[]).concat(h.errorYOptions||[]);h.error2d.update(w)}h.scatter2d&&h.scatter2d.update(h.markerOptions),h.fillOrder=u.repeat(null,g),h.fill2d&&(h.fillOptions=h.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,u=h.lineOptions[e],c=[];s._ownfill&&c.push(e),s._nexttrace&&c.push(e+1),c.length&&(h.fillOrder[e]=c);var f,p,d=[],v=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(v[p+1]);)p-=2;0!==v[f+1]&&(d=[v[f],0]),d=d.concat(v.slice(f,p+2)),0!==v[p+1]&&(d=d.concat([v[p],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(v[p]);)p-=2;0!==v[f]&&(d=[0,v[f+1]]),d=d.concat(v.slice(f,p+2)),0!==v[p]&&(d=d.concat([0,v[p+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(d=[],i=0,a=0;a-1;for(o=0;o-1;l--)o=y[i[l]],s=x[i[l]],u=g.c2p(o)-b,c=m.c2p(s)-_,(f=Math.sqrt(u*u+c*c))=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),d=360*p,v=e-d;if(n.getClosest(l,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-c.c2p([v,a]),u=o.y-f.c2p([n,r]),p=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-p,1-3/p)},t),!1!==t.index){var g=l[t.index],m=g.lonlat,y=[i.modHalf(m[0],360)+d,m[1]],x=c.c2p(y),b=f.c2p(y),_=g.mrc||1;return t.x0=x-_,t.x1=x+_,t.y0=b-_,t.y1=b+_,t.color=a(u,g),t.extraText=function(t,e,r){if(!t.hovertemplate){var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),a=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,u=[];return i||a&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):a?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1])),(i||-1!==n.indexOf("text"))&&o(e,t,u),u.join("
")}function c(t){return t+"°"}}(u,g,l[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}},{"../../components/fx":619,"../../constants/numerical":680,"../../lib":703,"../scatter/get_trace_color":1084}],1133:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),style:function(t,e){if(e){var r=e[0].trace;r._glTrace.update(e)}},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatterlike"],meta:{}}},{"../../plots/mapbox":806,"../scatter/marker_colorbar":1092,"../scattergeo/calc":1115,"./attributes":1128,"./defaults":1130,"./event_data":1131,"./hover":1132,"./plot":1134,"./select":1135}],1134:[function(t,e,r){"use strict";var n=t("./convert");function i(t,e){this.subplot=t,this.uid=e,this.sourceIds={fill:e+"-source-fill",line:e+"-source-line",circle:e+"-source-circle",symbol:e+"-source-symbol"},this.layerIds={fill:e+"-layer-fill",line:e+"-layer-line",circle:e+"-layer-circle",symbol:e+"-layer-symbol"},this.order=["fill","line","circle","symbol"]}var a=i.prototype;a.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},a.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},a.addLayer=function(t,e){this.subplot.map.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint})},a.update=function(t){for(var e=this.subplot,r=n(t),i=0;i")}}e.exports={hoverPoints:function(t,e,r,i){var a=n(t,e,r,i);if(a&&!1!==a[0].index){var s=a[0];if(void 0===s.index)return a;var l=t.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,o(u,c,l,s),s.hovertemplate=c.hovertemplate,a}},makeHoverPointText:o}},{"../../lib":703,"../../plots/cartesian/axes":751,"../scatter/hover":1085}],1140:[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"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":815,"../scatter/marker_colorbar":1092,"../scatter/select":1095,"../scatter/style":1097,"./attributes":1136,"./calc":1137,"./defaults":1138,"./hover":1139,"./plot":1141}],1141:[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,u=0;u=h&&(y.marker.cluster=d.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&u.extendFlat(y.line,l.linePositions(t,p,_)),y.text&&(u.extendFlat(y.text,{positions:_},l.textPosition(t,p,y.text,y.marker)),u.extendFlat(y.textSel,{positions:_},l.textPosition(t,p,y.text,y.markerSel)),u.extendFlat(y.textUnsel,{positions:_},l.textPosition(t,p,y.text,y.markerUnsel))),y.fill&&!c.fill2d&&(c.fill2d=!0),y.marker&&!c.scatter2d&&(c.scatter2d=!0),y.line&&!c.line2d&&(c.line2d=!0),y.text&&!c.glText&&(c.glText=!0),c.lineOptions.push(y.line),c.fillOptions.push(y.fill),c.markerOptions.push(y.marker),c.markerSelectedOptions.push(y.markerSel),c.markerUnselectedOptions.push(y.markerUnsel),c.textOptions.push(y.text),c.textSelectedOptions.push(y.textSel),c.textUnselectedOptions.push(y.textUnsel),c.selectBatch.push([]),c.unselectBatch.push([]),d.x=w,d.y=k,d.rawx=w,d.rawy=k,d.r=g,d.theta=m,d.positions=_,d._scene=c,d.index=c.count,c.count++}}),a.plot(t,e,r)}},hoverPoints:function(t,e,r,n){var i=t.cd[0].t,o=i.r,s=i.theta,l=a.hoverPoints(t,e,r,n);if(l&&!1!==l[0].index){var u=l[0];if(void 0===u.index)return l;var c=t.subplot,h=u.cd[u.index],p=u.trace;if(h.r=o[u.index],h.theta=s[u.index],c.isPtInside(h))return u.xLabelVal=void 0,u.yLabelVal=void 0,f(h,p,c,u),l}},selectPoints:a.selectPoints,meta:{}}},{"../../lib":703,"../../plots/cartesian/axes":751,"../../plots/polar":815,"../scatter/calc":1076,"../scatter/colorscale_calc":1078,"../scatter/marker_colorbar":1092,"../scattergl":1127,"../scattergl/constants":1124,"../scattergl/convert":1125,"../scatterpolar/hover":1139,"./attributes":1142,"./defaults":1143,"fast-isnumeric":224,"point-cluster":464}],1145:[function(t,e,r){"use strict";var n=t("../../components/fx/hovertemplate_attributes"),i=t("../scatter/attributes"),a=t("../../plots/attributes"),o=t("../../components/colorscale/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,u=i.marker,c=i.line,f=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:l({},i.mode,{dflt:"markers"}),text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),line:{color:c.color,width:c.width,dash:s,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:i.connectgaps,cliponaxis:i.cliponaxis,fill:l({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i.fillcolor,marker:l({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({width:f.width,editType:"calc"},o("marker.line")),gradient:u.gradient,editType:"calc"},o("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:l({},a.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:i.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":587,"../../components/drawing/attributes":600,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../scatter/attributes":1075}],1146:[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"],u={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,c,f,h,p,d,v=t._fullLayout[e.subplot],g=v.sum,m=e.sum||g,y={a:e.a,b:e.b,c:e.c};for(r=0;r"),s.hovertemplate=p.hovertemplate,o}function y(t,e){g.push(t._hovertitle+": "+i.tickText(t,e,"hover").text)}}},{"../../plots/cartesian/axes":751,"../scatter/hover":1085}],1150:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),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":827,"../scatter/marker_colorbar":1092,"../scatter/select":1095,"../scatter/style":1097,"./attributes":1145,"./calc":1146,"./defaults":1147,"./event_data":1148,"./hover":1149,"./plot":1151}],1151:[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":1094}],1152:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/fx/hovertemplate_attributes"),o=t("../scattergl/attributes"),s=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template").templatedArray,u=t("../../lib/extend").extendFlat,c=n.marker,f=c.line,h=u(i("marker.line",{editTypeOverride:"calc"}),{width:u({},f.width,{editType:"calc"}),editType:"calc"}),p=u(i("marker"),{symbol:c.symbol,size:u({},c.size,{editType:"markerSize"}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,colorbar:c.colorbar,line:h,editType:"calc"});function d(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[t],editType:"plot"}}}p.color.editType=p.cmin.editType=p.cmax.editType="style",e.exports={dimensions:l("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({},o.text,{}),hovertext:u({},o.hovertext,{}),hovertemplate:a(),marker:p,xaxes:d("x"),yaxes:d("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:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plot_api/plot_template":741,"../../plots/cartesian/constants":757,"../scatter/attributes":1075,"../scattergl/attributes":1123}],1153:[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,u=t("../../plots/cartesian/axes").shouldShowZeroLine,c="splom";function f(t,e,r){for(var n=r.matrixOptions.data.length,i=e._visibleDims,a=r.viewOpts.ranges=new Array(n),o=0;oa&&l?r._splomSubplots[E]=1:i-1,T="lasso"===y||"select"===y||!!h.selectedpoints||A,M=!0;if(T){var E=h._length;if(h.selectedpoints){d.selectBatch=h.selectedpoints;var S=h.selectedpoints,C={};for(a=0;ag?2*(x.sizeAvg||Math.max(x.size,3)):u(e,y),n=0;n2?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 v(t,e){var r=t.fullSceneLayout,i=t.dataScale,c=e._len,f={};function v(t,e){var n=r[e],o=i[u[e]];return a.simpleMap(t,function(t){return n.d2l(t)*o})}f.vectors=l(v(e.u,"xaxis"),v(e.v,"yaxis"),v(e.w,"zaxis"),c);var g=h(e.x.slice(0,c)),m=h(e.y.slice(0,c)),y=h(e.z.slice(0,c));if(g.length*m.length*y.length>c)return{positions:[],cells:[]};var x=v(g,"xaxis"),b=v(m,"yaxis"),_=v(y,"zaxis");if(f.meshgrid=[x,b,_],e.starts){var w=e._slen;f.startingPositions=l(v(e.starts.x.slice(0,w),"xaxis"),v(e.starts.y.slice(0,w),"yaxis"),v(e.starts.z.slice(0,w),"zaxis"))}else{for(var k=b[0],A=p(x),T=p(_),M=new Array(A.length*T.length),E=0,S=0;S=0};v?(r=Math.min(d.length,m.length),s=function(t){return k(d[t])&&A(t)},u=function(t){return String(d[t])}):(r=Math.min(g.length,m.length),s=function(t){return k(g[t])&&A(t)},u=function(t){return String(g[t])}),x&&(r=Math.min(r,y.length));for(var T=0;T1){for(var C=a.randstr(),L=0;L0,h=n.select(r),p=h.selectAll("g.slice"),m=e[0],y=m.trace,w=m.hierarchy,M=x(w,y.level),E=y.maxdepth>=0?y.maxdepth:1/0,S=o._size,C=y.domain,L=S.w*(C.x[1]-C.x[0]),O=S.h*(C.y[1]-C.y[0]),I=.5*Math.min(L,O),P=m.cx=S.l+S.w*(C.x[1]+C.x[0])/2,D=m.cy=S.t+S.h*(1-C.y[0])-O/2;if(!M)return p.remove();var z=null,R={};c&&p.each(function(t){R[k(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!z&&_(t)&&(z=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=E;m.hasMultipleRoots&&b(M)&&(F=F.slice(1),B-=1,N=1,j+=1),F=F.filter(function(t){return t.y1<=j});var V=Math.min(B,E),U=function(t){return(t-N)/V*I},H=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},q=function(t){return u.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,P,D)},G=function(t){return P+t.pxmid[0]*t.transform.rCenter+(t.transform.x||0)},W=function(t){return D+t.pxmid[1]*t.transform.rCenter+(t.transform.y||0)};(p=p.data(F,function(t){return k(t)})).enter().append("g").classed("slice",!0),c?p.exit().transition().each(function(){var t=n.select(this),e=t.select("path.surface");e.transition().attrTween("d",function(t){var e=function(t){var e,r=k(t),i=R[r],a=R[k(M)];if(a){var o=t.x1>a.x1?2*Math.PI:0;e=t.rpx1Y?2*Math.PI:0;e={x0:a,x1:a}}else e={rpx0:I,rpx1:I},u.extendFlat(e,$(t));else e={rpx0:0,rpx1:0};else e={x0:0,x1:0};return n.interpolate(e,i)}(t);return function(t){return q(e(t))}}):a.attr("d",q),i.call(T,t,e).call(A,t,{isTransitioning:t._transitioning}),a.call(g,r,y);var h=u.ensureSingle(i,"g","slicetext"),p=u.ensureSingle(h,"text","",function(t){t.attr("data-notex",1)});p.text(function(t,e,r){var n=e.textinfo;if(!n||"none"===n)return"";var i=t.data.data,a=r.separators,o=n.split("+"),s=function(t){return-1!==o.indexOf(t)},l=[];if(s("label")&&i.label&&l.push(i.label),i.hasOwnProperty("v")&&s("value")&&l.push(v(i.v,a)),s("text")){var c=u.castOption(e,i.i,"text");u.isValidTextValue(c)&&l.push(c)}return l.join("
")}(r,y,o)).classed("slicetext",!0).attr("text-anchor","middle").call(l.font,b(r)?function(t,e,r){var n=e.data.data.i,i=u.castOption(t,n,"outsidetextfont.color")||u.castOption(t,n,"textfont.color")||r.color,a=u.castOption(t,n,"outsidetextfont.family")||u.castOption(t,n,"textfont.family")||r.family,o=u.castOption(t,n,"outsidetextfont.size")||u.castOption(t,n,"textfont.size")||r.size;return{color:i,family:a,size:o}}(y,r,o.font):function(t,e,r){var n=e.data.data,i=n.i,a=u.castOption(t,i,"insidetextfont.color");!a&&t._input.textfont&&(a=u.castOption(t._input,i,"textfont.color"));var o=u.castOption(t,i,"insidetextfont.family")||u.castOption(t,i,"textfont.family")||r.family,l=u.castOption(t,i,"insidetextfont.size")||u.castOption(t,i,"textfont.size")||r.size;return{color:a||s.contrast(n.color),family:o,size:l}}(y,r,o.font)).call(f.convertToTspans,t);var x=l.bBox(p.node());r.transform=d(x,r,m),r.translateX=G(r),r.translateY=W(r);var _=function(t,e){return"translate("+t.translateX+","+t.translateY+")"+(t.transform.scale<1?"scale("+t.transform.scale+")":"")+(t.transform.rotate?"rotate("+t.transform.rotate+")":"")+"translate("+-(e.left+e.right)/2+","+-(e.top+e.bottom)/2+")"};c?p.transition().attrTween("transform",function(t){var e=function(t){var e,r=R[k(t)],i=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},z)if(t.parent)if(Y){var a=t.x1>Y?2*Math.PI:0;e.x0=e.x1=a}else u.extendFlat(e,$(t));else e.x0=e.x1=0;else e.x0=e.x1=0;var o=n.interpolate(e.rpx1,t.rpx1),s=n.interpolate(e.x0,t.x0),l=n.interpolate(e.x1,t.x1),c=n.interpolate(e.transform.scale,i.scale),f=n.interpolate(e.transform.rotate,i.rotate),h=0===i.rCenter?3:0===e.transform.rCenter?1/3:1,p=n.interpolate(e.transform.rCenter,i.rCenter);return function(t){var e=o(t),r=s(t),n=l(t),a=function(t){return p(Math.pow(t,h))}(t),u={pxmid:H(e,(r+n)/2),transform:{rCenter:a,x:i.x,y:i.y}},d={rpx1:o(t),translateX:G(u),translateY:W(u),transform:{scale:c(t),rotate:f(t),rCenter:a}};return d}}(t);return function(t){return _(e(t),x)}}):p.attr("transform",_(r,x))})}function x(t,e){var r;return e&&t.eachAfter(function(t){if(k(t)===e)return r=t.copy()}),r||t}function b(t){var e=t.data.data;return""===e.pid}function _(t){return!t.parent}function w(t){return!t.children}function k(t){var e=t.data.data;return e.id}function A(t,e,r){var n=t.datum(),i=(r||{}).isTransitioning;h(t,i||w(n)||b(n)?null:"pointer")}function T(t,e,r){var i=r[0],s=i.trace;"_hasHoverLabel"in s||(s._hasHoverLabel=!1),"_hasHoverEvent"in s||(s._hasHoverEvent=!1),t.on("mouseover",function(t){var r=e._fullLayout;if(!e._dragging&&!1!==r.hovermode){var a=e._fullData[s.index],l=t.data.data,c=l.i,f=function(t){return u.castOption(a,c,t)},h=f("hovertemplate"),p=o.castHoverinfo(a,r,c),d=r.separators;if(h||p&&"none"!==p&&"skip"!==p){var g=t.rInscribed,m=i.cx+t.pxmid[0]*(1-g),y=i.cy+t.pxmid[1]*(1-g),x={},b=[],_=[],w=function(t){return-1!==b.indexOf(t)};if(p&&(b="all"===p?a._module.attributes.hoverinfo.flags:p.split("+")),x.label=l.label,w("label")&&x.label&&_.push(x.label),l.hasOwnProperty("v")&&(x.value=l.v,x.valueLabel=v(x.value,d),w("value")&&_.push(x.valueLabel)),x.text=f("hovertext")||f("text"),w("text")){var k=x.text;u.isValidTextValue(k)&&_.push(k)}o.loneHover({trace:a,x0:m-g*t.rpx1,x1:m+g*t.rpx1,y:y,idealAlign:t.pxmid[0]<0?"left":"right",text:_.join("
"),name:h||w("name")?a.name:void 0,color:f("hoverlabel.bgcolor")||l.color,borderColor:f("hoverlabel.bordercolor"),fontFamily:f("hoverlabel.font.family"),fontSize:f("hoverlabel.font.size"),fontColor:f("hoverlabel.font.color"),nameLength:f("hoverlabel.namelength"),textAlign:f("hoverlabel.align"),hovertemplate:h,hovertemplateLabels:x,eventData:[M(t,a)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),s._hasHoverLabel=!0}s._hasHoverEvent=!0,e.emit("plotly_hover",{points:[M(t,a)],event:n.event})}}),t.on("mouseout",function(t){var r=e._fullLayout,i=e._fullData[s.index],a=n.select(this).datum();s._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[M(a,i)],event:n.event}),s._hasHoverEvent=!1),s._hasHoverLabel&&(o.loneUnhover(r._hoverlayer.node()),s._hasHoverLabel=!1)}),t.on("click",function(t){var r=e._fullLayout,l=e._fullData[s.index],u=c.triggerHandler(e,"plotly_sunburstclick",{points:[M(t,l)],event:n.event});if(!1===u||w(t)||b(t))r.hovermode&&(e._hoverdata=[M(t,l)],o.click(e,n.event));else if(!e._dragging&&!e._transitioning){a.call("_storeDirectGUIEdit",l,r._tracePreGUI[l.uid],{level:l.level});var f=i.hierarchy,h=k(t),p=_(t)?function(t,e){var r;return t.eachAfter(function(t){for(var n=t.children||[],i=0;i0;if((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(),c){i&&(o=i());var f=n.transition().duration(r.duration).ease(r.easing).each("end",function(){o&&o()}).each("interrupt",function(){o&&o()});f.each(function(){l.selectAll("g.trace").each(function(e){y(t,e,this,r)})})}else a.each(function(e){y(t,e,this,r)});u&&a.exit().remove()}},{"../../components/color":580,"../../components/drawing":601,"../../components/fx":619,"../../components/fx/helpers":615,"../../lib":703,"../../lib/events":692,"../../lib/setcursor":723,"../../lib/svg_text_utils":727,"../../registry":831,"../pie/helpers":1054,"../pie/plot":1058,"./constants":1164,"./style":1170,d3:157,"d3-hierarchy":150}],1170:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../lib");function o(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,u=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",u).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){t._fullLayout._sunburstlayer.selectAll(".trace").each(function(t){var e=n.select(this),r=t[0],i=r.trace;e.style("opacity",i.opacity),e.selectAll("path.surface").each(function(t){n.select(this).call(o,t,i)})})},styleOne:o}},{"../../components/color":580,"../../lib":703,d3:157}],1171:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../components/fx/hovertemplate_attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=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 c=e.exports=l(s({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:a(),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},_deprecated:{zauto:s({},i.zauto,{}),zmin:s({},i.zmin,{}),zmax:s({},i.zmax,{})},hoverinfo:s({},o.hoverinfo)}),"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes",c.transforms=void 0},{"../../components/color":580,"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plot_api/edit_types":734,"../../plots/attributes":748}],1172:[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":588}],1173:[function(t,e,r){"use strict";var n=t("gl-surface3d"),i=t("ndarray"),a=t("ndarray-homography"),o=t("ndarray-fill"),s=t("../../lib").isArrayOrTypedArray,l=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,f=t("../heatmap/interp2d"),h=t("../heatmap/find_empties");function p(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 d=p.prototype;d.getXat=function(t,e,r,n){var i=s(this.data.x)?s(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},d.getYat=function(t,e,r,n){var i=s(this.data.y)?s(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},d.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)},d.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 v=[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=v[n];break}return r}function x(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;aw;)n--,n/=y(n),++n<_&&(n=w);var i=Math.round(n/t);return i>1?i:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],o=t[0].shape[1],s=0|Math.floor(t[0].shape[0]*e+1),l=0|Math.floor(t[0].shape[1]*r+1),u=1+n+1,c=1+o+1,f=i(new Float32Array(u*c),[u,c]),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"}}},{}],1180:[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||u===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=u,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=u+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 v=d.concat(p(r).map(function(){return u((d[0]||[""]).length)})),g=e.domain,m=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?v[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=y-_,k=w+n.uplift,A=h(b,k),T=h(x,_),M=f(T,[]),E=f(A,M),S={},C=e._fullInput.columnorder.concat(p(r.map(function(t,e){return e}))),L=v.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}),O=L.reduce(s,0);L=L.map(function(t){return t/O*m});var I=Math.max(o(e.header.line.width),o(e.cells.line.width)),P={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:m,maxLineWidth:I,height:y,columnOrder:C,groupHeight:y,rowBlocks:E,headerRowBlocks:M,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:v}),gdColumns:v.map(function(t){return t[0]}),gdColumnsOriginalOrder:v.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:v.map(function(t,e){var r=S[t];S[t]=(r||0)+1;var n=t+"__"+S[t];return{key:n,label:t,specIndex:e,xIndex:C[e],xScale:c,x:void 0,calcdata:void 0,columnWidth:L[e]}})};return P.columns.forEach(function(t){t.calcdata=P,t.x=c(t)}),P}},{"../../lib/extend":693,"./constants":1179,"fast-isnumeric":224}],1181:[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})}),i=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}),a=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});return[i,a,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){var i="string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:n+i,key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":693}],1182:[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&&a.match(/[<&>]/);var u,c="string"==typeof(u=a)&&u.match(n.latexCheck);t.latex=c;var f,h,p=c?"":_(t.calcdata.cells.prefix,e,r)||"",d=c?"":_(t.calcdata.cells.suffix,e,r)||"",v=c?null:_(t.calcdata.cells.format,e,r)||null,g=p+(v?i.format(v)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!c&&(f=b(g)),t.cellHeightMayIncrease=s||c||t.mayHaveMarkup||(void 0===f?b(g):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var m=" "===n.wrapSplitCharacter?g.replace(/
i&&n.push(a),i+=l}return n}(i,l,s);1===u.length&&(u[0]===i.length-1?u.unshift(u[0]-1):u.push(u[0]+1)),u[0]%2&&u.reverse(),e.each(function(t,e){t.page=u[e],t.scrollY=l}),e.attr("transform",function(t){var e=P(t.rowBlocks,t.page)-t.scrollY;return"translate(0 "+e+")"}),t&&(S(t,r,e,u,n.prevPages,n,0),S(t,r,e,u,n.prevPages,n,1),m(r,t))}}function E(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter(function(t){return s.key===t.key}),u=r||s.scrollbarState.dragMultiplier,c=s.scrollY;s.scrollY=void 0===a?s.scrollY+u*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(k);return M(t,f,l),s.scrollY===c}}function S(t,e,r,n,i,a,o){var s=n[o]!==i[o];s&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});y(t,e,a,r),i[o]=n[o]}))}function C(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=[],u=0,c=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)r=s.shift(),i=r.width+a,u+i>c&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],u=0),l.push(r.text),u+=i;u&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0}),o.selectAll("tspan.line").remove(),x(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(I)}}function L(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=R(o),u=o.key-l.firstRowIndex,c=l.rows[u].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:c,h=Math.max(f,c),p=h-l.rows[u].rowHeight;p&&(l.rows[u].rowHeight=h,t.selectAll("."+n.cn.columnCell).call(I),M(null,t.filter(k),0),m(r,a,!0)),s.attr("transform",function(){var t=this.parentNode,e=t.getBoundingClientRect(),r=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),a=this.transform.baseVal.consolidate(),s=r.top-e.top+(a?a.matrix.f:n.cellPad);return"translate("+O(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+s+")"}),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 I(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+D(e,1/0)},0),r=R(t),n=D(r,t.key),i=n+e;return"translate(0 "+i+")"}).selectAll("."+n.cn.cellRect).attr("height",function(t){return(e=R(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r})}function P(t,e){for(var r=0,n=e-1;n>=0;n--)r+=z(t[n]);return r}function D(t,e){for(var r=0,n=0;n0){var y,x,b,_,w,k=t.xa,A=t.ya;"h"===h.orientation?(w=e,y="y",b=A,x="x",_=k):(w=r,y="x",b=k,x="y",_=A);var T=f[t.index];if(w>=T.span[0]&&w<=T.span[1]){var M=n.extendFlat({},t),E=_.c2p(w,!0),S=o.getKdeValue(T,h,w),C=o.getPositionOnKdePath(T,h,E),L=b._offset,O=b._length;M[y+"0"]=C[0],M[y+"1"]=C[1],M[x+"0"]=M[x+"1"]=E,M[x+"Label"]=x+": "+i.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+S.toFixed(3),M.spikeDistance=m[0].spikeDistance;var I=y+"Spike";M[I]=m[0][I],m[0].spikeDistance=void 0,m[0][I]=void 0,M.hovertemplate=!1,g.push(M),(c={stroke:t.color})[y+"1"]=n.constrain(L+C[0],L,L+O),c[y+"2"]=n.constrain(L+C[1],L,L+O),c[x+"1"]=c[x+"2"]=_._offset+E}}d&&(g=g.concat(m))}-1!==p.indexOf("points")&&(u=a.hoverOnPoints(t,e,r));var P=l.selectAll(".violinline-"+h.uid).data(c?[0]:[]);return P.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),P.exit().remove(),P.attr(c),"closest"===s?u?[u]:g:u?(g.push(u),g):g}},{"../../lib":703,"../../plots/cartesian/axes":751,"../box/hover":869,"./helpers":1189}],1191:[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":762,"../box/defaults":867,"../box/select":874,"../scatter/style":1097,"./attributes":1185,"./calc":1186,"./cross_trace_calc":1187,"./defaults":1188,"./hover":1190,"./layout_attributes":1192,"./layout_defaults":1193,"./plot":1194,"./style":1195}],1192:[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":703,"../box/layout_attributes":871}],1193:[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":703,"../box/layout_defaults":872,"./layout_attributes":1192}],1194:[function(t,e,r){"use strict";var n=t("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,u){var c=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});return a.smoothopen(e[0],1)}i.makeTraceGroups(u,r,"trace violins").each(function(t){var r=n.select(this),a=t[0],s=a.t,u=a.trace;if(e.isRangePlot||(a.node3=r),!0!==u.visible||s.empty)r.remove();else{var d=s.bPos,v=s.bdPos,g=e[s.valLetter+"axis"],m=e[s.posLetter+"axis"],y="both"===u.side,x=y||"positive"===u.side,b=y||"negative"===u.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,k=w.length,A=t.pos+d,T=m.c2p(A);if(u.width)e=s.maxKDE/v;else{var M=c._violinScaleGroupStats[u.scalegroup];e="count"===u.scalemode?M.maxKDE/v*(M.maxCount/t.pts.length):M.maxKDE/v}if(x){for(f=new Array(k),o=0;o0)l.extraText=g(v)+" "+o.increasing;else{if(!(v<0))return;l.extraText="("+g(-v)+") "+o.decreasing}l.extraText+="
Initial: "+g(d.b+d.s-v)}return l.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;return i(n)?n:i(a)&&o?a:void 0}(c,d),[l]}function g(t){return n(h,t)}}},{"../../components/color":580,"../../plots/cartesian/axes":751,"../bar/hover":847}],1205:[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"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":762,"../bar/select":852,"./attributes":1200,"./calc":1201,"./cross_trace_calc":1202,"./defaults":1203,"./hover":1204,"./layout_attributes":1206,"./layout_defaults":1207,"./plot":1208,"./style":1209}],1206:[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"}}},{}],1207:[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&&(v+=f?"M"+c[0]+","+p[1]+"V"+p[0]:"M"+c[1]+","+p[0]+"H"+c[0]),"between"!==h&&(r.isSum||o 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?.3:1)}}),o(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":580,"../../components/drawing":601,"../bar/style":854,d3:157}],1210:[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"},u=l.aggregations;function c(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),u=l.get(),c=n.getDataConversions(t,e,o,u),d=function(t,e){var r=t.func,n=e.d2c,i=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,a=0;aa&&(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,y,h),b={},_={},w=0;d?(g=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}):(g=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)}),M(g);for(var k=o(e.transforms,r),A=0;A1?"%{group} (%{trace})":"%{group}");var u=t.styles,c=o.styles=[];if(u)for(a=0;aConsensus",en:"Consensus",id:"".concat(a.default.maxBy(r,"id").id+1,"")},c=(0,o.getConsensus)(t);i=[].concat(s(e),[c]),l=[].concat(s(r),[u])}return{sequencesArray:i,sequencesInfo:l}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.xhr=e.seqs=e.parser=e.newick=e.matrix=e.gff=e.fasta=e.clustal=void 0;var n=c(r(73)),i=c(r(93)),a=c(r(95)),o=c(r(97)),s=c(r(98)),l=c(r(46)),u=c(r(50));function c(t){return t&&t.__esModule?t:{default:t}}e.clustal=n.default,e.fasta=i.default,e.gff=a.default,e.matrix=o.default,e.newick=s.default,e.parser=l.default,e.seqs=u.default;var f=r(53);e.xhr=f;var h="imported";"undefined"!=typeof IO_VERSION&&(h=IO_VERSION);e.version=h},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(r(46)),i=a(r(50));function a(t){return t&&t.__esModule?t:{default:t}}var o;e.default=o={parse:function(t){var e=[];if("[object Array]"===Object.prototype.toString.call(t))var r=t;else r=t.split("\n");if(!1===r[0].slice(0,6))throw new Error("Invalid CLUSTAL Header");for(var n=0,a=1,o=0;n=e.length){var f=i.default.getMeta(u.trim());u=f.name;var h=new i.default.model(c,u,o);h.ids=f.ids||{},h.details=f.details||{};var p=Object.keys(h.ids);p.length>0&&(h.id=h.ids[p[0]]),e.push(h)}else e[o].seq+=c;o++}else console.log("parse error",s)}}else a=1;else a=1}return e}},n.default.mixin(o)},function(t,e,r){(function(e){var r;r="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=r}).call(this,r(45))},function(t,e){t.exports=function(t){var e=r.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var r=Object.prototype.toString},function(t,e,r){var n=r(77),i=r(91);t.exports=function(t){if(!t)return{};var e={};return i(n(t).split("\n"),function(t){var r,i=t.indexOf(":"),a=n(t.slice(0,i)).toLowerCase(),o=n(t.slice(i+1));void 0===e[a]?e[a]=o:(r=e[a],"[object Array]"===Object.prototype.toString.call(r)?e[a].push(o):e[a]=[e[a],o])}),e}},function(t,e,r){"use strict";var n=r(48),i=r(54),a=r(55),o=r(56),s=r(90),l=n.call(Function.call,o());i(l,{getPolyfill:o,implementation:a,shim:s}),t.exports=l},function(t,e,r){"use strict";var n=Array.prototype.slice,i=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==i.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,a=n.call(arguments,1),o=Math.max(0,e.length-a.length),s=[],l=0;l0&&!n.call(t,0))for(var v=0;v0)for(var g=0;g=0&&"[object Function]"===n.call(t.callee)),r}},function(t,e,r){"use strict";var n=r(82),i=n("%Object%"),a=n("%TypeError%"),o=n("%String%"),s=r(83),l=r(84),u=r(85),c=r(86),f=r(49),h=r(87),p=r(89),d={ToPrimitive:h,ToBoolean:function(t){return!!t},ToNumber:function(t){return+t},ToInteger:function(t){var e=this.ToNumber(t);return s(e)?0:0!==e&&l(e)?u(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(s(e)||0===e||!l(e))return 0;var r=u(e)*Math.floor(Math.abs(e));return c(r,65536)},ToString:function(t){return o(t)},ToObject:function(t){return this.CheckObjectCoercible(t),i(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new a(e||"Cannot call method on "+t);return t},IsCallable:f,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:s(t)&&s(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0},IsPropertyDescriptor:function(t){if("Object"!==this.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(p(t,r)&&!e[r])return!1;var n=p(t,"[[Value]]"),i=p(t,"[[Get]]")||p(t,"[[Set]]");if(n&&i)throw new a("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new a("Desc must be a Property Descriptor");return!(!p(t,"[[Get]]")&&!p(t,"[[Set]]"))},IsDataDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new a("Desc must be a Property Descriptor");return!(!p(t,"[[Value]]")&&!p(t,"[[Writable]]"))},IsGenericDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new a("Desc must be a Property Descriptor");return!this.IsAccessorDescriptor(t)&&!this.IsDataDescriptor(t)},FromPropertyDescriptor:function(t){if(void 0===t)return t;if(!this.IsPropertyDescriptor(t))throw new a("Desc must be a Property Descriptor");if(this.IsDataDescriptor(t))return{value:t["[[Value]]"],writable:!!t["[[Writable]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};if(this.IsAccessorDescriptor(t))return{get:t["[[Get]]"],set:t["[[Set]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};throw new a("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(t){if("Object"!==this.Type(t))throw new a("ToPropertyDescriptor requires an object");var e={};if(p(t,"enumerable")&&(e["[[Enumerable]]"]=this.ToBoolean(t.enumerable)),p(t,"configurable")&&(e["[[Configurable]]"]=this.ToBoolean(t.configurable)),p(t,"value")&&(e["[[Value]]"]=t.value),p(t,"writable")&&(e["[[Writable]]"]=this.ToBoolean(t.writable)),p(t,"get")){var r=t.get;if(void 0!==r&&!this.IsCallable(r))throw new TypeError("getter must be a function");e["[[Get]]"]=r}if(p(t,"set")){var n=t.set;if(void 0!==n&&!this.IsCallable(n))throw new a("setter must be a function");e["[[Set]]"]=n}if((p(e,"[[Get]]")||p(e,"[[Set]]"))&&(p(e,"[[Value]]")||p(e,"[[Writable]]")))throw new a("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}};t.exports=d},function(t,e,r){"use strict";var n=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,a=Object.getPrototypeOf||function(t){return t.__proto__},o=void 0,s="undefined"==typeof Uint8Array?void 0:a(Uint8Array),l={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":i?a([][Symbol.iterator]()):void 0,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":void 0,"$ %AsyncFunction%":void 0,"$ %AsyncFunctionPrototype%":void 0,"$ %AsyncGenerator%":void 0,"$ %AsyncGeneratorFunction%":void 0,"$ %AsyncGeneratorPrototype%":void 0,"$ %AsyncIteratorPrototype%":o&&i&&Symbol.asyncIterator?o[Symbol.asyncIterator]():void 0,"$ %Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"==typeof DataView?void 0:DataView,"$ %DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"$ %Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"$ %Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"$ %Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":void 0,"$ %GeneratorFunction%":void 0,"$ %GeneratorPrototype%":void 0,"$ %Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"$ %Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"$ %Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"$ %Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"$ %Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"$ %Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":i?a(a([][Symbol.iterator]())):void 0,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":"undefined"==typeof Map?void 0:Map,"$ %MapIteratorPrototype%":"undefined"!=typeof Map&&i?a((new Map)[Symbol.iterator]()):void 0,"$ %MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"==typeof Promise?void 0:Promise,"$ %PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"$ %PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"$ %Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"$ %Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"$ %Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"$ %Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"==typeof Set?void 0:Set,"$ %SetIteratorPrototype%":"undefined"!=typeof Set&&i?a((new Set)[Symbol.iterator]()):void 0,"$ %SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"$ %SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":i?a(""[Symbol.iterator]()):void 0,"$ %StringPrototype%":String.prototype,"$ %Symbol%":i?Symbol:void 0,"$ %SymbolPrototype%":i?Symbol.prototype:void 0,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":n,"$ %TypedArray%":s,"$ %TypedArrayPrototype%":s?s.prototype:void 0,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"$ %Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"$ %WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"$ %WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"$ %WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype};t.exports=function(t,e){if(arguments.length>1&&"boolean"!=typeof e)throw new TypeError('"allowMissing" argument must be a boolean');var r="$ "+t;if(!(r in l))throw new SyntaxError("intrinsic "+t+" does not exist!");if(void 0===l[r]&&!e)throw new TypeError("intrinsic "+t+" exists, but is not available. Please file an issue!");return l[r]}},function(t,e){t.exports=Number.isNaN||function(t){return t!=t}},function(t,e){var r=Number.isNaN||function(t){return t!=t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},function(t,e){t.exports=function(t){return t>=0?1:-1}},function(t,e){t.exports=function(t,e){var r=t%e;return Math.floor(r>=0?r:r+e)}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=r(88),a=r(49),o=function(t){var e;if((e=arguments.length>1?arguments[1]:"[object Date]"===n.call(t)?String:Number)===String||e===Number){var r,o,s=e===String?["toString","valueOf"]:["valueOf","toString"];for(o=0;o1?o(t,arguments[1]):o(t)}},function(t,e){t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,r){"use strict";var n=r(48);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,r){"use strict";var n=r(54),i=r(56);t.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},function(t,e,r){"use strict";var n=r(49),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n"===a[0]||";"===a[0]){var o=a.slice(1).trim(),l=r(o.trim());o=l.name;var u=l.id||e.length,c=new n.default.model("",l.name,u);c.ids=l.ids||{},c.details=l.details||{},e.push(c)}else c.seq+=a}return e},write:function(t,e){for(var r="",i=0;i"+a.name+"\n",r+=n.default.splitNChars(a.seq,80).join("\n"),r+="\n"}return r}},a.default.mixin(s)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){t=t||{};for(var e=function(t,e,r){for(var n=[],i=ta;i?o++:o--)n.push(o);return n}(0,arguments.length,!1),r=0;r=0)break;var s=o.split(/\t/),l=s[0].trim();if("GFF"===l)break;if(2===s.length)if("startgroup"===l)e=s[1].trim();else{if("endgroup"===l){e="";continue}r[s[0]]=i.parseColor(s[1])}else if(s.length>=5){var u=i.parseLine(s);e&&(u.attributes.Parent=e),a.push(u)}}return{offset:n,colors:r,features:a}},i.parseColor=function(t){return t.indexOf(",")>=0?(0,n.rgbToHex)(t.split(",").map(function(t){return parseInt(t)})):6===t.length&&parseInt(t.charAt(0),16)<=16&&"bisque"!==t?"#"+t:t},i.parseLine=function(t){var e={attributes:{}};return e.attributes.Name=t[0].trim(),e.seqname=t[1].trim(),e.start=parseInt(t[3]),e.end=parseInt(t[4]),e.feature=t[5].trim(),"ID_NOT_SPECIFIED"===e.seqname&&(e.seqname=t[2].trim()),e}},function(t,e,r){"use strict";var n,i=r(46),a=(n=i)&&n.__esModule?n:{default:n};var o=function t(e){return this.constructor!=t?new t(e):(this.matrix={},this.parsingOrder=[],null!=e&&this.parse(e),this)};a.default.mixin(o),t.exports=o,o.prototype.parse=function(t){return t.split("\n").forEach(function(t){this.parseLine(t)}.bind(this)),this.buildMatrix(),this.matrix},o.read=function(t,e){return(new o).read(t,e)},o.parse=function(t){return(new o).parse(t)},o.prototype.parseLine=function(t){var e=t.charAt(0);if("#"!==e){this.parsingOrder.push(e);for(var r=t.substring(1).split(/\s+/).filter(function(t){return t.length>0}).map(function(t){return parseInt(t)}),n={},i=0;i=0;t--){var e=this.parsingOrder[t],r=this.matrix[e];for(var n in r)this.matrix[n][e]=r[n]}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseNhx=e.parse=void 0;var n=a(r(99)),i=a(r(100));function a(t){return t&&t.__esModule?t:{default:t}}var o={};o.parse=n.default,o.parseNhx=i.default,e.default=o,e.parse=n.default,e.parseNhx=i.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=[],r={},n=t.split(/\s*(;|\(|\)|,|:)\s*/),i=0;i1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n.default.isString(t)?(e=x[t]||v.default,b.includes(t)?(r="#ffffff",i=1):(r="#444444",i=.75)):(e=t,r="#ffffff",i=1),a&&(r=a),o&&(i=o);var s=function(t){t["-"]||(t["-"]="#ffffff");var e=1/n.default.size(t),r=0,i={},a=[];return n.default.forEach(t,function(t,n){i[n]=r+.005,a.push([r,t]),r+=e,a.push([r,t])}),a[a.length-1][0]=1,{colormap:i,colorscale:a}}(e);return{colormap:s.colormap,colorscale:s.colorscale,textcolor:r,opacity:i}}},function(t,e,r){"use strict";t.exports={A:"#00a35c",R:"#00fc03",N:"#00eb14",D:"#00eb14",C:"#0000ff",Q:"#00f10e",E:"#00f10e",G:"#009d62",H:"#00d52a",I:"#0054ab",L:"#007b84",K:"#00ff00",M:"#009768",F:"#008778",P:"#00e01f",S:"#00d52a",T:"#00db24",W:"#00a857",Y:"#00e619",V:"#005fa0",B:"#00eb14",X:"#00b649",Z:"#00f10e"}},function(t,e,r){"use strict";t.exports={A:"#BBBBBB",B:"grey",C:"yellow",D:"red",E:"red",F:"magenta",G:"brown",H:"#00FFFF",I:"#BBBBBB",J:"#fff",K:"#00FFFF",L:"#BBBBBB",M:"#BBBBBB",N:"green",O:"#fff",P:"brown",Q:"green",R:"#00FFFF",S:"green",T:"green",U:"#fff",V:"#BBBBBB",W:"magenta",X:"grey",Y:"magenta",Z:"grey","-":"grey"}},function(t,e,r){"use strict";t.exports={A:"orange",B:"#fff",C:"green",D:"red",E:"red",F:"blue",G:"orange",H:"red",I:"green",J:"#fff",K:"red",L:"green",M:"green",N:"#fff",O:"#fff",P:"orange",Q:"#fff",R:"red",S:"orange",T:"orange",U:"#fff",V:"green",W:"blue",X:"#fff",Y:"blue",Z:"#fff"}},function(t,e,r){"use strict";t.exports={A:"#80a0f0",R:"#f01505",N:"#00ff00",D:"#c048c0",C:"#f08080",Q:"#00ff00",E:"#c048c0",G:"#f09048",H:"#15a4a4",I:"#80a0f0",L:"#80a0f0",K:"#f01505",M:"#80a0f0",F:"#80a0f0",P:"#ffff00",S:"#00ff00",T:"#00ff00",W:"#80a0f0",Y:"#15a4a4",V:"#80a0f0",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,r){"use strict";t.exports={A:"#e718e7",R:"#6f906f",N:"#1be41b",D:"#778877",C:"#23dc23",Q:"#926d92",E:"#ff00ff",G:"#00ff00",H:"#758a75",I:"#8a758a",L:"#ae51ae",K:"#a05fa0",M:"#ef10ef",F:"#986798",P:"#00ff00",S:"#36c936",T:"#47b847",W:"#8a758a",Y:"#21de21",V:"#857a85",B:"#49b649",X:"#758a75",Z:"#c936c9"}},function(t,e,r){"use strict";t.exports={A:"#ad0052",B:"#0c00f3",C:"#c2003d",D:"#0c00f3",E:"#0c00f3",F:"#cb0034",G:"#6a0095",H:"#1500ea",I:"#ff0000",J:"#fff",K:"#0000ff",L:"#ea0015",M:"#b0004f",N:"#0c00f3",O:"#fff",P:"#4600b9",Q:"#0c00f3",R:"#0000ff",S:"#5e00a1",T:"#61009e",U:"#fff",V:"#f60009",W:"#5b00a4",X:"#680097",Y:"#4f00b0",Z:"#0c00f3"}},function(t,e,r){"use strict";t.exports={A:" orange",B:" #fff",C:" green",D:" red",E:" red",F:" green",G:" orange",H:" magenta",I:" green",J:" #fff",K:" red",L:" green",M:" green",N:" magenta",O:" #fff",P:" green",Q:" magenta",R:" red",S:" orange",T:" orange",U:" #fff",V:" green",W:" green",X:" #fff",Y:" green",Z:" #fff"}},function(t,e,r){"use strict";t.exports={A:" #77dd88",B:" #fff",C:" #99ee66",D:" #55bb33",E:" #55bb33",F:" #9999ff",G:" #77dd88",H:" #5555ff",I:" #66bbff",J:" #fff",K:" #ffcc77",L:" #66bbff",M:" #66bbff",N:" #55bb33",O:" #fff",P:" #eeaaaa",Q:" #55bb33",R:" #ffcc77",S:" #ff4455",T:" #ff4455",U:" #fff",V:" #66bbff",W:" #9999ff",X:" #fff",Y:" #9999ff",Z:" #fff"}},function(t,e,r){"use strict";t.exports={A:" #64F73F",C:" #FFB340",G:" #EB413C",T:" #3C88EE",U:" #3C88EE"}},function(t,e,r){"use strict";t.exports={A:" #FF83FA",C:" #40E0D0",G:" #FF83FA",R:" #FF83FA",T:" #40E0D0",U:" #40E0D0",Y:" #40E0D0"}},function(t,e,r){"use strict";t.exports={A:"#5858a7",R:"#6b6b94",N:"#64649b",D:"#2121de",C:"#9d9d62",Q:"#8c8c73",E:"#0000ff",G:"#4949b6",H:"#60609f",I:"#ecec13",L:"#b2b24d",K:"#4747b8",M:"#82827d",F:"#c2c23d",P:"#2323dc",S:"#4949b6",T:"#9d9d62",W:"#c0c03f",Y:"#d3d32c",V:"#ffff00",B:"#4343bc",X:"#797986",Z:"#4747b8"}},function(t,e,r){"use strict";t.exports={A:"#ccff00",R:"#0000ff",N:"#cc00ff",D:"#ff0000",C:"#ffff00",Q:"#ff00cc",E:"#ff0066",G:"#ff9900",H:"#0066ff",I:"#66ff00",L:"#33ff00",K:"#6600ff",M:"#00ff00",F:"#00ff66",P:"#ffcc00",S:"#ff3300",T:"#ff6600",W:"#00ccff",Y:"#00ffcc",V:"#99ff00",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,r){"use strict";t.exports={A:"#2cd3d3",R:"#708f8f",N:"#ff0000",D:"#e81717",C:"#a85757",Q:"#3fc0c0",E:"#778888",G:"#ff0000",H:"#708f8f",I:"#00ffff",L:"#1ce3e3",K:"#7e8181",M:"#1ee1e1",F:"#1ee1e1",P:"#f60909",S:"#e11e1e",T:"#738c8c",W:"#738c8c",Y:"#9d6262",V:"#07f8f8",B:"#f30c0c",X:"#7c8383",Z:"#5ba4a4"}},function(t,e,r){"use strict";t.exports={A:"#ffafaf",R:"#6464ff",N:"#00ff00",D:"#ff0000",C:"#ffff00",Q:"#00ff00",E:"#ff0000",G:"#ff00ff",H:"#6464ff",I:"#ffafaf",L:"#ffafaf",K:"#6464ff",M:"#ffafaf",F:"#ffc800",P:"#ff00ff",S:"#00ff00",T:"#00ff00",W:"#ffc800",Y:"#ffc800",V:"#ffafaf",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DropdownSelect=e.Caption=void 0;var n,i=o(r(1)),a=((n=r(0))&&n.__esModule,o(r(159)));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}function s(){return(s=Object.assign||function(t){for(var e=1;e=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}var u=function(t){return i.default.createElement("div",{style:{marginTop:-8,marginBottom:-8}},i.default.createElement("p",{style:{fontSize:12,fontColor:"#444444"}},t.children))};e.Caption=u;e.DropdownSelect=function(t){var e=t.caption,r=t.isCreatable,n=t.outerStyle,o=l(t,["caption","isCreatable","outerStyle"]);return i.default.createElement("div",{style:n},e&&i.default.createElement(u,null,e),!e&&i.default.createElement(u,null," "),r&&i.default.createElement(a.Creatable,s({allowCreate:!0},o)),!r&&i.default.createElement(a.default,o))}},function(t,e,r){"use strict";(function(t){r.d(e,"b",function(){return o}),r.d(e,"a",function(){return s});var n=r(158),i=void 0!==t?t:{},a=Object(n.a)(i),o=(a.flush,a.hydrate,a.cx,a.merge,a.getRegisteredStyles,a.injectGlobal),s=(a.keyframes,a.css);a.sheet,a.caches}).call(this,r(45))},function(t,e,r){t.exports=function(){"use strict";return function(t){function e(e){if(e)try{t(e+"}")}catch(t){}}return function(r,n,i,a,o,s,l,u,c,f){switch(r){case 1:if(0===c&&64===n.charCodeAt(0))return t(n+";"),"";break;case 2:if(0===u)return n+"/*|*/";break;case 3:switch(u){case 102:case 112:return t(i[0]+n),"";default:return n+(0===f?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(e)}}}}()},function(t,e,r){(function(e){for(var n=r(120),i="undefined"==typeof window?e:window,a=["moz","webkit"],o="AnimationFrame",s=i["request"+o],l=i["cancel"+o]||i["cancelRequest"+o],u=0;!s&&u1)for(var r=1;r=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}(this.props,[]);return function(t){c.forEach(function(e){return delete t[e]})}(i),i.className=this.props.inputClassName,i.id=this.state.inputId,i.style=r,o.default.createElement("div",{className:this.props.className,style:e},this.renderStyles(),o.default.createElement("input",n({},i,{ref:this.inputRef})),o.default.createElement("div",{ref:this.sizerRef,style:u},t),this.props.placeholder?o.default.createElement("div",{ref:this.placeHolderSizerRef,style:u},this.props.placeholder):null)}}]),e}();d.propTypes={className:s.default.string,defaultValue:s.default.any,extraWidth:s.default.oneOfType([s.default.number,s.default.string]),id:s.default.string,injectStyles:s.default.bool,inputClassName:s.default.string,inputRef:s.default.func,inputStyle:s.default.object,minWidth:s.default.oneOfType([s.default.number,s.default.string]),onAutosize:s.default.func,onChange:s.default.func,placeholder:s.default.string,placeholderIsMinWidth:s.default.bool,style:s.default.object,value:s.default.any},d.defaultProps={minWidth:1,injectStyles:!0},e.default=d},function(t,e,r){"use strict";var n=s(r(124)),i=s(r(129)),a=s(r(63)),o=s(r(60));function s(t){return t&&t.__esModule?t:{default:t}}t.exports={Transition:o.default,TransitionGroup:a.default,ReplaceTransition:i.default,CSSTransition:n.default}},function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;!function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}e.default=t}(r(0));var n=s(r(125)),i=s(r(128)),a=s(r(1)),o=s(r(60));r(62);function s(t){return t&&t.__esModule?t:{default:t}}function l(){return(l=Object.assign||function(t){for(var e=1;e=0||(i[r]=t[r]);return i}(t,["children","in"]),o=n.default.Children.toArray(e),s=o[0],l=o[1];return delete i.onEnter,delete i.onEntering,delete i.onEntered,delete i.onExit,delete i.onExiting,delete i.onExited,n.default.createElement(a.default,i,r?n.default.cloneElement(s,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):n.default.cloneElement(l,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},o}(n.default.Component);s.propTypes={};var l=s;e.default=l,t.exports=e.default},function(t,e,r){"use strict";e.__esModule=!0,e.getChildMapping=i,e.mergeChildMappings=a,e.getInitialChildMapping=function(t,e){return i(t.children,function(r){return(0,n.cloneElement)(r,{onExited:e.bind(null,r),in:!0,appear:o(r,"appear",t),enter:o(r,"enter",t),exit:o(r,"exit",t)})})},e.getNextChildMapping=function(t,e,r){var s=i(t.children),l=a(e,s);return Object.keys(l).forEach(function(i){var a=l[i];if((0,n.isValidElement)(a)){var u=i in e,c=i in s,f=e[i],h=(0,n.isValidElement)(f)&&!f.props.in;!c||u&&!h?c||!u||h?c&&u&&(0,n.isValidElement)(f)&&(l[i]=(0,n.cloneElement)(a,{onExited:r.bind(null,a),in:f.props.in,exit:o(a,"exit",t),enter:o(a,"enter",t)})):l[i]=(0,n.cloneElement)(a,{in:!1}):l[i]=(0,n.cloneElement)(a,{onExited:r.bind(null,a),in:!0,exit:o(a,"exit",t),enter:o(a,"enter",t)})}}),l};var n=r(1);function i(t,e){var r=Object.create(null);return t&&n.Children.map(t,function(t){return t}).forEach(function(t){r[t.key]=function(t){return e&&(0,n.isValidElement)(t)?e(t):t}(t)}),r}function a(t,e){function r(r){return r in e?e[r]:t[r]}t=t||{},e=e||{};var n,i=Object.create(null),a=[];for(var o in t)o in e?a.length&&(i[o]=a,a=[]):a.push(o);var s={};for(var l in e){if(i[l])for(n=0;n=4;)e=1540483477*(65535&(e=255&t.charCodeAt(i)|(255&t.charCodeAt(++i))<<8|(255&t.charCodeAt(++i))<<16|(255&t.charCodeAt(++i))<<24))+((1540483477*(e>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(e=1540483477*(65535&(e^=e>>>24))+((1540483477*(e>>>16)&65535)<<16)),r-=4,++i;switch(r){case 3:n^=(255&t.charCodeAt(i+2))<<16;case 2:n^=(255&t.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(i)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),((n^=n>>>15)>>>0).toString(36)};var o=function(t){function e(t,e,n){var i=e.trim().split(d);e=i;var a=i.length,o=t.length;switch(o){case 0:case 1:var s=0;for(t=0===o?"":t[0]+" ";sn&&(n=(e=e.trim()).charCodeAt(0)),n){case 38:return e.replace(v,"$1"+t.trim());case 58:return t.trim()+e.replace(v,"$1"+t.trim());default:if(0<1*r&&0l.charCodeAt(8))break;case 115:o=o.replace(l,"-webkit-"+l)+";"+o;break;case 207:case 102:o=o.replace(l,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0p)&&(N=(U=U.replace(" ",":")).length),01?i-1:0),s=1;s=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function E(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?E(t):e}function C(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e-1}function D(t){return P(t)?window.pageYOffset:t.scrollTop}function z(t,e){P(t)?window.scrollTo(0,e):t.scrollTop=e}function R(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:L,i=D(t),a=e-i,o=10,s=0;!function e(){var l,u=a*((l=(l=s+=o)/r-1)*l*l+1)+i;z(t,u),s=p)return{placement:"bottom",maxHeight:e};if(k>=p&&!o)return a&&R(l,A,160),{placement:"bottom",maxHeight:e};if(!o&&k>=n||o&&_>=n)return a&&R(l,A,160),{placement:"bottom",maxHeight:o?_-y:k-y};if("auto"===i||o){var M=e,E=o?b:w;return E>=n&&(M=Math.min(E-y-s.controlHeight,e)),{placement:"top",maxHeight:M}}if("bottom"===i)return z(l,A),{placement:"bottom",maxHeight:e};break;case"top":if(b>=p)return{placement:"top",maxHeight:e};if(w>=p&&!o)return a&&R(l,T,160),{placement:"top",maxHeight:e};if(!o&&w>=n||o&&b>=n){var S=e;return(!o&&w>=n||o&&b>=n)&&(S=o?b-x:w-x),a&&R(l,T,160),{placement:"top",maxHeight:S}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}var N=function(t){return"auto"===t?"bottom":t},j=function(t){function e(){var t,r;m(this,e);for(var n=arguments.length,i=new Array(n),a=0;a-1}},rt=function(t){return i.a.createElement("span",_({className:Object(s.a)({label:"a11yText",zIndex:9999,border:0,clip:"rect(1px, 1px, 1px, 1px)",height:1,width:1,position:"absolute",overflow:"hidden",padding:0,whiteSpace:"nowrap",backgroundColor:"red",color:"blue"})},t))},nt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=(t.in,t.out,t.onExited,t.appear,t.enter,t.exit,t.innerRef),r=(t.emotion,M(t,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return i.a.createElement("input",_({ref:e},r,{className:Object(s.a)({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"})}))}}]),e}(),it=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"componentDidMount",value:function(){this.props.innerRef(Object(l.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),e}(),at=["boxSizing","height","overflow","paddingRight","position"],ot={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function st(t){t.preventDefault()}function lt(t){t.stopPropagation()}function ut(){var t=this.scrollTop,e=this.scrollHeight,r=t+this.offsetHeight;0===t?this.scrollTop=1:r===e&&(this.scrollTop=t-1)}function ct(){return"ontouchstart"in window||navigator.maxTouchPoints}var ft=!("undefined"==typeof window||!window.document||!window.document.createElement),ht=0,pt=function(t){function e(){var t,r;m(this,e);for(var n=arguments.length,i=new Array(n),a=0;a0,d=c-f-u,v=!1;d>e&&r.isBottom&&(a&&a(t),r.isBottom=!1),p&&r.isTop&&(s&&s(t),r.isTop=!1),p&&e>d?(i&&!r.isBottom&&i(t),h.scrollTop=c,v=!0,r.isBottom=!0):!p&&-e>u&&(o&&!r.isTop&&o(t),h.scrollTop=0,v=!0,r.isTop=!0),v&&r.cancelScroll(t)}),b(E(E(r)),"onWheel",function(t){r.handleEventDelta(t,t.deltaY)}),b(E(E(r)),"onTouchStart",function(t){r.touchStart=t.changedTouches[0].clientY}),b(E(E(r)),"onTouchMove",function(t){var e=r.touchStart-t.changedTouches[0].clientY;r.handleEventDelta(t,e)}),b(E(E(r)),"getScrollTarget",function(t){r.scrollTarget=t}),r}return k(e,n["Component"]),x(e,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(t){t&&(t.scrollHeight<=t.clientHeight||("function"==typeof t.addEventListener&&t.addEventListener("wheel",this.onWheel,!1),"function"==typeof t.addEventListener&&t.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof t.addEventListener&&t.addEventListener("touchmove",this.onTouchMove,!1)))}},{key:"stopListening",value:function(t){t.scrollHeight<=t.clientHeight||("function"==typeof t.removeEventListener&&t.removeEventListener("wheel",this.onWheel,!1),"function"==typeof t.removeEventListener&&t.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof t.removeEventListener&&t.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return i.a.createElement(it,{innerRef:this.getScrollTarget},this.props.children)}}]),e}(),gt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=t.isEnabled,r=M(t,["isEnabled"]);return e?i.a.createElement(vt,r):this.props.children}}]),e}();b(gt,"defaultProps",{isEnabled:!0});var mt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.isSearchable,n=e.isMulti,i=e.label,a=e.isDisabled;switch(t){case"menu":return"Use Up and Down to choose options".concat(a?"":", press Enter to select the currently focused option",", press Escape to exit the menu, press Tab to select the option and exit the menu.");case"input":return"".concat(i||"Select"," is focused ").concat(r?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},yt=function(t,e){var r=e.value,n=e.isDisabled;if(r)switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"select-option":return"option ".concat(r,n?" is disabled. Select another option.":", selected.")}},xt=function(t){return!!t.isDisabled},bt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=t.children,r=t.className,n=t.cx,a=t.isMulti,o=t.getStyles,l=t.hasValue;return i.a.createElement("div",{className:n(Object(s.a)(o("valueContainer",this.props)),{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":l},r)},e)}}]),e}(),_t=function(t){var e=t.size,r=M(t,["size"]);return i.a.createElement("svg",_({height:e,width:e,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:Object(s.a)({display:"inline-block",fill:"currentColor",lineHeight:1,stroke:"currentColor",strokeWidth:0})},r))},wt=function(t){return i.a.createElement(_t,_({size:20},t),i.a.createElement("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},kt=function(t){return i.a.createElement(_t,_({size:20},t),i.a.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},At=function(t){var e=t.isFocused,r=t.theme,n=r.spacing.baseUnit,i=r.colors;return{label:"indicatorContainer",color:e?i.neutral60:i.neutral20,display:"flex",padding:2*n,transition:"color 150ms",":hover":{color:e?i.neutral80:i.neutral40}}},Tt=At,Mt=At,Et=!1,St=function(t){var e=t.color,r=t.delay,n=t.offset;return i.a.createElement("span",{className:Object(s.a)({animationDuration:"1s",animationDelay:"".concat(r,"ms"),animationIterationCount:"infinite",animationName:"react-select-loading-indicator",animationTimingFunction:"ease-in-out",backgroundColor:e,borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":null,height:"1em",verticalAlign:"top",width:"1em"})})},Ct=function(t){var e=t.className,r=t.cx,n=t.getStyles,a=t.innerProps,o=t.isFocused,l=t.isRtl,u=t.theme.colors,c=o?u.neutral80:u.neutral20;return Et||(Object(s.b)("@keyframes ","react-select-loading-indicator","{0%,80%,100%{opacity:0;}40%{opacity:1;}};"),Et=!0),i.a.createElement("div",_({},a,{className:r(Object(s.a)(n("loadingIndicator",t)),{indicator:!0,"loading-indicator":!0},e)}),i.a.createElement(St,{color:c,delay:0,offset:l}),i.a.createElement(St,{color:c,delay:160,offset:!0}),i.a.createElement(St,{color:c,delay:320,offset:!l}))};Ct.defaultProps={size:4};var Lt=function(t){var e=t.children,r=t.innerProps;return i.a.createElement("div",r,e)},Ot=Lt,It=Lt,Pt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=t.children,r=t.innerProps;return i.a.createElement("div",r,e||i.a.createElement(wt,{size:14}))}}]),e}(),Dt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=t.children,r=t.className,n=t.components,a=t.cx,o=t.data,l=t.getStyles,u=t.innerProps,c=t.isDisabled,f=t.removeProps,h=t.selectProps,p=n.Container,d=n.Label,v=n.Remove,g=w({className:a(Object(s.a)(l("multiValue",this.props)),{"multi-value":!0,"multi-value--is-disabled":c},r)},u),m={className:a(Object(s.a)(l("multiValueLabel",this.props)),{"multi-value__label":!0},r)},y=w({className:a(Object(s.a)(l("multiValueRemove",this.props)),{"multi-value__remove":!0},r)},f);return i.a.createElement(p,{data:o,innerProps:g,selectProps:h},i.a.createElement(d,{data:o,innerProps:m,selectProps:h},e),i.a.createElement(v,{data:o,innerProps:y,selectProps:h}))}}]),e}();b(Dt,"defaultProps",{cropWithEllipsis:!0});var zt={ClearIndicator:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerProps;return i.a.createElement("div",_({},o,{className:n(Object(s.a)(a("clearIndicator",t)),{indicator:!0,"clear-indicator":!0},r)}),e||i.a.createElement(wt,null))},Control:function(t){var e=t.children,r=t.cx,n=t.getStyles,a=t.className,o=t.isDisabled,l=t.isFocused,u=t.innerRef,c=t.innerProps,f=t.menuIsOpen;return i.a.createElement("div",_({ref:u,className:r(Object(s.a)(n("control",t)),{control:!0,"control--is-disabled":o,"control--is-focused":l,"control--menu-is-open":f},a)},c),e)},DropdownIndicator:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerProps;return i.a.createElement("div",_({},o,{className:n(Object(s.a)(a("dropdownIndicator",t)),{indicator:!0,"dropdown-indicator":!0},r)}),e||i.a.createElement(kt,null))},DownChevron:kt,CrossIcon:wt,Group:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.Heading,l=t.headingProps,u=t.label,c=t.theme,f=t.selectProps;return i.a.createElement("div",{className:n(Object(s.a)(a("group",t)),{group:!0},r)},i.a.createElement(o,_({},l,{selectProps:f,theme:c,getStyles:a,cx:n}),u),i.a.createElement("div",null,e))},GroupHeading:function(t){var e=t.className,r=t.cx,n=t.getStyles,a=t.theme,o=(t.selectProps,M(t,["className","cx","getStyles","theme","selectProps"]));return i.a.createElement("div",_({className:r(Object(s.a)(n("groupHeading",w({theme:a},o))),{"group-heading":!0},e)},o))},IndicatorsContainer:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles;return i.a.createElement("div",{className:n(Object(s.a)(a("indicatorsContainer",t)),{indicators:!0},r)},e)},IndicatorSeparator:function(t){var e=t.className,r=t.cx,n=t.getStyles,a=t.innerProps;return i.a.createElement("span",_({},a,{className:r(Object(s.a)(n("indicatorSeparator",t)),{"indicator-separator":!0},e)}))},Input:function(t){var e=t.className,r=t.cx,n=t.getStyles,a=t.innerRef,o=t.isHidden,l=t.isDisabled,u=t.theme,c=(t.selectProps,M(t,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return i.a.createElement("div",{className:Object(s.a)(n("input",w({theme:u},c)))},i.a.createElement(d.a,_({className:r(null,{input:!0},e),inputRef:a,inputStyle:function(t){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:t?0:1,outline:0,padding:0,color:"inherit"}}(o),disabled:l},c)))},LoadingIndicator:Ct,Menu:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerRef,l=t.innerProps,u=n(Object(s.a)(a("menu",t)),{menu:!0},r);return i.a.createElement("div",_({className:u},l,{ref:o}),e)},MenuList:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.isMulti,l=t.innerRef;return i.a.createElement("div",{className:n(Object(s.a)(a("menuList",t)),{"menu-list":!0,"menu-list--is-multi":o},r),ref:l},e)},MenuPortal:W,LoadingMessage:G,NoOptionsMessage:q,MultiValue:Dt,MultiValueContainer:Ot,MultiValueLabel:It,MultiValueRemove:Pt,Option:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.isDisabled,l=t.isFocused,u=t.isSelected,c=t.innerRef,f=t.innerProps;return i.a.createElement("div",_({ref:c,className:n(Object(s.a)(a("option",t)),{option:!0,"option--is-disabled":o,"option--is-focused":l,"option--is-selected":u},r)},f),e)},Placeholder:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerProps;return i.a.createElement("div",_({className:n(Object(s.a)(a("placeholder",t)),{placeholder:!0},r)},o),e)},SelectContainer:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerProps,l=t.isDisabled,u=t.isRtl;return i.a.createElement("div",_({className:n(Object(s.a)(a("container",t)),{"--is-disabled":l,"--is-rtl":u},r)},o),e)},SingleValue:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.isDisabled,l=t.innerProps;return i.a.createElement("div",_({className:n(Object(s.a)(a("singleValue",t)),{"single-value":!0,"single-value--is-disabled":o},r)},l),e)},ValueContainer:bt},Rt=function(t){return w({},zt,t.components)},Ft={clearIndicator:Mt,container:function(t){var e=t.isDisabled;return{label:"container",direction:t.isRtl?"rtl":null,pointerEvents:e?"none":null,position:"relative"}},control:function(t){var e=t.isDisabled,r=t.isFocused,n=t.theme,i=n.colors,a=n.borderRadius,o=n.spacing;return{label:"control",alignItems:"center",backgroundColor:e?i.neutral5:i.neutral0,borderColor:e?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:r?i.primary:i.neutral30}}},dropdownIndicator:Tt,group:function(t){var e=t.theme.spacing;return{paddingBottom:2*e.baseUnit,paddingTop:2*e.baseUnit}},groupHeading:function(t){var e=t.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*e.baseUnit,paddingRight:3*e.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(t){var e=t.isDisabled,r=t.theme,n=r.spacing.baseUnit,i=r.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:e?i.neutral10:i.neutral20,marginBottom:2*n,marginTop:2*n,width:1}},input:function(t){var e=t.isDisabled,r=t.theme,n=r.spacing,i=r.colors;return{margin:n.baseUnit/2,paddingBottom:n.baseUnit/2,paddingTop:n.baseUnit/2,visibility:e?"hidden":"visible",color:i.neutral80}},loadingIndicator:function(t){var e=t.isFocused,r=t.size,n=t.theme,i=n.colors,a=n.spacing.baseUnit;return{label:"loadingIndicator",color:e?i.neutral60:i.neutral20,display:"flex",padding:2*a,transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"}},loadingMessage:H,menu:function(t){var e,r=t.placement,n=t.theme,i=n.borderRadius,a=n.spacing,o=n.colors;return b(e={label:"menu"},function(t){return t?{bottom:"top",top:"bottom"}[t]:"bottom"}(r),"100%"),b(e,"backgroundColor",o.neutral0),b(e,"borderRadius",i),b(e,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),b(e,"marginBottom",a.menuGutter),b(e,"marginTop",a.menuGutter),b(e,"position","absolute"),b(e,"width","100%"),b(e,"zIndex",1),e},menuList:function(t){var e=t.maxHeight,r=t.theme.spacing.baseUnit;return{maxHeight:e,overflowY:"auto",paddingBottom:r,paddingTop:r,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(t){var e=t.rect,r=t.offset,n=t.position;return{left:e.left,position:n,top:r,width:e.width,zIndex:1}},multiValue:function(t){var e=t.theme,r=e.spacing,n=e.borderRadius;return{label:"multiValue",backgroundColor:e.colors.neutral10,borderRadius:n/2,display:"flex",margin:r.baseUnit/2,minWidth:0}},multiValueLabel:function(t){var e=t.theme,r=e.borderRadius,n=e.colors,i=t.cropWithEllipsis;return{borderRadius:r/2,color:n.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:i?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(t){var e=t.theme,r=e.spacing,n=e.borderRadius,i=e.colors;return{alignItems:"center",borderRadius:n/2,backgroundColor:t.isFocused&&i.dangerLight,display:"flex",paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}}},noOptionsMessage:U,option:function(t){var e=t.isDisabled,r=t.isFocused,n=t.isSelected,i=t.theme,a=i.spacing,o=i.colors;return{label:"option",backgroundColor:n?o.primary:r?o.primary25:"transparent",color:e?o.neutral20:n?o.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*a.baseUnit,"px ").concat(3*a.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:n?o.primary:o.primary50}}},placeholder:function(t){var e=t.theme,r=e.spacing;return{label:"placeholder",color:e.colors.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(t){var e=t.isDisabled,r=t.theme,n=r.spacing,i=r.colors;return{label:"singleValue",color:e?i.neutral40:i.neutral80,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,maxWidth:"calc(100% - ".concat(2*n.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(t){var e=t.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(e.baseUnit/2,"px ").concat(2*e.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};function Bt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=w({},t);return Object.keys(e).forEach(function(n){t[n]?r[n]=function(r,i){return e[n](t[n](r,i),i)}:r[n]=e[n]}),r}var Nt={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},jt={backspaceRemovesValue:!0,blurInputOnSelect:F(),captureMenuScroll:!F(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:et(),formatGroupLabel:function(t){return t.label},getOptionLabel:function(t){return t.label},getOptionValue:function(t){return t.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:xt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(t){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var e=t.count;return"".concat(e," result").concat(1!==e?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0},Vt=1,Ut=function(t){function e(t){var r;m(this,e),b(E(E(r=S(this,A(e).call(this,t)))),"state",{ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,isComposing:!1,menuOptions:{render:[],focusable:[]},selectValue:[]}),b(E(E(r)),"blockOptionHover",!1),b(E(E(r)),"clearFocusValueOnUpdate",!1),b(E(E(r)),"commonProps",void 0),b(E(E(r)),"components",void 0),b(E(E(r)),"hasGroups",!1),b(E(E(r)),"initialTouchX",0),b(E(E(r)),"initialTouchY",0),b(E(E(r)),"inputIsHiddenAfterUpdate",void 0),b(E(E(r)),"instancePrefix",""),b(E(E(r)),"openAfterFocus",!1),b(E(E(r)),"scrollToFocusedOptionOnUpdate",!1),b(E(E(r)),"userIsDragging",void 0),b(E(E(r)),"controlRef",null),b(E(E(r)),"getControlRef",function(t){r.controlRef=t}),b(E(E(r)),"focusedOptionRef",null),b(E(E(r)),"getFocusedOptionRef",function(t){r.focusedOptionRef=t}),b(E(E(r)),"menuListRef",null),b(E(E(r)),"getMenuListRef",function(t){r.menuListRef=t}),b(E(E(r)),"inputRef",null),b(E(E(r)),"getInputRef",function(t){r.inputRef=t}),b(E(E(r)),"cacheComponents",function(t){r.components=Rt({components:t})}),b(E(E(r)),"focus",r.focusInput),b(E(E(r)),"blur",r.blurInput),b(E(E(r)),"onChange",function(t,e){var n=r.props;(0,n.onChange)(t,w({},e,{name:n.name}))}),b(E(E(r)),"setValue",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",n=arguments.length>2?arguments[2]:void 0,i=r.props,a=i.closeMenuOnSelect,o=i.isMulti;r.onInputChange("",{action:"set-value"}),a&&(r.inputIsHiddenAfterUpdate=!o,r.onMenuClose()),r.clearFocusValueOnUpdate=!0,r.onChange(t,{action:e,option:n})}),b(E(E(r)),"selectOption",function(t){var e=r.props,n=e.blurInputOnSelect,i=e.isMulti,a=r.state.selectValue;if(i)if(r.isOptionSelected(t,a)){var o=r.getOptionValue(t);r.setValue(a.filter(function(t){return r.getOptionValue(t)!==o}),"deselect-option",t),r.announceAriaLiveSelection({event:"deselect-option",context:{value:r.getOptionLabel(t)}})}else r.isOptionDisabled(t,a)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t),isDisabled:!0}}):(r.setValue([].concat(C(a),[t]),"select-option",t),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t)}}));else r.isOptionDisabled(t,a)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t),isDisabled:!0}}):(r.setValue(t,"select-option"),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t)}}));n&&r.blurInput()}),b(E(E(r)),"removeValue",function(t){var e=r.state.selectValue,n=r.getOptionValue(t);r.onChange(e.filter(function(t){return r.getOptionValue(t)!==n}),{action:"remove-value",removedValue:t}),r.announceAriaLiveSelection({event:"remove-value",context:{value:t?r.getOptionLabel(t):""}}),r.focusInput()}),b(E(E(r)),"clearValue",function(){var t=r.props.isMulti;r.onChange(t?[]:null,{action:"clear"})}),b(E(E(r)),"popValue",function(){var t=r.state.selectValue,e=t[t.length-1];r.announceAriaLiveSelection({event:"pop-value",context:{value:e?r.getOptionLabel(e):""}}),r.onChange(t.slice(0,t.length-1),{action:"pop-value",removedValue:e})}),b(E(E(r)),"getOptionLabel",function(t){return r.props.getOptionLabel(t)}),b(E(E(r)),"getOptionValue",function(t){return r.props.getOptionValue(t)}),b(E(E(r)),"getStyles",function(t,e){var n=Ft[t](e);n.boxSizing="border-box";var i=r.props.styles[t];return i?i(n,e):n}),b(E(E(r)),"getElementId",function(t){return"".concat(r.instancePrefix,"-").concat(t)}),b(E(E(r)),"getActiveDescendentId",function(){var t=r.props.menuIsOpen,e=r.state,n=e.menuOptions,i=e.focusedOption;if(i&&t){var a=n.focusable.indexOf(i),o=n.render[a];return o&&o.key}}),b(E(E(r)),"announceAriaLiveSelection",function(t){var e=t.event,n=t.context;r.setState({ariaLiveSelection:yt(e,n)})}),b(E(E(r)),"announceAriaLiveContext",function(t){var e=t.event,n=t.context;r.setState({ariaLiveContext:mt(e,w({},n,{label:r.props["aria-label"]}))})}),b(E(E(r)),"onMenuMouseDown",function(t){0===t.button&&(t.stopPropagation(),t.preventDefault(),r.focusInput())}),b(E(E(r)),"onMenuMouseMove",function(t){r.blockOptionHover=!1}),b(E(E(r)),"onControlMouseDown",function(t){var e=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==t.target.tagName&&r.onMenuClose():e&&r.openMenu("first"):(e&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==t.target.tagName&&t.preventDefault()}),b(E(E(r)),"onDropdownIndicatorMouseDown",function(t){if(!(t&&"mousedown"===t.type&&0!==t.button||r.props.isDisabled)){var e=r.props,n=e.isMulti,i=e.menuIsOpen;r.focusInput(),i?(r.inputIsHiddenAfterUpdate=!n,r.onMenuClose()):r.openMenu("first"),t.preventDefault(),t.stopPropagation()}}),b(E(E(r)),"onClearIndicatorMouseDown",function(t){t&&"mousedown"===t.type&&0!==t.button||(r.clearValue(),t.stopPropagation(),r.openAfterFocus=!1,setTimeout(function(){return r.focusInput()}))}),b(E(E(r)),"onScroll",function(t){"boolean"==typeof r.props.closeMenuOnScroll?t.target instanceof HTMLElement&&P(t.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(t)&&r.props.onMenuClose()}),b(E(E(r)),"onCompositionStart",function(){r.setState({isComposing:!0})}),b(E(E(r)),"onCompositionEnd",function(){r.setState({isComposing:!1})}),b(E(E(r)),"onTouchStart",function(t){var e=t.touches.item(0);e&&(r.initialTouchX=e.clientX,r.initialTouchY=e.clientY,r.userIsDragging=!1)}),b(E(E(r)),"onTouchMove",function(t){var e=t.touches.item(0);if(e){var n=Math.abs(e.clientX-r.initialTouchX),i=Math.abs(e.clientY-r.initialTouchY);r.userIsDragging=n>5||i>5}}),b(E(E(r)),"onTouchEnd",function(t){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(t.target)&&r.menuListRef&&!r.menuListRef.contains(t.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)}),b(E(E(r)),"onControlTouchEnd",function(t){r.userIsDragging||r.onControlMouseDown(t)}),b(E(E(r)),"onClearIndicatorTouchEnd",function(t){r.userIsDragging||r.onClearIndicatorMouseDown(t)}),b(E(E(r)),"onDropdownIndicatorTouchEnd",function(t){r.userIsDragging||r.onDropdownIndicatorMouseDown(t)}),b(E(E(r)),"handleInputChange",function(t){var e=t.currentTarget.value;r.inputIsHiddenAfterUpdate=!1,r.onInputChange(e,{action:"input-change"}),r.onMenuOpen()}),b(E(E(r)),"onInputFocus",function(t){var e=r.props,n=e.isSearchable,i=e.isMulti;r.props.onFocus&&r.props.onFocus(t),r.inputIsHiddenAfterUpdate=!1,r.announceAriaLiveContext({event:"input",context:{isSearchable:n,isMulti:i}}),r.setState({isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1}),b(E(E(r)),"onInputBlur",function(t){r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(t),r.onInputChange("",{action:"input-blur"}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))}),b(E(E(r)),"onOptionHover",function(t){r.blockOptionHover||r.state.focusedOption===t||r.setState({focusedOption:t})}),b(E(E(r)),"shouldHideSelectedOptions",function(){var t=r.props,e=t.hideSelectedOptions,n=t.isMulti;return void 0===e?n:e}),b(E(E(r)),"onKeyDown",function(t){var e=r.props,n=e.isMulti,i=e.backspaceRemovesValue,a=e.escapeClearsValue,o=e.inputValue,s=e.isClearable,l=e.isDisabled,u=e.menuIsOpen,c=e.onKeyDown,f=e.tabSelectsValue,h=e.openMenuOnFocus,p=r.state,d=p.isComposing,v=p.focusedOption,g=p.focusedValue,m=p.selectValue;if(!(l||"function"==typeof c&&(c(t),t.defaultPrevented))){switch(r.blockOptionHover=!0,t.key){case"ArrowLeft":if(!n||o)return;r.focusValue("previous");break;case"ArrowRight":if(!n||o)return;r.focusValue("next");break;case"Delete":case"Backspace":if(o)return;if(g)r.removeValue(g);else{if(!i)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(d)return;if(t.shiftKey||!u||!f||!v||h&&r.isOptionSelected(v,m))return;r.selectOption(v);break;case"Enter":if(229===t.keyCode)break;if(u){if(!v)return;if(d)return;r.selectOption(v);break}return;case"Escape":u?(r.inputIsHiddenAfterUpdate=!1,r.onInputChange("",{action:"menu-close"}),r.onMenuClose()):s&&a&&r.clearValue();break;case" ":if(o)return;if(!u){r.openMenu("first");break}if(!v)return;r.selectOption(v);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}t.preventDefault()}});var n=t.value;r.cacheComponents=o(r.cacheComponents,$).bind(E(E(r))),r.cacheComponents(t.components),r.instancePrefix="react-select-"+(r.props.instanceId||++Vt);var i=I(n),a=r.buildMenuOptions(t,i);return r.state.menuOptions=a,r.state.selectValue=i,r}return k(e,n["Component"]),x(e,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,r=e.options,n=e.value,i=e.inputValue;if(this.cacheComponents(t.components),t.value!==n||t.options!==r||t.inputValue!==i){var a=I(t.value),o=this.buildMenuOptions(t,a),s=this.getNextFocusedValue(a),l=this.getNextFocusedOption(o.focusable);this.setState({menuOptions:o,selectValue:a,focusedOption:l,focusedValue:s})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(t){var e,r,n,i,a,o=this.props,s=o.isDisabled,l=o.menuIsOpen,u=this.state.isFocused;(u&&!s&&t.isDisabled||u&&l&&!t.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(e=this.menuListRef,r=this.focusedOptionRef,n=e.getBoundingClientRect(),i=r.getBoundingClientRect(),a=r.offsetHeight/3,i.bottom+a>n.bottom?z(e,Math.min(r.offsetTop+r.clientHeight-e.offsetHeight+a,e.scrollHeight)):i.top-a-1&&(o=s)}this.scrollToFocusedOptionOnUpdate=!(i&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.onMenuOpen(),this.setState({focusedValue:null,focusedOption:r.focusable[o]}),this.announceAriaLiveContext({event:"menu"})}},{key:"focusValue",value:function(t){var e=this.props,r=e.isMulti,n=e.isSearchable,i=this.state,a=i.selectValue,o=i.focusedValue;if(r){this.setState({focusedOption:null});var s=a.indexOf(o);o||(s=-1,this.announceAriaLiveContext({event:"value"}));var l=a.length-1,u=-1;if(a.length){switch(t){case"previous":u=0===s?0:-1===s?l:s-1;break;case"next":s>-1&&s0&&void 0!==arguments[0]?arguments[0]:"first",e=this.props.pageSize,r=this.state,n=r.focusedOption,i=r.menuOptions.focusable;if(i.length){var a=0,o=i.indexOf(n);n||(o=-1,this.announceAriaLiveContext({event:"menu"})),"up"===t?a=o>0?o-1:i.length-1:"down"===t?a=(o+1)%i.length:"pageup"===t?(a=o-e)<0&&(a=0):"pagedown"===t?(a=o+e)>i.length-1&&(a=i.length-1):"last"===t&&(a=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[a],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:xt(i[a])}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Nt):w({},Nt,this.props.theme):Nt}},{key:"getCommonProps",value:function(){var t=this.clearValue,e=this.getStyles,r=this.setValue,n=this.selectOption,i=this.props,a=i.classNamePrefix,o=i.isMulti,s=i.isRtl,l=i.options,u=this.state.selectValue,c=this.hasValue();return{cx:function(t,e,r,n){var i=[e,n];if(r&&t)for(var a in r)r.hasOwnProperty(a)&&r[a]&&i.push("".concat(O(t,a)));return i.filter(function(t){return t}).map(function(t){return String(t).trim()}).join(" ")}.bind(null,a),clearValue:t,getStyles:e,getValue:function(){return u},hasValue:c,isMulti:o,isRtl:s,options:l,selectOption:n,setValue:r,selectProps:i,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(t){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var e=this.state,r=e.focusedValue,n=e.selectValue.indexOf(r);if(n>-1){if(t.indexOf(r)>-1)return r;if(n-1?e:t[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var t=this.props,e=t.isClearable,r=t.isMulti;return void 0===e?r:e}},{key:"isOptionDisabled",value:function(t,e){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(t,e)}},{key:"isOptionSelected",value:function(t,e){var r=this;if(e.indexOf(t)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(t,e);var n=this.getOptionValue(t);return e.some(function(t){return r.getOptionValue(t)===n})}},{key:"filterOption",value:function(t,e){return!this.props.filterOption||this.props.filterOption(t,e)}},{key:"formatOptionLabel",value:function(t,e){if("function"==typeof this.props.formatOptionLabel){var r=this.props.inputValue,n=this.state.selectValue;return this.props.formatOptionLabel(t,{context:e,inputValue:r,selectValue:n})}return this.getOptionLabel(t)}},{key:"formatGroupLabel",value:function(t){return this.props.formatGroupLabel(t)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"buildMenuOptions",value:function(t,e){var r=this,n=t.inputValue,i=void 0===n?"":n,a=t.options,o=function(t,n){var a=r.isOptionDisabled(t,e),o=r.isOptionSelected(t,e),s=r.getOptionLabel(t),l=r.getOptionValue(t);if(!(r.shouldHideSelectedOptions()&&o||!r.filterOption({label:s,value:l,data:t},i))){var u=a?void 0:function(){return r.onOptionHover(t)},c=a?void 0:function(){return r.selectOption(t)},f="".concat(r.getElementId("option"),"-").concat(n);return{innerProps:{id:f,onClick:c,onMouseMove:u,onMouseOver:u,tabIndex:-1},data:t,isDisabled:a,isSelected:o,key:f,label:s,type:"option",value:l}}};return a.reduce(function(t,e,n){if(e.options){r.hasGroups||(r.hasGroups=!0);var i=e.options.map(function(e,r){var i=o(e,"".concat(n,"-").concat(r));return i&&t.focusable.push(e),i}).filter(Boolean);if(i.length){var a="".concat(r.getElementId("group"),"-").concat(n);t.render.push({type:"group",key:a,data:e,options:i})}}else{var s=o(e,"".concat(n));s&&(t.render.push(s),t.focusable.push(e))}return t},{render:[],focusable:[]})}},{key:"constructAriaLiveMessage",value:function(){var t=this.state,e=t.ariaLiveContext,r=t.selectValue,n=t.focusedValue,i=t.focusedOption,a=this.props,o=a.options,s=a.menuIsOpen,l=a.inputValue,u=a.screenReaderStatus,c=n?function(t){var e=t.focusedValue,r=t.getOptionLabel,n=t.selectValue;return"value ".concat(r(e)," focused, ").concat(n.indexOf(e)+1," of ").concat(n.length,".")}({focusedValue:n,getOptionLabel:this.getOptionLabel,selectValue:r}):"",f=i&&s?function(t){var e=t.focusedOption,r=t.getOptionLabel,n=t.options;return"option ".concat(r(e)," focused").concat(e.isDisabled?" disabled":"",", ").concat(n.indexOf(e)+1," of ").concat(n.length,".")}({focusedOption:i,getOptionLabel:this.getOptionLabel,options:o}):"",h=function(t){var e=t.inputValue,r=t.screenReaderMessage;return"".concat(r).concat(e?" for search term "+e:"",".")}({inputValue:l,screenReaderMessage:u({count:this.countOptions()})});return"".concat(c," ").concat(f," ").concat(h," ").concat(e)}},{key:"renderInput",value:function(){var t=this.props,e=t.isDisabled,r=t.isSearchable,n=t.inputId,a=t.inputValue,o=t.tabIndex,s=this.components.Input,l=this.state.inputIsHidden,u=n||this.getElementId("input");if(!r)return i.a.createElement(nt,{id:u,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:L,onFocus:this.onInputFocus,readOnly:!0,disabled:e,tabIndex:o,value:""});var c={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]},f=this.commonProps,h=f.cx,p=f.theme,d=f.selectProps;return i.a.createElement(s,_({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:h,getStyles:this.getStyles,id:u,innerRef:this.getInputRef,isDisabled:e,isHidden:l,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:d,spellCheck:"false",tabIndex:o,theme:p,type:"text",value:a},c))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,e=this.components,r=e.MultiValue,n=e.MultiValueContainer,a=e.MultiValueLabel,o=e.MultiValueRemove,s=e.SingleValue,l=e.Placeholder,u=this.commonProps,c=this.props,f=c.controlShouldRenderValue,h=c.isDisabled,p=c.isMulti,d=c.inputValue,v=c.placeholder,g=this.state,m=g.selectValue,y=g.focusedValue,x=g.isFocused;if(!this.hasValue()||!f)return d?null:i.a.createElement(l,_({},u,{key:"placeholder",isDisabled:h,isFocused:x}),v);if(p)return m.map(function(e){var s=e===y;return i.a.createElement(r,_({},u,{components:{Container:n,Label:a,Remove:o},isFocused:s,isDisabled:h,key:t.getOptionValue(e),removeProps:{onClick:function(){return t.removeValue(e)},onTouchEnd:function(){return t.removeValue(e)},onMouseDown:function(t){t.preventDefault(),t.stopPropagation()}},data:e}),t.formatOptionLabel(e,"value"))});if(d)return null;var b=m[0];return i.a.createElement(s,_({},u,{data:b,isDisabled:h}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.components.ClearIndicator,e=this.commonProps,r=this.props,n=r.isDisabled,a=r.isLoading,o=this.state.isFocused;if(!this.isClearable()||!t||n||!this.hasValue()||a)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(t,_({},e,{innerProps:s,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var t=this.components.LoadingIndicator,e=this.commonProps,r=this.props,n=r.isDisabled,a=r.isLoading,o=this.state.isFocused;if(!t||!a)return null;return i.a.createElement(t,_({},e,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:o}))}},{key:"renderIndicatorSeparator",value:function(){var t=this.components,e=t.DropdownIndicator,r=t.IndicatorSeparator;if(!e||!r)return null;var n=this.commonProps,a=this.props.isDisabled,o=this.state.isFocused;return i.a.createElement(r,_({},n,{isDisabled:a,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var t=this.components.DropdownIndicator;if(!t)return null;var e=this.commonProps,r=this.props.isDisabled,n=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(t,_({},e,{innerProps:a,isDisabled:r,isFocused:n}))}},{key:"renderMenu",value:function(){var t=this,e=this.components,r=e.Group,n=e.GroupHeading,a=e.Menu,o=e.MenuList,s=e.MenuPortal,l=e.LoadingMessage,u=e.NoOptionsMessage,c=e.Option,f=this.commonProps,h=this.state,p=h.focusedOption,d=h.menuOptions,v=this.props,g=v.captureMenuScroll,m=v.inputValue,y=v.isLoading,x=v.loadingMessage,b=v.minMenuHeight,w=v.maxMenuHeight,k=v.menuIsOpen,A=v.menuPlacement,T=v.menuPosition,E=v.menuPortalTarget,S=v.menuShouldBlockScroll,C=v.menuShouldScrollIntoView,L=v.noOptionsMessage,O=v.onMenuScrollToTop,I=v.onMenuScrollToBottom;if(!k)return null;var P,D=function(e){var r=p===e.data;return e.innerRef=r?t.getFocusedOptionRef:void 0,i.a.createElement(c,_({},f,e,{isFocused:r}),t.formatOptionLabel(e.data,"menu"))};if(this.hasOptions())P=d.render.map(function(e){if("group"===e.type){e.type;var a=M(e,["type"]),o="".concat(e.key,"-heading");return i.a.createElement(r,_({},f,a,{Heading:n,headingProps:{id:o},label:t.formatGroupLabel(e.data)}),e.options.map(function(t){return D(t)}))}if("option"===e.type)return D(e)});else if(y){var z=x({inputValue:m});if(null===z)return null;P=i.a.createElement(l,f,z)}else{var R=L({inputValue:m});if(null===R)return null;P=i.a.createElement(u,f,R)}var F={minMenuHeight:b,maxMenuHeight:w,menuPlacement:A,menuPosition:T,menuShouldScrollIntoView:C},B=i.a.createElement(j,_({},f,F),function(e){var r=e.ref,n=e.placerProps,s=n.placement,l=n.maxHeight;return i.a.createElement(a,_({},f,F,{innerRef:r,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:y,placement:s}),i.a.createElement(gt,{isEnabled:g,onTopArrive:O,onBottomArrive:I},i.a.createElement(dt,{isEnabled:S},i.a.createElement(o,_({},f,{innerRef:t.getMenuListRef,isLoading:y,maxHeight:l}),P))))});return E||"fixed"===T?i.a.createElement(s,_({},f,{appendTo:E,controlElement:this.controlRef,menuPlacement:A,menuPosition:T}),B):B}},{key:"renderFormField",value:function(){var t=this,e=this.props,r=e.delimiter,n=e.isDisabled,a=e.isMulti,o=e.name,s=this.state.selectValue;if(o&&!n){if(a){if(r){var l=s.map(function(e){return t.getOptionValue(e)}).join(r);return i.a.createElement("input",{name:o,type:"hidden",value:l})}var u=s.length>0?s.map(function(e,r){return i.a.createElement("input",{key:"i-".concat(r),name:o,type:"hidden",value:t.getOptionValue(e)})}):i.a.createElement("input",{name:o,type:"hidden"});return i.a.createElement("div",null,u)}var c=s[0]?this.getOptionValue(s[0]):"";return i.a.createElement("input",{name:o,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?i.a.createElement(rt,{"aria-live":"assertive"},i.a.createElement("p",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),i.a.createElement("p",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var t=this.components,e=t.Control,r=t.IndicatorsContainer,n=t.SelectContainer,a=t.ValueContainer,o=this.props,s=o.className,l=o.id,u=o.isDisabled,c=o.menuIsOpen,f=this.state.isFocused,h=this.commonProps=this.getCommonProps();return i.a.createElement(n,_({},h,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:f}),this.renderLiveRegion(),i.a.createElement(e,_({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:f,menuIsOpen:c}),i.a.createElement(a,_({},h,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),i.a.createElement(r,_({},h,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),e}();b(Ut,"defaultProps",jt);var Ht={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},qt=function(t){var e,r;return r=e=function(e){function r(){var t,e;m(this,r);for(var n=arguments.length,i=new Array(n),a=0;a1?r-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r=String(t).toLowerCase(),n=String(e.value).toLowerCase(),i=String(e.label).toLowerCase();return n===r||i===r},$t=w({allowCreateWhileLoading:!1,createOptionPosition:"last"},{formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,e,r){return!(!t||e.some(function(e){return Zt(t,e)})||r.some(function(e){return Zt(t,e)}))},getNewOptionData:function(t,e){return{label:e,value:t,__isNew__:!0}}}),Jt=function(t){var e,r;return r=e=function(e){function r(t){var e;m(this,r),b(E(E(e=S(this,A(r).call(this,t)))),"select",void 0),b(E(E(e)),"onChange",function(t,r){var n=e.props,i=n.getNewOptionData,a=n.inputValue,o=n.isMulti,s=n.onChange,l=n.onCreateOption,u=n.value;if("select-option"!==r.action)return s(t,r);var c=e.state.newOption,f=Array.isArray(t)?t:[t];if(f[f.length-1]!==c)s(t,r);else if(l)l(a);else{var h=i(a,a),p={action:"create-option"};s(o?[].concat(C(I(u)),[h]):h,p)}});var n=t.options||[];return e.state={newOption:void 0,options:n},e}return k(r,n["Component"]),x(r,[{key:"componentWillReceiveProps",value:function(t){var e=t.allowCreateWhileLoading,r=t.createOptionPosition,n=t.formatCreateLabel,i=t.getNewOptionData,a=t.inputValue,o=t.isLoading,s=t.isValidNewOption,l=t.value,u=t.options||[],c=this.state.newOption;c=s(a,I(l),u)?i(a,n(a)):void 0,this.setState({newOption:c,options:!e&&o||!c?u:"first"===r?[c].concat(C(u)):[].concat(C(u),[c])})}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"render",value:function(){var e=this,r=_({},this.props),n=this.state.options;return i.a.createElement(t,_({},r,{ref:function(t){e.select=t},options:n,onChange:this.onChange}))}}]),r}(),b(e,"defaultProps",$t),r},Kt=qt(Jt(Ut)),Qt=qt(Jt(Ut)),te=Wt(Qt),ee=function(t){var e=t.component,r=t.duration,n=void 0===r?1:r,a=t.in,o=(t.onExited,M(t,["component","duration","in","onExited"])),s={entering:{opacity:0},entered:{opacity:1,transition:"opacity ".concat(n,"ms")},exiting:{opacity:0},exited:{opacity:0}};return i.a.createElement(v.Transition,{mountOnEnter:!0,unmountOnExit:!0,in:a,timeout:n},function(t){var r={style:w({},s[t])};return i.a.createElement(e,_({innerProps:r},o))})},re=260,ne=function(t){function e(){var t,r;m(this,e);for(var n=arguments.length,i=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},r=Rt({components:e}),n=r.Input,a=r.MultiValue,o=r.Placeholder,s=r.SingleValue,l=r.ValueContainer,u=M(r,["Input","MultiValue","Placeholder","SingleValue","ValueContainer"]);return w({Input:(t=n,function(e){e.in,e.onExited,e.appear,e.enter,e.exit;var r=M(e,["in","onExited","appear","enter","exit"]);return i.a.createElement(t,r)}),MultiValue:function(t){return function(e){var r=e.in,n=e.onExited,a=M(e,["in","onExited"]);return i.a.createElement(ne,{in:r,onExited:n},i.a.createElement(t,_({cropWithEllipsis:r},a)))}}(a),Placeholder:function(t){return function(e){return i.a.createElement(ee,_({component:t,duration:e.isMulti?re:1},e))}}(o),SingleValue:function(t){return function(e){return i.a.createElement(ee,_({component:t},e))}}(s),ValueContainer:function(t){return function(e){return i.a.createElement(v.TransitionGroup,_({component:t},e))}}(l)},u)},ae=ie(),oe=(ae.Input,ae.MultiValue,ae.Placeholder,ae.SingleValue,ae.ValueContainer,o(ie,$)),se=qt(Ut);e.default=se},function(t,e,r){"use strict";var n=r(9),i=Object(n.a)(function(t,e){for(var r={},n={},i=0,a=t.length;i0))return o;do{o.push(a=new Date(+t)),n(t,i),e(t)}while(a=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(t,e){if(t>=t)if(e<0)for(;++e<=0;)for(;n(t,-1),!r(t););else for(;--e>=0;)for(;n(t,1),!r(t););}))},a&&(c.count=function(t,n){return r.setTime(+t),i.setTime(+n),e(r),e(i),Math.floor(a(r,i))},c.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?c.filter(o?function(e){return o(e)%t==0}:function(e){return c.count(0,e)%t==0}):c:null}),c};var r=new Date,i=new Date},function(t,e,n){var r=n(128),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();t.exports=a},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";var r=n(99);n.d(e,"a",(function(){return r.a})),n(171),n(102),n(169),n(172);var i=n(69);n.d(e,"c",(function(){return i.a})),n(173);var a=n(357);n.d(e,"f",(function(){return a.a}));var o=n(174);n.d(e,"g",(function(){return o.a}));var c=n(358);n.d(e,"h",(function(){return c.a})),n.d(e,"i",(function(){return c.b}));var u=n(361);n.d(e,"j",(function(){return u.a}));var f=n(168);n.d(e,"d",(function(){return f.a})),n.d(e,"e",(function(){return f.b})),n(362),n(363),n(364);var s=n(365);n.d(e,"b",(function(){return s.a})),n(366)},function(t,e,n){"use strict";var r=n(100);n.d(e,"a",(function(){return r.e})),n.d(e,"f",(function(){return r.g})),n.d(e,"d",(function(){return r.f}));var i=n(355);n.d(e,"e",(function(){return i.a})),n.d(e,"c",(function(){return i.b}));var a=n(356);n.d(e,"b",(function(){return a.a}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(197);n.d(e,"bisect",(function(){return r.c})),n.d(e,"bisectRight",(function(){return r.b})),n.d(e,"bisectLeft",(function(){return r.a}));var i=n(36);n.d(e,"ascending",(function(){return i.a}));var a=n(198);n.d(e,"bisector",(function(){return a.a}));var o=n(452);n.d(e,"cross",(function(){return o.a}));var c=n(453);n.d(e,"descending",(function(){return c.a}));var u=n(200);n.d(e,"deviation",(function(){return u.a}));var f=n(202);n.d(e,"extent",(function(){return f.a}));var s=n(454);n.d(e,"histogram",(function(){return s.a}));var l=n(457);n.d(e,"thresholdFreedmanDiaconis",(function(){return l.a}));var d=n(458);n.d(e,"thresholdScott",(function(){return d.a}));var h=n(206);n.d(e,"thresholdSturges",(function(){return h.a}));var b=n(459);n.d(e,"max",(function(){return b.a}));var p=n(460);n.d(e,"mean",(function(){return p.a}));var v=n(461);n.d(e,"median",(function(){return v.a}));var y=n(462);n.d(e,"merge",(function(){return y.a}));var _=n(207);n.d(e,"min",(function(){return _.a}));var g=n(199);n.d(e,"pairs",(function(){return g.a}));var m=n(463);n.d(e,"permute",(function(){return m.a}));var x=n(112);n.d(e,"quantile",(function(){return x.a}));var w=n(204);n.d(e,"range",(function(){return w.a}));var j=n(464);n.d(e,"scan",(function(){return j.a}));var O=n(465);n.d(e,"shuffle",(function(){return O.a}));var M=n(466);n.d(e,"sum",(function(){return M.a}));var k=n(205);n.d(e,"ticks",(function(){return k.a})),n.d(e,"tickIncrement",(function(){return k.b})),n.d(e,"tickStep",(function(){return k.c}));var A=n(208);n.d(e,"transpose",(function(){return A.a}));var T=n(201);n.d(e,"variance",(function(){return T.a}));var S=n(467);n.d(e,"zip",(function(){return S.a}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return C})),e.a=I;var r=n(315),i=n(316),a=n(317),o=n(318),c=n(162),u=n(320),f=n(321),s=n(322),l=n(323),d=n(324),h=n(325),b=n(326),p=n(327),v=n(328),y=n(329),_=n(330),g=n(164),m=n(331),x=n(332),w=n(333),j=n(334),O=n(335),M=n(336),k=n(337),A=n(338),T=n(339),S=n(340),P=n(341),R=n(97),E=n(342),C=[null];function I(t,e){this._groups=t,this._parents=e}function N(){return new I([[document.documentElement]],C)}I.prototype=N.prototype={constructor:I,select:r.a,selectAll:i.a,filter:a.a,data:o.a,enter:c.b,exit:u.a,merge:f.a,order:s.a,sort:l.a,call:d.a,nodes:h.a,node:b.a,size:p.a,empty:v.a,each:y.a,attr:_.a,style:g.a,property:m.a,classed:x.a,text:w.a,html:j.a,raise:O.a,lower:M.a,append:k.a,insert:A.a,remove:T.a,clone:S.a,datum:P.a,on:R.b,dispatch:E.a},e.b=N},function(t,e,n){"use strict";n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return f})),n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return h})),e.g=function(t,e){var n=b(t,e);if(n.state>c)throw new Error("too late; already scheduled");return n},e.h=function(t,e){var n=b(t,e);if(n.state>f)throw new Error("too late; already started");return n},e.f=b;var r=n(68),i=n(177),a=Object(r.dispatch)("start","end","interrupt"),o=[],c=0,u=1,f=2,s=3,l=4,d=5,h=6;function b(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}e.e=function(t,e,n,r,b,p){var v=t.__transition;if(v){if(n in v)return}else t.__transition={};!function(t,e,n){var r,a=t.__transition;function o(d){var p,v,y,_;if(n.state!==u)return b();for(p in a)if((_=a[p]).name===n.name){if(_.state===s)return Object(i.b)(o);_.state===l?(_.state=h,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete a[p]):+p0&&(0,l.renderAxes)(o,this.conf,t,this.scale);var u=this.renderDatum(o,this.conf,t._layout);return this.conf.tooltipContent&&(0,i.registerTooltip)(this,t,u,this.conf),u.on("mouseover",(function(e,n){r.dispatch.call("mouseover",r,e),r.conf.tooltipContent&&t.clipboard.attr("value",r.conf.tooltipContent(e))})),u.on("mouseout",(function(t,e){r.dispatch.call("mouseout",r,t)})),Object.keys(this.conf.events).forEach((function(t){var e=r.conf;u.on(t,(function(n,r,i){e.events[t](n,r,i,c.event)}))})),this}},{key:"renderBlock",value:function(t,e,n,r){var i=this,a=t.selectAll(".block").data(e).enter().append("g").attr("class","block").attr("transform",(function(t){return"rotate("+360*n.blocks[t.key].start/(2*Math.PI)+")"}));return r.backgrounds&&a.selectAll(".background").data((function(t){return r.backgrounds.map((function(e){return{start:e.start||r.cmin,end:e.end||r.cmax,angle:n.blocks[t.key].end-n.blocks[t.key].start,color:e.color,opacity:e.opacity}}))})).enter().append("path").attr("class","background").attr("fill",(function(t){return t.color})).attr("opacity",(function(t){return t.opacity||1})).attr("d",(0,o.arc)().innerRadius((function(t){return"in"===r.direction?r.outerRadius-i.scale(t.start):r.innerRadius+i.scale(t.start)})).outerRadius((function(t){return"in"===r.direction?r.outerRadius-i.scale(t.end):r.innerRadius+i.scale(t.end)})).startAngle(0).endAngle((function(t){return t.angle}))),a}},{key:"theta",value:function(t,e){return t/e.len*(e.end-e.start)}},{key:"x",value:function(t,e,n){var r=this.scale(t.value),i="in"===n.direction?n.outerRadius-r:n.innerRadius+r,a=this.theta(t.position,e.blocks[t.block_id])-Math.PI/2;return i*Math.cos(a)}},{key:"y",value:function(t,e,n){var r=this.scale(t.value),i="in"===n.direction?n.outerRadius-r:n.innerRadius+r,a=this.theta(t.position,e.blocks[t.block_id])-Math.PI/2;return i*Math.sin(a)}}]),t}();e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSpanValueData=function(t,e){return 0===t.length?{data:[],meta:{min:null,max:null}}:d(t.filter((function(t,n){return s(t.block_id,n,e,"parent")})))},e.parseSpanStringData=function(t,e){return 0===t.length?{data:[],meta:{min:null,max:null}}:d(t.filter((function(t,n){return s(t.block_id,n,e,"parent")})).filter((function(t,e){return l({start:t.start,end:t.end},e)})).filter((function(t){return!(t.start<0||t.end>e[t.block_id])||(f.log(2,"position","position inconsistency",{datum:t,layoutSummary:e}),!1)})))},e.parsePositionValueData=function(t,e){return 0===t.length?{data:[],meta:{min:null,max:null}}:d(t.filter((function(t,n){return s(t.block_id,n,e,"parent")})).filter((function(t,e){return l({position:t.position,value:t.value},e)})))},e.parsePositionTextData=function(t,e){return 0===t.length?{data:[],meta:{min:null,max:null}}:d(t.filter((function(t,n){return s(t.block_id,n,e,"parent")})).filter((function(t,e){return l({position:t.position},e)})))},e.parseChordData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};var n=t.filter((function(t,n){return t.source?s(t.source.id,n,e,"sourceId"):(f.warn("No source for data at index "+n),!1)})).filter((function(t,n){return t.target?s(t.target.id,n,e,"targetId"):(f.warn("No target for data at index "+n),!1)})).filter((function(t,e){return l({sourceStart:t.source.start,sourceEnd:t.source.end,targetStart:t.target.start,targetEnd:t.target.end,value:t.value||1},e)}));return{data:n,meta:{min:(0,c.min)(n,(function(t){return t.value})),max:(0,c.max)(n,(function(t){return t.value}))}}};var r=u(n(18)),i=u(n(613)),a=u(n(617)),o=(u(n(144)),n(227)),c=n(10);function u(t){return t&&t.__esModule?t:{default:t}}var f=console;function s(t,e,n,a){return!!(0,i.default)((0,r.default)(n),t)||(f.log(1,"datum","unknown parent id",{line:e+1,value:t,header:a,layoutSummary:n}),!1)}function l(t,e){return(0,a.default)(t,(function(t,n){return!isNaN(t)||(f.log(1,"datum","not a number",{line:e+1,value:t,header:n}),!1)}))}function d(t){return{data:(0,o.nest)().key((function(t){return t.block_id})).entries(t),meta:{min:(0,c.min)(t,(function(t){return t.value})),max:(0,c.max)(t,(function(t){return t.value}))}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={min:{value:null,iteratee:!1},max:{value:null,iteratee:!1},logScale:{value:!1,iteratee:!1},logScaleBase:{value:Math.E,iteratee:!1}};e.axes={axes:{value:[],iteratee:!1},showAxesTooltip:{value:!0,iteratee:!1}},e.palette={colorPaletteSize:{value:9,iteratee:!1},colorPalette:{value:"YlGnBu",iteratee:!1},usePalette:{value:!0,iteratee:!1},colorPaletteReverse:{value:!0,iteratee:!1}},e.radial={innerRadius:{value:0,iteratee:!1},outerRadius:{value:0,iteratee:!1}},e.values=r,e.common={zIndex:{value:!1,iteratee:!1},opacity:{value:1,iteratee:!0},tooltipContent:{value:null,iteratee:!1},events:{value:{},iteratee:!1}}},function(t,e,n){var r=n(243),i=n(248);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(16),i=n(7),a="[object AsyncFunction]",o="[object Function]",c="[object GeneratorFunction]",u="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=r(t);return e==o||e==c||e==a||e==u}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e){t.exports={}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return a}));var r=Array.prototype,i=r.map,a=r.slice},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(5).Symbol;t.exports=r},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++ne?1:t>=e?0:NaN}},function(t,e,n){var r=n(476),i=n(478);t.exports=function(t,e,n){return r(i,t,e,n)}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(283),i=n(285)(r);t.exports=i},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n180||n<-180?n-360*Math.round(n/360):n):Object(r.a)(isNaN(t)?e:t)},e.b=function(t){return 1==(t=+t)?a:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Object(r.a)(isNaN(e)?n:e)}},e.a=a;var r=n(170);function i(t,e){return function(n){return t+n*e}}function a(t,e){var n=e-t;return n?i(t,n):Object(r.a)(isNaN(t)?e:t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return a})),n.d(e,"h",(function(){return o})),n.d(e,"i",(function(){return c})),n.d(e,"k",(function(){return u})),n.d(e,"l",(function(){return f})),n.d(e,"f",(function(){return s})),n.d(e,"j",(function(){return l})),n.d(e,"g",(function(){return d})),n.d(e,"m",(function(){return h})),e.b=function(t){return t>1?0:t<-1?l:Math.acos(t)},e.c=function(t){return t>=1?d:t<=-1?-d:Math.asin(t)};var r=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,c=Math.min,u=Math.sin,f=Math.sqrt,s=1e-12,l=Math.PI,d=l/2,h=2*l},function(t,e,n){"use strict";e.a=function(t,e){if((i=t.length)>1)for(var n,r,i,a=1,o=t[e[0]],c=o.length;a=0;)n[e]=e;return n}},function(t,e,n){"use strict";e.a=function(t){return null===t?NaN:+t}},function(t,e,n){"use strict";e.b=c,e.a=function t(){var e=Object(a.b)(a.c,i.c);return e.copy=function(){return Object(a.a)(e,t())},c(e)};var r=n(10),i=n(8),a=n(76),o=n(527);function c(t){var e=t.domain;return t.ticks=function(t){var n=e();return Object(r.ticks)(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){return Object(o.a)(e(),t,n)},t.nice=function(n){null==n&&(n=10);var i,a=e(),o=0,c=a.length-1,u=a[o],f=a[c];return f0?(u=Math.floor(u/i)*i,f=Math.ceil(f/i)*i,i=Object(r.tickIncrement)(u,f,n)):i<0&&(u=Math.ceil(u*i)/i,f=Math.floor(f*i)/i,i=Object(r.tickIncrement)(u,f,n)),i>0?(a[o]=Math.floor(u/i)*i,a[c]=Math.ceil(f/i)*i,e(a)):i<0&&(a[o]=Math.ceil(u*i)/i,a[c]=Math.floor(f*i)/i,e(a)),t},t}},function(t,e,n){"use strict";e.a=function(t){return t.match(/.{6}/g).map((function(t){return"#"+t}))}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(52),i=n(255),a=n(256),o=n(257),c=n(258),u=n(259);function f(t){var e=this.__data__=new r(t);this.size=e.size}f.prototype.clear=i,f.prototype.delete=a,f.prototype.get=o,f.prototype.has=c,f.prototype.set=u,t.exports=f},function(t,e,n){var r=n(250),i=n(251),a=n(252),o=n(253),c=n(254);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t2?l:s,r=o=null,y}function y(e){return(r||(r=n(d,h,p?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=e?0:t>=n?1:r(t)}}}(t):t,b)))(+e)}return y.invert=function(t){return(o||(o=n(h,d,f,p?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=0?e:t>=1?n:r(t)}}}(e):e)))(+t)},y.domain=function(t){return arguments.length?(d=a.a.call(t,c.a),v()):d.slice()},y.range=function(t){return arguments.length?(h=a.b.call(t),v()):h.slice()},y.rangeRound=function(t){return h=a.b.call(t),b=i.f,v()},y.clamp=function(t){return arguments.length?(p=!!t,v()):p},y.interpolate=function(t){return arguments.length?(b=t,v()):b},v()};var r=n(10),i=n(8),a=n(27),o=n(121),c=n(228),u=[0,1];function f(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Object(o.a)(e)}function s(t,e,n,r){var i=t[0],a=t[1],o=e[0],c=e[1];return a-1&&t%1==0&&t<=n}},function(t,e,n){var r=n(277),i=n(60),a=n(89),o=a&&a.isTypedArray,c=o?i(o):r;t.exports=c},function(t,e,n){(function(t){var r=n(128),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i&&r.process,c=function(){try{var t=a&&a.require&&a.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=c}).call(e,n(84)(t))},function(t,e,n){var r=n(83),i=n(38),a=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var o=t[e];a.call(t,e)&&i(o,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(149),i=n(150),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,c=o?function(t){return null==t?[]:(t=Object(t),r(o(t),(function(e){return a.call(t,e)})))}:i;t.exports=c},function(t,e,n){var r=n(2),i=n(34),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||o.test(t)||!a.test(t)||null!=e&&t in Object(e)}},function(t,e,n){"use strict";var r=n(94);e.a=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),r.a.hasOwnProperty(e)?{space:r.a[e],local:t}:t}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r}));var r="http://www.w3.org/1999/xhtml";e.a={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(t,e,n){"use strict";function r(){}e.a=function(t){return null==t?r:function(){return this.querySelector(t)}}},function(t,e,n){"use strict";e.a=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),e.a=function(t,e,n,r){var a=i;t.sourceEvent=i,i=t;try{return e.apply(n,r)}finally{i=a}};var r={},i=null;function a(t,e,n){return t=o(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function o(t,e,n){return function(r){var a=i;i=r;try{t.call(this,this.__data__,e,n)}finally{i=a}}}function c(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function u(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=l.exec(t))?m(parseInt(e[1],16)):(e=d.exec(t))?new O(e[1],e[2],e[3],1):(e=h.exec(t))?new O(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=b.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=v.exec(t))?M(e[1],e[2]/100,e[3]/100,1):(e=y.exec(t))?M(e[1],e[2]/100,e[3]/100,e[4]):_.hasOwnProperty(t)?m(_[t]):"transparent"===t?new O(NaN,NaN,NaN,0):null}function m(t){return new O(t>>16&255,t>>8&255,255&t,1)}function x(t,e,n,r){return r<=0&&(t=e=n=NaN),new O(t,e,n,r)}function w(t){return t instanceof i||(t=g(t)),t?new O((t=t.rgb()).r,t.g,t.b,t.opacity):new O}function j(t,e,n,r){return 1===arguments.length?w(t):new O(t,e,n,null==r?1:r)}function O(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function M(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new A(t,e,n,r)}function k(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof A)return new A(t.h,t.s,t.l,t.opacity);if(t instanceof i||(t=g(t)),!t)return new A;if(t instanceof A)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,a=Math.min(e,n,r),o=Math.max(e,n,r),c=NaN,u=o-a,f=(o+a)/2;return u?(c=e===o?(n-r)/u+6*(n0&&f<1?0:c,new A(c,u,f,t.opacity)}(t):new A(t,e,n,null==r?1:r)}function A(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function T(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Object(r.a)(i,g,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Object(r.a)(O,j,Object(r.b)(i,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new O(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new O(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(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+")")}})),Object(r.a)(A,k,Object(r.b)(i,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new A(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new A(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new O(T(t>=240?t-240:t+120,i,r),T(t,i,r),T(t<120?t+240:t-120,i,r),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}}))},function(t,e,n){"use strict";e.b=function(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n},e.a=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t}},function(t,e,n){"use strict";function r(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}e.a=r,e.b=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],c=i>0?t[i-1]:2*a-o,u=i=0&&e._call.call(null,t),e=e._next;--a}()}finally{a=0,function(){for(var t,e,n=r,a=1/0;n;)n._call?(a>n._time&&(a=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:r=e);i=t,m(a)}(),s=0}}function g(){var t=d.now(),e=t-f;e>u&&(l-=e,f=t)}function m(t){a||(o&&(o=clearTimeout(o)),t-s>24?(t<1/0&&(o=setTimeout(_,t-d.now()-l)),c&&(c=clearInterval(c))):(c||(f=d.now(),c=setInterval(g,u)),a=1,h(_)))}v.prototype=y.prototype={constructor:v,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?b():+n)+(null==e?0:+e),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=n,m()},stop:function(){this._call&&(this._call=null,this._time=1/0,m())}}},function(t,e,n){var r=n(51),i=n(64),a=n(90),o=n(181),c=n(404),u=n(134),f=n(30),s=n(405),l=n(406),d=n(147),h=n(407),b=n(41),p=n(408),v=n(409),y=n(137),_=n(2),g=n(59),m=n(413),x=n(7),w=n(415),j=n(18),O=1,M=2,k=4,A="[object Arguments]",T="[object Function]",S="[object GeneratorFunction]",P="[object Object]",R={};R[A]=R["[object Array]"]=R["[object ArrayBuffer]"]=R["[object DataView]"]=R["[object Boolean]"]=R["[object Date]"]=R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Map]"]=R["[object Number]"]=R[P]=R["[object RegExp]"]=R["[object Set]"]=R["[object String]"]=R["[object Symbol]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R["[object Error]"]=R[T]=R["[object WeakMap]"]=!1,t.exports=function t(e,n,E,C,I,N){var D,z=n&O,B=n&M,U=n&k;if(E&&(D=I?E(e,C,I,N):E(e)),void 0!==D)return D;if(!x(e))return e;var L=_(e);if(L){if(D=p(e),!z)return f(e,D)}else{var W=b(e),F=W==T||W==S;if(g(e))return u(e,z);if(W==P||W==A||F&&!I){if(D=B||F?{}:y(e),!z)return B?l(e,c(D,e)):s(e,o(D,e))}else{if(!R[W])return I?e:{};D=v(e,W,z)}}N||(N=new r);var Y=N.get(e);if(Y)return Y;if(N.set(e,D),w(e))return e.forEach((function(r){D.add(t(r,n,E,r,e,N))})),D;if(m(e))return e.forEach((function(r,i){D.set(i,t(r,n,E,i,e,N))})),D;var q=U?B?h:d:B?keysIn:j,G=L?void 0:q(e);return i(G||e,(function(r,i){G&&(r=e[i=r]),a(D,i,t(r,n,E,i,e,N))})),D}},function(t,e,n){var r=n(417),i=n(39),a=n(33),o=n(418),c=n(2);t.exports=function(t,e,n){var u=c(t)?r:o,f=arguments.length<3;return u(t,a(e,4),n,f,i)}},function(t,e,n){var r=n(107),i=n(422),a=n(78),o=n(63),c=a((function(t,e){if(null==t)return[];var n=e.length;return n>1&&o(t,e[0],e[1])?e=[]:n>2&&o(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=c},function(t,e,n){var r=n(65),i=n(421);t.exports=function t(e,n,a,o,c){var u=-1,f=e.length;for(a||(a=i),c||(c=[]);++u0&&a(s)?n>1?t(s,n-1,a,o,c):r(c,s):o||(c[c.length]=s)}return c}},function(t,e,n){"use strict";var r=n(35),i=n(25),a=n(71),o=n(109);e.a=function(){var t=o.a,e=o.b,n=Object(i.a)(!0),c=null,u=a.a,f=null;function s(i){var a,o,s,l=i.length,d=!1;for(null==c&&(f=u(s=Object(r.a)())),a=0;a<=l;++a)!(ar.f){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,f=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/f,a=(a*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/f}if(t._l23_a>r.f){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/l,c=(c*s+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(i,a,o,c,t._x2,t._y2)}function o(t,e){this._context=t,this._alpha=e}o.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 n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:a(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}},e.a=function t(e){function n(t){return e?new o(t,e):new i.a(t,0)}return n.alpha=function(e){return t(+e)},n}(.5)},function(t,e,n){"use strict";e.b=i;var r=n(46);function i(t){for(var e,n=0,r=-1,i=t.length;++r=1)return+n(t[i-1],i-1,t);var i,a=(i-1)*e,o=Math.floor(a),c=+n(t[o],o,t);return c+(+n(t[o+1],o+1,t)-c)*(a-o)}}},function(t,e,n){var r=n(211),i=n(480),a=n(481),o=n(213),c=n(495),u=n(116),f=n(496),s=n(219),l=n(220),d=n(119),h="Expected a function",b=1,p=2,v=8,y=16,_=32,g=64,m=Math.max;t.exports=function(t,e,n,x,w,j,O,M){var k=e&p;if(!k&&"function"!=typeof t)throw new TypeError(h);var A=x?x.length:0;if(A||(e&=~(_|g),x=w=void 0),O=void 0===O?O:m(d(O),0),M=void 0===M?M:d(M),A-=w?w.length:0,e&g){var T=x,S=w;x=w=void 0}var P=k?void 0:u(t),R=[t,e,n,x,w,T,S,j,O,M];if(P&&f(R,P),t=R[0],e=R[1],n=R[2],x=R[3],w=R[4],!(M=R[9]=void 0===R[9]?k?0:t.length:m(R[9]-A,0))&&e&(v|y)&&(e&=~(v|y)),e&&e!=b)E=e==v||e==y?a(t,e,M):e!=_&&e!=(b|_)||w.length?o.apply(void 0,R):c(t,e,n,x);else var E=i(t,e,n);return l((P?r:s)(E,R),t,e)}},function(t,e,n){var r=n(56),i=n(115),a=4294967295;function o(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=a,this.__views__=[]}o.prototype=r(i.prototype),o.prototype.constructor=o,t.exports=o},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(212),i=n(483),a=r?function(t){return r.get(t)}:i;t.exports=a},function(t,e,n){var r=n(56),i=n(115);function a(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}a.prototype=r(i.prototype),a.prototype.constructor=a,t.exports=a},function(t,e){var n="__lodash_placeholder__";t.exports=function(t,e){for(var r=-1,i=t.length,a=0,o=[];++r1?r[0]+r.slice(2):r,+t.slice(n+1)]}},function(t,e,n){"use strict";n(4);var r=n(542);n.d(e,"c",(function(){return r.a})),n.d(e,"n",(function(){return r.a}));var i=n(543);n.d(e,"g",(function(){return i.a})),n.d(e,"r",(function(){return i.a}));var a=n(544);n.d(e,"d",(function(){return a.a}));var o=n(545);n.d(e,"b",(function(){return o.a}));var c=n(546);n.d(e,"a",(function(){return c.a}));var u=n(547);n.d(e,"j",(function(){return u.b})),n.d(e,"h",(function(){return u.b})),n.d(e,"e",(function(){return u.a})),n.d(e,"i",(function(){return u.c}));var f=n(548);n.d(e,"f",(function(){return f.a}));var s=n(549);n.d(e,"k",(function(){return s.a}));var l=n(550);n.d(e,"o",(function(){return l.a}));var d=n(551);n.d(e,"m",(function(){return d.a}));var h=n(552);n.d(e,"l",(function(){return h.a}));var b=n(553);n.d(e,"u",(function(){return b.b})),n.d(e,"s",(function(){return b.b})),n.d(e,"p",(function(){return b.a})),n.d(e,"t",(function(){return b.c}));var p=n(554);n.d(e,"q",(function(){return p.a}));var v=n(555);n.d(e,"v",(function(){return v.a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o}));var r,i,a,o,c,u=n(237);c={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"]},r=Object(u.a)(c),i=r.format,r.parse,a=r.utcFormat,o=r.utcParse},function(t,e,n){var r=n(50),i=n(78),a=n(249),o=n(282),c=i((function(t){return t.push(void 0,a),r(o,void 0,t)}));t.exports=c},function(t,e,n){var r=n(50),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var a=arguments,o=-1,c=i(a.length-e,0),u=Array(c);++o0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(51),i=n(132),a=n(133),o=n(273),c=n(7),u=n(61),f=n(140);t.exports=function t(e,n,s,l,d){e!==n&&a(n,(function(a,u){if(c(a))d||(d=new r),o(e,n,u,s,t,l,d);else{var h=l?l(f(e,u),a,u+"",e,n,d):void 0;void 0===h&&(h=a),i(e,u,h)}}),u)}},function(t,e,n){var r=n(83),i=n(38);t.exports=function(t,e,n){(void 0===n||i(t[e],n))&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(272)();t.exports=r},function(t,e,n){(function(t){var r=n(5),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i?r.Buffer:void 0,c=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=c?c(n):new t.constructor(n);return t.copy(r),r}}).call(e,n(84)(t))},function(t,e,n){var r=n(85);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(5).Uint8Array;t.exports=r},function(t,e,n){var r=n(56),i=n(86),a=n(57);t.exports=function(t){return"function"!=typeof t.constructor||a(t)?{}:r(i(t))}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(16),i=n(86),a=n(6),o="[object Object]",c=Function.prototype,u=Object.prototype,f=c.toString,s=u.hasOwnProperty,l=f.call(Object);t.exports=function(t){if(!a(t)||r(t)!=o)return!1;var e=i(t);if(null===e)return!0;var n=s.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&f.call(n)==l}},function(t,e){t.exports=function(t,e){if("__proto__"!=e)return t[e]}},function(t,e,n){var r=n(279),i=n(58),a=n(2),o=n(59),c=n(62),u=n(88),f=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=a(t),s=!n&&i(t),l=!n&&!s&&o(t),d=!n&&!s&&!l&&u(t),h=n||s||l||d,b=h?r(t.length,String):[],p=b.length;for(var v in t)!e&&!f.call(t,v)||h&&("length"==v||l&&("offset"==v||"parent"==v)||d&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||c(v,p))||b.push(v);return b}},function(t,e,n){var r=n(78),i=n(63);t.exports=function(t){return r((function(e,n){var r=-1,a=n.length,o=a>1?n[a-1]:void 0,c=a>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(a--,o):void 0,c&&i(n[0],n[1],c)&&(o=a<3?void 0:o,a=1),e=Object(e);++rd))return!1;var b=s.get(t);if(b&&s.get(e))return b==e;var p=-1,v=!0,y=n&c?new r:void 0;for(s.set(t,e),s.set(e,t);++p1?this.each((null==e?i:"function"==typeof e?o:a)(t,e,null==n?"":n)):c(this.node(),t)}},function(t,e,n){"use strict";e.b=function(t,e){var n=t.document.documentElement,a=Object(r.select)(t).on("dragstart.drag",null);e&&(a.on("click.drag",i.a,!0),setTimeout((function(){a.on("click.drag",null)}),0)),"onselectstart"in n?a.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)};var r=n(3),i=n(166);e.a=function(t){var e=t.document.documentElement,n=Object(r.select)(t).on("dragstart.drag",i.a,!0);"onselectstart"in e?n.on("selectstart.drag",i.a,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}},function(t,e,n){"use strict";e.b=function(){r.event.stopImmediatePropagation()};var r=n(3);e.a=function(){r.event.preventDefault(),r.event.stopImmediatePropagation()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=Math.PI/180,i=180/Math.PI},function(t,e,n){"use strict";n.d(e,"b",(function(){return u}));var r=n(9),i=n(102),a=n(169),o=n(43);function c(t){return function(e){var n,i,a=e.length,o=new Array(a),c=new Array(a),u=new Array(a);for(n=0;nu&&(c=e.slice(u,c),s[f]?s[f]+=c:s[++f]=c),(n=n[0])===(o=o[0])?s[f]?s[f]+=o:s[++f]=o:(s[++f]=null,l.push({i:f,x:Object(r.a)(n,o)})),u=a.lastIndex;return ur.d&&n.state=o;--c)d.point(y[c],_[c]);d.lineEnd(),d.areaEnd()}v&&(y[a]=+t(h,a,i),_[a]=+n(h,a,i),d.point(e?+e(h,a,i):y[a],u?+u(h,a,i):_[a]))}if(b)return d=null,b+""||null}function b(){return Object(o.a)().defined(f).curve(l).context(s)}return h.x=function(n){return arguments.length?(t="function"==typeof n?n:Object(i.a)(+n),e=null,h):t},h.x0=function(e){return arguments.length?(t="function"==typeof e?e:Object(i.a)(+e),h):t},h.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Object(i.a)(+t),h):e},h.y=function(t){return arguments.length?(n="function"==typeof t?t:Object(i.a)(+t),u=null,h):n},h.y0=function(t){return arguments.length?(n="function"==typeof t?t:Object(i.a)(+t),h):n},h.y1=function(t){return arguments.length?(u=null==t?null:"function"==typeof t?t:Object(i.a)(+t),h):u},h.lineX0=h.lineY0=function(){return b().x(t).y(n)},h.lineY1=function(){return b().x(t).y(u)},h.lineX1=function(){return b().x(e).y(n)},h.defined=function(t){return arguments.length?(f="function"==typeof t?t:Object(i.a)(!!t),h):f},h.curve=function(t){return arguments.length?(l=t,null!=s&&(d=l(s)),h):l},h.context=function(t){return arguments.length?(null==t?s=d=null:d=l(s=t),h):s},h}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),e.b=a;var r=a(n(71).a);function i(t){this._curve=t}function a(t){function e(e){return new i(t(e))}return e._curve=t,e}i.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))}}},function(t,e,n){"use strict";e.b=a;var r=n(184),i=n(108);function a(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(Object(r.b)(t)):e()._curve},t}e.a=function(){return a(Object(i.a)().curve(r.a))}},function(t,e,n){"use strict";e.a=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=Array.prototype.slice},function(t,e,n){"use strict";var r=n(44);e.a={draw:function(t,e){var n=Math.sqrt(e/r.j);t.moveTo(n,0),t.arc(0,0,n,0,r.m)}}},function(t,e,n){"use strict";e.a={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}}},function(t,e,n){"use strict";var r=Math.sqrt(1/3),i=2*r;e.a={draw:function(t,e){var n=Math.sqrt(e/i),a=n*r;t.moveTo(0,-n),t.lineTo(a,0),t.lineTo(0,n),t.lineTo(-a,0),t.closePath()}}},function(t,e,n){"use strict";var r=n(44),i=Math.sin(r.j/10)/Math.sin(7*r.j/10),a=Math.sin(r.m/10)*i,o=-Math.cos(r.m/10)*i;e.a={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),i=a*n,c=o*n;t.moveTo(0,-n),t.lineTo(i,c);for(var u=1;u<5;++u){var f=r.m*u/5,s=Math.cos(f),l=Math.sin(f);t.lineTo(l*n,-s*n),t.lineTo(s*i-l*c,l*i+s*c)}t.closePath()}}},function(t,e,n){"use strict";e.a={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}}},function(t,e,n){"use strict";var r=Math.sqrt(3);e.a={draw:function(t,e){var n=-Math.sqrt(e/(3*r));t.moveTo(0,2*n),t.lineTo(-r*n,-n),t.lineTo(r*n,-n),t.closePath()}}},function(t,e,n){"use strict";var r=-.5,i=Math.sqrt(3)/2,a=1/Math.sqrt(12),o=3*(a/2+1);e.a={draw:function(t,e){var n=Math.sqrt(e/o),c=n/2,u=n*a,f=c,s=n*a+n,l=-f,d=s;t.moveTo(c,u),t.lineTo(f,s),t.lineTo(l,d),t.lineTo(r*c-i*u,i*c+r*u),t.lineTo(r*f-i*s,i*f+r*s),t.lineTo(r*l-i*d,i*l+r*d),t.lineTo(r*c+i*u,r*u-i*c),t.lineTo(r*f+i*s,r*s-i*f),t.lineTo(r*l+i*d,r*d-i*l),t.closePath()}}},function(t,e,n){"use strict";e.a=a;var r=n(72),i=n(74);function a(t,e){this._context=t,this._k=(1-e)/6}a.prototype={areaStart:r.a,areaEnd:r.a,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:Object(i.c)(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}},e.b=function t(e){function n(t){return new a(t,e)}return n.tension=function(e){return t(+e)},n}(0)},function(t,e,n){"use strict";e.a=i;var r=n(74);function i(t,e){this._context=t,this._k=(1-e)/6}i.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:Object(r.c)(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}},e.b=function t(e){function n(t){return new i(t,e)}return n.tension=function(e){return t(+e)},n}(0)},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return c}));var r=n(36),i=n(198),a=Object(i.a)(r.a),o=a.right,c=a.left;e.c=o},function(t,e,n){"use strict";var r=n(36);e.a=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return Object(r.a)(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}},function(t,e,n){"use strict";function r(t,e){return[t,e]}e.b=r,e.a=function(t,e){null==e&&(e=r);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n1)return f/(o-1)}},function(t,e,n){"use strict";e.a=function(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o=n)for(r=i=n;++on&&(r=n),i=n)for(r=i=n;++on&&(r=n),i=r?c*=10:u>=i?c*=5:u>=a&&(c*=2),e=0?(u>=r?10:u>=i?5:u>=a?2:1)*Math.pow(10,c):-Math.pow(10,-c)/(u>=r?10:u>=i?5:u>=a?2:1)}e.a=function(t,e,n){var r,i,a,c,u=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((r=e0)for(t=Math.ceil(t/c),e=Math.floor(e/c),a=new Array(i=Math.ceil(e-t+1));++u=n)for(r=n;++an&&(r=n)}else for(;++a=n)for(r=n;++an&&(r=n);return r}},function(t,e,n){"use strict";var r=n(207);function i(t){return t.length}e.a=function(t){if(!(o=t.length))return[];for(var e=-1,n=Object(r.a)(t,i),a=new Array(n);++e3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Math.E;return r&&t*e<=0&&console.warn("As log(0) = -∞, a log scale domain must be\n strictly-positive or strictly-negative. logscale ignored"),(r&&t*e>0?(0,f.scaleLog)().base(i):(0,f.scaleLinear)()).domain([t,e]).range([0,n]).clamp(!0)};var r=s(n(475)),i=s(n(506)),a=s(n(509)),o=s(n(511)),c=s(n(514)),u=s(n(518)),f=n(225);function s(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){var r=n(28),i=n(212),a=i?function(t,e){return i.set(t,e),t}:r;t.exports=a},function(t,e,n){var r=n(151),i=r&&new r;t.exports=i},function(t,e,n){var r=n(214),i=n(215),a=n(482),o=n(75),c=n(216),u=n(222),f=n(494),s=n(118),l=n(5),d=1,h=2,b=8,p=16,v=128,y=512;t.exports=function t(e,n,_,g,m,x,w,j,O,M){var k=n&v,A=n&d,T=n&h,S=n&(b|p),P=n&y,R=T?void 0:o(e);return function d(){for(var h=arguments.length,b=Array(h),p=h;p--;)b[p]=arguments[p];if(S)var v=u(d),y=a(b,v);if(g&&(b=r(b,g,m,S)),x&&(b=i(b,x,w,S)),h-=y,S&&h1&&b.reverse(),k&&O(c=t.charCodeAt(n))||c>57){h=(46===c?l+t.slice(n+1):t.slice(n))+h,t=t.slice(0,n);break}}v&&!b&&(t=e(t,1/0));var O=f.length+t.length+h.length,M=O>1)+f+t+h+M.slice(O);break;default:t=M+f+t+h}return d(t)}return y=null==y?_?6:12:/[gprs]/.test(_)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),j.toString=function(){return t+""},j}return{format:b,formatPrefix:function(t,e){var n=b(((t=Object(o.a)(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3))),a=Math.pow(10,-i),c=s[8+i/3];return function(t){return n(a*t)+c}}}}},function(t,e,n){"use strict";e.a=a;var r=n(232),i=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function a(t){return new o(t)}function o(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e,n=e[1]||" ",a=e[2]||">",o=e[3]||"-",c=e[4]||"",u=!!e[5],f=e[6]&&+e[6],s=!!e[7],l=e[8]&&+e[8].slice(1),d=e[9]||"";"n"===d?(s=!0,d="g"):r.a[d]||(d=""),(u||"0"===n&&"="===a)&&(u=!0,n="0",a="="),this.fill=n,this.align=a,this.sign=o,this.symbol=c,this.zero=u,this.width=f,this.comma=s,this.precision=l,this.type=d}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type}},function(t,e,n){"use strict";var r=n(531),i=n(233),a=n(532);e.a={"":r.a,"%":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.round(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 Object(a.a)(100*t,e)},r:a.a,s:i.a,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r}));var r,i=n(122);e.a=function(t,e){var n=Object(i.a)(t,e);if(!n)return t+"";var a=n[0],o=n[1],c=o-(r=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,u=a.length;return c===u?a:c>u?a+new Array(c-u+1).join("0"):c>0?a.slice(0,c)+"."+a.slice(c):"0."+new Array(1-c).join("0")+Object(i.a)(t,Math.max(0,e+c-1))[0]}},function(t,e,n){"use strict";e.a=function(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],o=t[i];return o=12)]},Q:pt,s:vt,S:F,u:Y,U:q,V:G,w:V,W:X,x:null,X:null,y:H,Y:$,Z:Z,"%":bt},St={a:function(t){return l[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return d[t.getUTCMonth()]},c:null,d:K,e:K,f:nt,H:J,I:Q,j:tt,L:et,m:rt,M:it,p:function(t){return f[+(t.getUTCHours()>=12)]},Q:pt,s:vt,S:at,u:ot,U:ct,V:ut,w:ft,W:st,x:null,X:null,y:lt,Y:dt,Z:ht,"%":bt},Pt={a:function(t,e,n){var r=wt.exec(e.slice(n));return r?(t.w=jt[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=mt.exec(e.slice(n));return r?(t.w=xt[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=kt.exec(e.slice(n));return r?(t.m=At[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=Ot.exec(e.slice(n));return r?(t.m=Mt[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return Ct(t,e,n,r)},d:O,e:O,f:P,H:k,I:k,j:M,L:S,m:j,M:A,p:function(t,e,n){var r=_t.exec(e.slice(n));return r?(t.p=gt[r[0].toLowerCase()],n+r[0].length):-1},Q:E,s:C,S:T,u:v,U:y,V:_,w:p,W:g,x:function(t,e,r){return Ct(t,n,e,r)},X:function(t,e,n){return Ct(t,u,e,n)},y:x,Y:m,Z:w,"%":R};function Rt(t,e){return function(n){var r,i,a,o=[],u=-1,f=0,s=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in u||(u.w=1),"Z"in u?(c=(i=a(o(u.y))).getUTCDay(),i=c>4||0===c?r.p.ceil(i):Object(r.p)(i),i=r.l.offset(i,7*(u.V-1)),u.y=i.getUTCFullYear(),u.m=i.getUTCMonth(),u.d=i.getUTCDate()+(u.w+6)%7):(c=(i=e(o(u.y))).getDay(),i=c>4||0===c?r.e.ceil(i):Object(r.e)(i),i=r.a.offset(i,7*(u.V-1)),u.y=i.getFullYear(),u.m=i.getMonth(),u.d=i.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),c="Z"in u?a(o(u.y)).getUTCDay():e(o(u.y)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(c+5)%7:u.w+7*u.U-(c+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,a(u)):e(u)}}function Ct(t,e,n,r){for(var i,a,o=0,u=e.length,f=n.length;o=f)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Pt[i in c?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return(Tt.x=Rt(n,Tt),Tt.X=Rt(u,Tt),Tt.c=Rt(e,Tt),St.x=Rt(n,St),St.X=Rt(u,St),St.c=Rt(e,St),{format:function(t){var e=Rt(t+="",Tt);return e.toString=function(){return t},e},parse:function(t){var e=Et(t+="",i);return e.toString=function(){return t},e},utcFormat:function(t){var e=Rt(t+="",St);return e.toString=function(){return t},e},utcParse:function(t){var e=Et(t,a);return e.toString=function(){return t},e}})};var r=n(123);function i(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 a(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 o(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}var c={"-":"",_:" ",0:"0"},u=/^\s*\d+/,f=/^%/,s=/[\\^$*+?|[\]().{}]/g;function l(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function w(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function j(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function O(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function M(t,e,n){var r=u.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function k(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function A(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function T(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function S(t,e,n){var r=u.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function P(t,e,n){var r=u.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function R(t,e,n){var r=f.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function E(t,e,n){var r=u.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function C(t,e,n){var r=u.exec(e.slice(n));return r?(t.Q=1e3*+r[0],n+r[0].length):-1}function I(t,e){return l(t.getDate(),e,2)}function N(t,e){return l(t.getHours(),e,2)}function D(t,e){return l(t.getHours()%12||12,e,2)}function z(t,e){return l(1+r.a.count(Object(r.k)(t),t),e,3)}function B(t,e){return l(t.getMilliseconds(),e,3)}function U(t,e){return B(t,e)+"000"}function L(t,e){return l(t.getMonth()+1,e,2)}function W(t,e){return l(t.getMinutes(),e,2)}function F(t,e){return l(t.getSeconds(),e,2)}function Y(t){var e=t.getDay();return 0===e?7:e}function q(t,e){return l(r.h.count(Object(r.k)(t),t),e,2)}function G(t,e){var n=t.getDay();return t=n>=4||0===n?Object(r.i)(t):r.i.ceil(t),l(r.i.count(Object(r.k)(t),t)+(4===Object(r.k)(t).getDay()),e,2)}function V(t){return t.getDay()}function X(t,e){return l(r.e.count(Object(r.k)(t),t),e,2)}function H(t,e){return l(t.getFullYear()%100,e,2)}function $(t,e){return l(t.getFullYear()%1e4,e,4)}function Z(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+l(e/60|0,"0",2)+l(e%60,"0",2)}function K(t,e){return l(t.getUTCDate(),e,2)}function J(t,e){return l(t.getUTCHours(),e,2)}function Q(t,e){return l(t.getUTCHours()%12||12,e,2)}function tt(t,e){return l(1+r.l.count(Object(r.v)(t),t),e,3)}function et(t,e){return l(t.getUTCMilliseconds(),e,3)}function nt(t,e){return et(t,e)+"000"}function rt(t,e){return l(t.getUTCMonth()+1,e,2)}function it(t,e){return l(t.getUTCMinutes(),e,2)}function at(t,e){return l(t.getUTCSeconds(),e,2)}function ot(t){var e=t.getUTCDay();return 0===e?7:e}function ct(t,e){return l(r.s.count(Object(r.v)(t),t),e,2)}function ut(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Object(r.t)(t):r.t.ceil(t),l(r.t.count(Object(r.v)(t),t)+(4===Object(r.v)(t).getUTCDay()),e,2)}function ft(t){return t.getUTCDay()}function st(t,e){return l(r.p.count(Object(r.v)(t),t),e,2)}function lt(t,e){return l(t.getUTCFullYear()%100,e,2)}function dt(t,e){return l(t.getUTCFullYear()%1e4,e,4)}function ht(){return"+0000"}function bt(){return"%"}function pt(t){return+t}function vt(t){return Math.floor(+t/1e3)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(124),i="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||Object(r.b)(i)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return c})),n.d(e,"c",(function(){return u}));var r=Math.cos,i=Math.sin,a=Math.PI,o=a/2,c=2*a,u=Math.max},function(t,e,n){"use strict";var r=function(){function t(t,e){for(var n=0;n-1}},function(t,e,n){var r=n(53);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(52);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(52),i=n(81),a=n(82),o=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var c=n.__data__;if(!i||c.length=O&&(O=j+1);!(w=m[O])&&++O<_;);x._next=w||null}}return(s=new r.a(s,i))._enter=l,s._exit=d,s}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";var r=n(163),i=n(11);e.a=function(){return new i.a(this._exit||this._groups.map(r.a),this._parents)}},function(t,e,n){"use strict";var r=n(11);e.a=function(t){for(var e=this._groups,n=t._groups,i=e.length,a=n.length,o=Math.min(i,a),c=new Array(i),u=0;u=0;)(r=i[a])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this}},function(t,e,n){"use strict";var r=n(11);function i(t,e){return te?1:t>=e?0:NaN}e.a=function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=i);for(var n=this._groups,a=n.length,o=new Array(a),c=0;c1?this.each((null==e?r:"function"==typeof e?a:i)(t,e)):this.node()[t]}},function(t,e,n){"use strict";function r(t){return t.trim().split(/^|\s+/)}function i(t){return t.classList||new a(t)}function a(t){this._node=t,this._names=r(t.getAttribute("class")||"")}function o(t,e){for(var n=i(t),r=-1,a=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}},e.a=function(t,e){var n=r(t+"");if(arguments.length<2){for(var a=i(this.node()),o=-1,c=n.length;++or?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}e.a=function(){var t,e,n=d,_=h,g=y,m=p,x=v,w=[0,1/0],j=[[-1/0,-1/0],[1/0,1/0]],O=250,M=a.j,k=[],A=Object(r.dispatch)("start","zoom","end"),T=500,S=150,P=0;function R(t){t.property("__zoom",b).on("wheel.zoom",B).on("mousedown.zoom",U).on("dblclick.zoom",L).filter(x).on("touchstart.zoom",W).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function E(t,e){return(e=Math.max(w[0],Math.min(w[1],e)))===t.k?t:new s.a(e,t.x,t.y)}function C(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new s.a(t.k,r,i)}function I(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function N(t,e,n){t.on("start.zoom",(function(){D(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){D(this,arguments).end()})).tween("zoom",(function(){var t=this,r=arguments,i=D(t,r),a=_.apply(t,r),o=n||I(a),c=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=t.__zoom,f="function"==typeof e?e.apply(t,r):e,l=M(u.invert(o).concat(c/u.k),f.invert(o).concat(c/f.k));return function(t){if(1===t)t=f;else{var e=l(t),n=c/e[2];t=new s.a(n,o[0]-e[0]*n,o[1]-e[1]*n)}i.zoom(null,t)}}))}function D(t,e){for(var n,r=0,i=k.length;rP}t.zoom("mouse",g(C(t.that.__zoom,t.mouse[0]=Object(o.mouse)(t.that),t.mouse[1]),t.extent,j))}),!0).on("mouseup.zoom",(function(){r.on("mousemove.zoom mouseup.zoom",null),Object(i.b)(o.event.view,t.moved),Object(l.a)(),t.end()}),!0),a=Object(o.mouse)(this),u=o.event.clientX,f=o.event.clientY;Object(i.a)(o.event.view),Object(l.b)(),t.mouse=[a,this.__zoom.invert(a)],Object(c.interrupt)(this),t.start()}}function L(){if(n.apply(this,arguments)){var t=this.__zoom,e=Object(o.mouse)(this),r=t.invert(e),i=t.k*(o.event.shiftKey?.5:2),a=g(C(E(t,i),e,r),_.apply(this,arguments),j);Object(l.a)(),O>0?Object(o.select)(this).transition().duration(O).call(N,a,e):Object(o.select)(this).call(R.transform,a)}}function W(){if(n.apply(this,arguments)){var e,r,i,a,u=D(this,arguments),f=o.event.changedTouches,s=f.length;for(Object(l.b)(),r=0;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function c(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),a=0;ad?Math.pow(t,1/3):t/l+f}function y(t){return t>s?t*t*t:l*(t-f)}function _(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function g(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function m(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof x)return new x(t.h,t.c,t.l,t.opacity);t instanceof p||(t=h(t));var e=Math.atan2(t.b,t.a)*a.b;return new x(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new x(t,e,n,null==r?1:r)}function x(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}Object(r.a)(p,b,Object(r.b)(i.a,{brighter:function(t){return new p(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new p(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return t=c*y(t),e=o*y(e),n=u*y(n),new i.b(_(3.2404542*e-1.5371385*t-.4985314*n),_(-.969266*e+1.8760108*t+.041556*n),_(.0556434*e-.2040259*t+1.0572252*n),this.opacity)}})),Object(r.a)(x,m,Object(r.b)(i.a,{brighter:function(t){return new x(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new x(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return h(this).rgb()}}))},function(t,e,n){"use strict";e.a=b;var r=n(101),i=n(100),a=n(167),o=-.14861,c=1.78277,u=-.29227,f=-.90649,s=1.97294,l=s*f,d=s*c,h=c*u-f*o;function b(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof p)return new p(t.h,t.s,t.l,t.opacity);t instanceof i.b||(t=Object(i.h)(t));var e=t.r/255,n=t.g/255,r=t.b/255,o=(h*r+l*e-d*n)/(h+l-d),c=r-o,b=(s*(n-o)-u*c)/f,v=Math.sqrt(b*b+c*c)/(s*o*(1-o)),y=v?Math.atan2(b,c)*a.b-120:NaN;return new p(y<0?y+360:y,v,o,t.opacity)}(t):new p(t,e,n,null==r?1:r)}function p(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Object(r.a)(p,b,Object(r.b)(i.a,{brighter:function(t){return t=null==t?i.c:Math.pow(i.c,t),new p(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?i.d:Math.pow(i.d,t),new p(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*a.a,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),l=Math.sin(t);return new i.b(255*(e+n*(o*r+c*l)),255*(e+n*(u*r+f*l)),255*(e+n*(s*r)),this.opacity)}}))},function(t,e,n){"use strict";e.a=function(t,e){return e-=t=+t,function(n){return Math.round(t+e*n)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return c}));var r=n(69),i=n(359);function a(t,e,n,i){function a(t){return t.length?t.pop()+" ":""}return function(o,c){var u=[],f=[];return o=t(o),c=t(c),function(t,i,a,o,c,u){if(t!==a||i!==o){var f=c.push("translate(",null,e,null,n);u.push({i:f-4,x:Object(r.a)(t,a)},{i:f-2,x:Object(r.a)(i,o)})}else(a||o)&&c.push("translate("+a+e+o+n)}(o.translateX,o.translateY,c.translateX,c.translateY,u,f),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(a(n)+"rotate(",null,i)-2,x:Object(r.a)(t,e)})):e&&n.push(a(n)+"rotate("+e+i)}(o.rotate,c.rotate,u,f),function(t,e,n,o){t!==e?o.push({i:n.push(a(n)+"skewX(",null,i)-2,x:Object(r.a)(t,e)}):e&&n.push(a(n)+"skewX("+e+i)}(o.skewX,c.skewX,u,f),function(t,e,n,i,o,c){if(t!==n||e!==i){var u=o.push(a(o)+"scale(",null,",",null,")");c.push({i:u-4,x:Object(r.a)(t,n)},{i:u-2,x:Object(r.a)(e,i)})}else 1===n&&1===i||o.push(a(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,c.scaleX,c.scaleY,u,f),o=c=null,function(t){for(var e,n=-1,r=f.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?r.g:r.h;return function(){var r=o(this,t),c=r.on;c!==i&&(a=(i=c).copy()).on(e,n),r.on=a}}e.a=function(t,e){var n=this._id;return arguments.length<2?Object(r.f)(this.node(),n).on.on(t):this.each(i(n,t,e))}},function(t,e,n){"use strict";e.a=function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t}},function(t,e,n){"use strict";var r=n(3),i=n(19),a=n(12);e.a=function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Object(r.selector)(t));for(var o=this._groups,c=o.length,u=new Array(c),f=0;fi.c&&n.name===e)return new r.a([[t]],a,e,+o);return null}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";e.a=function(t,e,n){this.target=t,this.type=e,this.transform=n}},function(t,e,n){"use strict";e.b=function(){r.event.stopImmediatePropagation()};var r=n(3);e.a=function(){r.event.preventDefault(),r.event.stopImmediatePropagation()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],n=arguments[2],o=0===t.length,c=n.svg.attr("width",n.conf.width).attr("height",n.conf.height);e&&(0,r.default)(n.tracks,(function(t,e){c.select("."+e).remove()}));var u=c.select(".all");u.empty()&&(u=c.append("g").attr("class","all").attr("transform","translate(\n "+parseInt(n.conf.width/2)+",\n "+parseInt(n.conf.height/2)+"\n )")),(0,r.default)(n.tracks,(function(e,r){(o||r in t)&&e.render(n,u,r)})),(o||"layout"in t)&&(0,a.default)(u,n);var f=c.selectAll(".all > g").remove(),s=(0,i.default)(f._groups[0],(function(t){return t.getAttribute("z-index")}));return c.select(".all").selectAll("g").data(s).enter().append((function(t){return t})),n};var r=o(n(32)),i=o(n(106)),a=o(n(426));function o(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){var r=n(29),i=n(58),a=n(2),o=r?r.isConcatSpreadable:void 0;t.exports=function(t){return a(t)||i(t)||!!(o&&t&&t[o])}},function(t,e,n){var r=n(40),i=n(33),a=n(158),o=n(423),c=n(60),u=n(424),f=n(28);t.exports=function(t,e,n){var s=-1;e=r(e.length?e:[f],c(i));var l=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++s,value:t}}));return o(l,(function(t,e){return u(t,e,n)}))}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(425);t.exports=function(t,e,n){for(var i=-1,a=t.criteria,o=e.criteria,c=a.length,u=n.length;++i=u?f:f*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(34);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,a=t==t,o=r(t),c=void 0!==e,u=null===e,f=e==e,s=r(e);if(!u&&!s&&!o&&t>e||o&&c&&f&&!u&&!s||i&&c&&f||!n&&f||!a)return 1;if(!i&&!o&&!s&&tMath.PI?"rotate(180)translate(-16)":null})).style("text-anchor",(function(t){return t.angle>Math.PI?"end":null})).style("font-size",t.ticks.labelSize+"px").style("fill",t.ticks.labelColor).text((function(t){return t.label}))}(n,o,e)};var r=n(13),i=n(10),a=n(3)},function(t,e,n){"use strict";var r=n(35),i=n(25),a=n(44);function o(t){return t.innerRadius}function c(t){return t.outerRadius}function u(t){return t.startAngle}function f(t){return t.endAngle}function s(t){return t&&t.padAngle}function l(t,e,n,r,i,o,c){var u=t-n,f=e-r,s=(c?o:-o)/Object(a.l)(u*u+f*f),l=s*f,d=-s*u,h=t+l,b=e+d,p=n+l,v=r+d,y=(h+p)/2,_=(b+v)/2,g=p-h,m=v-b,x=g*g+m*m,w=i-o,j=h*v-p*b,O=(m<0?-1:1)*Object(a.l)(Object(a.h)(0,w*w*x-j*j)),M=(j*m-g*O)/x,k=(-j*g-m*O)/x,A=(j*m+g*O)/x,T=(-j*g+m*O)/x,S=M-y,P=k-_,R=A-y,E=T-_;return S*S+P*P>R*R+E*E&&(M=A,k=T),{cx:M,cy:k,x01:-l,y01:-d,x11:M*(i/w-1),y11:k*(i/w-1)}}e.a=function(){var t=o,e=c,n=Object(i.a)(0),d=null,h=u,b=f,p=s,v=null;function y(){var i,o,c=+t.apply(this,arguments),u=+e.apply(this,arguments),f=h.apply(this,arguments)-a.g,s=b.apply(this,arguments)-a.g,y=Object(a.a)(s-f),_=s>f;if(v||(v=i=Object(r.a)()),ua.f)if(y>a.m-a.f)v.moveTo(u*Object(a.e)(f),u*Object(a.k)(f)),v.arc(0,0,u,f,s,!_),c>a.f&&(v.moveTo(c*Object(a.e)(s),c*Object(a.k)(s)),v.arc(0,0,c,s,f,_));else{var g,m,x=f,w=s,j=f,O=s,M=y,k=y,A=p.apply(this,arguments)/2,T=A>a.f&&(d?+d.apply(this,arguments):Object(a.l)(c*c+u*u)),S=Object(a.i)(Object(a.a)(u-c)/2,+n.apply(this,arguments)),P=S,R=S;if(T>a.f){var E=Object(a.c)(T/c*Object(a.k)(A)),C=Object(a.c)(T/u*Object(a.k)(A));(M-=2*E)>a.f?(j+=E*=_?1:-1,O-=E):(M=0,j=O=(f+s)/2),(k-=2*C)>a.f?(x+=C*=_?1:-1,w-=C):(k=0,x=w=(f+s)/2)}var I=u*Object(a.e)(x),N=u*Object(a.k)(x),D=c*Object(a.e)(O),z=c*Object(a.k)(O);if(S>a.f){var B=u*Object(a.e)(w),U=u*Object(a.k)(w),L=c*Object(a.e)(j),W=c*Object(a.k)(j);if(ya.f?function(t,e,n,r,i,a,o,c){var u=n-t,f=r-e,s=o-i,l=c-a,d=(s*(e-a)-l*(t-i))/(l*u-s*f);return[t+d*u,e+d*f]}(I,N,L,W,B,U,D,z):[D,z],Y=I-F[0],q=N-F[1],G=B-F[0],V=U-F[1],X=1/Object(a.k)(Object(a.b)((Y*G+q*V)/(Object(a.l)(Y*Y+q*q)*Object(a.l)(G*G+V*V)))/2),H=Object(a.l)(F[0]*F[0]+F[1]*F[1]);P=Object(a.i)(S,(c-H)/(X-1)),R=Object(a.i)(S,(u-H)/(X+1))}}k>a.f?R>a.f?(g=l(L,W,I,N,u,R,_),m=l(B,U,D,z,u,R,_),v.moveTo(g.cx+g.x01,g.cy+g.y01),Ra.f&&M>a.f?P>a.f?(g=l(D,z,B,U,c,-P,_),m=l(I,N,L,W,c,-P,_),v.lineTo(g.cx+g.x01,g.cy+g.y01),P1e-6)if(Math.abs(l*u-f*s)>1e-6&&a){var h=n-o,b=i-c,p=u*u+f*f,v=h*h+b*b,y=Math.sqrt(p),_=Math.sqrt(d),g=a*Math.tan((r-Math.acos((p+d-v)/(2*y*_)))/2),m=g/_,x=g/y;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*s)+","+(e+m*l)),this._+="A"+a+","+a+",0,0,"+ +(l*h>s*b)+","+(this._x1=t+x*u)+","+(this._y1=e+x*f)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,o,c,u){t=+t,e=+e;var f=(n=+n)*Math.cos(o),s=n*Math.sin(o),l=t+f,d=e+s,h=1^u,b=u?o-c:c-o;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+d:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-d)>1e-6)&&(this._+="L"+l+","+d),n&&(b<0&&(b=b%i+i),b>a?this._+="A"+n+","+n+",0,1,"+h+","+(t-f)+","+(e-s)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=d):b>1e-6&&(this._+="A"+n+","+n+",0,"+ +(b>=r)+","+h+","+(this._x1=t+n*Math.cos(c))+","+(this._y1=e+n*Math.sin(c))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},e.a=c},function(t,e,n){"use strict";var r=n(25),i=n(430),a=n(431),o=n(44);e.a=function(){var t=a.a,e=i.a,n=null,c=Object(r.a)(0),u=Object(r.a)(o.m),f=Object(r.a)(0);function s(r){var i,a,s,l,d,h=r.length,b=0,p=new Array(h),v=new Array(h),y=+c.apply(this,arguments),_=Math.min(o.m,Math.max(-o.m,u.apply(this,arguments)-y)),g=Math.min(Math.abs(_)/h,f.apply(this,arguments)),m=g*(_<0?-1:1);for(i=0;i0&&(b+=d);for(null!=e?p.sort((function(t,n){return e(v[t],v[n])})):null!=n&&p.sort((function(t,e){return n(r[t],r[e])})),i=0,s=b?(_-h*m)/b:0;i0?d*s:0)+m,v[a]={data:r[a],index:i,value:d,startAngle:y,endAngle:l,padAngle:g};return v}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:Object(r.a)(+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?(c="function"==typeof t?t:Object(r.a)(+t),s):c},s.endAngle=function(t){return arguments.length?(u="function"==typeof t?t:Object(r.a)(+t),s):u},s.padAngle=function(t){return arguments.length?(f="function"==typeof t?t:Object(r.a)(+t),s):f},s}},function(t,e,n){"use strict";e.a=function(t,e){return et?1:e>=t?0:NaN}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";var r=n(184),i=n(183),a=n(185);e.a=function(){var t=Object(i.a)().curve(r.a),e=t.curve,n=t.lineX0,o=t.lineX1,c=t.lineY0,u=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 Object(a.b)(n())},delete t.lineX0,t.lineEndAngle=function(){return Object(a.b)(o())},delete t.lineX1,t.lineInnerRadius=function(){return Object(a.b)(c())},delete t.lineY0,t.lineOuterRadius=function(){return Object(a.b)(u())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Object(r.b)(t)):e()._curve},t}},function(t,e,n){"use strict";e.a=function(){return s(l)},e.c=function(){return s(d)},e.b=function(){var t=s(h);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t};var r=n(35),i=n(187),a=n(25),o=n(109),c=n(186);function u(t){return t.source}function f(t){return t.target}function s(t){var e=u,n=f,c=o.a,s=o.b,l=null;function d(){var a,o=i.a.call(arguments),u=e.apply(this,o),f=n.apply(this,o);if(l||(l=a=Object(r.a)()),t(l,+c.apply(this,(o[0]=u,o)),+s.apply(this,o),+c.apply(this,(o[0]=f,o)),+s.apply(this,o)),a)return l=null,a+""||null}return d.source=function(t){return arguments.length?(e=t,d):e},d.target=function(t){return arguments.length?(n=t,d):n},d.x=function(t){return arguments.length?(c="function"==typeof t?t:Object(a.a)(+t),d):c},d.y=function(t){return arguments.length?(s="function"==typeof t?t:Object(a.a)(+t),d):s},d.context=function(t){return arguments.length?(l=null==t?null:t,d):l},d}function l(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function d(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function h(t,e,n,r,i){var a=Object(c.a)(e,n),o=Object(c.a)(e,n=(n+i)/2),u=Object(c.a)(r,n),f=Object(c.a)(r,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],u[0],u[1],f[0],f[1])}},function(t,e,n){"use strict";n.d(e,"b",(function(){return d}));var r=n(35),i=n(188),a=n(189),o=n(190),c=n(191),u=n(192),f=n(193),s=n(194),l=n(25),d=[i.a,a.a,o.a,u.a,c.a,f.a,s.a];e.a=function(){var t=Object(l.a)(i.a),e=Object(l.a)(64),n=null;function a(){var i;if(n||(n=i=Object(r.a)()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(e){return arguments.length?(t="function"==typeof e?e:Object(l.a)(e),a):t},a.size=function(t){return arguments.length?(e="function"==typeof t?t:Object(l.a)(+t),a):e},a.context=function(t){return arguments.length?(n=null==t?null:t,a):n},a}},function(t,e,n){"use strict";var r=n(72),i=n(73);function a(t){this._context=t}a.prototype={areaStart:r.a,areaEnd:r.a,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:Object(i.c)(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},e.a=function(t){return new a(t)}},function(t,e,n){"use strict";var r=n(73);function i(t){this._context=t}i.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 n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Object(r.c)(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},e.a=function(t){return new i(t)}},function(t,e,n){"use strict";var r=n(73);function i(t,e){this._basis=new r.a(t),this._beta=e}i.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],o=t[n]-i,c=e[n]-a,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*o),this._beta*e[u]+(1-this._beta)*(a+r*c));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}},e.a=function t(e){function n(t){return 1===e?new r.a(t):new i(t,e)}return n.beta=function(e){return t(+e)},n}(.85)},function(t,e,n){"use strict";var r=n(195),i=n(72),a=n(110);function o(t,e){this._context=t,this._alpha=e}o.prototype={areaStart:i.a,areaEnd:i.a,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 n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Object(a.b)(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}},e.a=function t(e){function n(t){return e?new o(t,e):new r.a(t,0)}return n.alpha=function(e){return t(+e)},n}(.5)},function(t,e,n){"use strict";var r=n(196),i=n(110);function a(t,e){this._context=t,this._alpha=e}a.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 n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Object(i.b)(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}},e.a=function t(e){function n(t){return e?new a(t,e):new r.a(t,0)}return n.alpha=function(e){return t(+e)},n}(.5)},function(t,e,n){"use strict";var r=n(72);function i(t){this._context=t}i.prototype={areaStart:r.a,areaEnd:r.a,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},e.a=function(t){return new i(t)}},function(t,e,n){"use strict";function r(t){return t<0?-1:1}function i(t,e,n){var i=t._x1-t._x0,a=e-t._x1,o=(t._y1-t._y0)/(i||a<0&&-0),c=(n-t._y1)/(a||i<0&&-0),u=(o*a+c*i)/(i+a);return(r(o)+r(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(u))||0}function a(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function o(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,c=(a-r)/3;t._context.bezierCurveTo(r+c,i+c*e,a-c,o-c*n,a,o)}function c(t){this._context=t}function u(t){this._context=new f(t)}function f(t){this._context=t}e.a=function(t){return new c(t)},e.b=function(t){return new u(t)},c.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:o(this,this._t0,a(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){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,o(this,a(this,n=i(this,t,e)),n);break;default:o(this,this._t0,n=i(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(u.prototype=Object.create(c.prototype)).point=function(t,e){c.prototype.point.call(this,e,t)},f.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}}},function(t,e,n){"use strict";function r(t){this._context=t}function i(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);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[r-1]=(t[r]+i[r-1])/2,e=0;e=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 n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}},e.a=function(t){return new r(t,.5)}},function(t,e,n){"use strict";var r=n(187),i=n(25),a=n(45),o=n(46);function c(t,e){return t[e]}e.a=function(){var t=Object(i.a)([]),e=o.a,n=a.a,u=c;function f(r){var i,a,o=t.apply(this,arguments),c=r.length,f=o.length,s=new Array(f);for(i=0;i0){for(var n,i,a,o=0,c=t[0].length;o1)for(var n,r,i,a,o,c,u=0,f=t[e[0]].length;u=0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=o,r[0]=o+=i):r[0]=a}},function(t,e,n){"use strict";var r=n(45);e.a=function(t,e){if((n=t.length)>0){for(var n,i=0,a=t[e[0]],o=a.length;i0&&(i=(n=t[e[0]]).length)>0){for(var n,i,a,o=0,c=1;ct?1:e>=t?0:NaN}},function(t,e,n){"use strict";var r=n(203),i=n(197),a=n(455),o=n(202),c=n(456),u=n(204),f=n(205),s=n(206);e.a=function(){var t=c.a,e=o.a,n=s.a;function l(r){var a,o,c=r.length,s=new Array(c);for(a=0;ah;)b.pop(),--p;var v,y=new Array(p+1);for(a=0;a<=p;++a)(v=y[a]=[]).x0=a>0?b[a-1]:d,v.x1=a=n)for(r=n;++ar&&(r=n)}else for(;++a=n)for(r=n;++ar&&(r=n);return r}},function(t,e,n){"use strict";var r=n(47);e.a=function(t,e){var n,i=t.length,a=i,o=-1,c=0;if(null==e)for(;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n}},function(t,e,n){"use strict";e.a=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r}},function(t,e,n){"use strict";var r=n(36);e.a=function(t,e){if(n=t.length){var n,i,a=0,o=0,c=t[o];for(null==e&&(e=r.a);++a90?"end":"start",t._rotate=t._angle>90?180:0,t}))})).enter().append("g").append("text").text((function(t){return t.value})).attr("transform",(function(t){return"\n rotate("+t._angle+")\n translate("+e.innerRadius+", 0)\n rotate("+t._rotate+")\n "})).attr("text-anchor",(function(t){return t._anchor}));return(0,o.default)(e.style,(function(t,e){i.style(e,t)})),i}}]),e}(i.default);e.default=l},function(t,e,n){var r=n(470);"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(472)(r,i),r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(471)(!1)).push([t.i,"div.circos-tooltip {\r\n position: absolute;\r\n text-align: center;\r\n padding: 5px 10px;\r\n background: #111111;\r\n color: white;\r\n border: 0px;\r\n pointer-events: none;\r\n z-index: 1000;\r\n}\r\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n,r=t[1]||"",i=t[3];if(!i)return r;if(e&&"function"==typeof btoa){var a=(n=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */"),o=i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}));return[r].concat(o).concat([a]).join("\n")}return[r].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i=0&&l.splice(e,1)}function y(t){var e=document.createElement("style");return void 0===t.attrs.type&&(t.attrs.type="text/css"),_(e,t.attrs),p(t,e),e}function _(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function g(t,e){var n,r,i,a;if(e.transform&&t.css){if(!(a=e.transform(t.css)))return function(){};t.css=a}if(e.singleton){var o=s++;n=f||(f=y(e)),r=w.bind(null,n,o,!1),i=w.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",_(e,t.attrs),p(t,e),e}(e),r=O.bind(null,n,e),i=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=y(e),r=j.bind(null,n),i=function(){v(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=b(t,e);return h(n,e),function(t){for(var r=[],i=0;i0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],r={};return(0,i.default)(n,(function(n,i){void 0!==n.iteratee?n.iteratee?Object.keys(e).indexOf(i)>-1?((0,a.default)(e[i]),r[i]=e[i]):r[i]=function(){return n.value}:r[i]=Object.keys(e).indexOf(i)>-1?e[i]:n.value:r[i]=t(e[i],n)})),r}(t,(0,r.default)(e));return(0,o.default)(f,function(t,e){return{cmin:null===t.min?e.min:t.min,cmax:null===t.max?e.max:t.max}}(f,n),function(t,e){if(0===t.innerRadius&&0===t.outerRadius){var n=(0,c.smartBorders)(t,e._layout,e.tracks);return{innerRadius:n.in,outerRadius:n.out}}return t.innerRadius<=1&&t.outerRadius<=1?{innerRadius:t.innerRadius*e._layout.conf.innerRadius,outerRadius:t.outerRadius*e._layout.conf.innerRadius}:t.innerRadius<=10&&t.outerRadius<=10?{innerRadius:t.innerRadius*e._layout.conf.outerRadius,outerRadius:t.outerRadius*e._layout.conf.outerRadius}:void 0}(f,u)),f}},function(t,e,n){var r=n(37)("sortBy",n(106));r.placeholder=n(26),t.exports=r},function(t,e,n){var r=n(477),i=n(26),a=Array.prototype.push;function o(t,e){return 2==e?function(e,n){return t(e,n)}:function(e){return t(e)}}function c(t){for(var e=t?t.length:0,n=Array(e);e--;)n[e]=t[e];return n}function u(t,e){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var i=r[0]=e.apply(void 0,r);return t.apply(void 0,r),i}}}t.exports=function t(e,n,f,s){var l="function"==typeof n,d=n===Object(n);if(d&&(s=f,f=n,n=void 0),null==f)throw new TypeError;s||(s={});var h={cap:!("cap"in s)||s.cap,curry:!("curry"in s)||s.curry,fixed:!("fixed"in s)||s.fixed,immutable:!("immutable"in s)||s.immutable,rearg:!("rearg"in s)||s.rearg},b=l?f:i,p="curry"in s&&s.curry,v="fixed"in s&&s.fixed,y="rearg"in s&&s.rearg,_=l?f.runInContext():void 0,g=l?f:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},m=g.ary,x=g.assign,w=g.clone,j=g.curry,O=g.forEach,M=g.isArray,k=g.isError,A=g.isFunction,T=g.isWeakMap,S=g.keys,P=g.rearg,R=g.toInteger,E=g.toPath,C=S(r.aryMethod),I={castArray:function(t){return function(){var e=arguments[0];return M(e)?t(c(e)):t.apply(void 0,arguments)}},iteratee:function(t){return function(){var e=arguments[0],n=arguments[1],r=t(e,n),i=r.length;return h.cap&&"number"==typeof n?(n=n>2?n-2:1,i&&i<=n?r:o(r,n)):r}},mixin:function(t){return function(e){var n=this;if(!A(n))return t(n,Object(e));var r=[];return O(S(e),(function(t){A(e[t])&&r.push([t,n.prototype[t]])})),t(n,Object(e)),O(r,(function(t){var e=t[1];A(e)?n.prototype[t[0]]=e:delete n.prototype[t[0]]})),n}},nthArg:function(t){return function(e){var n=e<0?1:R(e)+1;return j(t(e),n)}},rearg:function(t){return function(e,n){var r=n?n.length:0;return j(t(e,n),r)}},runInContext:function(n){return function(r){return t(e,n(r),s)}}};function N(t,e){if(h.cap){var n=r.iterateeRearg[t];if(n)return function(t,e){return L(t,(function(t){var n=e.length;return function(t,e){return 2==e?function(e,n){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}(P(o(t,n),e),n)}))}(e,n);var i=!l&&r.iterateeAry[t];if(i)return function(t,e){return L(t,(function(t){return"function"==typeof t?o(t,e):t}))}(e,i)}return e}function D(t,e,n){if(h.fixed&&(v||!r.skipFixed[t])){var i=r.methodSpread[t],o=i&&i.start;return void 0===o?m(e,n):function(t,e){return function(){for(var n=arguments.length,r=n-1,i=Array(n);n--;)i[n]=arguments[n];var o=i[e],c=i.slice(0,e);return o&&a.apply(c,o),e!=r&&a.apply(c,i.slice(e+1)),t.apply(this,c)}}(e,o)}return e}function z(t,e,n){return h.rearg&&n>1&&(y||!r.skipRearg[t])?P(e,r.methodRearg[t]||r.aryRearg[n]):e}function B(t,e){for(var n=-1,r=(e=E(e)).length,i=r-1,a=w(Object(t)),o=a;null!=o&&++n1?j(e,n):e}(0,i=N(a,i),t),!1}})),!i})),i||(i=o),i==e&&(i=p?j(i,1):function(){return e.apply(this,arguments)}),i.convert=U(a,e),i.placeholder=e.placeholder=n,i}if(!d)return W(n,f,b);var F=f,Y=[];return O(C,(function(t){O(r.aryMethod[t],(function(t){var e=F[r.remap[t]||t];e&&Y.push([t,W(t,e,F)])}))})),O(S(F),(function(t){var e=F[t];if("function"==typeof e){for(var n=Y.length;n--;)if(Y[n][0]==t)return;e.convert=U(t,e),Y.push([t,e])}})),O(Y,(function(t){F[t[0]]=t[1]})),F.convert=function(t){return F.runInContext.convert(t)(void 0)},F.placeholder=F,O(S(F),(function(t){O(r.realToAlias[t]||[],(function(e){F[e]=F[t]}))})),F}},function(t,e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,n=e.aliasToReal,r={};for(var i in n){var a=n[i];t.call(r,a)?r[a].push(i):r[a]=[i]}return r}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},function(t,e,n){t.exports={ary:n(479),assign:n(181),clone:n(498),curry:n(499),forEach:n(64),isArray:n(2),isError:n(500),isFunction:n(24),isWeakMap:n(501),iteratee:n(502),keys:n(143),rearg:n(503),toInteger:n(119),toPath:n(505)}},function(t,e,n){var r=n(113),i=128;t.exports=function(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,r(t,i,void 0,void 0,void 0,void 0,e)}},function(t,e,n){var r=n(75),i=n(5),a=1;t.exports=function(t,e,n){var o=e&a,c=r(t);return function e(){return(this&&this!==i&&this instanceof e?c:t).apply(o?n:this,arguments)}}},function(t,e,n){var r=n(50),i=n(75),a=n(213),o=n(216),c=n(222),u=n(118),f=n(5);t.exports=function(t,e,n){var s=i(t);return function i(){for(var l=arguments.length,d=Array(l),h=l,b=c(i);h--;)d[h]=arguments[h];var p=l<3&&d[0]!==b&&d[l-1]!==b?[]:u(d,b);return(l-=p.length)1?"& ":"")+e[i],e=e.join(r>2?", ":" "),t.replace(n,"{\n/* [wrapped with "+e+"] */\n")}},function(t,e,n){var r=n(64),i=n(490),a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];t.exports=function(t,e){return r(a,(function(n){var r="_."+n[0];e&n[1]&&!i(t,r)&&t.push(r)})),t.sort()}},function(t,e,n){var r=n(221);t.exports=function(t,e){return!(null==t||!t.length)&&r(t,e,0)>-1}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,a=n+(r?1:-1);r?a--:++a=u.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var c,f,l,d=-1,h=n.length,b=u[i++],p=Object(r.a)(),v=a();++du.length)return n;var i,a=f[r-1];return null!=e&&r>=u.length?i=n.entries():(i=[],n.each((function(e,n){i.push({key:n,values:t(e,r)})}))),null!=a?i.sort((function(t,e){return a(t.key,e.key)})):i}(s(t,0,o,c),0)},key:function(t){return u.push(t),n},sortKeys:function(t){return f[u.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}}},function(t,e,n){"use strict";var r=n(120);function i(){}var a=r.a.prototype;function o(t,e){var n=new i;if(t instanceof i)t.each((function(t){n.add(t)}));else if(t){var r=-1,a=t.length;if(null==e)for(;++r0&&c>0&&(u+c+1>r&&(c=Math.max(1,r-u)),a.push(n.substring(i-=c,i+c)),!((u+=c+1)>r));)c=t[o=(o+1)%t.length];return a.reverse().join(e)}}},function(t,e,n){"use strict";e.a=function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}},function(t,e,n){"use strict";e.a=function(t,e){t:for(var n,r=(t=t.toPrecision(e)).length,i=1,a=-1;i0&&(a=0)}return a>0?t.slice(0,a)+t.slice(n+1):t}},function(t,e,n){"use strict";var r=n(122);e.a=function(t,e){var n=Object(r.a)(t,e);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")}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";var r=n(77);e.a=function(t){return Math.max(0,-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(77);e.a=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3)))-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(77);e.a=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Object(r.a)(e)-Object(r.a)(t))+1}},function(t,e,n){"use strict";e.a=function t(){var e=Object(c.b)(u,f).domain([1,10]),n=e.domain,a=10,s=d(10),b=l(10);function p(){return s=d(a),b=l(a),n()[0]<0&&(s=h(s),b=h(b)),e}return e.base=function(t){return arguments.length?(a=+t,p()):a},e.domain=function(t){return arguments.length?(n(t),p()):n()},e.ticks=function(t){var e,i=n(),o=i[0],c=i[i.length-1];(e=c0){for(;dc)break;v.push(l)}}else for(;d=1;--f)if(!((l=u*f)c)break;v.push(l)}}else v=Object(r.ticks)(d,h,Math.min(h-d,p)).map(b);return e?v.reverse():v},e.tickFormat=function(t,n){if(null==n&&(n=10===a?".0e":","),"function"!=typeof n&&(n=Object(i.a)(n)),t===1/0)return n;null==t&&(t=10);var r=Math.max(1,a*t/e.ticks().length);return function(t){var e=t/b(Math.round(s(t)));return e*a0?a[r-1]:e[0],r=o?[c[o-1],n]:[c[r-1],c[r]]},f.copy=function(){return t().domain([e,n]).range(u)},Object(a.b)(f)};var r=n(10),i=n(27),a=n(48)},function(t,e,n){"use strict";e.a=function t(){var e=[.5],n=[0,1],a=1;function o(t){if(t<=t)return n[Object(r.bisect)(e,t,0,a)]}return o.domain=function(t){return arguments.length?(e=i.b.call(t),a=Math.min(e.length,n.length-1),o):e.slice()},o.range=function(t){return arguments.length?(n=i.b.call(t),a=Math.min(e.length,n.length-1),o):n.slice()},o.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},o.copy=function(){return t().domain(e).range(n)},o};var r=n(10),i=n(27)},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)((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?Object(r.a)((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):i:null},e.a=i,i.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)((function(t){t.setTime(Math.floor(t/i.d)*i.d)}),(function(t,e){t.setTime(+t+e*i.d)}),(function(t,e){return(e-t)/i.d}),(function(t){return t.getUTCSeconds()}));e.a=a,a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)((function(t){t.setTime(Math.floor(t/i.c)*i.c)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getMinutes()}));e.a=a,a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)((function(t){var e=t.getTimezoneOffset()*i.c%i.b;e<0&&(e+=i.b),t.setTime(Math.floor((+t-e)/i.b)*i.b+e)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getHours()}));e.a=a,a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.c)/i.a}),(function(t){return t.getDate()-1}));e.a=a,a.range},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return c})),n.d(e,"c",(function(){return s}));var r=n(4),i=n(15);function a(t){return Object(r.a)((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-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.c)/i.e}))}var o=a(0),c=a(1),u=a(2),f=a(3),s=a(4),l=a(5),d=a(6);o.range,c.range,u.range,f.range,s.range,l.range,d.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)((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()}));e.a=i,i.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)((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()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null},e.a=i,i.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getUTCMinutes()}));e.a=a,a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getUTCHours()}));e.a=a,a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/i.a}),(function(t){return t.getUTCDate()-1}));e.a=a,a.range},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return c})),n.d(e,"c",(function(){return s}));var r=n(4),i=n(15);function a(t){return Object(r.a)((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)/i.e}))}var o=a(0),c=a(1),u=a(2),f=a(3),s=a(4),l=a(5),d=a(6);o.range,c.range,u.range,f.range,s.range,l.range,d.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)((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()}));e.a=i,i.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)((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()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null},e.a=i,i.range},function(t,e,n){"use strict";var r=n(238),i=n(124);+new Date("2000-01-01T00:00:00.000Z")||Object(i.c)(r.a)},function(t,e,n){"use strict";var r=n(235),i=n(236),a=n(123);e.a=function(){return Object(r.a)(a.v,a.q,a.u,a.l,a.m,a.o,a.r,a.n,i.b).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])}},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf")},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6")},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9")},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5")},function(t,e,n){"use strict";var r=n(9),i=n(8);e.a=Object(i.b)(Object(r.b)(300,.5,0),Object(r.b)(-240,.5,1))},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var r=n(9),i=n(8),a=Object(i.b)(Object(r.b)(-100,.75,.35),Object(r.b)(80,1.5,.8)),o=Object(i.b)(Object(r.b)(260,.75,.35),Object(r.b)(80,1.5,.8)),c=Object(r.b)();e.b=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return c.h=360*t-100,c.s=1.5-1.5*e,c.l=.8-.9*e,c+""}},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return c}));var r=n(49);function i(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}e.a=i(Object(r.a)("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var a=i(Object(r.a)("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),o=i(Object(r.a)("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),c=i(Object(r.a)("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"))},function(t,e,n){"use strict";e.a=function t(e){var n=0,i=1,a=!1;function o(t){var r=(t-n)/(i-n);return e(a?Math.max(0,Math.min(1,r)):r)}return o.domain=function(t){return arguments.length?(n=+t[0],i=+t[1],o):[n,i]},o.clamp=function(t){return arguments.length?(a=!!t,o):a},o.interpolator=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t(e).domain([n,i]).clamp(a)},Object(r.b)(o)};var r=n(48)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildColorValue=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Math.E;if((0,a.default)(t))return t;var o="-"===t[0],c="-"===t[0]?t.slice(1):t;if(u[c]){var s=f(u[c],e,n,o,r,i);return function(t){return s(t.value)}}return t};var r,i=n(24),a=(r=i)&&r.__esModule?r:{default:r},o=n(225),c=n(567),u={BrBG:c.interpolateBrBG,PRGn:c.interpolatePRGn,PiYG:c.interpolatePiYG,PuOr:c.interpolatePuOr,RdBu:c.interpolateRdBu,RdGy:c.interpolateRdGy,RdYlBu:c.interpolateRdYlBu,RdYlGn:c.interpolateRdYlGn,Spectral:c.interpolateSpectral,Blues:c.interpolateBlues,Greens:c.interpolateGreens,Greys:c.interpolateGreys,Oranges:c.interpolateOranges,Purples:c.interpolatePurples,Reds:c.interpolateReds,BuGn:c.interpolateBuGn,BuPu:c.interpolateBuPu,GnBu:c.interpolateGnBu,OrRd:c.interpolateOrRd,PuBuGn:c.interpolatePuBuGn,PuBu:c.interpolatePuBu,PuRd:c.interpolatePuRd,RdPu:c.interpolateRdPu,YlGnBu:c.interpolateYlGnBu,YlGn:c.interpolateYlGn,YlOrBr:c.interpolateYlOrBr,YlOrRd:c.interpolateYlOrRd},f=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Math.E;if(i&&e*n<=0&&console.warn("As log(0) = -∞, a log scale domain must be\n strictly-positive or strictly-negative. logscale ignored"),i&&e*n>0){var c=(0,o.scaleLog)().base(a).domain(r?[n,e]:[e,n]).range([0,1]);return(0,o.scaleSequential)((function(e){return t(c(e))})).domain([0,1])}return(0,o.scaleSequential)(t).domain(r?[n,e]:[e,n])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(568);n.d(e,"schemeCategory10",(function(){return r.a}));var i=n(569);n.d(e,"schemeAccent",(function(){return i.a}));var a=n(570);n.d(e,"schemeDark2",(function(){return a.a}));var o=n(571);n.d(e,"schemePaired",(function(){return o.a}));var c=n(572);n.d(e,"schemePastel1",(function(){return c.a}));var u=n(573);n.d(e,"schemePastel2",(function(){return u.a}));var f=n(574);n.d(e,"schemeSet1",(function(){return f.a}));var s=n(575);n.d(e,"schemeSet2",(function(){return s.a}));var l=n(576);n.d(e,"schemeSet3",(function(){return l.a}));var d=n(577);n.d(e,"interpolateBrBG",(function(){return d.a})),n.d(e,"schemeBrBG",(function(){return d.b}));var h=n(578);n.d(e,"interpolatePRGn",(function(){return h.a})),n.d(e,"schemePRGn",(function(){return h.b}));var b=n(579);n.d(e,"interpolatePiYG",(function(){return b.a})),n.d(e,"schemePiYG",(function(){return b.b}));var p=n(580);n.d(e,"interpolatePuOr",(function(){return p.a})),n.d(e,"schemePuOr",(function(){return p.b}));var v=n(581);n.d(e,"interpolateRdBu",(function(){return v.a})),n.d(e,"schemeRdBu",(function(){return v.b}));var y=n(582);n.d(e,"interpolateRdGy",(function(){return y.a})),n.d(e,"schemeRdGy",(function(){return y.b}));var _=n(583);n.d(e,"interpolateRdYlBu",(function(){return _.a})),n.d(e,"schemeRdYlBu",(function(){return _.b}));var g=n(584);n.d(e,"interpolateRdYlGn",(function(){return g.a})),n.d(e,"schemeRdYlGn",(function(){return g.b}));var m=n(585);n.d(e,"interpolateSpectral",(function(){return m.a})),n.d(e,"schemeSpectral",(function(){return m.b}));var x=n(586);n.d(e,"interpolateBuGn",(function(){return x.a})),n.d(e,"schemeBuGn",(function(){return x.b}));var w=n(587);n.d(e,"interpolateBuPu",(function(){return w.a})),n.d(e,"schemeBuPu",(function(){return w.b}));var j=n(588);n.d(e,"interpolateGnBu",(function(){return j.a})),n.d(e,"schemeGnBu",(function(){return j.b}));var O=n(589);n.d(e,"interpolateOrRd",(function(){return O.a})),n.d(e,"schemeOrRd",(function(){return O.b}));var M=n(590);n.d(e,"interpolatePuBuGn",(function(){return M.a})),n.d(e,"schemePuBuGn",(function(){return M.b}));var k=n(591);n.d(e,"interpolatePuBu",(function(){return k.a})),n.d(e,"schemePuBu",(function(){return k.b}));var A=n(592);n.d(e,"interpolatePuRd",(function(){return A.a})),n.d(e,"schemePuRd",(function(){return A.b}));var T=n(593);n.d(e,"interpolateRdPu",(function(){return T.a})),n.d(e,"schemeRdPu",(function(){return T.b}));var S=n(594);n.d(e,"interpolateYlGnBu",(function(){return S.a})),n.d(e,"schemeYlGnBu",(function(){return S.b}));var P=n(595);n.d(e,"interpolateYlGn",(function(){return P.a})),n.d(e,"schemeYlGn",(function(){return P.b}));var R=n(596);n.d(e,"interpolateYlOrBr",(function(){return R.a})),n.d(e,"schemeYlOrBr",(function(){return R.b}));var E=n(597);n.d(e,"interpolateYlOrRd",(function(){return E.a})),n.d(e,"schemeYlOrRd",(function(){return E.b}));var C=n(598);n.d(e,"interpolateBlues",(function(){return C.a})),n.d(e,"schemeBlues",(function(){return C.b}));var I=n(599);n.d(e,"interpolateGreens",(function(){return I.a})),n.d(e,"schemeGreens",(function(){return I.b}));var N=n(600);n.d(e,"interpolateGreys",(function(){return N.a})),n.d(e,"schemeGreys",(function(){return N.b}));var D=n(601);n.d(e,"interpolatePurples",(function(){return D.a})),n.d(e,"schemePurples",(function(){return D.b}));var z=n(602);n.d(e,"interpolateReds",(function(){return z.a})),n.d(e,"schemeReds",(function(){return z.b}));var B=n(603);n.d(e,"interpolateOranges",(function(){return B.a})),n.d(e,"schemeOranges",(function(){return B.b}));var U=n(604);n.d(e,"interpolateCubehelixDefault",(function(){return U.a}));var L=n(605);n.d(e,"interpolateRainbow",(function(){return L.b})),n.d(e,"interpolateWarm",(function(){return L.c})),n.d(e,"interpolateCool",(function(){return L.a}));var W=n(606);n.d(e,"interpolateSinebow",(function(){return W.a}));var F=n(607);n.d(e,"interpolateViridis",(function(){return F.a})),n.d(e,"interpolateMagma",(function(){return F.c})),n.d(e,"interpolateInferno",(function(){return F.b})),n.d(e,"interpolatePlasma",(function(){return F.d}))},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f")},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(0),i=n(1),a=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";var r=n(9),i=n(8);e.a=Object(i.b)(Object(r.b)(300,.5,0),Object(r.b)(-240,.5,1))},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var r=n(9),i=n(8),a=Object(i.b)(Object(r.b)(-100,.75,.35),Object(r.b)(80,1.5,.8)),o=Object(i.b)(Object(r.b)(260,.75,.35),Object(r.b)(80,1.5,.8)),c=Object(r.b)();e.b=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return c.h=360*t-100,c.s=1.5-1.5*e,c.l=.8-.9*e,c+""}},function(t,e,n){"use strict";var r=n(9),i=Object(r.f)(),a=Math.PI/3,o=2*Math.PI/3;e.a=function(t){var e;return t=(.5-t)*Math.PI,i.r=255*(e=Math.sin(t))*e,i.g=255*(e=Math.sin(t+a))*e,i.b=255*(e=Math.sin(t+o))*e,i+""}},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return c}));var r=n(0);function i(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}e.a=i(Object(r.a)("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var a=i(Object(r.a)("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),o=i(Object(r.a)("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),c=i(Object(r.a)("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.renderAxes=e._buildAxesData=void 0;var r=c(n(609)),i=c(n(105)),a=n(13),o=c(n(612));function c(t){return t&&t.__esModule?t:{default:t}}var u=function(t,e,n){return{value:t,thickness:e.thickness||1,color:e.color||"#d3d3d3",opacity:e.opacity||n.opacity}},f=e._buildAxesData=function(t){return(0,i.default)(t.axes,(function(e,n){if(!n.position&&!n.spacing)return o.default.warn("Skipping axe group with no position and spacing defined"),e;if(n.position&&e.push(u(n.position,n,t)),n.spacing){var i=(0,r.default)(n.start||t.cmin,n.end||t.cmax,n.spacing).map((function(e){return u(e,n,t)}));return e.concat(i)}return e}),[])};e.renderAxes=function(t,e,n,r){var i=f(e),o=(0,a.arc)().innerRadius((function(t){return"in"===e.direction?e.outerRadius-r(t.value):e.innerRadius+r(t.value)})).outerRadius((function(t){return"in"===e.direction?e.outerRadius-r(t.value):e.innerRadius+r(t.value)})).startAngle(0).endAngle((function(t){return t.length})),c=t.selectAll(".axis").data((function(t){var e=n._layout.blocks[t.key];return i.map((function(n){return{value:n.value,thickness:n.thickness,color:n.color,opacity:n.opacity,block_id:t.key,length:e.end-e.start}}))})).enter().append("path").attr("opacity",(function(t){return t.opacity})).attr("class","axis").attr("d",o).attr("stroke-width",(function(t){return t.thickness})).attr("stroke",(function(t){return t.color}));return e.showAxesTooltip&&(c.on("mouseover",(function(t,e){n.tip.html(t.value).transition().style("opacity",.9).style("left",event.pageX+"px").style("top",event.pageY-28+"px")})),c.on("mouseout",(function(t,e){n.tip.transition().duration(500).style("opacity",0)}))),c}},function(t,e,n){var r=n(610)();t.exports=r},function(t,e,n){var r=n(611),i=n(63),a=n(223);t.exports=function(t){return function(e,n,o){return o&&"number"!=typeof o&&i(e,n,o)&&(n=o=void 0),e=a(e),void 0===n?(n=e,e=0):n=a(n),o=void 0===o?e-1:!!s&&r(t,e,n)>-1}},function(t,e,n){var r=n(16),i=n(2),a=n(6),o="[object String]";t.exports=function(t){return"string"==typeof t||!i(t)&&a(t)&&r(t)==o}},function(t,e,n){var r=n(616),i=n(18);t.exports=function(t){return null==t?[]:r(t,i(t))}},function(t,e,n){var r=n(40);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},function(t,e,n){var r=n(618),i=n(619),a=n(33),o=n(2),c=n(63);t.exports=function(t,e,n){var u=o(t)?r:i;return n&&c(t,e,n)&&(e=void 0),u(t,a(e,3))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n=1?t:t*e},p=function(t){function e(t,n,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,h,r,a.parseChordData))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"getCoordinates",value:function(t,e,n,r){var i=e.blocks[t.id],a=i.start+t.start/i.len*(i.end-i.start),o=i.start+t.end/i.len*(i.end-i.start),c=void 0;return(0,f.default)(n.radius)?c=b(n.radius(r),e.conf.innerRadius):n.radius&&(c=b(n.radius,e.conf.innerRadius)),c||(c=e.conf.innerRadius),{radius:c,startAngle:a,endAngle:o}}},{key:"renderChords",value:function(t,e,n,r,i,a){var o=this,u=t.append("g").selectAll(".chord").data(r).enter().append("path").attr("class","chord").attr("d",(0,c.ribbon)().source((function(t){return a(t.source,i._layout,o.conf,t)})).target((function(t){return a(t.target,i._layout,o.conf,t)}))).attr("opacity",n.opacity).on("mouseover",(function(t){o.dispatch.call("mouseover",o,t),i.clipboard.attr("value",n.tooltipContent(t))})).on("mouseout",(function(t){return o.dispatch.call("mouseout",o,t)}));return Object.keys(n.events).forEach((function(t){u.on(t,(function(e,r,i){n.events[t](e,r,i,s.event)}))})),u.attr("fill",n.colorValue),u}},{key:"render",value:function(t,e,n){e.select("."+n).remove();var r=e.append("g").attr("class",n).attr("z-index",this.conf.zIndex),i=this.renderChords(r,n,this.conf,this.data,t,this.getCoordinates);return this.conf.tooltipContent&&(0,o.registerTooltip)(this,t,i,this.conf),this}}]),e}(i.default);e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(624);n.d(e,"chord",(function(){return r.a}));var i=n(625);n.d(e,"ribbon",(function(){return i.a}))},function(t,e,n){"use strict";var r=n(10),i=n(239);function a(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}e.a=function(){var t=0,e=null,n=null,o=null;function c(a){var c,u,f,s,l,d,h=a.length,b=[],p=Object(r.range)(h),v=[],y=[],_=y.groups=new Array(h),g=new Array(h*h);for(c=0,l=-1;++lt.position+r?t.groups.push([e]):t.groups[t.groups.length-1].push(e),t.position=e.position,t)}),{position:null,groups:[]}).groups):[t.values];var n,r})).enter().append("g").attr("class","line").append("path").datum((function(t){return t.map((function(t){var i=r.scale(t.value);return(0,o.default)(t,{angle:r.theta(t.position,n.blocks[t.block_id])},function(t){return e.fill?{innerRadius:"out"===e.direction?e.innerRadius:e.outerRadius-t,outerRadius:"out"===e.direction?e.innerRadius+t:e.outerRadius}:{radius:"out"===e.direction?e.innerRadius+t:e.outerRadius-t}}(i))}))})).attr("d",f).attr("opacity",e.opacity).attr("stroke-width",e.thickness).attr("stroke",e.colorValue).attr("fill","none");return e.fill&&l.attr("fill",e.fillColor),l}}]),e}(i.default);e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;ne.end?-1:t.start==e.start&&t.end==e.end?0:1}));var r=[];(0,u.default)(t.values,(function(t){var n=!1;(0,u.default)(r,(function(r,i){if(r.slice(0).pop().end+e0))return o;do{o.push(a=new Date(+t)),n(t,i),e(t)}while(a=t)for(;e(t),!r(t);)t.setTime(t-1)},function(t,e){if(t>=t)if(e<0)for(;++e<=0;)for(;n(t,-1),!r(t););else for(;--e>=0;)for(;n(t,1),!r(t););})};a&&(c.count=function(t,n){return r.setTime(+t),i.setTime(+n),e(r),e(i),Math.floor(a(r,i))},c.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?c.filter(o?function(e){return o(e)%t==0}:function(e){return c.count(0,e)%t==0}):c:null});return c};var r=new Date,i=new Date},function(t,e,n){var r=n(128),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();t.exports=a},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";var r=n(99);n.d(e,"a",function(){return r.a});n(171),n(102),n(169),n(172);var i=n(69);n.d(e,"c",function(){return i.a});n(173);var a=n(357);n.d(e,"f",function(){return a.a});var o=n(174);n.d(e,"g",function(){return o.a});var c=n(358);n.d(e,"h",function(){return c.a}),n.d(e,"i",function(){return c.b});var u=n(361);n.d(e,"j",function(){return u.a});var f=n(168);n.d(e,"d",function(){return f.a}),n.d(e,"e",function(){return f.b});n(362),n(363),n(364);var s=n(365);n.d(e,"b",function(){return s.a});n(366)},function(t,e,n){"use strict";var r=n(100);n.d(e,"a",function(){return r.e}),n.d(e,"f",function(){return r.g}),n.d(e,"d",function(){return r.f});var i=n(355);n.d(e,"e",function(){return i.a}),n.d(e,"c",function(){return i.b});var a=n(356);n.d(e,"b",function(){return a.a})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(197);n.d(e,"bisect",function(){return r.c}),n.d(e,"bisectRight",function(){return r.b}),n.d(e,"bisectLeft",function(){return r.a});var i=n(36);n.d(e,"ascending",function(){return i.a});var a=n(198);n.d(e,"bisector",function(){return a.a});var o=n(452);n.d(e,"cross",function(){return o.a});var c=n(453);n.d(e,"descending",function(){return c.a});var u=n(200);n.d(e,"deviation",function(){return u.a});var f=n(202);n.d(e,"extent",function(){return f.a});var s=n(454);n.d(e,"histogram",function(){return s.a});var l=n(457);n.d(e,"thresholdFreedmanDiaconis",function(){return l.a});var d=n(458);n.d(e,"thresholdScott",function(){return d.a});var h=n(206);n.d(e,"thresholdSturges",function(){return h.a});var b=n(459);n.d(e,"max",function(){return b.a});var p=n(460);n.d(e,"mean",function(){return p.a});var v=n(461);n.d(e,"median",function(){return v.a});var y=n(462);n.d(e,"merge",function(){return y.a});var _=n(207);n.d(e,"min",function(){return _.a});var g=n(199);n.d(e,"pairs",function(){return g.a});var m=n(463);n.d(e,"permute",function(){return m.a});var x=n(112);n.d(e,"quantile",function(){return x.a});var w=n(204);n.d(e,"range",function(){return w.a});var j=n(464);n.d(e,"scan",function(){return j.a});var O=n(465);n.d(e,"shuffle",function(){return O.a});var M=n(466);n.d(e,"sum",function(){return M.a});var k=n(205);n.d(e,"ticks",function(){return k.a}),n.d(e,"tickIncrement",function(){return k.b}),n.d(e,"tickStep",function(){return k.c});var A=n(208);n.d(e,"transpose",function(){return A.a});var T=n(201);n.d(e,"variance",function(){return T.a});var S=n(467);n.d(e,"zip",function(){return S.a})},function(t,e,n){"use strict";n.d(e,"c",function(){return C}),e.a=I;var r=n(315),i=n(316),a=n(317),o=n(318),c=n(162),u=n(320),f=n(321),s=n(322),l=n(323),d=n(324),h=n(325),b=n(326),p=n(327),v=n(328),y=n(329),_=n(330),g=n(164),m=n(331),x=n(332),w=n(333),j=n(334),O=n(335),M=n(336),k=n(337),A=n(338),T=n(339),S=n(340),P=n(341),R=n(97),E=n(342),C=[null];function I(t,e){this._groups=t,this._parents=e}function N(){return new I([[document.documentElement]],C)}I.prototype=N.prototype={constructor:I,select:r.a,selectAll:i.a,filter:a.a,data:o.a,enter:c.b,exit:u.a,merge:f.a,order:s.a,sort:l.a,call:d.a,nodes:h.a,node:b.a,size:p.a,empty:v.a,each:y.a,attr:_.a,style:g.a,property:m.a,classed:x.a,text:w.a,html:j.a,raise:O.a,lower:M.a,append:k.a,insert:A.a,remove:T.a,clone:S.a,datum:P.a,on:R.b,dispatch:E.a},e.b=N},function(t,e,n){"use strict";n.d(e,"c",function(){return u}),n.d(e,"d",function(){return f}),n.d(e,"b",function(){return d}),n.d(e,"a",function(){return h}),e.g=function(t,e){var n=b(t,e);if(n.state>c)throw new Error("too late; already scheduled");return n},e.h=function(t,e){var n=b(t,e);if(n.state>f)throw new Error("too late; already started");return n},e.f=b;var r=n(68),i=n(177),a=Object(r.dispatch)("start","end","interrupt"),o=[],c=0,u=1,f=2,s=3,l=4,d=5,h=6;function b(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}e.e=function(t,e,n,r,b,p){var v=t.__transition;if(v){if(n in v)return}else t.__transition={};!function(t,e,n){var r,a=t.__transition;function o(d){var p,v,y,_;if(n.state!==u)return b();for(p in a)if((_=a[p]).name===n.name){if(_.state===s)return Object(i.b)(o);_.state===l?(_.state=h,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete a[p]):+p0&&(0,l.renderAxes)(o,this.conf,t,this.scale);var u=this.renderDatum(o,this.conf,t._layout);return this.conf.tooltipContent&&(0,i.registerTooltip)(this,t,u,this.conf),u.on("mouseover",function(e,n){r.dispatch.call("mouseover",r,e),r.conf.tooltipContent&&t.clipboard.attr("value",r.conf.tooltipContent(e))}),u.on("mouseout",function(t,e){r.dispatch.call("mouseout",r,t)}),Object.keys(this.conf.events).forEach(function(t){var e=r.conf;u.on(t,function(n,r,i){e.events[t](n,r,i,c.event)})}),this}},{key:"renderBlock",value:function(t,e,n,r){var i=this,a=t.selectAll(".block").data(e).enter().append("g").attr("class","block").attr("transform",function(t){return"rotate("+360*n.blocks[t.key].start/(2*Math.PI)+")"});return r.backgrounds&&a.selectAll(".background").data(function(t){return r.backgrounds.map(function(e){return{start:e.start||r.cmin,end:e.end||r.cmax,angle:n.blocks[t.key].end-n.blocks[t.key].start,color:e.color,opacity:e.opacity}})}).enter().append("path").attr("class","background").attr("fill",function(t){return t.color}).attr("opacity",function(t){return t.opacity||1}).attr("d",(0,o.arc)().innerRadius(function(t){return"in"===r.direction?r.outerRadius-i.scale(t.start):r.innerRadius+i.scale(t.start)}).outerRadius(function(t){return"in"===r.direction?r.outerRadius-i.scale(t.end):r.innerRadius+i.scale(t.end)}).startAngle(0).endAngle(function(t){return t.angle})),a}},{key:"theta",value:function(t,e){return t/e.len*(e.end-e.start)}},{key:"x",value:function(t,e,n){var r=this.scale(t.value),i="in"===n.direction?n.outerRadius-r:n.innerRadius+r,a=this.theta(t.position,e.blocks[t.block_id])-Math.PI/2;return i*Math.cos(a)}},{key:"y",value:function(t,e,n){var r=this.scale(t.value),i="in"===n.direction?n.outerRadius-r:n.innerRadius+r,a=this.theta(t.position,e.blocks[t.block_id])-Math.PI/2;return i*Math.sin(a)}}]),t}();e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSpanValueData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};return d(t.filter(function(t,n){return s(t.block_id,n,e,"parent")}))},e.parseSpanStringData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};return d(t.filter(function(t,n){return s(t.block_id,n,e,"parent")}).filter(function(t,e){return l({start:t.start,end:t.end},e)}).filter(function(t){return!(t.start<0||t.end>e[t.block_id])||(f.log(2,"position","position inconsistency",{datum:t,layoutSummary:e}),!1)}))},e.parsePositionValueData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};return d(t.filter(function(t,n){return s(t.block_id,n,e,"parent")}).filter(function(t,e){return l({position:t.position,value:t.value},e)}))},e.parsePositionTextData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};return d(t.filter(function(t,n){return s(t.block_id,n,e,"parent")}).filter(function(t,e){return l({position:t.position},e)}))},e.parseChordData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};var n=t.filter(function(t,n){return t.source?s(t.source.id,n,e,"sourceId"):(f.warn("No source for data at index "+n),!1)}).filter(function(t,n){return t.target?s(t.target.id,n,e,"targetId"):(f.warn("No target for data at index "+n),!1)}).filter(function(t,e){return l({sourceStart:t.source.start,sourceEnd:t.source.end,targetStart:t.target.start,targetEnd:t.target.end,value:t.value||1},e)});return{data:n,meta:{min:(0,c.min)(n,function(t){return t.value}),max:(0,c.max)(n,function(t){return t.value})}}};var r=u(n(18)),i=u(n(613)),a=u(n(617)),o=(u(n(144)),n(227)),c=n(10);function u(t){return t&&t.__esModule?t:{default:t}}var f=console;function s(t,e,n,a){return!!(0,i.default)((0,r.default)(n),t)||(f.log(1,"datum","unknown parent id",{line:e+1,value:t,header:a,layoutSummary:n}),!1)}function l(t,e){return(0,a.default)(t,function(t,n){return!isNaN(t)||(f.log(1,"datum","not a number",{line:e+1,value:t,header:n}),!1)})}function d(t){return{data:(0,o.nest)().key(function(t){return t.block_id}).entries(t),meta:{min:(0,c.min)(t,function(t){return t.value}),max:(0,c.max)(t,function(t){return t.value})}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={min:{value:null,iteratee:!1},max:{value:null,iteratee:!1},logScale:{value:!1,iteratee:!1},logScaleBase:{value:Math.E,iteratee:!1}};e.axes={axes:{value:[],iteratee:!1},showAxesTooltip:{value:!0,iteratee:!1}},e.palette={colorPaletteSize:{value:9,iteratee:!1},colorPalette:{value:"YlGnBu",iteratee:!1},usePalette:{value:!0,iteratee:!1},colorPaletteReverse:{value:!0,iteratee:!1}},e.radial={innerRadius:{value:0,iteratee:!1},outerRadius:{value:0,iteratee:!1}},e.values=r,e.common={zIndex:{value:!1,iteratee:!1},opacity:{value:1,iteratee:!0},tooltipContent:{value:null,iteratee:!1},events:{value:{},iteratee:!1}}},function(t,e,n){var r=n(243),i=n(248);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(16),i=n(7),a="[object AsyncFunction]",o="[object Function]",c="[object GeneratorFunction]",u="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=r(t);return e==o||e==c||e==a||e==u}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e){t.exports={}},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return a});var r=Array.prototype,i=r.map,a=r.slice},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(5).Symbol;t.exports=r},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++ne?1:t>=e?0:NaN}},function(t,e,n){var r=n(476),i=n(478);t.exports=function(t,e,n){return r(i,t,e,n)}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(283),i=n(285)(r);t.exports=i},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n180||n<-180?n-360*Math.round(n/360):n):Object(r.a)(isNaN(t)?e:t)},e.b=function(t){return 1==(t=+t)?a:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Object(r.a)(isNaN(e)?n:e)}},e.a=a;var r=n(170);function i(t,e){return function(n){return t+n*e}}function a(t,e){var n=e-t;return n?i(t,n):Object(r.a)(isNaN(t)?e:t)}},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"e",function(){return a}),n.d(e,"h",function(){return o}),n.d(e,"i",function(){return c}),n.d(e,"k",function(){return u}),n.d(e,"l",function(){return f}),n.d(e,"f",function(){return s}),n.d(e,"j",function(){return l}),n.d(e,"g",function(){return d}),n.d(e,"m",function(){return h}),e.b=function(t){return t>1?0:t<-1?l:Math.acos(t)},e.c=function(t){return t>=1?d:t<=-1?-d:Math.asin(t)};var r=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,c=Math.min,u=Math.sin,f=Math.sqrt,s=1e-12,l=Math.PI,d=l/2,h=2*l},function(t,e,n){"use strict";e.a=function(t,e){if((i=t.length)>1)for(var n,r,i,a=1,o=t[e[0]],c=o.length;a=0;)n[e]=e;return n}},function(t,e,n){"use strict";e.a=function(t){return null===t?NaN:+t}},function(t,e,n){"use strict";e.b=c,e.a=function t(){var e=Object(a.b)(a.c,i.c);e.copy=function(){return Object(a.a)(e,t())};return c(e)};var r=n(10),i=n(8),a=n(76),o=n(527);function c(t){var e=t.domain;return t.ticks=function(t){var n=e();return Object(r.ticks)(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){return Object(o.a)(e(),t,n)},t.nice=function(n){null==n&&(n=10);var i,a=e(),o=0,c=a.length-1,u=a[o],f=a[c];return f0?(u=Math.floor(u/i)*i,f=Math.ceil(f/i)*i,i=Object(r.tickIncrement)(u,f,n)):i<0&&(u=Math.ceil(u*i)/i,f=Math.floor(f*i)/i,i=Object(r.tickIncrement)(u,f,n)),i>0?(a[o]=Math.floor(u/i)*i,a[c]=Math.ceil(f/i)*i,e(a)):i<0&&(a[o]=Math.ceil(u*i)/i,a[c]=Math.floor(f*i)/i,e(a)),t},t}},function(t,e,n){"use strict";e.a=function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(52),i=n(255),a=n(256),o=n(257),c=n(258),u=n(259);function f(t){var e=this.__data__=new r(t);this.size=e.size}f.prototype.clear=i,f.prototype.delete=a,f.prototype.get=o,f.prototype.has=c,f.prototype.set=u,t.exports=f},function(t,e,n){var r=n(250),i=n(251),a=n(252),o=n(253),c=n(254);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t2?l:s,r=o=null,y}function y(e){return(r||(r=n(d,h,p?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=e?0:t>=n?1:r(t)}}}(t):t,b)))(+e)}return y.invert=function(t){return(o||(o=n(h,d,f,p?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=0?e:t>=1?n:r(t)}}}(e):e)))(+t)},y.domain=function(t){return arguments.length?(d=a.a.call(t,c.a),v()):d.slice()},y.range=function(t){return arguments.length?(h=a.b.call(t),v()):h.slice()},y.rangeRound=function(t){return h=a.b.call(t),b=i.f,v()},y.clamp=function(t){return arguments.length?(p=!!t,v()):p},y.interpolate=function(t){return arguments.length?(b=t,v()):b},v()};var r=n(10),i=n(8),a=n(27),o=n(121),c=n(228),u=[0,1];function f(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Object(o.a)(e)}function s(t,e,n,r){var i=t[0],a=t[1],o=e[0],c=e[1];return a-1&&t%1==0&&t<=n}},function(t,e,n){var r=n(277),i=n(60),a=n(89),o=a&&a.isTypedArray,c=o?i(o):r;t.exports=c},function(t,e,n){(function(t){var r=n(128),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i&&r.process,c=function(){try{var t=a&&a.require&&a.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=c}).call(e,n(84)(t))},function(t,e,n){var r=n(83),i=n(38),a=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var o=t[e];a.call(t,e)&&i(o,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(149),i=n(150),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,c=o?function(t){return null==t?[]:(t=Object(t),r(o(t),function(e){return a.call(t,e)}))}:i;t.exports=c},function(t,e,n){var r=n(2),i=n(34),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||o.test(t)||!a.test(t)||null!=e&&t in Object(e)}},function(t,e,n){"use strict";var r=n(94);e.a=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),r.a.hasOwnProperty(e)?{space:r.a[e],local:t}:t}},function(t,e,n){"use strict";n.d(e,"b",function(){return r});var r="http://www.w3.org/1999/xhtml";e.a={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(t,e,n){"use strict";function r(){}e.a=function(t){return null==t?r:function(){return this.querySelector(t)}}},function(t,e,n){"use strict";e.a=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}},function(t,e,n){"use strict";n.d(e,"c",function(){return i}),e.a=function(t,e,n,r){var a=i;t.sourceEvent=i,i=t;try{return e.apply(n,r)}finally{i=a}};var r={},i=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(r={mouseenter:"mouseover",mouseleave:"mouseout"}));function a(t,e,n){return t=o(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function o(t,e,n){return function(r){var a=i;i=r;try{t.call(this,this.__data__,e,n)}finally{i=a}}}function c(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),o=a.length;if(!(arguments.length<2)){for(f=e?u:c,null==n&&(n=!1),r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=l.exec(t))?m(parseInt(e[1],16)):(e=d.exec(t))?new O(e[1],e[2],e[3],1):(e=h.exec(t))?new O(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=b.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=v.exec(t))?M(e[1],e[2]/100,e[3]/100,1):(e=y.exec(t))?M(e[1],e[2]/100,e[3]/100,e[4]):_.hasOwnProperty(t)?m(_[t]):"transparent"===t?new O(NaN,NaN,NaN,0):null}function m(t){return new O(t>>16&255,t>>8&255,255&t,1)}function x(t,e,n,r){return r<=0&&(t=e=n=NaN),new O(t,e,n,r)}function w(t){return t instanceof i||(t=g(t)),t?new O((t=t.rgb()).r,t.g,t.b,t.opacity):new O}function j(t,e,n,r){return 1===arguments.length?w(t):new O(t,e,n,null==r?1:r)}function O(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function M(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new A(t,e,n,r)}function k(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof A)return new A(t.h,t.s,t.l,t.opacity);if(t instanceof i||(t=g(t)),!t)return new A;if(t instanceof A)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,a=Math.min(e,n,r),o=Math.max(e,n,r),c=NaN,u=o-a,f=(o+a)/2;return u?(c=e===o?(n-r)/u+6*(n0&&f<1?0:c,new A(c,u,f,t.opacity)}(t):new A(t,e,n,null==r?1:r)}function A(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function T(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Object(r.a)(i,g,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Object(r.a)(O,j,Object(r.b)(i,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new O(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new O(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(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+")")}})),Object(r.a)(A,k,Object(r.b)(i,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new A(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new A(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new O(T(t>=240?t-240:t+120,i,r),T(t,i,r),T(t<120?t+240:t-120,i,r),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}}))},function(t,e,n){"use strict";e.b=function(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n},e.a=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t}},function(t,e,n){"use strict";function r(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}e.a=r,e.b=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],c=i>0?t[i-1]:2*a-o,u=i=0&&e._call.call(null,t),e=e._next;--a}()}finally{a=0,function(){var t,e,n=r,a=1/0;for(;n;)n._call?(a>n._time&&(a=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:r=e);i=t,m(a)}(),s=0}}function g(){var t=d.now(),e=t-f;e>u&&(l-=e,f=t)}function m(t){a||(o&&(o=clearTimeout(o)),t-s>24?(t<1/0&&(o=setTimeout(_,t-d.now()-l)),c&&(c=clearInterval(c))):(c||(f=d.now(),c=setInterval(g,u)),a=1,h(_)))}v.prototype=y.prototype={constructor:v,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?b():+n)+(null==e?0:+e),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=n,m()},stop:function(){this._call&&(this._call=null,this._time=1/0,m())}}},function(t,e,n){var r=n(51),i=n(64),a=n(90),o=n(181),c=n(404),u=n(134),f=n(30),s=n(405),l=n(406),d=n(147),h=n(407),b=n(41),p=n(408),v=n(409),y=n(137),_=n(2),g=n(59),m=n(413),x=n(7),w=n(415),j=n(18),O=1,M=2,k=4,A="[object Arguments]",T="[object Function]",S="[object GeneratorFunction]",P="[object Object]",R={};R[A]=R["[object Array]"]=R["[object ArrayBuffer]"]=R["[object DataView]"]=R["[object Boolean]"]=R["[object Date]"]=R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Map]"]=R["[object Number]"]=R[P]=R["[object RegExp]"]=R["[object Set]"]=R["[object String]"]=R["[object Symbol]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R["[object Error]"]=R[T]=R["[object WeakMap]"]=!1,t.exports=function t(e,n,E,C,I,N){var D,z=n&O,B=n&M,U=n&k;if(E&&(D=I?E(e,C,I,N):E(e)),void 0!==D)return D;if(!x(e))return e;var L=_(e);if(L){if(D=p(e),!z)return f(e,D)}else{var W=b(e),F=W==T||W==S;if(g(e))return u(e,z);if(W==P||W==A||F&&!I){if(D=B||F?{}:y(e),!z)return B?l(e,c(D,e)):s(e,o(D,e))}else{if(!R[W])return I?e:{};D=v(e,W,z)}}N||(N=new r);var Y=N.get(e);if(Y)return Y;if(N.set(e,D),w(e))return e.forEach(function(r){D.add(t(r,n,E,r,e,N))}),D;if(m(e))return e.forEach(function(r,i){D.set(i,t(r,n,E,i,e,N))}),D;var q=U?B?h:d:B?keysIn:j,G=L?void 0:q(e);return i(G||e,function(r,i){G&&(r=e[i=r]),a(D,i,t(r,n,E,i,e,N))}),D}},function(t,e,n){var r=n(417),i=n(39),a=n(33),o=n(418),c=n(2);t.exports=function(t,e,n){var u=c(t)?r:o,f=arguments.length<3;return u(t,a(e,4),n,f,i)}},function(t,e,n){var r=n(107),i=n(422),a=n(78),o=n(63),c=a(function(t,e){if(null==t)return[];var n=e.length;return n>1&&o(t,e[0],e[1])?e=[]:n>2&&o(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])});t.exports=c},function(t,e,n){var r=n(65),i=n(421);t.exports=function t(e,n,a,o,c){var u=-1,f=e.length;for(a||(a=i),c||(c=[]);++u0&&a(s)?n>1?t(s,n-1,a,o,c):r(c,s):o||(c[c.length]=s)}return c}},function(t,e,n){"use strict";var r=n(35),i=n(25),a=n(71),o=n(109);e.a=function(){var t=o.a,e=o.b,n=Object(i.a)(!0),c=null,u=a.a,f=null;function s(i){var a,o,s,l=i.length,d=!1;for(null==c&&(f=u(s=Object(r.a)())),a=0;a<=l;++a)!(ar.f){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,f=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/f,a=(a*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/f}if(t._l23_a>r.f){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/l,c=(c*s+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(i,a,o,c,t._x2,t._y2)}function o(t,e){this._context=t,this._alpha=e}o.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 n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:a(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}},e.a=function t(e){function n(t){return e?new o(t,e):new i.a(t,0)}return n.alpha=function(e){return t(+e)},n}(.5)},function(t,e,n){"use strict";e.b=i;var r=n(46);function i(t){for(var e,n=0,r=-1,i=t.length;++r=1)return+n(t[i-1],i-1,t);var i,a=(i-1)*e,o=Math.floor(a),c=+n(t[o],o,t);return c+(+n(t[o+1],o+1,t)-c)*(a-o)}}},function(t,e,n){var r=n(211),i=n(480),a=n(481),o=n(213),c=n(495),u=n(116),f=n(496),s=n(219),l=n(220),d=n(119),h="Expected a function",b=1,p=2,v=8,y=16,_=32,g=64,m=Math.max;t.exports=function(t,e,n,x,w,j,O,M){var k=e&p;if(!k&&"function"!=typeof t)throw new TypeError(h);var A=x?x.length:0;if(A||(e&=~(_|g),x=w=void 0),O=void 0===O?O:m(d(O),0),M=void 0===M?M:d(M),A-=w?w.length:0,e&g){var T=x,S=w;x=w=void 0}var P=k?void 0:u(t),R=[t,e,n,x,w,T,S,j,O,M];if(P&&f(R,P),t=R[0],e=R[1],n=R[2],x=R[3],w=R[4],!(M=R[9]=void 0===R[9]?k?0:t.length:m(R[9]-A,0))&&e&(v|y)&&(e&=~(v|y)),e&&e!=b)E=e==v||e==y?a(t,e,M):e!=_&&e!=(b|_)||w.length?o.apply(void 0,R):c(t,e,n,x);else var E=i(t,e,n);return l((P?r:s)(E,R),t,e)}},function(t,e,n){var r=n(56),i=n(115),a=4294967295;function o(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=a,this.__views__=[]}o.prototype=r(i.prototype),o.prototype.constructor=o,t.exports=o},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(212),i=n(483),a=r?function(t){return r.get(t)}:i;t.exports=a},function(t,e,n){var r=n(56),i=n(115);function a(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}a.prototype=r(i.prototype),a.prototype.constructor=a,t.exports=a},function(t,e){var n="__lodash_placeholder__";t.exports=function(t,e){for(var r=-1,i=t.length,a=0,o=[];++r1?r[0]+r.slice(2):r,+t.slice(n+1)]}},function(t,e,n){"use strict";n(4);var r=n(542);n.d(e,"c",function(){return r.a}),n.d(e,"n",function(){return r.a});var i=n(543);n.d(e,"g",function(){return i.a}),n.d(e,"r",function(){return i.a});var a=n(544);n.d(e,"d",function(){return a.a});var o=n(545);n.d(e,"b",function(){return o.a});var c=n(546);n.d(e,"a",function(){return c.a});var u=n(547);n.d(e,"j",function(){return u.b}),n.d(e,"h",function(){return u.b}),n.d(e,"e",function(){return u.a}),n.d(e,"i",function(){return u.c});var f=n(548);n.d(e,"f",function(){return f.a});var s=n(549);n.d(e,"k",function(){return s.a});var l=n(550);n.d(e,"o",function(){return l.a});var d=n(551);n.d(e,"m",function(){return d.a});var h=n(552);n.d(e,"l",function(){return h.a});var b=n(553);n.d(e,"u",function(){return b.b}),n.d(e,"s",function(){return b.b}),n.d(e,"p",function(){return b.a}),n.d(e,"t",function(){return b.c});var p=n(554);n.d(e,"q",function(){return p.a});var v=n(555);n.d(e,"v",function(){return v.a})},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return a}),n.d(e,"c",function(){return o});var r,i,a,o,c,u=n(237);c={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"]},r=Object(u.a)(c),i=r.format,r.parse,a=r.utcFormat,o=r.utcParse},function(t,e,n){var r=n(50),i=n(78),a=n(249),o=n(282),c=i(function(t){return t.push(void 0,a),r(o,void 0,t)});t.exports=c},function(t,e,n){var r=n(50),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var a=arguments,o=-1,c=i(a.length-e,0),u=Array(c);++o0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(51),i=n(132),a=n(133),o=n(273),c=n(7),u=n(61),f=n(140);t.exports=function t(e,n,s,l,d){e!==n&&a(n,function(a,u){if(c(a))d||(d=new r),o(e,n,u,s,t,l,d);else{var h=l?l(f(e,u),a,u+"",e,n,d):void 0;void 0===h&&(h=a),i(e,u,h)}},u)}},function(t,e,n){var r=n(83),i=n(38);t.exports=function(t,e,n){(void 0===n||i(t[e],n))&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(272)();t.exports=r},function(t,e,n){(function(t){var r=n(5),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i?r.Buffer:void 0,c=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=c?c(n):new t.constructor(n);return t.copy(r),r}}).call(e,n(84)(t))},function(t,e,n){var r=n(85);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(5).Uint8Array;t.exports=r},function(t,e,n){var r=n(56),i=n(86),a=n(57);t.exports=function(t){return"function"!=typeof t.constructor||a(t)?{}:r(i(t))}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(16),i=n(86),a=n(6),o="[object Object]",c=Function.prototype,u=Object.prototype,f=c.toString,s=u.hasOwnProperty,l=f.call(Object);t.exports=function(t){if(!a(t)||r(t)!=o)return!1;var e=i(t);if(null===e)return!0;var n=s.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&f.call(n)==l}},function(t,e){t.exports=function(t,e){if("__proto__"!=e)return t[e]}},function(t,e,n){var r=n(279),i=n(58),a=n(2),o=n(59),c=n(62),u=n(88),f=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=a(t),s=!n&&i(t),l=!n&&!s&&o(t),d=!n&&!s&&!l&&u(t),h=n||s||l||d,b=h?r(t.length,String):[],p=b.length;for(var v in t)!e&&!f.call(t,v)||h&&("length"==v||l&&("offset"==v||"parent"==v)||d&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||c(v,p))||b.push(v);return b}},function(t,e,n){var r=n(78),i=n(63);t.exports=function(t){return r(function(e,n){var r=-1,a=n.length,o=a>1?n[a-1]:void 0,c=a>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(a--,o):void 0,c&&i(n[0],n[1],c)&&(o=a<3?void 0:o,a=1),e=Object(e);++rd))return!1;var b=s.get(t);if(b&&s.get(e))return b==e;var p=-1,v=!0,y=n&c?new r:void 0;for(s.set(t,e),s.set(e,t);++p1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):i(this.node(),t)}},function(t,e,n){"use strict";e.b=function(t,e){var n=t.document.documentElement,a=Object(r.select)(t).on("dragstart.drag",null);e&&(a.on("click.drag",i.a,!0),setTimeout(function(){a.on("click.drag",null)},0));"onselectstart"in n?a.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)};var r=n(3),i=n(166);e.a=function(t){var e=t.document.documentElement,n=Object(r.select)(t).on("dragstart.drag",i.a,!0);"onselectstart"in e?n.on("selectstart.drag",i.a,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}},function(t,e,n){"use strict";e.b=function(){r.event.stopImmediatePropagation()};var r=n(3);e.a=function(){r.event.preventDefault(),r.event.stopImmediatePropagation()}},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return i});var r=Math.PI/180,i=180/Math.PI},function(t,e,n){"use strict";n.d(e,"b",function(){return u});var r=n(9),i=n(102),a=n(169),o=n(43);function c(t){return function(e){var n,i,a=e.length,o=new Array(a),c=new Array(a),u=new Array(a);for(n=0;nu&&(c=e.slice(u,c),s[f]?s[f]+=c:s[++f]=c),(n=n[0])===(o=o[0])?s[f]?s[f]+=o:s[++f]=o:(s[++f]=null,l.push({i:f,x:Object(r.a)(n,o)})),u=a.lastIndex;return ur.d&&n.state=o;--c)d.point(y[c],_[c]);d.lineEnd(),d.areaEnd()}v&&(y[a]=+t(h,a,i),_[a]=+n(h,a,i),d.point(e?+e(h,a,i):y[a],u?+u(h,a,i):_[a]))}if(b)return d=null,b+""||null}function b(){return Object(o.a)().defined(f).curve(l).context(s)}return h.x=function(n){return arguments.length?(t="function"==typeof n?n:Object(i.a)(+n),e=null,h):t},h.x0=function(e){return arguments.length?(t="function"==typeof e?e:Object(i.a)(+e),h):t},h.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Object(i.a)(+t),h):e},h.y=function(t){return arguments.length?(n="function"==typeof t?t:Object(i.a)(+t),u=null,h):n},h.y0=function(t){return arguments.length?(n="function"==typeof t?t:Object(i.a)(+t),h):n},h.y1=function(t){return arguments.length?(u=null==t?null:"function"==typeof t?t:Object(i.a)(+t),h):u},h.lineX0=h.lineY0=function(){return b().x(t).y(n)},h.lineY1=function(){return b().x(t).y(u)},h.lineX1=function(){return b().x(e).y(n)},h.defined=function(t){return arguments.length?(f="function"==typeof t?t:Object(i.a)(!!t),h):f},h.curve=function(t){return arguments.length?(l=t,null!=s&&(d=l(s)),h):l},h.context=function(t){return arguments.length?(null==t?s=d=null:d=l(s=t),h):s},h}},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),e.b=a;var r=a(n(71).a);function i(t){this._curve=t}function a(t){function e(e){return new i(t(e))}return e._curve=t,e}i.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))}}},function(t,e,n){"use strict";e.b=a;var r=n(184),i=n(108);function a(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(Object(r.b)(t)):e()._curve},t}e.a=function(){return a(Object(i.a)().curve(r.a))}},function(t,e,n){"use strict";e.a=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=Array.prototype.slice},function(t,e,n){"use strict";var r=n(44);e.a={draw:function(t,e){var n=Math.sqrt(e/r.j);t.moveTo(n,0),t.arc(0,0,n,0,r.m)}}},function(t,e,n){"use strict";e.a={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}}},function(t,e,n){"use strict";var r=Math.sqrt(1/3),i=2*r;e.a={draw:function(t,e){var n=Math.sqrt(e/i),a=n*r;t.moveTo(0,-n),t.lineTo(a,0),t.lineTo(0,n),t.lineTo(-a,0),t.closePath()}}},function(t,e,n){"use strict";var r=n(44),i=Math.sin(r.j/10)/Math.sin(7*r.j/10),a=Math.sin(r.m/10)*i,o=-Math.cos(r.m/10)*i;e.a={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),i=a*n,c=o*n;t.moveTo(0,-n),t.lineTo(i,c);for(var u=1;u<5;++u){var f=r.m*u/5,s=Math.cos(f),l=Math.sin(f);t.lineTo(l*n,-s*n),t.lineTo(s*i-l*c,l*i+s*c)}t.closePath()}}},function(t,e,n){"use strict";e.a={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}}},function(t,e,n){"use strict";var r=Math.sqrt(3);e.a={draw:function(t,e){var n=-Math.sqrt(e/(3*r));t.moveTo(0,2*n),t.lineTo(-r*n,-n),t.lineTo(r*n,-n),t.closePath()}}},function(t,e,n){"use strict";var r=-.5,i=Math.sqrt(3)/2,a=1/Math.sqrt(12),o=3*(a/2+1);e.a={draw:function(t,e){var n=Math.sqrt(e/o),c=n/2,u=n*a,f=c,s=n*a+n,l=-f,d=s;t.moveTo(c,u),t.lineTo(f,s),t.lineTo(l,d),t.lineTo(r*c-i*u,i*c+r*u),t.lineTo(r*f-i*s,i*f+r*s),t.lineTo(r*l-i*d,i*l+r*d),t.lineTo(r*c+i*u,r*u-i*c),t.lineTo(r*f+i*s,r*s-i*f),t.lineTo(r*l+i*d,r*d-i*l),t.closePath()}}},function(t,e,n){"use strict";e.a=a;var r=n(72),i=n(74);function a(t,e){this._context=t,this._k=(1-e)/6}a.prototype={areaStart:r.a,areaEnd:r.a,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:Object(i.c)(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}},e.b=function t(e){function n(t){return new a(t,e)}return n.tension=function(e){return t(+e)},n}(0)},function(t,e,n){"use strict";e.a=i;var r=n(74);function i(t,e){this._context=t,this._k=(1-e)/6}i.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:Object(r.c)(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}},e.b=function t(e){function n(t){return new i(t,e)}return n.tension=function(e){return t(+e)},n}(0)},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return c});var r=n(36),i=n(198),a=Object(i.a)(r.a),o=a.right,c=a.left;e.c=o},function(t,e,n){"use strict";var r=n(36);e.a=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return Object(r.a)(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}},function(t,e,n){"use strict";function r(t,e){return[t,e]}e.b=r,e.a=function(t,e){null==e&&(e=r);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n1)return f/(o-1)}},function(t,e,n){"use strict";e.a=function(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o=n)for(r=i=n;++on&&(r=n),i=n)for(r=i=n;++on&&(r=n),i=r?c*=10:u>=i?c*=5:u>=a&&(c*=2);return e=0?(u>=r?10:u>=i?5:u>=a?2:1)*Math.pow(10,c):-Math.pow(10,-c)/(u>=r?10:u>=i?5:u>=a?2:1)}e.a=function(t,e,n){var r,i,a,c,u=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e0)for(t=Math.ceil(t/c),e=Math.floor(e/c),a=new Array(i=Math.ceil(e-t+1));++u=n)for(r=n;++an&&(r=n)}else for(;++a=n)for(r=n;++an&&(r=n);return r}},function(t,e,n){"use strict";var r=n(207);function i(t){return t.length}e.a=function(t){if(!(o=t.length))return[];for(var e=-1,n=Object(r.a)(t,i),a=new Array(n);++e3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Math.E;r&&t*e<=0&&console.warn("As log(0) = -∞, a log scale domain must be\n strictly-positive or strictly-negative. logscale ignored");return(r&&t*e>0?(0,f.scaleLog)().base(i):(0,f.scaleLinear)()).domain([t,e]).range([0,n]).clamp(!0)};var r=s(n(475)),i=s(n(506)),a=s(n(509)),o=s(n(511)),c=s(n(514)),u=s(n(518)),f=n(225);function s(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){var r=n(28),i=n(212),a=i?function(t,e){return i.set(t,e),t}:r;t.exports=a},function(t,e,n){var r=n(151),i=r&&new r;t.exports=i},function(t,e,n){var r=n(214),i=n(215),a=n(482),o=n(75),c=n(216),u=n(222),f=n(494),s=n(118),l=n(5),d=1,h=2,b=8,p=16,v=128,y=512;t.exports=function t(e,n,_,g,m,x,w,j,O,M){var k=n&v,A=n&d,T=n&h,S=n&(b|p),P=n&y,R=T?void 0:o(e);return function d(){for(var h=arguments.length,b=Array(h),p=h;p--;)b[p]=arguments[p];if(S)var v=u(d),y=a(b,v);if(g&&(b=r(b,g,m,S)),x&&(b=i(b,x,w,S)),h-=y,S&&h1&&b.reverse(),k&&O(c=t.charCodeAt(n))||c>57){h=(46===c?l+t.slice(n+1):t.slice(n))+h,t=t.slice(0,n);break}}v&&!b&&(t=e(t,1/0));var O=f.length+t.length+h.length,M=O>1)+f+t+h+M.slice(O);break;default:t=M+f+t+h}return d(t)}return y=null==y?_?6:12:/[gprs]/.test(_)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),j.toString=function(){return t+""},j}return{format:b,formatPrefix:function(t,e){var n=b(((t=Object(o.a)(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3))),a=Math.pow(10,-i),c=s[8+i/3];return function(t){return n(a*t)+c}}}}},function(t,e,n){"use strict";e.a=a;var r=n(232),i=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function a(t){return new o(t)}function o(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e,n=e[1]||" ",a=e[2]||">",o=e[3]||"-",c=e[4]||"",u=!!e[5],f=e[6]&&+e[6],s=!!e[7],l=e[8]&&+e[8].slice(1),d=e[9]||"";"n"===d?(s=!0,d="g"):r.a[d]||(d=""),(u||"0"===n&&"="===a)&&(u=!0,n="0",a="="),this.fill=n,this.align=a,this.sign=o,this.symbol=c,this.zero=u,this.width=f,this.comma=s,this.precision=l,this.type=d}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type}},function(t,e,n){"use strict";var r=n(531),i=n(233),a=n(532);e.a={"":r.a,"%":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.round(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 Object(a.a)(100*t,e)},r:a.a,s:i.a,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}}},function(t,e,n){"use strict";n.d(e,"b",function(){return r});var r,i=n(122);e.a=function(t,e){var n=Object(i.a)(t,e);if(!n)return t+"";var a=n[0],o=n[1],c=o-(r=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,u=a.length;return c===u?a:c>u?a+new Array(c-u+1).join("0"):c>0?a.slice(0,c)+"."+a.slice(c):"0."+new Array(1-c).join("0")+Object(i.a)(t,Math.max(0,e+c-1))[0]}},function(t,e,n){"use strict";e.a=function(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],o=t[i];return o=12)]},Q:pt,s:vt,S:F,u:Y,U:q,V:G,w:V,W:X,x:null,X:null,y:H,Y:$,Z:Z,"%":bt},St={a:function(t){return l[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return d[t.getUTCMonth()]},c:null,d:K,e:K,f:nt,H:J,I:Q,j:tt,L:et,m:rt,M:it,p:function(t){return f[+(t.getUTCHours()>=12)]},Q:pt,s:vt,S:at,u:ot,U:ct,V:ut,w:ft,W:st,x:null,X:null,y:lt,Y:dt,Z:ht,"%":bt},Pt={a:function(t,e,n){var r=wt.exec(e.slice(n));return r?(t.w=jt[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=mt.exec(e.slice(n));return r?(t.w=xt[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=kt.exec(e.slice(n));return r?(t.m=At[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=Ot.exec(e.slice(n));return r?(t.m=Mt[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return Ct(t,e,n,r)},d:O,e:O,f:P,H:k,I:k,j:M,L:S,m:j,M:A,p:function(t,e,n){var r=_t.exec(e.slice(n));return r?(t.p=gt[r[0].toLowerCase()],n+r[0].length):-1},Q:E,s:C,S:T,u:v,U:y,V:_,w:p,W:g,x:function(t,e,r){return Ct(t,n,e,r)},X:function(t,e,n){return Ct(t,u,e,n)},y:x,Y:m,Z:w,"%":R};function Rt(t,e){return function(n){var r,i,a,o=[],u=-1,f=0,s=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in u||(u.w=1),"Z"in u?(i=a(o(u.y)),c=i.getUTCDay(),i=c>4||0===c?r.p.ceil(i):Object(r.p)(i),i=r.l.offset(i,7*(u.V-1)),u.y=i.getUTCFullYear(),u.m=i.getUTCMonth(),u.d=i.getUTCDate()+(u.w+6)%7):(i=e(o(u.y)),c=i.getDay(),i=c>4||0===c?r.e.ceil(i):Object(r.e)(i),i=r.a.offset(i,7*(u.V-1)),u.y=i.getFullYear(),u.m=i.getMonth(),u.d=i.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),c="Z"in u?a(o(u.y)).getUTCDay():e(o(u.y)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(c+5)%7:u.w+7*u.U-(c+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,a(u)):e(u)}}function Ct(t,e,n,r){for(var i,a,o=0,u=e.length,f=n.length;o=f)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Pt[i in c?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return Tt.x=Rt(n,Tt),Tt.X=Rt(u,Tt),Tt.c=Rt(e,Tt),St.x=Rt(n,St),St.X=Rt(u,St),St.c=Rt(e,St),{format:function(t){var e=Rt(t+="",Tt);return e.toString=function(){return t},e},parse:function(t){var e=Et(t+="",i);return e.toString=function(){return t},e},utcFormat:function(t){var e=Rt(t+="",St);return e.toString=function(){return t},e},utcParse:function(t){var e=Et(t,a);return e.toString=function(){return t},e}}};var r=n(123);function i(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 a(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 o(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}var c={"-":"",_:" ",0:"0"},u=/^\s*\d+/,f=/^%/,s=/[\\^$*+?|[\]().{}]/g;function l(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function w(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function j(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function O(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function M(t,e,n){var r=u.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function k(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function A(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function T(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function S(t,e,n){var r=u.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function P(t,e,n){var r=u.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function R(t,e,n){var r=f.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function E(t,e,n){var r=u.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function C(t,e,n){var r=u.exec(e.slice(n));return r?(t.Q=1e3*+r[0],n+r[0].length):-1}function I(t,e){return l(t.getDate(),e,2)}function N(t,e){return l(t.getHours(),e,2)}function D(t,e){return l(t.getHours()%12||12,e,2)}function z(t,e){return l(1+r.a.count(Object(r.k)(t),t),e,3)}function B(t,e){return l(t.getMilliseconds(),e,3)}function U(t,e){return B(t,e)+"000"}function L(t,e){return l(t.getMonth()+1,e,2)}function W(t,e){return l(t.getMinutes(),e,2)}function F(t,e){return l(t.getSeconds(),e,2)}function Y(t){var e=t.getDay();return 0===e?7:e}function q(t,e){return l(r.h.count(Object(r.k)(t),t),e,2)}function G(t,e){var n=t.getDay();return t=n>=4||0===n?Object(r.i)(t):r.i.ceil(t),l(r.i.count(Object(r.k)(t),t)+(4===Object(r.k)(t).getDay()),e,2)}function V(t){return t.getDay()}function X(t,e){return l(r.e.count(Object(r.k)(t),t),e,2)}function H(t,e){return l(t.getFullYear()%100,e,2)}function $(t,e){return l(t.getFullYear()%1e4,e,4)}function Z(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+l(e/60|0,"0",2)+l(e%60,"0",2)}function K(t,e){return l(t.getUTCDate(),e,2)}function J(t,e){return l(t.getUTCHours(),e,2)}function Q(t,e){return l(t.getUTCHours()%12||12,e,2)}function tt(t,e){return l(1+r.l.count(Object(r.v)(t),t),e,3)}function et(t,e){return l(t.getUTCMilliseconds(),e,3)}function nt(t,e){return et(t,e)+"000"}function rt(t,e){return l(t.getUTCMonth()+1,e,2)}function it(t,e){return l(t.getUTCMinutes(),e,2)}function at(t,e){return l(t.getUTCSeconds(),e,2)}function ot(t){var e=t.getUTCDay();return 0===e?7:e}function ct(t,e){return l(r.s.count(Object(r.v)(t),t),e,2)}function ut(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Object(r.t)(t):r.t.ceil(t),l(r.t.count(Object(r.v)(t),t)+(4===Object(r.v)(t).getUTCDay()),e,2)}function ft(t){return t.getUTCDay()}function st(t,e){return l(r.p.count(Object(r.v)(t),t),e,2)}function lt(t,e){return l(t.getUTCFullYear()%100,e,2)}function dt(t,e){return l(t.getUTCFullYear()%1e4,e,4)}function ht(){return"+0000"}function bt(){return"%"}function pt(t){return+t}function vt(t){return Math.floor(+t/1e3)}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(124),i="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||Object(r.b)(i)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"b",function(){return o}),n.d(e,"e",function(){return c}),n.d(e,"c",function(){return u});var r=Math.cos,i=Math.sin,a=Math.PI,o=a/2,c=2*a,u=Math.max},function(t,e,n){"use strict";var r=function(){function t(t,e){for(var n=0;n-1}},function(t,e,n){var r=n(53);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(52);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(52),i=n(81),a=n(82),o=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var c=n.__data__;if(!i||c.length=O&&(O=j+1);!(w=m[O])&&++O<_;);x._next=w||null}}return(s=new r.a(s,i))._enter=l,s._exit=d,s}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";var r=n(163),i=n(11);e.a=function(){return new i.a(this._exit||this._groups.map(r.a),this._parents)}},function(t,e,n){"use strict";var r=n(11);e.a=function(t){for(var e=this._groups,n=t._groups,i=e.length,a=n.length,o=Math.min(i,a),c=new Array(i),u=0;u=0;)(r=i[a])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this}},function(t,e,n){"use strict";var r=n(11);function i(t,e){return te?1:t>=e?0:NaN}e.a=function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=i);for(var n=this._groups,a=n.length,o=new Array(a),c=0;c1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]}},function(t,e,n){"use strict";function r(t){return t.trim().split(/^|\s+/)}function i(t){return t.classList||new a(t)}function a(t){this._node=t,this._names=r(t.getAttribute("class")||"")}function o(t,e){for(var n=i(t),r=-1,a=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}},e.a=function(t,e){var n=r(t+"");if(arguments.length<2){for(var a=i(this.node()),u=-1,f=n.length;++ur?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}e.a=function(){var t,e,n=d,_=h,g=y,m=p,x=v,w=[0,1/0],j=[[-1/0,-1/0],[1/0,1/0]],O=250,M=a.j,k=[],A=Object(r.dispatch)("start","zoom","end"),T=500,S=150,P=0;function R(t){t.property("__zoom",b).on("wheel.zoom",B).on("mousedown.zoom",U).on("dblclick.zoom",L).filter(x).on("touchstart.zoom",W).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function E(t,e){return(e=Math.max(w[0],Math.min(w[1],e)))===t.k?t:new s.a(e,t.x,t.y)}function C(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new s.a(t.k,r,i)}function I(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function N(t,e,n){t.on("start.zoom",function(){D(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).end()}).tween("zoom",function(){var t=arguments,r=D(this,t),i=_.apply(this,t),a=n||I(i),o=Math.max(i[1][0]-i[0][0],i[1][1]-i[0][1]),c=this.__zoom,u="function"==typeof e?e.apply(this,t):e,f=M(c.invert(a).concat(o/c.k),u.invert(a).concat(o/u.k));return function(t){if(1===t)t=u;else{var e=f(t),n=o/e[2];t=new s.a(n,a[0]-e[0]*n,a[1]-e[1]*n)}r.zoom(null,t)}})}function D(t,e){for(var n,r=0,i=k.length;rP}t.zoom("mouse",g(C(t.that.__zoom,t.mouse[0]=Object(o.mouse)(t.that),t.mouse[1]),t.extent,j))},!0).on("mouseup.zoom",function(){r.on("mousemove.zoom mouseup.zoom",null),Object(i.b)(o.event.view,t.moved),Object(l.a)(),t.end()},!0),a=Object(o.mouse)(this),u=o.event.clientX,f=o.event.clientY;Object(i.a)(o.event.view),Object(l.b)(),t.mouse=[a,this.__zoom.invert(a)],Object(c.interrupt)(this),t.start()}}function L(){if(n.apply(this,arguments)){var t=this.__zoom,e=Object(o.mouse)(this),r=t.invert(e),i=t.k*(o.event.shiftKey?.5:2),a=g(C(E(t,i),e,r),_.apply(this,arguments),j);Object(l.a)(),O>0?Object(o.select)(this).transition().duration(O).call(N,a,e):Object(o.select)(this).call(R.transform,a)}}function W(){if(n.apply(this,arguments)){var e,r,i,a,u=D(this,arguments),f=o.event.changedTouches,s=f.length;for(Object(l.b)(),r=0;r=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),u=-1,f=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u0)for(var n,r,i=new Array(n),a=0;ad?Math.pow(t,1/3):t/l+f}function y(t){return t>s?t*t*t:l*(t-f)}function _(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function g(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function m(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof x)return new x(t.h,t.c,t.l,t.opacity);t instanceof p||(t=h(t));var e=Math.atan2(t.b,t.a)*a.b;return new x(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new x(t,e,n,null==r?1:r)}function x(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}Object(r.a)(p,b,Object(r.b)(i.a,{brighter:function(t){return new p(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new p(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return t=c*y(t),e=o*y(e),n=u*y(n),new i.b(_(3.2404542*e-1.5371385*t-.4985314*n),_(-.969266*e+1.8760108*t+.041556*n),_(.0556434*e-.2040259*t+1.0572252*n),this.opacity)}})),Object(r.a)(x,m,Object(r.b)(i.a,{brighter:function(t){return new x(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new x(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return h(this).rgb()}}))},function(t,e,n){"use strict";e.a=b;var r=n(101),i=n(100),a=n(167),o=-.14861,c=1.78277,u=-.29227,f=-.90649,s=1.97294,l=s*f,d=s*c,h=c*u-f*o;function b(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof p)return new p(t.h,t.s,t.l,t.opacity);t instanceof i.b||(t=Object(i.h)(t));var e=t.r/255,n=t.g/255,r=t.b/255,o=(h*r+l*e-d*n)/(h+l-d),c=r-o,b=(s*(n-o)-u*c)/f,v=Math.sqrt(b*b+c*c)/(s*o*(1-o)),y=v?Math.atan2(b,c)*a.b-120:NaN;return new p(y<0?y+360:y,v,o,t.opacity)}(t):new p(t,e,n,null==r?1:r)}function p(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Object(r.a)(p,b,Object(r.b)(i.a,{brighter:function(t){return t=null==t?i.c:Math.pow(i.c,t),new p(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?i.d:Math.pow(i.d,t),new p(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*a.a,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),l=Math.sin(t);return new i.b(255*(e+n*(o*r+c*l)),255*(e+n*(u*r+f*l)),255*(e+n*(s*r)),this.opacity)}}))},function(t,e,n){"use strict";e.a=function(t,e){return e-=t=+t,function(n){return Math.round(t+e*n)}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"b",function(){return c});var r=n(69),i=n(359);function a(t,e,n,i){function a(t){return t.length?t.pop()+" ":""}return function(o,c){var u=[],f=[];return o=t(o),c=t(c),function(t,i,a,o,c,u){if(t!==a||i!==o){var f=c.push("translate(",null,e,null,n);u.push({i:f-4,x:Object(r.a)(t,a)},{i:f-2,x:Object(r.a)(i,o)})}else(a||o)&&c.push("translate("+a+e+o+n)}(o.translateX,o.translateY,c.translateX,c.translateY,u,f),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(a(n)+"rotate(",null,i)-2,x:Object(r.a)(t,e)})):e&&n.push(a(n)+"rotate("+e+i)}(o.rotate,c.rotate,u,f),function(t,e,n,o){t!==e?o.push({i:n.push(a(n)+"skewX(",null,i)-2,x:Object(r.a)(t,e)}):e&&n.push(a(n)+"skewX("+e+i)}(o.skewX,c.skewX,u,f),function(t,e,n,i,o,c){if(t!==n||e!==i){var u=o.push(a(o)+"scale(",null,",",null,")");c.push({i:u-4,x:Object(r.a)(t,n)},{i:u-2,x:Object(r.a)(e,i)})}else 1===n&&1===i||o.push(a(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,c.scaleX,c.scaleY,u,f),o=c=null,function(t){for(var e,n=-1,r=f.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?r.g:r.h;return function(){var r=o(this,t),c=r.on;c!==i&&(a=(i=c).copy()).on(e,n),r.on=a}}(n,t,e))}},function(t,e,n){"use strict";e.a=function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t}},function(t,e,n){"use strict";var r=n(3),i=n(19),a=n(12);e.a=function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Object(r.selector)(t));for(var o=this._groups,c=o.length,u=new Array(c),f=0;fi.c&&n.name===e)return new r.a([[t]],a,e,+o);return null}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";e.a=function(t,e,n){this.target=t,this.type=e,this.transform=n}},function(t,e,n){"use strict";e.b=function(){r.event.stopImmediatePropagation()};var r=n(3);e.a=function(){r.event.preventDefault(),r.event.stopImmediatePropagation()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],n=arguments[2],o=0===t.length,c=n.svg.attr("width",n.conf.width).attr("height",n.conf.height);e&&(0,r.default)(n.tracks,function(t,e){c.select("."+e).remove()});var u=c.select(".all");u.empty()&&(u=c.append("g").attr("class","all").attr("transform","translate(\n "+parseInt(n.conf.width/2)+",\n "+parseInt(n.conf.height/2)+"\n )"));(0,r.default)(n.tracks,function(e,r){(o||r in t)&&e.render(n,u,r)}),(o||"layout"in t)&&(0,a.default)(u,n);var f=c.selectAll(".all > g").remove(),s=(0,i.default)(f._groups[0],function(t){return t.getAttribute("z-index")});return c.select(".all").selectAll("g").data(s).enter().append(function(t){return t}),n};var r=o(n(32)),i=o(n(106)),a=o(n(426));function o(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){var r=n(29),i=n(58),a=n(2),o=r?r.isConcatSpreadable:void 0;t.exports=function(t){return a(t)||i(t)||!!(o&&t&&t[o])}},function(t,e,n){var r=n(40),i=n(33),a=n(158),o=n(423),c=n(60),u=n(424),f=n(28);t.exports=function(t,e,n){var s=-1;e=r(e.length?e:[f],c(i));var l=a(t,function(t,n,i){return{criteria:r(e,function(e){return e(t)}),index:++s,value:t}});return o(l,function(t,e){return u(t,e,n)})}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(425);t.exports=function(t,e,n){for(var i=-1,a=t.criteria,o=e.criteria,c=a.length,u=n.length;++i=u?f:f*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(34);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,a=t==t,o=r(t),c=void 0!==e,u=null===e,f=e==e,s=r(e);if(!u&&!s&&!o&&t>e||o&&c&&f&&!u&&!s||i&&c&&f||!n&&f||!a)return 1;if(!i&&!o&&!s&&tMath.PI?"rotate(180)translate(-16)":null}).style("text-anchor",function(t){return t.angle>Math.PI?"end":null}).style("font-size",t.ticks.labelSize+"px").style("fill",t.ticks.labelColor).text(function(t){return t.label})}(n,o,e)};var r=n(13),i=n(10),a=n(3)},function(t,e,n){"use strict";var r=n(35),i=n(25),a=n(44);function o(t){return t.innerRadius}function c(t){return t.outerRadius}function u(t){return t.startAngle}function f(t){return t.endAngle}function s(t){return t&&t.padAngle}function l(t,e,n,r,i,o,c){var u=t-n,f=e-r,s=(c?o:-o)/Object(a.l)(u*u+f*f),l=s*f,d=-s*u,h=t+l,b=e+d,p=n+l,v=r+d,y=(h+p)/2,_=(b+v)/2,g=p-h,m=v-b,x=g*g+m*m,w=i-o,j=h*v-p*b,O=(m<0?-1:1)*Object(a.l)(Object(a.h)(0,w*w*x-j*j)),M=(j*m-g*O)/x,k=(-j*g-m*O)/x,A=(j*m+g*O)/x,T=(-j*g+m*O)/x,S=M-y,P=k-_,R=A-y,E=T-_;return S*S+P*P>R*R+E*E&&(M=A,k=T),{cx:M,cy:k,x01:-l,y01:-d,x11:M*(i/w-1),y11:k*(i/w-1)}}e.a=function(){var t=o,e=c,n=Object(i.a)(0),d=null,h=u,b=f,p=s,v=null;function y(){var i,o,c=+t.apply(this,arguments),u=+e.apply(this,arguments),f=h.apply(this,arguments)-a.g,s=b.apply(this,arguments)-a.g,y=Object(a.a)(s-f),_=s>f;if(v||(v=i=Object(r.a)()),ua.f)if(y>a.m-a.f)v.moveTo(u*Object(a.e)(f),u*Object(a.k)(f)),v.arc(0,0,u,f,s,!_),c>a.f&&(v.moveTo(c*Object(a.e)(s),c*Object(a.k)(s)),v.arc(0,0,c,s,f,_));else{var g,m,x=f,w=s,j=f,O=s,M=y,k=y,A=p.apply(this,arguments)/2,T=A>a.f&&(d?+d.apply(this,arguments):Object(a.l)(c*c+u*u)),S=Object(a.i)(Object(a.a)(u-c)/2,+n.apply(this,arguments)),P=S,R=S;if(T>a.f){var E=Object(a.c)(T/c*Object(a.k)(A)),C=Object(a.c)(T/u*Object(a.k)(A));(M-=2*E)>a.f?(j+=E*=_?1:-1,O-=E):(M=0,j=O=(f+s)/2),(k-=2*C)>a.f?(x+=C*=_?1:-1,w-=C):(k=0,x=w=(f+s)/2)}var I=u*Object(a.e)(x),N=u*Object(a.k)(x),D=c*Object(a.e)(O),z=c*Object(a.k)(O);if(S>a.f){var B=u*Object(a.e)(w),U=u*Object(a.k)(w),L=c*Object(a.e)(j),W=c*Object(a.k)(j);if(ya.f?function(t,e,n,r,i,a,o,c){var u=n-t,f=r-e,s=o-i,l=c-a,d=(s*(e-a)-l*(t-i))/(l*u-s*f);return[t+d*u,e+d*f]}(I,N,L,W,B,U,D,z):[D,z],Y=I-F[0],q=N-F[1],G=B-F[0],V=U-F[1],X=1/Object(a.k)(Object(a.b)((Y*G+q*V)/(Object(a.l)(Y*Y+q*q)*Object(a.l)(G*G+V*V)))/2),H=Object(a.l)(F[0]*F[0]+F[1]*F[1]);P=Object(a.i)(S,(c-H)/(X-1)),R=Object(a.i)(S,(u-H)/(X+1))}}k>a.f?R>a.f?(g=l(L,W,I,N,u,R,_),m=l(B,U,D,z,u,R,_),v.moveTo(g.cx+g.x01,g.cy+g.y01),Ra.f&&M>a.f?P>a.f?(g=l(D,z,B,U,c,-P,_),m=l(I,N,L,W,c,-P,_),v.lineTo(g.cx+g.x01,g.cy+g.y01),P1e-6)if(Math.abs(l*u-f*s)>1e-6&&a){var h=n-o,b=i-c,p=u*u+f*f,v=h*h+b*b,y=Math.sqrt(p),_=Math.sqrt(d),g=a*Math.tan((r-Math.acos((p+d-v)/(2*y*_)))/2),m=g/_,x=g/y;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*s)+","+(e+m*l)),this._+="A"+a+","+a+",0,0,"+ +(l*h>s*b)+","+(this._x1=t+x*u)+","+(this._y1=e+x*f)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,o,c,u){t=+t,e=+e;var f=(n=+n)*Math.cos(o),s=n*Math.sin(o),l=t+f,d=e+s,h=1^u,b=u?o-c:c-o;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+d:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-d)>1e-6)&&(this._+="L"+l+","+d),n&&(b<0&&(b=b%i+i),b>a?this._+="A"+n+","+n+",0,1,"+h+","+(t-f)+","+(e-s)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=d):b>1e-6&&(this._+="A"+n+","+n+",0,"+ +(b>=r)+","+h+","+(this._x1=t+n*Math.cos(c))+","+(this._y1=e+n*Math.sin(c))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},e.a=c},function(t,e,n){"use strict";var r=n(25),i=n(430),a=n(431),o=n(44);e.a=function(){var t=a.a,e=i.a,n=null,c=Object(r.a)(0),u=Object(r.a)(o.m),f=Object(r.a)(0);function s(r){var i,a,s,l,d,h=r.length,b=0,p=new Array(h),v=new Array(h),y=+c.apply(this,arguments),_=Math.min(o.m,Math.max(-o.m,u.apply(this,arguments)-y)),g=Math.min(Math.abs(_)/h,f.apply(this,arguments)),m=g*(_<0?-1:1);for(i=0;i0&&(b+=d);for(null!=e?p.sort(function(t,n){return e(v[t],v[n])}):null!=n&&p.sort(function(t,e){return n(r[t],r[e])}),i=0,s=b?(_-h*m)/b:0;i0?d*s:0)+m,v[a]={data:r[a],index:i,value:d,startAngle:y,endAngle:l,padAngle:g};return v}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:Object(r.a)(+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?(c="function"==typeof t?t:Object(r.a)(+t),s):c},s.endAngle=function(t){return arguments.length?(u="function"==typeof t?t:Object(r.a)(+t),s):u},s.padAngle=function(t){return arguments.length?(f="function"==typeof t?t:Object(r.a)(+t),s):f},s}},function(t,e,n){"use strict";e.a=function(t,e){return et?1:e>=t?0:NaN}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";var r=n(184),i=n(183),a=n(185);e.a=function(){var t=Object(i.a)().curve(r.a),e=t.curve,n=t.lineX0,o=t.lineX1,c=t.lineY0,u=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 Object(a.b)(n())},delete t.lineX0,t.lineEndAngle=function(){return Object(a.b)(o())},delete t.lineX1,t.lineInnerRadius=function(){return Object(a.b)(c())},delete t.lineY0,t.lineOuterRadius=function(){return Object(a.b)(u())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Object(r.b)(t)):e()._curve},t}},function(t,e,n){"use strict";e.a=function(){return s(l)},e.c=function(){return s(d)},e.b=function(){var t=s(h);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t};var r=n(35),i=n(187),a=n(25),o=n(109),c=n(186);function u(t){return t.source}function f(t){return t.target}function s(t){var e=u,n=f,c=o.a,s=o.b,l=null;function d(){var a,o=i.a.call(arguments),u=e.apply(this,o),f=n.apply(this,o);if(l||(l=a=Object(r.a)()),t(l,+c.apply(this,(o[0]=u,o)),+s.apply(this,o),+c.apply(this,(o[0]=f,o)),+s.apply(this,o)),a)return l=null,a+""||null}return d.source=function(t){return arguments.length?(e=t,d):e},d.target=function(t){return arguments.length?(n=t,d):n},d.x=function(t){return arguments.length?(c="function"==typeof t?t:Object(a.a)(+t),d):c},d.y=function(t){return arguments.length?(s="function"==typeof t?t:Object(a.a)(+t),d):s},d.context=function(t){return arguments.length?(l=null==t?null:t,d):l},d}function l(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function d(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function h(t,e,n,r,i){var a=Object(c.a)(e,n),o=Object(c.a)(e,n=(n+i)/2),u=Object(c.a)(r,n),f=Object(c.a)(r,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],u[0],u[1],f[0],f[1])}},function(t,e,n){"use strict";n.d(e,"b",function(){return d});var r=n(35),i=n(188),a=n(189),o=n(190),c=n(191),u=n(192),f=n(193),s=n(194),l=n(25),d=[i.a,a.a,o.a,u.a,c.a,f.a,s.a];e.a=function(){var t=Object(l.a)(i.a),e=Object(l.a)(64),n=null;function a(){var i;if(n||(n=i=Object(r.a)()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(e){return arguments.length?(t="function"==typeof e?e:Object(l.a)(e),a):t},a.size=function(t){return arguments.length?(e="function"==typeof t?t:Object(l.a)(+t),a):e},a.context=function(t){return arguments.length?(n=null==t?null:t,a):n},a}},function(t,e,n){"use strict";var r=n(72),i=n(73);function a(t){this._context=t}a.prototype={areaStart:r.a,areaEnd:r.a,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:Object(i.c)(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},e.a=function(t){return new a(t)}},function(t,e,n){"use strict";var r=n(73);function i(t){this._context=t}i.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 n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Object(r.c)(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},e.a=function(t){return new i(t)}},function(t,e,n){"use strict";var r=n(73);function i(t,e){this._basis=new r.a(t),this._beta=e}i.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],o=t[n]-i,c=e[n]-a,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*o),this._beta*e[u]+(1-this._beta)*(a+r*c));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}},e.a=function t(e){function n(t){return 1===e?new r.a(t):new i(t,e)}return n.beta=function(e){return t(+e)},n}(.85)},function(t,e,n){"use strict";var r=n(195),i=n(72),a=n(110);function o(t,e){this._context=t,this._alpha=e}o.prototype={areaStart:i.a,areaEnd:i.a,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 n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Object(a.b)(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}},e.a=function t(e){function n(t){return e?new o(t,e):new r.a(t,0)}return n.alpha=function(e){return t(+e)},n}(.5)},function(t,e,n){"use strict";var r=n(196),i=n(110);function a(t,e){this._context=t,this._alpha=e}a.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 n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Object(i.b)(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}},e.a=function t(e){function n(t){return e?new a(t,e):new r.a(t,0)}return n.alpha=function(e){return t(+e)},n}(.5)},function(t,e,n){"use strict";var r=n(72);function i(t){this._context=t}i.prototype={areaStart:r.a,areaEnd:r.a,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},e.a=function(t){return new i(t)}},function(t,e,n){"use strict";function r(t){return t<0?-1:1}function i(t,e,n){var i=t._x1-t._x0,a=e-t._x1,o=(t._y1-t._y0)/(i||a<0&&-0),c=(n-t._y1)/(a||i<0&&-0),u=(o*a+c*i)/(i+a);return(r(o)+r(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(u))||0}function a(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function o(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,c=(a-r)/3;t._context.bezierCurveTo(r+c,i+c*e,a-c,o-c*n,a,o)}function c(t){this._context=t}function u(t){this._context=new f(t)}function f(t){this._context=t}e.a=function(t){return new c(t)},e.b=function(t){return new u(t)},c.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:o(this,this._t0,a(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){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,o(this,a(this,n=i(this,t,e)),n);break;default:o(this,this._t0,n=i(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(u.prototype=Object.create(c.prototype)).point=function(t,e){c.prototype.point.call(this,e,t)},f.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}}},function(t,e,n){"use strict";function r(t){this._context=t}function i(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);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[r-1]=(t[r]+i[r-1])/2,e=0;e=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 n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}},e.a=function(t){return new r(t,.5)}},function(t,e,n){"use strict";var r=n(187),i=n(25),a=n(45),o=n(46);function c(t,e){return t[e]}e.a=function(){var t=Object(i.a)([]),e=o.a,n=a.a,u=c;function f(r){var i,a,o=t.apply(this,arguments),c=r.length,f=o.length,s=new Array(f);for(i=0;i0){for(var n,i,a,o=0,c=t[0].length;o1)for(var n,r,i,a,o,c,u=0,f=t[e[0]].length;u=0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=o,r[0]=o+=i):r[0]=a}},function(t,e,n){"use strict";var r=n(45);e.a=function(t,e){if((n=t.length)>0){for(var n,i=0,a=t[e[0]],o=a.length;i0&&(i=(n=t[e[0]]).length)>0){for(var n,i,a,o=0,c=1;ct?1:e>=t?0:NaN}},function(t,e,n){"use strict";var r=n(203),i=n(197),a=n(455),o=n(202),c=n(456),u=n(204),f=n(205),s=n(206);e.a=function(){var t=c.a,e=o.a,n=s.a;function l(r){var a,o,c=r.length,s=new Array(c);for(a=0;ah;)b.pop(),--p;var v,y=new Array(p+1);for(a=0;a<=p;++a)(v=y[a]=[]).x0=a>0?b[a-1]:d,v.x1=a=n)for(r=n;++ar&&(r=n)}else for(;++a=n)for(r=n;++ar&&(r=n);return r}},function(t,e,n){"use strict";var r=n(47);e.a=function(t,e){var n,i=t.length,a=i,o=-1,c=0;if(null==e)for(;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n}},function(t,e,n){"use strict";e.a=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r}},function(t,e,n){"use strict";var r=n(36);e.a=function(t,e){if(n=t.length){var n,i,a=0,o=0,c=t[o];for(null==e&&(e=r.a);++a90?"end":"start",t._rotate=t._angle>90?180:0,t})}).enter().append("g").append("text").text(function(t){return t.value}).attr("transform",function(t){return"\n rotate("+t._angle+")\n translate("+e.innerRadius+", 0)\n rotate("+t._rotate+")\n "}).attr("text-anchor",function(t){return t._anchor});return(0,o.default)(e.style,function(t,e){i.style(e,t)}),i}}]),e}();e.default=l},function(t,e,n){var r=n(470);"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(472)(r,i);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(471)(!1)).push([t.i,"div.circos-tooltip {\r\n position: absolute;\r\n text-align: center;\r\n padding: 5px 10px;\r\n background: #111111;\r\n color: white;\r\n border: 0px;\r\n pointer-events: none;\r\n z-index: 1000;\r\n}\r\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(o=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(a).concat([i]).join("\n")}var o;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i=0&&s.splice(e,1)}function v(t){var e=document.createElement("style");return void 0===t.attrs.type&&(t.attrs.type="text/css"),y(e,t.attrs),b(t,e),e}function y(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function _(t,e){var n,r,i,a;if(e.transform&&t.css){if(!(a=e.transform(t.css)))return function(){};t.css=a}if(e.singleton){var o=f++;n=u||(u=v(e)),r=x.bind(null,n,o,!1),i=x.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",y(e,t.attrs),b(t,e),e}(e),r=function(t,e,n){var r=n.css,i=n.sourceMap,a=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||a)&&(r=l(r));i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),c=t.href;t.href=URL.createObjectURL(o),c&&URL.revokeObjectURL(c)}.bind(null,n,e),i=function(){p(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){p(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return d(n,e),function(t){for(var r=[],i=0;i0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],r={};return(0,i.default)(n,function(n,i){void 0!==n.iteratee?n.iteratee?Object.keys(e).indexOf(i)>-1?((0,a.default)(e[i]),r[i]=e[i]):r[i]=function(){return n.value}:r[i]=Object.keys(e).indexOf(i)>-1?e[i]:n.value:r[i]=t(e[i],n)}),r}(t,(0,r.default)(e));return(0,o.default)(f,function(t,e){return{cmin:null===t.min?e.min:t.min,cmax:null===t.max?e.max:t.max}}(f,n),function(t,e){if(0===t.innerRadius&&0===t.outerRadius){var n=(0,c.smartBorders)(t,e._layout,e.tracks);return{innerRadius:n.in,outerRadius:n.out}}return t.innerRadius<=1&&t.outerRadius<=1?{innerRadius:t.innerRadius*e._layout.conf.innerRadius,outerRadius:t.outerRadius*e._layout.conf.innerRadius}:t.innerRadius<=10&&t.outerRadius<=10?{innerRadius:t.innerRadius*e._layout.conf.outerRadius,outerRadius:t.outerRadius*e._layout.conf.outerRadius}:void 0}(f,u)),f}},function(t,e,n){var r=n(37)("sortBy",n(106));r.placeholder=n(26),t.exports=r},function(t,e,n){var r=n(477),i=n(26),a=Array.prototype.push;function o(t,e){return 2==e?function(e,n){return t(e,n)}:function(e){return t(e)}}function c(t){for(var e=t?t.length:0,n=Array(e);e--;)n[e]=t[e];return n}function u(t,e){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var i=r[0]=e.apply(void 0,r);return t.apply(void 0,r),i}}}t.exports=function t(e,n,f,s){var l="function"==typeof n,d=n===Object(n);if(d&&(s=f,f=n,n=void 0),null==f)throw new TypeError;s||(s={});var h={cap:!("cap"in s)||s.cap,curry:!("curry"in s)||s.curry,fixed:!("fixed"in s)||s.fixed,immutable:!("immutable"in s)||s.immutable,rearg:!("rearg"in s)||s.rearg},b=l?f:i,p="curry"in s&&s.curry,v="fixed"in s&&s.fixed,y="rearg"in s&&s.rearg,_=l?f.runInContext():void 0,g=l?f:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},m=g.ary,x=g.assign,w=g.clone,j=g.curry,O=g.forEach,M=g.isArray,k=g.isError,A=g.isFunction,T=g.isWeakMap,S=g.keys,P=g.rearg,R=g.toInteger,E=g.toPath,C=S(r.aryMethod),I={castArray:function(t){return function(){var e=arguments[0];return M(e)?t(c(e)):t.apply(void 0,arguments)}},iteratee:function(t){return function(){var e=arguments[0],n=arguments[1],r=t(e,n),i=r.length;return h.cap&&"number"==typeof n?(n=n>2?n-2:1,i&&i<=n?r:o(r,n)):r}},mixin:function(t){return function(e){var n=this;if(!A(n))return t(n,Object(e));var r=[];return O(S(e),function(t){A(e[t])&&r.push([t,n.prototype[t]])}),t(n,Object(e)),O(r,function(t){var e=t[1];A(e)?n.prototype[t[0]]=e:delete n.prototype[t[0]]}),n}},nthArg:function(t){return function(e){var n=e<0?1:R(e)+1;return j(t(e),n)}},rearg:function(t){return function(e,n){var r=n?n.length:0;return j(t(e,n),r)}},runInContext:function(n){return function(r){return t(e,n(r),s)}}};function N(t,e){if(h.cap){var n=r.iterateeRearg[t];if(n)return function(t,e){return L(t,function(t){var n=e.length;return function(t,e){return 2==e?function(e,n){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}(P(o(t,n),e),n)})}(e,n);var i=!l&&r.iterateeAry[t];if(i)return function(t,e){return L(t,function(t){return"function"==typeof t?o(t,e):t})}(e,i)}return e}function D(t,e,n){if(h.fixed&&(v||!r.skipFixed[t])){var i=r.methodSpread[t],o=i&&i.start;return void 0===o?m(e,n):function(t,e){return function(){for(var n=arguments.length,r=n-1,i=Array(n);n--;)i[n]=arguments[n];var o=i[e],c=i.slice(0,e);return o&&a.apply(c,o),e!=r&&a.apply(c,i.slice(e+1)),t.apply(this,c)}}(e,o)}return e}function z(t,e,n){return h.rearg&&n>1&&(y||!r.skipRearg[t])?P(e,r.methodRearg[t]||r.aryRearg[n]):e}function B(t,e){for(var n=-1,r=(e=E(e)).length,i=r-1,a=w(Object(t)),o=a;null!=o&&++n1?j(u,f):u,!1}var u,f}),!i}),i||(i=o),i==e&&(i=p?j(i,1):function(){return e.apply(this,arguments)}),i.convert=U(a,e),i.placeholder=e.placeholder=n,i}if(!d)return W(n,f,b);var F=f,Y=[];return O(C,function(t){O(r.aryMethod[t],function(t){var e=F[r.remap[t]||t];e&&Y.push([t,W(t,e,F)])})}),O(S(F),function(t){var e=F[t];if("function"==typeof e){for(var n=Y.length;n--;)if(Y[n][0]==t)return;e.convert=U(t,e),Y.push([t,e])}}),O(Y,function(t){F[t[0]]=t[1]}),F.convert=function(t){return F.runInContext.convert(t)(void 0)},F.placeholder=F,O(S(F),function(t){O(r.realToAlias[t]||[],function(e){F[e]=F[t]})}),F}},function(t,e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,n=e.aliasToReal,r={};for(var i in n){var a=n[i];t.call(r,a)?r[a].push(i):r[a]=[i]}return r}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},function(t,e,n){t.exports={ary:n(479),assign:n(181),clone:n(498),curry:n(499),forEach:n(64),isArray:n(2),isError:n(500),isFunction:n(24),isWeakMap:n(501),iteratee:n(502),keys:n(143),rearg:n(503),toInteger:n(119),toPath:n(505)}},function(t,e,n){var r=n(113),i=128;t.exports=function(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,r(t,i,void 0,void 0,void 0,void 0,e)}},function(t,e,n){var r=n(75),i=n(5),a=1;t.exports=function(t,e,n){var o=e&a,c=r(t);return function e(){return(this&&this!==i&&this instanceof e?c:t).apply(o?n:this,arguments)}}},function(t,e,n){var r=n(50),i=n(75),a=n(213),o=n(216),c=n(222),u=n(118),f=n(5);t.exports=function(t,e,n){var s=i(t);return function i(){for(var l=arguments.length,d=Array(l),h=l,b=c(i);h--;)d[h]=arguments[h];var p=l<3&&d[0]!==b&&d[l-1]!==b?[]:u(d,b);return(l-=p.length)1?"& ":"")+e[i],e=e.join(r>2?", ":" "),t.replace(n,"{\n/* [wrapped with "+e+"] */\n")}},function(t,e,n){var r=n(64),i=n(490),a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];t.exports=function(t,e){return r(a,function(n){var r="_."+n[0];e&n[1]&&!i(t,r)&&t.push(r)}),t.sort()}},function(t,e,n){var r=n(221);t.exports=function(t,e){return!(null==t||!t.length)&&r(t,e,0)>-1}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,a=n+(r?1:-1);r?a--:++a=u.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var c,f,l,d=-1,h=n.length,b=u[i++],p=Object(r.a)(),v=a();++du.length)return n;var i,a=f[r-1];return null!=e&&r>=u.length?i=n.entries():(i=[],n.each(function(e,n){i.push({key:n,values:t(e,r)})})),null!=a?i.sort(function(t,e){return a(t.key,e.key)}):i}(s(t,0,o,c),0)},key:function(t){return u.push(t),n},sortKeys:function(t){return f[u.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}}},function(t,e,n){"use strict";var r=n(120);function i(){}var a=r.a.prototype;function o(t,e){var n=new i;if(t instanceof i)t.each(function(t){n.add(t)});else if(t){var r=-1,a=t.length;if(null==e)for(;++r0&&c>0&&(u+c+1>r&&(c=Math.max(1,r-u)),a.push(n.substring(i-=c,i+c)),!((u+=c+1)>r));)c=t[o=(o+1)%t.length];return a.reverse().join(e)}}},function(t,e,n){"use strict";e.a=function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}},function(t,e,n){"use strict";e.a=function(t,e){t:for(var n,r=(t=t.toPrecision(e)).length,i=1,a=-1;i0&&(a=0)}return a>0?t.slice(0,a)+t.slice(n+1):t}},function(t,e,n){"use strict";var r=n(122);e.a=function(t,e){var n=Object(r.a)(t,e);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")}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";var r=n(77);e.a=function(t){return Math.max(0,-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(77);e.a=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3)))-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(77);e.a=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Object(r.a)(e)-Object(r.a)(t))+1}},function(t,e,n){"use strict";e.a=function t(){var e=Object(c.b)(u,f).domain([1,10]),n=e.domain,a=10,s=d(10),b=l(10);function p(){return s=d(a),b=l(a),n()[0]<0&&(s=h(s),b=h(b)),e}e.base=function(t){return arguments.length?(a=+t,p()):a};e.domain=function(t){return arguments.length?(n(t),p()):n()};e.ticks=function(t){var e,i=n(),o=i[0],c=i[i.length-1];(e=c0){for(;dc)break;v.push(l)}}else for(;d=1;--f)if(!((l=u*f)c)break;v.push(l)}}else v=Object(r.ticks)(d,h,Math.min(h-d,p)).map(b);return e?v.reverse():v};e.tickFormat=function(t,n){if(null==n&&(n=10===a?".0e":","),"function"!=typeof n&&(n=Object(i.a)(n)),t===1/0)return n;null==t&&(t=10);var r=Math.max(1,a*t/e.ticks().length);return function(t){var e=t/b(Math.round(s(t)));return e*a0?a[r-1]:e[0],r=o?[c[o-1],n]:[c[r-1],c[r]]};f.copy=function(){return t().domain([e,n]).range(u)};return Object(a.b)(f)};var r=n(10),i=n(27),a=n(48)},function(t,e,n){"use strict";e.a=function t(){var e=[.5],n=[0,1],a=1;function o(t){if(t<=t)return n[Object(r.bisect)(e,t,0,a)]}o.domain=function(t){return arguments.length?(e=i.b.call(t),a=Math.min(e.length,n.length-1),o):e.slice()};o.range=function(t){return arguments.length?(n=i.b.call(t),a=Math.min(e.length,n.length-1),o):n.slice()};o.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]};o.copy=function(){return t().domain(e).range(n)};return o};var r=n(10),i=n(27)},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(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?Object(r.a)(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):i:null},e.a=i;i.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setTime(Math.floor(t/i.d)*i.d)},function(t,e){t.setTime(+t+e*i.d)},function(t,e){return(e-t)/i.d},function(t){return t.getUTCSeconds()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setTime(Math.floor(t/i.c)*i.c)},function(t,e){t.setTime(+t+e*i.c)},function(t,e){return(e-t)/i.c},function(t){return t.getMinutes()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){var e=t.getTimezoneOffset()*i.c%i.b;e<0&&(e+=i.b),t.setTime(Math.floor((+t-e)/i.b)*i.b+e)},function(t,e){t.setTime(+t+e*i.b)},function(t,e){return(e-t)/i.b},function(t){return t.getHours()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.c)/i.a},function(t){return t.getDate()-1});e.a=a;a.range},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return c}),n.d(e,"c",function(){return s});var r=n(4),i=n(15);function a(t){return Object(r.a)(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-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.c)/i.e})}var o=a(0),c=a(1),u=a(2),f=a(3),s=a(4),l=a(5),d=a(6);o.range,c.range,u.range,f.range,s.range,l.range,d.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(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()});e.a=i;i.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(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()});i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null},e.a=i;i.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*i.c)},function(t,e){return(e-t)/i.c},function(t){return t.getUTCMinutes()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*i.b)},function(t,e){return(e-t)/i.b},function(t){return t.getUTCHours()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/i.a},function(t){return t.getUTCDate()-1});e.a=a;a.range},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return c}),n.d(e,"c",function(){return s});var r=n(4),i=n(15);function a(t){return Object(r.a)(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)/i.e})}var o=a(0),c=a(1),u=a(2),f=a(3),s=a(4),l=a(5),d=a(6);o.range,c.range,u.range,f.range,s.range,l.range,d.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(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()});e.a=i;i.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(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()});i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null},e.a=i;i.range},function(t,e,n){"use strict";var r=n(238),i=n(124);+new Date("2000-01-01T00:00:00.000Z")||Object(i.c)(r.a)},function(t,e,n){"use strict";var r=n(235),i=n(236),a=n(123);e.a=function(){return Object(r.a)(a.v,a.q,a.u,a.l,a.m,a.o,a.r,a.n,i.b).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])}},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf")},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6")},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9")},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5")},function(t,e,n){"use strict";var r=n(9),i=n(8);e.a=Object(i.b)(Object(r.b)(300,.5,0),Object(r.b)(-240,.5,1))},function(t,e,n){"use strict";n.d(e,"c",function(){return a}),n.d(e,"a",function(){return o});var r=n(9),i=n(8),a=Object(i.b)(Object(r.b)(-100,.75,.35),Object(r.b)(80,1.5,.8)),o=Object(i.b)(Object(r.b)(260,.75,.35),Object(r.b)(80,1.5,.8)),c=Object(r.b)();e.b=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return c.h=360*t-100,c.s=1.5-1.5*e,c.l=.8-.9*e,c+""}},function(t,e,n){"use strict";n.d(e,"c",function(){return a}),n.d(e,"b",function(){return o}),n.d(e,"d",function(){return c});var r=n(49);function i(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}e.a=i(Object(r.a)("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var a=i(Object(r.a)("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),o=i(Object(r.a)("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),c=i(Object(r.a)("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"))},function(t,e,n){"use strict";e.a=function t(e){var n=0,i=1,a=!1;function o(t){var r=(t-n)/(i-n);return e(a?Math.max(0,Math.min(1,r)):r)}o.domain=function(t){return arguments.length?(n=+t[0],i=+t[1],o):[n,i]};o.clamp=function(t){return arguments.length?(a=!!t,o):a};o.interpolator=function(t){return arguments.length?(e=t,o):e};o.copy=function(){return t(e).domain([n,i]).clamp(a)};return Object(r.b)(o)};var r=n(48)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildColorValue=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Math.E;if((0,a.default)(t))return t;var o="-"===t[0],c="-"===t[0]?t.slice(1):t;if(u[c]){var s=f(u[c],e,n,o,r,i);return function(t){return s(t.value)}}return t};var r,i=n(24),a=(r=i)&&r.__esModule?r:{default:r},o=n(225),c=n(567);var u={BrBG:c.interpolateBrBG,PRGn:c.interpolatePRGn,PiYG:c.interpolatePiYG,PuOr:c.interpolatePuOr,RdBu:c.interpolateRdBu,RdGy:c.interpolateRdGy,RdYlBu:c.interpolateRdYlBu,RdYlGn:c.interpolateRdYlGn,Spectral:c.interpolateSpectral,Blues:c.interpolateBlues,Greens:c.interpolateGreens,Greys:c.interpolateGreys,Oranges:c.interpolateOranges,Purples:c.interpolatePurples,Reds:c.interpolateReds,BuGn:c.interpolateBuGn,BuPu:c.interpolateBuPu,GnBu:c.interpolateGnBu,OrRd:c.interpolateOrRd,PuBuGn:c.interpolatePuBuGn,PuBu:c.interpolatePuBu,PuRd:c.interpolatePuRd,RdPu:c.interpolateRdPu,YlGnBu:c.interpolateYlGnBu,YlGn:c.interpolateYlGn,YlOrBr:c.interpolateYlOrBr,YlOrRd:c.interpolateYlOrRd};var f=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Math.E;if(i&&e*n<=0&&console.warn("As log(0) = -∞, a log scale domain must be\n strictly-positive or strictly-negative. logscale ignored"),i&&e*n>0){var c=(0,o.scaleLog)().base(a).domain(r?[n,e]:[e,n]).range([0,1]);return(0,o.scaleSequential)(function(e){return t(c(e))}).domain([0,1])}return(0,o.scaleSequential)(t).domain(r?[n,e]:[e,n])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(568);n.d(e,"schemeCategory10",function(){return r.a});var i=n(569);n.d(e,"schemeAccent",function(){return i.a});var a=n(570);n.d(e,"schemeDark2",function(){return a.a});var o=n(571);n.d(e,"schemePaired",function(){return o.a});var c=n(572);n.d(e,"schemePastel1",function(){return c.a});var u=n(573);n.d(e,"schemePastel2",function(){return u.a});var f=n(574);n.d(e,"schemeSet1",function(){return f.a});var s=n(575);n.d(e,"schemeSet2",function(){return s.a});var l=n(576);n.d(e,"schemeSet3",function(){return l.a});var d=n(577);n.d(e,"interpolateBrBG",function(){return d.a}),n.d(e,"schemeBrBG",function(){return d.b});var h=n(578);n.d(e,"interpolatePRGn",function(){return h.a}),n.d(e,"schemePRGn",function(){return h.b});var b=n(579);n.d(e,"interpolatePiYG",function(){return b.a}),n.d(e,"schemePiYG",function(){return b.b});var p=n(580);n.d(e,"interpolatePuOr",function(){return p.a}),n.d(e,"schemePuOr",function(){return p.b});var v=n(581);n.d(e,"interpolateRdBu",function(){return v.a}),n.d(e,"schemeRdBu",function(){return v.b});var y=n(582);n.d(e,"interpolateRdGy",function(){return y.a}),n.d(e,"schemeRdGy",function(){return y.b});var _=n(583);n.d(e,"interpolateRdYlBu",function(){return _.a}),n.d(e,"schemeRdYlBu",function(){return _.b});var g=n(584);n.d(e,"interpolateRdYlGn",function(){return g.a}),n.d(e,"schemeRdYlGn",function(){return g.b});var m=n(585);n.d(e,"interpolateSpectral",function(){return m.a}),n.d(e,"schemeSpectral",function(){return m.b});var x=n(586);n.d(e,"interpolateBuGn",function(){return x.a}),n.d(e,"schemeBuGn",function(){return x.b});var w=n(587);n.d(e,"interpolateBuPu",function(){return w.a}),n.d(e,"schemeBuPu",function(){return w.b});var j=n(588);n.d(e,"interpolateGnBu",function(){return j.a}),n.d(e,"schemeGnBu",function(){return j.b});var O=n(589);n.d(e,"interpolateOrRd",function(){return O.a}),n.d(e,"schemeOrRd",function(){return O.b});var M=n(590);n.d(e,"interpolatePuBuGn",function(){return M.a}),n.d(e,"schemePuBuGn",function(){return M.b});var k=n(591);n.d(e,"interpolatePuBu",function(){return k.a}),n.d(e,"schemePuBu",function(){return k.b});var A=n(592);n.d(e,"interpolatePuRd",function(){return A.a}),n.d(e,"schemePuRd",function(){return A.b});var T=n(593);n.d(e,"interpolateRdPu",function(){return T.a}),n.d(e,"schemeRdPu",function(){return T.b});var S=n(594);n.d(e,"interpolateYlGnBu",function(){return S.a}),n.d(e,"schemeYlGnBu",function(){return S.b});var P=n(595);n.d(e,"interpolateYlGn",function(){return P.a}),n.d(e,"schemeYlGn",function(){return P.b});var R=n(596);n.d(e,"interpolateYlOrBr",function(){return R.a}),n.d(e,"schemeYlOrBr",function(){return R.b});var E=n(597);n.d(e,"interpolateYlOrRd",function(){return E.a}),n.d(e,"schemeYlOrRd",function(){return E.b});var C=n(598);n.d(e,"interpolateBlues",function(){return C.a}),n.d(e,"schemeBlues",function(){return C.b});var I=n(599);n.d(e,"interpolateGreens",function(){return I.a}),n.d(e,"schemeGreens",function(){return I.b});var N=n(600);n.d(e,"interpolateGreys",function(){return N.a}),n.d(e,"schemeGreys",function(){return N.b});var D=n(601);n.d(e,"interpolatePurples",function(){return D.a}),n.d(e,"schemePurples",function(){return D.b});var z=n(602);n.d(e,"interpolateReds",function(){return z.a}),n.d(e,"schemeReds",function(){return z.b});var B=n(603);n.d(e,"interpolateOranges",function(){return B.a}),n.d(e,"schemeOranges",function(){return B.b});var U=n(604);n.d(e,"interpolateCubehelixDefault",function(){return U.a});var L=n(605);n.d(e,"interpolateRainbow",function(){return L.b}),n.d(e,"interpolateWarm",function(){return L.c}),n.d(e,"interpolateCool",function(){return L.a});var W=n(606);n.d(e,"interpolateSinebow",function(){return W.a});var F=n(607);n.d(e,"interpolateViridis",function(){return F.a}),n.d(e,"interpolateMagma",function(){return F.c}),n.d(e,"interpolateInferno",function(){return F.b}),n.d(e,"interpolatePlasma",function(){return F.d})},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f")},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";var r=n(9),i=n(8);e.a=Object(i.b)(Object(r.b)(300,.5,0),Object(r.b)(-240,.5,1))},function(t,e,n){"use strict";n.d(e,"c",function(){return a}),n.d(e,"a",function(){return o});var r=n(9),i=n(8),a=Object(i.b)(Object(r.b)(-100,.75,.35),Object(r.b)(80,1.5,.8)),o=Object(i.b)(Object(r.b)(260,.75,.35),Object(r.b)(80,1.5,.8)),c=Object(r.b)();e.b=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return c.h=360*t-100,c.s=1.5-1.5*e,c.l=.8-.9*e,c+""}},function(t,e,n){"use strict";var r=n(9),i=Object(r.f)(),a=Math.PI/3,o=2*Math.PI/3;e.a=function(t){var e;return t=(.5-t)*Math.PI,i.r=255*(e=Math.sin(t))*e,i.g=255*(e=Math.sin(t+a))*e,i.b=255*(e=Math.sin(t+o))*e,i+""}},function(t,e,n){"use strict";n.d(e,"c",function(){return a}),n.d(e,"b",function(){return o}),n.d(e,"d",function(){return c});var r=n(0);function i(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}e.a=i(Object(r.a)("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var a=i(Object(r.a)("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),o=i(Object(r.a)("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),c=i(Object(r.a)("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.renderAxes=e._buildAxesData=void 0;var r=c(n(609)),i=c(n(105)),a=n(13),o=c(n(612));function c(t){return t&&t.__esModule?t:{default:t}}var u=function(t,e,n){return{value:t,thickness:e.thickness||1,color:e.color||"#d3d3d3",opacity:e.opacity||n.opacity}},f=e._buildAxesData=function(t){return(0,i.default)(t.axes,function(e,n){if(!n.position&&!n.spacing)return o.default.warn("Skipping axe group with no position and spacing defined"),e;if(n.position&&e.push(u(n.position,n,t)),n.spacing){var i=(0,r.default)(n.start||t.cmin,n.end||t.cmax,n.spacing).map(function(e){return u(e,n,t)});return e.concat(i)}return e},[])};e.renderAxes=function(t,e,n,r){var i=f(e),o=(0,a.arc)().innerRadius(function(t){return"in"===e.direction?e.outerRadius-r(t.value):e.innerRadius+r(t.value)}).outerRadius(function(t){return"in"===e.direction?e.outerRadius-r(t.value):e.innerRadius+r(t.value)}).startAngle(0).endAngle(function(t){return t.length}),c=t.selectAll(".axis").data(function(t){var e=n._layout.blocks[t.key];return i.map(function(n){return{value:n.value,thickness:n.thickness,color:n.color,opacity:n.opacity,block_id:t.key,length:e.end-e.start}})}).enter().append("path").attr("opacity",function(t){return t.opacity}).attr("class","axis").attr("d",o).attr("stroke-width",function(t){return t.thickness}).attr("stroke",function(t){return t.color});return e.showAxesTooltip&&(c.on("mouseover",function(t,e){n.tip.html(t.value).transition().style("opacity",.9).style("left",event.pageX+"px").style("top",event.pageY-28+"px")}),c.on("mouseout",function(t,e){n.tip.transition().duration(500).style("opacity",0)})),c}},function(t,e,n){var r=n(610)();t.exports=r},function(t,e,n){var r=n(611),i=n(63),a=n(223);t.exports=function(t){return function(e,n,o){return o&&"number"!=typeof o&&i(e,n,o)&&(n=o=void 0),e=a(e),void 0===n?(n=e,e=0):n=a(n),o=void 0===o?e-1:!!s&&r(t,e,n)>-1}},function(t,e,n){var r=n(16),i=n(2),a=n(6),o="[object String]";t.exports=function(t){return"string"==typeof t||!i(t)&&a(t)&&r(t)==o}},function(t,e,n){var r=n(616),i=n(18);t.exports=function(t){return null==t?[]:r(t,i(t))}},function(t,e,n){var r=n(40);t.exports=function(t,e){return r(e,function(e){return t[e]})}},function(t,e,n){var r=n(618),i=n(619),a=n(33),o=n(2),c=n(63);t.exports=function(t,e,n){var u=o(t)?r:i;return n&&c(t,e,n)&&(e=void 0),u(t,a(e,3))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n=1?t:t*e},p=function(t){function e(t,n,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,h,r,a.parseChordData))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default),r(e,[{key:"getCoordinates",value:function(t,e,n,r){var i=e.blocks[t.id],a=i.start+t.start/i.len*(i.end-i.start),o=i.start+t.end/i.len*(i.end-i.start),c=void 0;return(0,f.default)(n.radius)?c=b(n.radius(r),e.conf.innerRadius):n.radius&&(c=b(n.radius,e.conf.innerRadius)),c||(c=e.conf.innerRadius),{radius:c,startAngle:a,endAngle:o}}},{key:"renderChords",value:function(t,e,n,r,i,a){var o=this,u=t.append("g").selectAll(".chord").data(r).enter().append("path").attr("class","chord").attr("d",(0,c.ribbon)().source(function(t){return a(t.source,i._layout,o.conf,t)}).target(function(t){return a(t.target,i._layout,o.conf,t)})).attr("opacity",n.opacity).on("mouseover",function(t){o.dispatch.call("mouseover",o,t),i.clipboard.attr("value",n.tooltipContent(t))}).on("mouseout",function(t){return o.dispatch.call("mouseout",o,t)});return Object.keys(n.events).forEach(function(t){u.on(t,function(e,r,i){n.events[t](e,r,i,s.event)})}),u.attr("fill",n.colorValue),u}},{key:"render",value:function(t,e,n){e.select("."+n).remove();var r=e.append("g").attr("class",n).attr("z-index",this.conf.zIndex),i=this.renderChords(r,n,this.conf,this.data,t,this.getCoordinates);return this.conf.tooltipContent&&(0,o.registerTooltip)(this,t,i,this.conf),this}}]),e}();e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(624);n.d(e,"chord",function(){return r.a});var i=n(625);n.d(e,"ribbon",function(){return i.a})},function(t,e,n){"use strict";var r=n(10),i=n(239);e.a=function(){var t=0,e=null,n=null,a=null;function o(o){var c,u,f,s,l,d,h=o.length,b=[],p=Object(r.range)(h),v=[],y=[],_=y.groups=new Array(h),g=new Array(h*h);for(c=0,l=-1;++lt.position+r?t.groups.push([e]):t.groups[t.groups.length-1].push(e),t.position=e.position,t)},{position:null,groups:[]}).groups):[t.values];var n,r}).enter().append("g").attr("class","line").append("path").datum(function(t){return t.map(function(t){var i=r.scale(t.value);return(0,o.default)(t,{angle:r.theta(t.position,n.blocks[t.block_id])},function(t){return e.fill?{innerRadius:"out"===e.direction?e.innerRadius:e.outerRadius-t,outerRadius:"out"===e.direction?e.innerRadius+t:e.outerRadius}:{radius:"out"===e.direction?e.innerRadius+t:e.outerRadius-t}}(i))})}).attr("d",f).attr("opacity",e.opacity).attr("stroke-width",e.thickness).attr("stroke",e.colorValue).attr("fill","none");return e.fill&&l.attr("fill",e.fillColor),l}}]),e}();e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;ne.end?-1:t.start==e.start&&t.end==e.end?0:1});var r=[];(0,u.default)(t.values,function(t){var n=!1;(0,u.default)(r,function(r,i){if(r.slice(0).pop().end+et;t++)a.call(this,this._deferreds[t]);this._deferreds=null}function f(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function s(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}var l=i.immediateFn||"function"==typeof e&&e||function(t){setTimeout(t,1)},d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=this;return new i((function(r,i){a.call(n,new f(t,e,r,i))}))},i.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);return new i((function(e,n){function r(a,o){try{if(o&&("object"==typeof o||"function"==typeof o)){var c=o.then;if("function"==typeof c)return void c.call(o,(function(t){r(a,t)}),n)}t[a]=o,0==--i&&e(t)}catch(t){n(t)}}if(0===t.length)return e([]);for(var i=t.length,a=0;ar;r++)t[r].then(e,n)}))},void 0!==t&&t.exports?t.exports=i:n.Promise||(n.Promise=i)}(this),a.copy=function(t){return new Promise((function(e,n){if("string"!=typeof t&&!("text/plain"in t))throw new Error("You must provide a text/plain type.");var r="string"==typeof t?t:t["text/plain"];window.clipboardData.setData("Text",r)?e():n(new Error("Copying was rejected."))}))},a.paste=function(){return new Promise((function(t,e){var n=window.clipboardData.getData("Text");n?t(n):e(new Error("Pasting was rejected."))}))}),a}()}).call(e,n(634).setImmediate)},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(635),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(e,n(80))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,a,o,c,u=1,f={},s=!1,l=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){b(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(o="setImmediate$"+Math.random()+"$",c=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&b(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",c,!1):t.attachEvent("onmessage",c),r=function(e){t.postMessage(o+e,"*")}):t.MessageChannel?((a=new MessageChannel).port1.onmessage=function(t){b(t.data)},r=function(t){a.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(t){var e=l.createElement("script");e.onreadystatechange=function(){b(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(b,0,t)},d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;nn.value[r]){e=n.color[r];break}return e}}}},{key:"setToolTip",value:function(t){if(void 0!==t.tooltipContent){if(void 0!==t.tooltipContent.name)if("all"===t.tooltipContent.name)t.tooltipContent=function(t){var e="";for(var n in t)e="

"+(n.charAt(0).toUpperCase()+n.slice(1))+" : "+t[n]+"

"+e;return"

"+e+"

"};else{var e=t.tooltipContent.name;t.tooltipContent=function(t){return t[e]}}else if(void 0!==t.tooltipContent.source){var n=t.tooltipContent;void 0!==n.sourceID&&void 0!==n.targetID?t.tooltipContent=function(t){return"

"+t[n.source][n.sourceID]+" ➤ "+t[n.target][n.targetID]+": "+t[n.target][n.targetEnd]+"

"}:t.tooltipContent=function(t){return"

"+t[n.source]+" ➤ "+t[n.target]+": "+t[n.targetEnd]+"

"}}}else t.tooltipContent=null}},{key:"configCircos",value:function(t,e,n,r){var i=this;this.circos.layout(t,e),n&&n.forEach((function(t,e){var n,a=t.id,o=t.data,c=t.config,u=t.type;void 0!==c&&((n=c).events=i.setEvent(r,e),i.setColor(n),i.setToolTip(n)),i.circos[u.toLowerCase()](a||"track-".concat(e),o,n)})),this.circos.render()}},{key:"componentDidMount",value:function(){var t=this.props,e=t.enableDownloadSVG,n=t.enableZoomPan,r=t.size,i=t.layout,a=t.config,c=t.tracks,u=t.setProps;this.circos=new o.a({container:this.ref,width:r,height:r,enableZoomPan:n,enableDownloadSVG:e}),this.configCircos(i,a,c,u),this.setStopScroll(n)}},{key:"shouldComponentUpdate",value:function(t){return this.props.config!==t.config||this.props.layout!==t.layout||this.props.tracks!==t.tracks||this.props.size!==t.size||this.props.selectEvent!==t.selectEvent}},{key:"componentDidUpdate",value:function(){var t=this.props,e=t.size,n=t.layout,r=t.config,i=t.tracks,a=t.setProps;this.circos.removeTracks(),this.container=this.ref,this.circos.width=e,this.circos.height=e,this.configCircos(n,r,i,a)}},{key:"componentWillUnmount",value:function(){this.setStopScroll(!1)}},{key:"render",value:function(){var t=this,e=this.props,n=e.id,r=e.style,a=e.config,o=e.layout,c=e.tracks,u=e.size,f=e.eventDatum;return i.a.createElement("div",{id:n,style:r,eventDatum:f},i.a.createElement("div",{id:"Circos-container",ref:function(e){t.ref=e},config:a,layout:o,tracks:c,size:u}))}}])&&f(n.prototype,r),a&&f(n,a),e}(r.Component);h.defaultProps=c.b,h.propTypes=c.c}}]); \ No newline at end of file +function(n){function r(t,e){return function(){t.apply(e,arguments)}}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,r(o,this),r(c,this))}function a(t){var e=this;return null===this._state?void this._deferreds.push(t):void l(function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})}function o(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void s(r(e,t),r(o,this),r(c,this))}this._state=!0,this._value=t,u.call(this)}catch(t){c.call(this,t)}}function c(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,e=this._deferreds.length;e>t;t++)a.call(this,this._deferreds[t]);this._deferreds=null}function f(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function s(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(t){if(r)return;r=!0,n(t)}}var l=i.immediateFn||"function"==typeof e&&e||function(t){setTimeout(t,1)},d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=this;return new i(function(r,i){a.call(n,new f(t,e,r,i))})},i.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);return new i(function(e,n){function r(a,o){try{if(o&&("object"==typeof o||"function"==typeof o)){var c=o.then;if("function"==typeof c)return void c.call(o,function(t){r(a,t)},n)}t[a]=o,0==--i&&e(t)}catch(t){n(t)}}if(0===t.length)return e([]);for(var i=t.length,a=0;ar;r++)t[r].then(e,n)})},void 0!==t&&t.exports?t.exports=i:n.Promise||(n.Promise=i)}(this),a.copy=function(t){return new Promise(function(e,n){if("string"!=typeof t&&!("text/plain"in t))throw new Error("You must provide a text/plain type.");var r="string"==typeof t?t:t["text/plain"],i=window.clipboardData.setData("Text",r);i?e():n(new Error("Copying was rejected."))})},a.paste=function(){return new Promise(function(t,e){var n=window.clipboardData.getData("Text");n?t(n):e(new Error("Pasting was rejected."))})}),a}()}).call(e,n(634).setImmediate)},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(635),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(e,n(80))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,a,o,c,u=1,f={},s=!1,l=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){b(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((a=new MessageChannel).port1.onmessage=function(t){b(t.data)},r=function(t){a.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(t){var e=l.createElement("script");e.onreadystatechange=function(){b(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(b,0,t)}:(o="setImmediate$"+Math.random()+"$",c=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&b(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",c,!1):t.attachEvent("onmessage",c),r=function(e){t.postMessage(o+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;nn.value[r]){e=n.color[r];break}return e}}}},{key:"setToolTip",value:function(t){if(void 0!==t.tooltipContent){if(void 0!==t.tooltipContent.name)if("all"===t.tooltipContent.name)t.tooltipContent=function(t){var e="";for(var n in t){e="

"+(n.charAt(0).toUpperCase()+n.slice(1))+" : "+t[n]+"

"+e}return"

"+e+"

"};else{var e=t.tooltipContent.name;t.tooltipContent=function(t){return t[e]}}else if(void 0!==t.tooltipContent.source){var n=t.tooltipContent;void 0!==n.sourceID&&void 0!==n.targetID?t.tooltipContent=function(t){return"

"+t[n.source][n.sourceID]+" ➤ "+t[n.target][n.targetID]+": "+t[n.target][n.targetEnd]+"

"}:t.tooltipContent=function(t){return"

"+t[n.source]+" ➤ "+t[n.target]+": "+t[n.targetEnd]+"

"}}}else t.tooltipContent=null}},{key:"configCircos",value:function(t,e,n,r){var i=this;this.circos.layout(t,e),n&&n.forEach(function(t,e){var n,a=t.id,o=t.data,c=t.config,u=t.type;void 0!==c&&((n=c).events=i.setEvent(r,e),i.setColor(n),i.setToolTip(n)),i.circos[u.toLowerCase()](a||"track-".concat(e),o,n)}),this.circos.render()}},{key:"componentDidMount",value:function(){var t=this.props,e=t.enableDownloadSVG,n=t.enableZoomPan,r=t.size,i=t.layout,a=t.config,c=t.tracks,u=t.setProps;this.circos=new o.a({container:this.ref,width:r,height:r,enableZoomPan:n,enableDownloadSVG:e}),this.configCircos(i,a,c,u),this.setStopScroll(n)}},{key:"shouldComponentUpdate",value:function(t){return this.props.config!==t.config||this.props.layout!==t.layout||this.props.tracks!==t.tracks||this.props.size!==t.size||this.props.selectEvent!==t.selectEvent}},{key:"componentDidUpdate",value:function(){var t=this.props,e=t.size,n=t.layout,r=t.config,i=t.tracks,a=t.setProps;this.circos.removeTracks(),this.container=this.ref,this.circos.width=e,this.circos.height=e,this.configCircos(n,r,i,a)}},{key:"componentWillUnmount",value:function(){this.setStopScroll(!1)}},{key:"render",value:function(){var t=this,e=this.props,n=e.id,r=e.style,a=e.config,o=e.layout,c=e.tracks,u=e.size,f=e.eventDatum;return i.a.createElement("div",{id:n,style:r,eventDatum:f},i.a.createElement("div",{id:"Circos-container",ref:function(e){t.ref=e},config:a,layout:o,tracks:c,size:u}))}}])&&f(n.prototype,a),c&&f(n,c),e}();h.defaultProps=c.b,h.propTypes=c.c}}]); \ No newline at end of file diff --git a/dash_bio/async~ideogram.js b/dash_bio/async~ideogram.js index 6d2f54726..a9e26023f 100644 --- a/dash_bio/async~ideogram.js +++ b/dash_bio/async~ideogram.js @@ -1,2 +1,2 @@ -(window.webpackJsonpdash_bio=window.webpackJsonpdash_bio||[]).push([[3],{137:function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,n;function _possibleConstructorReturn(t,n){return!n||"object"!==_typeof(n)&&"function"!=typeof n?_assertThisInitialized(t):n}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _inherits(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&_setPrototypeOf(t,n)}function _setPrototypeOf(t,n){return(_setPrototypeOf=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function _classCallCheck(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,n){for(var e=0;e=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),o.hasOwnProperty(n)?{space:o[n],local:t}:t},a=function(t){var n=i(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===r&&n.documentElement.namespaceURI===r?n.createElement(t):n.createElementNS(e,t)}})(n)};function s(){}var c=function(t){return null==t?s:function(){return this.querySelector(t)}};function u(){return[]}var l=function(t){return null==t?u:function(){return this.querySelectorAll(t)}},f=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var h=document.documentElement;if(!h.matches){var d=h.webkitMatchesSelector||h.msMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector;f=function(t){return function(){return d.call(this,t)}}}}var g=f,p=function(t){return new Array(t.length)};function m(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}m.prototype={constructor:m,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var v="$";function y(t,n,e,r,o,i){for(var a,s=0,c=n.length,u=i.length;sn?1:t>=n?0:NaN}var w=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function x(t,n){return t.style.getPropertyValue(n)||w(t).getComputedStyle(t,null).getPropertyValue(n)}function A(t){return t.trim().split(/^|\s+/)}function k(t){return t.classList||new C(t)}function C(t){this._node=t,this._names=A(t.getAttribute("class")||"")}function T(t,n){for(var e=k(t),r=-1,o=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var N={},H=null;function I(t,n,e){return t=j(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function j(t,n,e){return function(r){var o=H;H=r;try{t.call(this,this.__data__,n,e)}finally{H=o}}}function R(t){return function(){var n=this.__on;if(n){for(var e,r=0,o=-1,i=n.length;r=x&&(x=w+1);!(_=m[x])&&++x=0;)(r=o[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=_);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):x(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=A(t+"");if(arguments.length<2){for(var r=k(this.node()),o=-1,i=e.length;++o=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(s=n?W:R,null==e&&(e=!1),r=0;r=i?d=!0:(r=t.charCodeAt(a++))===l?g=!0:r===f&&(g=!0,t.charCodeAt(a)===l&&++a),t.slice(o+1,n-1).replace(/""/g,'"')}for(;a>>1;e>>1;t(n[i])>>1);--i>0;)e(t,i,o,n);return t}function e(n,e,r,o){for(var i,a=n[--o+e],s=t(a);(i=e<<1)<=r&&(it(n[o+i+1])&&i++,!(s<=t(n[o+i])));)n[o+e]=n[o+i],e=i;n[o+e]=a}return n.sort=function(t,n,r){for(var o,i=r-n;--i>0;)o=t[n],t[n]=t[n+i],t[n+i]=o,e(t,1,i,n);return t},n}function a(t){var n=i(t);return function(e,r,o,i){var a,s,c,u=new Array(i=Math.min(o-r,i));for(s=0;sa&&(u[0]=c,a=t(n(u,0,i)[0]))}while(++re&&t(n[i-1])>s;--i)n[i]=n[i-1];n[i]=a}return n}}function c(t){var n=s(t);return function e(r,o,i){return(i-o>1,l=u-a,f=u+a,h=n[s],d=t(h),g=n[l],p=t(g),m=n[u],v=t(m),y=n[f],b=t(y),_=n[c],w=t(_);d>p&&(i=h,h=g,g=i,i=d,d=p,p=i),b>w&&(i=y,y=_,_=i,i=b,b=w,w=i),d>v&&(i=h,h=m,m=i,i=d,d=v,v=i),p>v&&(i=g,g=m,m=i,i=p,p=v,v=i),d>b&&(i=h,h=y,y=i,i=d,d=b,b=i),v>b&&(i=m,m=y,y=i,i=v,v=b,b=i),p>w&&(i=g,g=_,_=i,i=p,p=w,w=i),p>v&&(i=g,g=m,m=i,i=p,p=v,v=i),b>w&&(i=y,y=_,_=i,i=b,b=w,w=i);var x=g,A=p,k=y,C=b;n[s]=h,n[l]=n[r],n[u]=m,n[f]=n[o-1],n[c]=_;var T=r+1,M=o-2,S=A<=C&&A>=C;if(S)for(var L=T;L<=M;++L){var D=n[L];if((O=t(D))A)for(;;){if(!((P=t(n[M]))>A)){if(PC)for(;;){if(!((P=t(n[M]))>C)){Pc){for(var B;(B=t(n[T]))<=A&&B>=A;)++T;for(;(P=t(n[M]))<=C&&P>=C;)--M;for(L=T;L<=M;L++){var O;if(D=n[L],(O=t(D))<=A&&O>=A)L!==T&&(n[L]=n[T],n[T]=D),T++;else if(O<=C&&O>=C)for(;;){var P;if(!((P=t(n[M]))<=C&&P>=C)){P32)throw new Error("invalid array width!");return t};function p(t){for(var n=new Array(t),e=-1;++er;)h[--s]=0},dimension:function(t){var l,M,S,L,D,B={filter:function(t){return null==t?X():Array.isArray(t)?q(t):"function"==typeof t?$(t):z(t)},filterExact:z,filterRange:q,filterFunction:$,filterAll:X,top:function(t){for(var n,e=[],r=j;--r>=I&&t>0;)h[n=M[r]]||(e.push(o[n]),--t);return e},bottom:function(t){for(var n,e=[],r=I;r0;)h[n=M[r]]||(e.push(o[n]),--t),r++;return e},group:G,groupAll:function(){var t=G(v),n=t.all;return delete t.all,delete t.top,delete t.order,delete t.orderNatural,delete t.size,t.value=function(){return n()[0].value},t},dispose:Q,remove:Q},O=~u&-~u,P=~O,F=c((function(t){return S[t]})),E=m,N=[],H=[],I=0,j=0;function R(n,r,o){S=n.map(t),L=F(function(t){for(var n=k(t,t),e=-1;++eI)for(r=I,o=Math.min(n,j);rj)for(r=Math.max(n,j),o=e;r1?d(c,s):k(s,D),M&&(f=(l=w[0]).key);N=y);)++N;for(;N_||(c[u=e[N]+i]=B,h[u]&P||(b.value=A(b.value,o[u])),++N>=a));)y=t(n[N]);H()}for(;OO)for(O=0;O1?(F=U,E=z):(!B&&j&&(B=1,r=[{key:null,value:T()}]),1===B?(F=Y,E=q):(F=v,E=v),c=null),p[u]=F}function W(){if(B>1){for(var t=B,n=r,e=k(t,t),o=0,i=0;o1)for(o=0;o1?(E=z,F=U):1===B?(E=q,F=Y):E=F=v}else if(1===B){if(j)return;for(o=0;o=0&&p.splice(t,1),(t=N.indexOf(R))>=0&&N.splice(t,1),(t=T.indexOf(W))>=0&&T.splice(t,1),e}return arguments.length<1&&(t=n),p.push(F),N.push(R),T.push(W),R(l,M,0,s),V().orderNatural()}function Q(){H.forEach((function(t){t.dispose()}));var t=A.indexOf(R);return t>=0&&A.splice(t,1),(t=A.indexOf(W))>=0&&A.splice(t,1),(t=T.indexOf(U))>=0&&T.splice(t,1),u&=P,X()}return A.unshift(R),A.push(W),T.push(U),u|=O,(f>=32?!O:u&-(1<=0&&p.splice(t),(t=A.indexOf(c))>=0&&A.splice(t),i}return p.push(u),A.push(c),c(0,0),f()},size:function(){return s}},o=[],s=0,u=0,f=8,h=l(0),p=[],A=[],T=[];function M(n){var e=s,r=n.length;return r&&(o=o.concat(n),h=d(h,s+=r),A.forEach((function(t){t(n,e,r)}))),t}return arguments.length?M(arguments[0]):t}function k(t,n){return(n<257?l:n<65537?f:h)(t)}function C(t){return 8===t?256:16===t?65536:4294967296}"undefined"!=typeof Uint8Array&&(l=function(t){return new Uint8Array(t)},f=function(t){return new Uint16Array(t)},h=function(t){return new Uint32Array(t)},d=function(t,n){if(t.length>=n)return t;var e=new t.constructor(n);return e.set(t),e},g=function(t,n){var e;switch(n){case 16:e=f(t.length);break;case 32:e=h(t.length);break;default:throw new Error("invalid array width!")}return e.set(t),e}),t.crossfilter=A}(void 0!==n&&n||this)},function(t,n,e){"use strict";e.r(n);var r={};e.r(r),e.d(r,"dispatch",(function(){return h}));var o={};e.r(o),e.d(o,"brush",(function(){return ne})),e.d(o,"brushX",(function(){return Jn})),e.d(o,"brushY",(function(){return te})),e.d(o,"brushSelection",(function(){return Zn}));var i=e(0),a=e(2),s={value:function(){}};function c(){for(var t,n=0,e=arguments.length,r={};n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++i0)for(var e,r,o=new Array(e),i=0;i>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=A.exec(t))?O(parseInt(n[1],16)):(n=k.exec(t))?new N(n[1],n[2],n[3],1):(n=C.exec(t))?new N(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=T.exec(t))?P(n[1],n[2],n[3],n[4]):(n=M.exec(t))?P(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=S.exec(t))?I(n[1],n[2]/100,n[3]/100,1):(n=L.exec(t))?I(n[1],n[2]/100,n[3]/100,n[4]):D.hasOwnProperty(t)?O(D[t]):"transparent"===t?new N(NaN,NaN,NaN,0):null}function O(t){return new N(t>>16&255,t>>8&255,255&t,1)}function P(t,n,e,r){return r<=0&&(t=n=e=NaN),new N(t,n,e,r)}function F(t){return t instanceof y||(t=B(t)),t?new N((t=t.rgb()).r,t.g,t.b,t.opacity):new N}function E(t,n,e,r){return 1===arguments.length?F(t):new N(t,n,e,null==r?1:r)}function N(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function H(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function I(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new R(t,n,e,r)}function j(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof R)return new R(t.h,t.s,t.l,t.opacity);if(t instanceof y||(t=B(t)),!t)return new R;if(t instanceof R)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,o=Math.min(n,e,r),i=Math.max(n,e,r),a=NaN,s=i-o,c=(i+o)/2;return s?(a=n===i?(e-r)/s+6*(e0&&c<1?0:a,new R(a,s,c,t.opacity)}(t):new R(t,n,e,null==r?1:r)}function R(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function W(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}m(y,B,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),m(N,E,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+H(this.r)+H(this.g)+H(this.b)},toString:function(){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+")")}})),m(R,j,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new R(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new R(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,o=2*e-r;return new N(W(t>=240?t-240:t+120,o,r),W(t,o,r),W(t<120?t+240:t-120,o,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var U=Math.PI/180,Y=180/Math.PI,z=.96422,q=1,X=.82521,$=4/29,V=6/29,G=3*V*V,Q=V*V*V;function K(t){if(t instanceof Z)return new Z(t.l,t.a,t.b,t.opacity);if(t instanceof ot){if(isNaN(t.h))return new Z(t.l,0,0,t.opacity);var n=t.h*U;return new Z(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof N||(t=F(t));var e,r,o=et(t.r),i=et(t.g),a=et(t.b),s=J((.2225045*o+.7168786*i+.0606169*a)/q);return o===i&&i===a?e=r=s:(e=J((.4360747*o+.3850649*i+.1430804*a)/z),r=J((.0139322*o+.0971045*i+.7141733*a)/X)),new Z(116*s-16,500*(e-s),200*(s-r),t.opacity)}function Z(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function J(t){return t>Q?Math.pow(t,1/3):t/G+$}function tt(t){return t>V?t*t*t:G*(t-$)}function nt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function et(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function rt(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof ot)return new ot(t.h,t.c,t.l,t.opacity);if(t instanceof Z||(t=K(t)),0===t.a&&0===t.b)return new ot(NaN,0,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*Y;return new ot(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new ot(t,n,e,null==r?1:r)}function ot(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}m(Z,(function(t,n,e,r){return 1===arguments.length?K(t):new Z(t,n,e,null==r?1:r)}),v(y,{brighter:function(t){return new Z(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Z(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return new N(nt(3.1338561*(n=z*tt(n))-1.6168667*(t=q*tt(t))-.4906146*(e=X*tt(e))),nt(-.9787684*n+1.9161415*t+.033454*e),nt(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),m(ot,rt,v(y,{brighter:function(t){return new ot(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new ot(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return K(this).rgb()}}));var it=1.78277,at=-.29227,st=-.90649,ct=1.97294,ut=ct*st,lt=ct*it,ft=it*at- -.14861*st;function ht(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof dt)return new dt(t.h,t.s,t.l,t.opacity);t instanceof N||(t=F(t));var n=t.r/255,e=t.g/255,r=t.b/255,o=(ft*r+ut*n-lt*e)/(ft+ut-lt),i=r-o,a=(ct*(e-o)-at*i)/st,s=Math.sqrt(a*a+i*i)/(ct*o*(1-o)),c=s?Math.atan2(a,i)*Y-120:NaN;return new dt(c<0?c+360:c,s,o,t.opacity)}(t):new dt(t,n,e,null==r?1:r)}function dt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function gt(t,n,e,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*n+(4-6*i+3*a)*e+(1+3*t+3*i-3*a)*r+a*o)/6}m(dt,ht,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*U,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),o=Math.sin(t);return new N(255*(n+e*(-.14861*r+it*o)),255*(n+e*(at*r+st*o)),255*(n+e*(ct*r)),this.opacity)}}));var pt=function(t){return function(){return t}};function mt(t,n){return function(e){return t+e*n}}function vt(t,n){var e=n-t;return e?mt(t,e>180||e<-180?e-360*Math.round(e/360):e):pt(isNaN(t)?n:t)}function yt(t,n){var e=n-t;return e?mt(t,e):pt(isNaN(t)?n:t)}var bt=function t(n){var e=function(t){return 1==(t=+t)?yt:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):pt(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=E(t)).r,(n=E(n)).r),o=e(t.g,n.g),i=e(t.b,n.b),a=yt(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=o(n),t.b=i(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function _t(t){return function(n){var e,r,o=n.length,i=new Array(o),a=new Array(o),s=new Array(o);for(e=0;e=1?(e=1,n-1):Math.floor(e*n),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,s=ri&&(o=n.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(e=e[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,c.push({i:a,x:Ct(e,r)})),i=Mt.lastIndex;return i180?n+=360:n-t>180&&(t+=360),i.push({i:e.push(o(e)+"rotate(",null,r)-2,x:Ct(t,n)})):n&&e.push(o(e)+"rotate("+n+r)}(i.rotate,a.rotate,s,c),function(t,n,e,i){t!==n?i.push({i:e.push(o(e)+"skewX(",null,r)-2,x:Ct(t,n)}):n&&e.push(o(e)+"skewX("+n+r)}(i.skewX,a.skewX,s,c),function(t,n,e,r,i,a){if(t!==e||n!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Ct(t,e)},{i:s-2,x:Ct(n,r)})}else 1===e&&1===r||i.push(o(i)+"scale("+e+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,c),i=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Yt}()}finally{Yt=0,function(){for(var t,n,e=Rt,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Rt=n);Wt=t,on(r)}(),Vt=0}}function rn(){var t=Qt.now(),n=t-$t;n>Xt&&(Gt-=n,$t=t)}function on(t){Yt||(zt&&(zt=clearTimeout(zt)),t-Vt>24?(t<1/0&&(zt=setTimeout(en,t-Qt.now()-Gt)),qt&&(qt=clearInterval(qt))):(qt||($t=Qt.now(),qt=setInterval(rn,Xt)),Yt=1,Kt(en)))}tn.prototype=nn.prototype={constructor:tn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Zt():+e)+(null==n?0:+n),this._next||Wt===this||(Wt?Wt._next=this:Rt=this,Wt=this),this._call=t,this._time=e,on()},stop:function(){this._call&&(this._call=null,this._time=1/0,on())}};var an=function(t,n,e){var r=new tn;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},sn=h("start","end","interrupt"),cn=[],un=0,ln=1,fn=2,hn=3,dn=4,gn=5,pn=6,mn=function(t,n,e,r,o,i){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,o=t.__transition;function i(c){var u,l,f,h;if(e.state!==ln)return s();for(u in o)if((h=o[u]).name===e.name){if(h.state===hn)return an(i);h.state===dn?(h.state=pn,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[u]):+uun)throw new Error("too late; already scheduled");return e}function yn(t,n){var e=bn(t,n);if(e.state>fn)throw new Error("too late; already started");return e}function bn(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var _n=function(t,n){var e,r,o,i=t.__transition,a=!0;if(i){for(o in n=null==n?null:n+"",i)(e=i[o]).name===n?(r=e.state>fn&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?vn:yn;return function(){var a=i(this,t),s=a.on;s!==r&&(o=(r=s).copy()).on(n,e),a.on=o}}(e,t,n))},attr:function(t,n){var e=Object(i.namespace)(t),r="transform"===e?Nt:xn;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,o,i;return function(){var a,s=e(this);if(null!=s)return(a=this.getAttributeNS(t.space,t.local))===s?null:a===r&&s===o?i:i=n(r=a,o=s);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,o,i;return function(){var a,s=e(this);if(null!=s)return(a=this.getAttribute(t))===s?null:a===r&&s===o?i:i=n(r=a,o=s);this.removeAttribute(t)}})(e,r,wn(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,o;return function(){var i=this.getAttributeNS(t.space,t.local);return i===e?null:i===r?o:o=n(r=i,e)}}:function(t,n,e){var r,o;return function(){var i=this.getAttribute(t);return i===e?null:i===r?o:o=n(r=i,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=Object(i.namespace)(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Et:xn;return null==n?this.styleTween(t,function(t,n){var e,r,o;return function(){var a=Object(i.style)(this,t),s=(this.style.removeProperty(t),Object(i.style)(this,t));return a===s?null:a===e&&s===r?o:o=n(e=a,r=s)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,o,a;return function(){var s=Object(i.style)(this,t),c=e(this);return null==c&&(this.style.removeProperty(t),c=Object(i.style)(this,t)),s===c?null:s===r&&c===o?a:a=n(r=s,o=c)}}(t,r,wn(this,"style."+t,n)):function(t,n,e){var r,o;return function(){var a=Object(i.style)(this,t);return a===e?null:a===r?o:o=n(r=a,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,o=n.apply(r,arguments);return o&&function(n){r.style.setProperty(t,o(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(wn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,o=bn(this.node(),e).tween,i=0,a=o.length;i0&&(e=o-m),C<0?h=d-v:C>0&&(a=s-v),A=Nn,I.attr("cursor",Un.selection),W());break;default:return}Fn()}),!0).on("keyup.brush",(function(){switch(i.event.keyCode){case 16:P&&(b=_=P=!1,W());break;case 18:A===In&&(k<0?l=f:k>0&&(e=o),C<0?h=d:C>0&&(a=s),A=Hn,W());break;case 32:A===Nn&&(i.event.altKey?(k&&(l=f-m*k,e=o+m*k),C&&(h=d-v*C,a=s+v*C),A=In):(k<0?l=f:k>0&&(e=o),C<0?h=d:C>0&&(a=s),A=Hn),I.attr("cursor",Un[x]),W());break;default:return}Fn()}),!0).on("mousemove.brush",R,!0).on("mouseup.brush",U,!0);g(i.event.view)}Pn(),_n(w),c.call(w),N.start()}function R(){var t=Object(i.mouse)(w);!P||b||_||(Math.abs(t[0]-E[0])>Math.abs(t[1]-E[1])?_=!0:b=!0),E=t,y=!0,Fn(),W()}function W(){var t;switch(m=E[0]-F[0],v=E[1]-F[1],A){case Nn:case En:k&&(m=Math.max(L-e,Math.min(B-l,m)),o=e+m,f=l+m),C&&(v=Math.max(D-a,Math.min(O-h,v)),s=a+v,d=h+v);break;case Hn:k<0?(m=Math.max(L-e,Math.min(B-e,m)),o=e+m,f=l):k>0&&(m=Math.max(L-l,Math.min(B-l,m)),o=e,f=l+m),C<0?(v=Math.max(D-a,Math.min(O-a,v)),s=a+v,d=h):C>0&&(v=Math.max(D-h,Math.min(O-h,v)),s=a,d=h+v);break;case In:k&&(o=Math.max(L,Math.min(B,e-m*k)),f=Math.max(L,Math.min(B,l+m*k))),C&&(s=Math.max(D,Math.min(O,a-v*C)),d=Math.max(D,Math.min(O,h+v*C)))}fn?1:t>=n?0:NaN},oe=function(t){return 1===t.length&&(t=function(t){return function(n,e){return re(t(n),e)}}(t)),{left:function(n,e,r,o){for(null==r&&(r=0),null==o&&(o=n.length);r>>1;t(n[i],e)<0?r=i+1:o=i}return r},right:function(n,e,r,o){for(null==r&&(r=0),null==o&&(o=n.length);r>>1;t(n[i],e)>0?o=i:r=i+1}return r}}}(re),ie=oe.right,ae=(oe.left,ie),se=Array.prototype,ce=(se.slice,se.map,Math.sqrt(50)),ue=Math.sqrt(10),le=Math.sqrt(2),fe=function(t,n,e){var r,o,i,a,s=-1;if(e=+e,(t=+t)==(n=+n)&&e>0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),i=new Array(o=Math.ceil(n-t+1));++s=0?(i>=ce?10:i>=ue?5:i>=le?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=ce?10:i>=ue?5:i>=le?2:1)}var de=function(t,n){var e,r,o=t.length,i=-1;if(null==n){for(;++i=e)for(r=e;++ir&&(r=e)}else for(;++i=e)for(r=e;++ir&&(r=e);return r};function ge(){}function pe(t,n){var e=new ge;if(t instanceof ge)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,o=-1,i=t.length;if(null==n)for(;++o1?r[0]+r.slice(2):r,+t.slice(e+1)]},Se=function(t){return(t=Me(Math.abs(t)))?t[1]:NaN},Le=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function De(t){return new Be(t)}function Be(t){if(!(n=Le.exec(t)))throw new Error("invalid format: "+t);var n;this.fill=n[1]||" ",this.align=n[2]||">",this.sign=n[3]||"-",this.symbol=n[4]||"",this.zero=!!n[5],this.width=n[6]&&+n[6],this.comma=!!n[7],this.precision=n[8]&&+n[8].slice(1),this.trim=!!n[9],this.type=n[10]||""}De.prototype=Be.prototype,Be.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Oe,Pe,Fe,Ee,Ne=function(t){t:for(var n,e=t.length,r=1,o=-1;r0){if(!+t[r])break t;o=0}}return o>0?t.slice(0,o)+t.slice(n+1):t},He=function(t,n){var e=Me(t,n);if(!e)return t+"";var r=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")},Ie={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return He(100*t,n)},r:He,s:function(t,n){var e=Me(t,n);if(!e)return t+"";var r=e[0],o=e[1],i=o-(Oe=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Me(t,Math.max(0,n+i-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},je=function(t){return t},Re=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];Pe=function(t){var n=t.grouping&&t.thousands?function(t,n){return function(e,r){for(var o=e.length,i=[],a=0,s=t[0],c=0;o>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),i.push(e.substring(o-=s,o+s)),!((c+=s+1)>r));)s=t[a=(a+1)%t.length];return i.reverse().join(n)}}(t.grouping,t.thousands):je,e=t.currency,r=t.decimal,o=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(t.numerals):je,i=t.percent||"%";function a(t){var a=(t=De(t)).fill,s=t.align,c=t.sign,u=t.symbol,l=t.zero,f=t.width,h=t.comma,d=t.precision,g=t.trim,p=t.type;"n"===p?(h=!0,p="g"):Ie[p]||(null==d&&(d=12),g=!0,p="g"),(l||"0"===a&&"="===s)&&(l=!0,a="0",s="=");var m="$"===u?e[0]:"#"===u&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",v="$"===u?e[1]:/[%p]/.test(p)?i:"",y=Ie[p],b=/[defgprs%]/.test(p);function _(t){var e,i,u,_=m,w=v;if("c"===p)w=y(t)+w,t="";else{var x=(t=+t)<0;if(t=y(Math.abs(t),d),g&&(t=Ne(t)),x&&0==+t&&(x=!1),_=(x?"("===c?c:"-":"-"===c||"("===c?"":c)+_,w=("s"===p?Re[8+Oe/3]:"")+w+(x&&"("===c?")":""),b)for(e=-1,i=t.length;++e(u=t.charCodeAt(e))||u>57){w=(46===u?r+t.slice(e+1):t.slice(e))+w,t=t.slice(0,e);break}}h&&!l&&(t=n(t,1/0));var A=_.length+t.length+w.length,k=A>1)+_+t+w+k.slice(A);break;default:t=k+_+t+w}return o(t)}return d=null==d?6:/[gprs]/.test(p)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),_.toString=function(){return t+""},_}return{format:a,formatPrefix:function(t,n){var e=a(((t=De(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Se(n)/3))),o=Math.pow(10,-r),i=Re[8+r/3];return function(t){return e(o*t)+i}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),Fe=Pe.format,Ee=Pe.formatPrefix;var We=function(t,n,e){var r,o=t[0],i=t[t.length-1],a=function(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=ce?o*=10:i>=ue?o*=5:i>=le&&(o*=2),n2?Te:Ce,r=o=null,l}function l(n){return(r||(r=e(i,a,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,s)))(+n)}return l.invert=function(t){return(o||(o=e(a,i,ke,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},l.domain=function(t){return arguments.length?(i=be.call(t,xe),u()):i.slice()},l.range=function(t){return arguments.length?(a=_e.call(t),u()):a.slice()},l.rangeRound=function(t){return a=_e.call(t),s=Dt,u()},l.clamp=function(t){return arguments.length?(c=!!t,u()):c},l.interpolate=function(t){return arguments.length?(s=t,u()):s},u()}(ke,Ct);return t.copy=function(){return function(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}(t,Ue())},function(t){var n=t.domain;return t.ticks=function(t){var e=n();return fe(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return We(n(),t,e)},t.nice=function(e){null==e&&(e=10);var r,o=n(),i=0,a=o.length-1,s=o[i],c=o[a];return c0?r=he(s=Math.floor(s/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=he(s=Math.ceil(s*r)/r,c=Math.floor(c*r)/r,e)),r>0?(o[i]=Math.floor(s/r)*r,o[a]=Math.ceil(c/r)*r,n(o)):r<0&&(o[i]=Math.ceil(s*r)/r,o[a]=Math.floor(c*r)/r,n(o)),t},t}(t)}var Ye=new Date,ze=new Date;function qe(t,n,e,r){function o(n){return t(n=new Date(+n)),n}return o.floor=o,o.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},o.round=function(t){var n=o(t),e=o.ceil(t);return t-n0))return s;do{s.push(a=new Date(+e)),n(e,i),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(o.count=function(n,r){return Ye.setTime(+n),ze.setTime(+r),t(Ye),t(ze),Math.floor(e(Ye,ze))},o.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?o.filter(r?function(n){return r(n)%t==0}:function(n){return o.count(0,n)%t==0}):o:null}),o}var Xe=qe((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));Xe.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?qe((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):Xe:null},Xe.range;var $e=6e4,Ve=6048e5,Ge=(((qe((function(t){t.setTime(1e3*Math.floor(t/1e3))}),(function(t,n){t.setTime(+t+1e3*n)}),(function(t,n){return(n-t)/1e3}),(function(t){return t.getUTCSeconds()})).range,qe((function(t){t.setTime(Math.floor(t/$e)*$e)}),(function(t,n){t.setTime(+t+n*$e)}),(function(t,n){return(n-t)/$e}),(function(t){return t.getMinutes()}))).range,qe((function(t){var n=t.getTimezoneOffset()*$e%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getHours()}))).range,qe((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*$e)/864e5}),(function(t){return t.getDate()-1}))),Qe=Ge;function Ke(t){return qe((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*$e)/Ve}))}Ge.range;var Ze=Ke(0),Je=Ke(1),tr=Ke(2),nr=Ke(3),er=Ke(4),rr=Ke(5),or=Ke(6),ir=((Ze.range,Je.range,tr.range,nr.range,er.range,rr.range,or.range,qe((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))).range,qe((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()})));ir.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qe((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var ar=ir,sr=(((ir.range,qe((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*$e)}),(function(t,n){return(n-t)/$e}),(function(t){return t.getUTCMinutes()}))).range,qe((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getUTCHours()}))).range,qe((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/864e5}),(function(t){return t.getUTCDate()-1}))),cr=sr;function ur(t){return qe((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/Ve}))}sr.range;var lr=ur(0),fr=ur(1),hr=ur(2),dr=ur(3),gr=ur(4),pr=ur(5),mr=ur(6),vr=((lr.range,fr.range,hr.range,dr.range,gr.range,pr.range,mr.range,qe((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}))).range,qe((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));vr.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qe((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var yr=vr;function br(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function _r(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function wr(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}vr.range;var xr,Ar,kr,Cr={"-":"",_:" ",0:"0"},Tr=/^\s*\d+/,Mr=/^%/,Sr=/[\\^$*+?|[\]().{}]/g;function Lr(t,n,e){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i68?1900:2e3),e+r[0].length):-1}function Rr(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Wr(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Ur(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Yr(t,n,e){var r=Tr.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function zr(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function qr(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Xr(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function $r(t,n,e){var r=Tr.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Vr(t,n,e){var r=Tr.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Gr(t,n,e){var r=Mr.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Qr(t,n,e){var r=Tr.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Kr(t,n,e){var r=Tr.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function Zr(t,n){return Lr(t.getDate(),n,2)}function Jr(t,n){return Lr(t.getHours(),n,2)}function to(t,n){return Lr(t.getHours()%12||12,n,2)}function no(t,n){return Lr(1+Qe.count(ar(t),t),n,3)}function eo(t,n){return Lr(t.getMilliseconds(),n,3)}function ro(t,n){return eo(t,n)+"000"}function oo(t,n){return Lr(t.getMonth()+1,n,2)}function io(t,n){return Lr(t.getMinutes(),n,2)}function ao(t,n){return Lr(t.getSeconds(),n,2)}function so(t){var n=t.getDay();return 0===n?7:n}function co(t,n){return Lr(Ze.count(ar(t),t),n,2)}function uo(t,n){var e=t.getDay();return t=e>=4||0===e?er(t):er.ceil(t),Lr(er.count(ar(t),t)+(4===ar(t).getDay()),n,2)}function lo(t){return t.getDay()}function fo(t,n){return Lr(Je.count(ar(t),t),n,2)}function ho(t,n){return Lr(t.getFullYear()%100,n,2)}function go(t,n){return Lr(t.getFullYear()%1e4,n,4)}function po(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Lr(n/60|0,"0",2)+Lr(n%60,"0",2)}function mo(t,n){return Lr(t.getUTCDate(),n,2)}function vo(t,n){return Lr(t.getUTCHours(),n,2)}function yo(t,n){return Lr(t.getUTCHours()%12||12,n,2)}function bo(t,n){return Lr(1+cr.count(yr(t),t),n,3)}function _o(t,n){return Lr(t.getUTCMilliseconds(),n,3)}function wo(t,n){return _o(t,n)+"000"}function xo(t,n){return Lr(t.getUTCMonth()+1,n,2)}function Ao(t,n){return Lr(t.getUTCMinutes(),n,2)}function ko(t,n){return Lr(t.getUTCSeconds(),n,2)}function Co(t){var n=t.getUTCDay();return 0===n?7:n}function To(t,n){return Lr(lr.count(yr(t),t),n,2)}function Mo(t,n){var e=t.getUTCDay();return t=e>=4||0===e?gr(t):gr.ceil(t),Lr(gr.count(yr(t),t)+(4===yr(t).getUTCDay()),n,2)}function So(t){return t.getUTCDay()}function Lo(t,n){return Lr(fr.count(yr(t),t),n,2)}function Do(t,n){return Lr(t.getUTCFullYear()%100,n,2)}function Bo(t,n){return Lr(t.getUTCFullYear()%1e4,n,4)}function Oo(){return"+0000"}function Po(){return"%"}function Fo(t){return+t}function Eo(t){return Math.floor(+t/1e3)}(xr=function(t){var n=t.dateTime,e=t.date,r=t.time,o=t.periods,i=t.days,a=t.shortDays,s=t.months,c=t.shortMonths,u=Br(o),l=Or(o),f=Br(i),h=Or(i),d=Br(a),g=Or(a),p=Br(s),m=Or(s),v=Br(c),y=Or(c),b={a:function(t){return a[t.getDay()]},A:function(t){return i[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Zr,e:Zr,f:ro,H:Jr,I:to,j:no,L:eo,m:oo,M:io,p:function(t){return o[+(t.getHours()>=12)]},Q:Fo,s:Eo,S:ao,u:so,U:co,V:uo,w:lo,W:fo,x:null,X:null,y:ho,Y:go,Z:po,"%":Po},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:mo,e:mo,f:wo,H:vo,I:yo,j:bo,L:_o,m:xo,M:Ao,p:function(t){return o[+(t.getUTCHours()>=12)]},Q:Fo,s:Eo,S:ko,u:Co,U:To,V:Mo,w:So,W:Lo,x:null,X:null,y:Do,Y:Bo,Z:Oo,"%":Po},w={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=g[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=y[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=p.exec(n.slice(e));return r?(t.m=m[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return k(t,n,e,r)},d:Ur,e:Ur,f:Vr,H:zr,I:zr,j:Yr,L:$r,m:Wr,M:qr,p:function(t,n,e){var r=u.exec(n.slice(e));return r?(t.p=l[r[0].toLowerCase()],e+r[0].length):-1},Q:Qr,s:Kr,S:Xr,u:Fr,U:Er,V:Nr,w:Pr,W:Hr,x:function(t,n,r){return k(t,e,n,r)},X:function(t,n,e){return k(t,r,n,e)},y:jr,Y:Ir,Z:Rr,"%":Gr};function x(t,n){return function(e){var r,o,i,a=[],s=-1,c=0,u=t.length;for(e instanceof Date||(e=new Date(+e));++s53)return null;"w"in i||(i.w=1),"Z"in i?(r=(o=(r=_r(wr(i.y))).getUTCDay())>4||0===o?fr.ceil(r):fr(r),r=cr.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(r=(o=(r=n(wr(i.y))).getDay())>4||0===o?Je.ceil(r):Je(r),r=Qe.offset(r,7*(i.V-1)),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?_r(wr(i.y)).getUTCDay():n(wr(i.y)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,_r(i)):n(i)}}function k(t,n,e,r){for(var o,i,a=0,s=n.length,c=e.length;a=c)return-1;if(37===(o=n.charCodeAt(a++))){if(o=n.charAt(a++),!(i=w[o in Cr?n.charAt(a++):o])||(r=i(t,e,r))<0)return-1}else if(o!=e.charCodeAt(r++))return-1}return r}return b.x=x(e,b),b.X=x(r,b),b.c=x(n,b),_.x=x(e,_),_.X=x(r,_),_.c=x(n,_),{format:function(t){var n=x(t+="",b);return n.toString=function(){return t},n},parse:function(t){var n=A(t+="",br);return n.toString=function(){return t},n},utcFormat:function(t){var n=x(t+="",_);return n.toString=function(){return t},n},utcParse:function(t){var n=A(t,_r);return n.toString=function(){return t},n}}}({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"]})).format,xr.parse,Ar=xr.utcFormat,kr=xr.utcParse,Date.prototype.toISOString||Ar("%Y-%m-%dT%H:%M:%S.%LZ"),+new Date("2000-01-01T00:00:00.000Z")||kr("%Y-%m-%dT%H:%M:%S.%LZ");var No=function(t){return t.match(/.{6}/g).map((function(t){return"#"+t}))};function Ho(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}function Io(t,n){var e,r,o=/(^([+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|^0x[\da-fA-F]+$|\d+)/g,i=/^\s+|\s+$/g,a=/\s+/g,s=/^0x[0-9a-f]+$/i,c=/^0/,u=function(t){return(Io.insensitive&&(""+t).toLowerCase()||""+t).replace(i,"")},l=u(t),f=u(n),h=l.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=f.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),g=parseInt(l.match(s),16)||1!==h.length&&Date.parse(l),p=parseInt(f.match(s),16)||g&&f.match(/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/)&&Date.parse(f)||null,m=function(t,n){return(!t.match(c)||1==n)&&parseFloat(t)||t.replace(a," ").replace(i,"")||0};if(p){if(gp)return 1}for(var v=0,y=h.length,b=d.length,_=Math.max(y,b);v<_;v++){if(e=m(h[v]||"",y),r=m(d[v]||"",b),isNaN(e)!==isNaN(r))return isNaN(e)?1:-1;if(/[^\x00-\x80]/.test(e+r)&&e.localeCompare){var w=e.localeCompare(r);return w/Math.abs(w)}if(er)return 1}}No("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),No("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),No("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),No("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),Ut(ht(300,.5,0),ht(-240,.5,1)),Ut(ht(-100,.75,.35),ht(80,1.5,.8)),Ut(ht(260,.75,.35),ht(80,1.5,.8)),ht(),Ho(No("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Ho(No("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Ho(No("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Ho(No("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));var jo=e(1);function Ro(t){this.config=JSON.parse(JSON.stringify(t)),function(t){t.chromosomesArray=[],t.coordinateSystem="iscn",t.maxLength={bp:0,iscn:0},t.chromosomes={},t.numChromosomes=0,t.config.debug||(t.config.debug=!1),t.config.dataDir||(t.config.dataDir=t.getDataDir()),t.config.container||(t.config.container="body"),t.selector=t.config.container+" #_ideogram",t.config.resolution||(t.config.resolution=""),t.config.orientation||(t.config.orientation="vertical"),t.config.brush||(t.config.brush=null),t.config.rows||(t.config.rows=1),"showChromosomeLabels"in t.config==0&&(t.config.showChromosomeLabels=!0),t.config.showNonNuclearChromosomes||(t.config.showNonNuclearChromosomes=!1)}(this),function(t){t.config.ploidy||(t.config.ploidy=1),t.config.ploidy>1&&(t.sexChromosomes={},t.config.sex||(t.config.sex="male"),2!==t.config.ploidy||t.config.ancestors||(t.config.ancestors={M:"#ffb6c1",P:"#add8e6"},t.config.ploidyDesc="MP"))}(this),function(t){t.config.showBandLabels||(t.config.showBandLabels=!1),"showFullyBanded"in t.config?t.config.showFullyBanded=t.config.showFullyBanded:t.config.showFullyBanded=!0,t.bandsToShow=[],t.bandData={}}(this),function(t){var n,e,r;t.config.chrHeight||(n=t.config.container,e=document.querySelector(n).getBoundingClientRect(),r="vertical"===t.config.orientation?e.height:e.width,"body"!==n&&0!==r||(r=400),t.config.chrHeight=r)}(this),function(t){var n,e;t.config.chrWidth||(n=10,(e=t.config.chrHeight)<900&&e>500?n=Math.round(e/40):e>=900&&(n=Math.round(e/45)),t.config.chrWidth=n)}(this),function(t){t.config.chrMargin||(1===t.config.ploidy?t.config.chrMargin=10:t.config.chrMargin=Math.round(t.config.chrWidth/4)),t.config.showBandLabels&&(t.config.chrMargin+=20)}(this),function(t,n){t.onLoad&&(n.onLoadCallback=t.onLoad),t.onLoadAnnots&&(n.onLoadAnnotsCallback=t.onLoadAnnots),t.onDrawAnnots&&(n.onDrawAnnotsCallback=t.onDrawAnnots),t.onBrushMove&&(n.onBrushMoveCallback=t.onBrushMove),t.onDidRotate&&(n.onDidRotateCallback=t.onDidRotate),t.onWillShowAnnotTooltip&&(n.onWillShowAnnotTooltipCallback=t.onWillShowAnnotTooltip)}(t,this),function(t){t.organisms={9606:{commonName:"Human",scientificName:"Homo sapiens",scientificNameAbbr:"H. sapiens",assemblies:{default:"GCF_000001405.26",GRCh38:"GCF_000001405.26",GRCh37:"GCF_000001405.13"}},10090:{commonName:"Mouse",scientificName:"Mus musculus",scientificNameAbbr:"M. musculus",assemblies:{default:"GCF_000001635.20"}},4641:{commonName:"banana",scientificName:"Musa acuminata",scientificNameAbbr:"M. acuminata",assemblies:{default:"mock"}}}}(this),function(t){t.bump=Math.round(t.config.chrHeight/125),t.adjustedBump=!1,t.config.chrHeight<200&&(t.adjustedBump=!0,t.bump=4)}(this),function(t,n){t.chromosome&&(n.config.chromosomes=[t.chromosome],"showBandLabels"in t==0&&(n.config.showBandLabels=!0),"rotatable"in t==0&&(n.config.rotatable=!1))}(t,this),this.initAnnotSettings(),this.config.chrMargin+=this.config.chrWidth,"heatmap"===this.config.annotationsLayout?this.config.chrMargin+=this.config.annotTracksHeight:this.config.chrMargin+=2*this.config.annotTracksHeight,this.init()}var Wo=jo.a.assign({},i);function Uo(t){void 0!==t.timeout&&window.clearTimeout(t.timeout),t.rawAnnots=t.setOriginalTrackIndexes(t.rawAnnots),t.config.annotationsDisplayedTracks?t.annots=t.updateDisplayedTracks(t.config.annotationsDisplayedTracks):(t.annots=t.processAnnotData(t.rawAnnots),t.config.filterable&&t.initCrossFilter(),t.drawProcessedAnnots(t.annots))}function Yo(t,n){var e=(new Date).getTime(),r=this.config;this.initDrawChromosomes(t),r.annotationsPath&&function(t){t.rawAnnots?Uo(t):function n(){t.timeout=setTimeout((function(){t.rawAnnots?Uo(t):n()}),50)}()}(this),function(t,n){var e,r,o,i;if(!0===t.showBandLabels&&(o=(new Date).getTime(),n.hideUnshownBandLabels(),i=(new Date).getTime(),t.debug&&console.log("Time in showing bands: "+(i-o)+" ms"),"vertical"===t.orientation))for(e=0;e0}return!0}}]),t}(),qo=jo.a.assign({},i),Xo=function(){function t(n){_classCallCheck(this,t),this._node=n}return _createClass(t,[{key:"getLabel",value:function(){return qo.select(this._node.parentNode).select("text.chrLabel").text()}},{key:"getSetLabel",value:function(){return qo.select(this._node.parentNode).select("text.chrSetLabel").text()}}]),t}(),$o=jo.a.assign({},i),Vo=function(){function t(n,e){if(_classCallCheck(this,t),this._config=n,this._ideo=e,this._ploidy=this._ideo._ploidy,this._translate=void 0,"chrSetMargin"in n)this.chrSetMargin=n.chrSetMargin;else{var r=this._config.chrMargin;this.chrSetMargin=this._config.ploidy>1?r:0}this._tickSize=8,this._isRotated=!1}return _createClass(t,[{key:"_getLeftMargin",value:function(){return this.margin.left}},{key:"_getYScale",value:function(){return 20/this._config.chrWidth}},{key:"getChromosomeLabels",value:function(t){var n=new Xo(t),e=[];return this._ideo.config.ploidy>1&&e.push(n.getSetLabel()),e.push(n.getLabel()),e.filter((function(t){return t.length>0}))}},{key:"getChromosomeBandLabelTranslate",value:function(t){var n,e,r,o=this._ideo,i=this._tickSize,a=o.config.orientation;return"vertical"===a?r="rotate(-90)translate("+(n=i)+","+(e=o.round(2+t.px.start+t.px.width/2))+")":"horizontal"===a&&(r="translate("+(n=o.round(-i+t.px.start+t.px.width/2))+","+(e=-10)+")"),{x:n,y:e,translate:r}}},{key:"didRotate",value:function(t,n){var e,r,o,i,a,s,c,u,l;r=(e=this._ideo).config.taxid,o=n.id.split("-")[0].replace("chr",""),i=(a=e.chromosomes[r][o]).bands,u=(c=$o.select(n.parentNode)).attr("transform"),l=/scale\(.*\)/.exec(u),u=u.replace(l,""),c.attr("transform",u),s=a.width,(a=e.getChromosomeModel(i,o,r,t)).oldWidth=s,e.chromosomes[r][o]=a,e.drawChromosome(a),e.handleRotateOnClick(),e.rawAnnots&&(e.displayedTrackIndexes?e.updateDisplayedTracks(e.displayedTrackIndexes):(e.annots=e.processAnnotData(e.rawAnnots),e.drawProcessedAnnots(e.annots),e.config.filterable&&e.initCrossFilter())),!0===e.config.showBandLabels&&(e.drawBandLabels(e.chromosomes),e.hideUnshownBandLabels()),e.onDidRotateCallback&&e.onDidRotateCallback(a)}},{key:"rotate",value:function(t,n,e){var r,o,i,a;r=this._ideo,a=r.selector+" .chrSetLabel, "+r.selector+" .chrLabel",i=document.querySelector(r.selector).getBoundingClientRect(),o=$o.selectAll(r.selector+" g.chromosome").filter((function(){return this!==e})),this._isRotated?(this._isRotated=!1,r.config.chrHeight=r.config.chrHeightOriginal,r.config.chrWidth=r.config.chrWidthOriginal,r.config.annotationHeight=r.config.annotationHeightOriginal,this.rotateBack(t,n,e,(function(){o.style("display",null),$o.selectAll(a).style("display",null),r._layout.didRotate(n,e)}))):(this._isRotated=!0,o.style("display","none"),$o.selectAll(a).style("display","none"),this.rotateForward(t,n,e,(function(){var t,o,a;r.config.chrHeightOriginal=r.config.chrHeight,r.config.chrWidthOriginal=r.config.chrWidth,r.config.annotationHeightOriginal=r.config.annotationHeight,"VerticalLayout"===r._layout._class?(o=i.width,a=window.innerWidth):(o=i.height-10,a=window.innerHeight-10),t=a0?n:n+4+2*t);if(!this._translate){var i;this._translate=[this._ploidy.getSetSize(0)*o*2];for(var a=1;a1&&(t*=1.8),t}},{key:"rotateForward",value:function(t,n,e,r){var o;Ko.select(e.parentNode).transition().attr("transform","rotate(90) translate(30, -37.5) ").on("end",r),o=this.getChromosomeLabels(e),Ko.select(this._ideo.getSvg()).append("g").attr("class","tmp").selectAll("text").data(o).enter().append("text").attr("class",(function(t,n){return 0===n&&2===o.length?"chrSetLabel":null})).attr("x",26).attr("y",(function(t,n){return 12*(n+1+o.length%2)})).style("text-anchor","middle").style("opacity",0).text(String).transition().style("opacity",1),this._ideo.config.orientation="vertical"}},{key:"rotateBack",value:function(t,n,e,r){var o=this.getChromosomeSetTranslate(t);Ko.select(e.parentNode).transition().attr("transform",o).on("end",r),Ko.selectAll(this._ideo.selector+" g.tmp").style("opacity",0).remove(),this._ideo.config.orientation="horizontal"}},{key:"getHeight",value:function(t){var n=this._config.chromosomes[t].length,e=this.getChromosomeSetYTranslate(n-1);return(e+=this._getChromosomeSetSize(n-1))+2*this._getAdditionalOffset()}},{key:"getWidth",value:function(){return this._config.chrHeight+1.5*this.margin.top}},{key:"getChromosomeSetLabelAnchor",value:function(){return"end"}},{key:"getChromosomeBandLabelAnchor",value:function(){return null}},{key:"getChromosomeBandTickY1",value:function(){return 2}},{key:"getChromosomeBandTickY2",value:function(){return 10}},{key:"getChromosomeSetLabelTranslate",value:function(){return null}},{key:"getChromosomeSetTranslate",value:function(t){return"translate("+this._getLeftMargin()+", "+this.getChromosomeSetYTranslate(t)+")"}},{key:"getChromosomeSetYTranslate",value:function(t){if(!this._config.ploidyDesc)return this._config.chrMargin*(t+1);if(!this._translate){this._translate=[1];for(var n=1;no-1?(e=this.margin.left+1.4*this._config.chrHeight,r=this.getChromosomeSetYTranslate(t-o)):(e=this.margin.left,r=this.getChromosomeSetYTranslate(t)),"rotate(90) translate("+e+", -"+r+")"}},{key:"getChromosomeSetYTranslate",value:function(t){var n=this._getAdditionalOffset();return this.margin.left*t+this._config.chrWidth+2*n+n*t}},{key:"getChromosomeSetLabelXPosition",value:function(t){return(this._ploidy.getSetSize(t)*this._config.chrWidth+20)/-2+(this._config.ploidy>1?0:this._config.chrWidth)}},{key:"getChromosomeLabelXPosition",value:function(){return this._config.chrWidth/-2}}]),n}(Vo),ni=jo.a.assign({},i);function ei(t,n,e){this.config.annotationsPath&&this.fetchAnnots(this.config.annotationsPath),function(t){if("ploidyDesc"in t.config&&"string"==typeof t.config.ploidyDesc){for(var n=[],e=0;e1?new ti(n,t):"vertical"===n.orientation?new Qo(n,t):"horizontal"===n.orientation?new Zo(n,t):new Qo(n,t)}(this),function(t,n){ni.selectAll(n.config.container+" #_ideogramOuterWrap").remove(),ni.select(n.config.container).append("div").attr("id","_ideogramOuterWrap").append("div").attr("id","_ideogramTrackLabelContainer").style("position","absolute"),ni.select(n.config.container+" #_ideogramOuterWrap").append("div").attr("id","_ideogramMiddleWrap").style("position","relative").style("overflow-x","auto").append("div").attr("id","_ideogramInnerWrap").append("svg").attr("id","_ideogram").attr("class",function(t){var n="";return t.config.showChromosomeLabels&&("horizontal"===t.config.orientation?n+="labeledLeft ":n+="labeled "),t.config.annotationsLayout&&"overlay"===t.config.annotationsLayout&&(n+="faint"),n}(n)).attr("width",n._layout.getWidth(t)).attr("height",n._layout.getHeight(t)).html(n.getBandColorGradients())}(n,this),this.isOnlyIdeogram=1===document.querySelectorAll("#_ideogram").length,function(t){ni.select(t.config.container+" #_ideogramOuterWrap").append("div").attr("class","_ideogramTooltip").attr("id","_ideogramTooltip").style("opacity",0).style("position","fixed").style("text-align","center").style("padding","4px").style("font","12px sans-serif").style("background","white").style("border","1px solid black").style("border-radius","5px").style("z-index","100")}(this),this.finishInit(t,e)}var ri=e(5),oi=jo.a.assign({},a,i);function ii(t,n,e){var r=e.config.ploidy;return"sex"in e.config&&(2===r&&e.sexChromosomes.index+2===n||"female"===e.config.sex&&"Y"===t.name)}function ai(t,n,e,r,o){var i,a,s,c;for(i=0;i=chrBands.length/2&&(n.coordinateSystem="bp")}function ci(t){var n,e,r,o=this.config.taxids,i=0;for(t.length>0&&(this.bandsArray={}),e=0;e=4&&(f=h[3],i[0]=f),h.length>=8&&(u=h[8].split(","),l=t.rgbToHex(u[0],u[1],u[2]),i.push(l)),[a,i])}},{key:"parseRawAnnots",value:function(t,n,e,r){var o,i,a,s,c,u;for(u=!0,!1===isNaN(parseInt(e[n],10))&&(u=!1),o=n;o=8&&c.push("color"),{keys:c,annots:t}}},{key:"parseBed",value:function(t,n){var e,r,o,i,a=[],s=t.split(/\r\n|\n/);for(r=Object.keys(n.chromosomes[n.config.taxid]),e=0;e")}(n),pi.select(n.config.container+" #_ideogramTrackLabel").interrupt().style("top","").style("left","").style("transform",null).style("transform","rotate(-90deg)").html(o),e=function(t,n,e){var r,o,i,a,s;return r=n.id.split("-").slice(0,-1).join("-")+"-0",o=pi.select(e.config.container+" #"+r).nodes()[0].getBoundingClientRect(),i=pi.select(e.config.container+" #_ideogramTrackLabel").nodes()[0].getBoundingClientRect(),a=pi.select(e.config.container).nodes()[0].getBoundingClientRect(),s=Math.round(o.left+i.width)-o.width-1,[s-=a.left-7,-(t.split("
").length-2)*o.width+2]}(o,t,n),i=(r=_slicedToArray(e,2))[0],function(t,n,e){pi.select(e.config.container+" #_ideogramTrackLabel").style("opacity",1).style("left",n+"px").style("top",t+"px").style("width","max-content").style("transform-origin","bottom left").style("text-align","left").on("mouseover",(function(){clearTimeout(e.hideTrackLabelTimeout)})).on("mouseout",(function(){vi(e)}))}(r[1],i,n)}(this,i)})).on("mouseout",(function(){vi(i)})),i.onDrawAnnotsCallback&&i.onDrawAnnotsCallback()}function xi(t,n,e,r,o){return t===n&&"+"===o&&e>r||e===o||0!==t&&t!==n&&e<=o&&e>r||0===t&&e<=o}function Ai(t,n){var e,r,o,i,a,s,c,u;for(e=0;e0&&(r+="-"+t.stop.toLocaleString()),n=r,e=24,t.name&&(n=(t.displayName?t.displayName:t.name)+"
"+n,e+=8),[n,e]}(t),function(t,n,e,r,o){t.html(n).style("opacity",1).style("left",e.e+"px").style("top",e.f-r+"px").style("pointer-events",null).on("mouseover",(function(){clearTimeout(o.hideAnnotTooltipTimeout)})).on("mouseout",(function(){o.startHideAnnotTooltipTimeout()}))}(i,(r=_slicedToArray(e,2))[0],o,r[1],this))}function Oi(t){var n,e,r=!1,o=(new Date).getTime();return n=this.chromosomes[this.config.taxid],function(t){"histogramScaling"in t.config==0&&(t.config.histogramScaling="absolute")}(this),void 0===this.maxAnnotsPerBar&&(this.maxAnnotsPerBar={},r=!0),function(t,n,e){var r,o,i,a,s,c,u;if(n||"relative"===e.config.histogramScaling){for(r=0,o=0;oi&&(i=u),u>r&&(r=u);e.maxAnnotsPerBar[s]=i}e.maxAnnotsPerBarAllChrs=r}}(e=function(t,n,e,r){var o,i,a,s,c,u,l,f,h,d,g=r.config.barWidth;for(o in t)for(i=t[o].annots,s=n[(a=e[t[o].chr]).chrIndex].annots,c=0;c=h&&l":"triangle"===r&&(n='"):n='",n}function Hi(t,n,e){var r,o,i;for(r=0;r"+(i=e.rows[r]).name+"",o=Fi*r,"name"in e&&(o+=Fi),n+=''+Ni(i)+"";return[t,n]}var Ii=Object.assign({},i);function ji(t){var n,e,r=[],o=this.chromosomes[this.config.taxid];if("annots"in t[0])return this.drawProcessedAnnots(t);for(e in o)r.push({chr:e,annots:[]});r=function(t,n){var e,r,o,i;for(e=0;e"+i.name+""),o=(s=_slicedToArray(Hi(o,r='',i),2))[0],r=s[1],a+=(r+="")+"
    "+o+"
"}var c=Pi.select(t.config.container+" #_ideogramOuterWrap");c.append("style").html(Ei),c.append("div").attr("id","_ideogramLegend").html(a)}(this),"heatmap"!==n?(function(t,n,e){var r;!function(t,n){var e,r;if("heatmap"!==t&&"histogram"!==t){for(r=0,e=0;e2e3&&console.warn('Rendering more than 2000 annotations in Ideogram?\nTry setting "annotationsLayout" to "heatmap" or "histogram" in your Ideogram configuration object for better layout and performance.')}}(t,n),"histogram"===t&&(n=e.getHistogramBars(n)),r=function(t,n){return Ii.selectAll(n.selector+" .chromosome").data(t).selectAll("path.annot").data((function(t){return t.annots})).enter()}(e.fillAnnots(n),e),"tracks"===t?function(t,n){var e,r=n.config.annotationHeight;e=function(t){var n;return{triangle:"m0,0 l -"+t+" "+2*t+" l "+2*t+" 0 z",circle:"m -"+(n=t)+", "+n+"a "+n+","+n+" 0 1,0 "+2*n+",0a "+n+","+n+" 0 1,0 -"+2*n+",0",rectangle:"m0,0 l 0 "+2*t+"l "+t+" 0l 0 -"+2*t+"z"}}(r),t.append("g").attr("id",(function(t){return t.id})).attr("class","annot").attr("transform",(function(t){var e=n.config.chrWidth+t.trackIndex*r*2;return"translate("+t.px+","+e+")"})).append("path").attr("d",(function(t){return function(t,n){return t.shape&&"triangle"!==t.shape?"circle"===t.shape?n.circle:"rectangle"===t.shape?n.rectangle:t.shape:n.triangle}(t,e)})).attr("fill",(function(t){return t.color})).on("mouseover",(function(t){n.showAnnotTooltip(t,this)})).on("mouseout",(function(){n.startHideAnnotTooltipTimeout()}))}(r,e):"overlay"===t?function(t,n){t.append("polygon").attr("id",(function(t){return t.id})).attr("class","annot").attr("points",(function(t){var e,r,o=n.config.chrWidth;return t.stopPx-t.startPx>1?(e=t.startPx,r=t.stopPx):(e=t.px-.5,r=t.px+.5),e+","+o+" "+r+","+o+" "+r+",0 "+e+",0"})).attr("fill",(function(t){return t.color})).on("mouseover",(function(t){n.showAnnotTooltip(t,this)})).on("mouseout",(function(){n.startHideAnnotTooltipTimeout()}))}(r,e):"histogram"===t&&function(t,n){var e,r,o={},i=n.config.chrWidth;for(r in e=n.chromosomes[n.config.taxid])o[r]=e[r];t.append("polygon").attr("class","annot").attr("points",(function(t){return function(t,n,e,r){var o,i,a,s;o=t.px+r.bump,i=t.px+r.config.barWidth+r.bump,a=n,s=n+t.height;var c=e[t.chr];return i>c&&(i=c),o+","+a+" "+i+","+a+" "+i+","+s+" "+o+","+s}(t,i,o,n)})).attr("fill",(function(t){return t.color}))}(r,e)}(n,t,this),this.onDrawAnnotsCallback&&this.onDrawAnnotsCallback()):this.drawHeatmaps(t)}var Wi=Object.assign({},i);function Ui(t,n,e){return t.append("g").attr("class","syntenicRegion").attr("id",n).on("click",(function(){var t=this,n=Wi.selectAll(e.selector+" .syntenicRegion").filter((function(){return this!==t}));n.classed("hidden",!n.classed("hidden"))})).on("mouseover",(function(){var t=this;Wi.selectAll(e.selector+" .syntenicRegion").filter((function(){return this!==t})).classed("ghost",!0)})).on("mouseout",(function(){Wi.selectAll(e.selector+" .syntenicRegion").classed("ghost",!1)}))}function Yi(t,n,e){var r,o;return r=t.r1,o=t.r2,r.startPx=e.convertBpToPx(r.chr,r.start)+n,r.stopPx=e.convertBpToPx(r.chr,r.stop)+n,o.startPx=e.convertBpToPx(o.chr,o.start)+n,o.stopPx=e.convertBpToPx(o.chr,o.stop)+n,[r,o]}function zi(t,n,e,r,o,i){var a,s;a="color"in i?i.color:"#CFC",s="opacity"in i?i.opacity:1,t.append("polygon").attr("points",n+", "+r.startPx+" "+n+", "+r.stopPx+" "+e+", "+o.stopPx+" "+e+", "+o.startPx).attr("style","fill: "+a+"; fill-opacity: "+s)}function qi(t,n,e,r,o){t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.startPx).attr("y2",o.startPx),t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.stopPx).attr("y2",o.stopPx)}function Xi(t){var n=(new Date).getTime();(function(t,n,e,r){var o,i,a,s,c,u,l,f;for(o=0;oc&&(c=s+1),i.splice(4,0,s),a.push(i);u.push({chr:o.chr,annots:a})}return n.numAvailTracks=c,u}(t.annots,this),n.splice(4,0,"trackIndexOriginal"),t={keys:n,annots:e},this.rawAnnots.metadata&&(t.metadata=this.rawAnnots.metadata),t)}var Ki=[["F00"],["F00","88F"],["F00","CCC","88F"],["F00","FA0","0AF","88F"],["F00","FA0","CCC","0AF","88F"],["F00","FA0","875","578","0AF","88F"],["F00","FA0","875","CCC","578","0AF","88F"],["F00","FA0","7A0","875","0A7","578","0AF","88F"],["F00","FA0","7A0","875","CCC","0A7","578","0AF","88F"],["F00","FA0","7A0","875","552","255","0A7","578","0AF","88F"]];function Zi(t,n,e,r,o,i,a){var s;return a.config.annotationTracks?o=function(t,n,e,r,o){var i;return n.trackIndex=e[3],(i=o.config.annotationTracks[n.trackIndex]).color&&(n.color=i.color),i.shape&&(n.shape=i.shape),t[r].annots.push(n),t}(o,t,e,i,a):"trackIndex"===n[3]&&1!==a.numAvailTracks?(o=(s=_slicedToArray(function(t,n,e,r,o,i){var a=Ki[i.numAvailTracks-1];return t.trackIndex=n[3],t.trackIndexOriginal=n[4],t.color="#"+a[t.trackIndexOriginal],t.trackIndex>i.config.numTracks-1?(t.trackIndex in e?e[t.trackIndex].push(t):e[t.trackIndex]=[t],[r,e]):(r[o].annots.push(t),[r,e])}(t,e,r,o,i,a),2))[0],r=s[1]):o=function(t,n,e,r){return n.trackIndex=0,n.color||(n.color=r.config.annotationsColor),n.shape||(n.shape="triangle"),t[e].annots.push(n),t}(o,t,i,a),[o,r]}function Ji(t,n,e,r,o,i,a){var s,c,u,l;for(s=0;s10&&console.error("Ideogram only displays up to 10 tracks at a time. You specified "+r+" tracks. Perhaps consider a different way to visualize your data."),(e=Object.keys(t).length)&&console.warn("Ideogram configuration specified "+r+" tracks, but loaded annotations contain "+e+" extra tracks.")}(i,this),o}var ea=jo.a.assign({},i,a);function ra(){var t=this.config;t.annotationsPath||t.localAnnotationsPath||this.annots||t.annotations?function(t,n){var e;n.annotationHeight||(e="heatmap"===n.annotationsLayout?n.chrWidth-1:Math.round(n.chrHeight/100),t.config.annotationHeight=e),n.annotationTracks?t.config.numAnnotTracks=n.annotationTracks.length:n.annotationsNumTracks?t.config.numAnnotTracks=n.annotationsNumTracks:t.config.numAnnotTracks=1,t.config.annotTracksHeight=n.annotationHeight*n.numAnnotTracks,void 0===n.barWidth&&(t.config.barWidth=3)}(this,t):this.config.annotTracksHeight=0,void 0===t.annotationsColor&&(this.config.annotationsColor="#F00"),function(t,n){!1!==n.showAnnotTooltip&&(t.config.showAnnotTooltip=!0),n.onWillShowAnnotTooltip&&(t.onWillShowAnnotTooltipCallback=n.onWillShowAnnotTooltip)}(this,t)}function oa(t){t.rawAnnots.annots=t.rawAnnots.annots.sort((function(t,n){return Io(t.chr,n.chr)})),t.onLoadAnnotsCallback&&t.onLoadAnnotsCallback(),t.config.heatmaps&&t.deserializeAnnotsForHeatmap(t.rawAnnots)}function ia(t){var n,e=this;"http"===t.slice(0,4)?(n=function(t){var n,e;return"bed"!==(e=(n=t.split("?")[0].split("."))[n.length-1])&&"json"!==e?(e=e.toUpperCase(),void alert("Ideogram.js only supports BED and Ideogram JSON at the moment. Sorry, check back soon for "+e+" support!")):e}(t),ea.text(t).then((function(t){e.rawAnnots="bed"===n?new gi(t,e).rawAnnots:JSON.parse(t),oa(e)}))):ea.json(e.config.annotationsPath).then((function(t){e.rawAnnots=t,oa(e)}))}function aa(t){var n,e,r,o,i,a,s;for(n=[],e=[],r=this.chromosomesArray,o=0;o100){if(void 0===e.recovering)return o.getAssemblyAndChromosomesFromEutils(e.callback,!0),Promise.reject("Unexpectedly found genomic scaffolds instead of chromosomes while querying RefSeq. Recovering.");throw Error("Failed to find chromosomes for genome "+r)}}(t,n,e),r=t.linksets[0].linksetdbs[0].links.join(","),o=e.ideo.esummary+"&db=nucleotide&id="+r,da.json(o)}(t,o,a)})).then((function(n){return o=function(t,n,e){var r,o,i=[];for(r in t)"uids"!==r&&(o=ga(t[r],e),i.push(o));return i=i.sort(Ideogram.sortChromosomes),e.coordinateSystem="bp",n.push(i),n}(n.result,o,i),t(o)}),(function(t){console.warn(t)}))}var ma,va,ya,ba=jo.a.assign({},i);function _a(){var t=this.bandsToShow.join(",");ba.selectAll(this.selector+" .bandLabel, .bandLabelStalk").style("display","none"),ba.selectAll(t).style("display","")}function wa(t,n,e,r,o){return n!==e&&(t=r[o.id][e]+36),t}function xa(t,n,e,r,o,i,a){var s,c;return e#_ideogram {padding-left: 5px;} #_ideogram .labeled {padding-left: 15px;} #_ideogram.labeledLeft {padding-left: 15px; padding-top: 15px;} #_ideogram text {font: 9px Tahoma; fill: #000;} #_ideogram .italic {font-style: italic;} #_ideogram .chromosome {cursor: pointer; fill: #AAA;}#_ideogram .chrSetLabel {font-weight: bolder;}#_ideogram .ghost {opacity: 0.2;}#_ideogram .hidden {display: none;}#_ideogram .bandLabelStalk line {stroke: #AAA; stroke-width: 1;}#_ideogram .syntenyBorder {stroke:#AAA;stroke-width:1;}#_ideogram .brush .selection { fill: #F00; stroke: #F00; fill-opacity: .3; shape-rendering: crispEdges;}#_ideogram .noBands {fill: #AAA;}#_ideogram .gneg {fill: #FFF}#_ideogram .gpos25 {fill: #BBB}#_ideogram .gpos33 {fill: #AAA}#_ideogram .gpos50 {fill: #888}#_ideogram .gpos66 {fill: #666}#_ideogram .gpos75 {fill: #444}#_ideogram .gpos100 {fill: #000}#_ideogram .gpos {fill: #000}#_ideogram .acen {fill: #FDD}#_ideogram .stalk {fill: #CCE;}#_ideogram .gvar {fill: #DDF}#_ideogram.faint .gneg {fill: #FFF}#_ideogram.faint .gpos25 {fill: #EEE}#_ideogram.faint .gpos33 {fill: #EEE}#_ideogram.faint .gpos50 {fill: #EEE}#_ideogram.faint .gpos66 {fill: #EEE}#_ideogram.faint .gpos75 {fill: #EEE}#_ideogram.faint .gpos100 {fill: #DDD}#_ideogram.faint .gpos {fill: #DDD}#_ideogram.faint .acen {fill: #FEE}#_ideogram.faint .stalk {fill: #EEF;}#_ideogram.faint .gvar {fill: #EEF}#_ideogram .gneg {fill: url("#gneg")} #_ideogram .gpos25 {fill: url("#gpos25")} #_ideogram .gpos33 {fill: url("#gpos33")} #_ideogram .gpos50 {fill: url("#gpos50")} #_ideogram .gpos66 {fill: url("#gpos66")} #_ideogram .gpos75 {fill: url("#gpos75")} #_ideogram .gpos100 {fill: url("#gpos100")} #_ideogram .gpos {fill: url("#gpos100")} #_ideogram .acen {fill: url("#acen")} #_ideogram .stalk {fill: url("#stalk")} #_ideogram .gvar {fill: url("#gvar")} #_ideogram .noBands {fill: url("#noBands")} #_ideogram .chromosome {fill: url("#noBands")} ',ya=' ';var Ca=jo.a.assign({},i);function Ta(t,n,e,r){var o=this,i=o._layout,a=e.chrIndex;return t.selectAll("text").data(n).enter().append("g").attr("class",(function(t,n){return"bandLabel bsbsl-"+n})).attr("transform",(function(t){var n=i.getChromosomeBandLabelTranslate(t,a);return"horizontal"===o.config.orientation?r[e.id].push(n.x+13):r[e.id].push(n.y+6),n.translate})).append("text").attr("text-anchor",i.getChromosomeBandLabelAnchor(a)).text((function(t){return t.name})),r}function Ma(t,n,e,r){var o=this;t.selectAll("line.bandLabelStalk").data(n).enter().append("g").attr("class",(function(t,n){return"bandLabelStalk bsbsl-"+n})).attr("transform",(function(t){var n;return n=o.round(t.px.start+t.px.width/2),r[e.id].push(n+13),"translate("+n+","+-10+")"})).append("line").attr("x1",0).attr("y1",o._layout.getChromosomeBandTickY1(e.chrIndex)).attr("x2",0).attr("y2",o._layout.getChromosomeBandTickY2(e.chrIndex))}function Sa(t){var n,e,r,o,i,a={};for(o=function(t){var n,e,r=[];for(n in t)for(e in t[n])r.push(t[n][e]);return r}(t),n=0;n',a+="gneg"===e?'':'',a+=""}return a}(ma),va+""+(t+=ya)+""}var Ba=e(4);function Oa(t,n,e,r){var o,i;return o=n[t],e.push(o),(i={iscn:o[o.length-1].iscn.stop,bp:o[o.length-1].bp.stop}).iscn>r.maxLength.iscn&&(r.maxLength.iscn=i.iscn),i.bp>r.maxLength.bp&&(r.maxLength.bp=i.bp),e}function Pa(t,n,e,r){var o,i;if("iscn"===r.coordinateSystem||r.config.multiorganism)e=function(t,n,e,r){var o,i,a;for(o=r.bandData[t],i=r.parseBands(o,t,n),n=Object.keys(i).sort((function(t,n){return Io(t,n)})),r.config.chromosomes[t]=n.slice(),r.numChromosomes+=r.config.chromosomes[t].length,a=0;ar.maxLength.bp&&(r.maxLength.bp=o.length);return e}function Fa(){var t,n,e,r,o,i,a,s,c=(new Date).getTime();e=[],t=function(t){var n,e,r;if(!0===t.config.multiorganism)for(t.coordinateSystem="bp",r=t.config.taxids,n=0;n1&&o.length>1&&(t=r[0].replace("chr",""),o=r[1].split("-"),n=parseInt(o[0]),e=parseInt(o[1]-1)),[t,n,e]}(t,n,e),t=(o=_slicedToArray(r,3))[0],n=o[1],e=o[2],u=(a=_slicedToArray(function(t,n){var e,r,o=[1],i=[1],a=t.bands.slice(-1)[0];for(r=0;r1){if(o=function(t,n){var e,r,o,i,a,s,c,u,l;for(e=0;e=a&&n<=s)return[u+l*(o+i/c*(n-a)-o)/i,r];return[null,r]}(t,n),r=(i=_slicedToArray(o,2))[0],e=i[1],null!==r)return r}else if(n>=1&&n<=t.length)return t.scale.bp*n;!function(t,n,e){throw new Error("Base pair out of range. bp: "+t+"; length of chr"+n.name+": "+e.bp.stop)}(n,t,e)}function Wa(t,n,e,r,o,i,a){var s,c,u,l;return a=t-n,s=r-o,c=i.bp.stop-i.bp.start,u=n+a/s*(e-o),l=i.bp.start+c*(u-n)/a,Math.round(l)}function Ua(t,n){var e,r,o,i,a,s;for(0===n&&(n=t.bands[0].px.start),e=0;e=o&&n<=i)return Wa(s,a,n,i,o,r,void 0);!function(t,n,e){throw new Error("Pixel out of range. px: "+t+"; length of chr"+n.name+": "+e)}(n,t,i)}Ea.scaleLinear=Ue,Ea.max=de;var Ya=e(6),za=Object.assign({},i);function qa(){var t,n,e=[],r=this.annots;for(n=0;n1&&this._model.bands.push({name:"q",px:{start:0,stop:this._model.width,width:this._model.width},bp:{start:1,stop:this._model.length}}),this._model}},{key:"getCssClass",value:function(){return"noBands"}}]),n}(Ka),Ja=function(){function t(n){_classCallCheck(this,t),this._config=n,this._ploidy=new zo(this._config)}return _createClass(t,[{key:"getArmColor",value:function(t,n,e){return this._config.armColors?this._config.armColors[e]:this._config.ancestors?this._getPolyploidArmColor(t,n,e):null}},{key:"getBorderColor",value:function(t,n,e){return n1&&(r=this._ploidy.getChromosomesNumber(n)),i=0;i1||""===n.orientation)&&(t-=1),t}(n,s),o=-4,!0===s.showBandLabels&&(o=s.chrMargin+s.chrWidth+26),i=s.chrMargin*n,s.numAnnotTracks>1==0&&(i+=1),a=i+o,t.selectAll("text.chrLabel").attr("transform",e.scaleSvg).selectAll("tspan").attr("x",e.x).attr("y",a)}(t,n,o,this):function(t,n,e,r){var o,i,a,s=r.config;o=-s.chrWidth-2,!0===s.showBandLabels&&(o=s.chrMargin+8),i=s.annotTracksHeight,"overlay"!==s.annotationsLayout&&(i*=2),a=3-(s.chrMargin*n+o)+i,a/=e.scale.x,t.selectAll("text.chrLabel").attr("transform","rotate(-90)"+e.scaleSvg).selectAll("tspan").attr("x",a).attr("y",e.y)}(t,n,o,this)}var hs=jo.a.assign({},i,a,o,r);hs.scaleLinear=Ue,hs.max=de;var ds=function(){function t(n){_classCallCheck(this,t),this.configure=Ro,this.initDrawChromosomes=ci,this.onLoad=li,this.handleRotateOnClick=ui,this.init=di,this.finishInit=Yo,this.writeContainer=ei,this.onLoadAnnots=Mi,this.onDrawAnnots=Si,this.processAnnotData=na,this.restoreDefaultTracks=Vi,this.updateDisplayedTracks=Gi,this.initAnnotSettings=ra,this.fetchAnnots=ia,this.drawAnnots=ji,this.getHistogramBars=Oi,this.drawHeatmaps=wi,this.deserializeAnnotsForHeatmap=Ci,this.fillAnnots=aa,this.drawProcessedAnnots=Ri,this.drawSynteny=Xi,this.startHideAnnotTooltipTimeout=Li,this.showAnnotTooltip=Bi,this.onWillShowAnnotTooltip=Di,this.setOriginalTrackIndexes=Qi,this.esearch=ua,this.esummary=la,this.elink=fa,this.getTaxidFromEutils=ha.b,this.setTaxidData=ha.e,this.setTaxidAndAssemblyAndChromosomes=ha.d,this.getOrganismFromEutils=ha.a,this.getTaxids=ha.c,this.getAssemblyAndChromosomesFromEutils=pa,this.parseBands=Ba.a,this.drawBandLabels=Sa,this.getBandColorGradients=Da,this.processBandData=Fa,this.setBandsToShow=ka,this.hideUnshownBandLabels=_a,this.drawBandLabelText=Ta,this.drawBandLabelStalk=Ma,this.onBrushMove=Na,this.createBrush=Ha,this.drawSexChromosomes=Ia,this.setSexChromosomes=ja,this.convertBpToPx=Ra,this.convertPxToBp=Ua,this.unpackAnnots=qa,this.packAnnots=Xa,this.initCrossFilter=$a,this.filterAnnots=Va,this.assemblyIsAccession=jo.b,this.getDataDir=jo.c,this.round=jo.h,this.onDidRotate=jo.g,this.getSvg=jo.d,this.getChromosomeModel=Qa,this.getChromosomePixels=Ga,this.drawChromosomeLabels=ls,this.rotateChromosomeLabels=fs,this.appendHomolog=is,this.drawChromosome=as,this.rotateAndToggleDisplay=ss,this.setOverflowScroll=cs,this.configure(n)}return _createClass(t,null,[{key:"slugify",value:function(t){return t.toLowerCase().replace(" ","-")}},{key:"sortChromosomes",value:function(t,n){var e="nuclear"===t.type,r="nuclear"===n.type,o="chloroplast"===t.type,i="chloroplast"===n.type,a="mitochondrion"===t.type,s="mitochondrion"===n.type,c="apicoplast"===t.type,u="apicoplast"===n.type;return e&&r?Io(t.name,n.name):!e&&r?1:a&&i?1:o&&s?-1:c||a||o||!(s||i||u)?void 0:-1}},{key:"version",get:function(){return"1.4.1"}},{key:"d3",get:function(){return hs}}]),t}();window.Ideogram=ds,n.default=ds}])},"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=n():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=n)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}).call(this,__webpack_require__(52)(module))},36:function(t,n,e){"use strict";e.r(n),e.d(n,"default",(function(){return p}));var r=e(1),o=e.n(r),i=e(137),a=e.n(i),s=e(163),c=e(11);function u(t){return(u="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})(t)}function l(){return(l=Object.assign||function(t){for(var n=1;n=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),o.hasOwnProperty(n)?{space:o[n],local:t}:t},a=function(t){var n=i(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===r&&n.documentElement.namespaceURI===r?n.createElement(t):n.createElementNS(e,t)}})(n)};function s(){}var c=function(t){return null==t?s:function(){return this.querySelector(t)}};function u(){return[]}var l=function(t){return null==t?u:function(){return this.querySelectorAll(t)}},f=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var h=document.documentElement;if(!h.matches){var d=h.webkitMatchesSelector||h.msMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector;f=function(t){return function(){return d.call(this,t)}}}}var g=f,p=function(t){return new Array(t.length)};function m(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}m.prototype={constructor:m,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var v="$";function y(t,n,e,r,o,i){for(var a,s=0,c=n.length,u=i.length;sn?1:t>=n?0:NaN}var w=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function x(t,n){return t.style.getPropertyValue(n)||w(t).getComputedStyle(t,null).getPropertyValue(n)}function A(t){return t.trim().split(/^|\s+/)}function k(t){return t.classList||new C(t)}function C(t){this._node=t,this._names=A(t.getAttribute("class")||"")}function T(t,n){for(var e=k(t),r=-1,o=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var N={},H=null;function I(t,n,e){return t=j(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function j(t,n,e){return function(r){var o=H;H=r;try{t.call(this,this.__data__,n,e)}finally{H=o}}}function R(t){return function(){var n=this.__on;if(n){for(var e,r=0,o=-1,i=n.length;r=x&&(x=w+1);!(_=m[x])&&++x=0;)(r=o[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=_);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):x(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=A(t+"");if(arguments.length<2){for(var r=k(this.node()),o=-1,i=e.length;++o=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),a=i.length;if(!(arguments.length<2)){for(s=n?W:R,null==e&&(e=!1),r=0;r=i?d=!0:(r=t.charCodeAt(a++))===l?g=!0:r===f&&(g=!0,t.charCodeAt(a)===l&&++a),t.slice(o+1,n-1).replace(/""/g,'"')}for(;a>>1;e>>1;t(n[i])>>1);--i>0;)e(t,i,o,n);return t}function e(n,e,r,o){for(var i,a=n[--o+e],s=t(a);(i=e<<1)<=r&&(it(n[o+i+1])&&i++,!(s<=t(n[o+i])));)n[o+e]=n[o+i],e=i;n[o+e]=a}return n.sort=function(t,n,r){for(var o,i=r-n;--i>0;)o=t[n],t[n]=t[n+i],t[n+i]=o,e(t,1,i,n);return t},n}function a(t){var n=i(t);return function(e,r,o,i){var a,s,c,u=new Array(i=Math.min(o-r,i));for(s=0;sa&&(u[0]=c,a=t(n(u,0,i)[0]))}while(++re&&t(n[i-1])>s;--i)n[i]=n[i-1];n[i]=a}return n}}function c(t){var n=s(t);return function e(r,o,i){return(i-o>1,l=u-a,f=u+a,h=n[s],d=t(h),g=n[l],p=t(g),m=n[u],v=t(m),y=n[f],b=t(y),_=n[c],w=t(_);d>p&&(i=h,h=g,g=i,i=d,d=p,p=i),b>w&&(i=y,y=_,_=i,i=b,b=w,w=i),d>v&&(i=h,h=m,m=i,i=d,d=v,v=i),p>v&&(i=g,g=m,m=i,i=p,p=v,v=i),d>b&&(i=h,h=y,y=i,i=d,d=b,b=i),v>b&&(i=m,m=y,y=i,i=v,v=b,b=i),p>w&&(i=g,g=_,_=i,i=p,p=w,w=i),p>v&&(i=g,g=m,m=i,i=p,p=v,v=i),b>w&&(i=y,y=_,_=i,i=b,b=w,w=i);var x=g,A=p,k=y,C=b;n[s]=h,n[l]=n[r],n[u]=m,n[f]=n[o-1],n[c]=_;var T=r+1,M=o-2,S=A<=C&&A>=C;if(S)for(var L=T;L<=M;++L){var D=n[L];if((O=t(D))A)for(;;){if(!((P=t(n[M]))>A)){if(PC)for(;;){if(!((P=t(n[M]))>C)){Pc){for(var B;(B=t(n[T]))<=A&&B>=A;)++T;for(;(P=t(n[M]))<=C&&P>=C;)--M;for(L=T;L<=M;L++){var O;if(D=n[L],(O=t(D))<=A&&O>=A)L!==T&&(n[L]=n[T],n[T]=D),T++;else if(O<=C&&O>=C)for(;;){var P;if(!((P=t(n[M]))<=C&&P>=C)){P32)throw new Error("invalid array width!");return t};function p(t){for(var n=new Array(t),e=-1;++er;)h[--s]=0},dimension:function(t){var l,M,S,L,D,B={filter:function(t){return null==t?X():Array.isArray(t)?q(t):"function"==typeof t?$(t):z(t)},filterExact:z,filterRange:q,filterFunction:$,filterAll:X,top:function(t){for(var n,e=[],r=j;--r>=I&&t>0;)h[n=M[r]]||(e.push(o[n]),--t);return e},bottom:function(t){for(var n,e=[],r=I;r0;)h[n=M[r]]||(e.push(o[n]),--t),r++;return e},group:G,groupAll:function(){var t=G(v),n=t.all;return delete t.all,delete t.top,delete t.order,delete t.orderNatural,delete t.size,t.value=function(){return n()[0].value},t},dispose:Q,remove:Q},O=~u&-~u,P=~O,F=c(function(t){return S[t]}),E=m,N=[],H=[],I=0,j=0;function R(n,r,o){S=n.map(t),L=F(function(t){for(var n=k(t,t),e=-1;++eI)for(r=I,o=Math.min(n,j);rj)for(r=Math.max(n,j),o=e;r1?d(c,s):k(s,D),M&&(f=(l=w[0]).key);N=y);)++N;for(;N_||(c[u=e[N]+i]=B,h[u]&P||(b.value=A(b.value,o[u])),++N>=a));)y=t(n[N]);H()}for(;OO)for(O=0;O1?(F=U,E=z):(!B&&j&&(B=1,r=[{key:null,value:T()}]),1===B?(F=Y,E=q):(F=v,E=v),c=null),p[u]=F}function W(){if(B>1){for(var t=B,n=r,e=k(t,t),o=0,i=0;o1)for(o=0;o1?(E=z,F=U):1===B?(E=q,F=Y):E=F=v}else if(1===B){if(j)return;for(o=0;o=0&&p.splice(t,1),(t=N.indexOf(R))>=0&&N.splice(t,1),(t=T.indexOf(W))>=0&&T.splice(t,1),e}return arguments.length<1&&(t=n),p.push(F),N.push(R),T.push(W),R(l,M,0,s),V().orderNatural()}function Q(){H.forEach(function(t){t.dispose()});var t=A.indexOf(R);return t>=0&&A.splice(t,1),(t=A.indexOf(W))>=0&&A.splice(t,1),(t=T.indexOf(U))>=0&&T.splice(t,1),u&=P,X()}return A.unshift(R),A.push(W),T.push(U),u|=O,(f>=32?!O:u&-(1<=0&&p.splice(t),(t=A.indexOf(c))>=0&&A.splice(t),i}return p.push(u),A.push(c),c(0,0),f()},size:function(){return s}},o=[],s=0,u=0,f=8,h=l(0),p=[],A=[],T=[];function M(n){var e=s,r=n.length;return r&&(o=o.concat(n),h=d(h,s+=r),A.forEach(function(t){t(n,e,r)})),t}return arguments.length?M(arguments[0]):t}function k(t,n){return(n<257?l:n<65537?f:h)(t)}function C(t){return 8===t?256:16===t?65536:4294967296}"undefined"!=typeof Uint8Array&&(l=function(t){return new Uint8Array(t)},f=function(t){return new Uint16Array(t)},h=function(t){return new Uint32Array(t)},d=function(t,n){if(t.length>=n)return t;var e=new t.constructor(n);return e.set(t),e},g=function(t,n){var e;switch(n){case 16:e=f(t.length);break;case 32:e=h(t.length);break;default:throw new Error("invalid array width!")}return e.set(t),e}),t.crossfilter=A}(void 0!==n&&n||this)},function(t,n,e){"use strict";e.r(n);var r={};e.r(r),e.d(r,"dispatch",function(){return h});var o={};e.r(o),e.d(o,"brush",function(){return ne}),e.d(o,"brushX",function(){return Jn}),e.d(o,"brushY",function(){return te}),e.d(o,"brushSelection",function(){return Zn});var i=e(0),a=e(2),s={value:function(){}};function c(){for(var t,n=0,e=arguments.length,r={};n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++i0)for(var e,r,o=new Array(e),i=0;i>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=A.exec(t))?O(parseInt(n[1],16)):(n=k.exec(t))?new N(n[1],n[2],n[3],1):(n=C.exec(t))?new N(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=T.exec(t))?P(n[1],n[2],n[3],n[4]):(n=M.exec(t))?P(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=S.exec(t))?I(n[1],n[2]/100,n[3]/100,1):(n=L.exec(t))?I(n[1],n[2]/100,n[3]/100,n[4]):D.hasOwnProperty(t)?O(D[t]):"transparent"===t?new N(NaN,NaN,NaN,0):null}function O(t){return new N(t>>16&255,t>>8&255,255&t,1)}function P(t,n,e,r){return r<=0&&(t=n=e=NaN),new N(t,n,e,r)}function F(t){return t instanceof y||(t=B(t)),t?new N((t=t.rgb()).r,t.g,t.b,t.opacity):new N}function E(t,n,e,r){return 1===arguments.length?F(t):new N(t,n,e,null==r?1:r)}function N(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function H(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function I(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new R(t,n,e,r)}function j(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof R)return new R(t.h,t.s,t.l,t.opacity);if(t instanceof y||(t=B(t)),!t)return new R;if(t instanceof R)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,o=Math.min(n,e,r),i=Math.max(n,e,r),a=NaN,s=i-o,c=(i+o)/2;return s?(a=n===i?(e-r)/s+6*(e0&&c<1?0:a,new R(a,s,c,t.opacity)}(t):new R(t,n,e,null==r?1:r)}function R(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function W(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}m(y,B,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),m(N,E,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+H(this.r)+H(this.g)+H(this.b)},toString:function(){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+")")}})),m(R,j,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new R(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new R(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,o=2*e-r;return new N(W(t>=240?t-240:t+120,o,r),W(t,o,r),W(t<120?t+240:t-120,o,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var U=Math.PI/180,Y=180/Math.PI,z=.96422,q=1,X=.82521,$=4/29,V=6/29,G=3*V*V,Q=V*V*V;function K(t){if(t instanceof Z)return new Z(t.l,t.a,t.b,t.opacity);if(t instanceof ot){if(isNaN(t.h))return new Z(t.l,0,0,t.opacity);var n=t.h*U;return new Z(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof N||(t=F(t));var e,r,o=et(t.r),i=et(t.g),a=et(t.b),s=J((.2225045*o+.7168786*i+.0606169*a)/q);return o===i&&i===a?e=r=s:(e=J((.4360747*o+.3850649*i+.1430804*a)/z),r=J((.0139322*o+.0971045*i+.7141733*a)/X)),new Z(116*s-16,500*(e-s),200*(s-r),t.opacity)}function Z(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function J(t){return t>Q?Math.pow(t,1/3):t/G+$}function tt(t){return t>V?t*t*t:G*(t-$)}function nt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function et(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function rt(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof ot)return new ot(t.h,t.c,t.l,t.opacity);if(t instanceof Z||(t=K(t)),0===t.a&&0===t.b)return new ot(NaN,0,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*Y;return new ot(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new ot(t,n,e,null==r?1:r)}function ot(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}m(Z,function(t,n,e,r){return 1===arguments.length?K(t):new Z(t,n,e,null==r?1:r)},v(y,{brighter:function(t){return new Z(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Z(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return new N(nt(3.1338561*(n=z*tt(n))-1.6168667*(t=q*tt(t))-.4906146*(e=X*tt(e))),nt(-.9787684*n+1.9161415*t+.033454*e),nt(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),m(ot,rt,v(y,{brighter:function(t){return new ot(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new ot(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return K(this).rgb()}}));var it=1.78277,at=-.29227,st=-.90649,ct=1.97294,ut=ct*st,lt=ct*it,ft=it*at- -.14861*st;function ht(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof dt)return new dt(t.h,t.s,t.l,t.opacity);t instanceof N||(t=F(t));var n=t.r/255,e=t.g/255,r=t.b/255,o=(ft*r+ut*n-lt*e)/(ft+ut-lt),i=r-o,a=(ct*(e-o)-at*i)/st,s=Math.sqrt(a*a+i*i)/(ct*o*(1-o)),c=s?Math.atan2(a,i)*Y-120:NaN;return new dt(c<0?c+360:c,s,o,t.opacity)}(t):new dt(t,n,e,null==r?1:r)}function dt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function gt(t,n,e,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*n+(4-6*i+3*a)*e+(1+3*t+3*i-3*a)*r+a*o)/6}m(dt,ht,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*U,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),o=Math.sin(t);return new N(255*(n+e*(-.14861*r+it*o)),255*(n+e*(at*r+st*o)),255*(n+e*(ct*r)),this.opacity)}}));var pt=function(t){return function(){return t}};function mt(t,n){return function(e){return t+e*n}}function vt(t,n){var e=n-t;return e?mt(t,e>180||e<-180?e-360*Math.round(e/360):e):pt(isNaN(t)?n:t)}function yt(t,n){var e=n-t;return e?mt(t,e):pt(isNaN(t)?n:t)}var bt=function t(n){var e=function(t){return 1==(t=+t)?yt:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):pt(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=E(t)).r,(n=E(n)).r),o=e(t.g,n.g),i=e(t.b,n.b),a=yt(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=o(n),t.b=i(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function _t(t){return function(n){var e,r,o=n.length,i=new Array(o),a=new Array(o),s=new Array(o);for(e=0;e=1?(e=1,n-1):Math.floor(e*n),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,s=ri&&(o=n.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(e=e[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,c.push({i:a,x:Ct(e,r)})),i=Mt.lastIndex;return i180?n+=360:n-t>180&&(t+=360),c.push({i:e.push(o(e)+"rotate(",null,r)-2,x:Ct(t,n)})):n&&e.push(o(e)+"rotate("+n+r)}(i.rotate,a.rotate,s),function(t,n,e,i){t!==n?c.push({i:e.push(o(e)+"skewX(",null,r)-2,x:Ct(t,n)}):n&&e.push(o(e)+"skewX("+n+r)}(i.skewX,a.skewX,s),function(t,n,e,r,i,a){if(t!==e||n!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Ct(t,e)},{i:s-2,x:Ct(n,r)})}else 1===e&&1===r||i.push(o(i)+"scale("+e+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,c),i=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Yt}()}finally{Yt=0,function(){for(var t,n,e=Rt,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Rt=n);Wt=t,on(r)}(),Vt=0}}function rn(){var t=Qt.now(),n=t-$t;n>Xt&&(Gt-=n,$t=t)}function on(t){Yt||(zt&&(zt=clearTimeout(zt)),t-Vt>24?(t<1/0&&(zt=setTimeout(en,t-Qt.now()-Gt)),qt&&(qt=clearInterval(qt))):(qt||($t=Qt.now(),qt=setInterval(rn,Xt)),Yt=1,Kt(en)))}tn.prototype=nn.prototype={constructor:tn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Zt():+e)+(null==n?0:+n),this._next||Wt===this||(Wt?Wt._next=this:Rt=this,Wt=this),this._call=t,this._time=e,on()},stop:function(){this._call&&(this._call=null,this._time=1/0,on())}};var an=function(t,n,e){var r=new tn;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r},sn=h("start","end","interrupt"),cn=[],un=0,ln=1,fn=2,hn=3,dn=4,gn=5,pn=6,mn=function(t,n,e,r,o,i){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,o=t.__transition;function i(c){var u,l,f,h;if(e.state!==ln)return s();for(u in o)if((h=o[u]).name===e.name){if(h.state===hn)return an(i);h.state===dn?(h.state=pn,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[u]):+uun)throw new Error("too late; already scheduled");return e}function yn(t,n){var e=bn(t,n);if(e.state>fn)throw new Error("too late; already started");return e}function bn(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var _n=function(t,n){var e,r,o,i=t.__transition,a=!0;if(i){for(o in n=null==n?null:n+"",i)(e=i[o]).name===n?(r=e.state>fn&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t})?vn:yn;return function(){var a=i(this,t),s=a.on;s!==r&&(o=(r=s).copy()).on(n,e),a.on=o}}(e,t,n))},attr:function(t,n){var e=Object(i.namespace)(t),r="transform"===e?Nt:xn;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,o,i;return function(){var a,s=e(this);if(null!=s)return(a=this.getAttributeNS(t.space,t.local))===s?null:a===r&&s===o?i:i=n(r=a,o=s);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,o,i;return function(){var a,s=e(this);if(null!=s)return(a=this.getAttribute(t))===s?null:a===r&&s===o?i:i=n(r=a,o=s);this.removeAttribute(t)}})(e,r,wn(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,o;return function(){var i=this.getAttributeNS(t.space,t.local);return i===e?null:i===r?o:o=n(r=i,e)}}:function(t,n,e){var r,o;return function(){var i=this.getAttribute(t);return i===e?null:i===r?o:o=n(r=i,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=Object(i.namespace)(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Et:xn;return null==n?this.styleTween(t,function(t,n){var e,r,o;return function(){var a=Object(i.style)(this,t),s=(this.style.removeProperty(t),Object(i.style)(this,t));return a===s?null:a===e&&s===r?o:o=n(e=a,r=s)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,o,a;return function(){var s=Object(i.style)(this,t),c=e(this);return null==c&&(this.style.removeProperty(t),c=Object(i.style)(this,t)),s===c?null:s===r&&c===o?a:a=n(r=s,o=c)}}(t,r,wn(this,"style."+t,n)):function(t,n,e){var r,o;return function(){var a=Object(i.style)(this,t);return a===e?null:a===r?o:o=n(r=a,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,o=n.apply(r,arguments);return o&&function(n){r.style.setProperty(t,o(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(wn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,o=bn(this.node(),e).tween,i=0,a=o.length;i0&&(e=o-m),C<0?h=d-v:C>0&&(a=s-v),A=Nn,I.attr("cursor",Un.selection),W());break;default:return}Fn()},!0).on("keyup.brush",function(){switch(i.event.keyCode){case 16:P&&(b=_=P=!1,W());break;case 18:A===In&&(k<0?l=f:k>0&&(e=o),C<0?h=d:C>0&&(a=s),A=Hn,W());break;case 32:A===Nn&&(i.event.altKey?(k&&(l=f-m*k,e=o+m*k),C&&(h=d-v*C,a=s+v*C),A=In):(k<0?l=f:k>0&&(e=o),C<0?h=d:C>0&&(a=s),A=Hn),I.attr("cursor",Un[x]),W());break;default:return}Fn()},!0).on("mousemove.brush",R,!0).on("mouseup.brush",U,!0);g(i.event.view)}Pn(),_n(w),c.call(w),N.start()}function R(){var t=Object(i.mouse)(w);!P||b||_||(Math.abs(t[0]-E[0])>Math.abs(t[1]-E[1])?_=!0:b=!0),E=t,y=!0,Fn(),W()}function W(){var t;switch(m=E[0]-F[0],v=E[1]-F[1],A){case Nn:case En:k&&(m=Math.max(L-e,Math.min(B-l,m)),o=e+m,f=l+m),C&&(v=Math.max(D-a,Math.min(O-h,v)),s=a+v,d=h+v);break;case Hn:k<0?(m=Math.max(L-e,Math.min(B-e,m)),o=e+m,f=l):k>0&&(m=Math.max(L-l,Math.min(B-l,m)),o=e,f=l+m),C<0?(v=Math.max(D-a,Math.min(O-a,v)),s=a+v,d=h):C>0&&(v=Math.max(D-h,Math.min(O-h,v)),s=a,d=h+v);break;case In:k&&(o=Math.max(L,Math.min(B,e-m*k)),f=Math.max(L,Math.min(B,l+m*k))),C&&(s=Math.max(D,Math.min(O,a-v*C)),d=Math.max(D,Math.min(O,h+v*C)))}fn?1:t>=n?0:NaN},oe=function(t){return 1===t.length&&(t=function(t){return function(n,e){return re(t(n),e)}}(t)),{left:function(n,e,r,o){for(null==r&&(r=0),null==o&&(o=n.length);r>>1;t(n[i],e)<0?r=i+1:o=i}return r},right:function(n,e,r,o){for(null==r&&(r=0),null==o&&(o=n.length);r>>1;t(n[i],e)>0?o=i:r=i+1}return r}}}(re),ie=oe.right,ae=(oe.left,ie),se=Array.prototype,ce=(se.slice,se.map,Math.sqrt(50)),ue=Math.sqrt(10),le=Math.sqrt(2),fe=function(t,n,e){var r,o,i,a,s=-1;if(e=+e,(t=+t)==(n=+n)&&e>0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),i=new Array(o=Math.ceil(n-t+1));++s=0?(i>=ce?10:i>=ue?5:i>=le?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=ce?10:i>=ue?5:i>=le?2:1)}var de=function(t,n){var e,r,o=t.length,i=-1;if(null==n){for(;++i=e)for(r=e;++ir&&(r=e)}else for(;++i=e)for(r=e;++ir&&(r=e);return r};function ge(){}function pe(t,n){var e=new ge;if(t instanceof ge)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,o=-1,i=t.length;if(null==n)for(;++o1?r[0]+r.slice(2):r,+t.slice(e+1)]},Se=function(t){return(t=Me(Math.abs(t)))?t[1]:NaN},Le=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function De(t){return new Be(t)}function Be(t){if(!(n=Le.exec(t)))throw new Error("invalid format: "+t);var n;this.fill=n[1]||" ",this.align=n[2]||">",this.sign=n[3]||"-",this.symbol=n[4]||"",this.zero=!!n[5],this.width=n[6]&&+n[6],this.comma=!!n[7],this.precision=n[8]&&+n[8].slice(1),this.trim=!!n[9],this.type=n[10]||""}De.prototype=Be.prototype,Be.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Oe,Pe,Fe,Ee,Ne=function(t){t:for(var n,e=t.length,r=1,o=-1;r0){if(!+t[r])break t;o=0}}return o>0?t.slice(0,o)+t.slice(n+1):t},He=function(t,n){var e=Me(t,n);if(!e)return t+"";var r=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")},Ie={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return He(100*t,n)},r:He,s:function(t,n){var e=Me(t,n);if(!e)return t+"";var r=e[0],o=e[1],i=o-(Oe=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Me(t,Math.max(0,n+i-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},je=function(t){return t},Re=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];Pe=function(t){var n=t.grouping&&t.thousands?function(t,n){return function(e,r){for(var o=e.length,i=[],a=0,s=t[0],c=0;o>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),i.push(e.substring(o-=s,o+s)),!((c+=s+1)>r));)s=t[a=(a+1)%t.length];return i.reverse().join(n)}}(t.grouping,t.thousands):je,e=t.currency,r=t.decimal,o=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}}(t.numerals):je,i=t.percent||"%";function a(t){var a=(t=De(t)).fill,s=t.align,c=t.sign,u=t.symbol,l=t.zero,f=t.width,h=t.comma,d=t.precision,g=t.trim,p=t.type;"n"===p?(h=!0,p="g"):Ie[p]||(null==d&&(d=12),g=!0,p="g"),(l||"0"===a&&"="===s)&&(l=!0,a="0",s="=");var m="$"===u?e[0]:"#"===u&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",v="$"===u?e[1]:/[%p]/.test(p)?i:"",y=Ie[p],b=/[defgprs%]/.test(p);function _(t){var e,i,u,_=m,w=v;if("c"===p)w=y(t)+w,t="";else{var x=(t=+t)<0;if(t=y(Math.abs(t),d),g&&(t=Ne(t)),x&&0==+t&&(x=!1),_=(x?"("===c?c:"-":"-"===c||"("===c?"":c)+_,w=("s"===p?Re[8+Oe/3]:"")+w+(x&&"("===c?")":""),b)for(e=-1,i=t.length;++e(u=t.charCodeAt(e))||u>57){w=(46===u?r+t.slice(e+1):t.slice(e))+w,t=t.slice(0,e);break}}h&&!l&&(t=n(t,1/0));var A=_.length+t.length+w.length,k=A>1)+_+t+w+k.slice(A);break;default:t=k+_+t+w}return o(t)}return d=null==d?6:/[gprs]/.test(p)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),_.toString=function(){return t+""},_}return{format:a,formatPrefix:function(t,n){var e=a(((t=De(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Se(n)/3))),o=Math.pow(10,-r),i=Re[8+r/3];return function(t){return e(o*t)+i}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),Fe=Pe.format,Ee=Pe.formatPrefix;var We=function(t,n,e){var r,o=t[0],i=t[t.length-1],a=function(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=ce?o*=10:i>=ue?o*=5:i>=le&&(o*=2),n2?Te:Ce,r=o=null,l}function l(n){return(r||(r=e(i,a,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,s)))(+n)}return l.invert=function(t){return(o||(o=e(a,i,ke,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},l.domain=function(t){return arguments.length?(i=be.call(t,xe),u()):i.slice()},l.range=function(t){return arguments.length?(a=_e.call(t),u()):a.slice()},l.rangeRound=function(t){return a=_e.call(t),s=Dt,u()},l.clamp=function(t){return arguments.length?(c=!!t,u()):c},l.interpolate=function(t){return arguments.length?(s=t,u()):s},u()}(ke,Ct);return t.copy=function(){return function(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}(t,Ue())},function(t){var n=t.domain;return t.ticks=function(t){var e=n();return fe(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return We(n(),t,e)},t.nice=function(e){null==e&&(e=10);var r,o=n(),i=0,a=o.length-1,s=o[i],c=o[a];return c0?r=he(s=Math.floor(s/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=he(s=Math.ceil(s*r)/r,c=Math.floor(c*r)/r,e)),r>0?(o[i]=Math.floor(s/r)*r,o[a]=Math.ceil(c/r)*r,n(o)):r<0&&(o[i]=Math.ceil(s*r)/r,o[a]=Math.floor(c*r)/r,n(o)),t},t}(t)}var Ye=new Date,ze=new Date;function qe(t,n,e,r){function o(n){return t(n=new Date(+n)),n}return o.floor=o,o.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},o.round=function(t){var n=o(t),e=o.ceil(t);return t-n0))return s;do{s.push(a=new Date(+e)),n(e,i),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(o.count=function(n,r){return Ye.setTime(+n),ze.setTime(+r),t(Ye),t(ze),Math.floor(e(Ye,ze))},o.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?o.filter(r?function(n){return r(n)%t==0}:function(n){return o.count(0,n)%t==0}):o:null}),o}var Xe=qe(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});Xe.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?qe(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Xe:null},Xe.range;var $e=6e4,Ve=6048e5,Ge=(((qe(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}).range,qe(function(t){t.setTime(Math.floor(t/$e)*$e)},function(t,n){t.setTime(+t+n*$e)},function(t,n){return(n-t)/$e},function(t){return t.getMinutes()})).range,qe(function(t){var n=t.getTimezoneOffset()*$e%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()})).range,qe(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*$e)/864e5},function(t){return t.getDate()-1})),Qe=Ge;function Ke(t){return qe(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*$e)/Ve})}Ge.range;var Ze=Ke(0),Je=Ke(1),tr=Ke(2),nr=Ke(3),er=Ke(4),rr=Ke(5),or=Ke(6),ir=((Ze.range,Je.range,tr.range,nr.range,er.range,rr.range,or.range,qe(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()})).range,qe(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()}));ir.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qe(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var ar=ir,sr=(((ir.range,qe(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*$e)},function(t,n){return(n-t)/$e},function(t){return t.getUTCMinutes()})).range,qe(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()})).range,qe(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1})),cr=sr;function ur(t){return qe(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/Ve})}sr.range;var lr=ur(0),fr=ur(1),hr=ur(2),dr=ur(3),gr=ur(4),pr=ur(5),mr=ur(6),vr=((lr.range,fr.range,hr.range,dr.range,gr.range,pr.range,mr.range,qe(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()})).range,qe(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()}));vr.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qe(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var yr=vr;function br(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function _r(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function wr(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}vr.range;var xr,Ar,kr,Cr={"-":"",_:" ",0:"0"},Tr=/^\s*\d+/,Mr=/^%/,Sr=/[\\^$*+?|[\]().{}]/g;function Lr(t,n,e){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i68?1900:2e3),e+r[0].length):-1}function Rr(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Wr(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Ur(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Yr(t,n,e){var r=Tr.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function zr(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function qr(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Xr(t,n,e){var r=Tr.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function $r(t,n,e){var r=Tr.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Vr(t,n,e){var r=Tr.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Gr(t,n,e){var r=Mr.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Qr(t,n,e){var r=Tr.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Kr(t,n,e){var r=Tr.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function Zr(t,n){return Lr(t.getDate(),n,2)}function Jr(t,n){return Lr(t.getHours(),n,2)}function to(t,n){return Lr(t.getHours()%12||12,n,2)}function no(t,n){return Lr(1+Qe.count(ar(t),t),n,3)}function eo(t,n){return Lr(t.getMilliseconds(),n,3)}function ro(t,n){return eo(t,n)+"000"}function oo(t,n){return Lr(t.getMonth()+1,n,2)}function io(t,n){return Lr(t.getMinutes(),n,2)}function ao(t,n){return Lr(t.getSeconds(),n,2)}function so(t){var n=t.getDay();return 0===n?7:n}function co(t,n){return Lr(Ze.count(ar(t),t),n,2)}function uo(t,n){var e=t.getDay();return t=e>=4||0===e?er(t):er.ceil(t),Lr(er.count(ar(t),t)+(4===ar(t).getDay()),n,2)}function lo(t){return t.getDay()}function fo(t,n){return Lr(Je.count(ar(t),t),n,2)}function ho(t,n){return Lr(t.getFullYear()%100,n,2)}function go(t,n){return Lr(t.getFullYear()%1e4,n,4)}function po(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Lr(n/60|0,"0",2)+Lr(n%60,"0",2)}function mo(t,n){return Lr(t.getUTCDate(),n,2)}function vo(t,n){return Lr(t.getUTCHours(),n,2)}function yo(t,n){return Lr(t.getUTCHours()%12||12,n,2)}function bo(t,n){return Lr(1+cr.count(yr(t),t),n,3)}function _o(t,n){return Lr(t.getUTCMilliseconds(),n,3)}function wo(t,n){return _o(t,n)+"000"}function xo(t,n){return Lr(t.getUTCMonth()+1,n,2)}function Ao(t,n){return Lr(t.getUTCMinutes(),n,2)}function ko(t,n){return Lr(t.getUTCSeconds(),n,2)}function Co(t){var n=t.getUTCDay();return 0===n?7:n}function To(t,n){return Lr(lr.count(yr(t),t),n,2)}function Mo(t,n){var e=t.getUTCDay();return t=e>=4||0===e?gr(t):gr.ceil(t),Lr(gr.count(yr(t),t)+(4===yr(t).getUTCDay()),n,2)}function So(t){return t.getUTCDay()}function Lo(t,n){return Lr(fr.count(yr(t),t),n,2)}function Do(t,n){return Lr(t.getUTCFullYear()%100,n,2)}function Bo(t,n){return Lr(t.getUTCFullYear()%1e4,n,4)}function Oo(){return"+0000"}function Po(){return"%"}function Fo(t){return+t}function Eo(t){return Math.floor(+t/1e3)}(xr=function(t){var n=t.dateTime,e=t.date,r=t.time,o=t.periods,i=t.days,a=t.shortDays,s=t.months,c=t.shortMonths,u=Br(o),l=Or(o),f=Br(i),h=Or(i),d=Br(a),g=Or(a),p=Br(s),m=Or(s),v=Br(c),y=Or(c),b={a:function(t){return a[t.getDay()]},A:function(t){return i[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Zr,e:Zr,f:ro,H:Jr,I:to,j:no,L:eo,m:oo,M:io,p:function(t){return o[+(t.getHours()>=12)]},Q:Fo,s:Eo,S:ao,u:so,U:co,V:uo,w:lo,W:fo,x:null,X:null,y:ho,Y:go,Z:po,"%":Po},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:mo,e:mo,f:wo,H:vo,I:yo,j:bo,L:_o,m:xo,M:Ao,p:function(t){return o[+(t.getUTCHours()>=12)]},Q:Fo,s:Eo,S:ko,u:Co,U:To,V:Mo,w:So,W:Lo,x:null,X:null,y:Do,Y:Bo,Z:Oo,"%":Po},w={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=g[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=y[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=p.exec(n.slice(e));return r?(t.m=m[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return k(t,n,e,r)},d:Ur,e:Ur,f:Vr,H:zr,I:zr,j:Yr,L:$r,m:Wr,M:qr,p:function(t,n,e){var r=u.exec(n.slice(e));return r?(t.p=l[r[0].toLowerCase()],e+r[0].length):-1},Q:Qr,s:Kr,S:Xr,u:Fr,U:Er,V:Nr,w:Pr,W:Hr,x:function(t,n,r){return k(t,e,n,r)},X:function(t,n,e){return k(t,r,n,e)},y:jr,Y:Ir,Z:Rr,"%":Gr};function x(t,n){return function(e){var r,o,i,a=[],s=-1,c=0,u=t.length;for(e instanceof Date||(e=new Date(+e));++s53)return null;"w"in i||(i.w=1),"Z"in i?(r=(o=(r=_r(wr(i.y))).getUTCDay())>4||0===o?fr.ceil(r):fr(r),r=cr.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(r=(o=(r=n(wr(i.y))).getDay())>4||0===o?Je.ceil(r):Je(r),r=Qe.offset(r,7*(i.V-1)),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?_r(wr(i.y)).getUTCDay():n(wr(i.y)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,_r(i)):n(i)}}function k(t,n,e,r){for(var o,i,a=0,s=n.length,c=e.length;a=c)return-1;if(37===(o=n.charCodeAt(a++))){if(o=n.charAt(a++),!(i=w[o in Cr?n.charAt(a++):o])||(r=i(t,e,r))<0)return-1}else if(o!=e.charCodeAt(r++))return-1}return r}return b.x=x(e,b),b.X=x(r,b),b.c=x(n,b),_.x=x(e,_),_.X=x(r,_),_.c=x(n,_),{format:function(t){var n=x(t+="",b);return n.toString=function(){return t},n},parse:function(t){var n=A(t+="",br);return n.toString=function(){return t},n},utcFormat:function(t){var n=x(t+="",_);return n.toString=function(){return t},n},utcParse:function(t){var n=A(t,_r);return n.toString=function(){return t},n}}}({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"]})).format,xr.parse,Ar=xr.utcFormat,kr=xr.utcParse,Date.prototype.toISOString||Ar("%Y-%m-%dT%H:%M:%S.%LZ"),+new Date("2000-01-01T00:00:00.000Z")||kr("%Y-%m-%dT%H:%M:%S.%LZ");var No=function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})};function Ho(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}function Io(t,n){var e,r,o=/(^([+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|^0x[\da-fA-F]+$|\d+)/g,i=/^\s+|\s+$/g,a=/\s+/g,s=/^0x[0-9a-f]+$/i,c=/^0/,u=function(t){return(Io.insensitive&&(""+t).toLowerCase()||""+t).replace(i,"")},l=u(t),f=u(n),h=l.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=f.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),g=parseInt(l.match(s),16)||1!==h.length&&Date.parse(l),p=parseInt(f.match(s),16)||g&&f.match(/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/)&&Date.parse(f)||null,m=function(t,n){return(!t.match(c)||1==n)&&parseFloat(t)||t.replace(a," ").replace(i,"")||0};if(p){if(gp)return 1}for(var v=0,y=h.length,b=d.length,_=Math.max(y,b);v<_;v++){if(e=m(h[v]||"",y),r=m(d[v]||"",b),isNaN(e)!==isNaN(r))return isNaN(e)?1:-1;if(/[^\x00-\x80]/.test(e+r)&&e.localeCompare){var w=e.localeCompare(r);return w/Math.abs(w)}if(er)return 1}}No("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),No("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),No("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),No("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),Ut(ht(300,.5,0),ht(-240,.5,1)),Ut(ht(-100,.75,.35),ht(80,1.5,.8)),Ut(ht(260,.75,.35),ht(80,1.5,.8)),ht(),Ho(No("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Ho(No("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Ho(No("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Ho(No("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));var jo=e(1);function Ro(t){this.config=JSON.parse(JSON.stringify(t)),function(t){t.chromosomesArray=[],t.coordinateSystem="iscn",t.maxLength={bp:0,iscn:0},t.chromosomes={},t.numChromosomes=0,t.config.debug||(t.config.debug=!1),t.config.dataDir||(t.config.dataDir=t.getDataDir()),t.config.container||(t.config.container="body"),t.selector=t.config.container+" #_ideogram",t.config.resolution||(t.config.resolution=""),t.config.orientation||(t.config.orientation="vertical"),t.config.brush||(t.config.brush=null),t.config.rows||(t.config.rows=1),"showChromosomeLabels"in t.config==0&&(t.config.showChromosomeLabels=!0),t.config.showNonNuclearChromosomes||(t.config.showNonNuclearChromosomes=!1)}(this),function(t){t.config.ploidy||(t.config.ploidy=1),t.config.ploidy>1&&(t.sexChromosomes={},t.config.sex||(t.config.sex="male"),2!==t.config.ploidy||t.config.ancestors||(t.config.ancestors={M:"#ffb6c1",P:"#add8e6"},t.config.ploidyDesc="MP"))}(this),function(t){t.config.showBandLabels||(t.config.showBandLabels=!1),"showFullyBanded"in t.config?t.config.showFullyBanded=t.config.showFullyBanded:t.config.showFullyBanded=!0,t.bandsToShow=[],t.bandData={}}(this),function(t){var n,e,r;t.config.chrHeight||(n=t.config.container,e=document.querySelector(n).getBoundingClientRect(),r="vertical"===t.config.orientation?e.height:e.width,"body"!==n&&0!==r||(r=400),t.config.chrHeight=r)}(this),function(t){var n,e;t.config.chrWidth||(n=10,(e=t.config.chrHeight)<900&&e>500?n=Math.round(e/40):e>=900&&(n=Math.round(e/45)),t.config.chrWidth=n)}(this),function(t){t.config.chrMargin||(1===t.config.ploidy?t.config.chrMargin=10:t.config.chrMargin=Math.round(t.config.chrWidth/4)),t.config.showBandLabels&&(t.config.chrMargin+=20)}(this),function(t,n){t.onLoad&&(n.onLoadCallback=t.onLoad),t.onLoadAnnots&&(n.onLoadAnnotsCallback=t.onLoadAnnots),t.onDrawAnnots&&(n.onDrawAnnotsCallback=t.onDrawAnnots),t.onBrushMove&&(n.onBrushMoveCallback=t.onBrushMove),t.onDidRotate&&(n.onDidRotateCallback=t.onDidRotate),t.onWillShowAnnotTooltip&&(n.onWillShowAnnotTooltipCallback=t.onWillShowAnnotTooltip)}(t,this),function(t){t.organisms={9606:{commonName:"Human",scientificName:"Homo sapiens",scientificNameAbbr:"H. sapiens",assemblies:{default:"GCF_000001405.26",GRCh38:"GCF_000001405.26",GRCh37:"GCF_000001405.13"}},10090:{commonName:"Mouse",scientificName:"Mus musculus",scientificNameAbbr:"M. musculus",assemblies:{default:"GCF_000001635.20"}},4641:{commonName:"banana",scientificName:"Musa acuminata",scientificNameAbbr:"M. acuminata",assemblies:{default:"mock"}}}}(this),function(t){t.bump=Math.round(t.config.chrHeight/125),t.adjustedBump=!1,t.config.chrHeight<200&&(t.adjustedBump=!0,t.bump=4)}(this),function(t,n){t.chromosome&&(n.config.chromosomes=[t.chromosome],"showBandLabels"in t==0&&(n.config.showBandLabels=!0),"rotatable"in t==0&&(n.config.rotatable=!1))}(t,this),this.initAnnotSettings(),this.config.chrMargin+=this.config.chrWidth,"heatmap"===this.config.annotationsLayout?this.config.chrMargin+=this.config.annotTracksHeight:this.config.chrMargin+=2*this.config.annotTracksHeight,this.init()}var Wo=jo.a.assign({},i);function Uo(t){void 0!==t.timeout&&window.clearTimeout(t.timeout),t.rawAnnots=t.setOriginalTrackIndexes(t.rawAnnots),t.config.annotationsDisplayedTracks?t.annots=t.updateDisplayedTracks(t.config.annotationsDisplayedTracks):(t.annots=t.processAnnotData(t.rawAnnots),t.config.filterable&&t.initCrossFilter(),t.drawProcessedAnnots(t.annots))}function Yo(t,n){var e=(new Date).getTime(),r=this.config;this.initDrawChromosomes(t),r.annotationsPath&&function(t){t.rawAnnots?Uo(t):function n(){t.timeout=setTimeout(function(){t.rawAnnots?Uo(t):n()},50)}()}(this),function(t,n){var e,r,o,i;if(!0===t.showBandLabels&&(o=(new Date).getTime(),n.hideUnshownBandLabels(),i=(new Date).getTime(),t.debug&&console.log("Time in showing bands: "+(i-o)+" ms"),"vertical"===t.orientation))for(e=0;e0}return!0}}]),t}(),qo=jo.a.assign({},i),Xo=function(){function t(n){_classCallCheck(this,t),this._node=n}return _createClass(t,[{key:"getLabel",value:function(){return qo.select(this._node.parentNode).select("text.chrLabel").text()}},{key:"getSetLabel",value:function(){return qo.select(this._node.parentNode).select("text.chrSetLabel").text()}}]),t}(),$o=jo.a.assign({},i),Vo=function(){function t(n,e){if(_classCallCheck(this,t),this._config=n,this._ideo=e,this._ploidy=this._ideo._ploidy,this._translate=void 0,"chrSetMargin"in n)this.chrSetMargin=n.chrSetMargin;else{var r=this._config.chrMargin;this.chrSetMargin=this._config.ploidy>1?r:0}this._tickSize=8,this._isRotated=!1}return _createClass(t,[{key:"_getLeftMargin",value:function(){return this.margin.left}},{key:"_getYScale",value:function(){return 20/this._config.chrWidth}},{key:"getChromosomeLabels",value:function(t){var n=new Xo(t),e=[];return this._ideo.config.ploidy>1&&e.push(n.getSetLabel()),e.push(n.getLabel()),e.filter(function(t){return t.length>0})}},{key:"getChromosomeBandLabelTranslate",value:function(t){var n,e,r,o=this._ideo,i=this._tickSize,a=o.config.orientation;return"vertical"===a?r="rotate(-90)translate("+(n=i)+","+(e=o.round(2+t.px.start+t.px.width/2))+")":"horizontal"===a&&(r="translate("+(n=o.round(-i+t.px.start+t.px.width/2))+","+(e=-10)+")"),{x:n,y:e,translate:r}}},{key:"didRotate",value:function(t,n){var e,r,o,i,a,s,c,u,l;r=(e=this._ideo).config.taxid,o=n.id.split("-")[0].replace("chr",""),i=(a=e.chromosomes[r][o]).bands,u=(c=$o.select(n.parentNode)).attr("transform"),l=/scale\(.*\)/.exec(u),u=u.replace(l,""),c.attr("transform",u),s=a.width,(a=e.getChromosomeModel(i,o,r,t)).oldWidth=s,e.chromosomes[r][o]=a,e.drawChromosome(a),e.handleRotateOnClick(),e.rawAnnots&&(e.displayedTrackIndexes?e.updateDisplayedTracks(e.displayedTrackIndexes):(e.annots=e.processAnnotData(e.rawAnnots),e.drawProcessedAnnots(e.annots),e.config.filterable&&e.initCrossFilter())),!0===e.config.showBandLabels&&(e.drawBandLabels(e.chromosomes),e.hideUnshownBandLabels()),e.onDidRotateCallback&&e.onDidRotateCallback(a)}},{key:"rotate",value:function(t,n,e){var r,o,i,a;r=this._ideo,a=r.selector+" .chrSetLabel, "+r.selector+" .chrLabel",i=document.querySelector(r.selector).getBoundingClientRect(),o=$o.selectAll(r.selector+" g.chromosome").filter(function(){return this!==e}),this._isRotated?(this._isRotated=!1,r.config.chrHeight=r.config.chrHeightOriginal,r.config.chrWidth=r.config.chrWidthOriginal,r.config.annotationHeight=r.config.annotationHeightOriginal,this.rotateBack(t,n,e,function(){o.style("display",null),$o.selectAll(a).style("display",null),r._layout.didRotate(n,e)})):(this._isRotated=!0,o.style("display","none"),$o.selectAll(a).style("display","none"),this.rotateForward(t,n,e,function(){var t,o,a;r.config.chrHeightOriginal=r.config.chrHeight,r.config.chrWidthOriginal=r.config.chrWidth,r.config.annotationHeightOriginal=r.config.annotationHeight,"VerticalLayout"===r._layout._class?(o=i.width,a=window.innerWidth):(o=i.height-10,a=window.innerHeight-10),t=a0?n:n+4+2*t);if(!this._translate){var i;this._translate=[this._ploidy.getSetSize(0)*o*2];for(var a=1;a1&&(t*=1.8),t}},{key:"rotateForward",value:function(t,n,e,r){var o;Ko.select(e.parentNode).transition().attr("transform","rotate(90) translate(30, -37.5) ").on("end",r),o=this.getChromosomeLabels(e),Ko.select(this._ideo.getSvg()).append("g").attr("class","tmp").selectAll("text").data(o).enter().append("text").attr("class",function(t,n){return 0===n&&2===o.length?"chrSetLabel":null}).attr("x",26).attr("y",function(t,n){return 12*(n+1+o.length%2)}).style("text-anchor","middle").style("opacity",0).text(String).transition().style("opacity",1),this._ideo.config.orientation="vertical"}},{key:"rotateBack",value:function(t,n,e,r){var o=this.getChromosomeSetTranslate(t);Ko.select(e.parentNode).transition().attr("transform",o).on("end",r),Ko.selectAll(this._ideo.selector+" g.tmp").style("opacity",0).remove(),this._ideo.config.orientation="horizontal"}},{key:"getHeight",value:function(t){var n=this._config.chromosomes[t].length,e=this.getChromosomeSetYTranslate(n-1);return(e+=this._getChromosomeSetSize(n-1))+2*this._getAdditionalOffset()}},{key:"getWidth",value:function(){return this._config.chrHeight+1.5*this.margin.top}},{key:"getChromosomeSetLabelAnchor",value:function(){return"end"}},{key:"getChromosomeBandLabelAnchor",value:function(){return null}},{key:"getChromosomeBandTickY1",value:function(){return 2}},{key:"getChromosomeBandTickY2",value:function(){return 10}},{key:"getChromosomeSetLabelTranslate",value:function(){return null}},{key:"getChromosomeSetTranslate",value:function(t){return"translate("+this._getLeftMargin()+", "+this.getChromosomeSetYTranslate(t)+")"}},{key:"getChromosomeSetYTranslate",value:function(t){if(!this._config.ploidyDesc)return this._config.chrMargin*(t+1);if(!this._translate){this._translate=[1];for(var n=1;no-1?(e=this.margin.left+1.4*this._config.chrHeight,r=this.getChromosomeSetYTranslate(t-o)):(e=this.margin.left,r=this.getChromosomeSetYTranslate(t)),"rotate(90) translate("+e+", -"+r+")"}},{key:"getChromosomeSetYTranslate",value:function(t){var n=this._getAdditionalOffset();return this.margin.left*t+this._config.chrWidth+2*n+n*t}},{key:"getChromosomeSetLabelXPosition",value:function(t){return(this._ploidy.getSetSize(t)*this._config.chrWidth+20)/-2+(this._config.ploidy>1?0:this._config.chrWidth)}},{key:"getChromosomeLabelXPosition",value:function(){return this._config.chrWidth/-2}}]),n}(),ni=jo.a.assign({},i);function ei(t,n,e){this.config.annotationsPath&&this.fetchAnnots(this.config.annotationsPath),function(t){if("ploidyDesc"in t.config&&"string"==typeof t.config.ploidyDesc){for(var n=[],e=0;e1?new ti(n,t):"vertical"===n.orientation?new Qo(n,t):"horizontal"===n.orientation?new Zo(n,t):new Qo(n,t)}(this),function(t,n){ni.selectAll(n.config.container+" #_ideogramOuterWrap").remove(),ni.select(n.config.container).append("div").attr("id","_ideogramOuterWrap").append("div").attr("id","_ideogramTrackLabelContainer").style("position","absolute"),ni.select(n.config.container+" #_ideogramOuterWrap").append("div").attr("id","_ideogramMiddleWrap").style("position","relative").style("overflow-x","auto").append("div").attr("id","_ideogramInnerWrap").append("svg").attr("id","_ideogram").attr("class",function(t){var n="";return t.config.showChromosomeLabels&&("horizontal"===t.config.orientation?n+="labeledLeft ":n+="labeled "),t.config.annotationsLayout&&"overlay"===t.config.annotationsLayout&&(n+="faint"),n}(n)).attr("width",n._layout.getWidth(t)).attr("height",n._layout.getHeight(t)).html(n.getBandColorGradients())}(n,this),this.isOnlyIdeogram=1===document.querySelectorAll("#_ideogram").length,function(t){ni.select(t.config.container+" #_ideogramOuterWrap").append("div").attr("class","_ideogramTooltip").attr("id","_ideogramTooltip").style("opacity",0).style("position","fixed").style("text-align","center").style("padding","4px").style("font","12px sans-serif").style("background","white").style("border","1px solid black").style("border-radius","5px").style("z-index","100")}(this),this.finishInit(t,e)}var ri=e(5),oi=jo.a.assign({},a,i);function ii(t,n,e){var r=e.config.ploidy;return"sex"in e.config&&(2===r&&e.sexChromosomes.index+2===n||"female"===e.config.sex&&"Y"===t.name)}function ai(t,n,e,r,o){var i,a,s,c;for(i=0;i=chrBands.length/2&&(n.coordinateSystem="bp")}function ci(t){var n,e,r,o=this.config.taxids,i=0;for(t.length>0&&(this.bandsArray={}),e=0;e=4&&(f=h[3],i[0]=f),h.length>=8&&(u=h[8].split(","),l=t.rgbToHex(u[0],u[1],u[2]),i.push(l)),[a,i])}},{key:"parseRawAnnots",value:function(t,n,e,r){var o,i,a,s,c,u;for(u=!0,!1===isNaN(parseInt(e[n],10))&&(u=!1),o=n;o=8&&c.push("color"),{keys:c,annots:t}}},{key:"parseBed",value:function(t,n){var e,r,o,i,a=[],s=t.split(/\r\n|\n/);for(r=Object.keys(n.chromosomes[n.config.taxid]),e=0;e")}(n),pi.select(n.config.container+" #_ideogramTrackLabel").interrupt().style("top","").style("left","").style("transform",null).style("transform","rotate(-90deg)").html(o),e=function(t,n,e){var r,o,i,a,s;return r=n.id.split("-").slice(0,-1).join("-")+"-0",o=pi.select(e.config.container+" #"+r).nodes()[0].getBoundingClientRect(),i=pi.select(e.config.container+" #_ideogramTrackLabel").nodes()[0].getBoundingClientRect(),a=pi.select(e.config.container).nodes()[0].getBoundingClientRect(),s=Math.round(o.left+i.width)-o.width-1,[s-=a.left-7,-(t.split("
").length-2)*o.width+2]}(o,t,n),a=(r=_slicedToArray(e,2))[0],function(t,n,e){pi.select(e.config.container+" #_ideogramTrackLabel").style("opacity",1).style("left",n+"px").style("top",t+"px").style("width","max-content").style("transform-origin","bottom left").style("text-align","left").on("mouseover",function(){clearTimeout(e.hideTrackLabelTimeout)}).on("mouseout",function(){vi(e)})}(r[1],a,n)}).on("mouseout",function(){vi(i)}),i.onDrawAnnotsCallback&&i.onDrawAnnotsCallback()}function xi(t,n,e,r,o){return t===n&&"+"===o&&e>r||e===o||0!==t&&t!==n&&e<=o&&e>r||0===t&&e<=o}function Ai(t,n){var e,r,o,i,a,s,c,u;for(e=0;e0&&(r+="-"+t.stop.toLocaleString()),n=r,e=24,t.name&&(n=(t.displayName?t.displayName:t.name)+"
"+n,e+=8),[n,e]}(t),function(t,n,e,r,o){i.html(n).style("opacity",1).style("left",e.e+"px").style("top",e.f-r+"px").style("pointer-events",null).on("mouseover",function(){clearTimeout(o.hideAnnotTooltipTimeout)}).on("mouseout",function(){o.startHideAnnotTooltipTimeout()})}(0,(r=_slicedToArray(e,2))[0],o,r[1],this))}function Oi(t){var n,e,r=!1,o=(new Date).getTime();return n=this.chromosomes[this.config.taxid],function(t){"histogramScaling"in t.config==0&&(t.config.histogramScaling="absolute")}(this),void 0===this.maxAnnotsPerBar&&(this.maxAnnotsPerBar={},r=!0),function(t,n,e){var r,o,i,a,s,c,u;if(n||"relative"===e.config.histogramScaling){for(r=0,o=0;oi&&(i=u),u>r&&(r=u);e.maxAnnotsPerBar[s]=i}e.maxAnnotsPerBarAllChrs=r}}(e=function(t,n,e,r){var o,i,a,s,c,u,l,f,h,d,g=r.config.barWidth;for(o in t)for(i=t[o].annots,s=n[(a=e[t[o].chr]).chrIndex].annots,c=0;c=h&&l":"triangle"===r&&(n='"):n='",n}function Hi(t,n,e){var r,o,i;for(r=0;r"+(i=e.rows[r]).name+"",o=Fi*r,"name"in e&&(o+=Fi),n+=''+Ni(i)+"";return[t,n]}var Ii=Object.assign({},i);function ji(t){var n,e,r=[],o=this.chromosomes[this.config.taxid];if("annots"in t[0])return this.drawProcessedAnnots(t);for(e in o)r.push({chr:e,annots:[]});r=function(t,n){var e,r,o,i;for(e=0;e"+i.name+""),o=(s=_slicedToArray(Hi(o,r='',i),2))[0],r=s[1],a+=(r+="")+"
    "+o+"
"}var c=Pi.select(t.config.container+" #_ideogramOuterWrap");c.append("style").html(Ei),c.append("div").attr("id","_ideogramLegend").html(a)}(this),"heatmap"!==n?(function(t,n,e){var r;!function(t,n){var e,r;if("heatmap"!==t&&"histogram"!==t){for(r=0,e=0;e2e3&&console.warn('Rendering more than 2000 annotations in Ideogram?\nTry setting "annotationsLayout" to "heatmap" or "histogram" in your Ideogram configuration object for better layout and performance.')}}(t,n),"histogram"===t&&(n=e.getHistogramBars(n)),r=function(t,n){return Ii.selectAll(n.selector+" .chromosome").data(t).selectAll("path.annot").data(function(t){return t.annots}).enter()}(e.fillAnnots(n),e),"tracks"===t?function(t,n){var e,r=n.config.annotationHeight;e=function(t){var n;return{triangle:"m0,0 l -"+r+" "+2*r+" l "+2*r+" 0 z",circle:"m -"+(n=r)+", "+n+"a "+n+","+n+" 0 1,0 "+2*n+",0a "+n+","+n+" 0 1,0 -"+2*n+",0",rectangle:"m0,0 l 0 "+2*r+"l "+r+" 0l 0 -"+2*r+"z"}}(),t.append("g").attr("id",function(t){return t.id}).attr("class","annot").attr("transform",function(t){var e=n.config.chrWidth+t.trackIndex*r*2;return"translate("+t.px+","+e+")"}).append("path").attr("d",function(t){return function(t,n){return t.shape&&"triangle"!==t.shape?"circle"===t.shape?n.circle:"rectangle"===t.shape?n.rectangle:t.shape:n.triangle}(t,e)}).attr("fill",function(t){return t.color}).on("mouseover",function(t){n.showAnnotTooltip(t,this)}).on("mouseout",function(){n.startHideAnnotTooltipTimeout()})}(r,e):"overlay"===t?function(t,n){r.append("polygon").attr("id",function(t){return t.id}).attr("class","annot").attr("points",function(t){var e,r,o=n.config.chrWidth;return t.stopPx-t.startPx>1?(e=t.startPx,r=t.stopPx):(e=t.px-.5,r=t.px+.5),e+","+o+" "+r+","+o+" "+r+",0 "+e+",0"}).attr("fill",function(t){return t.color}).on("mouseover",function(t){n.showAnnotTooltip(t,this)}).on("mouseout",function(){n.startHideAnnotTooltipTimeout()})}(0,e):"histogram"===t&&function(t,n){var e,r,o={},i=n.config.chrWidth;for(r in e=n.chromosomes[n.config.taxid])o[r]=e[r];t.append("polygon").attr("class","annot").attr("points",function(t){return function(t,n,e,r){var o,i,a,s;o=t.px+r.bump,i=t.px+r.config.barWidth+r.bump,a=n,s=n+t.height;var c=e[t.chr];return i>c&&(i=c),o+","+a+" "+i+","+a+" "+i+","+s+" "+o+","+s}(t,i,o,n)}).attr("fill",function(t){return t.color})}(r,e)}(n,t,this),this.onDrawAnnotsCallback&&this.onDrawAnnotsCallback()):this.drawHeatmaps(t)}var Wi=Object.assign({},i);function Ui(t,n,e){return t.append("g").attr("class","syntenicRegion").attr("id",n).on("click",function(){var t=this,n=Wi.selectAll(e.selector+" .syntenicRegion").filter(function(){return this!==t});n.classed("hidden",!n.classed("hidden"))}).on("mouseover",function(){var t=this;Wi.selectAll(e.selector+" .syntenicRegion").filter(function(){return this!==t}).classed("ghost",!0)}).on("mouseout",function(){Wi.selectAll(e.selector+" .syntenicRegion").classed("ghost",!1)})}function Yi(t,n,e){var r,o;return r=t.r1,o=t.r2,r.startPx=e.convertBpToPx(r.chr,r.start)+n,r.stopPx=e.convertBpToPx(r.chr,r.stop)+n,o.startPx=e.convertBpToPx(o.chr,o.start)+n,o.stopPx=e.convertBpToPx(o.chr,o.stop)+n,[r,o]}function zi(t,n,e,r,o,i){var a,s;a="color"in i?i.color:"#CFC",s="opacity"in i?i.opacity:1,t.append("polygon").attr("points",n+", "+r.startPx+" "+n+", "+r.stopPx+" "+e+", "+o.stopPx+" "+e+", "+o.startPx).attr("style","fill: "+a+"; fill-opacity: "+s)}function qi(t,n,e,r,o){t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.startPx).attr("y2",o.startPx),t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.stopPx).attr("y2",o.stopPx)}function Xi(t){var n=(new Date).getTime();(function(t,n,e,r){var o,i,a,s,c,u,l,f;for(o=0;oc&&(c=s+1),i.splice(4,0,s),a.push(i);u.push({chr:o.chr,annots:a})}return n.numAvailTracks=c,u}(t.annots,this),n.splice(4,0,"trackIndexOriginal"),t={keys:n,annots:e},this.rawAnnots.metadata&&(t.metadata=this.rawAnnots.metadata),t)}var Ki=[["F00"],["F00","88F"],["F00","CCC","88F"],["F00","FA0","0AF","88F"],["F00","FA0","CCC","0AF","88F"],["F00","FA0","875","578","0AF","88F"],["F00","FA0","875","CCC","578","0AF","88F"],["F00","FA0","7A0","875","0A7","578","0AF","88F"],["F00","FA0","7A0","875","CCC","0A7","578","0AF","88F"],["F00","FA0","7A0","875","552","255","0A7","578","0AF","88F"]];function Zi(t,n,e,r,o,i,a){var s;return a.config.annotationTracks?o=function(t,n,e,r,o){var i;return n.trackIndex=e[3],(i=o.config.annotationTracks[n.trackIndex]).color&&(n.color=i.color),i.shape&&(n.shape=i.shape),t[r].annots.push(n),t}(o,t,e,i,a):"trackIndex"===n[3]&&1!==a.numAvailTracks?(o=(s=_slicedToArray(function(t,n,e,r,o,i){var a=Ki[i.numAvailTracks-1];return t.trackIndex=n[3],t.trackIndexOriginal=n[4],t.color="#"+a[t.trackIndexOriginal],t.trackIndex>i.config.numTracks-1?(t.trackIndex in e?e[t.trackIndex].push(t):e[t.trackIndex]=[t],[r,e]):(r[o].annots.push(t),[r,e])}(t,e,r,o,i,a),2))[0],r=s[1]):o=function(t,n,e,r){return n.trackIndex=0,n.color||(n.color=r.config.annotationsColor),n.shape||(n.shape="triangle"),t[e].annots.push(n),t}(o,t,i,a),[o,r]}function Ji(t,n,e,r,o,i,a){var s,c,u,l;for(s=0;s10&&console.error("Ideogram only displays up to 10 tracks at a time. You specified "+r+" tracks. Perhaps consider a different way to visualize your data."),(e=Object.keys(t).length)&&console.warn("Ideogram configuration specified "+r+" tracks, but loaded annotations contain "+e+" extra tracks.")}(i,this),o}var ea=jo.a.assign({},i,a);function ra(){var t=this.config;t.annotationsPath||t.localAnnotationsPath||this.annots||t.annotations?function(t,n){var e;n.annotationHeight||(e="heatmap"===n.annotationsLayout?n.chrWidth-1:Math.round(n.chrHeight/100),t.config.annotationHeight=e),n.annotationTracks?t.config.numAnnotTracks=n.annotationTracks.length:n.annotationsNumTracks?t.config.numAnnotTracks=n.annotationsNumTracks:t.config.numAnnotTracks=1,t.config.annotTracksHeight=n.annotationHeight*n.numAnnotTracks,void 0===n.barWidth&&(t.config.barWidth=3)}(this,t):this.config.annotTracksHeight=0,void 0===t.annotationsColor&&(this.config.annotationsColor="#F00"),function(t,n){!1!==n.showAnnotTooltip&&(t.config.showAnnotTooltip=!0),n.onWillShowAnnotTooltip&&(t.onWillShowAnnotTooltipCallback=n.onWillShowAnnotTooltip)}(this,t)}function oa(t){t.rawAnnots.annots=t.rawAnnots.annots.sort(function(t,n){return Io(t.chr,n.chr)}),t.onLoadAnnotsCallback&&t.onLoadAnnotsCallback(),t.config.heatmaps&&t.deserializeAnnotsForHeatmap(t.rawAnnots)}function ia(t){var n,e=this;"http"===t.slice(0,4)?(n=function(t){var n,e;return"bed"!==(e=(n=t.split("?")[0].split("."))[n.length-1])&&"json"!==e?(e=e.toUpperCase(),void alert("Ideogram.js only supports BED and Ideogram JSON at the moment. Sorry, check back soon for "+e+" support!")):e}(t),ea.text(t).then(function(t){e.rawAnnots="bed"===n?new gi(t,e).rawAnnots:JSON.parse(t),oa(e)})):ea.json(e.config.annotationsPath).then(function(t){e.rawAnnots=t,oa(e)})}function aa(t){var n,e,r,o,i,a,s;for(n=[],e=[],r=this.chromosomesArray,o=0;o100){if(void 0===e.recovering)return o.getAssemblyAndChromosomesFromEutils(e.callback,!0),Promise.reject("Unexpectedly found genomic scaffolds instead of chromosomes while querying RefSeq. Recovering.");throw Error("Failed to find chromosomes for genome "+r)}}(t,n,e),r=t.linksets[0].linksetdbs[0].links.join(","),o=e.ideo.esummary+"&db=nucleotide&id="+r,da.json(o)}(t,o,a)}).then(function(n){return o=function(t,n,e){var r,o,i=[];for(r in t)"uids"!==r&&(o=ga(t[r],e),i.push(o));return i=i.sort(Ideogram.sortChromosomes),e.coordinateSystem="bp",n.push(i),n}(n.result,o,i),t(o)},function(t){console.warn(t)})}var ma,va,ya,ba=jo.a.assign({},i);function _a(){var t=this.bandsToShow.join(",");ba.selectAll(this.selector+" .bandLabel, .bandLabelStalk").style("display","none"),ba.selectAll(t).style("display","")}function wa(t,n,e,r,o){return n!==e&&(t=r[o.id][e]+36),t}function xa(t,n,e,r,o,i,a){var s,c;return e#_ideogram {padding-left: 5px;} #_ideogram .labeled {padding-left: 15px;} #_ideogram.labeledLeft {padding-left: 15px; padding-top: 15px;} #_ideogram text {font: 9px Tahoma; fill: #000;} #_ideogram .italic {font-style: italic;} #_ideogram .chromosome {cursor: pointer; fill: #AAA;}#_ideogram .chrSetLabel {font-weight: bolder;}#_ideogram .ghost {opacity: 0.2;}#_ideogram .hidden {display: none;}#_ideogram .bandLabelStalk line {stroke: #AAA; stroke-width: 1;}#_ideogram .syntenyBorder {stroke:#AAA;stroke-width:1;}#_ideogram .brush .selection { fill: #F00; stroke: #F00; fill-opacity: .3; shape-rendering: crispEdges;}#_ideogram .noBands {fill: #AAA;}#_ideogram .gneg {fill: #FFF}#_ideogram .gpos25 {fill: #BBB}#_ideogram .gpos33 {fill: #AAA}#_ideogram .gpos50 {fill: #888}#_ideogram .gpos66 {fill: #666}#_ideogram .gpos75 {fill: #444}#_ideogram .gpos100 {fill: #000}#_ideogram .gpos {fill: #000}#_ideogram .acen {fill: #FDD}#_ideogram .stalk {fill: #CCE;}#_ideogram .gvar {fill: #DDF}#_ideogram.faint .gneg {fill: #FFF}#_ideogram.faint .gpos25 {fill: #EEE}#_ideogram.faint .gpos33 {fill: #EEE}#_ideogram.faint .gpos50 {fill: #EEE}#_ideogram.faint .gpos66 {fill: #EEE}#_ideogram.faint .gpos75 {fill: #EEE}#_ideogram.faint .gpos100 {fill: #DDD}#_ideogram.faint .gpos {fill: #DDD}#_ideogram.faint .acen {fill: #FEE}#_ideogram.faint .stalk {fill: #EEF;}#_ideogram.faint .gvar {fill: #EEF}#_ideogram .gneg {fill: url("#gneg")} #_ideogram .gpos25 {fill: url("#gpos25")} #_ideogram .gpos33 {fill: url("#gpos33")} #_ideogram .gpos50 {fill: url("#gpos50")} #_ideogram .gpos66 {fill: url("#gpos66")} #_ideogram .gpos75 {fill: url("#gpos75")} #_ideogram .gpos100 {fill: url("#gpos100")} #_ideogram .gpos {fill: url("#gpos100")} #_ideogram .acen {fill: url("#acen")} #_ideogram .stalk {fill: url("#stalk")} #_ideogram .gvar {fill: url("#gvar")} #_ideogram .noBands {fill: url("#noBands")} #_ideogram .chromosome {fill: url("#noBands")} ',ya=' ';var Ca=jo.a.assign({},i);function Ta(t,n,e,r){var o=this,i=o._layout,a=e.chrIndex;return t.selectAll("text").data(n).enter().append("g").attr("class",function(t,n){return"bandLabel bsbsl-"+n}).attr("transform",function(t){var n=i.getChromosomeBandLabelTranslate(t,a);return"horizontal"===o.config.orientation?r[e.id].push(n.x+13):r[e.id].push(n.y+6),n.translate}).append("text").attr("text-anchor",i.getChromosomeBandLabelAnchor(a)).text(function(t){return t.name}),r}function Ma(t,n,e,r){var o=this;t.selectAll("line.bandLabelStalk").data(n).enter().append("g").attr("class",function(t,n){return"bandLabelStalk bsbsl-"+n}).attr("transform",function(t){var n;return n=o.round(t.px.start+t.px.width/2),r[e.id].push(n+13),"translate("+n+","+-10+")"}).append("line").attr("x1",0).attr("y1",o._layout.getChromosomeBandTickY1(e.chrIndex)).attr("x2",0).attr("y2",o._layout.getChromosomeBandTickY2(e.chrIndex))}function Sa(t){var n,e,r,o,i,a={};for(o=function(t){var n,e,r=[];for(n in t)for(e in t[n])r.push(t[n][e]);return r}(t),n=0;n',a+="gneg"===e?'':'',a+=""}return a}(ma),va+""+(t+=ya)+""}var Ba=e(4);function Oa(t,n,e,r){var o,i;return o=n[t],e.push(o),(i={iscn:o[o.length-1].iscn.stop,bp:o[o.length-1].bp.stop}).iscn>r.maxLength.iscn&&(r.maxLength.iscn=i.iscn),i.bp>r.maxLength.bp&&(r.maxLength.bp=i.bp),e}function Pa(t,n,e,r){var o,i;if("iscn"===r.coordinateSystem||r.config.multiorganism)e=function(t,n,e,r){var o,i,a;for(o=r.bandData[t],i=r.parseBands(o,t,n),n=Object.keys(i).sort(function(t,n){return Io(t,n)}),r.config.chromosomes[t]=n.slice(),r.numChromosomes+=r.config.chromosomes[t].length,a=0;ar.maxLength.bp&&(r.maxLength.bp=o.length);return e}function Fa(){var t,n,e,r,o,i,a,s,c=(new Date).getTime();e=[],t=function(t){var n,e,r;if(!0===t.config.multiorganism)for(t.coordinateSystem="bp",r=t.config.taxids,n=0;n1&&o.length>1&&(t=r[0].replace("chr",""),o=r[1].split("-"),n=parseInt(o[0]),e=parseInt(o[1]-1)),[t,n,e]}(t,n,e),t=(o=_slicedToArray(r,3))[0],n=o[1],e=o[2],u=(a=_slicedToArray(function(t,n){var e,r,o=[1],i=[1],a=t.bands.slice(-1)[0];for(r=0;r1){if(o=function(t,n){var e,r,o,i,a,s,c,u,l;for(e=0;e=a&&n<=s)return[u+l*(o+i/c*(n-a)-o)/i,r];return[null,r]}(t,n),r=(i=_slicedToArray(o,2))[0],e=i[1],null!==r)return r}else if(n>=1&&n<=t.length)return t.scale.bp*n;!function(t,n,e){throw new Error("Base pair out of range. bp: "+t+"; length of chr"+n.name+": "+e.bp.stop)}(n,t,e)}function Wa(t,n,e,r,o,i,a){var s,c,u,l;return a=t-n,s=r-o,c=i.bp.stop-i.bp.start,u=n+a/s*(e-o),l=i.bp.start+c*(u-n)/a,Math.round(l)}function Ua(t,n){var e,r,o,i,a,s;for(0===n&&(n=t.bands[0].px.start),e=0;e=o&&n<=i)return Wa(s,a,n,i,o,r,void 0);!function(t,n,e){throw new Error("Pixel out of range. px: "+t+"; length of chr"+n.name+": "+e)}(n,t,i)}Ea.scaleLinear=Ue,Ea.max=de;var Ya=e(6),za=Object.assign({},i);function qa(){var t,n,e=[],r=this.annots;for(n=0;n1&&this._model.bands.push({name:"q",px:{start:0,stop:this._model.width,width:this._model.width},bp:{start:1,stop:this._model.length}}),this._model}},{key:"getCssClass",value:function(){return"noBands"}}]),n}(),Ja=function(){function t(n){_classCallCheck(this,t),this._config=n,this._ploidy=new zo(this._config)}return _createClass(t,[{key:"getArmColor",value:function(t,n,e){return this._config.armColors?this._config.armColors[e]:this._config.ancestors?this._getPolyploidArmColor(t,n,e):null}},{key:"getBorderColor",value:function(t,n,e){return n1&&(r=this._ploidy.getChromosomesNumber(n)),i=0;i1||""===n.orientation)&&(t-=1),t}(n,s),o=-4,!0===s.showBandLabels&&(o=s.chrMargin+s.chrWidth+26),i=s.chrMargin*n,s.numAnnotTracks>1==0&&(i+=1),a=i+o,t.selectAll("text.chrLabel").attr("transform",e.scaleSvg).selectAll("tspan").attr("x",e.x).attr("y",a)}(t,n,o,this):function(t,n,e,r){var o,i,a,s=r.config;o=-s.chrWidth-2,!0===s.showBandLabels&&(o=s.chrMargin+8),i=s.annotTracksHeight,"overlay"!==s.annotationsLayout&&(i*=2),a=3-(s.chrMargin*n+o)+i,a/=e.scale.x,t.selectAll("text.chrLabel").attr("transform","rotate(-90)"+e.scaleSvg).selectAll("tspan").attr("x",a).attr("y",e.y)}(t,n,o,this)}var hs=jo.a.assign({},i,a,o,r);hs.scaleLinear=Ue,hs.max=de;var ds=function(){function t(n){_classCallCheck(this,t),this.configure=Ro,this.initDrawChromosomes=ci,this.onLoad=li,this.handleRotateOnClick=ui,this.init=di,this.finishInit=Yo,this.writeContainer=ei,this.onLoadAnnots=Mi,this.onDrawAnnots=Si,this.processAnnotData=na,this.restoreDefaultTracks=Vi,this.updateDisplayedTracks=Gi,this.initAnnotSettings=ra,this.fetchAnnots=ia,this.drawAnnots=ji,this.getHistogramBars=Oi,this.drawHeatmaps=wi,this.deserializeAnnotsForHeatmap=Ci,this.fillAnnots=aa,this.drawProcessedAnnots=Ri,this.drawSynteny=Xi,this.startHideAnnotTooltipTimeout=Li,this.showAnnotTooltip=Bi,this.onWillShowAnnotTooltip=Di,this.setOriginalTrackIndexes=Qi,this.esearch=ua,this.esummary=la,this.elink=fa,this.getTaxidFromEutils=ha.b,this.setTaxidData=ha.e,this.setTaxidAndAssemblyAndChromosomes=ha.d,this.getOrganismFromEutils=ha.a,this.getTaxids=ha.c,this.getAssemblyAndChromosomesFromEutils=pa,this.parseBands=Ba.a,this.drawBandLabels=Sa,this.getBandColorGradients=Da,this.processBandData=Fa,this.setBandsToShow=ka,this.hideUnshownBandLabels=_a,this.drawBandLabelText=Ta,this.drawBandLabelStalk=Ma,this.onBrushMove=Na,this.createBrush=Ha,this.drawSexChromosomes=Ia,this.setSexChromosomes=ja,this.convertBpToPx=Ra,this.convertPxToBp=Ua,this.unpackAnnots=qa,this.packAnnots=Xa,this.initCrossFilter=$a,this.filterAnnots=Va,this.assemblyIsAccession=jo.b,this.getDataDir=jo.c,this.round=jo.h,this.onDidRotate=jo.g,this.getSvg=jo.d,this.getChromosomeModel=Qa,this.getChromosomePixels=Ga,this.drawChromosomeLabels=ls,this.rotateChromosomeLabels=fs,this.appendHomolog=is,this.drawChromosome=as,this.rotateAndToggleDisplay=ss,this.setOverflowScroll=cs,this.configure(n)}return _createClass(t,null,[{key:"slugify",value:function(t){return t.toLowerCase().replace(" ","-")}},{key:"sortChromosomes",value:function(t,n){var e="nuclear"===t.type,r="nuclear"===n.type,o="chloroplast"===t.type,i="chloroplast"===n.type,a="mitochondrion"===t.type,s="mitochondrion"===n.type,c="apicoplast"===t.type,u="apicoplast"===n.type;return e&&r?Io(t.name,n.name):!e&&r?1:a&&i?1:o&&s?-1:c||a||o||!(s||i||u)?void 0:-1}},{key:"version",get:function(){return"1.4.1"}},{key:"d3",get:function(){return hs}}]),t}();window.Ideogram=ds,n.default=ds}])},"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=n():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=n)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}).call(this,__webpack_require__(52)(module))},36:function(t,n,e){"use strict";e.r(n),e.d(n,"default",function(){return p});var r=e(1),o=e.n(r),i=e(134),a=e.n(i),s=e(160),c=e(11);function u(t){return(u="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})(t)}function l(){return(l=Object.assign||function(t){for(var n=1;n=0&&m.splice(n,1)}function a(t){var n=document.createElement("style");return n.type="text/css",o(t,n),n}function c(t){var n=document.createElement("link");return n.rel="stylesheet",o(t,n),n}function f(t,n){var e,r,i;if(n.singleton){var o=_++;e=g||(g=a(n)),r=s.bind(null,e,o,!1),i=s.bind(null,e,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=c(n),r=h.bind(null,e),i=function(){u(e),e.href&&URL.revokeObjectURL(e.href)}):(e=a(n),r=l.bind(null,e),i=function(){u(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else i()}}function s(t,n,e,r){var i=e?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(n,i);else{var o=document.createTextNode(i),u=t.childNodes;u[n]&&t.removeChild(u[n]),u.length?t.insertBefore(o,u[n]):t.appendChild(o)}}function l(t,n){var e=n.css,r=n.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}function h(t,n){var e=n.css,r=n.sourceMap;r&&(e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([e],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}var d={},p=function(t){var n;return function(){return void 0===n&&(n=t.apply(this,arguments)),n}},v=p((function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())})),y=p((function(){return document.head||document.getElementsByTagName("head")[0]})),g=null,_=0,m=[];t.exports=function(t,n){void 0===(n=n||{}).singleton&&(n.singleton=v()),void 0===n.insertAt&&(n.insertAt="bottom");var e=i(t);return r(e,n),function(t){for(var o=[],u=0;u1})).append("line").attr("class","separator separator-double"),t.selectAll(".separator-double").style("stroke","#FFF").style("stroke-width",(function(t){return 4*t.bond-5+"px"})),e.filter((function(t){return 3===t.bond})).append("line").attr("class","separator separator-triple"),t.selectAll(".separator-triple").style("stroke",(function(t){return c.default.chooseColor(t,"black")})).style("stroke-width","1px"),n.exit().remove()}}},{key:"render",value:function(){var t=this;return o.default.createElement("g",{className:"links-container",ref:function(n){t.linksContainer=n}})}}]),n}(o.default.Component);f.propTypes={links:u.default.arrayOf(u.default.object)},n.default=f},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function t(t,n){for(var e=0;en?1:t>=n?0:NaN},i=function(t){var n;return 1===t.length&&(n=t,t=function(t,e){return r(n(t),e)}),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}};var o=i(r),u=o.right,a=o.left,c=u,f=function(t,n){null==n&&(n=s);for(var e=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);et?1:n>=t?0:NaN},d=function(t){return null===t?NaN:+t},p=function(t,n){var e,r,i=t.length,o=0,u=-1,a=0,c=0;if(null==n)for(;++u1)return c/(o-1)},v=function(t,n){var e=p(t,n);return e?Math.sqrt(e):e},y=function(t,n){var e,r,i,o=t.length,u=-1;if(null==n){for(;++u=e)for(r=i=e;++ue&&(r=e),i=e)for(r=i=e;++ue&&(r=e),i0)return[t];if((r=n0)for(t=Math.ceil(t/u),n=Math.floor(n/u),o=new Array(i=Math.ceil(n-t+1));++a=0?(o>=M?10:o>=k?5:o>=T?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=M?10:o>=k?5:o>=T?2:1)}function N(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=M?i*=10:o>=k?i*=5:o>=T&&(i*=2),nl;)h.pop(),--d;var p,v=new Array(d+1);for(i=0;i<=d;++i)(p=v[i]=[]).x0=i>0?h[i-1]:s,p.x1=i=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),u=+e(t[o],o,t);return u+(+e(t[o+1],o+1,t)-u)*(i-o)}},O=function(t,n,e){return t=m.call(t,d).sort(r),Math.ceil((e-n)/(2*(P(t,.75)-P(t,.25))*Math.pow(t.length,-1/3)))},D=function(t,n,e){return Math.ceil((e-n)/(3.5*v(t)*Math.pow(t.length,-1/3)))},z=function(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++or&&(r=e)}else for(;++o=e)for(r=e;++or&&(r=e);return r},R=function(t,n){var e,r=t.length,i=r,o=-1,u=0;if(null==n)for(;++o=0;)for(n=(r=t[i]).length;--n>=0;)e[--u]=r[n];return e},I=function(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++oe&&(r=e)}else for(;++o=e)for(r=e;++oe&&(r=e);return r},q=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},j=function(t,n){if(e=t.length){var e,i,o=0,u=0,a=t[u];for(null==n&&(n=r);++o=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function dt(t,n){for(var e,r=0,i=t.length;r0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),gt.hasOwnProperty(n)?{space:gt[n],local:t}:t};function mt(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===yt&&n.documentElement.namespaceURI===yt?n.createElement(t):n.createElementNS(e,t)}}function xt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var bt=function(t){var n=_t(t);return(n.local?xt:mt)(n)};function wt(){}var Mt=function(t){return null==t?wt:function(){return this.querySelector(t)}};function kt(){return[]}var Tt=function(t){return null==t?kt:function(){return this.querySelectorAll(t)}},St=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var At=document.documentElement;if(!At.matches){var Nt=At.webkitMatchesSelector||At.msMatchesSelector||At.mozMatchesSelector||At.oMatchesSelector;St=function(t){return function(){return Nt.call(this,t)}}}}var Et=St,Ct=function(t){return new Array(t.length)};function Pt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}Pt.prototype={constructor:Pt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Ot="$";function Dt(t,n,e,r,i,o){for(var u,a=0,c=n.length,f=o.length;an?1:t>=n?0:NaN}function Lt(t){return function(){this.removeAttribute(t)}}function Ut(t){return function(){this.removeAttributeNS(t.space,t.local)}}function It(t,n){return function(){this.setAttribute(t,n)}}function qt(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function jt(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Ft(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}var Yt=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Bt(t){return function(){this.style.removeProperty(t)}}function Ht(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Xt(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Vt(t,n){return t.style.getPropertyValue(n)||Yt(t).getComputedStyle(t,null).getPropertyValue(n)}function Wt(t){return function(){delete this[t]}}function $t(t,n){return function(){this[t]=n}}function Zt(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Gt(t){return t.trim().split(/^|\s+/)}function Qt(t){return t.classList||new Jt(t)}function Jt(t){this._node=t,this._names=Gt(t.getAttribute("class")||"")}function Kt(t,n){for(var e=Qt(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function on(){this.textContent=""}function un(t){return function(){this.textContent=t}}function an(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function cn(){this.innerHTML=""}function fn(t){return function(){this.innerHTML=t}}function sn(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function ln(){this.nextSibling&&this.parentNode.appendChild(this)}function hn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function dn(){return null}function pn(){var t=this.parentNode;t&&t.removeChild(this)}function vn(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function yn(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var gn={},_n=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(gn={mouseenter:"mouseover",mouseleave:"mouseout"}));function mn(t,n,e){return t=xn(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function xn(t,n,e){return function(r){var i=_n;_n=r;try{t.call(this,this.__data__,n,e)}finally{_n=i}}}function bn(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function wn(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=b&&(b=x+1);!(m=g[b])&&++b=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=Rt);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?Bt:"function"==typeof n?Xt:Ht)(t,n,null==e?"":e)):Vt(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?Wt:"function"==typeof n?Zt:$t)(t,n)):this.node()[t]},classed:function(t,n){var e=Gt(t+"");if(arguments.length<2){for(var r=Qt(this.node()),i=-1,o=e.length;++il}c.mouse("drag")}function v(){On(_n.view).on("mousemove.drag mouseup.drag",null),Vn(_n.view,e),Hn(),c.mouse("end")}function y(){if(i.apply(this,arguments)){var t,n,e=_n.changedTouches,r=o.apply(this,arguments),u=e.length;for(t=0;t>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=ae.exec(t))?ye(parseInt(n[1],16)):(n=ce.exec(t))?new xe(n[1],n[2],n[3],1):(n=fe.exec(t))?new xe(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=se.exec(t))?ge(n[1],n[2],n[3],n[4]):(n=le.exec(t))?ge(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=he.exec(t))?be(n[1],n[2]/100,n[3]/100,1):(n=de.exec(t))?be(n[1],n[2]/100,n[3]/100,n[4]):pe.hasOwnProperty(t)?ye(pe[t]):"transparent"===t?new xe(NaN,NaN,NaN,0):null}function ye(t){return new xe(t>>16&255,t>>8&255,255&t,1)}function ge(t,n,e,r){return r<=0&&(t=n=e=NaN),new xe(t,n,e,r)}function _e(t){return t instanceof ee||(t=ve(t)),t?new xe((t=t.rgb()).r,t.g,t.b,t.opacity):new xe}function me(t,n,e,r){return 1===arguments.length?_e(t):new xe(t,n,e,null==r?1:r)}function xe(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function be(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Me(t,n,e,r)}function we(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Me)return new Me(t.h,t.s,t.l,t.opacity);if(t instanceof ee||(t=ve(t)),!t)return new Me;if(t instanceof Me)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,c=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e0&&c<1?0:u,new Me(u,a,c,t.opacity)}(t):new Me(t,n,e,null==r?1:r)}function Me(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ke(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}te(ee,ve,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),te(xe,me,ne(ee,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new xe(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new xe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(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+")")}})),te(Me,we,ne(ee,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Me(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Me(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new xe(ke(t>=240?t-240:t+120,i,r),ke(t,i,r),ke(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Te=Math.PI/180,Se=180/Math.PI,Ae=.95047,Ne=1,Ee=1.08883,Ce=4/29,Pe=6/29,Oe=3*Pe*Pe,De=Pe*Pe*Pe;function ze(t){if(t instanceof Le)return new Le(t.l,t.a,t.b,t.opacity);if(t instanceof Ye){var n=t.h*Te;return new Le(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof xe||(t=_e(t));var e=je(t.r),r=je(t.g),i=je(t.b),o=Ue((.4124564*e+.3575761*r+.1804375*i)/Ae),u=Ue((.2126729*e+.7151522*r+.072175*i)/Ne);return new Le(116*u-16,500*(o-u),200*(u-Ue((.0193339*e+.119192*r+.9503041*i)/Ee)),t.opacity)}function Re(t,n,e,r){return 1===arguments.length?ze(t):new Le(t,n,e,null==r?1:r)}function Le(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function Ue(t){return t>De?Math.pow(t,1/3):t/Oe+Ce}function Ie(t){return t>Pe?t*t*t:Oe*(t-Ce)}function qe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function je(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Fe(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Ye)return new Ye(t.h,t.c,t.l,t.opacity);t instanceof Le||(t=ze(t));var n=Math.atan2(t.b,t.a)*Se;return new Ye(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Ye(t,n,e,null==r?1:r)}function Ye(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}te(Le,Re,ne(ee,{brighter:function(t){return new Le(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Le(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=Ne*Ie(t),new xe(qe(3.2404542*(n=Ae*Ie(n))-1.5371385*t-.4985314*(e=Ee*Ie(e))),qe(-.969266*n+1.8760108*t+.041556*e),qe(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),te(Ye,Fe,ne(ee,{brighter:function(t){return new Ye(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Ye(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return ze(this).rgb()}}));var Be=-.29227,He=-.90649,Xe=1.97294,Ve=Xe*He,We=1.78277*Xe,$e=1.78277*Be- -.14861*He;function Ze(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Ge)return new Ge(t.h,t.s,t.l,t.opacity);t instanceof xe||(t=_e(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=($e*r+Ve*n-We*e)/($e+Ve-We),o=r-i,u=(Xe*(e-i)-Be*o)/He,a=Math.sqrt(u*u+o*o)/(Xe*i*(1-i)),c=a?Math.atan2(u,o)*Se-120:NaN;return new Ge(c<0?c+360:c,a,i,t.opacity)}(t):new Ge(t,n,e,null==r?1:r)}function Ge(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Qe(t,n,e,r,i){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*e+(1+3*t+3*o-3*u)*r+u*i)/6}te(Ge,Ze,ne(ee,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ge(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ge(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Te,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new xe(255*(n+e*(-.14861*r+1.78277*i)),255*(n+e*(Be*r+He*i)),255*(n+e*(Xe*r)),this.opacity)}}));var Je=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],u=r>0?t[r-1]:2*i-o,a=r180||e<-180?e-360*Math.round(e/360):e):tr(isNaN(t)?n:t)}function rr(t){return 1==(t=+t)?ir:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):tr(isNaN(n)?e:n)}}function ir(t,n){var e=n-t;return e?nr(t,e):tr(isNaN(t)?n:t)}var or=function t(n){var e=rr(n);function r(t,n){var r=e((t=me(t)).r,(n=me(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=ir(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}return r.gamma=t,r}(1);function ur(t){return function(n){var e,r,i=n.length,o=new Array(i),u=new Array(i),a=new Array(i);for(e=0;eo&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:lr(e,r)})),o=pr.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:lr(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:lr(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,c),function(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:lr(t,e)},{i:a-2,x:lr(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,c),o=u=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Hr}function ii(){Zr=($r=Qr.now())+Gr,Hr=Xr=0;try{ri()}finally{Hr=0,function(){var t,n,e=qr,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:qr=n);jr=t,ui(r)}(),Zr=0}}function oi(){var t=Qr.now(),n=t-$r;n>Wr&&(Gr-=n,$r=t)}function ui(t){Hr||(Xr&&(Xr=clearTimeout(Xr)),t-Zr>24?(t<1/0&&(Xr=setTimeout(ii,t-Qr.now()-Gr)),Vr&&(Vr=clearInterval(Vr))):(Vr||($r=Qr.now(),Vr=setInterval(oi,Wr)),Hr=1,Jr(ii)))}ni.prototype=ei.prototype={constructor:ni,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Kr():+e)+(null==n?0:+n),this._next||jr===this||(jr?jr._next=this:qr=this,jr=this),this._call=t,this._time=e,ui()},stop:function(){this._call&&(this._call=null,this._time=1/0,ui())}};var ai=function(t,n,e){var r=new ni;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},ci=function(t,n,e){var r=new ni,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?Kr():+e,r.restart((function o(u){u+=i,r.restart(o,i+=n,e),t(u)}),n,e),r)},fi=vt("start","end","interrupt"),si=[],li=0,hi=1,di=2,pi=3,vi=4,yi=5,gi=6,_i=function(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(c){var f,s,l,h;if(e.state!==hi)return a();for(f in i)if((h=i[f]).name===e.name){if(h.state===pi)return ai(o);h.state===vi?(h.state=gi,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fli)throw new Error("too late; already scheduled");return e}function xi(t,n){var e=bi(t,n);if(e.state>di)throw new Error("too late; already started");return e}function bi(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var wi=function(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>di&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?mi:xi;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}var Fi=Pn.prototype.constructor;function Yi(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}var Bi=0;function Hi(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Xi(t){return Pn().transition(t)}function Vi(){return++Bi}var Wi=Pn.prototype;function $i(t){return+t}function Zi(t){return t*t}function Gi(t){return t*(2-t)}function Qi(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function Ji(t){return t*t*t}function Ki(t){return--t*t*t+1}function to(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Hi.prototype=Xi.prototype={constructor:Hi,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=Mt(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;uhi&&e.name===n)return new Hi([[t]],Io,n,+r);return null},jo=function(t){return function(){return t}},Fo=function(t,n,e){this.target=t,this.type=n,this.selection=e};function Yo(){_n.stopImmediatePropagation()}var Bo=function(){_n.preventDefault(),_n.stopImmediatePropagation()},Ho={name:"drag"},Xo={name:"space"},Vo={name:"handle"},Wo={name:"center"},$o={name:"x",handles:["e","w"].map(eu),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Zo={name:"y",handles:["n","s"].map(eu),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Go={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(eu),input:function(t){return t},output:function(t){return t}},Qo={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Jo={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Ko={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},tu={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},nu={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function eu(t){return{type:t}}function ru(){return!_n.button}function iu(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function ou(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function uu(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function au(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function cu(){return lu($o)}function fu(){return lu(Zo)}var su=function(){return lu(Go)};function lu(t){var n,e=iu,r=ru,i=vt(u,"start","brush","end"),o=6;function u(n){var e=n.property("__brush",l).selectAll(".overlay").data([eu("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Qo.overlay).merge(e).each((function(){var t=ou(this).extent;On(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([eu("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Qo.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Qo[t.type]})),n.each(a).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",s)}function a(){var t=On(this),n=ou(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-o/2:n[0][0]-o/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-o/2:n[0][1]-o/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+o:o})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+o:o}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(t,n){return t.__brush.emitter||new f(t,n)}function f(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function s(){if(_n.touches){if(_n.changedTouches.length<_n.touches.length)return Bo()}else if(n)return;if(r.apply(this,arguments)){var e,i,o,u,f,s,l,h,d,p,v,y,g,_=this,m=_n.target.__data__.type,x="selection"===(_n.metaKey?m="overlay":m)?Ho:_n.altKey?Wo:Vo,b=t===Zo?null:tu[m],w=t===$o?null:nu[m],M=ou(_),k=M.extent,T=M.selection,S=k[0][0],A=k[0][1],N=k[1][0],E=k[1][1],C=b&&w&&_n.shiftKey,P=qn(_),O=P,D=c(_,arguments).beforestart();"overlay"===m?M.selection=T=[[e=t===Zo?S:P[0],o=t===$o?A:P[1]],[f=t===Zo?N:e,l=t===$o?E:o]]:(e=T[0][0],o=T[0][1],f=T[1][0],l=T[1][1]),i=e,u=o,s=f,h=l;var z=On(_).attr("pointer-events","none"),R=z.selectAll(".overlay").attr("cursor",Qo[m]);if(_n.touches)z.on("touchmove.brush",U,!0).on("touchend.brush touchcancel.brush",q,!0);else{var L=On(_n.view).on("keydown.brush",(function(){switch(_n.keyCode){case 16:C=b&&w;break;case 18:x===Vo&&(b&&(f=s-d*b,e=i+d*b),w&&(l=h-p*w,o=u+p*w),x=Wo,I());break;case 32:x!==Vo&&x!==Wo||(b<0?f=s-d:b>0&&(e=i-d),w<0?l=h-p:w>0&&(o=u-p),x=Xo,R.attr("cursor",Qo.selection),I());break;default:return}Bo()}),!0).on("keyup.brush",(function(){switch(_n.keyCode){case 16:C&&(y=g=C=!1,I());break;case 18:x===Wo&&(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(o=u),x=Vo,I());break;case 32:x===Xo&&(_n.altKey?(b&&(f=s-d*b,e=i+d*b),w&&(l=h-p*w,o=u+p*w),x=Wo):(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(o=u),x=Vo),R.attr("cursor",Qo[m]),I());break;default:return}Bo()}),!0).on("mousemove.brush",U,!0).on("mouseup.brush",q,!0);Xn(_n.view)}Yo(),wi(_),a.call(_),D.start()}function U(){var t=qn(_);!C||y||g||(Math.abs(t[0]-O[0])>Math.abs(t[1]-O[1])?g=!0:y=!0),O=t,v=!0,Bo(),I()}function I(){var t;switch(d=O[0]-P[0],p=O[1]-P[1],x){case Xo:case Ho:b&&(d=Math.max(S-e,Math.min(N-f,d)),i=e+d,s=f+d),w&&(p=Math.max(A-o,Math.min(E-l,p)),u=o+p,h=l+p);break;case Vo:b<0?(d=Math.max(S-e,Math.min(N-e,d)),i=e+d,s=f):b>0&&(d=Math.max(S-f,Math.min(N-f,d)),i=e,s=f+d),w<0?(p=Math.max(A-o,Math.min(E-o,p)),u=o+p,h=l):w>0&&(p=Math.max(A-l,Math.min(E-l,p)),u=o,h=l+p);break;case Wo:b&&(i=Math.max(S,Math.min(N,e-d*b)),s=Math.max(S,Math.min(N,f+d*b))),w&&(u=Math.max(A,Math.min(E,o-p*w)),h=Math.max(A,Math.min(E,l+p*w)))}s1e-6)if(Math.abs(s*a-c*f)>1e-6&&i){var h=e-o,d=r-u,p=a*a+c*c,v=h*h+d*d,y=Math.sqrt(p),g=Math.sqrt(l),_=i*Math.tan((wu-Math.acos((p+l-v)/(2*y*g)))/2),m=_/g,x=_/y;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*f)+","+(n+m*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>f*d)+","+(this._x1=t+x*a)+","+(this._y1=n+x*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n;var u=(e=+e)*Math.cos(r),a=e*Math.sin(r),c=t+u,f=n+a,s=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+f:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+c+","+f),e&&(l<0&&(l=l%Mu+Mu),l>ku?this._+="A"+e+","+e+",0,1,"+s+","+(t-u)+","+(n-a)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=f):l>1e-6&&(this._+="A"+e+","+e+",0,"+ +(l>=wu)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var Au=Su;function Nu(t){return t.source}function Eu(t){return t.target}function Cu(t){return t.radius}function Pu(t){return t.startAngle}function Ou(t){return t.endAngle}var Du=function(){var t=Nu,n=Eu,e=Cu,r=Pu,i=Ou,o=null;function u(){var u,a=xu.call(arguments),c=t.apply(this,a),f=n.apply(this,a),s=+e.apply(this,(a[0]=c,a)),l=r.apply(this,a)-vu,h=i.apply(this,a)-vu,d=s*hu(l),p=s*du(l),v=+e.apply(this,(a[0]=f,a)),y=r.apply(this,a)-vu,g=i.apply(this,a)-vu;if(o||(o=u=Au()),o.moveTo(d,p),o.arc(0,0,s,l,h),l===y&&h===g||(o.quadraticCurveTo(0,0,v*hu(y),v*du(y)),o.arc(0,0,v,y,g)),o.quadraticCurveTo(0,0,d,p),o.closePath(),u)return o=null,u+""||null}return u.radius=function(t){return arguments.length?(e="function"==typeof t?t:bu(+t),u):e},u.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:bu(+t),u):r},u.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:bu(+t),u):i},u.source=function(n){return arguments.length?(t=n,u):t},u.target=function(t){return arguments.length?(n=t,u):n},u.context=function(t){return arguments.length?(o=null==t?null:t,u):o},u};function zu(){}function Ru(t,n){var e=new zu;if(t instanceof zu)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var c,f,s,l=-1,h=e.length,d=r[i++],p=Lu(),v=u();++lr.length)return e;var u,a=i[o-1];return null!=n&&o>=r.length?u=e.entries():(u=[],e.each((function(n,e){u.push({key:e,values:t(n,o)})}))),null!=a?u.sort((function(t,n){return a(t.key,n.key)})):u}(o(t,0,ju,Fu),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}};function Iu(){return{}}function qu(t,n,e){t[n]=e}function ju(){return Lu()}function Fu(t,n,e){t.set(n,e)}function Yu(){}var Bu=Lu.prototype;function Hu(t,n){var e=new Yu;if(t instanceof Yu)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r=o?c=!0:(r=t.charCodeAt(u++))===Ju?f=!0:r===Ku&&(f=!0,t.charCodeAt(u)===Ju&&++u),t.slice(i+1,n-1).replace(/""/g,'"')}for(;u=(o=(v+g)/2))?v=o:g=o,(s=e>=(u=(y+_)/2))?y=u:_=u,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(a=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===a&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(o=(v+g)/2))?v=o:g=o,(s=e>=(u=(y+_)/2))?y=u:_=u}while((l=s<<1|f)==(h=(c>=u)<<1|a>=o));return i[h]=d,i[l]=p,t}var ya=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function ga(t){return t[0]}function _a(t){return t[1]}function ma(t,n,e){var r=new xa(null==n?ga:n,null==e?_a:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function xa(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function ba(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var wa=ma.prototype=xa.prototype;function Ma(t){return t.x+t.vx}function ka(t){return t.y+t.vy}wa.copy=function(){var t,n,e=new xa(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=ba(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=ba(n));return e},wa.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return va(this.cover(n,e),n,e,t)},wa.addAll=function(t){var n,e,r,i,o=t.length,u=new Array(o),a=new Array(o),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));for(st||t>i||r>n||n>o))return this;var u,a,c=i-e,f=this._root;switch(a=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{(u=new Array(4))[a]=f,f=u}while(o=r+(c*=2),t>(i=e+c)||n>o);break;case 1:do{(u=new Array(4))[a]=f,f=u}while(o=r+(c*=2),(e=i-c)>t||n>o);break;case 2:do{(u=new Array(4))[a]=f,f=u}while(r=o-(c*=2),t>(i=e+c)||r>n);break;case 3:do{(u=new Array(4))[a]=f,f=u}while(r=o-(c*=2),(e=i-c)>t||r>n)}this._root&&this._root.length&&(this._root=f)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},wa.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},wa.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},wa.find=function(t,n,e){var r,i,o,u,a,c,f,s=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new ya(v,s,l,h,d)),null==e?e=1/0:(s=t-e,l=n-e,h=t+e,d=n+e,e*=e);c=p.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(o=c.y0)>d||(u=c.x1)=g)<<1|t>=y)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,v.data),m=n-+this._y.call(null,v.data),x=_*_+m*m;if(x=(a=(p+y)/2))?p=a:y=a,(s=u>=(c=(v+g)/2))?v=c:g=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},wa.removeAll=function(t){for(var n=0,e=t.length;nc+d||if+d||oa.index){var p=c-u.x-u.vx,v=f-u.y-u.vy,y=p*p+v*v;yt.r&&(t.r=t[n].r)}function a(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r1?(null==e?a.remove(t):a.set(t,d(e)),n):a.get(t)},find:function(n,e,r){var i,o,u,a,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},Ra=function(){var t,n,e,r,i=da(-30),o=1,u=1/0,a=.81;function c(r){var i,o=t.length,u=ma(t,Ea,Ca).visitAfter(s);for(e=r,i=0;i=u)){(t.data!==n||t.next)&&(0===s&&(d+=(s=pa())*s),0===l&&(d+=(l=pa())*l),d1?r[0]+r.slice(2):r,+t.slice(e+1)]},ja=function(t){return(t=qa(Math.abs(t)))?t[1]:NaN},Fa=function(t,n){var e=qa(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Ya={"":function(t,n){t:for(var e,r=(t=t.toPrecision(n)).length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Fa(100*t,n)},r:Fa,s:function(t,n){var e=qa(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(Pa=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return o===u?r:o>u?r+new Array(o-u+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+qa(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Ba=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function Ha(t){return new Xa(t)}function Xa(t){if(!(n=Ba.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",o=n[4]||"",u=!!n[5],a=n[6]&&+n[6],c=!!n[7],f=n[8]&&+n[8].slice(1),s=n[9]||"";"n"===s?(c=!0,s="g"):Ya[s]||(s=""),(u||"0"===e&&"="===r)&&(u=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=u,this.width=a,this.comma=c,this.precision=f,this.type=s}Ha.prototype=Xa.prototype,Xa.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Va,Wa,$a,Za=function(t){return t},Ga=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Qa=function(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,o=[],u=0,a=n[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(t.substring(i-=a,i+a)),!((c+=a+1)>r));)a=n[u=(u+1)%n.length];return o.reverse().join(e)}):Za,i=t.currency,o=t.decimal,u=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(t.numerals):Za,a=t.percent||"%";function c(t){var n=(t=Ha(t)).fill,e=t.align,c=t.sign,f=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.type,v="$"===f?i[0]:"#"===f&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",y="$"===f?i[1]:/[%p]/.test(p)?a:"",g=Ya[p],_=!p||/[defgprs%]/.test(p);function m(t){var i,a,f,m=v,x=y;if("c"===p)x=g(t)+x,t="";else{var b=(t=+t)<0;if(t=g(Math.abs(t),d),b&&0==+t&&(b=!1),m=(b?"("===c?c:"-":"-"===c||"("===c?"":c)+m,x=("s"===p?Ga[8+Pa/3]:"")+x+(b&&"("===c?")":""),_)for(i=-1,a=t.length;++i(f=t.charCodeAt(i))||f>57){x=(46===f?o+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var w=m.length+t.length+x.length,M=w>1)+m+t+x+M.slice(w);break;default:t=M+m+t+x}return u(t)}return d=null==d?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:c,formatPrefix:function(t,n){var e=c(((t=Ha(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ja(n)/3))),i=Math.pow(10,-r),o=Ga[8+r/3];return function(t){return e(i*t)+o}}}};function Ja(t){return Va=Qa(t),Wa=Va.format,$a=Va.formatPrefix,Va}Ja({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Ka=function(t){return Math.max(0,-ja(Math.abs(t)))},tc=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ja(n)/3)))-ja(Math.abs(t)))},nc=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ja(n)-ja(t))+1},ec=function(){return new rc};function rc(){this.reset()}rc.prototype={constructor:rc,reset:function(){this.s=this.t=0},add:function(t){oc(ic,t,this.t),oc(this,ic.s,this.s),this.s?this.t+=ic.t:this.s=ic.t},valueOf:function(){return this.s}};var ic=new rc;function oc(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}var uc=1e-6,ac=Math.PI,cc=ac/2,fc=ac/4,sc=2*ac,lc=180/ac,hc=ac/180,dc=Math.abs,pc=Math.atan,vc=Math.atan2,yc=Math.cos,gc=Math.ceil,_c=Math.exp,mc=(Math.floor,Math.log),xc=Math.pow,bc=Math.sin,wc=Math.sign||function(t){return t>0?1:t<0?-1:0},Mc=Math.sqrt,kc=Math.tan;function Tc(t){return t>1?0:t<-1?ac:Math.acos(t)}function Sc(t){return t>1?cc:t<-1?-cc:Math.asin(t)}function Ac(t){return(t=bc(t/2))*t}function Nc(){}function Ec(t,n){t&&Pc.hasOwnProperty(t.type)&&Pc[t.type](t,n)}var Cc={Feature:function(t,n){Ec(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=yc(n=(n*=hc)/2+fc),u=bc(n),a=Ic*u,c=Uc*o+a*yc(i),f=a*r*bc(i);jc.add(vc(f,c)),Lc=t,Uc=o,Ic=u}var Wc=function(t){return Fc.reset(),qc(t,Yc),2*Fc};function $c(t){return[vc(t[1],t[0]),Sc(t[2])]}function Zc(t){var n=t[0],e=t[1],r=yc(e);return[r*yc(n),r*bc(n),bc(e)]}function Gc(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Qc(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Jc(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Kc(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function tf(t){var n=Mc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var nf,ef,rf,of,uf,af,cf,ff,sf,lf,hf=ec(),df={point:pf,lineStart:yf,lineEnd:gf,polygonStart:function(){df.point=_f,df.lineStart=mf,df.lineEnd=xf,hf.reset(),Yc.polygonStart()},polygonEnd:function(){Yc.polygonEnd(),df.point=pf,df.lineStart=yf,df.lineEnd=gf,jc<0?(nf=-(rf=180),ef=-(of=90)):hf>uc?of=90:hf<-uc&&(ef=-90),lf[0]=nf,lf[1]=rf}};function pf(t,n){sf.push(lf=[nf=t,rf=t]),nof&&(of=n)}function vf(t,n){var e=Zc([t*hc,n*hc]);if(ff){var r=Qc(ff,e),i=Qc([r[1],-r[0],0],r);tf(i),i=$c(i);var o,u=t-uf,a=u>0?1:-1,c=i[0]*lc*a,f=dc(u)>180;f^(a*ufof&&(of=o):f^(a*uf<(c=(c+360)%360-180)&&cof&&(of=n)),f?tbf(nf,rf)&&(rf=t):bf(t,rf)>bf(nf,rf)&&(nf=t):rf>=nf?(trf&&(rf=t)):t>uf?bf(nf,t)>bf(nf,rf)&&(rf=t):bf(t,rf)>bf(nf,rf)&&(nf=t)}else sf.push(lf=[nf=t,rf=t]);nof&&(of=n),ff=e,uf=t}function yf(){df.point=vf}function gf(){lf[0]=nf,lf[1]=rf,df.point=pf,ff=null}function _f(t,n){if(ff){var e=t-uf;hf.add(dc(e)>180?e+(e>0?360:-360):e)}else af=t,cf=n;Yc.point(t,n),vf(t,n)}function mf(){Yc.lineStart()}function xf(){_f(af,cf),Yc.lineEnd(),dc(hf)>uc&&(nf=-(rf=180)),lf[0]=nf,lf[1]=rf,ff=null}function bf(t,n){return(n-=t)<0?n+360:n}function wf(t,n){return t[0]-n[0]}function Mf(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nbf(r[0],r[1])&&(r[1]=i[1]),bf(i[0],r[1])>bf(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(u=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(a=bf(r[1],i[0]))>u&&(u=a,nf=i[0],rf=r[1])}return sf=lf=null,nf===1/0||ef===1/0?[[NaN,NaN],[NaN,NaN]]:[[nf,ef],[rf,of]]},Ff={sphere:Nc,point:Yf,lineStart:Hf,lineEnd:Wf,polygonStart:function(){Ff.lineStart=$f,Ff.lineEnd=Zf},polygonEnd:function(){Ff.lineStart=Hf,Ff.lineEnd=Wf}};function Yf(t,n){t*=hc;var e=yc(n*=hc);Bf(e*yc(t),e*bc(t),bc(n))}function Bf(t,n,e){++kf,Sf+=(t-Sf)/kf,Af+=(n-Af)/kf,Nf+=(e-Nf)/kf}function Hf(){Ff.point=Xf}function Xf(t,n){t*=hc;var e=yc(n*=hc);Uf=e*yc(t),If=e*bc(t),qf=bc(n),Ff.point=Vf,Bf(Uf,If,qf)}function Vf(t,n){t*=hc;var e=yc(n*=hc),r=e*yc(t),i=e*bc(t),o=bc(n),u=vc(Mc((u=If*o-qf*i)*u+(u=qf*r-Uf*o)*u+(u=Uf*i-If*r)*u),Uf*r+If*i+qf*o);Tf+=u,Ef+=u*(Uf+(Uf=r)),Cf+=u*(If+(If=i)),Pf+=u*(qf+(qf=o)),Bf(Uf,If,qf)}function Wf(){Ff.point=Yf}function $f(){Ff.point=Gf}function Zf(){Qf(Rf,Lf),Ff.point=Yf}function Gf(t,n){Rf=t,Lf=n,t*=hc,n*=hc,Ff.point=Qf;var e=yc(n);Uf=e*yc(t),If=e*bc(t),qf=bc(n),Bf(Uf,If,qf)}function Qf(t,n){t*=hc;var e=yc(n*=hc),r=e*yc(t),i=e*bc(t),o=bc(n),u=If*o-qf*i,a=qf*r-Uf*o,c=Uf*i-If*r,f=Mc(u*u+a*a+c*c),s=Sc(f),l=f&&-s/f;Of+=l*u,Df+=l*a,zf+=l*c,Tf+=s,Ef+=s*(Uf+(Uf=r)),Cf+=s*(If+(If=i)),Pf+=s*(qf+(qf=o)),Bf(Uf,If,qf)}var Jf=function(t){kf=Tf=Sf=Af=Nf=Ef=Cf=Pf=Of=Df=zf=0,qc(t,Ff);var n=Of,e=Df,r=zf,i=n*n+e*e+r*r;return i<1e-12&&(n=Ef,e=Cf,r=Pf,Tfac?t-sc:t<-ac?t+sc:t,n]}function es(t,n,e){return(t%=sc)?n||e?ts(is(t),os(n,e)):is(t):n||e?os(n,e):ns}function rs(t){return function(n,e){return[(n+=t)>ac?n-sc:n<-ac?n+sc:n,e]}}function is(t){var n=rs(t);return n.invert=rs(-t),n}function os(t,n){var e=yc(t),r=bc(t),i=yc(n),o=bc(n);function u(t,n){var u=yc(n),a=yc(t)*u,c=bc(t)*u,f=bc(n),s=f*e+a*r;return[vc(c*i-s*o,a*e-f*r),Sc(s*i+c*o)]}return u.invert=function(t,n){var u=yc(n),a=yc(t)*u,c=bc(t)*u,f=bc(n),s=f*i-c*o;return[vc(c*i+f*o,a*e+s*r),Sc(s*e-a*r)]},u}ns.invert=ns;var us=function(t){function n(n){return(n=t(n[0]*hc,n[1]*hc))[0]*=lc,n[1]*=lc,n}return t=es(t[0]*hc,t[1]*hc,t.length>2?t[2]*hc:0),n.invert=function(n){return(n=t.invert(n[0]*hc,n[1]*hc))[0]*=lc,n[1]*=lc,n},n};function as(t,n,e,r,i,o){if(e){var u=yc(n),a=bc(n),c=r*e;null==i?(i=n+r*sc,o=n-c/2):(i=cs(u,i),o=cs(u,o),(r>0?io)&&(i+=r*sc));for(var f,s=i;r>0?s>o:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},ls=function(t,n){return dc(t[0]-n[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function ps(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,k=M*w,T=k>ac,S=p*x;if(vs.add(vc(S*M*bc(k),v*b+S*yc(k))),o+=T?w+M*sc:w,T^h>=e^_>=e){var A=Qc(Zc(l),Zc(g));tf(A);var N=Qc(i,A);tf(N);var E=(T^w>=0?-1:1)*Sc(N[2]);(r>E||r===E&&(A[0]||A[1]))&&(u+=T^w>=0?1:-1)}}return(o<-uc||o0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),u.push(h.filter(_s))}return h}};function _s(t){return t.length>1}function ms(t,n){return((t=t.x)[0]<0?t[1]-cc-uc:cc-t[1])-((n=n.x)[0]<0?n[1]-cc-uc:cc-n[1])}var xs=gs((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,u){var a=o>0?ac:-ac,c=dc(o-e);dc(c-ac)0?cc:-cc),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),n=0):i!==a&&c>=ac&&(dc(e-i)uc?pc((bc(n)*(o=yc(r))*bc(e)-bc(r)*(i=yc(n))*bc(t))/(i*o*u)):(n+r)/2}(e,r,o,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=o,r=u),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*cc,r.point(-ac,i),r.point(0,i),r.point(ac,i),r.point(ac,0),r.point(ac,-i),r.point(0,-i),r.point(-ac,-i),r.point(-ac,0),r.point(-ac,i);else if(dc(t[0]-n[0])>uc){var o=t[0]0,i=dc(n)>uc;function o(t,e){return yc(t)*yc(e)>n}function u(t,e,r){var i=[1,0,0],o=Qc(Zc(t),Zc(e)),u=Gc(o,o),a=o[0],c=u-a*a;if(!c)return!r&&t;var f=n*u/c,s=-n*a/c,l=Qc(i,o),h=Kc(i,f);Jc(h,Kc(o,s));var d=l,p=Gc(h,d),v=Gc(d,d),y=p*p-v*(Gc(h,h)-1);if(!(y<0)){var g=Mc(y),_=Kc(d,(-p-g)/v);if(Jc(_,h),_=$c(_),!r)return _;var m,x=t[0],b=e[0],w=t[1],M=e[1];b0^_[1]<(dc(_[0]-x)ac^(x<=_[0]&&_[0]<=b)){var S=Kc(d,(-p+g)/v);return Jc(S,h),[_,$c(S)]}}}function a(n,e){var i=r?t:ac-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return gs(o,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],v=o(l,h),y=r?v?0:a(l,h):v?a(l+(l<0?ac:-ac),h):0;if(!n&&(f=c=v)&&t.lineStart(),v!==c&&(!(d=u(n,p))||ls(n,d)||ls(p,d))&&(p[0]+=uc,p[1]+=uc,v=o(p[0],p[1])),v!==c)s=0,v?(t.lineStart(),d=u(p,n),t.point(d[0],d[1])):(d=u(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^v){var g;y&e||!(g=u(p,n,!0))||(s=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!v||n&&ls(n,p)||t.point(p[0],p[1]),n=p,c=v,e=y},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,o){as(o,t,e,i,n,r)}),r?[0,-t]:[-ac,t-ac])},ws=function(t,n,e,r,i,o){var u,a=t[0],c=t[1],f=0,s=1,l=n[0]-a,h=n[1]-c;if(u=e-a,l||!(u>0)){if(u/=l,l<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=i-a,l||!(u<0)){if(u/=l,l<0){if(u>s)return;u>f&&(f=u)}else if(l>0){if(u0)){if(u/=h,h<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=o-c,h||!(u<0)){if(u/=h,h<0){if(u>s)return;u>f&&(f=u)}else if(h>0){if(u0&&(t[0]=a+f*l,t[1]=c+f*h),s<1&&(n[0]=a+s*l,n[1]=c+s*h),!0}}}}},Ms=1e9,ks=-Ms;function Ts(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,a,f){var s=0,l=0;if(null==i||(s=u(i,a))!==(l=u(o,a))||c(i,o)<0^a>0)do{f.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+a+4)%4)!==l);else f.point(o[0],o[1])}function u(r,i){return dc(r[0]-t)0?0:3:dc(r[0]-e)0?2:1:dc(r[1]-n)0?1:0:i>0?3:2}function a(t,n){return c(t.x,n.x)}function c(t,n){var e=u(t,1),r=u(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(u){var c,f,s,l,h,d,p,v,y,g,_,m=u,x=ss(),b={point:w,lineStart:function(){b.point=M,f&&f.push(s=[]);g=!0,y=!1,p=v=NaN},lineEnd:function(){c&&(M(l,h),d&&y&&x.rejoin(),c.push(x.result()));b.point=w,y&&m.lineEnd()},polygonStart:function(){m=x,c=[],f=[],_=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=f.length;er&&(h-o)*(r-u)>(d-u)*(t-o)&&++n:d<=r&&(h-o)*(r-u)<(d-u)*(t-o)&&--n;return n}(),e=_&&n,i=(c=U(c)).length;(e||i)&&(u.polygonStart(),e&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),i&&ds(c,a,n,o,u),u.polygonEnd());m=u,c=f=s=null}};function w(t,n){i(t,n)&&m.point(t,n)}function M(o,u){var a=i(o,u);if(f&&s.push([o,u]),g)l=o,h=u,d=a,g=!1,a&&(m.lineStart(),m.point(o,u));else if(a&&y)m.point(o,u);else{var c=[p=Math.max(ks,Math.min(Ms,p)),v=Math.max(ks,Math.min(Ms,v))],x=[o=Math.max(ks,Math.min(Ms,o)),u=Math.max(ks,Math.min(Ms,u))];ws(c,x,t,n,e,r)?(y||(m.lineStart(),m.point(c[0],c[1])),m.point(x[0],x[1]),a||m.lineEnd(),_=!1):a&&(m.lineStart(),m.point(o,u),_=!1)}p=o,v=u,y=a}return b}}var Ss,As,Ns,Es=function(){var t,n,e,r=0,i=0,o=960,u=500;return e={stream:function(e){return t&&n===e?t:t=Ts(r,i,o,u)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],o=+a[1][0],u=+a[1][1],t=n=null,e):[[r,i],[o,u]]}}},Cs=ec(),Ps={sphere:Nc,point:Nc,lineStart:function(){Ps.point=Ds,Ps.lineEnd=Os},lineEnd:Nc,polygonStart:Nc,polygonEnd:Nc};function Os(){Ps.point=Ps.lineEnd=Nc}function Ds(t,n){Ss=t*=hc,As=bc(n*=hc),Ns=yc(n),Ps.point=zs}function zs(t,n){t*=hc;var e=bc(n*=hc),r=yc(n),i=dc(t-Ss),o=yc(i),u=r*bc(i),a=Ns*e-As*r*o,c=As*e+Ns*r*o;Cs.add(vc(Mc(u*u+a*a),c)),Ss=t,As=e,Ns=r}var Rs=function(t){return Cs.reset(),qc(t,Ps),+Cs},Ls=[null,null],Us={type:"LineString",coordinates:Ls},Is=function(t,n){return Ls[0]=t,Ls[1]=n,Rs(Us)},qs={Feature:function(t,n){return Fs(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++ruc})).map(c)).concat(w(gc(o/d)*d,i,d).filter((function(t){return dc(t%v)>uc})).map(f))}return g.lines=function(){return _().map((function(t){return{type:"LineString",coordinates:t}}))},g.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(u).slice(1),s(e).reverse().slice(1),l(a).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],u=+t[1][1],r>e&&(t=r,r=e,e=t),a>u&&(t=a,a=u,u=t),g.precision(y)):[[r,a],[e,u]]},g.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),g.precision(y)):[[n,o],[t,i]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(p=+t[0],v=+t[1],g):[p,v]},g.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],g):[h,d]},g.precision=function(h){return arguments.length?(y=+h,c=$s(o,i,90),f=Zs(n,t,y),s=$s(a,u,90),l=Zs(r,e,y),g):y},g.extentMajor([[-180,-90+uc],[180,90-uc]]).extentMinor([[-180,-80-uc],[180,80+uc]])}function Qs(){return Gs()()}var Js,Ks,tl,nl,el=function(t,n){var e=t[0]*hc,r=t[1]*hc,i=n[0]*hc,o=n[1]*hc,u=yc(r),a=bc(r),c=yc(o),f=bc(o),s=u*yc(e),l=u*bc(e),h=c*yc(i),d=c*bc(i),p=2*Sc(Mc(Ac(o-r)+u*c*Ac(i-e))),v=bc(p),y=p?function(t){var n=bc(t*=p)/v,e=bc(p-t)/v,r=e*s+n*h,i=e*l+n*d,o=e*a+n*f;return[vc(i,r)*lc,vc(o,Mc(r*r+i*i))*lc]}:function(){return[e*lc,r*lc]};return y.distance=p,y},rl=function(t){return t},il=ec(),ol=ec(),ul={point:Nc,lineStart:Nc,lineEnd:Nc,polygonStart:function(){ul.lineStart=al,ul.lineEnd=sl},polygonEnd:function(){ul.lineStart=ul.lineEnd=ul.point=Nc,il.add(dc(ol)),ol.reset()},result:function(){var t=il/2;return il.reset(),t}};function al(){ul.point=cl}function cl(t,n){ul.point=fl,Js=tl=t,Ks=nl=n}function fl(t,n){ol.add(nl*t-tl*n),tl=t,nl=n}function sl(){fl(Js,Ks)}var ll=ul,hl=1/0,dl=hl,pl=-hl,vl=pl;var yl,gl,_l,ml,xl={point:function(t,n){tpl&&(pl=t);nvl&&(vl=n)},lineStart:Nc,lineEnd:Nc,polygonStart:Nc,polygonEnd:Nc,result:function(){var t=[[hl,dl],[pl,vl]];return pl=vl=-(dl=hl=1/0),t}},bl=0,wl=0,Ml=0,kl=0,Tl=0,Sl=0,Al=0,Nl=0,El=0,Cl={point:Pl,lineStart:Ol,lineEnd:Rl,polygonStart:function(){Cl.lineStart=Ll,Cl.lineEnd=Ul},polygonEnd:function(){Cl.point=Pl,Cl.lineStart=Ol,Cl.lineEnd=Rl},result:function(){var t=El?[Al/El,Nl/El]:Sl?[kl/Sl,Tl/Sl]:Ml?[bl/Ml,wl/Ml]:[NaN,NaN];return bl=wl=Ml=kl=Tl=Sl=Al=Nl=El=0,t}};function Pl(t,n){bl+=t,wl+=n,++Ml}function Ol(){Cl.point=Dl}function Dl(t,n){Cl.point=zl,Pl(_l=t,ml=n)}function zl(t,n){var e=t-_l,r=n-ml,i=Mc(e*e+r*r);kl+=i*(_l+t)/2,Tl+=i*(ml+n)/2,Sl+=i,Pl(_l=t,ml=n)}function Rl(){Cl.point=Pl}function Ll(){Cl.point=Il}function Ul(){ql(yl,gl)}function Il(t,n){Cl.point=ql,Pl(yl=_l=t,gl=ml=n)}function ql(t,n){var e=t-_l,r=n-ml,i=Mc(e*e+r*r);kl+=i*(_l+t)/2,Tl+=i*(ml+n)/2,Sl+=i,Al+=(i=ml*t-_l*n)*(_l+t),Nl+=i*(ml+n),El+=3*i,Pl(_l=t,ml=n)}var jl=Cl;function Fl(t){this._context=t}Fl.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,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,sc)}},result:Nc};var Yl,Bl,Hl,Xl,Vl,Wl=ec(),$l={point:Nc,lineStart:function(){$l.point=Zl},lineEnd:function(){Yl&&Gl(Bl,Hl),$l.point=Nc},polygonStart:function(){Yl=!0},polygonEnd:function(){Yl=null},result:function(){var t=+Wl;return Wl.reset(),t}};function Zl(t,n){$l.point=Gl,Bl=Xl=t,Hl=Vl=n}function Gl(t,n){Xl-=t,Vl-=n,Wl.add(Mc(Xl*Xl+Vl*Vl)),Xl=t,Vl=n}var Ql=$l;function Jl(){this._string=[]}function Kl(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Jl.prototype={_radius:4.5,_circle:Kl(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,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=Kl(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var th=function(t,n){var e,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),qc(t,e(r))),r.result()}return o.area=function(t){return qc(t,e(ll)),ll.result()},o.measure=function(t){return qc(t,e(Ql)),Ql.result()},o.bounds=function(t){return qc(t,e(xl)),xl.result()},o.centroid=function(t){return qc(t,e(jl)),jl.result()},o.projection=function(n){return arguments.length?(e=null==n?(t=null,rl):(t=n).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(n=null,new Jl):new Fl(n=t),"function"!=typeof i&&r.pointRadius(i),o):n},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(n)},nh=function(t){return{stream:eh(t)}};function eh(t){return function(n){var e=new rh;for(var r in t)e[r]=t[r];return e.stream=n,e}}function rh(){}function ih(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),qc(e,t.stream(xl)),n(xl.result()),null!=r&&t.clipExtent(r),t}function oh(t,n,e){return ih(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),u=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,a=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([u,a])}),e)}function uh(t,n,e){return oh(t,[[0,0],n],e)}function ah(t,n,e){return ih(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,u=-i*e[0][1];t.scale(150*i).translate([o,u])}),e)}function ch(t,n,e){return ih(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],u=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,u])}),e)}rh.prototype={constructor:rh,point:function(t,n){this.stream.point(t,n)},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 fh=16,sh=yc(30*hc),lh=function(t,n){return+n?function(t,n){function e(r,i,o,u,a,c,f,s,l,h,d,p,v,y){var g=f-r,_=s-i,m=g*g+_*_;if(m>4*n&&v--){var x=u+h,b=a+d,w=c+p,M=Mc(x*x+b*b+w*w),k=Sc(w/=M),T=dc(dc(w)-1)n||dc((g*E+_*C)/m-.5)>.3||u*h+a*d+c*p2?t[2]%360*hc:0,N()):[y*lc,g*lc,_*lc]},T.precision=function(t){return arguments.length?(k=lh(A,M=t*t),E()):Mc(M)},T.fitExtent=function(t,n){return oh(T,t,n)},T.fitSize=function(t,n){return uh(T,t,n)},T.fitWidth=function(t,n){return ah(T,t,n)},T.fitHeight=function(t,n){return ch(T,t,n)},function(){return n=t.apply(this,arguments),T.invert=n.invert&&S,N()}}function vh(t){var n=0,e=ac/3,r=ph(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*hc,e=t[1]*hc):[n*lc,e*lc]},i}function yh(t,n){var e=bc(t),r=(e+bc(n))/2;if(dc(r)=.12&&i<.234&&r>=-.425&&r<-.214?a:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:u).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[u.stream(n=e),a.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e0?n<-cc+uc&&(n=-cc+uc):n>cc-uc&&(n=cc-uc);var e=i/xc(Eh(n),r);return[e*bc(r*t),i-e*yc(r*t)]}return o.invert=function(t,n){var e=i-n,o=wc(r)*Mc(t*t+e*e);return[vc(t,dc(e))/r*wc(e),2*pc(xc(i/o,1/r))-cc]},o}var Ph=function(){return vh(Ch).scale(109.5).parallels([30,30])};function Oh(t,n){return[t,n]}Oh.invert=Oh;var Dh=function(){return dh(Oh).scale(152.63)};function zh(t,n){var e=yc(t),r=t===n?bc(t):(e-yc(n))/(n-t),i=e/r+t;if(dc(r)uc&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};var Fh=function(){return dh(jh).scale(175.295)};function Yh(t,n){return[yc(n)*bc(t),bc(n)]}Yh.invert=bh(Sc);var Bh=function(){return dh(Yh).scale(249.5).clipAngle(90+uc)};function Hh(t,n){var e=yc(n),r=1+yc(t)*e;return[e*bc(t)/r,bc(n)/r]}Hh.invert=bh((function(t){return 2*pc(t)}));var Xh=function(){return dh(Hh).scale(250).clipAngle(142)};function Vh(t,n){return[mc(kc((cc+n)/2)),-t]}Vh.invert=function(t,n){return[-n,2*pc(_c(t))-cc]};var Wh=function(){var t=Nh(Vh),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)};function $h(t,n){return t.parent===n.parent?1:2}function Zh(t,n){return t+n.x}function Gh(t,n){return Math.max(t,n.y)}var Qh=function(){var t=$h,n=1,e=1,r=!1;function i(i){var o,u=0;i.eachAfter((function(n){var e=n.children;e?(n.x=function(t){return t.reduce(Zh,0)/t.length}(e),n.y=function(t){return 1+t.reduce(Gh,0)}(e)):(n.x=o?u+=t(n,o):0,n.y=0,o=n)}));var a=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=a.x-t(a,c)/2,s=c.x+t(c,a)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i};function Jh(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function Kh(t,n){var e,r,i,o,u,a=new rd(t),c=+t.value&&(a.value=t.value),f=[a];for(null==n&&(n=td);e=f.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(u=i.length))for(e.children=new Array(u),o=u-1;o>=0;--o)f.push(r=e.children[o]=new rd(i[o])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(ed)}function td(t){return t.children}function nd(t){t.data=t.data.data}function ed(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function rd(t){this.data=t,this.depth=this.height=0,this.parent=null}rd.prototype=Kh.prototype={constructor:rd,count:function(){return this.eachAfter(Jh)},each:function(t){var n,e,r,i,o=this,u=[o];do{for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;t=e.pop(),n=r.pop();for(;t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return Kh(this).eachBefore(nd)}};var id=Array.prototype.slice;var od=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(id.call(t))).length,o=[];r0&&e*e>r*r+i*i}function fd(t,n){for(var e=0;ee*e+r*r}function vd(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function yd(t){this._=t,this.next=null,this.previous=null}function gd(t){if(!(i=t.length))return 0;var n,e,r,i,o,u,a,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;dd(e,n,r=t[2]),n=new yd(n),e=new yd(e),r=new yd(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=xd(n),e):t},e.parentId=function(t){return arguments.length?(n=xd(t),e):n},e};function Ud(t,n){return t.parent===n.parent?1:2}function Id(t){var n=t.children;return n?n[0]:t.t}function qd(t){var n=t.children;return n?n[n.length-1]:t.t}function jd(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Fd(t,n,e){return t.a.parent===n.parent?t.a:e}function Yd(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}Yd.prototype=Object.create(rd.prototype);var Bd=function(){var t=Ud,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,u=new Yd(t,0),a=[u];n=a.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)a.push(e=n.children[i]=new Yd(r[i],i)),e.parent=n;return(u.parent=new Yd(null,0)).children=[u],u}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(u),r)i.eachBefore(a);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),v=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*v}))}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,u=n,a=e,c=o.parent.children[0],f=o.m,s=u.m,l=a.m,h=c.m;a=qd(a),o=Id(o),a&&o;)c=Id(c),(u=qd(u)).a=n,(i=a.z+l-o.z-f+t(a._,o._))>0&&(jd(Fd(a,n,r),n,i),f+=i,s+=i),l+=a.m,f+=o.m,h+=c.m,s+=u.m;a&&!qd(u)&&(u.t=a,u.m+=l-s),o&&!Id(c)&&(c.t=o,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function u(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},Hd=function(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,f=t.value&&(i-e)/t.value;++ah&&(h=a),y=s*s*v,(d=Math.max(h/y,y/l))>p){s-=a;break}p=d}g.push(u={value:s,dice:c1?n:1)},e}(Xd),$d=function(){var t=Wd,n=!1,e=1,r=1,i=[0],o=bd,u=bd,a=bd,c=bd,f=bd;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Nd),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=a[n];return s.x0=i,s.y0=o,s.x1=u,void(s.y1=c)}var l=f[n],h=r/2+l,d=n+1,p=e-1;for(;d>>1;f[v]c-o){var _=(i*g+u*y)/r;t(n,d,y,i,o,_,c),t(d,e,g,_,o,u,c)}else{var m=(o*g+c*y)/r;t(n,d,y,i,o,u,m),t(d,e,g,i,m,u,c)}}(0,c,t.value,n,e,r,i)},Gd=function(t,n,e,r,i){(1&t.depth?Hd:Ed)(t,n,e,r,i)},Qd=function t(n){function e(t,e,r,i,o){if((u=t._squarify)&&u.ratio===n)for(var u,a,c,f,s,l=-1,h=u.length,d=t.value;++l1?n:1)},e}(Xd),Jd=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++e1&&tp(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}var rp=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[o[n]][2]]);for(n=+a;na!=f>a&&u<(c-e)*(a-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},op=function(t){for(var n,e,r=-1,i=t.length,o=t[i-1],u=o[0],a=o[1],c=0;++r=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,hp(t)}function hp(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function dp(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new cp(t)}cp.prototype=dp.prototype={constructor:cp,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=up.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),fp(this),this},abort:function(){return null==this._error&&lp(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},hp(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,hp(this),this}};var pp=function(){return Math.random()},vp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(pp),yp=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(pp),gp=function t(n){function e(){var t=yp.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(pp),_p=function t(n){function e(t){return function(){for(var e=0,r=0;r=200&&r<300||304===r){if(i)try{n=i.call(e,c)}catch(t){return void u.call("error",e,t)}else n=c;u.call("load",e,n)}else u.call("error",e,t)}if("undefined"==typeof XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=c.ontimeout=h:c.onreadystatechange=function(t){c.readyState>3&&h(t)},c.onprogress=function(t){u.call("progress",e,t)},e={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?a.get(t):(null==n?a.remove(t):a.set(t,n+""),e)},mimeType:function(t){return arguments.length?(r=null==t?null:t+"",e):r},responseType:function(t){return arguments.length?(o=t,e):o},timeout:function(t){return arguments.length?(l=+t,e):l},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",e)},password:function(t){return arguments.length<1?s:(s=null==t?null:t+"",e)},response:function(t){return i=t,e},get:function(t,n){return e.send("GET",t,n)},post:function(t,n){return e.send("POST",t,n)},send:function(n,i,h){return c.open(n,t,!0,f,s),null==r||a.has("accept")||a.set("accept",r+",*/*"),c.setRequestHeader&&a.each((function(t,n){c.setRequestHeader(n,t)})),null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=o&&(c.responseType=o),l>0&&(c.timeout=l),null==h&&"function"==typeof i&&(h=i,i=null),null!=h&&1===h.length&&(h=function(t){return function(n,e){t(null==n?e:null)}}(h)),null!=h&&e.on("error",h).on("load",(function(t){h(null,t)})),u.call("beforesend",e,c),c.send(null==i?null:i),e},abort:function(){return c.abort(),e},on:function(){var t=u.on.apply(u,arguments);return t===u?e:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return e.get(n)}return e};var wp=function(t,n){return function(e,r){var i=bp(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},Mp=wp("text/html",(function(t){return document.createRange().createContextualFragment(t.responseText)})),kp=wp("application/json",(function(t){return JSON.parse(t.responseText)})),Tp=wp("text/plain",(function(t){return t.responseText})),Sp=wp("application/xml",(function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n})),Ap=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=bp(e).mimeType(t);return o.row=function(t){return arguments.length?o.response(Np(n,r=t)):r},o.row(r),i?o.get(i):o}};function Np(t,n){return function(e){return t(e.responseText,n)}}var Ep=Ap("text/csv",ra),Cp=Ap("text/tab-separated-values",ca),Pp=Array.prototype,Op=Pp.map,Dp=Pp.slice,zp={name:"implicit"};function Rp(t){var n=Lu(),e=[],r=zp;function i(i){var o=i+"",u=n.get(o);if(!u){if(r!==zp)return r;n.set(o,u=e.push(i))}return t[(u-1)%t.length]}return t=null==t?[]:Dp.call(t),i.domain=function(t){if(!arguments.length)return e.slice();e=[],n=Lu();for(var r,o,u=-1,a=t.length;++u2?Bp:Yp,r=i=null,s}function s(n){return(r||(r=e(o,u,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,a)))(+n)}return s.invert=function(t){return(i||(i=e(u,o,Fp,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},s.domain=function(t){return arguments.length?(o=Op.call(t,qp),f()):o.slice()},s.range=function(t){return arguments.length?(u=Dp.call(t),f()):u.slice()},s.rangeRound=function(t){return u=Dp.call(t),a=br,f()},s.clamp=function(t){return arguments.length?(c=!!t,f()):c},s.interpolate=function(t){return arguments.length?(a=t,f()):a},f()}var Vp=function(t,n,e){var r,i=t[0],o=t[t.length-1],u=N(i,o,null==n?10:n);switch((e=Ha(null==e?",f":e)).type){case"s":var a=Math.max(Math.abs(i),Math.abs(o));return null!=e.precision||isNaN(r=tc(u,a))||(e.precision=r),$a(e,a);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(r=nc(u,Math.max(Math.abs(i),Math.abs(o))))||(e.precision=r-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(r=Ka(u))||(e.precision=r-2*("%"===e.type))}return Wa(e)};function Wp(t){var n=t.domain;return t.ticks=function(t){var e=n();return S(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Vp(n(),t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,u=i.length-1,a=i[o],c=i[u];return c0?r=A(a=Math.floor(a/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=A(a=Math.ceil(a*r)/r,c=Math.floor(c*r)/r,e)),r>0?(i[o]=Math.floor(a/r)*r,i[u]=Math.ceil(c/r)*r,n(i)):r<0&&(i[o]=Math.ceil(a*r)/r,i[u]=Math.floor(c*r)/r,n(i)),t},t}function $p(){var t=Xp(Fp,lr);return t.copy=function(){return Hp(t,$p())},Wp(t)}function Zp(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Op.call(e,qp),n):t.slice()},n.copy=function(){return Zp().domain(t)},Wp(n)}var Gp=function(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],u=t[i];return u0){for(;hc)break;v.push(l)}}else for(;h=1;--s)if(!((l=f*s)c)break;v.push(l)}}else v=S(h,d,Math.min(d-h,p)).map(i);return o?v.reverse():v},t.tickFormat=function(n,o){if(null==o&&(o=10===e?".0e":","),"function"!=typeof o&&(o=Wa(o)),n===1/0)return o;null==n&&(n=10);var u=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/i(Math.round(r(t)));return n*e0?e[i-1]:t[0],i=e?[r[e-1],n]:[r[u-1],r[u]]},o.copy=function(){return cv().domain([t,n]).range(i)},Wp(o)}function fv(){var t=[.5],n=[0,1],e=1;function r(r){if(r<=r)return n[c(t,r,0,e)]}return r.domain=function(i){return arguments.length?(t=Dp.call(i),e=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(i){return arguments.length?(n=Dp.call(i),e=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},r.copy=function(){return fv().domain(t).range(n)},r}var sv=new Date,lv=new Date;function hv(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return a;do{a.push(u=new Date(+e)),n(e,o),t(e)}while(u=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return sv.setTime(+n),lv.setTime(+r),t(sv),t(lv),Math.floor(e(sv,lv))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var dv=hv((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));dv.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?hv((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):dv:null};var pv=dv,vv=dv.range,yv=6e4,gv=6048e5,_v=hv((function(t){t.setTime(1e3*Math.floor(t/1e3))}),(function(t,n){t.setTime(+t+1e3*n)}),(function(t,n){return(n-t)/1e3}),(function(t){return t.getUTCSeconds()})),mv=_v,xv=_v.range,bv=hv((function(t){t.setTime(Math.floor(t/yv)*yv)}),(function(t,n){t.setTime(+t+n*yv)}),(function(t,n){return(n-t)/yv}),(function(t){return t.getMinutes()})),wv=bv,Mv=bv.range,kv=hv((function(t){var n=t.getTimezoneOffset()*yv%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getHours()})),Tv=kv,Sv=kv.range,Av=hv((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*yv)/864e5}),(function(t){return t.getDate()-1})),Nv=Av,Ev=Av.range;function Cv(t){return hv((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*yv)/gv}))}var Pv=Cv(0),Ov=Cv(1),Dv=Cv(2),zv=Cv(3),Rv=Cv(4),Lv=Cv(5),Uv=Cv(6),Iv=Pv.range,qv=Ov.range,jv=Dv.range,Fv=zv.range,Yv=Rv.range,Bv=Lv.range,Hv=Uv.range,Xv=hv((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Vv=Xv,Wv=Xv.range,$v=hv((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));$v.every=function(t){return isFinite(t=Math.floor(t))&&t>0?hv((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var Zv=$v,Gv=$v.range,Qv=hv((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*yv)}),(function(t,n){return(n-t)/yv}),(function(t){return t.getUTCMinutes()})),Jv=Qv,Kv=Qv.range,ty=hv((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getUTCHours()})),ny=ty,ey=ty.range,ry=hv((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/864e5}),(function(t){return t.getUTCDate()-1})),iy=ry,oy=ry.range;function uy(t){return hv((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/gv}))}var ay=uy(0),cy=uy(1),fy=uy(2),sy=uy(3),ly=uy(4),hy=uy(5),dy=uy(6),py=ay.range,vy=cy.range,yy=fy.range,gy=sy.range,_y=ly.range,my=hy.range,xy=dy.range,by=hv((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),wy=by,My=by.range,ky=hv((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));ky.every=function(t){return isFinite(t=Math.floor(t))&&t>0?hv((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Ty=ky,Sy=ky.range;function Ay(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ny(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ey(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Cy(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,u=t.shortDays,a=t.months,c=t.shortMonths,f=Yy(i),s=By(i),l=Yy(o),h=By(o),d=Yy(u),p=By(u),v=Yy(a),y=By(a),g=Yy(c),_=By(c),m={a:function(t){return u[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:fg,e:fg,f:pg,H:sg,I:lg,j:hg,L:dg,m:vg,M:yg,p:function(t){return i[+(t.getHours()>=12)]},Q:Hg,s:Xg,S:gg,u:_g,U:mg,V:xg,w:bg,W:wg,x:null,X:null,y:Mg,Y:kg,Z:Tg,"%":Bg},x={a:function(t){return u[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Sg,e:Sg,f:Pg,H:Ag,I:Ng,j:Eg,L:Cg,m:Og,M:Dg,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Hg,s:Xg,S:zg,u:Rg,U:Lg,V:Ug,w:Ig,W:qg,x:null,X:null,y:jg,Y:Fg,Z:Yg,"%":Bg},b={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=y[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return k(t,n,e,r)},d:Ky,e:Ky,f:og,H:ng,I:ng,j:tg,L:ig,m:Jy,M:eg,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:ag,s:cg,S:rg,u:Xy,U:Vy,V:Wy,w:Hy,W:$y,x:function(t,n,r){return k(t,e,n,r)},X:function(t,n,e){return k(t,r,n,e)},y:Gy,Y:Zy,Z:Qy,"%":ug};function w(t,n){return function(e){var r,i,o,u=[],a=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++a53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Ny(Ey(o.y))).getUTCDay(),r=i>4||0===i?cy.ceil(r):cy(r),r=iy.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=n(Ey(o.y))).getDay(),r=i>4||0===i?Ov.ceil(r):Ov(r),r=Nv.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Ny(Ey(o.y)).getUTCDay():n(Ey(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Ny(o)):n(o)}}function k(t,n,e,r){for(var i,o,u=0,a=n.length,c=e.length;u=c)return-1;if(37===(i=n.charCodeAt(u++))){if(i=n.charAt(u++),!(o=b[i in Ly?n.charAt(u++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return(m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),x.x=w(e,x),x.X=w(r,x),x.c=w(n,x),{format:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",Ay);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",x);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,Ny);return n.toString=function(){return t},n}})}var Py,Oy,Dy,zy,Ry,Ly={"-":"",_:" ",0:"0"},Uy=/^\s*\d+/,Iy=/^%/,qy=/[\\^$*+?|[\]().{}]/g;function jy(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function Qy(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Jy(t,n,e){var r=Uy.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Ky(t,n,e){var r=Uy.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function tg(t,n,e){var r=Uy.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function ng(t,n,e){var r=Uy.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function eg(t,n,e){var r=Uy.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function rg(t,n,e){var r=Uy.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function ig(t,n,e){var r=Uy.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function og(t,n,e){var r=Uy.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function ug(t,n,e){var r=Iy.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function ag(t,n,e){var r=Uy.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function cg(t,n,e){var r=Uy.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function fg(t,n){return jy(t.getDate(),n,2)}function sg(t,n){return jy(t.getHours(),n,2)}function lg(t,n){return jy(t.getHours()%12||12,n,2)}function hg(t,n){return jy(1+Nv.count(Zv(t),t),n,3)}function dg(t,n){return jy(t.getMilliseconds(),n,3)}function pg(t,n){return dg(t,n)+"000"}function vg(t,n){return jy(t.getMonth()+1,n,2)}function yg(t,n){return jy(t.getMinutes(),n,2)}function gg(t,n){return jy(t.getSeconds(),n,2)}function _g(t){var n=t.getDay();return 0===n?7:n}function mg(t,n){return jy(Pv.count(Zv(t),t),n,2)}function xg(t,n){var e=t.getDay();return t=e>=4||0===e?Rv(t):Rv.ceil(t),jy(Rv.count(Zv(t),t)+(4===Zv(t).getDay()),n,2)}function bg(t){return t.getDay()}function wg(t,n){return jy(Ov.count(Zv(t),t),n,2)}function Mg(t,n){return jy(t.getFullYear()%100,n,2)}function kg(t,n){return jy(t.getFullYear()%1e4,n,4)}function Tg(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+jy(n/60|0,"0",2)+jy(n%60,"0",2)}function Sg(t,n){return jy(t.getUTCDate(),n,2)}function Ag(t,n){return jy(t.getUTCHours(),n,2)}function Ng(t,n){return jy(t.getUTCHours()%12||12,n,2)}function Eg(t,n){return jy(1+iy.count(Ty(t),t),n,3)}function Cg(t,n){return jy(t.getUTCMilliseconds(),n,3)}function Pg(t,n){return Cg(t,n)+"000"}function Og(t,n){return jy(t.getUTCMonth()+1,n,2)}function Dg(t,n){return jy(t.getUTCMinutes(),n,2)}function zg(t,n){return jy(t.getUTCSeconds(),n,2)}function Rg(t){var n=t.getUTCDay();return 0===n?7:n}function Lg(t,n){return jy(ay.count(Ty(t),t),n,2)}function Ug(t,n){var e=t.getUTCDay();return t=e>=4||0===e?ly(t):ly.ceil(t),jy(ly.count(Ty(t),t)+(4===Ty(t).getUTCDay()),n,2)}function Ig(t){return t.getUTCDay()}function qg(t,n){return jy(cy.count(Ty(t),t),n,2)}function jg(t,n){return jy(t.getUTCFullYear()%100,n,2)}function Fg(t,n){return jy(t.getUTCFullYear()%1e4,n,4)}function Yg(){return"+0000"}function Bg(){return"%"}function Hg(t){return+t}function Xg(t){return Math.floor(+t/1e3)}function Vg(t){return Py=Cy(t),Oy=Py.format,Dy=Py.parse,zy=Py.utcFormat,Ry=Py.utcParse,Py}Vg({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 Wg=Date.prototype.toISOString?function(t){return t.toISOString()}:zy("%Y-%m-%dT%H:%M:%S.%LZ");var $g=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:Ry("%Y-%m-%dT%H:%M:%S.%LZ"),Zg=1e3,Gg=60*Zg,Qg=60*Gg,Jg=24*Qg,Kg=7*Jg,t_=30*Jg,n_=365*Jg;function e_(t){return new Date(t)}function r_(t){return t instanceof Date?+t:+new Date(+t)}function i_(t,n,e,r,o,u,a,c,f){var s=Xp(Fp,lr),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),v=f("%I:%M"),y=f("%I %p"),g=f("%a %d"),_=f("%b %d"),m=f("%B"),x=f("%Y"),b=[[a,1,Zg],[a,5,5*Zg],[a,15,15*Zg],[a,30,30*Zg],[u,1,Gg],[u,5,5*Gg],[u,15,15*Gg],[u,30,30*Gg],[o,1,Qg],[o,3,3*Qg],[o,6,6*Qg],[o,12,12*Qg],[r,1,Jg],[r,2,2*Jg],[e,1,Kg],[n,1,t_],[n,3,3*t_],[t,1,n_]];function w(i){return(a(i)1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return v_.h=360*t-100,v_.s=1.5-1.5*n,v_.l=.8-.9*n,v_+""};function g_(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var __=g_(a_("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),m_=g_(a_("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),x_=g_(a_("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),b_=g_(a_("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function w_(t){var n=0,e=1,r=!1;function i(i){var o=(i-n)/(e-n);return t(r?Math.max(0,Math.min(1,o)):o)}return i.domain=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.clamp=function(t){return arguments.length?(r=!!t,i):r},i.interpolator=function(n){return arguments.length?(t=n,i):t},i.copy=function(){return w_(t).domain([n,e]).clamp(r)},Wp(i)}var M_=function(t){return function(){return t}},k_=Math.abs,T_=Math.atan2,S_=Math.cos,A_=Math.max,N_=Math.min,E_=Math.sin,C_=Math.sqrt,P_=1e-12,O_=Math.PI,D_=O_/2,z_=2*O_;function R_(t){return t>=1?D_:t<=-1?-D_:Math.asin(t)}function L_(t){return t.innerRadius}function U_(t){return t.outerRadius}function I_(t){return t.startAngle}function q_(t){return t.endAngle}function j_(t){return t&&t.padAngle}function F_(t,n,e,r,i,o,u){var a=t-e,c=n-r,f=(u?o:-o)/C_(a*a+c*c),s=f*c,l=-f*a,h=t+s,d=n+l,p=e+s,v=r+l,y=(h+p)/2,g=(d+v)/2,_=p-h,m=v-d,x=_*_+m*m,b=i-o,w=h*v-p*d,M=(m<0?-1:1)*C_(A_(0,b*b*x-w*w)),k=(w*m-_*M)/x,T=(-w*_-m*M)/x,S=(w*m+_*M)/x,A=(-w*_+m*M)/x,N=k-y,E=T-g,C=S-y,P=A-g;return N*N+E*E>C*C+P*P&&(k=S,T=A),{cx:k,cy:T,x01:-s,y01:-l,x11:k*(i/b-1),y11:T*(i/b-1)}}var Y_=function(){var t=L_,n=U_,e=M_(0),r=null,i=I_,o=q_,u=j_,a=null;function c(){var c,f,s,l=+t.apply(this,arguments),h=+n.apply(this,arguments),d=i.apply(this,arguments)-D_,p=o.apply(this,arguments)-D_,v=k_(p-d),y=p>d;if(a||(a=c=Au()),hP_)if(v>z_-P_)a.moveTo(h*S_(d),h*E_(d)),a.arc(0,0,h,d,p,!y),l>P_&&(a.moveTo(l*S_(p),l*E_(p)),a.arc(0,0,l,p,d,y));else{var g,_,m=d,x=p,b=d,w=p,M=v,k=v,T=u.apply(this,arguments)/2,S=T>P_&&(r?+r.apply(this,arguments):C_(l*l+h*h)),A=N_(k_(h-l)/2,+e.apply(this,arguments)),N=A,E=A;if(S>P_){var C=R_(S/l*E_(T)),P=R_(S/h*E_(T));(M-=2*C)>P_?(b+=C*=y?1:-1,w-=C):(M=0,b=w=(d+p)/2),(k-=2*P)>P_?(m+=P*=y?1:-1,x-=P):(k=0,m=x=(d+p)/2)}var O=h*S_(m),D=h*E_(m),z=l*S_(w),R=l*E_(w);if(A>P_){var L=h*S_(x),U=h*E_(x),I=l*S_(b),q=l*E_(b);if(vP_?function(t,n,e,r,i,o,u,a){var c=e-t,f=r-n,s=u-i,l=a-o,h=(s*(n-o)-l*(t-i))/(l*c-s*f);return[t+h*c,n+h*f]}(O,D,I,q,L,U,z,R):[z,R],F=O-j[0],Y=D-j[1],B=L-j[0],H=U-j[1],X=1/E_(((s=(F*B+Y*H)/(C_(F*F+Y*Y)*C_(B*B+H*H)))>1?0:s<-1?O_:Math.acos(s))/2),V=C_(j[0]*j[0]+j[1]*j[1]);N=N_(A,(l-V)/(X-1)),E=N_(A,(h-V)/(X+1))}}k>P_?E>P_?(g=F_(I,q,O,D,h,E,y),_=F_(L,U,z,R,h,E,y),a.moveTo(g.cx+g.x01,g.cy+g.y01),EP_&&M>P_?N>P_?(g=F_(z,R,L,U,l,-N,y),_=F_(O,D,I,q,l,-N,y),a.lineTo(g.cx+g.x01,g.cy+g.y01),N=s;--l)a.point(y[l],g[l]);a.lineEnd(),a.areaEnd()}v&&(y[f]=+t(h,f,c),g[f]=+e(h,f,c),a.point(n?+n(h,f,c):y[f],r?+r(h,f,c):g[f]))}if(d)return a=null,d+""||null}function f(){return W_().defined(i).curve(u).context(o)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:M_(+e),n=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:M_(+n),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:M_(+t),c):n},c.y=function(t){return arguments.length?(e="function"==typeof t?t:M_(+t),r=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:M_(+t),c):e},c.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:M_(+t),c):r},c.lineX0=c.lineY0=function(){return f().x(t).y(e)},c.lineY1=function(){return f().x(t).y(r)},c.lineX1=function(){return f().x(n).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:M_(!!t),c):i},c.curve=function(t){return arguments.length?(u=t,null!=o&&(a=u(o)),c):u},c.context=function(t){return arguments.length?(null==t?o=a=null:a=u(o=t),c):o},c},Z_=function(t,n){return nt?1:n>=t?0:NaN},G_=function(t){return t},Q_=function(){var t=G_,n=Z_,e=null,r=M_(0),i=M_(z_),o=M_(0);function u(u){var a,c,f,s,l,h=u.length,d=0,p=new Array(h),v=new Array(h),y=+r.apply(this,arguments),g=Math.min(z_,Math.max(-z_,i.apply(this,arguments)-y)),_=Math.min(Math.abs(g)/h,o.apply(this,arguments)),m=_*(g<0?-1:1);for(a=0;a0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(v[t],v[e])})):null!=e&&p.sort((function(t,n){return e(u[t],u[n])})),a=0,f=d?(g-h*m)/d:0;a0?l*f:0)+m,v[c]={data:u[c],index:a,value:l,startAngle:y,endAngle:s,padAngle:_};return v}return u.value=function(n){return arguments.length?(t="function"==typeof n?n:M_(+n),u):t},u.sortValues=function(t){return arguments.length?(n=t,e=null,u):n},u.sort=function(t){return arguments.length?(e=t,n=null,u):e},u.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:M_(+t),u):r},u.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:M_(+t),u):i},u.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:M_(+t),u):o},u},J_=tm(H_);function K_(t){this._curve=t}function tm(t){function n(n){return new K_(t(n))}return n._curve=t,n}function nm(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(tm(t)):n()._curve},t}K_.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var em=function(){return nm(W_().curve(J_))},rm=function(){var t=$_().curve(J_),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=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 nm(e())},delete t.lineX0,t.lineEndAngle=function(){return nm(r())},delete t.lineX1,t.lineInnerRadius=function(){return nm(i())},delete t.lineY0,t.lineOuterRadius=function(){return nm(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(tm(t)):n()._curve},t},im=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},om=Array.prototype.slice;function um(t){return t.source}function am(t){return t.target}function cm(t){var n=um,e=am,r=X_,i=V_,o=null;function u(){var u,a=om.call(arguments),c=n.apply(this,a),f=e.apply(this,a);if(o||(o=u=Au()),t(o,+r.apply(this,(a[0]=c,a)),+i.apply(this,a),+r.apply(this,(a[0]=f,a)),+i.apply(this,a)),u)return o=null,u+""||null}return u.source=function(t){return arguments.length?(n=t,u):n},u.target=function(t){return arguments.length?(e=t,u):e},u.x=function(t){return arguments.length?(r="function"==typeof t?t:M_(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:M_(+t),u):i},u.context=function(t){return arguments.length?(o=null==t?null:t,u):o},u}function fm(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function sm(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function lm(t,n,e,r,i){var o=im(n,e),u=im(n,e=(e+i)/2),a=im(r,e),c=im(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(u[0],u[1],a[0],a[1],c[0],c[1])}function hm(){return cm(fm)}function dm(){return cm(sm)}function pm(){var t=cm(lm);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var vm={draw:function(t,n){var e=Math.sqrt(n/O_);t.moveTo(e,0),t.arc(0,0,e,0,z_)}},ym={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},gm=Math.sqrt(1/3),_m=2*gm,mm={draw:function(t,n){var e=Math.sqrt(n/_m),r=e*gm;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},xm=Math.sin(O_/10)/Math.sin(7*O_/10),bm=Math.sin(z_/10)*xm,wm=-Math.cos(z_/10)*xm,Mm={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=bm*e,i=wm*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var u=z_*o/5,a=Math.cos(u),c=Math.sin(u);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},km={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Tm=Math.sqrt(3),Sm={draw:function(t,n){var e=-Math.sqrt(n/(3*Tm));t.moveTo(0,2*e),t.lineTo(-Tm*e,-e),t.lineTo(Tm*e,-e),t.closePath()}},Am=Math.sqrt(3)/2,Nm=1/Math.sqrt(12),Em=3*(Nm/2+1),Cm={draw:function(t,n){var e=Math.sqrt(n/Em),r=e/2,i=e*Nm,o=r,u=e*Nm+e,a=-o,c=u;t.moveTo(r,i),t.lineTo(o,u),t.lineTo(a,c),t.lineTo(-.5*r-Am*i,Am*r+-.5*i),t.lineTo(-.5*o-Am*u,Am*o+-.5*u),t.lineTo(-.5*a-Am*c,Am*a+-.5*c),t.lineTo(-.5*r+Am*i,-.5*i-Am*r),t.lineTo(-.5*o+Am*u,-.5*u-Am*o),t.lineTo(-.5*a+Am*c,-.5*c-Am*a),t.closePath()}},Pm=[vm,ym,mm,km,Mm,Sm,Cm],Om=function(){var t=M_(vm),n=M_(64),e=null;function r(){var r;if(e||(e=r=Au()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return r.type=function(n){return arguments.length?(t="function"==typeof n?n:M_(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:M_(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},Dm=function(){};function zm(t,n,e){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+n)/6,(t._y0+4*t._y1+e)/6)}function Rm(t){this._context=t}Rm.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:zm(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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);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:zm(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Lm=function(t){return new Rm(t)};function Um(t){this._context=t}Um.prototype={areaStart:Dm,areaEnd:Dm,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:zm(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Im=function(t){return new Um(t)};function qm(t){this._context=t}qm.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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:zm(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var jm=function(t){return new qm(t)};function Fm(t,n){this._basis=new Rm(t),this._beta=n}Fm.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],u=t[e]-i,a=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*u),this._beta*n[c]+(1-this._beta)*(o+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Ym=function t(n){function e(t){return 1===n?new Rm(t):new Fm(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function Bm(t,n,e){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-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function Hm(t,n){this._context=t,this._k=(1-n)/6}Hm.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:Bm(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Bm(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Xm=function t(n){function e(t){return new Hm(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Vm(t,n){this._context=t,this._k=(1-n)/6}Vm.prototype={areaStart:Dm,areaEnd:Dm,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Bm(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Wm=function t(n){function e(t){return new Vm(t,n)}return e.tension=function(n){return t(+n)},e}(0);function $m(t,n){this._context=t,this._k=(1-n)/6}$m.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,n){switch(t=+t,n=+n,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:Bm(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Zm=function t(n){function e(t){return new $m(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Gm(t,n,e){var r=t._x1,i=t._y1,o=t._x2,u=t._y2;if(t._l01_a>P_){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>P_){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-n*t._l12_2a)/s,u=(u*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,u,t._x2,t._y2)}function Qm(t,n){this._context=t,this._alpha=n}Qm.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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Gm(this,t,n)}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=n}};var Jm=function t(n){function e(t){return n?new Qm(t,n):new Hm(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Km(t,n){this._context=t,this._alpha=n}Km.prototype={areaStart:Dm,areaEnd:Dm,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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Gm(this,t,n)}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=n}};var tx=function t(n){function e(t){return n?new Km(t,n):new Vm(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function nx(t,n){this._context=t,this._alpha=n}nx.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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,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:Gm(this,t,n)}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=n}};var ex=function t(n){function e(t){return n?new nx(t,n):new $m(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function rx(t){this._context=t}rx.prototype={areaStart:Dm,areaEnd:Dm,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var ix=function(t){return new rx(t)};function ox(t){return t<0?-1:1}function ux(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),u=(e-t._y1)/(i||r<0&&-0),a=(o*i+u*r)/(r+i);return(ox(o)+ox(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(a))||0}function ax(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function cx(t,n,e){var r=t._x0,i=t._y0,o=t._x1,u=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*n,o-a,u-a*e,o,u)}function fx(t){this._context=t}function sx(t){this._context=new lx(t)}function lx(t){this._context=t}function hx(t){return new fx(t)}function dx(t){return new sx(t)}function px(t){this._context=t}function vx(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),u=new Array(r);for(i[0]=0,o[0]=2,u[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(u[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var _x=function(t){return new gx(t,.5)};function mx(t){return new gx(t,0)}function xx(t){return new gx(t,1)}var bx=function(t,n){if((i=t.length)>1)for(var e,r,i,o=1,u=t[n[0]],a=u.length;o=0;)e[n]=n;return e};function Mx(t,n){return t[n]}var kx=function(){var t=M_([]),n=wx,e=bx,r=Mx;function i(i){var o,u,a=t.apply(this,arguments),c=i.length,f=a.length,s=new Array(f);for(o=0;o0){for(var e,r,i,o=0,u=t[0].length;o1)for(var e,r,i,o,u,a,c=0,f=t[n[0]].length;c=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=u,r[0]=u+=i):r[0]=o},Ax=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,u=1;u0)){if(o/=h,h<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=r-c,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>s&&(s=o)}else if(h>0){if(o0)){if(o/=d,d<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=i-f,d||!(o<0)){if(o/=d,d<0){if(o>l)return;o>s&&(s=o)}else if(d>0){if(o0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function Wx(t,n,e,r,i){var o=t[1];if(o)return!0;var u,a,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],v=(l+d)/2,y=(h+p)/2;if(p===h){if(v=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[v,e];o=[v,i]}else{if(c){if(c[1]1)if(l>d){if(c){if(c[1]>=i)return}else c=[(e-a)/u,e];o=[(i-a)/u,i]}else{if(c){if(c[1]=r)return}else c=[n,u*n+a];o=[r,u*r+a]}else{if(c){if(c[0]=-vb)){var d=c*c+f*f,p=s*s+l*l,v=(l*d-f*p)/h,y=(c*p-s*d)/h,g=Jx.pop()||new Kx;g.arc=t,g.site=i,g.x=v+u,g.y=(g.cy=y+a)+Math.sqrt(v*v+y*y),t.circle=g;for(var _=null,m=hb._;m;)if(g.ypb)a=a.L;else{if(!((i=o-fb(a,u))>pb)){r>-pb?(n=a.P,e=a):i>-pb?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){lb[t.index]={site:t,halfedges:[]}}(t);var c=ib(t);if(sb.insert(n,c),n||e){if(n===e)return nb(n),e=ib(n.site),sb.insert(c,e),c.edge=e.edge=Bx(n.site,c.site),tb(n),void tb(e);if(e){nb(n),nb(e);var f=n.site,s=f[0],l=f[1],h=t[0]-s,d=t[1]-l,p=e.site,v=p[0]-s,y=p[1]-l,g=2*(h*y-d*v),_=h*h+d*d,m=v*v+y*y,x=[(y*_-d*m)/g+s,(h*m-v*_)/g+l];Xx(e.edge,f,p,x),c.edge=Bx(f,t,null,x),e.edge=Bx(t,p,null,x),tb(n),tb(e)}else c.edge=Bx(n.site,c.site)}}function cb(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var u=t.P;if(!u)return-1/0;var a=(e=u.site)[0],c=e[1],f=c-n;if(!f)return a;var s=a-r,l=1/o-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-o/2)))/l+r:(r+a)/2}function fb(t,n){var e=t.N;if(e)return cb(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var sb,lb,hb,db,pb=1e-6,vb=1e-12;function yb(t,n){return n[1]-t[1]||n[0]-t[0]}function gb(t,n){var e,r,i,o=t.sort(yb).pop();for(db=[],lb=new Array(t.length),sb=new Yx,hb=new Yx;;)if(i=Qx,o&&(!i||o[1]pb||Math.abs(i[0][1]-i[1][1])>pb)||delete db[o]}(u,a,c,f),function(t,n,e,r){var i,o,u,a,c,f,s,l,h,d,p,v,y=lb.length,g=!0;for(i=0;ipb||Math.abs(v-h)>pb)&&(c.splice(a,0,db.push(Hx(u,d,Math.abs(p-t)pb?[t,Math.abs(l-t)pb?[Math.abs(h-r)pb?[e,Math.abs(l-e)pb?[Math.abs(h-n)=a)return null;var c=t-i.site[0],f=n-i.site[1],s=c*c+f*f;do{i=o.cells[r=u],u=null,i.halfedges.forEach((function(e){var r=o.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],f=n-a[1],l=c*c+f*f;lr?(r+i)/2:Math.min(0,r)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}var Ob=function(){var t,n,e=Sb,r=Ab,i=Pb,o=Eb,u=Cb,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,s=Cr,l=[],h=vt("start","zoom","end"),d=500,p=150,v=0;function y(t){t.property("__zoom",Nb).on("wheel.zoom",M).on("mousedown.zoom",k).on("dblclick.zoom",T).filter(u).on("touchstart.zoom",S).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new bb(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new bb(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e){t.on("start.zoom",(function(){b(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,o=b(t,i),u=r.apply(t,i),a=e||m(u),c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),f=t.__zoom,l="function"==typeof n?n.apply(t,i):n,h=s(f.invert(a).concat(c/f.k),l.invert(a).concat(c/l.k));return function(t){if(1===t)t=l;else{var n=h(t),e=c/n[2];t=new bb(e,a[0]-n[0]*e,a[1]-n[1]*e)}o.zoom(null,t)}}))}function b(t,n){for(var e,r=0,i=l.length;rv}t.zoom("mouse",i(_(t.that.__zoom,t.mouse[0]=qn(t.that),t.mouse[1]),t.extent,c))}),!0).on("mouseup.zoom",(function(){r.on("mousemove.zoom mouseup.zoom",null),Vn(_n.view,t.moved),Tb(),t.end()}),!0),o=qn(this),u=_n.clientX,a=_n.clientY;Xn(_n.view),kb(),t.mouse=[o,this.__zoom.invert(o)],wi(this),t.start()}}function T(){if(e.apply(this,arguments)){var t=this.__zoom,n=qn(this),o=t.invert(n),u=t.k*(_n.shiftKey?.5:2),a=i(_(g(t,u),n,o),r.apply(this,arguments),c);Tb(),f>0?On(this).transition().duration(f).call(x,a,n):On(this).call(y.transform,a)}}function S(){if(e.apply(this,arguments)){var n,r,i,o,u=b(this,arguments),a=_n.changedTouches,c=a.length;for(kb(),r=0;r=0&&g.splice(n,1)}function a(t){var n=document.createElement("style");return n.type="text/css",o(t,n),n}function c(t){var n=document.createElement("link");return n.rel="stylesheet",o(t,n),n}function f(t,n){var e,r,i;if(n.singleton){var o=y++;e=v||(v=a(n)),r=s.bind(null,e,o,!1),i=s.bind(null,e,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=c(n),r=function(t,n){var e=n.css,r=n.sourceMap;r&&(e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([e],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}.bind(null,e),i=function(){u(e),e.href&&URL.revokeObjectURL(e.href)}):(e=a(n),r=function(t,n){var e=n.css,r=n.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}.bind(null,e),i=function(){u(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else i()}}function s(t,n,e,r){var i=e?"":r.css;if(t.styleSheet)t.styleSheet.cssText=_(n,i);else{var o=document.createTextNode(i),u=t.childNodes;u[n]&&t.removeChild(u[n]),u.length?t.insertBefore(o,u[n]):t.appendChild(o)}}var l={},h=function(t){var n;return function(){return void 0===n&&(n=t.apply(this,arguments)),n}},d=h(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),p=h(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,y=0,g=[];t.exports=function(t,n){void 0===(n=n||{}).singleton&&(n.singleton=d()),void 0===n.insertAt&&(n.insertAt="bottom");var e=i(t);return r(e,n),function(t){for(var o=[],u=0;u1}).append("line").attr("class","separator separator-double"),t.selectAll(".separator-double").style("stroke","#FFF").style("stroke-width",function(t){return 4*t.bond-5+"px"}),e.filter(function(t){return 3===t.bond}).append("line").attr("class","separator separator-triple"),t.selectAll(".separator-triple").style("stroke",function(t){return c.default.chooseColor(t,"black")}).style("stroke-width","1px"),n.exit().remove()}}},{key:"render",value:function(){var t=this;return o.default.createElement("g",{className:"links-container",ref:function(n){t.linksContainer=n}})}}]),n}();f.propTypes={links:u.default.arrayOf(u.default.object)},n.default=f},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function t(t,n){for(var e=0;en?1:t>=n?0:NaN},i=function(t){var n;return 1===t.length&&(n=t,t=function(t,e){return r(n(t),e)}),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}};var o=i(r),u=o.right,a=o.left,c=u,f=function(t,n){null==n&&(n=s);for(var e=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);et?1:n>=t?0:NaN},d=function(t){return null===t?NaN:+t},p=function(t,n){var e,r,i=t.length,o=0,u=-1,a=0,c=0;if(null==n)for(;++u1)return c/(o-1)},v=function(t,n){var e=p(t,n);return e?Math.sqrt(e):e},y=function(t,n){var e,r,i,o=t.length,u=-1;if(null==n){for(;++u=e)for(r=i=e;++ue&&(r=e),i=e)for(r=i=e;++ue&&(r=e),i0)return[t];if((r=n0)for(t=Math.ceil(t/u),n=Math.floor(n/u),o=new Array(i=Math.ceil(n-t+1));++a=0?(o>=M?10:o>=k?5:o>=T?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=M?10:o>=k?5:o>=T?2:1)}function N(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=M?i*=10:o>=k?i*=5:o>=T&&(i*=2),nl;)h.pop(),--d;var p,v=new Array(d+1);for(i=0;i<=d;++i)(p=v[i]=[]).x0=i>0?h[i-1]:s,p.x1=i=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),u=+e(t[o],o,t);return u+(+e(t[o+1],o+1,t)-u)*(i-o)}},O=function(t,n,e){return t=m.call(t,d).sort(r),Math.ceil((e-n)/(2*(P(t,.75)-P(t,.25))*Math.pow(t.length,-1/3)))},D=function(t,n,e){return Math.ceil((e-n)/(3.5*v(t)*Math.pow(t.length,-1/3)))},z=function(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++or&&(r=e)}else for(;++o=e)for(r=e;++or&&(r=e);return r},R=function(t,n){var e,r=t.length,i=r,o=-1,u=0;if(null==n)for(;++o=0;)for(n=(r=t[i]).length;--n>=0;)e[--u]=r[n];return e},I=function(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++oe&&(r=e)}else for(;++o=e)for(r=e;++oe&&(r=e);return r},q=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},j=function(t,n){if(e=t.length){var e,i,o=0,u=0,a=t[u];for(null==n&&(n=r);++o=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})),u=-1,a=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++u0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),pt.hasOwnProperty(n)?{space:pt[n],local:t}:t};var yt=function(t){var n=vt(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===dt&&n.documentElement.namespaceURI===dt?n.createElement(t):n.createElementNS(e,t)}})(n)};function gt(){}var _t=function(t){return null==t?gt:function(){return this.querySelector(t)}};function mt(){return[]}var xt=function(t){return null==t?mt:function(){return this.querySelectorAll(t)}},bt=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var wt=document.documentElement;if(!wt.matches){var Mt=wt.webkitMatchesSelector||wt.msMatchesSelector||wt.mozMatchesSelector||wt.oMatchesSelector;bt=function(t){return function(){return Mt.call(this,t)}}}}var kt=bt,Tt=function(t){return new Array(t.length)};function St(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}St.prototype={constructor:St,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var At="$";function Nt(t,n,e,r,i,o){for(var u,a=0,c=n.length,f=o.length;an?1:t>=n?0:NaN}var Pt=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Ot(t,n){return t.style.getPropertyValue(n)||Pt(t).getComputedStyle(t,null).getPropertyValue(n)}function Dt(t){return t.trim().split(/^|\s+/)}function zt(t){return t.classList||new Rt(t)}function Rt(t){this._node=t,this._names=Dt(t.getAttribute("class")||"")}function Lt(t,n){for(var e=zt(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function It(){this.textContent=""}function qt(){this.innerHTML=""}function jt(){this.nextSibling&&this.parentNode.appendChild(this)}function Ft(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yt(){return null}function Bt(){var t=this.parentNode;t&&t.removeChild(this)}function Ht(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function Xt(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var Vt={},Wt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(Vt={mouseenter:"mouseover",mouseleave:"mouseout"}));function $t(t,n,e){return t=Zt(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function Zt(t,n,e){return function(r){var i=Wt;Wt=r;try{t.call(this,this.__data__,n,e)}finally{Wt=i}}}function Gt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=b&&(b=x+1);!(m=g[b])&&++b=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=Ct);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):Ot(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=Dt(t+"");if(arguments.length<2){for(var r=zt(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),u=o.length;if(!(arguments.length<2)){for(a=n?Qt:Gt,null==e&&(e=!1),r=0;rl}c.mouse("drag")}function v(){on(Wt.view).on("mousemove.drag mouseup.drag",null),mn(Wt.view,e),gn(),c.mouse("end")}function y(){if(i.apply(this,arguments)){var t,n,e=Wt.changedTouches,r=o.apply(this,arguments),u=e.length;for(t=0;t>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=zn.exec(t))?Bn(parseInt(n[1],16)):(n=Rn.exec(t))?new Wn(n[1],n[2],n[3],1):(n=Ln.exec(t))?new Wn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Un.exec(t))?Hn(n[1],n[2],n[3],n[4]):(n=In.exec(t))?Hn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=qn.exec(t))?$n(n[1],n[2]/100,n[3]/100,1):(n=jn.exec(t))?$n(n[1],n[2]/100,n[3]/100,n[4]):Fn.hasOwnProperty(t)?Bn(Fn[t]):"transparent"===t?new Wn(NaN,NaN,NaN,0):null}function Bn(t){return new Wn(t>>16&255,t>>8&255,255&t,1)}function Hn(t,n,e,r){return r<=0&&(t=n=e=NaN),new Wn(t,n,e,r)}function Xn(t){return t instanceof En||(t=Yn(t)),t?new Wn((t=t.rgb()).r,t.g,t.b,t.opacity):new Wn}function Vn(t,n,e,r){return 1===arguments.length?Xn(t):new Wn(t,n,e,null==r?1:r)}function Wn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function $n(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Gn(t,n,e,r)}function Zn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Gn)return new Gn(t.h,t.s,t.l,t.opacity);if(t instanceof En||(t=Yn(t)),!t)return new Gn;if(t instanceof Gn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,c=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e0&&c<1?0:u,new Gn(u,a,c,t.opacity)}(t):new Gn(t,n,e,null==r?1:r)}function Gn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Qn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}An(En,Yn,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),An(Wn,Vn,Nn(En,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Wn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Wn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(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+")")}})),An(Gn,Zn,Nn(En,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Gn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Gn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Wn(Qn(t>=240?t-240:t+120,i,r),Qn(t,i,r),Qn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Jn=Math.PI/180,Kn=180/Math.PI,te=.95047,ne=1,ee=1.08883,re=4/29,ie=6/29,oe=3*ie*ie,ue=ie*ie*ie;function ae(t){if(t instanceof fe)return new fe(t.l,t.a,t.b,t.opacity);if(t instanceof ve){var n=t.h*Jn;return new fe(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof Wn||(t=Xn(t));var e=de(t.r),r=de(t.g),i=de(t.b),o=se((.4124564*e+.3575761*r+.1804375*i)/te),u=se((.2126729*e+.7151522*r+.072175*i)/ne);return new fe(116*u-16,500*(o-u),200*(u-se((.0193339*e+.119192*r+.9503041*i)/ee)),t.opacity)}function ce(t,n,e,r){return 1===arguments.length?ae(t):new fe(t,n,e,null==r?1:r)}function fe(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function se(t){return t>ue?Math.pow(t,1/3):t/oe+re}function le(t){return t>ie?t*t*t:oe*(t-re)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function de(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof ve)return new ve(t.h,t.c,t.l,t.opacity);t instanceof fe||(t=ae(t));var n=Math.atan2(t.b,t.a)*Kn;return new ve(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new ve(t,n,e,null==r?1:r)}function ve(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}An(fe,ce,Nn(En,{brighter:function(t){return new fe(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new fe(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=ne*le(t),new Wn(he(3.2404542*(n=te*le(n))-1.5371385*t-.4985314*(e=ee*le(e))),he(-.969266*n+1.8760108*t+.041556*e),he(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),An(ve,pe,Nn(En,{brighter:function(t){return new ve(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new ve(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return ae(this).rgb()}}));var ye=-.29227,ge=-.90649,_e=1.97294,me=_e*ge,xe=1.78277*_e,be=1.78277*ye- -.14861*ge;function we(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Me)return new Me(t.h,t.s,t.l,t.opacity);t instanceof Wn||(t=Xn(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(be*r+me*n-xe*e)/(be+me-xe),o=r-i,u=(_e*(e-i)-ye*o)/ge,a=Math.sqrt(u*u+o*o)/(_e*i*(1-i)),c=a?Math.atan2(u,o)*Kn-120:NaN;return new Me(c<0?c+360:c,a,i,t.opacity)}(t):new Me(t,n,e,null==r?1:r)}function Me(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ke(t,n,e,r,i){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*e+(1+3*t+3*o-3*u)*r+u*i)/6}An(Me,we,Nn(En,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Me(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Me(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Jn,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new Wn(255*(n+e*(-.14861*r+1.78277*i)),255*(n+e*(ye*r+ge*i)),255*(n+e*(_e*r)),this.opacity)}}));var Te=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],u=r>0?t[r-1]:2*i-o,a=r180||e<-180?e-360*Math.round(e/360):e):Ae(isNaN(t)?n:t)}function Ce(t){return 1==(t=+t)?Pe:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Ae(isNaN(n)?e:n)}}function Pe(t,n){var e=n-t;return e?Ne(t,e):Ae(isNaN(t)?n:t)}var Oe=function t(n){var e=Ce(n);function r(t,n){var r=e((t=Vn(t)).r,(n=Vn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=Pe(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}return r.gamma=t,r}(1);function De(t){return function(n){var e,r,i=n.length,o=new Array(i),u=new Array(i),a=new Array(i);for(e=0;eo&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:Ie(e,r)})),o=Fe.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Ie(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Ie(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,c),function(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:Ie(t,e)},{i:a-2,x:Ie(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,c),o=u=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--gr}function Pr(){wr=(br=kr.now())+Mr,gr=_r=0;try{Cr()}finally{gr=0,function(){var t,n,e=hr,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:hr=n);dr=t,Dr(r)}(),wr=0}}function Or(){var t=kr.now(),n=t-br;n>xr&&(Mr-=n,br=t)}function Dr(t){gr||(_r&&(_r=clearTimeout(_r)),t-wr>24?(t<1/0&&(_r=setTimeout(Pr,t-kr.now()-Mr)),mr&&(mr=clearInterval(mr))):(mr||(br=kr.now(),mr=setInterval(Or,xr)),gr=1,Tr(Pr)))}Nr.prototype=Er.prototype={constructor:Nr,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Sr():+e)+(null==n?0:+n),this._next||dr===this||(dr?dr._next=this:hr=this,dr=this),this._call=t,this._time=e,Dr()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dr())}};var zr=function(t,n,e){var r=new Nr;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r},Rr=function(t,n,e){var r=new Nr,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?Sr():+e,r.restart(function o(u){u+=i,r.restart(o,i+=n,e),t(u)},n,e),r)},Lr=ht("start","end","interrupt"),Ur=[],Ir=0,qr=1,jr=2,Fr=3,Yr=4,Br=5,Hr=6,Xr=function(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(c){var f,s,l,h;if(e.state!==qr)return a();for(f in i)if((h=i[f]).name===e.name){if(h.state===Fr)return zr(o);h.state===Yr?(h.state=Hr,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fIr)throw new Error("too late; already scheduled");return e}function Wr(t,n){var e=$r(t,n);if(e.state>jr)throw new Error("too late; already started");return e}function $r(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var Zr=function(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>jr&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?Vr:Wr;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}(e,t,n))},attr:function(t,n){var e=vt(t),r="transform"===e?tr:Qr;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var u,a=e(this);if(null!=a)return(u=this.getAttributeNS(t.space,t.local))===a?null:u===r&&a===i?o:o=n(r=u,i=a);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var u,a=e(this);if(null!=a)return(u=this.getAttribute(t))===a?null:u===r&&a===i?o:o=n(r=u,i=a);this.removeAttribute(t)}})(e,r,Gr(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}:function(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=vt(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Ke:Qr;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=Ot(this,t),u=(this.style.removeProperty(t),Ot(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,o;return function(){var u=Ot(this,t),a=e(this);return null==a&&(this.style.removeProperty(t),a=Ot(this,t)),u===a?null:u===r&&a===i?o:o=n(r=u,i=a)}}(t,r,Gr(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var o=Ot(this,t);return o===e?null:o===r?i:i=n(r=o,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Gr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=$r(this.node(),e).tween,o=0,u=i.length;oqr&&e.name===n)return new ti([[t]],Wi,n,+r);return null},Zi=function(t){return function(){return t}},Gi=function(t,n,e){this.target=t,this.type=n,this.selection=e};function Qi(){Wt.stopImmediatePropagation()}var Ji=function(){Wt.preventDefault(),Wt.stopImmediatePropagation()},Ki={name:"drag"},to={name:"space"},no={name:"handle"},eo={name:"center"},ro={name:"x",handles:["e","w"].map(lo),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},io={name:"y",handles:["n","s"].map(lo),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},oo={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(lo),input:function(t){return t},output:function(t){return t}},uo={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ao={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},co={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},fo={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},so={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function lo(t){return{type:t}}function ho(){return!Wt.button}function po(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function vo(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function yo(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function go(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function _o(){return bo(ro)}function mo(){return bo(io)}var xo=function(){return bo(oo)};function bo(t){var n,e=po,r=ho,i=ht(u,"start","brush","end"),o=6;function u(n){var e=n.property("__brush",l).selectAll(".overlay").data([lo("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",uo.overlay).merge(e).each(function(){var t=vo(this).extent;on(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),n.selectAll(".selection").data([lo("selection")]).enter().append("rect").attr("class","selection").attr("cursor",uo.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,function(t){return t.type});r.exit().remove(),r.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return uo[t.type]}),n.each(a).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",s)}function a(){var t=on(this),n=vo(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?n[1][0]-o/2:n[0][0]-o/2}).attr("y",function(t){return"s"===t.type[0]?n[1][1]-o/2:n[0][1]-o/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+o:o}).attr("height",function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+o:o})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(t,n){return t.__brush.emitter||new f(t,n)}function f(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function s(){if(Wt.touches){if(Wt.changedTouches.length0&&(e=i-d),w<0?l=h-p:w>0&&(o=u-p),x=to,R.attr("cursor",uo.selection),I());break;default:return}Ji()},!0).on("keyup.brush",function(){switch(Wt.keyCode){case 16:C&&(y=g=C=!1,I());break;case 18:x===eo&&(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(o=u),x=no,I());break;case 32:x===to&&(Wt.altKey?(b&&(f=s-d*b,e=i+d*b),w&&(l=h-p*w,o=u+p*w),x=eo):(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(o=u),x=no),R.attr("cursor",uo[m]),I());break;default:return}Ji()},!0).on("mousemove.brush",U,!0).on("mouseup.brush",q,!0);_n(Wt.view)}Qi(),Zr(_),a.call(_),D.start()}function U(){var t=hn(_);!C||y||g||(Math.abs(t[0]-O[0])>Math.abs(t[1]-O[1])?g=!0:y=!0),O=t,v=!0,Ji(),I()}function I(){var t;switch(d=O[0]-P[0],p=O[1]-P[1],x){case to:case Ki:b&&(d=Math.max(S-e,Math.min(N-f,d)),i=e+d,s=f+d),w&&(p=Math.max(A-o,Math.min(E-l,p)),u=o+p,h=l+p);break;case no:b<0?(d=Math.max(S-e,Math.min(N-e,d)),i=e+d,s=f):b>0&&(d=Math.max(S-f,Math.min(N-f,d)),i=e,s=f+d),w<0?(p=Math.max(A-o,Math.min(E-o,p)),u=o+p,h=l):w>0&&(p=Math.max(A-l,Math.min(E-l,p)),u=o,h=l+p);break;case eo:b&&(i=Math.max(S,Math.min(N,e-d*b)),s=Math.max(S,Math.min(N,f+d*b))),w&&(u=Math.max(A,Math.min(E,o-p*w)),h=Math.max(A,Math.min(E,l+p*w)))}s1e-6)if(Math.abs(s*a-c*f)>1e-6&&i){var h=e-o,d=r-u,p=a*a+c*c,v=h*h+d*d,y=Math.sqrt(p),g=Math.sqrt(l),_=i*Math.tan((Po-Math.acos((p+l-v)/(2*y*g)))/2),m=_/g,x=_/y;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*f)+","+(n+m*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>f*d)+","+(this._x1=t+x*a)+","+(this._y1=n+x*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n;var u=(e=+e)*Math.cos(r),a=e*Math.sin(r),c=t+u,f=n+a,s=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+f:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+c+","+f),e&&(l<0&&(l=l%Oo+Oo),l>Do?this._+="A"+e+","+e+",0,1,"+s+","+(t-u)+","+(n-a)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=f):l>1e-6&&(this._+="A"+e+","+e+",0,"+ +(l>=Po)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var Lo=Ro;function Uo(t){return t.source}function Io(t){return t.target}function qo(t){return t.radius}function jo(t){return t.startAngle}function Fo(t){return t.endAngle}var Yo=function(){var t=Uo,n=Io,e=qo,r=jo,i=Fo,o=null;function u(){var u,a=Eo.call(arguments),c=t.apply(this,a),f=n.apply(this,a),s=+e.apply(this,(a[0]=c,a)),l=r.apply(this,a)-To,h=i.apply(this,a)-To,d=s*wo(l),p=s*Mo(l),v=+e.apply(this,(a[0]=f,a)),y=r.apply(this,a)-To,g=i.apply(this,a)-To;if(o||(o=u=Lo()),o.moveTo(d,p),o.arc(0,0,s,l,h),l===y&&h===g||(o.quadraticCurveTo(0,0,v*wo(y),v*Mo(y)),o.arc(0,0,v,y,g)),o.quadraticCurveTo(0,0,d,p),o.closePath(),u)return o=null,u+""||null}return u.radius=function(t){return arguments.length?(e="function"==typeof t?t:Co(+t),u):e},u.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Co(+t),u):r},u.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Co(+t),u):i},u.source=function(n){return arguments.length?(t=n,u):t},u.target=function(t){return arguments.length?(n=t,u):n},u.context=function(t){return arguments.length?(o=null==t?null:t,u):o},u};function Bo(){}function Ho(t,n){var e=new Bo;if(t instanceof Bo)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var c,f,s,l=-1,h=e.length,d=r[i++],p=Xo(),v=u();++lr.length)return e;var u,a=i[o-1];return null!=n&&o>=r.length?u=e.entries():(u=[],e.each(function(n,e){u.push({key:e,values:t(n,o)})})),null!=a?u.sort(function(t,n){return a(t.key,n.key)}):u}(o(t,0,Zo,Go),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}};function Wo(){return{}}function $o(t,n,e){t[n]=e}function Zo(){return Xo()}function Go(t,n,e){t.set(n,e)}function Qo(){}var Jo=Xo.prototype;function Ko(t,n){var e=new Qo;if(t instanceof Qo)t.each(function(t){e.add(t)});else if(t){var r=-1,i=t.length;if(null==n)for(;++r=o?c=!0:(r=t.charCodeAt(u++))===au?f=!0:r===cu&&(f=!0,t.charCodeAt(u)===au&&++u),t.slice(i+1,n-1).replace(/""/g,'"')}for(;u=(o=(v+g)/2))?v=o:g=o,(s=e>=(u=(y+_)/2))?y=u:_=u,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(a=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===a&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(o=(v+g)/2))?v=o:g=o,(s=e>=(u=(y+_)/2))?y=u:_=u}while((l=s<<1|f)==(h=(c>=u)<<1|a>=o));return i[h]=d,i[l]=p,t}var Tu=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function Su(t){return t[0]}function Au(t){return t[1]}function Nu(t,n,e){var r=new Eu(null==n?Su:n,null==e?Au:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Eu(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Cu(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var Pu=Nu.prototype=Eu.prototype;function Ou(t){return t.x+t.vx}function Du(t){return t.y+t.vy}Pu.copy=function(){var t,n,e=new Eu(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=Cu(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=Cu(n));return e},Pu.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return ku(this.cover(n,e),n,e,t)},Pu.addAll=function(t){var n,e,r,i,o=t.length,u=new Array(o),a=new Array(o),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));for(st||t>i||r>n||n>o))return this;var u,a,c=i-e,f=this._root;switch(a=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{(u=new Array(4))[a]=f,f=u}while(o=r+(c*=2),t>(i=e+c)||n>o);break;case 1:do{(u=new Array(4))[a]=f,f=u}while(o=r+(c*=2),(e=i-c)>t||n>o);break;case 2:do{(u=new Array(4))[a]=f,f=u}while(r=o-(c*=2),t>(i=e+c)||r>n);break;case 3:do{(u=new Array(4))[a]=f,f=u}while(r=o-(c*=2),(e=i-c)>t||r>n)}this._root&&this._root.length&&(this._root=f)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},Pu.data=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},Pu.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Pu.find=function(t,n,e){var r,i,o,u,a,c,f,s=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new Tu(v,s,l,h,d)),null==e?e=1/0:(s=t-e,l=n-e,h=t+e,d=n+e,e*=e);c=p.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(o=c.y0)>d||(u=c.x1)=g)<<1|t>=y)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,v.data),m=n-+this._y.call(null,v.data),x=_*_+m*m;if(x=(a=(p+y)/2))?p=a:y=a,(s=u>=(c=(v+g)/2))?v=c:g=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},Pu.removeAll=function(t){for(var n=0,e=t.length;nc+d||if+d||oa.index){var p=c-u.x-u.vx,v=f-u.y-u.vy,y=p*p+v*v;yt.r&&(t.r=t[n].r)}function a(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r1?(null==e?a.remove(t):a.set(t,d(e)),n):a.get(t)},find:function(n,e,r){var i,o,u,a,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},Hu=function(){var t,n,e,r,i=wu(-30),o=1,u=1/0,a=.81;function c(r){var i,o=t.length,u=Nu(t,Iu,qu).visitAfter(s);for(e=r,i=0;i=u)){(t.data!==n||t.next)&&(0===s&&(d+=(s=Mu())*s),0===l&&(d+=(l=Mu())*l),d1?r[0]+r.slice(2):r,+t.slice(e+1)]},Zu=function(t){return(t=$u(Math.abs(t)))?t[1]:NaN},Gu=function(t,n){var e=$u(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Qu={"":function(t,n){t:for(var e,r=(t=t.toPrecision(n)).length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Gu(100*t,n)},r:Gu,s:function(t,n){var e=$u(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(ju=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return o===u?r:o>u?r+new Array(o-u+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+$u(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Ju=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function Ku(t){return new ta(t)}function ta(t){if(!(n=Ju.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",o=n[4]||"",u=!!n[5],a=n[6]&&+n[6],c=!!n[7],f=n[8]&&+n[8].slice(1),s=n[9]||"";"n"===s?(c=!0,s="g"):Qu[s]||(s=""),(u||"0"===e&&"="===r)&&(u=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=u,this.width=a,this.comma=c,this.precision=f,this.type=s}Ku.prototype=ta.prototype,ta.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var na,ea,ra,ia=function(t){return t},oa=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],ua=function(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,o=[],u=0,a=n[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(t.substring(i-=a,i+a)),!((c+=a+1)>r));)a=n[u=(u+1)%n.length];return o.reverse().join(e)}):ia,i=t.currency,o=t.decimal,u=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}}(t.numerals):ia,a=t.percent||"%";function c(t){var n=(t=Ku(t)).fill,e=t.align,c=t.sign,f=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.type,v="$"===f?i[0]:"#"===f&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",y="$"===f?i[1]:/[%p]/.test(p)?a:"",g=Qu[p],_=!p||/[defgprs%]/.test(p);function m(t){var i,a,f,m=v,x=y;if("c"===p)x=g(t)+x,t="";else{var b=(t=+t)<0;if(t=g(Math.abs(t),d),b&&0==+t&&(b=!1),m=(b?"("===c?c:"-":"-"===c||"("===c?"":c)+m,x=("s"===p?oa[8+ju/3]:"")+x+(b&&"("===c?")":""),_)for(i=-1,a=t.length;++i(f=t.charCodeAt(i))||f>57){x=(46===f?o+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var w=m.length+t.length+x.length,M=w>1)+m+t+x+M.slice(w);break;default:t=M+m+t+x}return u(t)}return d=null==d?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:c,formatPrefix:function(t,n){var e=c(((t=Ku(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Zu(n)/3))),i=Math.pow(10,-r),o=oa[8+r/3];return function(t){return e(i*t)+o}}}};function aa(t){return na=ua(t),ea=na.format,ra=na.formatPrefix,na}aa({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var ca=function(t){return Math.max(0,-Zu(Math.abs(t)))},fa=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Zu(n)/3)))-Zu(Math.abs(t)))},sa=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Zu(n)-Zu(t))+1},la=function(){return new ha};function ha(){this.reset()}ha.prototype={constructor:ha,reset:function(){this.s=this.t=0},add:function(t){pa(da,t,this.t),pa(this,da.s,this.s),this.s?this.t+=da.t:this.s=da.t},valueOf:function(){return this.s}};var da=new ha;function pa(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}var va=1e-6,ya=Math.PI,ga=ya/2,_a=ya/4,ma=2*ya,xa=180/ya,ba=ya/180,wa=Math.abs,Ma=Math.atan,ka=Math.atan2,Ta=Math.cos,Sa=Math.ceil,Aa=Math.exp,Na=(Math.floor,Math.log),Ea=Math.pow,Ca=Math.sin,Pa=Math.sign||function(t){return t>0?1:t<0?-1:0},Oa=Math.sqrt,Da=Math.tan;function za(t){return t>1?0:t<-1?ya:Math.acos(t)}function Ra(t){return t>1?ga:t<-1?-ga:Math.asin(t)}function La(t){return(t=Ca(t/2))*t}function Ua(){}function Ia(t,n){t&&ja.hasOwnProperty(t.type)&&ja[t.type](t,n)}var qa={Feature:function(t,n){Ia(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=Ta(n=(n*=ba)/2+_a),u=Ca(n),a=Wa*u,c=Va*o+a*Ta(i),f=a*r*Ca(i);Za.add(ka(f,c)),Xa=t,Va=o,Wa=u}var ec=function(t){return Ga.reset(),$a(t,Qa),2*Ga};function rc(t){return[ka(t[1],t[0]),Ra(t[2])]}function ic(t){var n=t[0],e=t[1],r=Ta(e);return[r*Ta(n),r*Ca(n),Ca(e)]}function oc(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function uc(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function ac(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function cc(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function fc(t){var n=Oa(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var sc,lc,hc,dc,pc,vc,yc,gc,_c,mc,xc=la(),bc={point:wc,lineStart:kc,lineEnd:Tc,polygonStart:function(){bc.point=Sc,bc.lineStart=Ac,bc.lineEnd=Nc,xc.reset(),Qa.polygonStart()},polygonEnd:function(){Qa.polygonEnd(),bc.point=wc,bc.lineStart=kc,bc.lineEnd=Tc,Za<0?(sc=-(hc=180),lc=-(dc=90)):xc>va?dc=90:xc<-va&&(lc=-90),mc[0]=sc,mc[1]=hc}};function wc(t,n){_c.push(mc=[sc=t,hc=t]),ndc&&(dc=n)}function Mc(t,n){var e=ic([t*ba,n*ba]);if(gc){var r=uc(gc,e),i=uc([r[1],-r[0],0],r);fc(i),i=rc(i);var o,u=t-pc,a=u>0?1:-1,c=i[0]*xa*a,f=wa(u)>180;f^(a*pcdc&&(dc=o):f^(a*pc<(c=(c+360)%360-180)&&cdc&&(dc=n)),f?tEc(sc,hc)&&(hc=t):Ec(t,hc)>Ec(sc,hc)&&(sc=t):hc>=sc?(thc&&(hc=t)):t>pc?Ec(sc,t)>Ec(sc,hc)&&(hc=t):Ec(t,hc)>Ec(sc,hc)&&(sc=t)}else _c.push(mc=[sc=t,hc=t]);ndc&&(dc=n),gc=e,pc=t}function kc(){bc.point=Mc}function Tc(){mc[0]=sc,mc[1]=hc,bc.point=wc,gc=null}function Sc(t,n){if(gc){var e=t-pc;xc.add(wa(e)>180?e+(e>0?360:-360):e)}else vc=t,yc=n;Qa.point(t,n),Mc(t,n)}function Ac(){Qa.lineStart()}function Nc(){Sc(vc,yc),Qa.lineEnd(),wa(xc)>va&&(sc=-(hc=180)),mc[0]=sc,mc[1]=hc,gc=null}function Ec(t,n){return(n-=t)<0?n+360:n}function Cc(t,n){return t[0]-n[0]}function Pc(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nEc(r[0],r[1])&&(r[1]=i[1]),Ec(i[0],r[1])>Ec(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(u=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(a=Ec(r[1],i[0]))>u&&(u=a,sc=i[0],hc=r[1])}return _c=mc=null,sc===1/0||lc===1/0?[[NaN,NaN],[NaN,NaN]]:[[sc,lc],[hc,dc]]},Zc={sphere:Ua,point:Gc,lineStart:Jc,lineEnd:nf,polygonStart:function(){Zc.lineStart=ef,Zc.lineEnd=rf},polygonEnd:function(){Zc.lineStart=Jc,Zc.lineEnd=nf}};function Gc(t,n){t*=ba;var e=Ta(n*=ba);Qc(e*Ta(t),e*Ca(t),Ca(n))}function Qc(t,n,e){zc+=(t-zc)/++Oc,Rc+=(n-Rc)/Oc,Lc+=(e-Lc)/Oc}function Jc(){Zc.point=Kc}function Kc(t,n){t*=ba;var e=Ta(n*=ba);Xc=e*Ta(t),Vc=e*Ca(t),Wc=Ca(n),Zc.point=tf,Qc(Xc,Vc,Wc)}function tf(t,n){t*=ba;var e=Ta(n*=ba),r=e*Ta(t),i=e*Ca(t),o=Ca(n),u=ka(Oa((u=Vc*o-Wc*i)*u+(u=Wc*r-Xc*o)*u+(u=Xc*i-Vc*r)*u),Xc*r+Vc*i+Wc*o);Dc+=u,Uc+=u*(Xc+(Xc=r)),Ic+=u*(Vc+(Vc=i)),qc+=u*(Wc+(Wc=o)),Qc(Xc,Vc,Wc)}function nf(){Zc.point=Gc}function ef(){Zc.point=of}function rf(){uf(Bc,Hc),Zc.point=Gc}function of(t,n){Bc=t,Hc=n,t*=ba,n*=ba,Zc.point=uf;var e=Ta(n);Xc=e*Ta(t),Vc=e*Ca(t),Wc=Ca(n),Qc(Xc,Vc,Wc)}function uf(t,n){t*=ba;var e=Ta(n*=ba),r=e*Ta(t),i=e*Ca(t),o=Ca(n),u=Vc*o-Wc*i,a=Wc*r-Xc*o,c=Xc*i-Vc*r,f=Oa(u*u+a*a+c*c),s=Ra(f),l=f&&-s/f;jc+=l*u,Fc+=l*a,Yc+=l*c,Dc+=s,Uc+=s*(Xc+(Xc=r)),Ic+=s*(Vc+(Vc=i)),qc+=s*(Wc+(Wc=o)),Qc(Xc,Vc,Wc)}var af=function(t){Oc=Dc=zc=Rc=Lc=Uc=Ic=qc=jc=Fc=Yc=0,$a(t,Zc);var n=jc,e=Fc,r=Yc,i=n*n+e*e+r*r;return i<1e-12&&(n=Uc,e=Ic,r=qc,Dcya?t-ma:t<-ya?t+ma:t,n]}function lf(t,n,e){return(t%=ma)?n||e?ff(df(t),pf(n,e)):df(t):n||e?pf(n,e):sf}function hf(t){return function(n,e){return[(n+=t)>ya?n-ma:n<-ya?n+ma:n,e]}}function df(t){var n=hf(t);return n.invert=hf(-t),n}function pf(t,n){var e=Ta(t),r=Ca(t),i=Ta(n),o=Ca(n);function u(t,n){var u=Ta(n),a=Ta(t)*u,c=Ca(t)*u,f=Ca(n),s=f*e+a*r;return[ka(c*i-s*o,a*e-f*r),Ra(s*i+c*o)]}return u.invert=function(t,n){var u=Ta(n),a=Ta(t)*u,c=Ca(t)*u,f=Ca(n),s=f*i-c*o;return[ka(c*i+f*o,a*e+s*r),Ra(s*e-a*r)]},u}sf.invert=sf;var vf=function(t){function n(n){return(n=t(n[0]*ba,n[1]*ba))[0]*=xa,n[1]*=xa,n}return t=lf(t[0]*ba,t[1]*ba,t.length>2?t[2]*ba:0),n.invert=function(n){return(n=t.invert(n[0]*ba,n[1]*ba))[0]*=xa,n[1]*=xa,n},n};function yf(t,n,e,r,i,o){if(e){var u=Ta(n),a=Ca(n),c=r*e;null==i?(i=n+r*ma,o=n-c/2):(i=gf(u,i),o=gf(u,o),(r>0?io)&&(i+=r*ma));for(var f,s=i;r>0?s>o:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},xf=function(t,n){return wa(t[0]-n[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function Mf(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,k=M*w,T=k>ya,S=p*x;if(kf.add(ka(S*M*Ca(k),v*b+S*Ta(k))),o+=T?w+M*ma:w,T^h>=e^_>=e){var A=uc(ic(l),ic(g));fc(A);var N=uc(i,A);fc(N);var E=(T^w>=0?-1:1)*Ra(N[2]);(r>E||r===E&&(A[0]||A[1]))&&(u+=T^w>=0?1:-1)}}return(o<-va||o0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),u.push(h.filter(Af))}return h}};function Af(t){return t.length>1}function Nf(t,n){return((t=t.x)[0]<0?t[1]-ga-va:ga-t[1])-((n=n.x)[0]<0?n[1]-ga-va:ga-n[1])}var Ef=Sf(function(){return!0},function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,u){var a=o>0?ya:-ya,c=wa(o-e);wa(c-ya)0?ga:-ga),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),n=0):i!==a&&c>=ya&&(wa(e-i)va?Ma((Ca(n)*(o=Ta(r))*Ca(e)-Ca(r)*(i=Ta(n))*Ca(t))/(i*o*u)):(n+r)/2}(e,r,o,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=o,r=u),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}},function(t,n,e,r){var i;if(null==t)i=e*ga,r.point(-ya,i),r.point(0,i),r.point(ya,i),r.point(ya,0),r.point(ya,-i),r.point(0,-i),r.point(-ya,-i),r.point(-ya,0),r.point(-ya,i);else if(wa(t[0]-n[0])>va){var o=t[0]0,i=wa(n)>va;function o(t,e){return Ta(t)*Ta(e)>n}function u(t,e,r){var i=[1,0,0],o=uc(ic(t),ic(e)),u=oc(o,o),a=o[0],c=u-a*a;if(!c)return!r&&t;var f=n*u/c,s=-n*a/c,l=uc(i,o),h=cc(i,f);ac(h,cc(o,s));var d=l,p=oc(h,d),v=oc(d,d),y=p*p-v*(oc(h,h)-1);if(!(y<0)){var g=Oa(y),_=cc(d,(-p-g)/v);if(ac(_,h),_=rc(_),!r)return _;var m,x=t[0],b=e[0],w=t[1],M=e[1];b0^_[1]<(wa(_[0]-x)ya^(x<=_[0]&&_[0]<=b)){var S=cc(d,(-p+g)/v);return ac(S,h),[_,rc(S)]}}}function a(n,e){var i=r?t:ya-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return Sf(o,function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],v=o(l,h),y=r?v?0:a(l,h):v?a(l+(l<0?ya:-ya),h):0;if(!n&&(f=c=v)&&t.lineStart(),v!==c&&(!(d=u(n,p))||xf(n,d)||xf(p,d))&&(p[0]+=va,p[1]+=va,v=o(p[0],p[1])),v!==c)s=0,v?(t.lineStart(),d=u(p,n),t.point(d[0],d[1])):(d=u(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^v){var g;y&e||!(g=u(p,n,!0))||(s=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!v||n&&xf(n,p)||t.point(p[0],p[1]),n=p,c=v,e=y},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}},function(n,r,i,o){yf(o,t,e,i,n,r)},r?[0,-t]:[-ya,t-ya])},Pf=function(t,n,e,r,i,o){var u,a=t[0],c=t[1],f=0,s=1,l=n[0]-a,h=n[1]-c;if(u=e-a,l||!(u>0)){if(u/=l,l<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=i-a,l||!(u<0)){if(u/=l,l<0){if(u>s)return;u>f&&(f=u)}else if(l>0){if(u0)){if(u/=h,h<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=o-c,h||!(u<0)){if(u/=h,h<0){if(u>s)return;u>f&&(f=u)}else if(h>0){if(u0&&(t[0]=a+f*l,t[1]=c+f*h),s<1&&(n[0]=a+s*l,n[1]=c+s*h),!0}}}}},Of=1e9,Df=-Of;function zf(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,a,f){var s=0,l=0;if(null==i||(s=u(i,a))!==(l=u(o,a))||c(i,o)<0^a>0)do{f.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+a+4)%4)!==l);else f.point(o[0],o[1])}function u(r,i){return wa(r[0]-t)0?0:3:wa(r[0]-e)0?2:1:wa(r[1]-n)0?1:0:i>0?3:2}function a(t,n){return c(t.x,n.x)}function c(t,n){var e=u(t,1),r=u(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(u){var c,f,s,l,h,d,p,v,y,g,_,m=u,x=mf(),b={point:w,lineStart:function(){b.point=M,f&&f.push(s=[]);g=!0,y=!1,p=v=NaN},lineEnd:function(){c&&(M(l,h),d&&y&&x.rejoin(),c.push(x.result()));b.point=w,y&&m.lineEnd()},polygonStart:function(){m=x,c=[],f=[],_=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=f.length;er&&(h-o)*(r-u)>(d-u)*(t-o)&&++n:d<=r&&(h-o)*(r-u)<(d-u)*(t-o)&&--n;return n}(),e=_&&n,i=(c=U(c)).length;(e||i)&&(u.polygonStart(),e&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),i&&wf(c,a,n,o,u),u.polygonEnd());m=u,c=f=s=null}};function w(t,n){i(t,n)&&m.point(t,n)}function M(o,u){var a=i(o,u);if(f&&s.push([o,u]),g)l=o,h=u,d=a,g=!1,a&&(m.lineStart(),m.point(o,u));else if(a&&y)m.point(o,u);else{var c=[p=Math.max(Df,Math.min(Of,p)),v=Math.max(Df,Math.min(Of,v))],x=[o=Math.max(Df,Math.min(Of,o)),u=Math.max(Df,Math.min(Of,u))];Pf(c,x,t,n,e,r)?(y||(m.lineStart(),m.point(c[0],c[1])),m.point(x[0],x[1]),a||m.lineEnd(),_=!1):a&&(m.lineStart(),m.point(o,u),_=!1)}p=o,v=u,y=a}return b}}var Rf,Lf,Uf,If=function(){var t,n,e,r=0,i=0,o=960,u=500;return e={stream:function(e){return t&&n===e?t:t=zf(r,i,o,u)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],o=+a[1][0],u=+a[1][1],t=n=null,e):[[r,i],[o,u]]}}},qf=la(),jf={sphere:Ua,point:Ua,lineStart:function(){jf.point=Yf,jf.lineEnd=Ff},lineEnd:Ua,polygonStart:Ua,polygonEnd:Ua};function Ff(){jf.point=jf.lineEnd=Ua}function Yf(t,n){Rf=t*=ba,Lf=Ca(n*=ba),Uf=Ta(n),jf.point=Bf}function Bf(t,n){t*=ba;var e=Ca(n*=ba),r=Ta(n),i=wa(t-Rf),o=Ta(i),u=r*Ca(i),a=Uf*e-Lf*r*o,c=Lf*e+Uf*r*o;qf.add(ka(Oa(u*u+a*a),c)),Rf=t,Lf=e,Uf=r}var Hf=function(t){return qf.reset(),$a(t,jf),+qf},Xf=[null,null],Vf={type:"LineString",coordinates:Xf},Wf=function(t,n){return Xf[0]=t,Xf[1]=n,Hf(Vf)},$f={Feature:function(t,n){return Gf(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++rva}).map(c)).concat(w(Sa(o/d)*d,i,d).filter(function(t){return wa(t%v)>va}).map(f))}return g.lines=function(){return _().map(function(t){return{type:"LineString",coordinates:t}})},g.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(u).slice(1),s(e).reverse().slice(1),l(a).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],u=+t[1][1],r>e&&(t=r,r=e,e=t),a>u&&(t=a,a=u,u=t),g.precision(y)):[[r,a],[e,u]]},g.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),g.precision(y)):[[n,o],[t,i]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(p=+t[0],v=+t[1],g):[p,v]},g.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],g):[h,d]},g.precision=function(h){return arguments.length?(y=+h,c=rs(o,i,90),f=is(n,t,y),s=rs(a,u,90),l=is(r,e,y),g):y},g.extentMajor([[-180,-90+va],[180,90-va]]).extentMinor([[-180,-80-va],[180,80+va]])}function us(){return os()()}var as,cs,fs,ss,ls=function(t,n){var e=t[0]*ba,r=t[1]*ba,i=n[0]*ba,o=n[1]*ba,u=Ta(r),a=Ca(r),c=Ta(o),f=Ca(o),s=u*Ta(e),l=u*Ca(e),h=c*Ta(i),d=c*Ca(i),p=2*Ra(Oa(La(o-r)+u*c*La(i-e))),v=Ca(p),y=p?function(t){var n=Ca(t*=p)/v,e=Ca(p-t)/v,r=e*s+n*h,i=e*l+n*d,o=e*a+n*f;return[ka(i,r)*xa,ka(o,Oa(r*r+i*i))*xa]}:function(){return[e*xa,r*xa]};return y.distance=p,y},hs=function(t){return t},ds=la(),ps=la(),vs={point:Ua,lineStart:Ua,lineEnd:Ua,polygonStart:function(){vs.lineStart=ys,vs.lineEnd=ms},polygonEnd:function(){vs.lineStart=vs.lineEnd=vs.point=Ua,ds.add(wa(ps)),ps.reset()},result:function(){var t=ds/2;return ds.reset(),t}};function ys(){vs.point=gs}function gs(t,n){vs.point=_s,as=fs=t,cs=ss=n}function _s(t,n){ps.add(ss*t-fs*n),fs=t,ss=n}function ms(){_s(as,cs)}var xs=vs,bs=1/0,ws=bs,Ms=-bs,ks=Ms;var Ts,Ss,As,Ns,Es={point:function(t,n){tMs&&(Ms=t);nks&&(ks=n)},lineStart:Ua,lineEnd:Ua,polygonStart:Ua,polygonEnd:Ua,result:function(){var t=[[bs,ws],[Ms,ks]];return Ms=ks=-(ws=bs=1/0),t}},Cs=0,Ps=0,Os=0,Ds=0,zs=0,Rs=0,Ls=0,Us=0,Is=0,qs={point:js,lineStart:Fs,lineEnd:Hs,polygonStart:function(){qs.lineStart=Xs,qs.lineEnd=Vs},polygonEnd:function(){qs.point=js,qs.lineStart=Fs,qs.lineEnd=Hs},result:function(){var t=Is?[Ls/Is,Us/Is]:Rs?[Ds/Rs,zs/Rs]:Os?[Cs/Os,Ps/Os]:[NaN,NaN];return Cs=Ps=Os=Ds=zs=Rs=Ls=Us=Is=0,t}};function js(t,n){Cs+=t,Ps+=n,++Os}function Fs(){qs.point=Ys}function Ys(t,n){qs.point=Bs,js(As=t,Ns=n)}function Bs(t,n){var e=t-As,r=n-Ns,i=Oa(e*e+r*r);Ds+=i*(As+t)/2,zs+=i*(Ns+n)/2,Rs+=i,js(As=t,Ns=n)}function Hs(){qs.point=js}function Xs(){qs.point=Ws}function Vs(){$s(Ts,Ss)}function Ws(t,n){qs.point=$s,js(Ts=As=t,Ss=Ns=n)}function $s(t,n){var e=t-As,r=n-Ns,i=Oa(e*e+r*r);Ds+=i*(As+t)/2,zs+=i*(Ns+n)/2,Rs+=i,Ls+=(i=Ns*t-As*n)*(As+t),Us+=i*(Ns+n),Is+=3*i,js(As=t,Ns=n)}var Zs=qs;function Gs(t){this._context=t}Gs.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,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,ma)}},result:Ua};var Qs,Js,Ks,tl,nl,el=la(),rl={point:Ua,lineStart:function(){rl.point=il},lineEnd:function(){Qs&&ol(Js,Ks),rl.point=Ua},polygonStart:function(){Qs=!0},polygonEnd:function(){Qs=null},result:function(){var t=+el;return el.reset(),t}};function il(t,n){rl.point=ol,Js=tl=t,Ks=nl=n}function ol(t,n){tl-=t,nl-=n,el.add(Oa(tl*tl+nl*nl)),tl=t,nl=n}var ul=rl;function al(){this._string=[]}function cl(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}al.prototype={_radius:4.5,_circle:cl(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,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=cl(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var fl=function(t,n){var e,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),$a(t,e(r))),r.result()}return o.area=function(t){return $a(t,e(xs)),xs.result()},o.measure=function(t){return $a(t,e(ul)),ul.result()},o.bounds=function(t){return $a(t,e(Es)),Es.result()},o.centroid=function(t){return $a(t,e(Zs)),Zs.result()},o.projection=function(n){return arguments.length?(e=null==n?(t=null,hs):(t=n).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(n=null,new al):new Gs(n=t),"function"!=typeof i&&r.pointRadius(i),o):n},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(n)},sl=function(t){return{stream:ll(t)}};function ll(t){return function(n){var e=new hl;for(var r in t)e[r]=t[r];return e.stream=n,e}}function hl(){}function dl(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),$a(e,t.stream(Es)),n(Es.result()),null!=r&&t.clipExtent(r),t}function pl(t,n,e){return dl(t,function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),u=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,a=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([u,a])},e)}function vl(t,n,e){return pl(t,[[0,0],n],e)}function yl(t,n,e){return dl(t,function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,u=-i*e[0][1];t.scale(150*i).translate([o,u])},e)}function gl(t,n,e){return dl(t,function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],u=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,u])},e)}hl.prototype={constructor:hl,point:function(t,n){this.stream.point(t,n)},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 _l=16,ml=Ta(30*ba),xl=function(t,n){return+n?function(t,n){function e(r,i,o,u,a,c,f,s,l,h,d,p,v,y){var g=f-r,_=s-i,m=g*g+_*_;if(m>4*n&&v--){var x=u+h,b=a+d,w=c+p,M=Oa(x*x+b*b+w*w),k=Ra(w/=M),T=wa(wa(w)-1)n||wa((g*E+_*C)/m-.5)>.3||u*h+a*d+c*p2?t[2]%360*ba:0,N()):[y*xa,g*xa,_*xa]},T.precision=function(t){return arguments.length?(k=xl(A,M=t*t),E()):Oa(M)},T.fitExtent=function(t,n){return pl(T,t,n)},T.fitSize=function(t,n){return vl(T,t,n)},T.fitWidth=function(t,n){return yl(T,t,n)},T.fitHeight=function(t,n){return gl(T,t,n)},function(){return n=t.apply(this,arguments),T.invert=n.invert&&S,N()}}function kl(t){var n=0,e=ya/3,r=Ml(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*ba,e=t[1]*ba):[n*xa,e*xa]},i}function Tl(t,n){var e=Ca(t),r=(e+Ca(n))/2;if(wa(r)=.12&&i<.234&&r>=-.425&&r<-.214?a:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:u).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[u.stream(n=e),a.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e0?n<-ga+va&&(n=-ga+va):n>ga-va&&(n=ga-va);var e=i/Ea(Il(n),r);return[e*Ca(r*t),i-e*Ta(r*t)]}return o.invert=function(t,n){var e=i-n,o=Pa(r)*Oa(t*t+e*e);return[ka(t,wa(e))/r*Pa(e),2*Ma(Ea(i/o,1/r))-ga]},o}var jl=function(){return kl(ql).scale(109.5).parallels([30,30])};function Fl(t,n){return[t,n]}Fl.invert=Fl;var Yl=function(){return wl(Fl).scale(152.63)};function Bl(t,n){var e=Ta(t),r=t===n?Ca(t):(e-Ta(n))/(n-t),i=e/r+t;if(wa(r)va&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};var Gl=function(){return wl(Zl).scale(175.295)};function Ql(t,n){return[Ta(n)*Ca(t),Ca(n)]}Ql.invert=Cl(Ra);var Jl=function(){return wl(Ql).scale(249.5).clipAngle(90+va)};function Kl(t,n){var e=Ta(n),r=1+Ta(t)*e;return[e*Ca(t)/r,Ca(n)/r]}Kl.invert=Cl(function(t){return 2*Ma(t)});var th=function(){return wl(Kl).scale(250).clipAngle(142)};function nh(t,n){return[Na(Da((ga+n)/2)),-t]}nh.invert=function(t,n){return[-n,2*Ma(Aa(t))-ga]};var eh=function(){var t=Ul(nh),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)};function rh(t,n){return t.parent===n.parent?1:2}function ih(t,n){return t+n.x}function oh(t,n){return Math.max(t,n.y)}var uh=function(){var t=rh,n=1,e=1,r=!1;function i(i){var o,u=0;i.eachAfter(function(n){var e=n.children;e?(n.x=function(t){return t.reduce(ih,0)/t.length}(e),n.y=function(t){return 1+t.reduce(oh,0)}(e)):(n.x=o?u+=t(n,o):0,n.y=0,o=n)});var a=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=a.x-t(a,c)/2,s=c.x+t(c,a)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i};function ah(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function ch(t,n){var e,r,i,o,u,a=new hh(t),c=+t.value&&(a.value=t.value),f=[a];for(null==n&&(n=fh);e=f.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(u=i.length))for(e.children=new Array(u),o=u-1;o>=0;--o)f.push(r=e.children[o]=new hh(i[o])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(lh)}function fh(t){return t.children}function sh(t){t.data=t.data.data}function lh(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function hh(t){this.data=t,this.depth=this.height=0,this.parent=null}hh.prototype=ch.prototype={constructor:hh,count:function(){return this.eachAfter(ah)},each:function(t){var n,e,r,i,o=this,u=[o];do{for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})},sort:function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each(function(n){t.push(n)}),t},leaves:function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},links:function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n},copy:function(){return ch(this).eachBefore(sh)}};var dh=Array.prototype.slice;var ph=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(dh.call(t))).length,o=[];r0&&e*e>r*r+i*i}function _h(t,n){for(var e=0;ee*e+r*r}function kh(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function Th(t){this._=t,this.next=null,this.previous=null}function Sh(t){if(!(i=t.length))return 0;var n,e,r,i,o,u,a,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;wh(e,n,r=t[2]),n=new Th(n),e=new Th(e),r=new Th(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=Nh(n),e):t},e.parentId=function(t){return arguments.length?(n=Nh(t),e):n},e};function Xh(t,n){return t.parent===n.parent?1:2}function Vh(t){var n=t.children;return n?n[0]:t.t}function Wh(t){var n=t.children;return n?n[n.length-1]:t.t}function $h(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Zh(t,n,e){return t.a.parent===n.parent?t.a:e}function Gh(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}Gh.prototype=Object.create(hh.prototype);var Qh=function(){var t=Xh,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,u=new Gh(t,0),a=[u];n=a.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)a.push(e=n.children[i]=new Gh(r[i],i)),e.parent=n;return(u.parent=new Gh(null,0)).children=[u],u}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(u),r)i.eachBefore(a);else{var f=i,s=i,l=i;i.eachBefore(function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)});var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),v=e/(l.depth||1);i.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*v})}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,u=n,a=e,c=o.parent.children[0],f=o.m,s=u.m,l=a.m,h=c.m;a=Wh(a),o=Vh(o),a&&o;)c=Vh(c),(u=Wh(u)).a=n,(i=a.z+l-o.z-f+t(a._,o._))>0&&($h(Zh(a,n,r),n,i),f+=i,s+=i),l+=a.m,f+=o.m,h+=c.m,s+=u.m;a&&!Wh(u)&&(u.t=a,u.m+=l-s),o&&!Vh(c)&&(c.t=o,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function u(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},Jh=function(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,f=t.value&&(i-e)/t.value;++ah&&(h=a),y=s*s*v,(d=Math.max(h/y,y/l))>p){s-=a;break}p=d}g.push(u={value:s,dice:c1?n:1)},e}(Kh),ed=function(){var t=nd,n=!1,e=1,r=1,i=[0],o=Eh,u=Eh,a=Eh,c=Eh,f=Eh;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Lh),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=a[n];return s.x0=i,s.y0=o,s.x1=u,void(s.y1=c)}var l=f[n],h=r/2+l,d=n+1,p=e-1;for(;d>>1;f[v]c-o){var _=(i*g+u*y)/r;t(n,d,y,i,o,_,c),t(d,e,g,_,o,u,c)}else{var m=(o*g+c*y)/r;t(n,d,y,i,o,u,m),t(d,e,g,i,m,u,c)}}(0,c,t.value,n,e,r,i)},id=function(t,n,e,r,i){(1&t.depth?Jh:Uh)(t,n,e,r,i)},od=function t(n){function e(t,e,r,i,o){if((u=t._squarify)&&u.ratio===n)for(var u,a,c,f,s,l=-1,h=u.length,d=t.value;++l1?n:1)},e}(Kh),ud=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++e1&&cd(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}var ld=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[o[n]][2]]);for(n=+a;na!=f>a&&u<(c-e)*(a-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},dd=function(t){for(var n,e,r=-1,i=t.length,o=t[i-1],u=o[0],a=o[1],c=0;++r=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,xd(t)}function xd(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function bd(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new yd(t)}yd.prototype=bd.prototype={constructor:yd,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=pd.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),gd(this),this},abort:function(){return null==this._error&&md(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},xd(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,xd(this),this}};var wd=function(){return Math.random()},Md=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(wd),kd=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(wd),Td=function t(n){function e(){var t=kd.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(wd),Sd=function t(n){function e(t){return function(){for(var e=0,r=0;r=200&&r<300||304===r){if(i)try{n=i.call(e,c)}catch(t){return void u.call("error",e,t)}else n=c;u.call("load",e,n)}else u.call("error",e,t)}if("undefined"==typeof XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=c.ontimeout=h:c.onreadystatechange=function(t){c.readyState>3&&h(t)},c.onprogress=function(t){u.call("progress",e,t)},e={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?a.get(t):(null==n?a.remove(t):a.set(t,n+""),e)},mimeType:function(t){return arguments.length?(r=null==t?null:t+"",e):r},responseType:function(t){return arguments.length?(o=t,e):o},timeout:function(t){return arguments.length?(l=+t,e):l},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",e)},password:function(t){return arguments.length<1?s:(s=null==t?null:t+"",e)},response:function(t){return i=t,e},get:function(t,n){return e.send("GET",t,n)},post:function(t,n){return e.send("POST",t,n)},send:function(n,i,h){return c.open(n,t,!0,f,s),null==r||a.has("accept")||a.set("accept",r+",*/*"),c.setRequestHeader&&a.each(function(t,n){c.setRequestHeader(n,t)}),null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=o&&(c.responseType=o),l>0&&(c.timeout=l),null==h&&"function"==typeof i&&(h=i,i=null),null!=h&&1===h.length&&(h=function(t){return function(n,e){t(null==n?e:null)}}(h)),null!=h&&e.on("error",h).on("load",function(t){h(null,t)}),u.call("beforesend",e,c),c.send(null==i?null:i),e},abort:function(){return c.abort(),e},on:function(){var t=u.on.apply(u,arguments);return t===u?e:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return e.get(n)}return e};var Cd=function(t,n){return function(e,r){var i=Ed(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},Pd=Cd("text/html",function(t){return document.createRange().createContextualFragment(t.responseText)}),Od=Cd("application/json",function(t){return JSON.parse(t.responseText)}),Dd=Cd("text/plain",function(t){return t.responseText}),zd=Cd("application/xml",function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n}),Rd=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=Ed(e).mimeType(t);return o.row=function(t){return arguments.length?o.response(function(t,n){return function(e){return t(e.responseText,n)}}(n,r=t)):r},o.row(r),i?o.get(i):o}};var Ld=Rd("text/csv",hu),Ud=Rd("text/tab-separated-values",gu),Id=Array.prototype,qd=Id.map,jd=Id.slice,Fd={name:"implicit"};function Yd(t){var n=Xo(),e=[],r=Fd;function i(i){var o=i+"",u=n.get(o);if(!u){if(r!==Fd)return r;n.set(o,u=e.push(i))}return t[(u-1)%t.length]}return t=null==t?[]:jd.call(t),i.domain=function(t){if(!arguments.length)return e.slice();e=[],n=Xo();for(var r,o,u=-1,a=t.length;++u2?Gd:Zd,r=i=null,s}function s(n){return(r||(r=e(o,u,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,a)))(+n)}return s.invert=function(t){return(i||(i=e(u,o,$d,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},s.domain=function(t){return arguments.length?(o=qd.call(t,Vd),f()):o.slice()},s.range=function(t){return arguments.length?(u=jd.call(t),f()):u.slice()},s.rangeRound=function(t){return u=jd.call(t),a=$e,f()},s.clamp=function(t){return arguments.length?(c=!!t,f()):c},s.interpolate=function(t){return arguments.length?(a=t,f()):a},f()}var Kd=function(t,n,e){var r,i=t[0],o=t[t.length-1],u=N(i,o,null==n?10:n);switch((e=Ku(null==e?",f":e)).type){case"s":var a=Math.max(Math.abs(i),Math.abs(o));return null!=e.precision||isNaN(r=fa(u,a))||(e.precision=r),ra(e,a);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(r=sa(u,Math.max(Math.abs(i),Math.abs(o))))||(e.precision=r-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(r=ca(u))||(e.precision=r-2*("%"===e.type))}return ea(e)};function tp(t){var n=t.domain;return t.ticks=function(t){var e=n();return S(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Kd(n(),t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,u=i.length-1,a=i[o],c=i[u];return c0?r=A(a=Math.floor(a/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=A(a=Math.ceil(a*r)/r,c=Math.floor(c*r)/r,e)),r>0?(i[o]=Math.floor(a/r)*r,i[u]=Math.ceil(c/r)*r,n(i)):r<0&&(i[o]=Math.ceil(a*r)/r,i[u]=Math.floor(c*r)/r,n(i)),t},t}function np(){var t=Jd($d,Ie);return t.copy=function(){return Qd(t,np())},tp(t)}function ep(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=qd.call(e,Vd),n):t.slice()},n.copy=function(){return ep().domain(t)},tp(n)}var rp=function(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],u=t[i];return u0){for(;hc)break;v.push(l)}}else for(;h=1;--s)if(!((l=f*s)c)break;v.push(l)}}else v=S(h,d,Math.min(d-h,p)).map(i);return o?v.reverse():v},t.tickFormat=function(n,o){if(null==o&&(o=10===e?".0e":","),"function"!=typeof o&&(o=ea(o)),n===1/0)return o;null==n&&(n=10);var u=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/i(Math.round(r(t)));return n*e0?e[i-1]:t[0],i=e?[r[e-1],n]:[r[u-1],r[u]]},o.copy=function(){return vp().domain([t,n]).range(i)},tp(o)}function yp(){var t=[.5],n=[0,1],e=1;function r(r){if(r<=r)return n[c(t,r,0,e)]}return r.domain=function(i){return arguments.length?(t=jd.call(i),e=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(i){return arguments.length?(n=jd.call(i),e=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},r.copy=function(){return yp().domain(t).range(n)},r}var gp=new Date,_p=new Date;function mp(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return a;do{a.push(u=new Date(+e)),n(e,o),t(e)}while(u=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return gp.setTime(+n),_p.setTime(+r),t(gp),t(_p),Math.floor(e(gp,_p))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var xp=mp(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});xp.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?mp(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):xp:null};var bp=xp,wp=xp.range,Mp=6e4,kp=6048e5,Tp=mp(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),Sp=Tp,Ap=Tp.range,Np=mp(function(t){t.setTime(Math.floor(t/Mp)*Mp)},function(t,n){t.setTime(+t+n*Mp)},function(t,n){return(n-t)/Mp},function(t){return t.getMinutes()}),Ep=Np,Cp=Np.range,Pp=mp(function(t){var n=t.getTimezoneOffset()*Mp%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),Op=Pp,Dp=Pp.range,zp=mp(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Mp)/864e5},function(t){return t.getDate()-1}),Rp=zp,Lp=zp.range;function Up(t){return mp(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Mp)/kp})}var Ip=Up(0),qp=Up(1),jp=Up(2),Fp=Up(3),Yp=Up(4),Bp=Up(5),Hp=Up(6),Xp=Ip.range,Vp=qp.range,Wp=jp.range,$p=Fp.range,Zp=Yp.range,Gp=Bp.range,Qp=Hp.range,Jp=mp(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),Kp=Jp,tv=Jp.range,nv=mp(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});nv.every=function(t){return isFinite(t=Math.floor(t))&&t>0?mp(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var ev=nv,rv=nv.range,iv=mp(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*Mp)},function(t,n){return(n-t)/Mp},function(t){return t.getUTCMinutes()}),ov=iv,uv=iv.range,av=mp(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),cv=av,fv=av.range,sv=mp(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1}),lv=sv,hv=sv.range;function dv(t){return mp(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/kp})}var pv=dv(0),vv=dv(1),yv=dv(2),gv=dv(3),_v=dv(4),mv=dv(5),xv=dv(6),bv=pv.range,wv=vv.range,Mv=yv.range,kv=gv.range,Tv=_v.range,Sv=mv.range,Av=xv.range,Nv=mp(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),Ev=Nv,Cv=Nv.range,Pv=mp(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});Pv.every=function(t){return isFinite(t=Math.floor(t))&&t>0?mp(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Ov=Pv,Dv=Pv.range;function zv(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Rv(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Lv(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Uv(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,u=t.shortDays,a=t.months,c=t.shortMonths,f=Zv(i),s=Gv(i),l=Zv(o),h=Gv(o),d=Zv(u),p=Gv(u),v=Zv(a),y=Gv(a),g=Zv(c),_=Gv(c),m={a:function(t){return u[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:yy,e:yy,f:by,H:gy,I:_y,j:my,L:xy,m:wy,M:My,p:function(t){return i[+(t.getHours()>=12)]},Q:Qy,s:Jy,S:ky,u:Ty,U:Sy,V:Ay,w:Ny,W:Ey,x:null,X:null,y:Cy,Y:Py,Z:Oy,"%":Gy},x={a:function(t){return u[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Dy,e:Dy,f:Iy,H:zy,I:Ry,j:Ly,L:Uy,m:qy,M:jy,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Qy,s:Jy,S:Fy,u:Yy,U:By,V:Hy,w:Xy,W:Vy,x:null,X:null,y:Wy,Y:$y,Z:Zy,"%":Gy},b={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=y[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return k(t,n,e,r)},d:uy,e:uy,f:hy,H:cy,I:cy,j:ay,L:ly,m:oy,M:fy,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:py,s:vy,S:sy,u:Jv,U:Kv,V:ty,w:Qv,W:ny,x:function(t,n,r){return k(t,e,n,r)},X:function(t,n,e){return k(t,r,n,e)},y:ry,Y:ey,Z:iy,"%":dy};function w(t,n){return function(e){var r,i,o,u=[],a=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++a53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Rv(Lv(o.y))).getUTCDay(),r=i>4||0===i?vv.ceil(r):vv(r),r=lv.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=n(Lv(o.y))).getDay(),r=i>4||0===i?qp.ceil(r):qp(r),r=Rp.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Rv(Lv(o.y)).getUTCDay():n(Lv(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Rv(o)):n(o)}}function k(t,n,e,r){for(var i,o,u=0,a=n.length,c=e.length;u=c)return-1;if(37===(i=n.charCodeAt(u++))){if(i=n.charAt(u++),!(o=b[i in Bv?n.charAt(u++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),x.x=w(e,x),x.X=w(r,x),x.c=w(n,x),{format:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",zv);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",x);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,Rv);return n.toString=function(){return t},n}}}var Iv,qv,jv,Fv,Yv,Bv={"-":"",_:" ",0:"0"},Hv=/^\s*\d+/,Xv=/^%/,Vv=/[\\^$*+?|[\]().{}]/g;function Wv(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function iy(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function oy(t,n,e){var r=Hv.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function uy(t,n,e){var r=Hv.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function ay(t,n,e){var r=Hv.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function cy(t,n,e){var r=Hv.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function fy(t,n,e){var r=Hv.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function sy(t,n,e){var r=Hv.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function ly(t,n,e){var r=Hv.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function hy(t,n,e){var r=Hv.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function dy(t,n,e){var r=Xv.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function py(t,n,e){var r=Hv.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function vy(t,n,e){var r=Hv.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function yy(t,n){return Wv(t.getDate(),n,2)}function gy(t,n){return Wv(t.getHours(),n,2)}function _y(t,n){return Wv(t.getHours()%12||12,n,2)}function my(t,n){return Wv(1+Rp.count(ev(t),t),n,3)}function xy(t,n){return Wv(t.getMilliseconds(),n,3)}function by(t,n){return xy(t,n)+"000"}function wy(t,n){return Wv(t.getMonth()+1,n,2)}function My(t,n){return Wv(t.getMinutes(),n,2)}function ky(t,n){return Wv(t.getSeconds(),n,2)}function Ty(t){var n=t.getDay();return 0===n?7:n}function Sy(t,n){return Wv(Ip.count(ev(t),t),n,2)}function Ay(t,n){var e=t.getDay();return t=e>=4||0===e?Yp(t):Yp.ceil(t),Wv(Yp.count(ev(t),t)+(4===ev(t).getDay()),n,2)}function Ny(t){return t.getDay()}function Ey(t,n){return Wv(qp.count(ev(t),t),n,2)}function Cy(t,n){return Wv(t.getFullYear()%100,n,2)}function Py(t,n){return Wv(t.getFullYear()%1e4,n,4)}function Oy(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Wv(n/60|0,"0",2)+Wv(n%60,"0",2)}function Dy(t,n){return Wv(t.getUTCDate(),n,2)}function zy(t,n){return Wv(t.getUTCHours(),n,2)}function Ry(t,n){return Wv(t.getUTCHours()%12||12,n,2)}function Ly(t,n){return Wv(1+lv.count(Ov(t),t),n,3)}function Uy(t,n){return Wv(t.getUTCMilliseconds(),n,3)}function Iy(t,n){return Uy(t,n)+"000"}function qy(t,n){return Wv(t.getUTCMonth()+1,n,2)}function jy(t,n){return Wv(t.getUTCMinutes(),n,2)}function Fy(t,n){return Wv(t.getUTCSeconds(),n,2)}function Yy(t){var n=t.getUTCDay();return 0===n?7:n}function By(t,n){return Wv(pv.count(Ov(t),t),n,2)}function Hy(t,n){var e=t.getUTCDay();return t=e>=4||0===e?_v(t):_v.ceil(t),Wv(_v.count(Ov(t),t)+(4===Ov(t).getUTCDay()),n,2)}function Xy(t){return t.getUTCDay()}function Vy(t,n){return Wv(vv.count(Ov(t),t),n,2)}function Wy(t,n){return Wv(t.getUTCFullYear()%100,n,2)}function $y(t,n){return Wv(t.getUTCFullYear()%1e4,n,4)}function Zy(){return"+0000"}function Gy(){return"%"}function Qy(t){return+t}function Jy(t){return Math.floor(+t/1e3)}function Ky(t){return Iv=Uv(t),qv=Iv.format,jv=Iv.parse,Fv=Iv.utcFormat,Yv=Iv.utcParse,Iv}Ky({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 tg=Date.prototype.toISOString?function(t){return t.toISOString()}:Fv("%Y-%m-%dT%H:%M:%S.%LZ");var ng=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:Yv("%Y-%m-%dT%H:%M:%S.%LZ"),eg=1e3,rg=60*eg,ig=60*rg,og=24*ig,ug=7*og,ag=30*og,cg=365*og;function fg(t){return new Date(t)}function sg(t){return t instanceof Date?+t:+new Date(+t)}function lg(t,n,e,r,o,u,a,c,f){var s=Jd($d,Ie),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),v=f("%I:%M"),y=f("%I %p"),g=f("%a %d"),_=f("%b %d"),m=f("%B"),x=f("%Y"),b=[[a,1,eg],[a,5,5*eg],[a,15,15*eg],[a,30,30*eg],[u,1,rg],[u,5,5*rg],[u,15,15*rg],[u,30,30*rg],[o,1,ig],[o,3,3*ig],[o,6,6*ig],[o,12,12*ig],[r,1,og],[r,2,2*og],[e,1,ug],[n,1,ag],[n,3,3*ag],[t,1,cg]];function w(i){return(a(i)1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return wg.h=360*t-100,wg.s=1.5-1.5*n,wg.l=.8-.9*n,wg+""};function kg(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var Tg=kg(pg("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Sg=kg(pg("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Ag=kg(pg("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Ng=kg(pg("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Eg(t){var n=0,e=1,r=!1;function i(i){var o=(i-n)/(e-n);return t(r?Math.max(0,Math.min(1,o)):o)}return i.domain=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.clamp=function(t){return arguments.length?(r=!!t,i):r},i.interpolator=function(n){return arguments.length?(t=n,i):t},i.copy=function(){return Eg(t).domain([n,e]).clamp(r)},tp(i)}var Cg=function(t){return function(){return t}},Pg=Math.abs,Og=Math.atan2,Dg=Math.cos,zg=Math.max,Rg=Math.min,Lg=Math.sin,Ug=Math.sqrt,Ig=1e-12,qg=Math.PI,jg=qg/2,Fg=2*qg;function Yg(t){return t>=1?jg:t<=-1?-jg:Math.asin(t)}function Bg(t){return t.innerRadius}function Hg(t){return t.outerRadius}function Xg(t){return t.startAngle}function Vg(t){return t.endAngle}function Wg(t){return t&&t.padAngle}function $g(t,n,e,r,i,o,u){var a=t-e,c=n-r,f=(u?o:-o)/Ug(a*a+c*c),s=f*c,l=-f*a,h=t+s,d=n+l,p=e+s,v=r+l,y=(h+p)/2,g=(d+v)/2,_=p-h,m=v-d,x=_*_+m*m,b=i-o,w=h*v-p*d,M=(m<0?-1:1)*Ug(zg(0,b*b*x-w*w)),k=(w*m-_*M)/x,T=(-w*_-m*M)/x,S=(w*m+_*M)/x,A=(-w*_+m*M)/x,N=k-y,E=T-g,C=S-y,P=A-g;return N*N+E*E>C*C+P*P&&(k=S,T=A),{cx:k,cy:T,x01:-s,y01:-l,x11:k*(i/b-1),y11:T*(i/b-1)}}var Zg=function(){var t=Bg,n=Hg,e=Cg(0),r=null,i=Xg,o=Vg,u=Wg,a=null;function c(){var c,f,s,l=+t.apply(this,arguments),h=+n.apply(this,arguments),d=i.apply(this,arguments)-jg,p=o.apply(this,arguments)-jg,v=Pg(p-d),y=p>d;if(a||(a=c=Lo()),hIg)if(v>Fg-Ig)a.moveTo(h*Dg(d),h*Lg(d)),a.arc(0,0,h,d,p,!y),l>Ig&&(a.moveTo(l*Dg(p),l*Lg(p)),a.arc(0,0,l,p,d,y));else{var g,_,m=d,x=p,b=d,w=p,M=v,k=v,T=u.apply(this,arguments)/2,S=T>Ig&&(r?+r.apply(this,arguments):Ug(l*l+h*h)),A=Rg(Pg(h-l)/2,+e.apply(this,arguments)),N=A,E=A;if(S>Ig){var C=Yg(S/l*Lg(T)),P=Yg(S/h*Lg(T));(M-=2*C)>Ig?(b+=C*=y?1:-1,w-=C):(M=0,b=w=(d+p)/2),(k-=2*P)>Ig?(m+=P*=y?1:-1,x-=P):(k=0,m=x=(d+p)/2)}var O=h*Dg(m),D=h*Lg(m),z=l*Dg(w),R=l*Lg(w);if(A>Ig){var L=h*Dg(x),U=h*Lg(x),I=l*Dg(b),q=l*Lg(b);if(vIg?function(t,n,e,r,i,o,u,a){var c=e-t,f=r-n,s=u-i,l=a-o,h=(s*(n-o)-l*(t-i))/(l*c-s*f);return[t+h*c,n+h*f]}(O,D,I,q,L,U,z,R):[z,R],F=O-j[0],Y=D-j[1],B=L-j[0],H=U-j[1],X=1/Lg(((s=(F*B+Y*H)/(Ug(F*F+Y*Y)*Ug(B*B+H*H)))>1?0:s<-1?qg:Math.acos(s))/2),V=Ug(j[0]*j[0]+j[1]*j[1]);N=Rg(A,(l-V)/(X-1)),E=Rg(A,(h-V)/(X+1))}}k>Ig?E>Ig?(g=$g(I,q,O,D,h,E,y),_=$g(L,U,z,R,h,E,y),a.moveTo(g.cx+g.x01,g.cy+g.y01),EIg&&M>Ig?N>Ig?(g=$g(z,R,L,U,l,-N,y),_=$g(O,D,I,q,l,-N,y),a.lineTo(g.cx+g.x01,g.cy+g.y01),N=s;--l)a.point(y[l],g[l]);a.lineEnd(),a.areaEnd()}v&&(y[f]=+t(h,f,c),g[f]=+e(h,f,c),a.point(n?+n(h,f,c):y[f],r?+r(h,f,c):g[f]))}if(d)return a=null,d+""||null}function f(){return t_().defined(i).curve(u).context(o)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:Cg(+e),n=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:Cg(+n),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Cg(+t),c):n},c.y=function(t){return arguments.length?(e="function"==typeof t?t:Cg(+t),r=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:Cg(+t),c):e},c.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Cg(+t),c):r},c.lineX0=c.lineY0=function(){return f().x(t).y(e)},c.lineY1=function(){return f().x(t).y(r)},c.lineX1=function(){return f().x(n).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:Cg(!!t),c):i},c.curve=function(t){return arguments.length?(u=t,null!=o&&(a=u(o)),c):u},c.context=function(t){return arguments.length?(null==t?o=a=null:a=u(o=t),c):o},c},e_=function(t,n){return nt?1:n>=t?0:NaN},r_=function(t){return t},i_=function(){var t=r_,n=e_,e=null,r=Cg(0),i=Cg(Fg),o=Cg(0);function u(u){var a,c,f,s,l,h=u.length,d=0,p=new Array(h),v=new Array(h),y=+r.apply(this,arguments),g=Math.min(Fg,Math.max(-Fg,i.apply(this,arguments)-y)),_=Math.min(Math.abs(g)/h,o.apply(this,arguments)),m=_*(g<0?-1:1);for(a=0;a0&&(d+=l);for(null!=n?p.sort(function(t,e){return n(v[t],v[e])}):null!=e&&p.sort(function(t,n){return e(u[t],u[n])}),a=0,f=d?(g-h*m)/d:0;a0?l*f:0)+m,v[c]={data:u[c],index:a,value:l,startAngle:y,endAngle:s,padAngle:_};return v}return u.value=function(n){return arguments.length?(t="function"==typeof n?n:Cg(+n),u):t},u.sortValues=function(t){return arguments.length?(n=t,e=null,u):n},u.sort=function(t){return arguments.length?(e=t,n=null,u):e},u.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Cg(+t),u):r},u.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Cg(+t),u):i},u.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Cg(+t),u):o},u},o_=a_(Qg);function u_(t){this._curve=t}function a_(t){function n(n){return new u_(t(n))}return n._curve=t,n}function c_(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(a_(t)):n()._curve},t}u_.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var f_=function(){return c_(t_().curve(o_))},s_=function(){var t=n_().curve(o_),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=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 c_(e())},delete t.lineX0,t.lineEndAngle=function(){return c_(r())},delete t.lineX1,t.lineInnerRadius=function(){return c_(i())},delete t.lineY0,t.lineOuterRadius=function(){return c_(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(a_(t)):n()._curve},t},l_=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},h_=Array.prototype.slice;function d_(t){return t.source}function p_(t){return t.target}function v_(t){var n=d_,e=p_,r=Jg,i=Kg,o=null;function u(){var u,a=h_.call(arguments),c=n.apply(this,a),f=e.apply(this,a);if(o||(o=u=Lo()),t(o,+r.apply(this,(a[0]=c,a)),+i.apply(this,a),+r.apply(this,(a[0]=f,a)),+i.apply(this,a)),u)return o=null,u+""||null}return u.source=function(t){return arguments.length?(n=t,u):n},u.target=function(t){return arguments.length?(e=t,u):e},u.x=function(t){return arguments.length?(r="function"==typeof t?t:Cg(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:Cg(+t),u):i},u.context=function(t){return arguments.length?(o=null==t?null:t,u):o},u}function y_(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function g_(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function __(t,n,e,r,i){var o=l_(n,e),u=l_(n,e=(e+i)/2),a=l_(r,e),c=l_(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(u[0],u[1],a[0],a[1],c[0],c[1])}function m_(){return v_(y_)}function x_(){return v_(g_)}function b_(){var t=v_(__);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var w_={draw:function(t,n){var e=Math.sqrt(n/qg);t.moveTo(e,0),t.arc(0,0,e,0,Fg)}},M_={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},k_=Math.sqrt(1/3),T_=2*k_,S_={draw:function(t,n){var e=Math.sqrt(n/T_),r=e*k_;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},A_=Math.sin(qg/10)/Math.sin(7*qg/10),N_=Math.sin(Fg/10)*A_,E_=-Math.cos(Fg/10)*A_,C_={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=N_*e,i=E_*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var u=Fg*o/5,a=Math.cos(u),c=Math.sin(u);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},P_={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},O_=Math.sqrt(3),D_={draw:function(t,n){var e=-Math.sqrt(n/(3*O_));t.moveTo(0,2*e),t.lineTo(-O_*e,-e),t.lineTo(O_*e,-e),t.closePath()}},z_=Math.sqrt(3)/2,R_=1/Math.sqrt(12),L_=3*(R_/2+1),U_={draw:function(t,n){var e=Math.sqrt(n/L_),r=e/2,i=e*R_,o=r,u=e*R_+e,a=-o,c=u;t.moveTo(r,i),t.lineTo(o,u),t.lineTo(a,c),t.lineTo(-.5*r-z_*i,z_*r+-.5*i),t.lineTo(-.5*o-z_*u,z_*o+-.5*u),t.lineTo(-.5*a-z_*c,z_*a+-.5*c),t.lineTo(-.5*r+z_*i,-.5*i-z_*r),t.lineTo(-.5*o+z_*u,-.5*u-z_*o),t.lineTo(-.5*a+z_*c,-.5*c-z_*a),t.closePath()}},I_=[w_,M_,S_,P_,C_,D_,U_],q_=function(){var t=Cg(w_),n=Cg(64),e=null;function r(){var r;if(e||(e=r=Lo()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return r.type=function(n){return arguments.length?(t="function"==typeof n?n:Cg(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:Cg(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},j_=function(){};function F_(t,n,e){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+n)/6,(t._y0+4*t._y1+e)/6)}function Y_(t){this._context=t}Y_.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:F_(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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);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:F_(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var B_=function(t){return new Y_(t)};function H_(t){this._context=t}H_.prototype={areaStart:j_,areaEnd:j_,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:F_(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var X_=function(t){return new H_(t)};function V_(t){this._context=t}V_.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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:F_(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var W_=function(t){return new V_(t)};function $_(t,n){this._basis=new Y_(t),this._beta=n}$_.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],u=t[e]-i,a=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*u),this._beta*n[c]+(1-this._beta)*(o+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Z_=function t(n){function e(t){return 1===n?new Y_(t):new $_(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function G_(t,n,e){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-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function Q_(t,n){this._context=t,this._k=(1-n)/6}Q_.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:G_(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:G_(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var J_=function t(n){function e(t){return new Q_(t,n)}return e.tension=function(n){return t(+n)},e}(0);function K_(t,n){this._context=t,this._k=(1-n)/6}K_.prototype={areaStart:j_,areaEnd:j_,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:G_(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var tm=function t(n){function e(t){return new K_(t,n)}return e.tension=function(n){return t(+n)},e}(0);function nm(t,n){this._context=t,this._k=(1-n)/6}nm.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,n){switch(t=+t,n=+n,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:G_(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var em=function t(n){function e(t){return new nm(t,n)}return e.tension=function(n){return t(+n)},e}(0);function rm(t,n,e){var r=t._x1,i=t._y1,o=t._x2,u=t._y2;if(t._l01_a>Ig){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Ig){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-n*t._l12_2a)/s,u=(u*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,u,t._x2,t._y2)}function im(t,n){this._context=t,this._alpha=n}im.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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:rm(this,t,n)}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=n}};var om=function t(n){function e(t){return n?new im(t,n):new Q_(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function um(t,n){this._context=t,this._alpha=n}um.prototype={areaStart:j_,areaEnd:j_,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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:rm(this,t,n)}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=n}};var am=function t(n){function e(t){return n?new um(t,n):new K_(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function cm(t,n){this._context=t,this._alpha=n}cm.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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,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:rm(this,t,n)}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=n}};var fm=function t(n){function e(t){return n?new cm(t,n):new nm(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function sm(t){this._context=t}sm.prototype={areaStart:j_,areaEnd:j_,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var lm=function(t){return new sm(t)};function hm(t){return t<0?-1:1}function dm(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),u=(e-t._y1)/(i||r<0&&-0),a=(o*i+u*r)/(r+i);return(hm(o)+hm(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(a))||0}function pm(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function vm(t,n,e){var r=t._x0,i=t._y0,o=t._x1,u=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*n,o-a,u-a*e,o,u)}function ym(t){this._context=t}function gm(t){this._context=new _m(t)}function _m(t){this._context=t}function mm(t){return new ym(t)}function xm(t){return new gm(t)}function bm(t){this._context=t}function wm(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),u=new Array(r);for(i[0]=0,o[0]=2,u[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(u[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Tm=function(t){return new km(t,.5)};function Sm(t){return new km(t,0)}function Am(t){return new km(t,1)}var Nm=function(t,n){if((i=t.length)>1)for(var e,r,i,o=1,u=t[n[0]],a=u.length;o=0;)e[n]=n;return e};function Cm(t,n){return t[n]}var Pm=function(){var t=Cg([]),n=Em,e=Nm,r=Cm;function i(i){var o,u,a=t.apply(this,arguments),c=i.length,f=a.length,s=new Array(f);for(o=0;o0){for(var e,r,i,o=0,u=t[0].length;o1)for(var e,r,i,o,u,a,c=0,f=t[n[0]].length;c=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=u,r[0]=u+=i):r[0]=o},zm=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,u=1;u0)){if(o/=h,h<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=r-c,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>s&&(s=o)}else if(h>0){if(o0)){if(o/=d,d<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=i-f,d||!(o<0)){if(o/=d,d<0){if(o>l)return;o>s&&(s=o)}else if(d>0){if(o0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function tx(t,n,e,r,i){var o=t[1];if(o)return!0;var u,a,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],v=(l+d)/2,y=(h+p)/2;if(p===h){if(v=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[v,e];o=[v,i]}else{if(c){if(c[1]1)if(l>d){if(c){if(c[1]>=i)return}else c=[(e-a)/u,e];o=[(i-a)/u,i]}else{if(c){if(c[1]=r)return}else c=[n,u*n+a];o=[r,u*r+a]}else{if(c){if(c[0]=-wx)){var d=c*c+f*f,p=s*s+l*l,v=(l*d-f*p)/h,y=(c*p-s*d)/h,g=ox.pop()||new ux;g.arc=t,g.site=i,g.x=v+u,g.y=(g.cy=y+a)+Math.sqrt(v*v+y*y),t.circle=g;for(var _=null,m=mx._;m;)if(g.ybx)a=a.L;else{if(!((i=o-yx(a,u))>bx)){r>-bx?(n=a.P,e=a):i>-bx?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){_x[t.index]={site:t,halfedges:[]}}(t);var c=lx(t);if(gx.insert(n,c),n||e){if(n===e)return cx(n),e=lx(n.site),gx.insert(c,e),c.edge=e.edge=Gm(n.site,c.site),ax(n),void ax(e);if(e){cx(n),cx(e);var f=n.site,s=f[0],l=f[1],h=t[0]-s,d=t[1]-l,p=e.site,v=p[0]-s,y=p[1]-l,g=2*(h*y-d*v),_=h*h+d*d,m=v*v+y*y,x=[(y*_-d*m)/g+s,(h*m-v*_)/g+l];Jm(e.edge,f,p,x),c.edge=Gm(f,t,null,x),e.edge=Gm(t,p,null,x),ax(n),ax(e)}else c.edge=Gm(n.site,c.site)}}function vx(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var u=t.P;if(!u)return-1/0;var a=(e=u.site)[0],c=e[1],f=c-n;if(!f)return a;var s=a-r,l=1/o-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-o/2)))/l+r:(r+a)/2}function yx(t,n){var e=t.N;if(e)return vx(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var gx,_x,mx,xx,bx=1e-6,wx=1e-12;function Mx(t,n){return n[1]-t[1]||n[0]-t[0]}function kx(t,n){var e,r,i,o=t.sort(Mx).pop();for(xx=[],_x=new Array(t.length),gx=new Zm,mx=new Zm;;)if(i=ix,o&&(!i||o[1]bx||Math.abs(i[0][1]-i[1][1])>bx)||delete xx[o]}(u,a,c,f),function(t,n,e,r){var i,o,u,a,c,f,s,l,h,d,p,v,y=_x.length,g=!0;for(i=0;ibx||Math.abs(v-h)>bx)&&(c.splice(a,0,xx.push(Qm(u,d,Math.abs(p-t)bx?[t,Math.abs(l-t)bx?[Math.abs(h-r)bx?[e,Math.abs(l-e)bx?[Math.abs(h-n)=a)return null;var c=t-i.site[0],f=n-i.site[1],s=c*c+f*f;do{i=o.cells[r=u],u=null,i.halfedges.forEach(function(e){var r=o.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],f=n-a[1],l=c*c+f*f;lr?(r+i)/2:Math.min(0,r)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}var qx=function(){var t,n,e=Dx,r=zx,i=Ix,o=Lx,u=Ux,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,s=rr,l=[],h=ht("start","zoom","end"),d=500,p=150,v=0;function y(t){t.property("__zoom",Rx).on("wheel.zoom",M).on("mousedown.zoom",k).on("dblclick.zoom",T).filter(u).on("touchstart.zoom",S).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new Nx(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Nx(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e){t.on("start.zoom",function(){b(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).end()}).tween("zoom",function(){var t=arguments,i=b(this,t),o=r.apply(this,t),u=e||m(o),a=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=this.__zoom,f="function"==typeof n?n.apply(this,t):n,l=s(c.invert(u).concat(a/c.k),f.invert(u).concat(a/f.k));return function(t){if(1===t)t=f;else{var n=l(t),e=a/n[2];t=new Nx(e,u[0]-n[0]*e,u[1]-n[1]*e)}i.zoom(null,t)}})}function b(t,n){for(var e,r=0,i=l.length;rv}t.zoom("mouse",i(_(t.that.__zoom,t.mouse[0]=hn(t.that),t.mouse[1]),t.extent,c))},!0).on("mouseup.zoom",function(){r.on("mousemove.zoom mouseup.zoom",null),mn(Wt.view,t.moved),Ox(),t.end()},!0),o=hn(this),u=Wt.clientX,a=Wt.clientY;_n(Wt.view),Px(),t.mouse=[o,this.__zoom.invert(o)],Zr(this),t.start()}}function T(){if(e.apply(this,arguments)){var t=this.__zoom,n=hn(this),o=t.invert(n),u=t.k*(Wt.shiftKey?.5:2),a=i(_(g(t,u),n,o),r.apply(this,arguments),c);Ox(),f>0?on(this).transition().duration(f).call(x,a,n):on(this).call(y.transform,a)}}function S(){if(e.apply(this,arguments)){var n,r,i,o,u=b(this,arguments),a=Wt.changedTouches,c=a.length;for(Px(),r=0;r0&&f.container.children[0].offsetParent&&(r.resize(),clearInterval(p))}),50);this.oldModelData=this.props.modelData,this.glviewer=r}}},{key:"render",value:function(){var e=this;return s.default.createElement("div",{className:"molecule-3d",style:{width:this.props.width,height:this.props.height,position:"relative",margin:"0 auto"},ref:function(t){e.container=t}})}}]),t}(s.default.Component);p.defaultProps={atomLabelsShown:!1,backgroundOpacity:1,backgroundColor:"#73757c",height:"500px",onRenderNewData:function(){},orbital:{},selectedAtomIds:[],selectionType:f.default.ATOM,shapes:[],labels:[],styles:{},width:"500px",outlineWidth:0,outlineColor:"#000000",nearClip:null,farClip:null},p.propTypes={atomLabelsShown:l.default.bool,backgroundColor:l.default.string,backgroundOpacity:l.default.number,height:l.default.string,modelData:l.default.shape({atoms:l.default.array,bonds:l.default.array}).isRequired,onChangeSelection:l.default.func,onRenderNewData:l.default.func,orbital:l.default.shape({cube_file:l.default.string,iso_val:l.default.number,opacity:l.default.number,positiveVolumetricColor:l.default.string,negativeVolumetricColor:l.default.string}),selectedAtomIds:l.default.arrayOf(l.default.number),selectionType:l.default.oneOf([f.default.ATOM,f.default.RESIDUE,f.default.CHAIN]),shapes:l.default.arrayOf(l.default.object),labels:l.default.arrayOf(l.default.object),styles:l.default.objectOf(l.default.object),width:l.default.string,nearClip:l.default.number,farClip:l.default.number,outlineWidth:l.default.number,outlineColor:l.default.string},t.default=p},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={ARROW:"Arrow",SPHERE:"Sphere",CYLINDER:"Cylinder"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(2));t.default=n.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(e){return e&&e.__esModule?e:{default:e}}(r(3)),o="stick",a={colorStringToNumber:function(e){if(4!==e.length&&7!==e.length)return e;if("#"!==e[0])return e;var t=parseInt(e.substr(1,e.length-1),16);return isNaN(t)?e:t},getShapeSpec:function(e,t){var r=void 0;e.color&&(r=a.colorStringToNumber(e.color));var n=Object.assign({},{alpha:.8,callback:t,clickable:!1,color:65027,radius:e.radius},e,{color:r});if(e.type===i.default.ARROW)n.start=e.start,n.end=e.end;else if(e.type===i.default.SPHERE)n.center=e.center;else{if(e.type!==i.default.CYLINDER)throw new Error("Invalid shape type.");n.fromCap=!0,n.toCap=!0,n.start=e.start,n.end=e.end}return n},getLibStyle:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s={},l=i.visualization_type||o;return s[l]={},Object.entries(i).forEach((function(e){var t=n(e,2),r=t[0],i=t[1];"visualization_type"!==r&&(s[l][r]=i)})),t&&(s[l].color=2094078),"string"==typeof s[l].color&&(s[l].color=a.colorStringToNumber(s[l].color)),s}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8),i=function(e){return e&&e.__esModule?e:{default:e}}(r(1)),o={modelDataToCDJSON:function(e){return{m:[{a:e.atoms.map((function(e){return{l:e.elem,x:e.positions[0],y:e.positions[1],z:e.positions[2],mass:e.mass_magnitude}})),b:e.bonds.map((function(e){return{b:e.atom1_index,e:e.atom2_index,o:e.bond_order}}))}]}},addSelection:function(e,t,r,n){var a=t.slice(),s=t.indexOf(r.serial),l=-1===s;return n===i.default.ATOM?(l?a.push(r.serial):a.splice(s,1),a):(l?e.forEach((function(e){o.isSameGroup(r,e,n)&&a.push(e.serial)})):a=a.filter((function(t){var i=e[t];return!o.isSameGroup(r,i,n)})),a)},isSameGroup:function(e,t,r){if(r===i.default.RESIDUE)return e.residue_index===t.residue_index;if(r===i.default.CHAIN)return e.chain===t.chain;throw new Error("selectionType must be either residue or chain")},modelDataEquivalent:function(e,t){if(!e||!t)return!1;var r=new n.Set(e.atoms.map((function(e){return e.serial}))),i=new n.Set(t.atoms.map((function(e){return e.serial}))),o=new n.Set(e.bonds.map((function(e){return e.atom1_index+"=>"+e.atom2_index}))),a=new n.Set(t.bonds.map((function(e){return e.atom1_index+"=>"+e.atom2_index}))),s=r.equals(i),l=o.equals(a);if(!s||!l)return!1;var u=new Map,c=!0,f=!1,h=void 0;try{for(var p,d=e.atoms[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var m=p.value;u.set(m.serial,m.positions||[])}}catch(e){f=!0,h=e}finally{try{!c&&d.return&&d.return()}finally{if(f)throw h}}return t.atoms.every((function(e){return u.get(e.serial).every((function(t,r){return(e.positions||[])[r]===t}))}))}};t.default=o},function(e,t){e.exports=r(143)},function(e,t){e.exports=r(144)},function(e,t){e.exports=r(64)},function(e,t){e.exports=r(0)},function(e,t){e.exports=r(1)}])},143:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,require,require,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,e;!function(e,t){"use strict";"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){"use strict";var r=[],n=e.document,i=Object.getPrototypeOf,o=r.slice,a=r.concat,s=r.push,l=r.indexOf,u={},c=u.toString,f=u.hasOwnProperty,h=f.toString,p=h.call(Object),d={};function m(e,t){var r=(t=t||n).createElement("script");r.text=e,t.head.appendChild(r).parentNode.removeChild(r)}var v=function(e,t){return new v.fn.init(e,t)},g=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,y=/^-ms-/,b=/-([a-z])/g,x=function(e,t){return t.toUpperCase()};function w(e){var t=!!e&&"length"in e&&e.length,r=v.type(e);return"function"!==r&&!v.isWindow(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}v.fn=v.prototype={jquery:"3.2.1",constructor:v,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=v.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return v.each(this,e)},map:function(e){return this.pushStack(v.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,r=+e+(e<0?t:0);return this.pushStack(r>=0&&r+~]|"+N+")"+N+"*"),q=new RegExp("="+N+"*([^\\]'\"]*?)"+N+"*\\]","g"),H=new RegExp(F),G=new RegExp("^"+R+"$"),W={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,J=new RegExp("\\\\([\\da-f]{1,6}"+N+"?|("+N+")|.)","ig"),ee=function(e,t,r){var n="0x"+t-65536;return n!=n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ne=function(){h()},ie=ye((function(e){return!0===e.disabled&&("form"in e||"label"in e)}),{dir:"parentNode",next:"legend"});try{L.apply(T=k.call(w.childNodes),w.childNodes),T[w.childNodes.length].nodeType}catch(e){L={apply:T.length?function(e,t){E.apply(e,k.call(t))}:function(e,t){for(var r=e.length,n=0;e[r++]=t[n++];);e.length=r-1}}}function oe(e,t,n,i){var o,s,u,c,f,d,g,y=t&&t.ownerDocument,_=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==_&&9!==_&&11!==_)return n;if(!i&&((t?t.ownerDocument||t:w)!==p&&h(t),t=t||p,m)){if(11!==_&&(f=K.exec(e)))if(o=f[1]){if(9===_){if(!(u=t.getElementById(o)))return n;if(u.id===o)return n.push(u),n}else if(y&&(u=y.getElementById(o))&&b(t,u)&&u.id===o)return n.push(u),n}else{if(f[2])return L.apply(n,t.getElementsByTagName(e)),n;if((o=f[3])&&r.getElementsByClassName&&t.getElementsByClassName)return L.apply(n,t.getElementsByClassName(o)),n}if(r.qsa&&!S[e+" "]&&(!v||!v.test(e))){if(1!==_)y=t,g=e;else if("object"!==t.nodeName.toLowerCase()){for((c=t.getAttribute("id"))?c=c.replace(te,re):t.setAttribute("id",c=x),s=(d=a(e)).length;s--;)d[s]="#"+c+" "+ge(d[s]);g=d.join(","),y=Q.test(e)&&me(t.parentNode)||t}if(g)try{return L.apply(n,y.querySelectorAll(g)),n}catch(e){}finally{c===x&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,n,i)}function ae(){var e=[];return function t(r,i){return e.push(r+" ")>n.cacheLength&&delete t[e.shift()],t[r+" "]=i}}function se(e){return e[x]=!0,e}function le(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var r=e.split("|"),i=r.length;i--;)n.attrHandle[r[i]]=t}function ce(e,t){var r=t&&e,n=r&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(r)for(;r=r.nextSibling;)if(r===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var r=t.nodeName.toLowerCase();return("input"===r||"button"===r)&&t.type===e}}function pe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function de(e){return se((function(t){return t=+t,se((function(r,n){for(var i,o=e([],r.length,t),a=o.length;a--;)r[i=o[a]]&&(r[i]=!(n[i]=r[i]))}))}))}function me(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in r=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},h=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(d=(p=a).documentElement,m=!o(p),w!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ne,!1):i.attachEvent&&i.attachEvent("onunload",ne)),r.attributes=le((function(e){return e.className="i",!e.getAttribute("className")})),r.getElementsByTagName=le((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),r.getElementsByClassName=Z.test(p.getElementsByClassName),r.getById=le((function(e){return d.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length})),r.getById?(n.filter.ID=function(e){var t=e.replace(J,ee);return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r=t.getElementById(e);return r?[r]:[]}}):(n.filter.ID=function(e){var t=e.replace(J,ee);return function(e){var r=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return r&&r.value===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r,n,i,o=t.getElementById(e);if(o){if((r=o.getAttributeNode("id"))&&r.value===e)return[o];for(i=t.getElementsByName(e),n=0;o=i[n++];)if((r=o.getAttributeNode("id"))&&r.value===e)return[o]}return[]}}),n.find.TAG=r.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):r.qsa?t.querySelectorAll(e):void 0}:function(e,t){var r,n=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;r=o[i++];)1===r.nodeType&&n.push(r);return n}return o},n.find.CLASS=r.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},g=[],v=[],(r.qsa=Z.test(p.querySelectorAll))&&(le((function(e){d.appendChild(e).innerHTML="
",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+N+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+N+"*(?:value|"+O+")"),e.querySelectorAll("[id~="+x+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||v.push(".#.+[+~]")})),le((function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+N+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(r.matchesSelector=Z.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&le((function(e){r.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",F)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),t=Z.test(d.compareDocumentPosition),b=t||Z.test(d.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(r.contains?r.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},M=t?function(e,t){if(e===t)return f=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!r.sortDetached&&t.compareDocumentPosition(e)===n?e===p||e.ownerDocument===w&&b(w,e)?-1:t===p||t.ownerDocument===w&&b(w,t)?1:c?I(c,e)-I(c,t):0:4&n?-1:1)}:function(e,t){if(e===t)return f=!0,0;var r,n=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===p?-1:t===p?1:i?-1:o?1:c?I(c,e)-I(c,t):0;if(i===o)return ce(e,t);for(r=e;r=r.parentNode;)a.unshift(r);for(r=t;r=r.parentNode;)s.unshift(r);for(;a[n]===s[n];)n++;return n?ce(a[n],s[n]):a[n]===w?-1:s[n]===w?1:0},p):p},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&h(e),t=t.replace(q,"='$1']"),r.matchesSelector&&m&&!S[t+" "]&&(!g||!g.test(t))&&(!v||!v.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return oe(t,p,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=n.attrHandle[t.toLowerCase()],o=i&&$.call(n.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:r.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,re)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,n=[],i=0,o=0;if(f=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(M),f){for(;t=e[o++];)t===e[o]&&(i=n.push(o));for(;i--;)e.splice(n[i],1)}return c=null,e},i=oe.getText=function(e){var t,r="",n=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)r+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[n++];)r+=i(t);return r},(n=oe.selectors={cacheLength:50,createPseudo:se,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(J,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(J,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return W.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&H.test(r)&&(t=a(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(J,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|"+N+")"+e+"("+N+"|$)"))&&C(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,r){return function(n){var i=oe.attr(n,e);return null==i?"!="===t:!t||(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.slice(-r.length)===r:"~="===t?(" "+i.replace(j," ")+" ").indexOf(r)>-1:"|="===t&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,r,n,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===n&&0===i?function(e){return!!e.parentNode}:function(t,r,l){var u,c,f,h,p,d,m=o!==a?"nextSibling":"previousSibling",v=t.parentNode,g=s&&t.nodeName.toLowerCase(),y=!l&&!s,b=!1;if(v){if(o){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;d=m="only"===e&&!d&&"nextSibling"}return!0}if(d=[a?v.firstChild:v.lastChild],a&&y){for(b=(p=(u=(c=(f=(h=v)[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===_&&u[1])&&u[2],h=p&&v.childNodes[p];h=++p&&h&&h[m]||(b=p=0)||d.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[_,p,b];break}}else if(y&&(b=p=(u=(c=(f=(h=t)[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===_&&u[1]),!1===b)for(;(h=++p&&h&&h[m]||(b=p=0)||d.pop())&&((s?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++b||(y&&((c=(f=h[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]=[_,b]),h!==t)););return(b-=i)===n||b%n==0&&b/n>=0}}},PSEUDO:function(e,t){var r,i=n.pseudos[e]||n.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(r=[e,e,"",t],n.setFilters.hasOwnProperty(e.toLowerCase())?se((function(e,r){for(var n,o=i(e,t),a=o.length;a--;)e[n=I(e,o[a])]=!(r[n]=o[a])})):function(e){return i(e,0,r)}):i}},pseudos:{not:se((function(e){var t=[],r=[],n=s(e.replace(B,"$1"));return n[x]?se((function(e,t,r,i){for(var o,a=n(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,n(t,null,o,r),t[0]=null,!r.pop()}})),has:se((function(e){return function(t){return oe(e,t).length>0}})),contains:se((function(e){return e=e.replace(J,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}})),lang:se((function(e){return G.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(J,ee).toLowerCase(),function(t){var r;do{if(r=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(r=r.toLowerCase())===e||0===r.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var r=e.location&&e.location.hash;return r&&r.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!n.pseudos.empty(e)},header:function(e){return X.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:de((function(){return[0]})),last:de((function(e,t){return[t-1]})),eq:de((function(e,t,r){return[r<0?r+t:r]})),even:de((function(e,t){for(var r=0;r=0;)e.push(n);return e})),gt:de((function(e,t,r){for(var n=r<0?r+t:r;++n1?function(t,r,n){for(var i=e.length;i--;)if(!e[i](t,r,n))return!1;return!0}:e[0]}function xe(e,t,r,n,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s-1&&(o[u]=!(a[u]=f))}}else g=xe(g===a?g.splice(d,g.length):g),i?i(null,a,g,l):L.apply(a,g)}))}function _e(e){for(var t,r,i,o=e.length,a=n.relative[e[0].type],s=a||n.relative[" "],l=a?1:0,c=ye((function(e){return e===t}),s,!0),f=ye((function(e){return I(t,e)>-1}),s,!0),h=[function(e,r,n){var i=!a&&(n||r!==u)||((t=r).nodeType?c(e,r,n):f(e,r,n));return t=null,i}];l1&&be(h),l>1&&ge(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(B,"$1"),r,l0,i=e.length>0,o=function(o,a,s,l,c){var f,d,v,g=0,y="0",b=o&&[],x=[],w=u,D=o||i&&n.find.TAG("*",c),C=_+=null==w?1:Math.random()||.1,A=D.length;for(c&&(u=a===p||a||c);y!==A&&null!=(f=D[y]);y++){if(i&&f){for(d=0,a||f.ownerDocument===p||(h(f),s=!m);v=e[d++];)if(v(f,a||p,s)){l.push(f);break}c&&(_=C)}r&&((f=!v&&f)&&g--,o&&b.push(f))}if(g+=y,r&&y!==g){for(d=0;v=t[d++];)v(b,x,a,s);if(o){if(g>0)for(;y--;)b[y]||x[y]||(x[y]=z.call(l));x=xe(x)}L.apply(l,x),c&&!o&&x.length>0&&g+t.length>1&&oe.uniqueSort(l)}return c&&(_=C,u=w),b};return r?se(o):o}(o,i))).selector=e}return s},l=oe.select=function(e,t,r,i){var o,l,u,c,f,h="function"==typeof e&&e,p=!i&&a(e=h.selector||e);if(r=r||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&n.relative[l[1].type]){if(!(t=(n.find.ID(u.matches[0].replace(J,ee),t)||[])[0]))return r;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=W.needsContext.test(e)?0:l.length;o--&&(u=l[o],!n.relative[c=u.type]);)if((f=n.find[c])&&(i=f(u.matches[0].replace(J,ee),Q.test(l[0].type)&&me(t.parentNode)||t))){if(l.splice(o,1),!(e=i.length&&ge(l)))return L.apply(r,i),r;break}}return(h||s(e,p))(i,t,!m,r,!t||Q.test(e)&&me(t.parentNode)||t),r},r.sortStable=x.split("").sort(M).join("")===x,r.detectDuplicates=!!f,h(),r.sortDetached=le((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),le((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||ue("type|href|height|width",(function(e,t,r){if(!r)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),r.attributes&&le((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||ue("value",(function(e,t,r){if(!r&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),le((function(e){return null==e.getAttribute("disabled")}))||ue(O,(function(e,t,r){var n;if(!r)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null})),oe}(e);v.find=_,v.expr=_.selectors,v.expr[":"]=v.expr.pseudos,v.uniqueSort=v.unique=_.uniqueSort,v.text=_.getText,v.isXMLDoc=_.isXML,v.contains=_.contains,v.escapeSelector=_.escape;var D=function(e,t,r){for(var n=[],i=void 0!==r;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&v(e).is(r))break;n.push(e)}return n},C=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r},A=v.expr.match.needsContext;function S(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var M=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,$=/^.[^:#\[\.,]*$/;function T(e,t,r){return v.isFunction(t)?v.grep(e,(function(e,n){return!!t.call(e,n,e)!==r})):t.nodeType?v.grep(e,(function(e){return e===t!==r})):"string"!=typeof t?v.grep(e,(function(e){return l.call(t,e)>-1!==r})):$.test(t)?v.filter(t,e,r):(t=v.filter(t,e),v.grep(e,(function(e){return l.call(t,e)>-1!==r&&1===e.nodeType})))}v.filter=function(e,t,r){var n=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?v.find.matchesSelector(n,e)?[n]:[]:v.find.matches(e,v.grep(t,(function(e){return 1===e.nodeType})))},v.fn.extend({find:function(e){var t,r,n=this.length,i=this;if("string"!=typeof e)return this.pushStack(v(e).filter((function(){for(t=0;t1?v.uniqueSort(r):r},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&A.test(e)?v(e):e||[],!1).length}});var z,E=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(v.fn.init=function(e,t,r){var i,o;if(!e)return this;if(r=r||z,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:E.exec(e))||!i[1]&&t)return!t||t.jquery?(t||r).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof v?t[0]:t,v.merge(this,v.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:n,!0)),M.test(i[1])&&v.isPlainObject(t))for(i in t)v.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=n.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v.isFunction(e)?void 0!==r.ready?r.ready(e):e(v):v.makeArray(e,this)}).prototype=v.fn,z=v(n);var L=/^(?:parents|prev(?:Until|All))/,k={children:!0,contents:!0,next:!0,prev:!0};function I(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}v.fn.extend({has:function(e){var t=v(e,this),r=t.length;return this.filter((function(){for(var e=0;e-1:1===r.nodeType&&v.find.matchesSelector(r,e))){o.push(r);break}return this.pushStack(o.length>1?v.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?l.call(v(e),this[0]):l.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(v.uniqueSort(v.merge(this.get(),v(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),v.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return D(e,"parentNode")},parentsUntil:function(e,t,r){return D(e,"parentNode",r)},next:function(e){return I(e,"nextSibling")},prev:function(e){return I(e,"previousSibling")},nextAll:function(e){return D(e,"nextSibling")},prevAll:function(e){return D(e,"previousSibling")},nextUntil:function(e,t,r){return D(e,"nextSibling",r)},prevUntil:function(e,t,r){return D(e,"previousSibling",r)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return S(e,"iframe")?e.contentDocument:(S(e,"template")&&(e=e.content||e),v.merge([],e.childNodes))}},(function(e,t){v.fn[e]=function(r,n){var i=v.map(this,t,r);return"Until"!==e.slice(-5)&&(n=r),n&&"string"==typeof n&&(i=v.filter(n,i)),this.length>1&&(k[e]||v.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}}));var O=/[^\x20\t\r\n\f]+/g;function N(e){return e}function R(e){throw e}function P(e,t,r,n){var i;try{e&&v.isFunction(i=e.promise)?i.call(e).done(t).fail(r):e&&v.isFunction(i=e.then)?i.call(e,t,r):t.apply(void 0,[e].slice(n))}catch(e){r.apply(void 0,[e])}}v.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return v.each(e.match(O)||[],(function(e,r){t[r]=!0})),t}(e):v.extend({},e);var t,r,n,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,n=t=!0;a.length;s=-1)for(r=a.shift();++s-1;)o.splice(r,1),r<=s&&s--})),this},has:function(e){return e?v.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=r="",this},disabled:function(){return!o},lock:function(){return i=a=[],r||t||(o=r=""),this},locked:function(){return!!i},fireWith:function(e,r){return i||(r=[e,(r=r||[]).slice?r.slice():r],a.push(r),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},v.extend({Deferred:function(t){var r=[["notify","progress",v.Callbacks("memory"),v.Callbacks("memory"),2],["resolve","done",v.Callbacks("once memory"),v.Callbacks("once memory"),0,"resolved"],["reject","fail",v.Callbacks("once memory"),v.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return v.Deferred((function(t){v.each(r,(function(r,n){var i=v.isFunction(e[n[4]])&&e[n[4]];o[n[1]]((function(){var e=i&&i.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[n[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,n,i){var o=0;function a(t,r,n,i){return function(){var s=this,l=arguments,u=function(){var e,u;if(!(t=o&&(n!==R&&(s=void 0,l=[e]),r.rejectWith(s,l))}};t?c():(v.Deferred.getStackHook&&(c.stackTrace=v.Deferred.getStackHook()),e.setTimeout(c))}}return v.Deferred((function(e){r[0][3].add(a(0,e,v.isFunction(i)?i:N,e.notifyWith)),r[1][3].add(a(0,e,v.isFunction(t)?t:N)),r[2][3].add(a(0,e,v.isFunction(n)?n:R))})).promise()},promise:function(e){return null!=e?v.extend(e,i):i}},o={};return v.each(r,(function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add((function(){n=s}),r[3-e][2].disable,r[0][2].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,r=t,n=Array(r),i=o.call(arguments),a=v.Deferred(),s=function(e){return function(r){n[e]=this,i[e]=arguments.length>1?o.call(arguments):r,--t||a.resolveWith(n,i)}};if(t<=1&&(P(e,a.done(s(r)).resolve,a.reject,!t),"pending"===a.state()||v.isFunction(i[r]&&i[r].then)))return a.then();for(;r--;)P(i[r],s(r),a.reject);return a.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;v.Deferred.exceptionHook=function(t,r){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,r)},v.readyException=function(t){e.setTimeout((function(){throw t}))};var j=v.Deferred();function B(){n.removeEventListener("DOMContentLoaded",B),e.removeEventListener("load",B),v.ready()}v.fn.ready=function(e){return j.then(e).catch((function(e){v.readyException(e)})),this},v.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--v.readyWait:v.isReady)||(v.isReady=!0,!0!==e&&--v.readyWait>0||j.resolveWith(n,[v]))}}),v.ready.then=j.then,"complete"===n.readyState||"loading"!==n.readyState&&!n.documentElement.doScroll?e.setTimeout(v.ready):(n.addEventListener("DOMContentLoaded",B),e.addEventListener("load",B));var U=function(e,t,r,n,i,o,a){var s=0,l=e.length,u=null==r;if("object"===v.type(r))for(s in i=!0,r)U(e,t,s,r[s],!0,o,a);else if(void 0!==n&&(i=!0,v.isFunction(n)||(a=!0),u&&(a?(t.call(e,n),t=null):(u=t,t=function(e,t,r){return u.call(v(e),r)})),t))for(;s1,null,!0)},removeData:function(e){return this.each((function(){G.remove(this,e)}))}}),v.extend({queue:function(e,t,r){var n;if(e)return t=(t||"fx")+"queue",n=H.get(e,t),r&&(!n||Array.isArray(r)?n=H.access(e,t,v.makeArray(r)):n.push(r)),n||[]},dequeue:function(e,t){t=t||"fx";var r=v.queue(e,t),n=r.length,i=r.shift(),o=v._queueHooks(e,t);"inprogress"===i&&(i=r.shift(),n--),i&&("fx"===t&&r.unshift("inprogress"),delete o.stop,i.call(e,(function(){v.dequeue(e,t)}),o)),!n&&o&&o.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return H.get(e,r)||H.access(e,r,{empty:v.Callbacks("once memory").add((function(){H.remove(e,[t+"queue",r])}))})}}),v.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length\x20\t\r\n\f]+)/i,se=/^$|\/(?:java|ecma)script/i,le={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ue(e,t){var r;return r=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&S(e,t)?v.merge([e],r):r}function ce(e,t){for(var r=0,n=e.length;r-1)i&&i.push(o);else if(u=v.contains(o.ownerDocument,o),a=ue(f.appendChild(o),"script"),u&&ce(a),r)for(c=0;o=a[c++];)se.test(o.type||"")&&r.push(o);return f}fe=n.createDocumentFragment().appendChild(n.createElement("div")),(he=n.createElement("input")).setAttribute("type","radio"),he.setAttribute("checked","checked"),he.setAttribute("name","t"),fe.appendChild(he),d.checkClone=fe.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.innerHTML="",d.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue;var me=n.documentElement,ve=/^key/,ge=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ye=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function xe(){return!1}function we(){try{return n.activeElement}catch(e){}}function _e(e,t,r,n,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof r&&(n=n||r,r=void 0),t)_e(e,s,r,n,t[s],o);return e}if(null==n&&null==i?(i=r,n=r=void 0):null==i&&("string"==typeof r?(i=n,n=void 0):(i=n,n=r,r=void 0)),!1===i)i=xe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return v().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=v.guid++)),e.each((function(){v.event.add(this,t,i,n,r)}))}v.event={global:{},add:function(e,t,r,n,i){var o,a,s,l,u,c,f,h,p,d,m,g=H.get(e);if(g)for(r.handler&&(r=(o=r).handler,i=o.selector),i&&v.find.matchesSelector(me,i),r.guid||(r.guid=v.guid++),(l=g.events)||(l=g.events={}),(a=g.handle)||(a=g.handle=function(t){return void 0!==v&&v.event.triggered!==t.type?v.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(O)||[""]).length;u--;)p=m=(s=ye.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p&&(f=v.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=v.event.special[p]||{},c=v.extend({type:p,origType:m,data:n,handler:r,guid:r.guid,selector:i,needsContext:i&&v.expr.match.needsContext.test(i),namespace:d.join(".")},o),(h=l[p])||((h=l[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,n,d,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=r.guid)),i?h.splice(h.delegateCount++,0,c):h.push(c),v.event.global[p]=!0)},remove:function(e,t,r,n,i){var o,a,s,l,u,c,f,h,p,d,m,g=H.hasData(e)&&H.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(O)||[""]).length;u--;)if(p=m=(s=ye.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p){for(f=v.event.special[p]||{},h=l[p=(n?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)c=h[o],!i&&m!==c.origType||r&&r.guid!==c.guid||s&&!s.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(h.splice(o,1),c.selector&&h.delegateCount--,f.remove&&f.remove.call(e,c));a&&!h.length&&(f.teardown&&!1!==f.teardown.call(e,d,g.handle)||v.removeEvent(e,p,g.handle),delete l[p])}else for(p in l)v.event.remove(e,p+t[u],r,n,!0);v.isEmptyObject(l)&&H.remove(e,"handle events")}},dispatch:function(e){var t,r,n,i,o,a,s=v.event.fix(e),l=new Array(arguments.length),u=(H.get(this,"events")||{})[s.type]||[],c=v.event.special[s.type]||{};for(l[0]=s,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},r=0;r-1:v.find(i,this,null,[u]).length),a[i]&&o.push(n);o.length&&s.push({elem:u,handlers:o})}return u=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,Ce=/\s*$/g;function $e(e,t){return S(e,"table")&&S(11!==t.nodeType?t:t.firstChild,"tr")&&v(">tbody",e)[0]||e}function Te(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ze(e){var t=Se.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Ee(e,t){var r,n,i,o,a,s,l,u;if(1===t.nodeType){if(H.hasData(e)&&(o=H.access(e),a=H.set(t,o),u=o.events))for(i in delete a.handle,a.events={},u)for(r=0,n=u[i].length;r1&&"string"==typeof g&&!d.checkClone&&Ae.test(g))return e.each((function(i){var o=e.eq(i);y&&(t[0]=g.call(this,i,o.html())),ke(o,t,r,n)}));if(h&&(o=(i=de(t,e[0].ownerDocument,!1,e,n)).firstChild,1===i.childNodes.length&&(i=o),o||n)){for(l=(s=v.map(ue(i,"script"),Te)).length;f")},clone:function(e,t,r){var n,i,o,a,s=e.cloneNode(!0),l=v.contains(e.ownerDocument,e);if(!(d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||v.isXMLDoc(e)))for(a=ue(s),n=0,i=(o=ue(e)).length;n0&&ce(a,!l&&ue(e,"script")),s},cleanData:function(e){for(var t,r,n,i=v.event.special,o=0;void 0!==(r=e[o]);o++)if(V(r)){if(t=r[H.expando]){if(t.events)for(n in t.events)i[n]?v.event.remove(r,n):v.removeEvent(r,n,t.handle);r[H.expando]=void 0}r[G.expando]&&(r[G.expando]=void 0)}}}),v.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return U(this,(function(e){return void 0===e?v.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return ke(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||$e(this,e).appendChild(e)}))},prepend:function(){return ke(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=$e(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return ke(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return ke(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(v.cleanData(ue(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return v.clone(this,e,t)}))},html:function(e){return U(this,(function(e){var t=this[0]||{},r=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ce.test(e)&&!le[(ae.exec(e)||["",""])[1].toLowerCase()]){e=v.htmlPrefilter(e);try{for(;r1)}}),v.Tween=Ze,Ze.prototype={constructor:Ze,init:function(e,t,r,n,i,o){this.elem=e,this.prop=r,this.easing=i||v.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=o||(v.cssNumber[r]?"":"px")},cur:function(){var e=Ze.propHooks[this.prop];return e&&e.get?e.get(this):Ze.propHooks._default.get(this)},run:function(e){var t,r=Ze.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):Ze.propHooks._default.set(this),this}},Ze.prototype.init.prototype=Ze.prototype,Ze.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=v.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[v.cssProps[e.prop]]&&!v.cssHooks[e.prop]?e.elem[e.prop]=e.now:v.style(e.elem,e.prop,e.now+e.unit)}}},Ze.propHooks.scrollTop=Ze.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},v.fx=Ze.prototype.init,v.fx.step={};var Ke,Qe,Je=/^(?:toggle|show|hide)$/,et=/queueHooks$/;function tt(){Qe&&(!1===n.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(tt):e.setTimeout(tt,v.fx.interval),v.fx.tick())}function rt(){return e.setTimeout((function(){Ke=void 0})),Ke=v.now()}function nt(e,t){var r,n=0,i={height:e};for(t=t?1:0;n<4;n+=2-t)i["margin"+(r=Q[n])]=i["padding"+r]=e;return t&&(i.opacity=i.width=e),i}function it(e,t,r){for(var n,i=(ot.tweeners[t]||[]).concat(ot.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){v.removeAttr(this,e)}))}}),v.extend({attr:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?v.prop(e,t,r):(1===o&&v.isXMLDoc(e)||(i=v.attrHooks[t.toLowerCase()]||(v.expr.match.bool.test(t)?at:void 0)),void 0!==r?null===r?void v.removeAttr(e,t):i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:(e.setAttribute(t,r+""),r):i&&"get"in i&&null!==(n=i.get(e,t))?n:null==(n=v.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&S(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}},removeAttr:function(e,t){var r,n=0,i=t&&t.match(O);if(i&&1===e.nodeType)for(;r=i[n++];)e.removeAttribute(r)}}),at={set:function(e,t,r){return!1===t?v.removeAttr(e,r):e.setAttribute(r,r),r}},v.each(v.expr.match.bool.source.match(/\w+/g),(function(e,t){var r=st[t]||v.find.attr;st[t]=function(e,t,n){var i,o,a=t.toLowerCase();return n||(o=st[a],st[a]=i,i=null!=r(e,t,n)?a:null,st[a]=o),i}}));var lt=/^(?:input|select|textarea|button)$/i,ut=/^(?:a|area)$/i;function ct(e){return(e.match(O)||[]).join(" ")}function ft(e){return e.getAttribute&&e.getAttribute("class")||""}v.fn.extend({prop:function(e,t){return U(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[v.propFix[e]||e]}))}}),v.extend({prop:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&v.isXMLDoc(e)||(t=v.propFix[t]||t,i=v.propHooks[t]),void 0!==r?i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:e[t]=r:i&&"get"in i&&null!==(n=i.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=v.find.attr(e,"tabindex");return t?parseInt(t,10):lt.test(e.nodeName)||ut.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.optSelected||(v.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),v.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){v.propFix[this.toLowerCase()]=this})),v.fn.extend({addClass:function(e){var t,r,n,i,o,a,s,l=0;if(v.isFunction(e))return this.each((function(t){v(this).addClass(e.call(this,t,ft(this)))}));if("string"==typeof e&&e)for(t=e.match(O)||[];r=this[l++];)if(i=ft(r),n=1===r.nodeType&&" "+ct(i)+" "){for(a=0;o=t[a++];)n.indexOf(" "+o+" ")<0&&(n+=o+" ");i!==(s=ct(n))&&r.setAttribute("class",s)}return this},removeClass:function(e){var t,r,n,i,o,a,s,l=0;if(v.isFunction(e))return this.each((function(t){v(this).removeClass(e.call(this,t,ft(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(O)||[];r=this[l++];)if(i=ft(r),n=1===r.nodeType&&" "+ct(i)+" "){for(a=0;o=t[a++];)for(;n.indexOf(" "+o+" ")>-1;)n=n.replace(" "+o+" "," ");i!==(s=ct(n))&&r.setAttribute("class",s)}return this},toggleClass:function(e,t){var r=typeof e;return"boolean"==typeof t&&"string"===r?t?this.addClass(e):this.removeClass(e):v.isFunction(e)?this.each((function(r){v(this).toggleClass(e.call(this,r,ft(this),t),t)})):this.each((function(){var t,n,i,o;if("string"===r)for(n=0,i=v(this),o=e.match(O)||[];t=o[n++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==r||((t=ft(this))&&H.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":H.get(this,"__className__")||""))}))},hasClass:function(e){var t,r,n=0;for(t=" "+e+" ";r=this[n++];)if(1===r.nodeType&&(" "+ct(ft(r))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;v.fn.extend({val:function(e){var t,r,n,i=this[0];return arguments.length?(n=v.isFunction(e),this.each((function(r){var i;1===this.nodeType&&(null==(i=n?e.call(this,r,v(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=v.map(i,(function(e){return null==e?"":e+""}))),(t=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=v.valHooks[i.type]||v.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(r=t.get(i,"value"))?r:"string"==typeof(r=i.value)?r.replace(ht,""):null==r?"":r:void 0}}),v.extend({valHooks:{option:{get:function(e){var t=v.find.attr(e,"value");return null!=t?t:ct(v.text(e))}},select:{get:function(e){var t,r,n,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(n=o<0?l:a?o:0;n-1)&&(r=!0);return r||(e.selectedIndex=-1),o}}}}),v.each(["radio","checkbox"],(function(){v.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=v.inArray(v(e).val(),t)>-1}},d.checkOn||(v.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var pt=/^(?:focusinfocus|focusoutblur)$/;v.extend(v.event,{trigger:function(t,r,i,o){var a,s,l,u,c,h,p,d=[i||n],m=f.call(t,"type")?t.type:t,g=f.call(t,"namespace")?t.namespace.split("."):[];if(s=l=i=i||n,3!==i.nodeType&&8!==i.nodeType&&!pt.test(m+v.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[v.expando]?t:new v.Event(m,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),r=null==r?[t]:v.makeArray(r,[t]),p=v.event.special[m]||{},o||!p.trigger||!1!==p.trigger.apply(i,r))){if(!o&&!p.noBubble&&!v.isWindow(i)){for(u=p.delegateType||m,pt.test(u+m)||(s=s.parentNode);s;s=s.parentNode)d.push(s),l=s;l===(i.ownerDocument||n)&&d.push(l.defaultView||l.parentWindow||e)}for(a=0;(s=d[a++])&&!t.isPropagationStopped();)t.type=a>1?u:p.bindType||m,(h=(H.get(s,"events")||{})[t.type]&&H.get(s,"handle"))&&h.apply(s,r),(h=c&&s[c])&&h.apply&&V(s)&&(t.result=h.apply(s,r),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(d.pop(),r)||!V(i)||c&&v.isFunction(i[m])&&!v.isWindow(i)&&((l=i[c])&&(i[c]=null),v.event.triggered=m,i[m](),v.event.triggered=void 0,l&&(i[c]=l)),t.result}},simulate:function(e,t,r){var n=v.extend(new v.Event,r,{type:e,isSimulated:!0});v.event.trigger(n,null,t)}}),v.fn.extend({trigger:function(e,t){return this.each((function(){v.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var r=this[0];if(r)return v.event.trigger(e,t,r,!0)}}),v.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){v.fn[t]=function(e,r){return arguments.length>0?this.on(t,null,e,r):this.trigger(t)}})),v.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),d.focusin="onfocusin"in e,d.focusin||v.each({focus:"focusin",blur:"focusout"},(function(e,t){var r=function(e){v.event.simulate(t,e.target,v.event.fix(e))};v.event.special[t]={setup:function(){var n=this.ownerDocument||this,i=H.access(n,t);i||n.addEventListener(e,r,!0),H.access(n,t,(i||0)+1)},teardown:function(){var n=this.ownerDocument||this,i=H.access(n,t)-1;i?H.access(n,t,i):(n.removeEventListener(e,r,!0),H.remove(n,t))}}}));var dt=e.location,mt=v.now(),vt=/\?/;v.parseXML=function(t){var r;if(!t||"string"!=typeof t)return null;try{r=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){r=void 0}return r&&!r.getElementsByTagName("parsererror").length||v.error("Invalid XML: "+t),r};var gt=/\[\]$/,yt=/\r?\n/g,bt=/^(?:submit|button|image|reset|file)$/i,xt=/^(?:input|select|textarea|keygen)/i;function wt(e,t,r,n){var i;if(Array.isArray(t))v.each(t,(function(t,i){r||gt.test(e)?n(e,i):wt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,r,n)}));else if(r||"object"!==v.type(t))n(e,t);else for(i in t)wt(e+"["+i+"]",t[i],r,n)}v.param=function(e,t){var r,n=[],i=function(e,t){var r=v.isFunction(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==r?"":r)};if(Array.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,(function(){i(this.name,this.value)}));else for(r in e)wt(r,e[r],t,i);return n.join("&")},v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=v.prop(this,"elements");return e?v.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!v(this).is(":disabled")&&xt.test(this.nodeName)&&!bt.test(e)&&(this.checked||!oe.test(e))})).map((function(e,t){var r=v(this).val();return null==r?null:Array.isArray(r)?v.map(r,(function(e){return{name:t.name,value:e.replace(yt,"\r\n")}})):{name:t.name,value:r.replace(yt,"\r\n")}})).get()}});var _t=/%20/g,Dt=/#.*$/,Ct=/([?&])_=[^&]*/,At=/^(.*?):[ \t]*([^\r\n]*)$/gm,St=/^(?:GET|HEAD)$/,Mt=/^\/\//,$t={},Tt={},zt="*/".concat("*"),Et=n.createElement("a");function Lt(e){return function(t,r){"string"!=typeof t&&(r=t,t="*");var n,i=0,o=t.toLowerCase().match(O)||[];if(v.isFunction(r))for(;n=o[i++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(r)):(e[n]=e[n]||[]).push(r)}}function kt(e,t,r,n){var i={},o=e===Tt;function a(s){var l;return i[s]=!0,v.each(e[s]||[],(function(e,s){var u=s(t,r,n);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function It(e,t){var r,n,i=v.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&v.extend(!0,e,n),e}Et.href=dt.href,v.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:dt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(dt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":v.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?It(It(e,v.ajaxSettings),t):It(v.ajaxSettings,e)},ajaxPrefilter:Lt($t),ajaxTransport:Lt(Tt),ajax:function(t,r){"object"==typeof t&&(r=t,t=void 0),r=r||{};var i,o,a,s,l,u,c,f,h,p,d=v.ajaxSetup({},r),m=d.context||d,g=d.context&&(m.nodeType||m.jquery)?v(m):v.event,y=v.Deferred(),b=v.Callbacks("once memory"),x=d.statusCode||{},w={},_={},D="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=At.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=_[e.toLowerCase()]=_[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==c&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)C.always(e[C.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||D;return i&&i.abort(t),A(0,t),this}};if(y.promise(C),d.url=((t||d.url||dt.href)+"").replace(Mt,dt.protocol+"//"),d.type=r.method||r.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(O)||[""],null==d.crossDomain){u=n.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=Et.protocol+"//"+Et.host!=u.protocol+"//"+u.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=v.param(d.data,d.traditional)),kt($t,d,r,C),c)return C;for(h in(f=v.event&&d.global)&&0==v.active++&&v.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!St.test(d.type),o=d.url.replace(Dt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(_t,"+")):(p=d.url.slice(o.length),d.data&&(o+=(vt.test(o)?"&":"?")+d.data,delete d.data),!1===d.cache&&(o=o.replace(Ct,"$1"),p=(vt.test(o)?"&":"?")+"_="+mt+++p),d.url=o+p),d.ifModified&&(v.lastModified[o]&&C.setRequestHeader("If-Modified-Since",v.lastModified[o]),v.etag[o]&&C.setRequestHeader("If-None-Match",v.etag[o])),(d.data&&d.hasContent&&!1!==d.contentType||r.contentType)&&C.setRequestHeader("Content-Type",d.contentType),C.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+zt+"; q=0.01":""):d.accepts["*"]),d.headers)C.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(m,C,d)||c))return C.abort();if(D="abort",b.add(d.complete),C.done(d.success),C.fail(d.error),i=kt(Tt,d,r,C)){if(C.readyState=1,f&&g.trigger("ajaxSend",[C,d]),c)return C;d.async&&d.timeout>0&&(l=e.setTimeout((function(){C.abort("timeout")}),d.timeout));try{c=!1,i.send(w,A)}catch(e){if(c)throw e;A(-1,e)}}else A(-1,"No Transport");function A(t,r,n,s){var u,h,p,w,_,D=r;c||(c=!0,l&&e.clearTimeout(l),i=void 0,a=s||"",C.readyState=t>0?4:0,u=t>=200&&t<300||304===t,n&&(w=function(e,t,r){for(var n,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(i in s)if(s[i]&&s[i].test(n)){l.unshift(i);break}if(l[0]in r)o=l[0];else{for(i in r){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),r[o]}(d,C,n)),w=function(e,t,r,n){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(r[e.responseFields[o]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(d,w,C,u),u?(d.ifModified&&((_=C.getResponseHeader("Last-Modified"))&&(v.lastModified[o]=_),(_=C.getResponseHeader("etag"))&&(v.etag[o]=_)),204===t||"HEAD"===d.type?D="nocontent":304===t?D="notmodified":(D=w.state,h=w.data,u=!(p=w.error))):(p=D,!t&&D||(D="error",t<0&&(t=0))),C.status=t,C.statusText=(r||D)+"",u?y.resolveWith(m,[h,D,C]):y.rejectWith(m,[C,D,p]),C.statusCode(x),x=void 0,f&&g.trigger(u?"ajaxSuccess":"ajaxError",[C,d,u?h:p]),b.fireWith(m,[C,D]),f&&(g.trigger("ajaxComplete",[C,d]),--v.active||v.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,r){return v.get(e,t,r,"json")},getScript:function(e,t){return v.get(e,void 0,t,"script")}}),v.each(["get","post"],(function(e,t){v[t]=function(e,r,n,i){return v.isFunction(r)&&(i=i||n,n=r,r=void 0),v.ajax(v.extend({url:e,type:t,dataType:i,data:r,success:n},v.isPlainObject(e)&&e))}})),v._evalUrl=function(e){return v.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},v.fn.extend({wrapAll:function(e){var t;return this[0]&&(v.isFunction(e)&&(e=e.call(this[0])),t=v(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v.isFunction(e)?this.each((function(t){v(this).wrapInner(e.call(this,t))})):this.each((function(){var t=v(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v.isFunction(e);return this.each((function(r){v(this).wrapAll(t?e.call(this,r):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){v(this).replaceWith(this.childNodes)})),this}}),v.expr.pseudos.hidden=function(e){return!v.expr.pseudos.visible(e)},v.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},v.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ot={0:200,1223:204},Nt=v.ajaxSettings.xhr();d.cors=!!Nt&&"withCredentials"in Nt,d.ajax=Nt=!!Nt,v.ajaxTransport((function(t){var r,n;if(d.cors||Nt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);r=function(e){return function(){r&&(r=n=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ot[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=r(),n=s.onerror=r("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){r&&n()}))},r=r("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(r)throw e}},abort:function(){r&&r()}}})),v.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),v.ajaxTransport("script",(function(e){var t,r;if(e.crossDomain)return{send:function(i,o){t=v("