function cfg(){return{supports_search:false,supports_group_request:false,supported_resolutions:['1','3','5','10','15','30','60','120','240','D','W','M'],supports_marks:false,has_weekly_and_monthly:true,supports_timescale_marks:false,session: "0000-2359",minmov:1,pricescale:100000,timezone:"America/New_York"}}var dfb=(function(){var sd=0,_cursym="",_curp="";cp=function(s){switch(s){case"1":{return"1M"}case"3":{return"3M"}case"5":{return"5M"}case"10":{return"10M"}case"15":{return"15M"}case"30":{return"30M"}case"60":{return"1H"}case"120":{return"2H"}case"240":{return"4H"}case"D":{return"D"}case"W":{return"W"}case"M":{return"M"}default:return s}};function dfb(sb,sms){var _this=this;this._conf=cfg();this._lstb=null;this._cb=sb;this._lstcb=null;this._symss=sms;this._ldcmp=false;this.dispose=function(){KKE.api("datas.ecdv2.cc")};this.pause=function(){KKE.api("datas.ecdv2.cc")};this._requestConfiguration=function(){return new Promise((sol,rej)=>{sol(null)})};this._configurationReadyPromise=this._requestConfiguration().then(function(data){if(data===null){data=new cfg()}_this._setupWithConfiguration(data)});this.onReady=function(cb){var _this=this;this._configurationReadyPromise.then(function(){cb(_this._conf)})};this.getQuotes=function(sym,db,eb){};this.subscribeQuotes=function(s,ss,cb,guid){};this.unsubscribeQuotes=function(guid){};this.calculateHistoryDepth=function(p,pb,ib){};this.getMarks=function(sinfo,st,ed,cb,p){};this.getTimescaleMarks=function(sinfo,st,ed,cb,p){};this.getServerTime=function(cb){cb((new Date()).getTime()/1000)};this.searchSymbols=function(inp,ex,t,cb){cb([])};this.resolveSymbol=function(sn,cb,eb){var _this=this;if(sd==0){sd=1;_this._cursym=sn;_this._curp="";KKE.api("datas.ecdv2.rsi",sn,function(d){if(d.c==0){d.d.name=decodeURIComponent(d.d.name);if(cb){cb(d.d)}}sd=0})}};this.syncChart=function(d){var _this=this;if(_this._lstcb){if(d.time<=0){d.time=_this.lstb.time}if(d.open<=0){d.open=_this.lstb.open}if(d.close<=0){d.close=_this.lstb.close}if(d.high<=0){d.high=_this.lstb.high}if(d.low<=0){d.low=_this.lstb.low}if(d.volume<=0){d.volume=_this.lstb.volume}if(_this.lstb.time<=d.time){_this._lstcb(d)}}};this.getBars=function(sinfo,p,st,ed,cb,eb){var _this=this;_this._cbc=cb;var mt={noData:true};function gochart(this_,sinfo,p,eb){KKE.api("datas.ecdv2.chart",[sinfo.ticker,cp(p),1],function(d){if(d.c==0){var b=[];for(var i=0;i<d.d.length;i++){var m=d.d[i];var bv={time:(new Date(m.d.replace(/-/g,"/"))).getTime(),close:Number(m.c),open:Number(m.o),high:Number(m.h),low:Number(m.l),volume:Number(m.v)};if(!isNaN(bv.close))b.push(bv)}if(d.t==5){if(this_._lstcb){var ml=(b.length>3?3:b.length);if(ml>0){for(j=(b.length-ml);j<b.length;j++){if(this_.lstb==undefined||this_.lstb.time<=b[j].time){this_._lstcb(b[j])}}}}this_._ldcmp=true}else if(d.t==4){if(this_._cbc){if(b.length>0)this_._cbc(b);else eb(d)}}if(b.length>0){var temp=(this_.lstb==undefined?0:this_.lstb.close);this_.lstb=b[b.length-1]}}else{if(eb){eb(d)}}})};if(typeof(sinfo)=="undefined"||sinfo==null){sinfo={ticker:_this._cursym}}if(typeof(sinfo.ticker)=="undefined"||sinfo.ticker==null||sinfo.ticker==""){sinfo.ticker=_this._cursym}if(_this._cursym!=sinfo.ticker||_this._curp!=p){_this._cursym=sinfo.ticker;if(_this._curp!=""){}else{KKE.api("datas.ecdv2.wsst",function(std){if(std==1){_this._curp=p;_this._ldcmp=false;setTimeout(function(){gochart(_this,sinfo,p,eb)},500)}KKE.api("datas.ecdv2.wssub",[_this._symss],function(d){if(d.c==0){if(_this._cb!=undefined){_this._cb(d.d)}if(d.d.fsymbol==_this._cursym&&_this.lstb!=null){if(_this._ldcmp){var temp=(_this.lstb==undefined?0:_this.lstb.close);_this.lstb.close=d.d.price;if(_this._lstcb){_this._lstcb(_this.lstb)}}}}else if(d.c==1){_this._curp=p;_this._ldcmp=false;setTimeout(function(){gochart(_this,sinfo,p,eb)},1000)}})});return}_this._curp=p;_this._ldcmp=false;gochart(_this,sinfo,p,eb)}else if(cb){cb([],mt)}};this.subscribeBars=function(sinfo,p,cb,guid,rb){var _this=this;_this._lstcb=cb};this.unsubscribeBars=function(guid){};this._setupWithConfiguration=function(data){if(data.exchanges===undefined){data.exchanges=[]}this._conf=data}}return dfb}());var df=(function(_super){function df(wb,sms){var _this=this;_this=_super.call(this,wb,sms)||this;return _this}return df}(dfb));