tradingraph
Version:
Based on rpiontik chart https://github.com/rpiontik/crypto-chart
1 lines • 35.3 kB
JavaScript
(function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="da2a")})({"01f9":function(t,e,n){"use strict";var r=n("2d00"),i=n("5ca1"),a=n("2aba"),o=n("32e9"),s=n("84f2"),u=n("41a0"),c=n("7f20"),f=n("38fd"),l=n("2b4c")("iterator"),h=!([].keys&&"next"in[].keys()),d="@@iterator",p="keys",v="values",g=function(){return this};t.exports=function(t,e,n,y,m,b,w){u(n,e,y);var P,x,S,E=function(t){if(!h&&t in T)return T[t];switch(t){case p:return function(){return new n(this,t)};case v:return function(){return new n(this,t)}}return function(){return new n(this,t)}},O=e+" Iterator",k=m==v,A=!1,T=t.prototype,L=T[l]||T[d]||m&&T[m],_=L||E(m),M=m?k?E("entries"):_:void 0,j="Array"==e&&T.entries||L;if(j&&(S=f(j.call(new t)),S!==Object.prototype&&S.next&&(c(S,O,!0),r||"function"==typeof S[l]||o(S,l,g))),k&&L&&L.name!==v&&(A=!0,_=function(){return L.call(this)}),r&&!w||!h&&!A&&T[l]||o(T,l,_),s[e]=_,s[O]=g,m)if(P={values:k?_:E(v),keys:b?_:E(p),entries:M},w)for(x in P)x in T||a(T,x,P[x]);else i(i.P+i.F*(h||A),e,P);return P}},"09fa":function(t,e,n){var r=n("4588"),i=n("9def");t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw RangeError("Wrong length!");return n}},"0a49":function(t,e,n){var r=n("9b43"),i=n("626a"),a=n("4bf8"),o=n("9def"),s=n("cd1c");t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,f=4==t,l=6==t,h=5==t||l,d=e||s;return function(e,s,p){for(var v,g,y=a(e),m=i(y),b=r(s,p,3),w=o(m.length),P=0,x=n?d(e,w):u?d(e,0):void 0;w>P;P++)if((h||P in m)&&(v=m[P],g=b(v,P,y),t))if(n)x[P]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return P;case 2:x.push(v)}else if(f)return!1;return l?-1:c||f?f:x}}},"0d58":function(t,e,n){var r=n("ce10"),i=n("e11e");t.exports=Object.keys||function(t){return r(t,i)}},"0f88":function(t,e,n){var r,i=n("7726"),a=n("32e9"),o=n("ca5a"),s=o("typed_array"),u=o("view"),c=!(!i.ArrayBuffer||!i.DataView),f=c,l=0,h=9,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");while(l<h)(r=i[d[l++]])?(a(r.prototype,s,!0),a(r.prototype,u,!0)):f=!1;t.exports={ABV:c,CONSTR:f,TYPED:s,VIEW:u}},1169:function(t,e,n){var r=n("2d95");t.exports=Array.isArray||function(t){return"Array"==r(t)}},"11e9":function(t,e,n){var r=n("52a7"),i=n("4630"),a=n("6821"),o=n("6a99"),s=n("69a8"),u=n("c69a"),c=Object.getOwnPropertyDescriptor;e.f=n("9e1e")?c:function(t,e){if(t=a(t),e=o(e,!0),u)try{return c(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},1495:function(t,e,n){var r=n("86cc"),i=n("cb7c"),a=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){i(t);var n,o=a(e),s=o.length,u=0;while(s>u)r.f(t,n=o[u++],e[n]);return t}},"230e":function(t,e,n){var r=n("d3f4"),i=n("7726").document,a=r(i)&&r(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},"23c6":function(t,e,n){var r=n("2d95"),i=n("2b4c")("toStringTag"),a="Arguments"==r(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=o(e=Object(t),i))?n:a?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},2621:function(t,e){e.f=Object.getOwnPropertySymbols},"27ee":function(t,e,n){var r=n("23c6"),i=n("2b4c")("iterator"),a=n("84f2");t.exports=n("8378").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||a[r(t)]}},"2aba":function(t,e,n){var r=n("7726"),i=n("32e9"),a=n("69a8"),o=n("ca5a")("src"),s="toString",u=Function[s],c=(""+u).split(s);n("8378").inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,s){var u="function"==typeof n;u&&(a(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(a(n,o)||i(n,o,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,s,function(){return"function"==typeof this&&this[o]||u.call(this)})},"2aeb":function(t,e,n){var r=n("cb7c"),i=n("1495"),a=n("e11e"),o=n("613b")("IE_PROTO"),s=function(){},u="prototype",c=function(){var t,e=n("230e")("iframe"),r=a.length,i="<",o=">";e.style.display="none",n("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(i+"script"+o+"document.F=Object"+i+"/script"+o),t.close(),c=t.F;while(r--)delete c[u][a[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(s[u]=r(t),n=new s,s[u]=null,n[o]=t):n=c(),void 0===e?n:i(n,e)}},"2b4c":function(t,e,n){var r=n("5537")("wks"),i=n("ca5a"),a=n("7726").Symbol,o="function"==typeof a,s=t.exports=function(t){return r[t]||(r[t]=o&&a[t]||(o?a:i)("Symbol."+t))};s.store=r},"2d00":function(t,e){t.exports=!1},"2d95":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"2f21":function(t,e,n){"use strict";var r=n("79e5");t.exports=function(t,e){return!!t&&r(function(){e?t.call(null,function(){},1):t.call(null)})}},"32e9":function(t,e,n){var r=n("86cc"),i=n("4630");t.exports=n("9e1e")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},"33a4":function(t,e,n){var r=n("84f2"),i=n("2b4c")("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[i]===t)}},"36bd":function(t,e,n){"use strict";var r=n("4bf8"),i=n("77f1"),a=n("9def");t.exports=function(t){var e=r(this),n=a(e.length),o=arguments.length,s=i(o>1?arguments[1]:void 0,n),u=o>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);while(c>s)e[s++]=t;return e}},"38fd":function(t,e,n){var r=n("69a8"),i=n("4bf8"),a=n("613b")("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},"41a0":function(t,e,n){"use strict";var r=n("2aeb"),i=n("4630"),a=n("7f20"),o={};n("32e9")(o,n("2b4c")("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(o,{next:i(1,n)}),a(t,e+" Iterator")}},"456d":function(t,e,n){var r=n("4bf8"),i=n("0d58");n("5eda")("keys",function(){return function(t){return i(r(t))}})},4588:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"4bf8":function(t,e,n){var r=n("be13");t.exports=function(t){return Object(r(t))}},"52a7":function(t,e){e.f={}.propertyIsEnumerable},5537:function(t,e,n){var r=n("8378"),i=n("7726"),a="__core-js_shared__",o=i[a]||(i[a]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("2d00")?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},"55dd":function(t,e,n){"use strict";var r=n("5ca1"),i=n("d8e8"),a=n("4bf8"),o=n("79e5"),s=[].sort,u=[1,2,3];r(r.P+r.F*(o(function(){u.sort(void 0)})||!o(function(){u.sort(null)})||!n("2f21")(s)),"Array",{sort:function(t){return void 0===t?s.call(a(this)):s.call(a(this),i(t))}})},"5ca1":function(t,e,n){var r=n("7726"),i=n("8378"),a=n("32e9"),o=n("2aba"),s=n("9b43"),u="prototype",c=function(t,e,n){var f,l,h,d,p=t&c.F,v=t&c.G,g=t&c.S,y=t&c.P,m=t&c.B,b=v?r:g?r[e]||(r[e]={}):(r[e]||{})[u],w=v?i:i[e]||(i[e]={}),P=w[u]||(w[u]={});for(f in v&&(n=e),n)l=!p&&b&&void 0!==b[f],h=(l?b:n)[f],d=m&&l?s(h,r):y&&"function"==typeof h?s(Function.call,h):h,b&&o(b,f,h,t&c.U),w[f]!=h&&a(w,f,d),y&&P[f]!=h&&(P[f]=h)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},"5cc5":function(t,e,n){var r=n("2b4c")("iterator"),i=!1;try{var a=[7][r]();a["return"]=function(){i=!0},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var a=[7],o=a[r]();o.next=function(){return{done:n=!0}},a[r]=function(){return o},t(a)}catch(t){}return n}},"5eda":function(t,e,n){var r=n("5ca1"),i=n("8378"),a=n("79e5");t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],o={};o[t]=e(n),r(r.S+r.F*a(function(){n(1)}),"Object",o)}},"613b":function(t,e,n){var r=n("5537")("keys"),i=n("ca5a");t.exports=function(t){return r[t]||(r[t]=i(t))}},"626a":function(t,e,n){var r=n("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},"63d9":function(t,e,n){n("ec30")("Float32",4,function(t){return function(e,n,r){return t(this,e,n,r)}})},6821:function(t,e,n){var r=n("626a"),i=n("be13");t.exports=function(t){return r(i(t))}},"69a8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"6a99":function(t,e,n){var r=n("d3f4");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},7333:function(t,e,n){"use strict";var r=n("0d58"),i=n("2621"),a=n("52a7"),o=n("4bf8"),s=n("626a"),u=Object.assign;t.exports=!u||n("79e5")(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r})?function(t,e){var n=o(t),u=arguments.length,c=1,f=i.f,l=a.f;while(u>c){var h,d=s(arguments[c++]),p=f?r(d).concat(f(d)):r(d),v=p.length,g=0;while(v>g)l.call(d,h=p[g++])&&(n[h]=d[h])}return n}:u},7726:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"77f1":function(t,e,n){var r=n("4588"),i=Math.max,a=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):a(t,e)}},"79e5":function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},"7a56":function(t,e,n){"use strict";var r=n("7726"),i=n("86cc"),a=n("9e1e"),o=n("2b4c")("species");t.exports=function(t){var e=r[t];a&&e&&!e[o]&&i.f(e,o,{configurable:!0,get:function(){return this}})}},"7f20":function(t,e,n){var r=n("86cc").f,i=n("69a8"),a=n("2b4c")("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,a)&&r(t,a,{configurable:!0,value:e})}},8378:function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},"84f2":function(t,e){t.exports={}},"86cc":function(t,e,n){var r=n("cb7c"),i=n("c69a"),a=n("6a99"),o=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(r(t),e=a(e,!0),r(n),i)try{return o(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},9093:function(t,e,n){var r=n("ce10"),i=n("e11e").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},"9b43":function(t,e,n){var r=n("d8e8");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"9c29":function(t,e,n){n("ec30")("Uint32",4,function(t){return function(e,n,r){return t(this,e,n,r)}})},"9c6c":function(t,e,n){var r=n("2b4c")("unscopables"),i=Array.prototype;void 0==i[r]&&n("32e9")(i,r,{}),t.exports=function(t){i[r][t]=!0}},"9def":function(t,e,n){var r=n("4588"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},ac6a:function(t,e,n){for(var r=n("cadf"),i=n("0d58"),a=n("2aba"),o=n("7726"),s=n("32e9"),u=n("84f2"),c=n("2b4c"),f=c("iterator"),l=c("toStringTag"),h=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(d),v=0;v<p.length;v++){var g,y=p[v],m=d[y],b=o[y],w=b&&b.prototype;if(w&&(w[f]||s(w,f,h),w[l]||s(w,l,y),u[y]=h,m))for(g in r)w[g]||a(w,g,r[g],!0)}},ba92:function(t,e,n){"use strict";var r=n("4bf8"),i=n("77f1"),a=n("9def");t.exports=[].copyWithin||function(t,e){var n=r(this),o=a(n.length),s=i(t,o),u=i(e,o),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?o:i(c,o))-u,o-s),l=1;u<s&&s<u+f&&(l=-1,u+=f-1,s+=f-1);while(f-- >0)u in n?n[s]=n[u]:delete n[s],s+=l,u+=l;return n}},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},c366:function(t,e,n){var r=n("6821"),i=n("9def"),a=n("77f1");t.exports=function(t){return function(e,n,o){var s,u=r(e),c=i(u.length),f=a(o,c);if(t&&n!=n){while(c>f)if(s=u[f++],s!=s)return!0}else for(;c>f;f++)if((t||f in u)&&u[f]===n)return t||f||0;return!t&&-1}}},c69a:function(t,e,n){t.exports=!n("9e1e")&&!n("79e5")(function(){return 7!=Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a})},ca5a:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},cadf:function(t,e,n){"use strict";var r=n("9c6c"),i=n("d53b"),a=n("84f2"),o=n("6821");t.exports=n("01f9")(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},cb7c:function(t,e,n){var r=n("d3f4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},cd1c:function(t,e,n){var r=n("e853");t.exports=function(t,e){return new(r(t))(e)}},ce10:function(t,e,n){var r=n("69a8"),i=n("6821"),a=n("c366")(!1),o=n("613b")("IE_PROTO");t.exports=function(t,e){var n,s=i(t),u=0,c=[];for(n in s)n!=o&&r(s,n)&&c.push(n);while(e.length>u)r(s,n=e[u++])&&(~a(c,n)||c.push(n));return c}},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d53b:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},da2a:function(t,e,n){"use strict";n.r(e);n("ac6a"),n("456d"),n("55dd"),n("63d9"),n("9c29"),n("f751");function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}var o=10,s=.3,u=function(){function t(){r(this,t),this.data={treeReady:!1,rawBinary:[],rawParsed:[],averageBinary:[],averageParsed:[],firstEntry:0,lastResolution:0,start:null,width:null,last:{offset:0,end:0,resolution:0},tree:[]},this.params={empty:!1,candleWidths:[],defaultExposition:2592e3,fileSizes:{},resolutions:[],packetSize:0,dataRequestPending:!1,isInitialLoading:!0},this.requestInitialParams()}return a(t,[{key:"resetData",value:function(){Object.assign(this.data,{treeReady:!1,rawBinary:[],rawParsed:[],averageBinary:[],averageParsed:[],firstEntry:0,lastResolution:0,start:null,width:null,last:{offset:0,end:0,resolution:0},tree:[]}),Object.assign(this.params,{dataRequestPending:!1,isInitialLoading:!0,fileSizes:{},resolutions:[],empty:!1})}},{key:"requestInitialParams",value:function(){this.sendMessage("REQUEST_PARAMS",{inner:["candleWidths"],outer:["fileSizes","resolutions","packetSize"]})}},{key:"initialLoading",value:function(t){var e=this.params.fileSizes[t],n=this.rebaseExposition(e,e),r=this.rebaseOffset(e-n,t);this.params.isInitialLoading=!0,this.requestData(r,e-1,t)}},{key:"rebaseOffset",value:function(t,e){var n=this.params.fileSizes[e];return t<0?0:t>n-1?n-1:t}},{key:"rebaseExposition",value:function(t,e){return t>e?e:t}},{key:"append",value:function(t){this.data.treeReady=!1,this.params.dataRequestPending=!1,this.appendedData=["candleData"],this.data.rawBinary=t.slice(0),this.data.rawParsed=this.parseChartData(this.data.rawBinary),!0===this.params.isInitialLoading&&(this.appendedData.push("averageData"),this.data.averageBinary=t.slice(0),this.data.averageParsed=this.data.rawParsed.slice(0),this.params.isInitialLoading=!1),this.makeTree(),this.sendMessage("APPENDED",{type:this.appendedData})}},{key:"parseEntity",value:function(t){return{timestamp:new Uint32Array(t,0,1)[0],volume:new Float32Array(t,4,1)[0],open:new Float32Array(t,8,1)[0],high:new Float32Array(t,12,1)[0],low:new Float32Array(t,16,1)[0],close:new Float32Array(t,20,1)[0],average:new Float32Array(t,24,1)[0]}}},{key:"parseChartData",value:function(t){for(var e=[],n=0,r=0;n<t.byteLength;n+=this.params.packetSize,r++)e[r]=this.parseEntity(t.slice(n,n+this.params.packetSize));return e}},{key:"makeTree",value:function(){var t=this;this.data.rawParsed.length>0&&(this.data.start=this.data.rawParsed[0].timestamp,this.data.end=this.data.rawParsed[this.data.rawParsed.length-1].timestamp,this.params.candleWidths.map(function(e){t.data.tree[e]=[];var n=null;t.data.rawParsed.map(function(r){var i=r.timestamp-r.timestamp%e;n&&i===n.id?(n.low=r.low<n.low?r.low:n.low,n.high=r.high>n.high?r.high:n.high,n.close=r.close,n.volume+=r.volume):(n&&t.data.tree[e].push(n),n={id:i,timestamp:r.timestamp,open:r.open,low:r.low,high:r.high,close:r.close,volume:r.volume})}),n&&t.data.tree[e].push(n)}),this.data.treeReady=!0)}},{key:"findCandleWidthForUse",value:function(t,e){var n=e/o,r=null,i=0;return this.params.candleWidths.map(function(e){if(r){var a=Math.abs(Math.round(n-t/e));a<i&&(i=a,r=e)}else r=e,i=Math.abs(Math.round(n-t/e))}),r}},{key:"findAvailableResolution",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:86400,e=this.params.resolutions.length;if(t>this.params.resolutions[e-1])return this.params.resolutions[e-1];for(var n=0,r=e;n<r;n++){if(t===this.params.resolutions[n]||t<this.params.resolutions[n]&&0===n)return this.params.resolutions[n];if(t<this.params.resolutions[n]&&n>0)return this.params.resolutions[n-1]}}},{key:"convertTimestampToPackage",value:function(t,e){return Math.ceil(t/e)*this.params.packetSize}},{key:"convertOffsetToPackage",value:function(t,e){var n=(new Date).getTime()/1e3,r=n-(t-this.params.defaultExposition),i=this.convertTimestampToPackage(r,e),a=this.params.fileSizes[e];return this.rebaseOffset(a-i,e)}},{key:"renderCandles",value:function(t,e,n,r){this.data.treeReady||this.makeTree();var i={low:null,high:null,maxVolume:null,width:null,candles:[],candlesPositivePath:[],candlesNegativePath:[],volumePath:[]},a=this.findCandleWidthForUse(e,n),o=n/e;i.width=a*o;var u=this.data.tree[a],c=0;if(u&&this.data.lastResolution===a){var f=u.length;t>this.data.start&&(c=-Math.floor((t-this.data.start)/a));for(var l=-c;l<f;l++){var h=u[l];if(!(h.timestamp<=t)){if(h.timestamp>t+e){f=l;break}c<0&&(c=l),(null==i.low||i.low>h.low)&&(i.low=h.low),(null==i.high||i.high<h.high)&&(i.high=h.high),(null==i.maxVolume||i.maxVolume<h.volume)&&(i.maxVolume=h.volume)}}c=Math.abs(c),null==f&&(f=u.length);var d=0;d=i.high!==i.low?r/(i.high-i.low):r/(1.1*i.high-i.low);var p=0;i.maxVolume>0&&(p=r*s/i.maxVolume);for(var v=a*o*.25,g=c;g<f;g++){var y=u[g],m=(y.timestamp-t)*o,b="M".concat(m," ").concat((i.high-y.low)*d," L").concat(m," ").concat((i.high-y.high)*d," "),w="M".concat(m-v," ").concat((i.high-y.close)*d,"\n L").concat(m+v," ").concat((i.high-y.close)*d,"\n L").concat(m+v," ").concat((i.high-y.open)*d,"\n L").concat(m-v," ").concat((i.high-y.open)*d),P=Object.assign({},y);y.open<=y.close?(P.class="positive",P.candlePathIndex=i.candlesPositivePath.push(b+w)-1):(P.class="negative",P.candlePathIndex=i.candlesNegativePath.push(b+w)-1),P.volumePathIndex=i.volumePath.push("M".concat(m-v," ").concat(r-y.volume*p,"\n L").concat(m+v," ").concat(r-y.volume*p,"\n L").concat(m+v," ").concat(r,"\n L").concat(m-v," ").concat(r))-1,P.x=m,i.candles.push(P)}}else{var x=this.findAvailableResolution(a);this.requestData(this.convertOffsetToPackage(t,x),this.params.fileSizes[x]-1,x)}if(this.data.start>0&&this.data.start>t){var S=this.findAvailableResolution(a);this.requestData(this.convertOffsetToPackage(t,S),this.params.fileSizes[S]-1,S)}this.data.lastResolution=a,this.sendMessage("RENDERED",{type:"candles",data:i})}},{key:"returnEmptyData",value:function(){this.sendMessage("RENDERED",{type:"candles",data:{candles:[],candlesPositivePath:[],candlesNegativePath:[],volumePath:[]}}),this.sendMessage("RENDERED",{type:"average",data:{minTimestamp:0,path:[]}})}},{key:"renderAverage",value:function(t,e){var n=this.data.averageParsed.length;if(n){var r=t/n,i={minTimestamp:this.data.averageParsed[0].timestamp-86400,maxTimestamp:this.data.averageParsed[n-1].timestamp,path:[]},a=this.data.averageParsed.slice(0).sort(function(t,e){return t.average-e.average}),o=a[n-1].average,s=a[0].average,u=0;o!==s&&(u=e/(o-s)),i.path.push("M0 ".concat(u*(o-this.data.averageParsed[0].average)));for(var c=1;c<n;c++)i.path.push("L".concat(r*c," ").concat(u*(o-this.data.averageParsed[c].average)));this.sendMessage("RENDERED",{type:"average",data:i})}}},{key:"requestData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data.last.offset,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.data.last.end,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.data.last.resolution;!this.params.dataRequestPending&&e>0&&(this.data.last.offset!==t||this.data.last.end!==e||this.data.last.resolution!==n)&&(this.params.dataRequestPending=!0,Object.assign(this.data.last,{offset:t,end:e,resolution:n}),this.sendMessage("REQUEST_DATA",{offset:t,end:e,resolution:n}))}},{key:"setParams",value:function(t){t.candleWidths&&!this.isCandleWidthsTheSame(t.candleWidths)&&Object.assign(this.data,{treeReady:!1,rawBinary:[],rawParsed:[],firstEntry:0,lastResolution:0,start:null,width:null,tree:[]}),Object.assign(this.params,t)}},{key:"isCandleWidthsTheSame",value:function(t){for(var e=0,n=t.length;e<n;e++)if(-1===this.params.candleWidths.indexOf(t[e]))return!1;return!0}},{key:"messageHandler",value:function(t){switch(t.data.task){case"SET_PARAMS":this.setParams(t.data.params),!this.data.averageParsed.length&&Object.keys(this.params.fileSizes).length>0&&this.params.resolutions.length>0&&this.params.fileSizes[this.params.resolutions[this.params.resolutions.length-1]]>0&&this.params.packetSize&&!this.params.dataRequestPending?this.initialLoading(this.params.resolutions[this.params.resolutions.length-1]):!this.data.averageParsed.length&&Object.keys(this.params.fileSizes).length>0&&this.params.resolutions.length>0&&-1===this.params.fileSizes[this.params.resolutions[this.params.resolutions.length-1]]&&this.sendMessage("EMPTY");break;case"APPEND":this.append(t.data.data);break;case"RENDER":var e=t.data.params;switch(e.type){case"average":this.renderAverage(e.viewWidth,e.viewHeight);break;case"candles":this.renderCandles(e.offset,e.exposition,e.viewWidth,e.viewHeight);break;default:break}break;case"RELOAD":this.returnEmptyData(),this.params.empty=!1,this.resetData(),this.requestInitialParams();break;default:break}}},{key:"sendMessage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;postMessage({type:t,body:e})}}]),t}(),c=new u;onmessage=function(t){c.messageHandler(t)}},dcbc:function(t,e,n){var r=n("2aba");t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},e11e:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},e853:function(t,e,n){var r=n("d3f4"),i=n("1169"),a=n("2b4c")("species");t.exports=function(t){var e;return i(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&(e=e[a],null===e&&(e=void 0))),void 0===e?Array:e}},ebd6:function(t,e,n){var r=n("cb7c"),i=n("d8e8"),a=n("2b4c")("species");t.exports=function(t,e){var n,o=r(t).constructor;return void 0===o||void 0==(n=r(o)[a])?e:i(n)}},ec30:function(t,e,n){"use strict";if(n("9e1e")){var r=n("2d00"),i=n("7726"),a=n("79e5"),o=n("5ca1"),s=n("0f88"),u=n("ed0b"),c=n("9b43"),f=n("f605"),l=n("4630"),h=n("32e9"),d=n("dcbc"),p=n("4588"),v=n("9def"),g=n("09fa"),y=n("77f1"),m=n("6a99"),b=n("69a8"),w=n("23c6"),P=n("d3f4"),x=n("4bf8"),S=n("33a4"),E=n("2aeb"),O=n("38fd"),k=n("9093").f,A=n("27ee"),T=n("ca5a"),L=n("2b4c"),_=n("0a49"),M=n("c366"),j=n("ebd6"),R=n("cadf"),I=n("84f2"),D=n("5cc5"),F=n("7a56"),N=n("36bd"),W=n("ba92"),C=n("86cc"),U=n("11e9"),V=C.f,B=U.f,z=i.RangeError,q=i.TypeError,G=i.Uint8Array,H="ArrayBuffer",Y="Shared"+H,Q="BYTES_PER_ELEMENT",J="prototype",K=Array[J],X=u.ArrayBuffer,Z=u.DataView,$=_(0),tt=_(2),et=_(3),nt=_(4),rt=_(5),it=_(6),at=M(!0),ot=M(!1),st=R.values,ut=R.keys,ct=R.entries,ft=K.lastIndexOf,lt=K.reduce,ht=K.reduceRight,dt=K.join,pt=K.sort,vt=K.slice,gt=K.toString,yt=K.toLocaleString,mt=L("iterator"),bt=L("toStringTag"),wt=T("typed_constructor"),Pt=T("def_constructor"),xt=s.CONSTR,St=s.TYPED,Et=s.VIEW,Ot="Wrong length!",kt=_(1,function(t,e){return Mt(j(t,t[Pt]),e)}),At=a(function(){return 1===new G(new Uint16Array([1]).buffer)[0]}),Tt=!!G&&!!G[J].set&&a(function(){new G(1).set({})}),Lt=function(t,e){var n=p(t);if(n<0||n%e)throw z("Wrong offset!");return n},_t=function(t){if(P(t)&&St in t)return t;throw q(t+" is not a typed array!")},Mt=function(t,e){if(!(P(t)&&wt in t))throw q("It is not a typed array constructor!");return new t(e)},jt=function(t,e){return Rt(j(t,t[Pt]),e)},Rt=function(t,e){var n=0,r=e.length,i=Mt(t,r);while(r>n)i[n]=e[n++];return i},It=function(t,e,n){V(t,e,{get:function(){return this._d[n]}})},Dt=function(t){var e,n,r,i,a,o,s=x(t),u=arguments.length,f=u>1?arguments[1]:void 0,l=void 0!==f,h=A(s);if(void 0!=h&&!S(h)){for(o=h.call(s),r=[],e=0;!(a=o.next()).done;e++)r.push(a.value);s=r}for(l&&u>2&&(f=c(f,arguments[2],2)),e=0,n=v(s.length),i=Mt(this,n);n>e;e++)i[e]=l?f(s[e],e):s[e];return i},Ft=function(){var t=0,e=arguments.length,n=Mt(this,e);while(e>t)n[t]=arguments[t++];return n},Nt=!!G&&a(function(){yt.call(new G(1))}),Wt=function(){return yt.apply(Nt?vt.call(_t(this)):_t(this),arguments)},Ct={copyWithin:function(t,e){return W.call(_t(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return nt(_t(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return N.apply(_t(this),arguments)},filter:function(t){return jt(this,tt(_t(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return rt(_t(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return it(_t(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){$(_t(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return ot(_t(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return at(_t(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return dt.apply(_t(this),arguments)},lastIndexOf:function(t){return ft.apply(_t(this),arguments)},map:function(t){return kt(_t(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return lt.apply(_t(this),arguments)},reduceRight:function(t){return ht.apply(_t(this),arguments)},reverse:function(){var t,e=this,n=_t(e).length,r=Math.floor(n/2),i=0;while(i<r)t=e[i],e[i++]=e[--n],e[n]=t;return e},some:function(t){return et(_t(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return pt.call(_t(this),t)},subarray:function(t,e){var n=_t(this),r=n.length,i=y(t,r);return new(j(n,n[Pt]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?r:y(e,r))-i))}},Ut=function(t,e){return jt(this,vt.call(_t(this),t,e))},Vt=function(t){_t(this);var e=Lt(arguments[1],1),n=this.length,r=x(t),i=v(r.length),a=0;if(i+e>n)throw z(Ot);while(a<i)this[e+a]=r[a++]},Bt={entries:function(){return ct.call(_t(this))},keys:function(){return ut.call(_t(this))},values:function(){return st.call(_t(this))}},zt=function(t,e){return P(t)&&t[St]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},qt=function(t,e){return zt(t,e=m(e,!0))?l(2,t[e]):B(t,e)},Gt=function(t,e,n){return!(zt(t,e=m(e,!0))&&P(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?V(t,e,n):(t[e]=n.value,t)};xt||(U.f=qt,C.f=Gt),o(o.S+o.F*!xt,"Object",{getOwnPropertyDescriptor:qt,defineProperty:Gt}),a(function(){gt.call({})})&&(gt=yt=function(){return dt.call(this)});var Ht=d({},Ct);d(Ht,Bt),h(Ht,mt,Bt.values),d(Ht,{slice:Ut,set:Vt,constructor:function(){},toString:gt,toLocaleString:Wt}),It(Ht,"buffer","b"),It(Ht,"byteOffset","o"),It(Ht,"byteLength","l"),It(Ht,"length","e"),V(Ht,bt,{get:function(){return this[St]}}),t.exports=function(t,e,n,u){u=!!u;var c=t+(u?"Clamped":"")+"Array",l="get"+t,d="set"+t,p=i[c],y=p||{},m=p&&O(p),b=!p||!s.ABV,x={},S=p&&p[J],A=function(t,n){var r=t._d;return r.v[l](n*e+r.o,At)},T=function(t,n,r){var i=t._d;u&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[d](n*e+i.o,r,At)},L=function(t,e){V(t,e,{get:function(){return A(this,e)},set:function(t){return T(this,e,t)},enumerable:!0})};b?(p=n(function(t,n,r,i){f(t,p,c,"_d");var a,o,s,u,l=0,d=0;if(P(n)){if(!(n instanceof X||(u=w(n))==H||u==Y))return St in n?Rt(p,n):Dt.call(p,n);a=n,d=Lt(r,e);var y=n.byteLength;if(void 0===i){if(y%e)throw z(Ot);if(o=y-d,o<0)throw z(Ot)}else if(o=v(i)*e,o+d>y)throw z(Ot);s=o/e}else s=g(n),o=s*e,a=new X(o);h(t,"_d",{b:a,o:d,l:o,e:s,v:new Z(a)});while(l<s)L(t,l++)}),S=p[J]=E(Ht),h(S,"constructor",p)):a(function(){p(1)})&&a(function(){new p(-1)})&&D(function(t){new p,new p(null),new p(1.5),new p(t)},!0)||(p=n(function(t,n,r,i){var a;return f(t,p,c),P(n)?n instanceof X||(a=w(n))==H||a==Y?void 0!==i?new y(n,Lt(r,e),i):void 0!==r?new y(n,Lt(r,e)):new y(n):St in n?Rt(p,n):Dt.call(p,n):new y(g(n))}),$(m!==Function.prototype?k(y).concat(k(m)):k(y),function(t){t in p||h(p,t,y[t])}),p[J]=S,r||(S.constructor=p));var _=S[mt],M=!!_&&("values"==_.name||void 0==_.name),j=Bt.values;h(p,wt,!0),h(S,St,c),h(S,Et,!0),h(S,Pt,p),(u?new p(1)[bt]==c:bt in S)||V(S,bt,{get:function(){return c}}),x[c]=p,o(o.G+o.W+o.F*(p!=y),x),o(o.S,c,{BYTES_PER_ELEMENT:e}),o(o.S+o.F*a(function(){y.of.call(p,1)}),c,{from:Dt,of:Ft}),Q in S||h(S,Q,e),o(o.P,c,Ct),F(c),o(o.P+o.F*Tt,c,{set:Vt}),o(o.P+o.F*!M,c,Bt),r||S.toString==gt||(S.toString=gt),o(o.P+o.F*a(function(){new p(1).slice()}),c,{slice:Ut}),o(o.P+o.F*(a(function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()})||!a(function(){S.toLocaleString.call([1,2])})),c,{toLocaleString:Wt}),I[c]=M?_:j,r||M||h(S,mt,j)}}else t.exports=function(){}},ed0b:function(t,e,n){"use strict";var r=n("7726"),i=n("9e1e"),a=n("2d00"),o=n("0f88"),s=n("32e9"),u=n("dcbc"),c=n("79e5"),f=n("f605"),l=n("4588"),h=n("9def"),d=n("09fa"),p=n("9093").f,v=n("86cc").f,g=n("36bd"),y=n("7f20"),m="ArrayBuffer",b="DataView",w="prototype",P="Wrong length!",x="Wrong index!",S=r[m],E=r[b],O=r.Math,k=r.RangeError,A=r.Infinity,T=S,L=O.abs,_=O.pow,M=O.floor,j=O.log,R=O.LN2,I="buffer",D="byteLength",F="byteOffset",N=i?"_b":I,W=i?"_l":D,C=i?"_o":F;function U(t,e,n){var r,i,a,o=new Array(n),s=8*n-e-1,u=(1<<s)-1,c=u>>1,f=23===e?_(2,-24)-_(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for(t=L(t),t!=t||t===A?(i=t!=t?1:0,r=u):(r=M(j(t)/R),t*(a=_(2,-r))<1&&(r--,a*=2),t+=r+c>=1?f/a:f*_(2,1-c),t*a>=2&&(r++,a/=2),r+c>=u?(i=0,r=u):r+c>=1?(i=(t*a-1)*_(2,e),r+=c):(i=t*_(2,c-1)*_(2,e),r=0));e>=8;o[l++]=255&i,i/=256,e-=8);for(r=r<<e|i,s+=e;s>0;o[l++]=255&r,r/=256,s-=8);return o[--l]|=128*h,o}function V(t,e,n){var r,i=8*n-e-1,a=(1<<i)-1,o=a>>1,s=i-7,u=n-1,c=t[u--],f=127&c;for(c>>=7;s>0;f=256*f+t[u],u--,s-=8);for(r=f&(1<<-s)-1,f>>=-s,s+=e;s>0;r=256*r+t[u],u--,s-=8);if(0===f)f=1-o;else{if(f===a)return r?NaN:c?-A:A;r+=_(2,e),f-=o}return(c?-1:1)*r*_(2,f-e)}function B(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function z(t){return[255&t]}function q(t){return[255&t,t>>8&255]}function G(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function H(t){return U(t,52,8)}function Y(t){return U(t,23,4)}function Q(t,e,n){v(t[w],e,{get:function(){return this[n]}})}function J(t,e,n,r){var i=+n,a=d(i);if(a+e>t[W])throw k(x);var o=t[N]._b,s=a+t[C],u=o.slice(s,s+e);return r?u:u.reverse()}function K(t,e,n,r,i,a){var o=+n,s=d(o);if(s+e>t[W])throw k(x);for(var u=t[N]._b,c=s+t[C],f=r(+i),l=0;l<e;l++)u[c+l]=f[a?l:e-l-1]}if(o.ABV){if(!c(function(){S(1)})||!c(function(){new S(-1)})||c(function(){return new S,new S(1.5),new S(NaN),S.name!=m})){S=function(t){return f(this,S),new T(d(t))};for(var X,Z=S[w]=T[w],$=p(T),tt=0;$.length>tt;)(X=$[tt++])in S||s(S,X,T[X]);a||(Z.constructor=S)}var et=new E(new S(2)),nt=E[w].setInt8;et.setInt8(0,2147483648),et.setInt8(1,2147483649),!et.getInt8(0)&&et.getInt8(1)||u(E[w],{setInt8:function(t,e){nt.call(this,t,e<<24>>24)},setUint8:function(t,e){nt.call(this,t,e<<24>>24)}},!0)}else S=function(t){f(this,S,m);var e=d(t);this._b=g.call(new Array(e),0),this[W]=e},E=function(t,e,n){f(this,E,b),f(t,S,b);var r=t[W],i=l(e);if(i<0||i>r)throw k("Wrong offset!");if(n=void 0===n?r-i:h(n),i+n>r)throw k(P);this[N]=t,this[C]=i,this[W]=n},i&&(Q(S,D,"_l"),Q(E,I,"_b"),Q(E,D,"_l"),Q(E,F,"_o")),u(E[w],{getInt8:function(t){return J(this,1,t)[0]<<24>>24},getUint8:function(t){return J(this,1,t)[0]},getInt16:function(t){var e=J(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=J(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return B(J(this,4,t,arguments[1]))},getUint32:function(t){return B(J(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return V(J(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return V(J(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){K(this,1,t,z,e)},setUint8:function(t,e){K(this,1,t,z,e)},setInt16:function(t,e){K(this,2,t,q,e,arguments[2])},setUint16:function(t,e){K(this,2,t,q,e,arguments[2])},setInt32:function(t,e){K(this,4,t,G,e,arguments[2])},setUint32:function(t,e){K(this,4,t,G,e,arguments[2])},setFloat32:function(t,e){K(this,4,t,Y,e,arguments[2])},setFloat64:function(t,e){K(this,8,t,H,e,arguments[2])}});y(S,m),y(E,b),s(E[w],o.VIEW,!0),e[m]=S,e[b]=E},f605:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},f751:function(t,e,n){var r=n("5ca1");r(r.S+r.F,"Object",{assign:n("7333")})},fab2:function(t,e,n){var r=n("7726").document;t.exports=r&&r.documentElement}});