Socket
Socket
Sign inDemoInstall

react-tradingview-wrapper

Package Overview
Dependencies
8
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.6

2

dist/index.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-tradingview-wrapper"]=t():e["react-tradingview-wrapper"]=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpreact_tradingview_wrapper([1],{1:function(e,t,i){"use strict";function o(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"IntervalTypes",function(){return u}),i.d(t,"Themes",function(){return m}),i.d(t,"BarStyles",function(){return y});var a=i(2),d=i.n(a),l=i(6),h=i.n(l),c=i(10),p=i.n(c),g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},u={D:"D",W:"W"},m={LIGHT:"Light",DARK:"Dark"},y={BARS:"0",CANDLES:"1",HOLLOW_CANDLES:"9",HEIKIN_ASHI:"8",LINE:"2",AREA:"3",RENKO:"4",LINE_BREAK:"7",KAGI:"5",POINT_AND_FIGURE:"6"},f="tradingview-widget-script",b="tradingview-widget",w=function(e){function t(){var e,i,s,a;n(this,t);for(var l=arguments.length,h=Array(l),c=0;c<l;c++)h[c]=arguments[c];return i=s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(h))),s.state={containerStyle:{}},s.componentDidMount=function(){return s.appendScript(s.initWidget)},s.componentDidUpdate=function(){s.cleanWidget(),s.initWidget()},s.appendScript=function(e){if(s.scriptExists())return void e();var t=document.createElement("script");t.id=f,t.type="text/javascript",t.async=!0,t.src=p.a,t.onload=e,document.getElementsByTagName("head")[0].appendChild(t)},s.scriptExists=function(){return null!==document.getElementById(f)},s.initWidget=function(){var e=s.props,t=e.widgetType,i=o(e,["widgetType"]),n=g({},i,{container_id:b});if(n.autosize){delete n.width,delete n.height;var r=document.getElementById(b);r.style.width="100%",r.style.height="100%"}"number"==typeof n.interval&&(n.interval=n.interval.toString()),n.popup_width&&"number"==typeof n.popup_width&&(n.popup_width=n.popup_width.toString()),n.popup_height&&"number"==typeof n.popup_height&&(n.popup_height=n.popup_height.toString()),new TradingView[t](n)},s.cleanWidget=function(){document.getElementById(b).innerHTML=""},s.render=function(){return d.a.createElement("article",{id:b})},a=i,r(s,a)}return s(t,e),t}(a.PureComponent);w.propTypes={widgetType:h.a.string,width:h.a.number,height:h.a.number,autosize:h.a.bool,symbol:h.a.string.isRequired,interval:h.a.oneOf([1,3,5,15,30,60,120,180,"1","3","5","15","30","60","120","180",u.D,u.W]),timezone:h.a.string,theme:h.a.oneOf([m.LIGHT,m.DARK]),style:h.a.oneOf([y.BARS,y.CANDLES,y.HOLLOW_CANDLES,y.HEIKIN_ASHI,y.LINE,y.AREA,y.RENKO,y.LINE_BREAK,y.KAGI,y.POINT_AND_FIGURE]),locale:h.a.string,toolbar_bg:h.a.string,enable_publishing:h.a.bool,allow_symbol_change:h.a.bool,withdateranges:h.a.bool,hide_side_toolbar:h.a.bool,hideideas:h.a.bool,watchlist:h.a.arrayOf(h.a.string),details:h.a.bool,hotlist:h.a.bool,calendar:h.a.bool,news:h.a.arrayOf(h.a.string),studies:h.a.arrayOf(h.a.string),show_popup_button:h.a.bool,popup_width:h.a.oneOfType([h.a.number,h.a.string]),popup_height:h.a.oneOfType([h.a.number,h.a.string]),no_referral_id:h.a.bool,referral_id:h.a.string},w.defaultProps={widgetType:"widget",width:980,height:610,autosize:!1,interval:u.D,timezone:"Etc/UTC",theme:m.LIGHT,style:y.CANDLES,locale:"en",toolbar_bg:"#F1F3F6",enable_publishing:!1,allow_symbol_change:!0,hideideas:!0},t.default=w},10:function(e,t,i){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){if(!window.TradingView||!window.TradingView.host||window.TradingView.reoloadTvjs){var e={host:null==window.location.host.match(/tradingview\.com|pyrrosinvestment\.com/i)?"https://s.tradingview.com":"https://www.tradingview.com",ideasHost:"https://www.tradingview.com",chatHost:"https://www.tradingview.com",gEl:function(e){return document.getElementById(e)},gId:function(){return"tradingview_"+(1048576*(1+Math.random())|0).toString(16).substring(1)},onready:function(e){window.addEventListener?window.addEventListener("DOMContentLoaded",e,!1):window.attachEvent("onload",e)},css:function(e){var t,i=document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",o.styleSheet?o.styleSheet.cssText=e:(t=document.createTextNode(e),o.appendChild(t)),i.appendChild(o)},bindEvent:function(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on"+t,i)},unbindEvent:function(e,t,i){e.removeEventListener?e.removeEventListener(t,i,!1):e.detachEvent&&e.detachEvent("on"+t,i)},cloneSimpleObject:function(e){if(null==e||"object"!=(void 0===e?"undefined":o(e)))return e;var t=e.constructor();for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},isMobileDevice:function(){var e={Android:/Android/i.test(navigator.userAgent),BlackBerry:/BlackBerry/i.test(navigator.userAgent),iOS:/iPhone|iPad|iPod/i.test(navigator.userAgent),Opera:/Opera Mini/i.test(navigator.userAgent)};return e.any=e.Android||e.BlackBerry||e.iOS||e.Opera,e}(),generateUtmForUrlParams:function(e){return"utm_source="+encodeURI(window.location.hostname)+"&utm_medium=widget"+(e.type?"&utm_campaign="+e.type:"")+(e.type&&"chart"===e.type?"&utm_term="+encodeURIComponent(e.symbol):"")},WidgetAbstract:function(){},MiniWidget:function(t){this.id=e.gId(),this.options={whitelabel:t.whitelabel||"",width:e.WidgetAbstract.prototype.fixSize(t.width)||300,height:e.WidgetAbstract.prototype.fixSize(t.height)||400,symbols:t.symbols,tabs:t.tabs||"",symbols_description:t.symbols_description||"",customer:t.customer||"",container:t.container_id||"",greyText:t.greyText||"",large_chart_url:t.large_chart_url||"",large_chart_target:t.large_chart_target||"",gridLineColor:t.gridLineColor||"",fontColor:t.fontColor||"",underLineColor:t.underLineColor||"",trendLineColor:t.trendLineColor||"",timeAxisBackgroundColor:t.timeAxisBackgroundColor||"",activeTickerBackgroundColor:t.activeTickerBackgroundColor||"",noGraph:t.noGraph||!1,locale:t.locale,styleTickerActiveBg:t.styleTickerActiveBg||"",styleTabActiveBorderColor:t.styleTabActiveBorderColor||"",styleTickerBodyFontSize:t.styleTickerBodyFontSize||"",styleTickerBodyFontWeight:t.styleTickerBodyFontWeight||"",styleTickerHeadFontSize:t.styleTickerHeadFontSize||"",styleTickerHeadFontWeight:t.styleTickerHeadFontWeight||"",styleTickerChangeDownColor:t.styleTickerChangeDownColor||"",styleTickerChangeUpColor:t.styleTickerChangeUpColor||"",styleTickerLastDownBg:t.styleTickerLastDownBg||"",styleTickerLastUpBg:t.styleTickerLastUpBg||"",styleTickerSymbolColor:t.styleTickerSymbolColor||"",styleTickerSymbolHoverTextDecoration:t.styleTickerSymbolHoverTextDecoration||"",styleTickerActiveSymbolTextDecoration:t.styleTickerActiveSymbolTextDecoration||"",styleTabsActiveBorderColor:t.styleTabsActiveBorderColor||"",styleTabsNoBorder:t.styleTabsNoBorder||"",styleWidgetNoBorder:t.styleWidgetNoBorder||""},this.createWidget()},MediumWidget:function(t){this.id=e.gId(),this.options={container:t.container_id||"",width:e.WidgetAbstract.prototype.fixSize(t.width)||"",height:e.WidgetAbstract.prototype.fixSize(t.height)||"",symbols:t.symbols,greyText:t.greyText||"",symbols_description:t.symbols_description||"",large_chart_url:t.large_chart_url||"",customer:t.customer||"",gridLineColor:t.gridLineColor||"",fontColor:t.fontColor||"",underLineColor:t.underLineColor||"",trendLineColor:t.trendLineColor||"",timeAxisBackgroundColor:t.timeAxisBackgroundColor||"",chartOnly:!!t.chartOnly,locale:t.locale,whitelabel:!!t.whitelabel||""},this.createWidget()},widget:function(t){this.id=e.gId();var i=e.getUrlParams(),o=t.tvwidgetsymbol||i.tvwidgetsymbol||i.symbol||t.symbol||"NASDAQ:AAPL",n=t.logo||"";if(n.src&&(n=n.src),n&&n.replace(".png",""),this.options={whitelabel:t.whitelabel||"",width:t.width||800,height:t.height||500,symbol:o,interval:t.interval||"1",range:t.range||"",timezone:t.timezone||"",autosize:t.autosize,hide_top_toolbar:t.hide_top_toolbar,hide_side_toolbar:t.hide_side_toolbar,allow_symbol_change:t.allow_symbol_change,save_image:void 0===t.save_image||t.save_image,container:t.container_id||"",toolbar_bg:t.toolbar_bg||"f4f7f9",watchlist:t.watchlist||[],editablewatchlist:!!t.editablewatchlist,studies:t.studies||[],theme:t.theme||"",style:t.style||"",extended_hours:void 0===t.extended_hours?void 0:+t.extended_hours,details:!!t.details,news:!!t.news,calendar:!!t.calendar,hotlist:!!t.hotlist,hideideas:!!t.hideideas,hideideasbutton:!!t.hideideasbutton,widgetbar_width:+t.widgetbar_width||void 0,withdateranges:t.withdateranges||"",customer:t.customer||n||"",venue:t.venue,symbology:t.symbology,logo:n,show_popup_button:!!t.show_popup_button,popup_height:t.popup_height||"",popup_width:t.popup_width||"",studies_overrides:t.studies_overrides,overrides:t.overrides,enabled_features:t.enabled_features,disabled_features:t.disabled_features,publish_source:t.publish_source||"",enable_publishing:t.enable_publishing,idea_url:t.idea_url,whotrades:t.whotrades||void 0,locale:t.locale,referral_id:t.referral_id,no_referral_id:t.no_referral_id,ref_landing_page:t.ref_landing_page,fundamental:t.fundamental,percentage:t.percentage,hidevolume:t.hidevolume,padding:t.padding,greyText:t.greyText||""},t.cme&&(this.options.customer="cme"),t.news&&t.news.length){this.options.news_vendors=[];for(var r=0;r<t.news.length;r++)switch(t.news[r]){case"headlines":case"stocktwits":this.options.news_vendors.push(t.news[r])}this.options.news_vendors||delete this.options.news_vendors}isFinite(t.widgetbar_width)&&t.widgetbar_width>0&&(this.options.widgetbar_width=t.widgetbar_width),this._ready_handlers=[],this.create()},chart:function(t){this.id=e.gId(),this.is_fullscreen=!1,this.options={width:t.width||640,height:t.height||500,container:t.container_id||"",realtime:t.realtime,chart:t.chart,locale:t.locale,type:"chart",autosize:t.autosize,mobileStatic:t.mobileStatic},this._ready_handlers=[],this.create()},WidgetPopup:function(t){this.id=e.gId(),this.options={callback:"function"==typeof t.callback?t.callback:function(){},width:t.width||800,height:t.height||600,symbol:t.symbol,interval:t.interval||"1",toolbar_bg:t.toolbar_bg||"f4f7f9",theme:t.theme||"",hide_side_toolbar:!!t.hide_side_toolbar,locale:t.locale,type:"chart"},this.create()},EventsWidget:function(t){this.id=e.gId(),this.options={container:t.container_id||"",width:t.width||486,height:t.height||670,currency:t.currencyFilter||"",importance:t.importanceFilter||"",type:"economic-calendar"},this.createWidget(t)},IdeasStreamWidget:function(t){this.id=e.gId(),this.options={container:t.container_id||"",width:t.width||486,height:t.height||670,symbol:t.symbol||"",username:t.username||"",mode:t.mode||"",userProfileUrl:t.userProfileUrl||"",ideaUrl:t.ideaUrl||"",publishSource:t.publishSource||"",sort:t.sort||"trending",stream:t.stream,interval:t.interval,time:t.time,waitSymbol:t.waitSymbol,hideDescription:t.hideDescription,startingCount:t.startingCount,bgColor:t.bgColor||"",headerColor:t.headerColor||"",borderColor:t.borderColor||"",locale:t.locale,type:"ideas-stream"},this._ready_handlers=[],this.createWidget(t)},IdeaWidget:function(t){this.id=e.gId(),this.options={container:t.container_id||"",width:t.width||486,height:t.height||670,idea:t.idea||"",userProfileUrl:t.userProfileUrl||"",chartUrl:t.chartUrl||"",whotrades:t.whotrades||void 0,locale:t.locale,type:"idea"},this.createWidget(t)},ChatWidgetEmbed:function(t){this.id=e.gId(),this.options={container:t.container_id||"",width:t.width||400,height:t.height||500,room:t.room||"",whotrades:t.whotrades||void 0,locale:t.locale,type:"chat-embed"},this.createWidget(t)},UserInfoWidget:function(e){this.options={container:e.container_id||"",width:e.width||1040,height:e.height||340,username:e.username||"",locale:e.locale,type:"user-info"},this.createWidget(e)},QuotesProvider:function(i){function o(e){var t=e.symbol,i=e.success,o=e.error;t&&i&&o&&(r.post(n.contentWindow,"resolveSymbol",{symbol:t}),i&&r.on("success"+t,function(e){i(e)}),o&&r.on("error"+t,function(e){o(e)}))}var n,r,s=e.gId(),i={container:i.container_id,symbols:i.symbols||[],type:"quotes-provider"},a=e.host+"/embed-quotes-provider/?"+e.generateUtmForUrlParams(i),d='<iframe id="'+s+'" src="'+a+'" width="0" height="0" frameborder="0" allowTransparency="true" scrolling="no"></iframe>';t(d,i.container),n=e.gEl(s),r=e.postMessageWrapper(n.contentWindow,s),e.bindEvent(n,"load",function(){i.symbols.forEach(o)})}};e.DependenciesManager=function(){},e.DependenciesManager.prototype.scripts={},e.DependenciesManager.prototype._loaded=function(e){for(var t in this.scripts[e].callbacks)this.scripts[e].callbacks[t]();this.scripts[e].status=!0,this.scripts[e].callbacks={}},e.DependenciesManager.prototype.depends=function(t,i,o){for(var n=0;n<t.length;n++)this.scripts[t[n]]&&!0===this.scripts[t[n]].status?o():this.scripts[t[n]]&&!1===this.scripts[t[n]].status?this.scripts[t[n]].callbacks[i]=o:(this.scripts[t[n]]={status:!1,script:document.createElement("script"),callbacks:{}},this.scripts[t[n]].callbacks[i]=o,this.scripts[t[n]].script.onload=this._loaded.bind(this,t[n]),this.scripts[t[n]].script.src=e.host+t[n],document.body.appendChild(this.scripts[t[n]].script))},e.dependenciesManager=new e.DependenciesManager,e.WidgetAbstract.prototype={fixSize:function(e){return/^[0-9]+(\.|,[0-9])*$/.test(e)?e+"px":e},width:function(){return this.options.autosize?"100%":e.WidgetAbstract.prototype.fixSize(this.options.width)},height:function(){return this.options.autosize?"100%":e.WidgetAbstract.prototype.fixSize(this.options.height)},addWrapperFrame:function(t,i,o){var n=e.WidgetAbstract.prototype.height.call(this),r=e.WidgetAbstract.prototype.width.call(this),o=o||"transparent";return'<div id="'+this.id+'-wrapper" style="position: relative;box-sizing: content-box;width: '+r+";height: "+n+';margin: 0 auto !important;padding: 0 !important;font-family:Arial,sans-serif;"><div style="width: '+r+";height: "+n+";background: "+o+';padding: 0 !important;">'+t+"</div>"+(i||"")+"</div>"},addFooterLogo:function(t,i){var o=(i||{}).greyText||"powered by",n=(i||{}).linkText||"tradingview.com",r=(i||{}).href||"https://www.tradingview.com/";return e.WidgetAbstract.prototype.addWrapperFrame.call(this,t,'<div style="position:absolute;display: block;box-sizing: content-box;height: 24px;width: '+e.WidgetAbstract.prototype.width.call(this)+';bottom: 0;left: 0;margin: 0;padding: 0;font-family: Arial,sans-serif;"><div style="display: block;margin: 0 1px 1px 1px;line-height: 7px;box-sizing: content-box;height: 11px;padding: 6px 10px;text-align: right;background: #fff;"><a href="'+r+"?"+e.generateUtmForUrlParams(this.options)+'" target="_blank" style="color: #0099d4;text-decoration: none;font-size: 11px;"><span style="color: #b4b4b4;font-size: 11px;">'+o+"</span> "+n+"</a></div></div>","#fff")}},e.UserInfoWidget.prototype={createWidget:function(){var e=this.widgetCode();t(e,this.options.container)},widgetCode:function(){var t=e.createUrlParams({username:this.options.username,locale:this.options.locale});this.options.type="user-info";var i="&"+e.generateUtmForUrlParams(this.options,{type:"UserInfoWidget"});return'<iframe src="'+e.ideasHost+"/user-info-widget/?"+t+i+'"'+(this.options.width?' width="'+this.options.width+'"':"")+(this.options.height?' height="'+this.options.height+'"':"")+' frameborder="0" allowTransparency="true" scrolling="no"></iframe>'}},e.ChatWidgetEmbed.prototype={createWidget:function(){var i=this.widgetCode();i=e.WidgetAbstract.prototype.addFooterLogo.call(this,i),t(i,this.options.container)},widgetCode:function(){var t=this.options.room?"#"+encodeURIComponent(this.options.room):"",i="&"+e.createUrlParams({whotrades:this.options.whotrades,locale:this.options.locale}),o=e.generateUtmForUrlParams(this.options,{type:"UserInfoWidget"});return'<iframe src="'+e.chatHost+"/chatwidgetembed/?"+o+i+t+'"'+(this.options.width?' width="'+this.options.width+'"':"")+(this.options.height?' height="'+this.options.height+'"':"")+' frameborder="0" allowTransparency="true" scrolling="no"></iframe>'}},e.IdeaWidget.prototype={createWidget:function(){var i=this.widgetCode();t(i,this.options.container);var o=this,n=e.gEl(this.id);this.postMessage=e.postMessageWrapper(n.contentWindow,this.id),this.postMessage.on("resize",function(e){e.id===o.id&&(n.style.height=e.height+"px")},!0)},widgetCode:function(){var t=e.createUrlParams({id:this.id,width:this.options.width,height:this.options.height,idea:this.options.idea,profile_url:this.options.userProfileUrl,chart_url:this.options.chartUrl,whotrades:this.options.whotrades,locale:this.options.locale});this.options.type="idea";var i="&"+e.generateUtmForUrlParams(this.options),o=e.ideasHost+"/idea-popup/?"+t+i;return'<iframe id="'+this.id+'" src="'+o+'" width="'+this.options.width+'"'+(this.options.height?' height="'+this.options.height+'"':"")+' frameborder="0" allowTransparency="true" scrolling="no"></iframe>'},getSymbol:function(e){this.postMessage.on("symbolInfo",e)}},e.EventsWidget.prototype={createWidget:function(){var e=this.widgetCode();t(e,this.options.container)},widgetCode:function(){var t=e.createUrlParams({currency:this.options.currency,importance:this.options.importance});this.options.type="events";var i="&"+e.generateUtmForUrlParams(this.options);return'<iframe src="'+e.host+"/eventswidgetembed/?"+t+i+'" width="'+this.options.width+'"'+(this.options.height?' height="'+this.options.height+'"':"")+' frameborder="0" scrolling="no"></iframe>'}},e.IdeasStreamWidget.prototype={createWidget:function(){var i=this.widgetCode();t(i,this.options.container);var o=this,n=e.gEl(this.id);this.postMessage=e.postMessageWrapper(n.contentWindow,this.id),e.bindEvent(n,"load",function(){o._ready=!0;for(var e=o._ready_handlers.length;e--;)o._ready_handlers[e].call(o)}),o.postMessage.on("resize",function(e){if(e.id===o.id){var t=Math.max(e.height,450);n.style.height=t+"px"}},!0)},widgetCode:function(){var t=this.options,i=e.createUrlParams({id:this.id,width:t.width,height:t.height,symbol:t.symbol,username:t.username,mode:t.mode,profile_url:t.userProfileUrl,idea_url:t.ideaUrl,publish_source:t.publishSource,sort:t.sort,stream:t.stream,interval:t.interval,time:t.time,wait_symbol:t.waitSymbol,request_host:e.ideasHost,hide_desc:t.hideDescription,s_count:t.startingCount,bg_color:t.bgColor,h_color:t.headerColor,borderColor:t.borderColor,locale:t.locale}),o=e.generateUtmForUrlParams(this.options)+"&",n=e.host+"/ideaswidgetembed/?"+o+i;return'<iframe id="'+this.id+'" src="'+n+'" width="'+t.width+'"'+(t.height?' height="'+t.height+'"':"")+' frameborder="0" allowTransparency="true" scrolling="no"></iframe>'},setSymbol:function(t){var i=e.gEl(this.id);this.postMessage.post(i.contentWindow,"setSymbol",t)},ready:function(e){this._ready?e.call(this):this._ready_handlers.push(e)}},e.MiniWidget.prototype={createWidget:function(){var i=this.widgetCode(),o=this.options;if(!o.noLogoOverlay&&!o.whitelabel){var n=this.options.greyText||"Quotes by";i=e.WidgetAbstract.prototype.addFooterLogo.call(this,i,{greyText:n,linkText:"TradingView"})}t(i,o.container)},widgetCode:function(){var t="",i="",o="",n="/miniwidgetembed/",r=this.options.width?"&width="+encodeURIComponent(this.options.width):"",s=this.options.height?"&height="+encodeURIComponent(this.options.height):"",a=this.options.noGraph?"&noGraph="+encodeURIComponent(this.options.noGraph):"",d=this.options.locale?"&locale="+encodeURIComponent(this.options.locale):"",l=this.options.whitelabel?"&whitelabel=1":"";this.options.type="market-overview";for(var h="&"+e.generateUtmForUrlParams(this.options),c=["large_chart_url","large_chart_target","gridLineColor","fontColor","underLineColor","trendLineColor","activeTickerBackgroundColor","timeAxisBackgroundColor","locale","styleTickerActiveBg","styleTabActiveBorderColor","styleTickerBodyFontSize","styleTickerBodyFontWeight","styleTickerHeadFontSize","styleTickerHeadFontWeight","styleTickerChangeDownColor","styleTickerChangeUpColor","styleTickerLastDownBg","styleTickerLastUpBg","styleTickerSymbolColor","styleTickerSymbolHoverTextDecoration","styleTickerActiveSymbolTextDecoration","styleTabsActiveBorderColor","styleTabsNoBorder","styleWidgetNoBorder"],p="",g=c.length-1;g>=0;g--){var u=c[g],m=this.options[u];p+=m?"&"+u+"="+encodeURIComponent(m):""}var y=function(t){for(var i=[],n=0;n<t.length;n++){var r=t[n];if(e.isArray(r)){var s=encodeURIComponent(r[0]),a=encodeURIComponent(r[1]);i.push(s),o+="&"+s+"="+a}else"string"==typeof r&&i.push(encodeURIComponent(r))}return i.join(",")};if(this.options.tabs){for(var g=0,f=this.options.tabs.length;g<f;g++){var b=this.options.tabs[g];this.options.symbols[b]&&(t+=(t?"&":"")+encodeURIComponent(b)+"="+y(this.options.symbols[b]))}i="&tabs="+encodeURIComponent(this.options.tabs.join(","))}else this.options.symbols&&(t="symbols="+y(this.options.symbols));if(this.options.symbols_description)for(var w in this.options.symbols_description)o+="&"+encodeURIComponent(w)+"="+encodeURIComponent(this.options.symbols_description[w]);this.options.customer&&(n="/"+this.options.customer+n);var v=e.host+n+"?"+t+i+o+p+r+s+a+d+l+h;return'<iframe id="'+this.id+'" src="'+v+'" width="'+this.options.width+'"'+(this.options.height?' height="'+this.options.height+'"':"")+' frameborder="0" allowTransparency="true" scrolling="no" style="margin: 0 !important; padding: 0 !important;"></iframe>'},remove:function(){var t=e.gEl("tradingview_widget");t.parentNode.removeChild(t)}},e.MediumWidget.prototype={createWidget:function(){var i=this.widgetCode();if(!this.options.noLogoOverlay&&!this.options.whitelabel){var o=this.options.greyText||"Quotes by";i=e.WidgetAbstract.prototype.addFooterLogo.call(this,i,{greyText:o,linkText:"TradingView"})}t(i,this.options.container)},widgetCode:function(){var t="",i="symbols="+function(i){for(var o=[],n=0;n<i.length;n++){var r=i[n];if(e.isArray(r)){var s=encodeURIComponent(r[0]),a=encodeURIComponent(r[1]);o.push(s),t+="&"+s+"="+a}else"string"==typeof r&&o.push(encodeURIComponent(r))}return o.join(",")}(this.options.symbols),o="&width="+encodeURIComponent(this.options.width),n="&height="+encodeURIComponent(this.options.height);this.options.type="symbol-overview";for(var r="&"+e.generateUtmForUrlParams(this.options),s=["gridLineColor","fontColor","underLineColor","trendLineColor","activeTickerBackgroundColor","timeAxisBackgroundColor","locale"],a="",d=s.length-1;d>=0;d--){var l=s[d],h=this.options[l];a+=h?"&"+l+"="+encodeURIComponent(h):""}var c=this.options.chartOnly?"&chartOnly=1":"",p=this.options.whitelabel?"&whitelabel=1":"",g="/mediumwidgetembed/";this.options.customer&&(g="/"+this.options.customer+g);var u=e.host+g+"?"+i+t+a+c+p+o+n+r;return'<iframe id="'+this.id+'" src="'+u+'" style="margin: 0 !important; padding: 0 !important; '+(this.options.width?"width: "+this.options.width+"; ":"")+(this.options.height?"height: "+this.options.height+";":"")+'" frameborder="0" allowTransparency="true" scrolling="no"></iframe>'},remove:function(){var t=e.gEl("tradingview_widget");t.parentNode.removeChild(t)}},e.widget.prototype={create:function(){this.options.type=this.options.fundamental?"fundamental":"chart";var i,o=this.render(),n=this;if(this.options.noLogoOverlay||(o=e.WidgetAbstract.prototype.addWrapperFrame.call(this,o)),t(o,this.options.container),!this.options.noLogoOverlay&&this.options.fundamental){var r=document.getElementById("tradingview-copyright"),s=this.options.greyText||"Fundamental data by {0}";r&&r.parentNode.removeChild(r);var a=document.getElementById(this.id);a.style.paddingBottom="30px",a.style.boxSizing="border-box";var d=document.createElement("a");d.setAttribute("href","http://www.tradingview.com?"+e.generateUtmForUrlParams(this.options)),d.setAttribute("rel","nofollow"),d.setAttribute("target","_blank"),d.style.fontFamily="'Trebuchet MS', Tahoma, Arial, sans-serif",d.style.fontSize="13px",d.style.color="#ADAEB0",d.innerHTML=s.replace("{0}",'<a style="color: #3BB3E4">TradingView</a>');var l=document.createElement("span");l.style.display="block",l.style.position="absolute",l.style.bottom="0",l.style.left="0",l.style.width="100%",l.style.height="30px",l.style.lineHeight="30px",l.style.textAlign="center",l.appendChild(d),a.parentNode.appendChild(l)}i=e.gEl(this.id),this.postMessage=e.postMessageWrapper(i.contentWindow,this.id),e.bindEvent(i,"load",function(){n.postMessage.get("widgetReady",{},function(){var e;for(n._ready=!0,e=n._ready_handlers.length;e--;)n._ready_handlers[e].call(n)})}),n.postMessage.on("logoCreated",function(t){if(t.left&&t.bottom&&t.width&&t.height&&t.href){n._logoOverlay&&(n._logoOverlay.parentNode.removeChild(n._logoOverlay),delete n._logoOverlay);var i=document.createElement("a");t.text&&(i.innerHTML=t.text,i.style.color="transparent"),i.style.position="absolute",i.style.display="inline-block",i.style.left=t.left,i.style.bottom=t.bottom,i.style.width=t.width,i.style.height=t.height,i.style.backgroundColor="transparent",i.style.pointerEvents="none",i.href=t.href,i.setAttribute("target","_blank"),n._logoOverlay=i,e.gEl(n.id+"-wrapper").appendChild(i)}}),n.postMessage.on("setLogoOverlayVisibility",function(e){n._logoOverlay&&e&&"boolean"==typeof e.visible&&(n._logoOverlay.style.display=e.visible?"inline-block":"none")}),n.postMessage.on("openChartInPopup",function(t){for(var i=e.cloneSimpleObject(n.options),o=["symbol","interval"],r=o.length-1;r>=0;r--){var s=o[r],a=t[s];a&&(i[s]=a)}i.show_popup_button=!1;var d=n.options.popup_width||900,l=n.options.popup_height||600,h=(screen.width-d)/2,c=(screen.height-l)/2;window.open(n.generateUrl(i),"_blank","resizable=yes, top="+c+", left="+h+", width="+d+", height="+l)})},ready:function(e){this._ready?e.call(this):this._ready_handlers.push(e)},render:function(){var e=this.generateUrl();return'<iframe id="'+this.id+'" src="'+e+'"'+(this.options.autosize?' style="width: 100%; height: 100%; margin: 0 !important; padding: 0 !important;"':' width="'+this.options.width+'" height="'+this.options.height+'"')+' frameborder="0" allowTransparency="true" scrolling="no" allowfullscreen></iframe>'},generateUrl:function(t){function i(e,i,o){return o=o||e,t[e]?"&"+o+"="+i:""}function o(e,i,o){return o=o||{},"&"+e+"="+(t[e]?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(JSON.stringify(o)))}var n,t=t||this.options;return n="cme"===t.customer?"/cmewidgetembed/":t.customer?"/"+t.customer+"/widgetembed/":"/widgetembed/",(t.enable_publishing?e.ideasHost:e.host)+n+"?symbol="+encodeURIComponent(t.symbol)+"&interval="+encodeURIComponent(t.interval)+(t.range?"&range="+encodeURIComponent(t.range):"")+(t.whitelabel?"&whitelabel=1":"")+(t.hide_top_toolbar?"&hidetoptoolbar=1":"")+(void 0===t.hide_side_toolbar?"":"&hidesidetoolbar="+(t.hide_side_toolbar?"1":"0"))+(void 0===t.allow_symbol_change?"":"&symboledit="+(t.allow_symbol_change?"1":"0"))+(void 0===t.save_image?"":"&saveimage="+(t.save_image?"1":"0"))+"&toolbarbg="+t.toolbar_bg.replace("#","")+(t.watchlist&&t.watchlist.length&&t.watchlist.join?"&watchlist="+encodeURIComponent(t.watchlist.join("")):"")+i("editablewatchlist","1")+i("details","1")+i("calendar","1")+i("hotlist","1")+i("news","1")+function(){return t.studies&&e.isArray(t.studies)?"string"==typeof t.studies[0]?i("studies",encodeURIComponent(t.studies.join(""))):o("studies",t.studies):""}()+(t.news_vendors?"&newsvendors="+encodeURIComponent(t.news_vendors.join("")):"")+i("widgetbar_width",t.widgetbar_width,"widgetbarwidth")+i("hideideas","1")+i("theme",encodeURIComponent(t.theme))+i("style",encodeURIComponent(t.style))+(void 0===t.extended_hours?"":"&extended_hours="+t.extended_hours)+i("timezone",encodeURIComponent(t.timezone))+i("hideideasbutton","1")+i("withdateranges","1")+i("hidevolume","1")+(void 0===t.padding?"":"&padding="+t.padding)+i("show_popup_button","1","showpopupbutton")+o("studies_overrides",t.studies_overrides,{})+o("overrides",t.overrides,{})+o("enabled_features",t.enabled_features,[])+o("disabled_features",t.disabled_features,[])+(t.show_popup_button?"&showpopupbutton=1":"")+(t.publish_source?"&publishsource="+encodeURIComponent(t.publish_source):"")+(t.enable_publishing?"&enablepublishing="+encodeURIComponent(t.enable_publishing):"")+(t.idea_url?"&idea_url="+encodeURIComponent(t.idea_url):"")+(t.venue?"&venue="+encodeURIComponent(t.venue):"")+(t.symbology?"&symbology="+encodeURIComponent(t.symbology):"")+(t.whotrades?"&whotrades="+encodeURIComponent(t.whotrades):"")+(t.locale?"&locale="+t.locale:"")+(t.referral_id?"&referral_id="+t.referral_id:"")+(t.no_referral_id?"&no_referral_id=1":"")+(t.ref_landing_page?"&ref_landing_page="+t.ref_landing_page:"")+(t.fundamental?"&fundamental="+encodeURIComponent(t.fundamental):"")+(t.percentage?"&percentage="+encodeURIComponent(t.percentage):"")+"&utm_source="+encodeURI(window.location.hostname)+"&utm_medium=widget"+(t.type?"&utm_campaign="+t.type:"")+(t.type&&"chart"===t.type?"&utm_term="+encodeURIComponent(t.symbol):"")},image:function(t){this.postMessage.get("imageURL",{},function(i){var o=e.host+"/x/"+i+"/";t(o)})},subscribeToQuote:function(t){var i=e.gEl(this.id);this.postMessage.post(i.contentWindow,"quoteSubscribe"),this.postMessage.on("quoteUpdate",t)},saveChart:function(e){this.postMessage.get("chartID",{},e)},getSymbolInfo:function(e){this.postMessage.get("symbolInfo",{},e)},remove:function(){var t=e.gEl(this.id);t.parentNode.removeChild(t)},reload:function(){var t=e.gEl(this.id),i=t.parentNode;i.removeChild(t),i.innerHTML=this.render()}},e.chart.prototype={create:function(){this.isMobile=e.isMobileDevice.any;var i,o,n,r=this.render(),s=this;e.chartCssAttached||(e.css(this.renderCss()),e.chartCssAttached=!0),t(r,this.options.container),o=e.gEl(this.id),i=e.gEl(this.id+"_actions"),n=e.gEl(this.id+"_fullscreen"),e.bindEvent(o,"load",function(){var e;for(i.style.display="block",s._ready=!0,e=s._ready_handlers.length;e--;)s._ready_handlers[e].call(s)}),e.bindEvent(n,"click",function(){s.toggleFullscreen()}),e.onready(function(){var e=!1;if(document.querySelector&&document.querySelector('a[href$="/v/'+s.options.chart+'/"]')&&(e=!0),!e)for(var t=document.getElementsByTagName("a"),i=new RegExp("/v/"+s.options.chart+"/$"),n=new RegExp("/chart/([0-9a-zA-Z:+*-/()]+)/"+s.options.chart),r=0;r<t.length;r++)if(i.test(t[r].href)||n.test(t[r].href)){e=!0;break}e&&(o.src+="#nolinks",o.name="nolinks")}),this.postMessage=e.postMessageWrapper(o.contentWindow,this.id)},ready:e.widget.prototype.ready,renderCss:function(){var t=e.host;return".tradingview-widget {position: relative;}.tradingview-widget .chart-actions-float {display: none; position: absolute; z-index: 5; top: 0; right: 0; background: #fff; border: 1px solid #bfbfbf; border-radius: 0 3px 0 3px; }.chart-actions-float a:nth-child(1) {border-right: 1px solid #b2b5b8;}.chart-actions-float a:nth-child(2) {padding: 5px 10px 5px 5px;}.tradingview-widget .chart-actions-float .status-picture {margin: 4px 1px 0 3px; border: none !important; padding: 0 !important; background: none !important;}.tradingview-widget .chart-status-picture {position: absolute; z-index: 50;}.tradingview-widget .icon {display: inline-block; position: relative;}.tradingview-widget .icon-action-realtime{background: url('"+t+"/static/images/svg/chart/make-it-live.svg'); width: 28px; height: 28px; margin-right: 2px;}.tradingview-widget .icon-action-zoom{background: url('"+t+"/static/images/svg/chart/fullscreen-embed.svg'); width: 28px; height: 28px;}.tradingview-widget .exit-fullscreen {z-index: 16; position: fixed; top: -1px; left: 50%; display: none; opacity: 0.6; background: #f9f9f9; color: #848487; border-radius: 0 0 3px 3px; font-size: 11px; width: 116px; font-weight: bold; padding: 2px 4px; cursor: default; margin: 0 0 0 -62px;}.tradingview-widget .exit-fullscreen:hover {opacity: 1;}.tradingview-widget .tradingview-button {padding: 5px; display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; text-decoration: none !important;color: #4c525e; cursor: pointer; font: normal 14px TrebuchetMS, Calibri, Arial; -webkit-user-select: none;-moz-user-select: none;-o-user-select: none;user-select: none; box-sizing: content-box; -moz-box-sizing: content-box; -webkit-box-sizing: content-box;}.tradingview-widget .tradingview-button:hover, ._tv-button:active {background-position: 0 -26px; color: #68696b;}"},render:function(){var t=this.options.mobileStatic&&this.isMobile?e.host+"/embed-static/":e.host+"/embed/",i="?method=script"+(this.options.locale?"&locale="+encodeURIComponent(this.options.locale):"");return this.options.type="chart",'<div class="tradingview-widget" '+(this.options.autosize?' style="width: 100%; height: 100%; margin: 0 !important; padding: 0 !important;"':' style="width:'+this.options.width+"px; height:"+this.options.height+'px;"')+'><div id="'+this.id+'_actions" class="chart-actions-float"><a id="'+this.id+'_fullscreen" class="tradingview-button" title="Full Screen"><span class="icon icon-action-zoom"></span></a><a id="'+this.id+'_live" class="tradingview-button" target="_blank" href="https://www.tradingview.com/chart/?clone='+this.options.chart+'"><span class="icon icon-action-realtime"></span> Make It Live</a> </div><iframe id="'+this.id+'" src="'+t+this.options.chart+"/"+i+"&"+e.generateUtmForUrlParams(this.options)+'"'+(this.options.autosize?' style="width: 100%; height: 100%; margin: 0 !important; padding: 0 !important;"':' width="'+this.options.width+'" height="'+this.options.height+'"')+' frameborder="0" allowTransparency="true" scrolling="no"></iframe></div>'},windowSize:function(){var e=0,t=0;return document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(e=document.documentElement.clientWidth,t=document.documentElement.clientHeight):"number"==typeof window.innerWidth?(e=window.innerWidth,t=window.innerHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(e=document.body.clientWidth,t=document.body.clientHeight),{width:e,height:t}},toggleFullscreen:function(){var t=e.gEl(this.id),i=e.gEl(this.id+"_actions"),o=this.windowSize();this.is_fullscreen?(t.style.position="static",this.options.autosize?(t.style.width="100%",t.style.height="100%"):(t.style.width=this.options.width+"px",t.style.height=this.options.height+"px"),t.style.zIndex="auto",t.style.backgroundColor="transparent",i.style.position="absolute",i.style.zIndex="auto",e.unbindEvent(document,"keydown",this.getKeyHandler())):(t.style.position="fixed",t.style.width=o.width+"px",t.style.height=o.height+"px",t.style.left="0px",t.style.top="0px",t.style.zIndex="1000000",t.style.backgroundColor="#fff",i.style.position="fixed",i.style.zIndex="1000001",e.bindEvent(document,"keydown",this.getKeyHandler())),this.is_fullscreen=!this.is_fullscreen},getKeyHandler:function(){var e=this;return this.keyHandler||(this.keyHandler=function(t){27===t.keyCode&&e.toggleFullscreen()}),this.keyHandler},getSymbolInfo:function(e){this.postMessage.get("symbolInfo",{},e)}},e.showSignIn=function(t,i){e.dependenciesManager.depends(["/static/lib/external/spin.min.js"],"authWidget",function(){var o=document.createElement("div"),n=document.createElement("div");o.appendChild(n),new window.Spinner({lines:17,length:0,width:3,radius:20,corners:1,color:"#00A2E2",opacity:0,direction:1,speed:1.5,trail:60,fps:20,shadow:!1,hwaccel:!1,top:"50%",left:"50%",zIndex:"auto"}).spin(n),o.style.cssText="position: fixed;left: 0;top: 0;width: 100%;height: 100%;background: rgba(0, 0, 0, 0.5);z-index: 120;-webkit-transform: translate3d(0, 0, 0);",o.addEventListener("click",function(){document.body.removeChild(o)}),document.body.appendChild(o);var r=e.gId(),s=e.createUrlParams({id:r,utmSourceOverride:t.utmSourceOverride}),a=e.ideasHost+"/authwidget/?"+s,d={width:"470px",height:"650px"},l='<iframe id="'+r+'" src="'+a+'" width="'+d.width+'"'+(d.height?' height="'+d.height+'"':"")+' frameborder="0" allowTransparency="true" scrolling="no"></iframe>',h=document.createElement("div");h.innerHTML=l,h.style.cssText="position: absolute;left: 50%;top: 50%;margin-top: -325px;margin-left: -235px;",o.appendChild(h);var c=e.gEl(r),p=e.postMessageWrapper(c.contentWindow,r),g=function e(t){t.id===r&&(document.body.removeChild(o),t.user&&i(t.user),p.off("close",e))};p.on("close",g,!0),p.on("widgetLoad",function(){n.style.display="none"})})},e.isSignedIn=function(t,i){var o=e.gId(),n=e.createUrlParams({id:o}),r=e.ideasHost+"/isauthwidget/?"+n,s='<iframe id="'+o+'" src="'+r+'" frameborder="0" allowTransparency="true" scrolling="no"></iframe>',a=document.createElement("div");a.innerHTML=s,document.body.appendChild(a);var d=e.gEl(o),l=e.postMessageWrapper(d.contentWindow,o),h=function e(t){t.id===o&&(document.body.removeChild(a),i(t.user),l.off("close",e))};l.on("close",h,!0)},e.onLoginStateChange=function(t,i){var o=e.gId(),n=e.createUrlParams({id:o}),r=e.ideasHost+"/loginstatewidget/?"+n,s='<iframe id="'+o+'" src="'+r+'" frameborder="0" allowTransparency="true" scrolling="no"></iframe>',a=document.createElement("div");a.innerHTML=s,document.body.appendChild(a);var d=e.gEl(o),l=e.postMessageWrapper(d.contentWindow,o),h=function(e){e.id===o&&i(e.user)};l.on("loginStateChange",h,!0)},e.postMessageWrapper=function(){var e,t={},i={},o={},n=0,r=0;return window.addEventListener&&window.addEventListener("message",function(o){var n;try{n=JSON.parse(o.data)}catch(e){return}if(n.provider&&"TradingView"===n.provider)if("get"===n.type){if(!i[n.name])return;i[n.name].forEach(function(t){"function"==typeof t&&t.call(n,n.data,function(t){var i={id:n.id,type:"on",name:n.name,client_id:n.client_id,data:t,provider:"TradingView"};e.postMessage(JSON.stringify(i),"*")})})}else if("on"===n.type)t[n.client_id]&&t[n.client_id][n.id]&&(t[n.client_id][n.id].call(n,n.data),delete t[n.client_id][n.id]);else if("post"===n.type){if(!i[n.name])return;i[n.name].forEach(function(e){"function"==typeof e&&e.call(n,n.data,function(){})})}}),function(s,a){return t[a]={},o[a]=s,e=s,{on:function(e,t,o){i[e]&&o||(i[e]=[]),i[e].push(t)},off:function(e,t){if(!i[e])return!1;var o=i[e].indexOf(t);o>-1&&i[e].splice(o,1)},get:function(e,i,r){var s={id:n++,type:"get",name:e,client_id:a,data:i,provider:"TradingView"};t[a][s.id]=r,o[a].postMessage(JSON.stringify(s),"*")},post:function(e,t,i){var o={id:r++,type:"post",name:t,data:i,provider:"TradingView"};e&&"function"==typeof e.postMessage&&e.postMessage(JSON.stringify(o),"*")}}}}(),e.getUrlParams=function(){for(var e=/\+/g,t=/([^&=]+)=?([^&]*)/g,i=window.location.search.substring(1),o=t.exec(i),n=function(t){return decodeURIComponent(t.replace(e," "))},r={};o;)r[n(o[1])]=n(o[2]),o=t.exec(i);return r},e.createUrlParams=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&null!=e[i]&&t.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return t.join("&")},e.WidgetPopup.prototype={create:function(){var t=this,i=this.options.width||900,o=this.options.height||600,n=(screen.width-i)/2,r=(screen.height-o)/2;this.options.type="popup";var s=e.host+"/widgetpopup/?symbol="+encodeURIComponent(this.options.symbol)+"&interval="+encodeURIComponent(this.options.interval)+"&toolbarbg="+this.options.toolbar_bg.replace("#","")+(this.options.theme?"&theme="+encodeURIComponent(this.options.theme):"")+"&hidesidetoolbar="+(this.options.hide_side_toolbar?"1":"0")+(this.options.locale?"&locale="+encodeURIComponent(this.options.locale):"")+"&"+e.generateUtmForUrlParams(this.options);this.popupWindow=window.open(s,"","resizable=yes,directories=no,location=no,toolbar=no,menubar=no,scrollbars=yes, top="+r+", left="+n+", width="+i+", height="+o),this.postMessage=e.postMessageWrapper(this.popupWindow,this.id),this.postMessage.on("pushChartId",function(e){var i=e;t.onPushChartId(i)}),"function"==typeof this.popupWindow&&this.popupWindow.focus()},onPushChartId:function(e){this.options.callback(e),this.popupWindow.close()}};var t=function(t,i){var o=e.gEl(i);o?o.innerHTML=t:document.write(t)};window.TradingView?function e(t,i){for(var n in i)"object"===o(i[n])&&t.hasOwnProperty(n)?e(t[n],i[n]):t[n]=i[n];return t}(window.TradingView,e):window.TradingView=e}}()}},[1])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-tradingview-wrapper"]=t():e["react-tradingview-wrapper"]=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpreact_tradingview_wrapper([1],[,function(e,t,n){"use strict";function o(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"IntervalTypes",function(){return d}),n.d(t,"Themes",function(){return f}),n.d(t,"BarStyles",function(){return h});var p=n(2),l=n.n(p),u=n(6),s=n.n(u),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d={D:"D",W:"W"},f={LIGHT:"Light",DARK:"Dark"},h={BARS:"0",CANDLES:"1",HOLLOW_CANDLES:"9",HEIKIN_ASHI:"8",LINE:"2",AREA:"3",RENKO:"4",LINE_BREAK:"7",KAGI:"5",POINT_AND_FIGURE:"6"},g="tradingview-widget-script",y="tradingview-widget",b=function(e){function t(){var e,n,a,p;r(this,t);for(var u=arguments.length,s=Array(u),d=0;d<u;d++)s[d]=arguments[d];return n=a=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),a.state={containerStyle:{}},a.componentDidMount=function(){return a.appendScript(a.initWidget)},a.componentDidUpdate=function(){a.cleanWidget(),a.initWidget()},a.appendScript=function(e){if(a.scriptExists())return void e();var t=document.createElement("script");t.id=g,t.type="text/javascript",t.async=!0,t.src="http://anhit.net/le/charting_library.min.js",t.onload=e,document.getElementsByTagName("head")[0].appendChild(t)},a.scriptExists=function(){return null!==document.getElementById(g)},a.initWidget=function(){var e=a.props,t=e.widgetType,n=o(e,["widgetType"]),r=c({},n,{container_id:y});if(r.autosize){delete r.width,delete r.height;var i=document.getElementById(y);i.style.width="100%",i.style.height="100%"}"number"==typeof r.interval&&(r.interval=r.interval.toString()),r.popup_width&&"number"==typeof r.popup_width&&(r.popup_width=r.popup_width.toString()),r.popup_height&&"number"==typeof r.popup_height&&(r.popup_height=r.popup_height.toString()),new TradingView[t](r)},a.cleanWidget=function(){document.getElementById(y).innerHTML=""},a.render=function(){return l.a.createElement("article",{id:y})},p=n,i(a,p)}return a(t,e),t}(p.PureComponent);b.propTypes={widgetType:s.a.string,width:s.a.number,height:s.a.number,autosize:s.a.bool,symbol:s.a.string.isRequired,interval:s.a.oneOf([1,3,5,15,30,60,120,180,"1","3","5","15","30","60","120","180",d.D,d.W]),timezone:s.a.string,theme:s.a.oneOf([f.LIGHT,f.DARK]),style:s.a.oneOf([h.BARS,h.CANDLES,h.HOLLOW_CANDLES,h.HEIKIN_ASHI,h.LINE,h.AREA,h.RENKO,h.LINE_BREAK,h.KAGI,h.POINT_AND_FIGURE]),locale:s.a.string,toolbar_bg:s.a.string,enable_publishing:s.a.bool,allow_symbol_change:s.a.bool,withdateranges:s.a.bool,hide_side_toolbar:s.a.bool,hideideas:s.a.bool,watchlist:s.a.arrayOf(s.a.string),details:s.a.bool,hotlist:s.a.bool,calendar:s.a.bool,news:s.a.arrayOf(s.a.string),studies:s.a.arrayOf(s.a.string),show_popup_button:s.a.bool,popup_width:s.a.oneOfType([s.a.number,s.a.string]),popup_height:s.a.oneOfType([s.a.number,s.a.string]),no_referral_id:s.a.bool,referral_id:s.a.string},b.defaultProps={widgetType:"widget",width:980,height:610,autosize:!1,interval:d.D,timezone:"Etc/UTC",theme:f.LIGHT,style:h.CANDLES,locale:"en",toolbar_bg:"#F1F3F6",enable_publishing:!1,allow_symbol_change:!0,hideideas:!0},t.default=b}],[1])});
{
"name": "react-tradingview-wrapper",
"version": "1.0.4",
"version": "1.0.6",
"description": "React component for rendering the TradingView Advanced Real-Time Chart Widget",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc