You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
2.2 MiB

webpackJsonp([0],[function(t,e,i){(function(t){"use strict";var e,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P;i(3),e=i(4),i(5),i(81),i(273),o=i(274),n=i(100).Action,s=i(275).ChartSaver,r=i(277),a=i(278),l=i(36),h=i(94),c=h.formatterOptions,d=i(279),p=i(280),i(285),u=i(286),_=i(540),f=i(571),m=i(579),g=i(604),v=i(291).UndoHistory,y=i(616),b=i(617),i(612),i(621),w=i(334),S=!!urlParams.indicatorsFile,T=$.Deferred(),C=$.Deferred(),$.when(T,C).done(function(){ChartApiInstance.start()}),S?$.getScript(urlParams.indicatorsFile).done(function(){void 0!==window.__customIndicators&&window.isArray(window.__customIndicators)&&(window.PineJS=i(605),JSServer.studyLibrary=JSServer.studyLibrary.concat(window.__customIndicators),console.log("{0} custom indicators loaded.".format(window.__customIndicators.length)),T.resolve())}).fail(function(t){console.warn("Error loading custom indicators @ `{0}`: {1} ({2}) ".format(urlParams.indicatorsFile,t.statusText,t.status)),T.resolve()}):T.resolve(),window.widgetReady=function(t){l.subscribe("onChartReady",t)},window.customizeUI=function(t){window.applyStudiesOverrides(t.studiesOverrides),window.__defaultsOverrides=t.defaultsOverrides},window.applyStudiesOverrides=function(t){if(t){for(var e in t)y.setProperty(e,t[e]);y.applyDefaultsToFactoryDefaults(Object.keys(t))}},window.applyOverrides=function(t){$.extend(!0,window.__defaultsOverrides,t),window.applyDefaultsOverrides(TradingView.defaultProperties.chartproperties),window.applyDefaultOverridesToLinetools(),window.chartWidgetCollection.applyOverrides(t)},window.is_authenticated=!1,x=function(){var e,i,n,v,y,S,T,x,P,L,k,I,E,A,V;if(!Modernizr.canvas||!Modernizr.canvastext)throw Error("Charting library cannot be running under this browser");t.setEnabled("charting_library_debug_mode","true"===urlParams.debug),e=window.headerChartPanel=$(".header-chart-panel"),i=$("#library-container"),n=$(".tv-header"),t.enabled("remove_library_container_border")&&(i.css("border","0px"),i.css("padding","1px")),window.customizeUI({studiesOverrides:urlParams.studiesOverrides?JSON.parse(urlParams.studiesOverrides):void 0,defaultsOverrides:JSON.parse(urlParams.overrides)}),urlParams.numeric_formatting=urlParams.numeric_formatting&&JSON.parse(urlParams.numeric_formatting),urlParams.numeric_formatting&&"string"==typeof urlParams.numeric_formatting.decimal_sign&&(c.decimalSign=urlParams.numeric_formatting.decimal_sign[0]),t.enabled("saveload_storage_customization")&&(void 0!==urlParams.chartsStorageUrl&&urlParams.chartsStorageUrl&&void 0!==urlParams.clientId&&urlParams.clientId?o.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl,urlParams.chartsStorageVer||"1.0"):(t.setEnabled("saveload_storage_customization",!1),t.setEnabled("header_saveload",!1))),window.ChartApiInstance=new g(window.parent[urlParams.uid].datafeed),window.parent[urlParams.uid].customFormatters&&(window.parent[urlParams.uid].customFormatters.timeFormatter&&(h.customFormatters.timeFormatter=window.parent[urlParams.uid].customFormatters.timeFormatter),window.parent[urlParams.uid].customFormatters.dateFormatter&&(h.customFormatters.dateFormatter=window.parent[urlParams.uid].customFormatters.dateFormatter)),urlParams.autoSaveDelay&&ChartApiInstance.setAutoSaveDelay(urlParams.autoSaveDelay),ChartApiInstance.setTimeFramesList(JSON.parse(urlParams.timeFrames)),ChartApiInstance.setStudiesAccessController(ChartApiInstance.createStudiesAccessController(urlParams.studiesAccess)),t.enabled("narrow_chart_enabled")&&$(".chart-page").css("min-width","240px"),t.enabled("use_localstorage_for_settings")&&TVSettings.sync(),v=urlParams.chartContent?JSON.parse(urlParams.chartContent).json:void 0,y=urlParams.interval||"D",S={jqParent:$("#chart-area"),onResize:function(o){var s,r,a,l,h,c,d=$(document.body).height()-2;i.height(d),s=$("#footer-chart-panel"),r=s&&s.is(":visible")?s.outerHeight():0,a=$("#bottom-area"),l=a&&a.is(":visible")?a.outerHeight():0,h=t.enabled("header_widget")&&e.is(":visible")?e.outerHeight():0,c=d-h-n.outerHeight()-l-r,c=Math.max(50,c),o.height(c)},padding:t.enabled("border_around_the_chart")?5:0,edge:t.enabled("border_around_the_chart")?5:0,content:v,widgetOptions:{hideIdeas:!0,addVolume:!0,handleSessionErrors:!0,muteSessionErrors:!0,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:y,defTimeframe:urlParams.timeframe&&urlParams.timeframe.toLowerCase()},globalEvents:!0,snapshotUrl:urlParams.snapshotUrl},v&&void 0!==v.extendedData&&(T=v.extendedData,S.metaInfo={id:T.uid,name:T.name,description:T.description,uid:T.uid,username:"",tags:""}),x=window.chartWidgetCollection=new u(S),x.activeChartWidget.subscribe(function(t){l.emit("activeChartChanged",x.getAll().indexOf(t))}),window.saver=new s(x),window.chartWidget=x.activeChartWidget.value(),window.pro=new TradingView.Pro,window.tradingViewApi=new b(x,window.saver,ChartApiInstance),P=JSON.parse(urlParams.favorites),P.intervals=P.intervals.map(function(t){var e=""+t;return e.match(/1[DWMYdwmy]/)&&(e=e.slice(1)),e}),t.enabled("study_templates")&&(window.studyTemplates=new r({chartWidgetCollection:x,notShowQuicks:!t.enabled("items_favoriting")})),L=null,window.headerWidget=new _({chartWidgetCollection:x,headerChartPanel:e,domePanel:L,hideStudyTemplates:!0,favoriteIntervals:P.intervals,interval_options:{interval:y},favoriteChartTypes:P.chartTypes}),a.bindToChartWidgetCollection(x),k=function(){},I=JSON.parse(urlParams.logo),k=I.image?function(e,i,o){var n,s,r,a,l,h,c,d;i=i||chartWidget._jqMainDiv,$(i).find(".onchart-custom-logo").remove(),n=$('<img src="'+I.image+'">'),s=I.link?$('<a href="'+I.link+'" target="_blank"/>').append(n):n,r=$('<span class="text">Powered&nbsp;by&nbsp;<span><a href="https://www.tradingview.com/" target="_blank"><span class="text logo-highlighted">TradingView</span></a>'),a=$('<div class="onchart-custom-logo"/>').appendTo(i),l=$('<div class="wrapper"/>').appendTo(a),h=$('<table class="inner">').appendTo(l),c=$("<tr>").appendTo(h),$('<td class="custom-logo">').append(s).appendTo(c),d=$("<tr>").appendTo(h),t.enabled("link_to_tradingview")&&$('<td class="tv-link">').append(r).appendTo(d),o&&a.addClass("on-pane")}:function(e,i,o){if(t.enabled("link_to_tradingview")){i=i||chartWidget._jqMainDiv,$(i).find(".onchart-tv-logo").remove();var n=$('<div class="onchart-tv-logo wrapper"><div class="wrapper"><a class="inner" href="https://www.tradingview.com/" target="_blank"><img class="solid" src="images/charting_library/logo-widget-copyright.png" alt="TradingView Logo"><img class="faded" src="images/charting_library/logo-widget-copyright-faded.png" alt="TradingView Logo"><span class="text"><span id="logo-symbol"></span>&nbsp;charts&nbsp;by&nbsp;<span class="logo-highlighted">TradingView</span></span></a></div></div>').appendTo(i);t.enabled("minimalistic_logo")?n.on("mouseenter",function(){$(this).addClass("expanded")}).on("mouseleave",function(){$(this).removeClass("expanded")}):n.addClass("expanded"),o&&n.addClass("on-pane")}},E=t.enabled("widget_logo"),E&&(chartWidget.createLogo=k,t.enabled("show_logo_on_all_charts")&&(x.createLogo=k.bind(this)),t.enabled("move_logo_to_main_pane")||chartWidget.withModel(null,k)),urlParams.toolbarbg&&(A="#"+urlParams.toolbarbg,$(".tv-side-toolbar").css("background-color",A),$(".chart-controls-bar").css("background-color",A),$("#chart-area").css("background-color",A),e.css("background-color",A),$("#footer-chart-panel").css("background-color",A)),TradingView.isNaN(urlParams.studyCountLimit)||(TradingView.STUDY_COUNT_LIMIT=Math.max(2,+urlParams.studyCountLimit)),TradingView.isNaN(urlParams.ssreqdelay)||w.setSearchRequestDelay(Math.max(0,+urlParams.ssreqdelay)),V=new f({container:$(".tv-side-toolbar"),chartWidgetCollection:x,onWidget:!0,drawingsAccess:urlParams.drawingsAccess?JSON.parse(urlParams.drawingsAccess):void 0,forceVisible:!!t.enabled("left_toolbar")}),window.sideToolbar=V,window.quoteSessionMultiplexerInstance={},window.quoteSessionMultiplexerInstance.simple=new p("simple"),window.quoteSessionMultiplexerInstance.full=new p,window.lineToolPropertiesToolbar=new m(x),chartWidget.onDisconnected().subscribe(null,function(t){t&&d.showCriticalErrorMessage()}),$(".tv-content").bind("contextmenu",function(t){var e=$(t.originalEvent.target);if(!e.is("input")&&!e.is("textarea"))return!1}),C.resolve(),chartWidget.withModel(null,function(){chartWidget.model().mainSeries().onSymbolResolved().subscribe(null,function(t){var e,i,o=chartWidget.model().mainSeries().symbolInfo()||t;o&&(e=chartWidget.model().mainSeries().properties().interval.value(),i={name:o.name,exchange:o.exchange,description:o.description,type:o.type,interval:e},l.emit("onSymbolChange",i))}),a.interval.subscribe(function(t){l.emit("onIntervalChange",t)}),ChartApiInstance.on("realtime_tick",function(t){l.emit("onTick",t)}),ChartApiInstance.on("onAutoSaveNeeded",function(){l.emit("onAutoSaveNeeded")}),t.enabled("charting_library_debug_mode")&&l.subscribeToAll(function(){var t=Array.prototype.slice.call(arguments);console.log('Event "{0}", arguments: {1}'.format(t[0],JSON.stringify(t.slice(1))))})}),l.subscribe("chart_load_requested",function(t){window.tradingViewApi.loadChart({json:JSON.parse(t.content),extendedData:t})})},window.destroyChart=function(){window.chartWidgetCollection&&(window.chartWidgetCollection.destroy(),window.chartWidgetCollection=null),window.quoteSessionMultiplexerInstance&&(window.quoteSessionMultiplexerInstance.simple&&window.quoteSessionMultiplexerInstance.simple.destroy(),window.quoteSessionMultiplexerInstance.full&&window.quoteSessionMultiplexerInstance.full.destroy(),window.quoteSessionMultiplexerInstance=null),ChartApiInstance&&(ChartApiInstance.destroy(),ChartApiInstance=null)},P=$.Deferred(),$.when(e,P).done(function(){if(JSON.parse(urlParams.disabledFeatures).forEach(function(e){t.setEnabled(e,!1)}),JSON.parse(urlParams.enabledFeatures).forEach(function(e){t.setEnabled(e,!0)}),setTimeout(x,0),t.enabled("14851")){!function(t,e,i,o,n,s,r){t.GoogleAnalyticsObject=n,t[n]=t[n]||function(){(t[n].q=t[n].q||[]).push(arguments)},t[n].l=1*new Date,s=e.createElement(i),r=e.getElementsByTagName(i)[0],s.async=1,s.src=o,r.parentNode.insertBefore(s,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga");var e=document.URL.match(RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-53174009-1","auto"),ga("set",{hostname:e,page:e,referrer:e}),ga("send","pageview")}}),function(){var t=!0;window.parent[urlParams.uid].datafeed.onReady(function(e){t&&console.warn("`onReady` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),window.configurationData=e,P.resolve()}),t=!1}(),window.getFunctionFromArguments=function(t){return window.parent[urlParams.uid][t]},window.createShortcutAction=function(){var t={};return function(e,i){void 0===t[e]&&(t[e]=new n({shortcut:e})),t[e].callbacks().subscribe(null,i)}}(),window.addCustomCSSFile=function(t){var e=document.createElement("link");document.getElementsByTagName("head")[0].appendChild(e),e.setAttribute("type","text/css"),e.setAttribute("rel","stylesheet"),e.setAttribute("href",t)},urlParams.customCSS&&window.addCustomCSSFile(urlParams.customCSS),window._initializationFinished=function(){v.clearStack()},window.resizeWindow=function(){$(window).resize()},window.createButton=function(){var t=null;return function(e){var i,o,n,s,r;return e=e||{},i=e.align||"left",o=window.headerWidget,n="left"===i?o._$left:o._$right,s=o.createGroup("",{single:!0}).appendTo(n),r=$('<div class="button"></div>').appendTo(s),t&&clearTimeout(t),t=setTimeout(function(){window.resizeWindow(),clearTimeout(t)},5),r}}()}).call(e,i(1))},function(t,e,i){var o=i(2),n={},s={},r={},a={init:function(){var t,e,i,l;Object.keys(o).forEach(function(i){t=o[i],e=t.subsets,Array.isArray(e)?e.forEach(function(t){n[t]=1}):e&&Object.keys(e).forEach(function(t){n[t]=1}),n[i]=1}),i=Object.keys(n),i.forEach(function(t){i.forEach(function(i){if(void 0!==(l=o[i])){if(!(e=l.subsets))return;s.hasOwnProperty(t)||(s[t]=[]),Array.isArray(e)&&~e.indexOf(t)?s[t].push(i):t in e&&s[t].push(i)}})}),"undefined"!=typeof __initialDisabledFeaturesets&&__initialDisabledFeaturesets&&__initialDisabledFeaturesets.forEach(function(t){a.disable(t)}),"undefined"!=typeof __initialEnabledFeaturesets&&__initialEnabledFeaturesets&&__initialEnabledFeaturesets.forEach(function(t){a.enable(t)}),"undefined"!=typeof window&&(window.Featuresets=a),this.meta={_uniqueSetsNames:n,_setsReverseDependencies:s,_setsStates:r}},enabled:function(t){var e=function(t){var i,o,n=s.hasOwnProperty(t)?s[t]:[];if(r[t]===!1)return!1;for(i=r[t],o=0;o<n.length;++o)i|=e(n[o]);return i};return!!e(t)},enable:function(t){r[t]=!0},disable:function(t){r[t]=!1},setEnabled:function(t,e){r[t]=!!e},_uniqueSets:function(){return Object.keys(n)}};a.init(),t.exports=a},function(t,e){t.exports={14851:{},custom_items_in_context_menu:{},websocket_connection:{},countdown:{},symbol_search_parser_mixin:{},show_pro_features:{},daily_timeframe_suffix:{},symbollist_context_menu:{},pay_attention_to_ticker_not_symbol:{},graying_disabled_tools_enabled:{},update_study_formatter_on_symbol_resolve:{},constraint_dialogs_movement:{},same_data_requery:{},phone_verification:{},show_interval_dialog_on_key_press:{},header_interval_dialog_button:{subsets:["show_interval_dialog_on_key_press"]},header_fullscreen_button:{},header_symbol_search:{},symbol_search_hot_key:{},header_resolutions:{subsets:["header_interval_dialog_button"]},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},header_saveload_to_the_right:{},study_on_study:{},header_widget:{subsets:["header_widget_dom_node","header_symbol_search","header_resolutions","header_chart_type","header_settings","header_indicators","header_compare","header_undo_redo","header_fullscreen_button","compare_symbol"]},compare_symbol:{subsets:["header_compare"]},chart_property_page:{subsets:["chart_property_page_style","chart_property_page_scales","chart_property_page_background","chart_property_page_timezone_sessions","chart_property_page_evetns_alerts","chart_property_page_trading","chart_property_page_template_button"]},disable_userlink_popup:{},left_toolbar:{},control_bar:{},widget_logo:{},timeframes_toolbar:{},edit_buttons_in_legend:{subsets:["show_hide_button_in_legend","format_button_in_legend","study_buttons_in_legend","delete_button_in_legend"]},show_hide_button_in_legend:{},format_button_in_legend:{},study_buttons_in_legend:{},delete_button_in_legend:{},pane_context_menu:{},scales_context_menu:{},legend_context_menu:{},context_menus:{subsets:["pane_context_menu","scales_context_menu","legend_context_menu","objects_tree_context_menu"]},items_favoriting:{},save_chart_properties_to_local_storage:{},use_localstorage_for_settings:{subsets:["items_favoriting","save_chart_properties_to_local_storage"]},plain_studymarket:{},trading_watch_positions:{},disable_resolution_rebuild:{},border_around_the_chart:{},narrow_chart_enabled:{},charting_library_debug_mode:{},log_data_request_time:{},saveload_requires_authentication:{},saveload_storage_customization:{},new_chart_creation_available:{},volume_force_overlay:{},create_volume_indicator_by_default:{},saved_charts_count_restriction:{},lean_chart_load:{},stop_study_on_restart:{},star_some_intervals_by_default:{},predefined_items_only_may_be_starred:{},move_logo_to_main_pane:{},show_logo_on_all_charts:{},link_to_tradingview:{},right_bar_stays_on_scroll:{},chart_content_overrides_by_deafults:{},show_dialog_on_snapshot_ready:{},snapshot_trading_drawings:{},allow_supported_resolutions_set_only:{},study_market_minimized:{},widgetbar_tabs:{},collapsible_header:{},show_extension_popup:{},study_templates:{},side_toolbar_in_fullscreen_mode:{},remove_library_container_border:{},whotrades_auth_only:{},support_multicharts:{},display_market_status:{},show_chart_warn_message:{},datasource_copypaste:{},line_tool_templates:{},expand_symbolsearch_items:{},symbol_search_three_columns_exchanges:{},symbol_search_flags:{},symbol_search_limited_exchanges:{},symbol_search_quandl:{},footer_share_buttons:{},footer_bugreport_button:{},footer_publish_idea_button:{},text_notes:{},symbol_info:{},no_bars_status:{},clear_bars_on_series_error:{},hide_loading_screen_on_series_error:{},seconds_resolution:{},dont_show_boolean_study_arguments:{},hide_last_na_study_output:{},price_scale_always_last_bar_value:{},study_dialog_search_control:{},cqg_trading_confirm_risks:{},trading_notifications:{},chart_crosshair_menu:{},linetoolpropertieswidget_template_button:{},use_overrides_for_overlay:{},timezone_menu:{},main_series_scale_menu:{},show_login_dialog:{},remove_img_from_rss:{},onchart_messages:{},custom_resolutions_box:{},referral_program_for_widget_owners:{},referral_program_policy_aggressive:{subsets:["referral_program_policy_passive","referral_program_policy_normal"]},referral_program_policy_normal:{subsets:["referral_program_policy_passive","header_fake_features_buttons","custom_resolutions_box"]},tv_production:{subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","header_fullscreen_button","header_widget","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","new_chart_creation_available","saved_charts_count_restriction","create_volume_indicator_by_default","charts_auto_save","right_bar_stays_on_scroll","save_old_chart_before_save_as","chart_property_page_trading","chart_content_overrides_by_deafults","alerts","show_dialog_on_snapshot_ready","show_extension_popup","header_saveload","header_saveload_to_the_right","header_layouttoggle","datasource_copypaste","alerts","show_saved_watchlists","watchlists_from_to_file","add_to_watchlist","chart_property_page","show_chart_property_page","support_multicharts","display_market_status","show_chart_warn_message","support_manage_drawings","widgetbar_tabs","study_templates","collapsible_header","line_tool_templates","caption_buttons_text_if_possible","footer_share_buttons","footer_publish_idea_button","text_notes","trading_watch_positions","symbol_info","linetoolpropertieswidget_template_button","cqg_trading_confirm_risks","trading_notifications","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","symbol_search_quandl","phone_verification","chart_events","onchart_messages","custom_resolutions_box","compare_symbol","timezone_menu","main_series_scale_menu","chart_crosshair_menu","study_on_study","show_login_dialog","dome_widget"]},browser_extension:{subsets:["disable_userlink_popup","show_pro_features","show_saved_watchlists","display_market_status","show_chart_warn_message","widgetbar_tabs","show_login_dialog"]},widget:{subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","create_volume_indicator_by_default","right_bar_stays_on_scroll","show_dialog_on_snapshot_ready","header_widget_dom_node","header_symbol_search","symbol_search_hot_key","header_resolutions","header_chart_type","header_compare","header_indicators","header_resolutions","header_widget_dom_node","left_toolbar","saveload_requires_authentication","show_dialog_on_snapshot_ready","star_some_intervals_by_default","symbol_search_parser_mixin","symbollist_context_menu","use_localstorage_for_settings","volume_force_overlay","websocket_connection","display_market_status","show_chart_warn_message","symbol_info","linetoolpropertieswidget_template_button","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","widgetbar_tabs","force_quandl_search","compare_symbol","timezone_menu","main_series_scale_menu","show_login_dialog","plain_studymarket"]},bovespa_widget:{subsets:["widget","header_settings","chart_property_page_timezone_sessions","linetoolpropertieswidget_template_button"]},charting_library_base:{subsets:["14851","adapt_onchart_logo_background","allow_supported_resolutions_set_only","border_around_the_chart","collapsible_header","constraint_dialogs_movement","context_menus","control_bar","create_volume_indicator_by_default","custom_items_in_context_menu","datasource_copypaste","daily_timeframe_suffix","display_market_status","edit_buttons_in_legend","graying_disabled_tools_enabled","narrow_chart_enabled","header_widget","header_saveload","header_saveload_to_the_right","lean_chart_load","left_toolbar","trading_watch_positions","link_to_tradingview","pay_attention_to_ticker_not_symbol","plain_studymarket","predefined_items_only_may_be_starred","refresh_saved_charts_list_on_dialog_show","right_bar_stays_on_scroll","saveload_storage_customization","show_dialog_on_snapshot_ready","stop_study_on_restart","study_market_minimized","timeframes_toolbar","symbol_search_hot_key","update_study_formatter_on_symbol_resolve","update_timeframes_set_on_symbol_resolve","use_localstorage_for_settings","volume_force_overlay","widget_logo","countdown","use_overrides_for_overlay","trading_notifications","compare_symbol","symbol_info","timezone_menu","main_series_scale_menu","study_dialog_search_control","chart_crosshair_menu","show_chart_property_page","chart_property_page_style","chart_property_page_scales","chart_property_page_background","chart_property_page_timezone_sessions","chart_property_page_evetns_alerts"]},charting_library:{subsets:["charting_library_base","header_screenshot"]},static_charts_service:{subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},trading_terminal:{subsets:["charting_library_base","support_multicharts","header_layouttoggle","chart_property_page_trading","add_to_watchlist"]},cqg_terminal:{subsets:["charting_library_base","chart_property_page_trading","expand_symbolsearch_items","caption_buttons_text_if_possible","clear_bars_on_series_error","no_bars_status","hide_loading_screen_on_series_error","support_multicharts","header_layouttoggle","same_data_requery","footer_bugreport_button","dome_widget","dome_widget_always_enabled","remove_img_from_rss","add_to_watchlist"]},amp_terminal:{subsets:["cqg_terminal"]}}},function(t,e){},function(t,e){var i=$.Deferred();$.i18n.init({lng:urlParams.locale,load:"unspecific",resGetPath:"localization/translations/__lng__.json",keyseparator:"@",nsseparator:"@",fallbackLng:"en"},function(t){i.resolve(),$(window).resize(),$(".loading-indicator").hide()}),t.exports=i},function(t,e,i){"use strict";function o(t){return t.keys().map(t)}window.TradingView=window.TradingView||{},window.requireAll=o,i(6),i(20),i(21),i(22),i(23),i(24),i(25),i(26),i(27),i(28),i(29),i(41),i(38),i(39),i(42),i(43),i(33),i(31),i(65),i(79),i(80),i(59)},function(t,e,i){"use strict";var o=i(7);window.actualLanguage&&(o.locale(window.actualLanguage,{months:[$.t("January"),$.t("February"),$.t("March"),$.t("April"),$.t("May"),$.t("June"),$.t("July"),$.t("August"),$.t("September"),$.t("October"),$.t("November"),$.t("December")],monthsShort:[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")],weekdays:[$.t("Sunday"),$.t("Monday"),$.t("Tuesday"),$.t("Wednesday"),$.t("Thursday"),$.t("Friday"),$.t("Saturday")],weekdaysShort:[$.t("Sun"),$.t("Mon"),$.t("Tue"),$.t("Wed"),$.t("Thu"),$.t("Fri"),$.t("Sat")],weekdaysMin:[$.t("Su",{context:"day_of_week"}),$.t("Mo",{context:"day_of_week"}),$.t("Tu",{context:"day_of_week"}),$.t("We",{context:"day_of_week"}),$.t("Th",{context:"day_of_week"}),$.t("Fr",{context:"day_of_week"}),$.t("Sa",{context:"day_of_week"})],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/DD/YYYY",l:"M/D/YYYY",LL:"D MMMM YYYY",ll:"D MMM LT",LLL:"D MMMM YYYY LT",lll:"D MMM YYYY LT",LLLL:"ddd D MMMM YYYY LT",llll:"ddd D MMM YYYY LT"},calendar:{sameDay:$.t("__specialSymbolOpen__Today at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextDay:$.t("__specialSymbolOpen__Tomorrow at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextWeek:$.t("__dayName__ __specialSymbolOpen__at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),lastDay:$.t("__specialSymbolOpen__Yesterday at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),lastWeek:$.t("__specialSymbolOpen__Last__specialSymbolClose__ __dayName__ __specialSymbolOpen__at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),sameElse:"L"},relativeTime:{future:function(t){return t===$.t("just now")?t:$.t("in %s",{context:"time_range"}).replace("%s",t)},past:function(t){return t===$.t("just now")?t:$.t("%s ago",{context:"time_range"}).replace("%s",t)},s:$.t("just now"),m:function(t){return $.t("%d minute",{count:t}).replace("%d",t)},mm:function(t){return $.t("%d minute",{count:t}).replace("%d",t)},h:$.t("an hour"),hh:function(t){return $.t("%d hour",{count:t}).replace("%d",t)},d:$.t("a day"),dd:function(t){return $.t("%d day",{count:t}).replace("%d",t)},M:$.t("a month"),MM:function(t){return $.t("%d month",{count:t}).replace("%d",t)},y:$.t("a year"),yy:function(t){return $.t("%d year",{count:t}).replace("%d",t)}},week:{dow:1,doy:4}}),o.locale(window.actualLanguage))},,,,,,,,,,,,,,function(t,e){"use strict";!function(t){t.fn.contextMenu=function(e){t(this).bind("contextmenu",function(t){return e(t),!1})}}(jQuery)},function(t,e){"use strict";!function(t){t.fn.selectable=function(e){return this.each(function(){var i=t(this);i.css("user-select",e?"text":"none"),i.css("-moz-user-select",e?"text":"-moz-none"),i.css("-webkit-user-select",e?"auto":"none"),(t.browser.msie||t.browser.opera)&&i.attr("unselectable",e?"off":"on")})}}(jQuery)},function(module,exports){(function(){"use strict";this.JSON||(this.JSON={}),function(){function f(t){return t<10?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var i,o,n,s,r,a=gap,l=e[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof rep&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?l+"":"null";case"boolean":case"null":return l+"";case"object":if(!l)return"null";if(gap+=indent,r=[],"[object Array]"===Object.prototype.toString.apply(l)){for(s=l.length,i=0;i<s;i+=1)r[i]=str(i,l)||"null";return n=0===r.length?"[]":gap?"[\n"+gap+r.join(",\n"+gap)+"\n"+a+"]":"["+r.join(",")+"]",gap=a,n}if(rep&&"object"==typeof rep)for(s=rep.length,i=0;i<s;i+=1)"string"==typeof(o=rep[i])&&(n=str(o,l))&&r.push(quote(o)+(gap?": ":":")+n);else for(o in l)Object.hasOwnProperty.call(l,o)&&(n=str(o,l))&&r.push(quote(o)+(gap?": ":":")+n);return n=0===r.length?"{}":gap?"{\n"+gap+r.join(",\n"+gap)+"\n"+a+"}":"{"+r.join(",")+"}",gap=a,n}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(t){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(t){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,e,i){var o;if(gap="",indent="","number"==typeof i)for(o=0;o<i;o+=1)indent+=" ";else"string"==typeof i&&(indent=i);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var i,o,n=t[e];if(n&&"object"==typeof n)for(i in n)Object.hasOwnProperty.call(n,i)&&(o=walk(n,i),void 0!==o?n[i]=o:delete n[i]);return reviver.call(t,e,n)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()}).call(window)},function(t,e,i){(function(t){var e=window.TradingView=window.TradingView||{};window.PineAddons={},e.className=function(t){for(var i in this)if(e[i]===t)return i;return null},e.isMobileView=/mobile=1/i.test(window.location.search),e.isOnFeaturePage=/on-features-page=1/i.test(window.location.search),e.wrapUrl=function(e){return t.enabled("charting_library_base")&&(e=e.replace("","")),e},e.isMobile=function(){var t=/Android/i.test(navigator.userAgent),i=/BlackBerry/i.test(navigator.userAgent),o=/iPhone|iPad|iPod/i.test(navigator.userAgent),n=/Opera Mini/i.test(navigator.userAgent),s=e.winMobileMode,r=e.isMobileView||t||i||o||n||s;return{Android:function(){return t},BlackBerry:function(){return i},iOS:function(){return o},Opera:function(){return n},Windows:function(){return s},any:function(){return r}}}(),e.supportTouch=function(){return Modernizr.touch||e.isMobile.any()},e.onWidget=function(){return/widgetembed|widgetpopup|idea-popup/.test(window.location.pathname)},e.onOrder=function(){return"/order/"===window.location.pathname},"undefined"!=typeof jQuery&&(e.debugReady=$.Deferred())}).call(e,i(1))},function(t,e){"use strict";!function(t,e,i){"$:nomunge";function o(o,n){function s(e){t(r).each(function(){var i=t(this);this===e.target||i.has(e.target).length||i.triggerHandler(n,[e.target])})}n=n||o+i;var r=t(),a=o+"."+n+"-special-event";t.event.special[n]={setup:function(){r=r.add(this),delete r.prevObject,1===r.length&&t(e).bind(a,s)},teardown:function(){r=r.not(this),delete r.prevObject,0===r.length&&t(e).unbind(a)},add:function(t){var e=t.handler;t.handler=function(t,i){t.target=i,e.apply(this,arguments)}}}}t.map("click dblclick mousemove mousedown mouseup mouseover mouseout change select submit keydown keypress keyup".split(" "),function(t){o(t)}),o("focusin","focus"+i),o("focusout","blur"+i),Modernizr.touch&&(o("touchstart","mousedown"+i),o("touchmove","mousemove"+i),o("touchend","mouseup"+i)),t.addOutsideEvent=o}(jQuery,document,"outside")},function(t,e){"use strict";!function(t){t.fn.mousecapture=function(e){var i=t(document);return this.each(function(){var o=t(this),n={};o.mousedown(function(t){var s,r,a;return e.move&&(s=function(t){e.move.call(o,t,n)},i.mousemove(s)),a=function(){e.move&&i.unbind("mousemove",s),i.unbind("mouseup",r)},r=e.up?function(t){return a(),e.up.call(o,t,n)}:a,i.mouseup(r),e.down.call(o,t,n)})}),this}}(jQuery)},function(t,e){"use strict";!function(t){function e(t,e){if(!(t.originalEvent.touches.length>1)){t.preventDefault();var i=t.originalEvent.changedTouches[0],o=document.createEvent("MouseEvents");o.initMouseEvent(e,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(o)}}if(t.support.touch="ontouchend"in document,t.support.touch){var i,o=t.ui.mouse.prototype,n=o._mouseInit,s=o._mouseDestroy;o._touchStart=function(t){var o=this;!i&&o._mouseCapture(t.originalEvent.changedTouches[0])&&(i=!0,o._touchMoved=!1,e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},o._touchMove=function(t){i&&(this._touchMoved=!0,e(t,"mousemove"))},o._touchEnd=function(t){i&&(e(t,"mouseup"),e(t,"mouseout"),this._touchMoved||e(t,"click"),i=!1)},o._mouseInit=function(){var e=this;e.element.bind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),n.call(e)},o._mouseDestroy=function(){var e=this;e.element.unbind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),s.call(e)}}}(jQuery)},function(t,e,i){(function(t){var e=TradingView.guid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},i=TradingView.randomHash=function(){return TradingView.randomHashN(12)},o=TradingView.randomHashN=function(t){var e,i,o="0123456789abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n="";for(e=0;e<t;e++)i=Math.round(Math.random()*(o.length-1)),n+=o[i];return n};void 0!==t&&t&&t.exports&&(t.exports={guid:e,randomHash:i,randomHashN:o})}).call(e,i(8)(t))},function(t,e,i){(function(t){function e(t){return"number"==typeof t&&isFinite(t)}function i(t){return"string"==typeof t?JSON.parse(t):t}function o(t){return null!==t&&void 0!==t&&t.constructor===Function}function n(t,e){t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),t.prototype.superclass=e}var s,r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=function(t){return"object"==typeof t&&null!==t},l=function(t){return a(t)&&(""+t.constructor).indexOf("function Object")!==-1};"undefined"!=typeof window?(s=window.TradingView=window.TradingView||{},window.isNumber=e,window.isFunction=o,window.inherit=n,window.isArray=r):s=this.TradingView=this.TradingView||{},s.isNaN=function(t){return!(t<=0||t>0)},s.isAbsent=function(t){return null===t||void 0===t},s.isExistent=function(t){return null!==t&&void 0!==t},Number.isNaN=Number.isNaN||function(t){return t!=t},s.isSameType=function(t,e){return Number.isNaN(t)||Number.isNaN(e)?Number.isNaN(t)===Number.isNaN(e):{}.toString.call(t)==={}.toString.call(e)},s.isInteger=function(t){return"number"==typeof t&&t%1==0},s.parseBool=function(t){return t===!0||"true"===t},s.isBoolean=function(t){return t===!0||t===!1},s.isString=function(t){return null!==t&&void 0!==t&&t.constructor===String},s.declareClassAsPureInterface=function(t,e){for(var i in t.prototype)"function"==typeof t.prototype[i]&&t.prototype.hasOwnProperty(i)&&(t.prototype[i]=function(){throw Error(e+"::"+i+" is an interface member declaration and must be overloaded in order to be called")})},s.requireFullInterfaceImplementation=function(t,e,i,o){for(var n in i.prototype)if("function"==typeof i.prototype[n]&&!t.prototype[n])throw Error("Interface implementation assertion failed: "+e+" does not implement "+o+"::"+n+" function")},s.isInherited=function(t,e){return t===e||!(!t||!t.prototype)&&(void 0!==t.prototype.superclass&&null!==t.prototype.superclass&&(t.prototype.superclass===e||s.isInherited(t.prototype.superclass,e)))},s.TypeValidator=function(t){this.m_type=t},s.TypeValidator.prototype.check=function(t){return t.constructor===this.m_type||s.isInherited(t.constructor,this.m_type)},s.PredicateValidator=function(t){this.m_predicate=t},s.PredicateValidator.prototype.check=function(t){return this.m_predicate(t)},s.clone=function(t){var e,i,o;if(!t||"object"!=typeof t)return t;e="function"==typeof t.pop?[]:{};for(i in t)t.hasOwnProperty(i)&&(o=t[i],e[i]=o&&"object"==typeof o?s.clone(o):o);return e},s.deepEquals=function(t,e,i){var n,a,l,h,c;if(i||(i=""),t===e)return[!0,i];if(o(t)&&(t=void 0),o(e)&&(e=void 0),void 0===t&&void 0!==e)return[!1,i];if(void 0===e&&void 0!==t)return[!1,i];if(null===t&&null!==e)return[!1,i];if(null===e&&null!==t)return[!1,i];if("object"!=typeof t&&"object"!=typeof e)return[t===e,i];if(Array.isArray(t)&&Array.isArray(e)){if(n=t.length,a=e.length,n!==a)return[!1,i];for(l=0;l<n;l++)if(h=s.deepEquals(t[l],e[l],i+"["+l+"]"),!h[0])return h;return[!0,i]}if(r(t)||r(e))return[!1,i];for(c in t)if(h=s.deepEquals(t[c],e[c],i+"["+c+"]"),!h[0])return h;return[!0,i]},s.merge=function(t,e){for(var i in e)"object"==typeof e[i]&&t.hasOwnProperty(i)?s.merge(t[i],e[i]):t[i]=e[i];return t},s.mergeObj=function(t,e){for(var i in e)e[i].constructor===Object&&t.hasOwnProperty(i)?s.mergeObj(t[i],e[i]):t[i]=e[i];return t},s.mergeWithRules=function(t,e,i,o){var n,r;for(n in e)r=o?o+"."+n:n,i&&r in i?t[n]=i[r](t[n],e[n]):"object"==typeof e[n]&&t.hasOwnProperty(n)?s.merge(t[n],e[n],i,r):t[n]=e[n]},s.sortMultipleFunction=function(){var t=[].slice.call(arguments),e=t.length;return function(i,o){var n,s,r,a,l,h,c;for(c=0;c<e&&(h=0,r=t[c],a="string"==typeof r?r:r.name,n=i[a],s=o[a],"function"==typeof r.fn&&(n=r.fn(n),s=r.fn(s)),l=r.reverse?-1:1,n<s&&(h=l*-1),n>s&&(h=1*l),0===h);c++);return h}},void 0!==t&&t&&t.exports&&(t.exports={inherit:n,clone:s.clone,merge:s.merge,isNumber:e,isInteger:s.isInteger,isBoolean:s.isBoolean,isString:s.isString,isObject:a,isHashObject:l,isNaN:s.isNaN,isAbsent:s.isAbsent,isExistent:s.isExistent,isSameType:s.isSameType,isArray:r,parseBool:s.parseBool,parseJSONorNot:i})}).call(e,i(8)(t))},function(t,e,i){var o=i(30),n=window.CanvasEx=i(40);TradingView.resizeCanvas=function(t,e,i){var o,n,s,r,a,l=t.prop("height"),h=t.prop("width");l&&h&&(l/=window.hidpiCanvasRatio||1,h/=window.hidpiCanvasRatio||1,o=$("<canvas>").prop("width",h).prop("height",l),n=o.get(0).getContext("2d"),s=Math.min(h,e),r=Math.min(l,i),s&&r&&n.drawImage(t.get(0),0,0,s,r,0,0,s,r),t.prop("height",i).prop("width",e),a=t.get(0).getContext("2d"),s&&r&&a.drawImage(o.get(0),0,0,s,r,0,0,s,r),o.remove())},n.computeDashPattern=function(t){return[[t.lineWidth,2*t.lineWidth],[3*t.lineWidth,2*t.lineWidth],[6*t.lineWidth,6*t.lineWidth]][t.lineStyle-1]},n.drawLine=function(t,e,i,o,s){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(s)&&(t.lineStyle===n.LINESTYLE_DASHED||t.lineStyle===n.LINESTYLE_DOTTED?t.drawDashedLine(t,e,i,o,s):n.drawSolidLine(t,e,i,o,s))},n.drawArrow=function(t,e,i,o,n){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(n)&&(t.beginPath(),t.moveTo(o,n),t.lineTo(e,i),t.moveTo(e+2,i+2),t.lineTo(e-2,i+2),t.moveTo(e-1,i+1),t.lineTo(e+1,i+1),t.stroke())},n.drawSolidLine=function(t,e,i,o,n){t.beginPath(),t.moveTo(e,i),t.lineTo(o,n),t.stroke()},n.setLineStyle=function(t,e){t.lineStyle=e;var i=[];e!==n.LINESTYLE_SOLID&&(i=n.computeDashPattern(t)),"function"==typeof t.setLineDash?t.setLineDash(i):void 0!==t.mozDash?t.mozDash=i:void 0!==t.webkitLineDash&&(t.webkitLineDash=i)},n.drawPoly=function(t,e,i){var o,n;for(t.beginPath(),t.moveTo(e[0].x,e[0].y),o=0;o<e.length;o++)n=e[o],t.lineTo(n.x,n.y);t.closePath(),t.stroke(),i&&t.fill()},n.lineStyles=[],"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(t){if(this.font!==t)try{this.font=t}catch(t){}},CanvasRenderingContext2D.prototype.lineStyle=n.LINESTYLE_SOLID,n.originalSave=CanvasRenderingContext2D.prototype.save,n.originalRestore=CanvasRenderingContext2D.prototype.restore,CanvasRenderingContext2D.prototype.save=function(){n.lineStyles.push(this.lineStyle),n.originalSave.call(this)},CanvasRenderingContext2D.prototype.restore=function(){n.lineStyles.length>0&&(this.lineStyle=n.lineStyles.pop(),n.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(t,e,i,o,s){t.save();var r=n.computeDashPattern(t);if(t.beginPath(),"function"==typeof t.setLineDash)t.setLineDash(r);else if(void 0!==t.mozDash)t.mozDash=r;else{if(void 0===t.webkitLineDash)return t.dashedLineTo(e,i,o,s,r),t.stroke(),void t.restore();t.webkitLineDash=r}t.moveTo(e,i),t.lineTo(o,s),t.stroke(),t.restore()},CanvasRenderingContext2D.prototype.dashedLineTo=function(t,e,i,n,s){var r,a,l,h,c,d,p={thereYet:o.greaterThan,cap:Math.min},u={thereYet:o.greaterThan,cap:Math.min};for(e-n>0&&(u.thereYet=o.lessThan,u.cap=Math.max),t-i>0&&(p.thereYet=o.lessThan,p.cap=Math.max),this.moveTo(t,e),r=t,a=e,l=0,h=!0;!p.thereYet(r,i)||!u.thereYet(a,n);)c=Math.atan2(n-e,i-t),d=s[l],r=p.cap(i,r+Math.cos(c)*d),a=u.cap(n,a+Math.sin(c)*d),h?this.lineTo(r,a):this.moveTo(r,a),l=(l+1)%s.length,h=!h},CanvasRenderingContext2D.prototype.roundRect=function(t,e,i,o,n){this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-n,e),this.arcTo(t+i,e,t+i,e+n,n),this.lineTo(t+i,e+o-n),this.arcTo(t+i,e+o,t+i-n,e+o,n),this.lineTo(t+n,e+o),this.arcTo(t,e+o,t,e+o-n,n),this.lineTo(t,e+n),this.arcTo(t,e,t+n,e,n)}),t.exports=n},function(t,e,i){"use strict";function o(t,e){return t<=e}function n(t,e){return t>=e}function s(t,e,i){return Math.min(Math.max(t,e),i)}function r(t){return t<0?-1:t>0?1:0}function a(t){if(t<0)return P.logDebugChart("MathEx.isBaseDecimal: argument less zero"),!1;for(var e=t;e>1;e/=10)if(e%10!=0)return!1;return!0}function l(t,e,i){return e-t<=i}function h(t,e,i){return Math.abs(t-e)<i}function c(t){return t<=0?(P.logDebugChart("MathEx.log10: argument less or equal zero"),NaN):Math.log(t)/Math.log(10)}function d(t,e){return t<e?-1:t>e?1:0}function p(t,e){var i,o;if(void 0===e&&(e=d),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)<0&&(i=t[o]);return i}function u(t,e){var i,o;if(void 0===e&&(e=d),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)>0&&(i=t[o]);return i}function _(t,e,i){var o=e.substract(t),n=i.substract(t),s=n.dotProduct(o)/o.dotProduct(o);return{coeff:s,distance:t.addScaled(o,s).substract(i).length()}}function f(t,e,i){var o,n,s=_(t,e,i);return 0<=s.coeff&&s.coeff<=1?s:(o=t.substract(i).length(),n=e.substract(i).length(),o<n?{coeff:0,distance:o}:{coeff:1,distance:n})}function m(t,e,i,o){var n,s,r=e.substract(t),a=o.substract(i),l=r.x*a.y-r.y*a.x;return Math.abs(l)<1e-6?null:(n=t.substract(i),s=n.y*a.x-n.x*a.y,s/l)}function g(t,e,i,o){var n,s,r,a=m(t,e,i,o);return null===a?null:(n=e.substract(t),s=n.scaled(a).add(t),r=f(i,o,s),Math.abs(r.distance)<1e-6?a:null)}function v(t,e,i){return t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y}function y(t,e,i,o){var n=t.add(e).scaled(.5),s=n.add(i).scaled(.5),r=g(t,e,s,o);return null===r&&(null===(r=g(e,i,s,o))&&null===(r=g(i,t,s,o)))}function b(t,e,i,o){var n,s=g(t,e,i,new C(o.x,i.y)),r=g(t,e,new C(o.x,i.y),o),a=g(t,e,o,new C(i.x,o.y)),l=g(t,e,new C(i.x,o.y),i),h=[];return s&&s>=0&&h.push(s),r&&r>=0&&h.push(r),a&&a>=0&&h.push(a),l&&l>=0&&h.push(l),0===h.length?null:(h.sort(function(t,e){return t-e}),n=v(t,i,o)?h[0]:h[h.length-1],t.addScaled(e.substract(t),n))}function w(t,e){var i,o,n,s=t.length-1,r=!1,a=e.x,l=e.y;for(i=0;i<t.length;i++)o=t[i],n=t[s],(o.y<l&&n.y>=l||n.y<l&&o.y>=l)&&o.x+(l-o.y)/(n.y-o.y)*(n.x-o.x)<a&&(r=!r),s=i;return r}function S(t,e,i){return(i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y)<=e*e}function T(t,e,i,o){return Math.abs(t.x-e.x)>1e-6&&Math.abs(t.y-e.y)>1e-6?0===Math.round(t.x)||0===Math.round(e.x)?0===Math.round(t.y)||0===Math.round(e.y)?new C(0,0):new C(0,o):0===Math.round(t.y)||0===Math.round(e.y)?new C(i,0):new C(i,o):null}var C,x,P=i(31);e.lessThan=o,e.greaterThan=n,e.clamp=s,e.sign=r,e.isBaseDecimal=a,e.greaterOrEqual=l,e.equal=h,e.log10=c,e.defComparator=d,e.min=p,e.max=u,C=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.addScaled=function(e,i){return new t(this.x+i*e.x,this.y+i*e.y)},t.prototype.substract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.dotProduct=function(t){return this.x*t.x+this.y*t.y},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.scaled=function(e){return new t(this.x*e,this.y*e)},t.prototype.normalized=function(){return this.scaled(1/this.length())},t.prototype.transponed=function(){return new t(-this.y,this.x)},t.prototype.clone=function(){return new t(this.x,this.y)},t}(),e.Point=C,x=function(){function t(){this._rows=[[1,0,0],[0,1,0],[0,0,1]]}return t.prototype.mult=function(e){var i,o,n,s,r;if(e instanceof t){for(i=new t,o=0;o<3;o++)for(n=0;n<3;n++)for(i._rows[o][n]=0,s=0;s<3;s++)i._rows[o][n]+=this._rows[o][s]*e._rows[s][n];return i}for(r=[e.x,e.y,1],i=[0,0,0],o=0;o<3;o++)for(n=0;n<3;n++)i[o]+=r[n]*this._rows[o][n];return new C(i[0],i[1])},t.rotate=function(e){var i=new t;return i._rows[0][0]=Math.cos(e),i._rows[1][1]=Math.cos(e),i._rows[0][1]=-Math.sin(e),i._rows[1][0]=Math.sin(e),i},t.scale=function(e,i){var o=new t;return o._rows[0][0]=e,o._rows[1][1]=i,o},t.translate=function(e,i){var o=new t;return o._rows[0][2]=e,o._rows[1][2]=i,o},t}(),e.Matrix=x,e.distanceToLine=_,e.distanceToSegment=f,e.intersectLines=m,e.intersectSegments=g,e.pointInRect=v,e.pointInTriangle=y,e.intersectRayWithRect=b,e.isInPolygon=w,e.isInCircle=S,e.optionalCorner=T},function(t,e,i){"use strict";function o(){}function n(t,e){var i,o=0,n=0;for(i=t.length-1;i>=1&&(o+=8*(1+encodeURIComponent(t[i]).length),!(i-1>0&&(n=8*(1+encodeURIComponent(t[i-1]).length),o+n>e)));i--);return t.slice(i)}function s(t,e,i,o){var n,s;w[i]||(w[i]={persistent:[],truncated:[]}),n=w[i][o===!0?"truncated":"persistent"],s={timestamp:+t,message:e},n.unshift(s),o===!0&&n.length>v&&(n.length=v)}function r(t,e){for(var i=0;i<t.length;i++)t[i].subsystem=e;return t}function a(t){function e(e,i,o,n,s){k(t,e,i,o,n,s)}function i(t){return function(i,o,n,s){e(i,t,o,n)}}return e.withinSubsystem=i,e}var l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E=window;l=i(32),h=i(33),c="undefined"!=typeof TradingView&&TradingView||{},d=void 0!==h&&h||{getInt:function(t,e){return e},setValue:function(){}},p=E.console||{},["debug","log","warn","error"].forEach(function(t){if(void 0===p[t])try{p[t]=o}catch(t){}}),u=c.LOGLEVEL_ERROR=1,_=c.LOGLEVEL_WARNING=2,f=c.LOGLEVEL_NORMAL=3,m=c.LOGLEVEL_DEBUG=4,g=_,v=300,y=75497472,b="loglevel",w={},S="general",T={general:"color: #099",chart:"color: #606",quote:"color: #660"},setInterval(function(){C=null,x=null},1e3),P=c.getLogLevel=function(){return d.getInt(b)},L=E.llev=c.setLogLevel=function(t){t="number"==typeof t?Math.max(u,Math.min(m,t)):g,d.setValue(b,t)},E.lon=c.loggingOn=function(){L(m),k(f,"Debug logging enabled")},E.lno=c.loggingNormal=function(){L(f),k(f,"Logging set to normal level")},E.loff=c.loggingOff=function(){L(_),k(f,"Debug logging disabled",null,!0)},c.getLogHistory=function(t,e,i,o){var s,a=[];return Object.keys(w).forEach(function(e){e===S&&i===!0||t&&e!==t||o&&~o.indexOf(e)||(a=a.concat(r(w[e].persistent.concat(w[e].truncated),e)))}),a.sort(function(t,e){return t.timestamp-e.timestamp}),"number"==typeof e&&(a=a.slice(-e)),s=a.map(function(t){return new Date(t.timestamp).toISOString()+":"+t.subsystem+":"+t.message.replace(/"/g,"'")}),n(s,y)},k=c.log=function(t,e,i,o,n,r){var a,l;if((e!==C||i!==x)&&(i=i||S,a=new Date,"\n"!==e&&t<=f&&!r&&s(a,e,i,n),o===!0||t<=P())){if("\n"!==e)switch(l=a.toISOString()+":"+i+":"+e,t){case m:p.debug(l);break;case f:T[i]?p.log("%c"+l,T[i]):p.log(l);break;case _:p.warn(l);break;case u:p.error(l)}C=e,x=i}},c.logError=a(u),c.logWarn=a(_),c.logNormal=a(f),c.logDebug=a(m),c.logNormalChart=a(f).withinSubsystem("chart"),c.logNormalQuote=a(f).withinSubsystem("quote"),c.logDebugChart=a(m).withinSubsystem("chart"),c.logDebugQuote=a(m).withinSubsystem("quote"),c.logNormalAlerts=a(f).withinSubsystem("alerts"),c.logNormalTrading=a(f).withinSubsystem("trading"),c.logErrorTrading=a(u).withinSubsystem("trading"),c.logWarnTrading=a(_).withinSubsystem("trading"),I=c.remoteDebug=function(){var t={arguments:JSON.stringify(Array.prototype.slice.call(arguments))};$.ajax("/remote_debug/",{data:t})},c.remoteDebugTouch=function(){Modernizr.touch&&I.apply(this,arguments)},l.isProd()&&void 0!==p&&(c.remoteDebug=o),c.debugReady&&c.debugReady.resolve(),e.LOGLEVEL_ERROR=c.LOGLEVEL_ERROR,e.LOGLEVEL_WARNING=c.LOGLEVEL_WARNING,e.LOGLEVEL_NORMAL=c.LOGLEVEL_NORMAL,e.LOGLEVEL_DEBUG=c.LOGLEVEL_DEBUG,e.getLogLevel=c.getLogLevel,e.setLogLevel=c.setLogLevel,e.loggingOn=c.loggingOn,e.loggingNormal=c.loggingNormal,e.loggingOff=c.loggingOff,e.getLogHistory=c.getLogHistory,e.log=c.log,e.logError=c.logError,e.logWarn=c.logWarn,e.logNormal=c.logNormal,e.logDebug=c.logDebug,e.logNormalChart=c.logNormalChart,e.logNormalQuote=c.logNormalQuote,e.logDebugChart=c.logDebugChart,e.logDebugQuote=c.logDebugQuote,e.logNormalAlerts=c.logNormalAlerts,e.logNormalTrading=c.logNormalTrading,e.logErrorTrading=c.logErrorTrading,e.logWarnTrading=c.logWarnTrading,e.remoteDebug=c.remoteDebug,e.remoteDebugTouch=c.remoteDebugTouch},function(t,e,i){(function(t){"use strict";var e=function(){return"www.tradingview.com"===location.host||"dwq4do82y8xi7.cloudfront.net"===location.host||"i18n.tradingview.com"===location.host||"new.tradingview.com"===location.host||location.host.match(/^[a-z]{2}\.tradingview\.com/)||location.host.match(/\w+-new\.tradingview.com/)||location.host.match(/proxy\d.tradingview.com/)||location.host.match(/prod-[^.]+.tradingview.com/)?"battle":location.href.indexOf("tradingview.com")!==-1?"staging":location.host.match(/webcharts/)?"staging_local":(location.host.match(/^localhost(:\d+)?$/),"local")};e.isLocal=function(){return"local"===this()},e.isProd=function(){return"battle"===this()},e.isDebug=function(){return!this.isProd()},TradingView.Environment=e,void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(8)(t))},function(t,e,i){(function(t,e,o){"use strict";var n=i(35).trackEvent,s=i(37).regExpEscape,r=i(38).TVLocalStorage,a=window.TVSettings=function(){function o(t){return A+"."+t}function l(t,e){var i;return i=V[t],window.is_authenticated&&!W||null!=i||(i=V[t]),null==i?e:i}function h(t,e){var i=l(t,void 0);if(null==i)return e;try{return JSON.parse(i)}catch(i){return f(t),e}}function c(t,e){var i=l(t);return null==i?e:!(!i||"false"===i||0==+i)}function d(t,e,i){var o,n=l(t,void 0,i);if(null==n)return e;if(o=parseFloat(n),!isFinite(o))throw new TypeError('"'+n+'" is not float (key: "'+t+'")');return o}function p(t,e,i){var o,n=l(t,void 0,i);if(null==n)return e;if(o=parseInt(n,10),!isFinite(o))throw new TypeError('"'+n+'" is not int (key: "'+t+'")');return o}function u(t,e,i){i=i||{};var o=""+e;return V[t]!==o&&(V[t]=o,g(t)),i.forceFlush&&!O&&(O=setTimeout(function(){O=void 0,v()},E)),a}function _(t,e,i){return u(t,JSON.stringify(e),i),a}function f(t,e){return e=e||{},null!=V[t]&&(delete V[t],g(t),n("Settings debug",t,user.username)),e.forceFlush&&v(),a}function m(){D=void 0,M.length&&v()}function g(t){if(!window.is_authenticated||W)try{null==V[t]?r.removeItem(o(t)):r.setItem(o(t),V[t])}catch(t){}else M.push(t),D||(D=setTimeout(m,I));N.emit("settings",JSON.stringify({key:t,value:V[t]}))}function v(e){var i,o,n,s,r;if(!t.enabled("widget")&&window.is_authenticated&&!W&&0!==M.length){for(i=M,M=[],o={},n=i.length;n--;)s=i[n],r=V[s],void 0===r&&(r=null),o[s]=r;$.ajax({url:"/savesettings/",type:"POST",data:{delta:JSON.stringify(o)},async:!e})}}function y(){var t,e,i;for(t=0;t<r.length;t++)e=r.key(t),i=A.length,e.substring(0,i+1)===A+"."&&(M=[],r.removeItem(e));$.post("/restoredefaults/",{},function(t){TVDialogs.showNotice("Success","Defaults has been successfully restored")}).error(function(t){})}function b(){return Object.keys(V)}function w(t,e){var i,o=b(e),n=[];for(t=RegExp("^"+s(t).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi"),i=o.length-1;i>=0;i--)t.test(o[i])&&n.push(o[i]),t.lastIndex=0;return n}function S(t){for(var e=0;e<B.length;++e)if(B[e].exec(t))return!0;return!1}function T(){var e,i,o,n,s;for(V=[],e=A+".",i=!t.enabled("save_chart_properties_to_local_storage"),o=r.length;o--;)(n=r.key(o))&&n.substring(0,e.length)===e&&(s=n.substring(e.length),i&&!S(s)||(V[s]=r.getItem(n)))}function C(t){var e,i,o,n,s;for(V=[],e=0===Object.keys(t).length,i=A+".",o=r.length;o--;)(n=r.key(o))&&n.substring(0,i.length)===i&&(e&&(s=n.substring(i.length),u(s,r.getItem(n))),r.removeItem(n));for(o in t)V[o]=t[o]+""}function x(t){window.is_authenticated&&!W?C(t||{}):T(),R.fire()}var P,L,k,I,E,A,V,M,D,O,B,R,N=i(39),F=!1,W=t.enabled("cqg_terminal");try{F=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(t){}return F?(P={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},L=function(t,e,i){var o=P[t];return null==o?e:o},k=function(){},{loaded:!1,loadedModel:!1,getValue:L,getJSON:L,getBool:L,getFloat:L,getInt:L,setValue:k,setJSON:k,remove:k,restoreDefaults:k,keys:function(){return Object.keys(P)},keysMask:function(){return[]},sync:k,onSync:{subscribe:function(){}}}):(I=12e4,E=10,"local"===window.environment&&(I=5e3),A="tradingview",V={},M=[],B=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^domepanel.visible$/],N.on("settings",function(t){var e=JSON.parse(t);null==e.value?delete V[e.key]:V[e.key]=e.value}),R=new e,$(window).on("visibilitychange",function(t,e){e||v()}),$(window).on("unload",function(){v(!0)}),{loaded:!1,loadedModel:!1,getValue:l,getJSON:h,getBool:c,getFloat:d,getInt:p,setValue:u,setJSON:_,remove:f,restoreDefaults:y,keys:b,keysMask:w,sync:x,onSync:R})}();void 0!==o&&o&&o.exports&&(o.exports=a)}).call(e,i(1),i(34),i(8)(t))},function(t,e,i){(function(t){"use strict";function e(){this._listeners=[]}e.prototype.subscribe=function(t,e,i){var o={object:t,member:e,singleshot:!!i};this._listeners.push(o)},e.prototype.unsubscribe=function(t,e){var i,o;for(i=0;i<this._listeners.length;++i)if(o=this._listeners[i],o.object===t&&o.member.prototype===e.prototype){this._listeners.splice(i,1);break}},e.prototype.unsubscribeAll=function(t){var e,i;for(e=0;e<this._listeners.length;++e)if(i=this._listeners[e],i.object===t){this._listeners.splice(e,1);break}},e.prototype.fire=function(){var t,e,i=this._listeners.slice();for(t=0;t<i.length;++t)e=i[t],e.member.apply(e.object||null,arguments);for(t=this._listeners.length-1;t>=0;t--)this._listeners[t].singleshot&&this._listeners.splice(t,1)},"undefined"!=typeof window&&(window.Delegate=e),void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(8)(t))},function(t,e,i){"use strict";function o(t,e,i){var o,a,l,h,c;if(s.enabled("charting_library_base")){for(e=e||t||i||"",o="",a=0;a<r.length;a++)if((l=e.match(r[a]))&&3===l.length){e=l[1],o=l[2];break}return void n.emit(e.toLowerCase().replace(" ","_"),{category:t,label:i,value:o})}h=window._gaq,window._UNIT_TESTS||void 0===h||(c=["_trackEvent",t,e],void 0!==i&&c.push(i),h.push(c))}var n=i(36),s=i(1),r=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/];e.trackEvent=o,window.TradingView=window.TradingView||{},window.TradingView.trackEvent=o},function(t,e,i){"use strict";function o(t,e,i){c[t].unsubscribe(i,e)}function n(t,e,i){s(t,e,i)}function s(t,e,i,o){if(c.hasOwnProperty(t)||(c[t]=new h),p[t])return void e.call(i);c[t].subscribe(i,e,o)}function r(t){d.push(t)}function a(t){var e,i,o=[];for(e=1;e<arguments.length;e++)o[e-1]=arguments[e];i=[t].concat(o),d.forEach(function(t){t.apply(null,i)}),c.hasOwnProperty(t)&&c[t].fire.apply(c[t],o)}function l(t){p[t]&&console.warn("Something went wrong: emitOnce called multiple times with same event ("+t+")"),p[t]=!0,a.apply(null,arguments)}var h=i(34),c={},d=[],p={};e.unsubscribe=o,e.on=n,e.subscribe=s,e.subscribeToAll=r,e.emit=a,e.emitOnce=l},function(t,e){"use strict";function i(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}e.regExpEscape=i},function(t,e){"use strict";var i,o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(t){delete this.isAvailable,delete this.localStorage}this._updateLength()};o.prototype.length=0,o.prototype.isAvailable=!1,o.prototype.localStorage={"tvlocalstorage.available":"false"},o.prototype._updateLength=function(){var t,e;if(this.isAvailable)this.length=this.localStorage.length;else{t=0;for(e in this.localStorage)this.localStorage.hasOwnProperty(e)&&t++;this.length=t}},o.prototype.key=function(t){return this.isAvailable?this.localStorage.key(t):Object.keys(this.localStorage)[t]},o.prototype.getItem=function(t){return this.isAvailable?this.localStorage.getItem(t):this.localStorage[t]},o.prototype.setItem=function(t,e){this.isAvailable?this.localStorage.setItem(t,e):this.localStorage[t]=e,this._updateLength()},o.prototype.removeItem=function(t){this.isAvailable?this.localStorage.removeItem(t):delete this.localStorage[t],this._updateLength()},o.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()},i=function(t){this.storage=t},i.prototype.getItem=function(t){return Promise.resolve(this.storage.getItem(t))},i.prototype.setItem=function(t,e){return Promise.resolve(this.storage.setItem(t,e))},window.TVLocalStorage=new o,window.TVLocalStorageAsync=new i(window.TVLocalStorage),t.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},function(t,e,i){(function(t){"use strict";var e,i="tvxwevents.",o={},n=$.browser.msie||/\btrident\b/i.test(navigator.userAgent);$(window).on("storage",function(t){if(null!==t.originalEvent.newValue){var s=t.originalEvent.key;if(s.startsWith(i)){if(s=s.substr(i.length),n&&e._emitting)return void(e._emitting=!1);o[s]&&o[s].forEach(function(e){e.call(t.originalEvent.newValue,t.originalEvent.newValue)})}}}),e=window.TVXWindowEvents={on:function(t,e){o[t]||(o[t]=[]),o[t].push(e)},off:function(t,e){if(o[t]){var i=o[t].indexOf(e);i!==-1&&(1===o[t].length?delete o[t]:o[t].splice(i,1))}},current:function(t){return TVLocalStorage.getItem(i+t)},emit:function(t,o){void 0===o&&(o=+new Date),o!==TVLocalStorage.getItem(i+t)&&(n&&(e._emitting=!0),TVLocalStorage.setItem(i+t,o))}},void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(8)(t))},function(t,e,i){(function(t){var e={};e.LINESTYLE_SOLID=0,e.LINESTYLE_DOTTED=1,e.LINESTYLE_DASHED=2,e.LINESTYLE_LARGE_DASHED=3,e.TEXTPOS_TOPLEFT=0,e.TEXTPOS_TOPCENTER=1,e.TEXTPOS_TOPRIGHT=2,e.TEXTPOS_MIDDLELEFT=3,e.TEXTPOS_MIDDLECENTER=4,e.TEXTPOS_MIDDLERIGHT=5,e.TEXTPOS_BOTTOMLEFT=6,e.TEXTPOS_BOTTOMCENTER=7,e.TEXTPOS_BOTTOMRIGHT=8,e.SIZE_AUTO="auto",e.SIZE_TINY="tiny",e.SIZE_SMALL="small",e.SIZE_NORMAL="normal",e.SIZE_LARGE="large",e.SIZE_HUGE="huge",e.MARKLOC_ABOVEBAR="AboveBar",e.MARKLOC_BELOWBAR="BelowBar",e.MARKLOC_TOP="Top",e.MARKLOC_BOTTOM="Bottom",e.MARKLOC_RIGHT="Right",e.MARKLOC_LEFT="Left",e.MARKLOC_ABSOLUTE="Absolute",e.MARKLOC_ABSOLUTEUP="AbsoluteUp",e.MARKLOC_ABSOLUTEDOWN="AbsoluteDown",e.HHISTLOC_RELATIVE="relative",e.HHISTLOC_ABSOLUTE="absolute",e.HHISTDIR_LEFTTORIGHT="left_to_right",e.HHISTDIR_RIGHTTOLEFT="right_to_left",void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(8)(t))},function(t,e){String.prototype.left=function(t){if(!TradingView.isInteger(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(0,t)},String.prototype.right=function(t){if(!TradingView.isInteger(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(this.length-t,this.length)},String.prototype.trimmed=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")},String.prototype.startsWith=function(t){return!(t.length>this.length)&&this.left(t.length)===t},String.prototype.format||(String.prototype.format=function(){var t=arguments;return this.replace(/{(\d+)}/g,function(e,i){return void 0!==t[i]?t[i]:e})})},function(t,e,i){(function(t){TradingView.cleanButAmpersand=function(t,e){var i=e?["&amp;"]:["&"];return TradingView.clean(t,e,i)},TradingView.strip_tags=function(t){return t&&t.replace?t.replace(/(<([^>]+)>)/gi,""):t},TradingView.encodeSpread=function(t){return encodeURIComponent(t)},TradingView.clean=function(t,e,i){var o,n,s,r=[["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],["'","&#039;"],["'","&#39;"]],a=t;if(!t||!t.replace)return a;for(o=0;o<r.length;o++)n=r[o][0],s=r[o][1],i&&i.indexOf&&i.indexOf(e?s:n)!==-1||(a=e?a.replace(RegExp(s,"g"),n):a.replace(RegExp(n,"g"),s));return a},void 0!==t&&t&&t.exports&&(t.exports={clean:TradingView.clean,cleanButAmpersand:TradingView.cleanButAmpersand})}).call(e,i(8)(t))},function(module,exports,__webpack_require__){(function(Featuresets,Delegate,_){"use strict";function loginUser(t,e){window.TVDialogs&&window.TVDialogs.signModal&&window.TVDialogs.signModal.close(),user=$.extend(!0,{},t),TradingView.changeLoginState(!0),"function"==typeof e&&window.TVDialogs&&window.TVDialogs.signModal?window.TVDialogs.signModal.on("signinSuccess",function(){e()}):"function"==typeof e&&e()}function onLoginStateChange(is_initial){window.iframeAuthWidget&&user.is_first_login&&(window.iframeAuthWidget.preventClose=!0),$("html").toggleClass("is-authenticated",is_authenticated).toggleClass("is-not-authenticated",!is_authenticated).toggleClass("is-pro",is_authenticated&&user&&!!user.is_pro).toggleClass("is-not-pro",!(is_authenticated&&user&&user.is_pro)).toggleClass("is-trial",is_authenticated&&user&&"pro_realtime_trial"===user.pro_plan).toggleClass("is-not-trial",!(is_authenticated&&user&&"pro_realtime_trial"===user.pro_plan)).toggleClass("is-mobile",!!TradingView.isMobileView).toggleClass("is-not-trial-available",!user.trial_availiable).toggleClass("is-trial-available",!!user.trial_availiable),TVSettings.sync(user.settings),is_initial||TradingView.dropPrerenderCache(),$(".js-header__gopro-button").attr("href",is_authenticated?"/gopro/":""),is_authenticated?(is_initial||($(".header-item-profile strong.user-badge").remove(),$(".header-item-profile > a").append(userBadge(user,!0,"strong")),$('input[name="csrfmiddlewaretoken"]').val($.cookie("csrftoken")||"")),$(".saved_charts_count").html(user.saved_charts),$(".treated_charts_count").html(user.treated_charts_count),$(".js-trial-days-left").html(user.trial_days_left_text||""),$(".js-header-gopro-button").attr("href","/gopro/"),user.fastpass_script&&eval(user.fastpass_script),user.is_first_login&&($(function(){var t=showSignModal({mode:"step-two",noCloseButton:!!user.social_registration,dontCloseOnEsc:!!user.social_registration,nameFields:!user.social_registration,noUsernameField:!user.social_registration,newUserHandler:user.social_registration});user.social_registration?delete user.social_registration:TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user})),window.iframeAuthWidget&&(window.iframeAuthWidget.preventClose=!1,t.on("destroy",function(){window.iframeAuthWidget.postClose()}))}),trackEvent("Conversion","First login"),user.prort_trial_started&&delete user.prort_trial_started,delete user.is_first_login),TradingView.setTrialAvailiable(user.trial_availiable)):(user={username:"Guest",following:"0",followers:"0",ignore_list:{}},$(".user-info-username").html(user.username),TVLocalStorage.removeItem("trial_availiable"))}var loginStateChange,TVModal=__webpack_require__(45).TVModal,TVXWindowEvents=__webpack_require__(39),trackEvent=__webpack_require__(35).trackEvent;__webpack_require__(60),$(document).ajaxSend(function(t,e,i){"POST"!==i.type||i.crossDomain||e.setRequestHeader("X-CSRFToken",$.cookie("csrftoken")),i.crossDomain&&!i.forceLanguageHeader||(window.language?e.setRequestHeader("X-Language",window.language):console.warn("window.language is not defined"))}),!TradingView||!TradingView.onChartPage||Modernizr.canvas&&Modernizr.canvastext&&Modernizr.websockets||(window.location="/badbrowser/"),$(document).ready(function(){$(".tv-select").selectbox({speed:100,classHolder:"tv-select-container"}),Modernizr.canvas&&Modernizr.canvastext&&Modernizr.websockets&&!navigator.userAgent.match("MSIE 10.0;")||new TVModal({width:500,destroyOnClose:!0,title:$.t("Oops, your browser is not supported!"),draggable:!1,closeOnOutsideClick:!1,shadow:!0,content:$.t('<div class="tv-text"><p class="tv-text__font">Please update your browser to the latest version, or use one of the following:</p>')+'<ul class="tv-list tv-list-plain"><li class="tv-list__item tv-list__item--no-margin"><span class="tv-list__item-description"><a href="http://www.google.com/chrome/" target="_blank">Chrome</a></span></li><li class="tv-list__item tv-list__item--no-margin"><span class="tv-list__item-description"><a href="http://www.mozilla.com" target="_blank">Firefox</a></span></li><li class="tv-list__item tv-list__item--no-margin"><span class="tv-list__item-description"><a href="http://www.apple.com/safari/" target="_blank">Safari</a></span></li><li class="tv-list__item tv-list__item--no-margin"><span class="tv-list__item-description"><a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home" target="_blank">Internet Explorer 11</a></span></li><li class="tv-list__item tv-list__item--no-margin"><span class="tv-list__item-description"><a href="http://www.microsoft.com/en-us/windows/microsoft-edge" target="_blank">Microsoft Edge</a></span></li></ul></div>',actions:[{name:"OK",type:"primary",text:$.t("OK"),key:13,method:"close"}]}).open(),!Featuresets.enabled("websocket_connection")||"WebSocket"in window||swfobject.hasFlashPlayerVersion("9.0.0")||TVDialogs.showNotice($.t("TradingView Notice"),{html:$.t("It appears that your browser does not support <strong>WebSocket</strong> technology and does not have <strong>Adobe Flash</strong> plugin installed, one of which is essential for our portal.<br/>")+$.t('Please, <a href="http://get.adobe.com/flashplayer/" target="_blank">install Flash plugin</a> or consider updating to one of these modern browsers with WebSocket support:')+'<ul><li><a href="http://www.google.com/chrome/" target="_blank">Chrome</a></li><li><a href="http://www.apple.com/safari/" target="_blank">Safari</a></li></ul>',classSuffix:"slim",doNotCloseOnBgClick:!0})}),loginStateChange=window.loginStateChange=new Delegate,loginStateChange.subscribe(null,onLoginStateChange),TVXWindowEvents.on("loginStateChange",function(){var t=JSON.parse(this);window.user=t.user,window.is_authenticated=!!t.is_authenticated,loginStateChange.fire()}),function(){var t="user-obj-changed",e={};window.crossTabSyncUserAttr=function(e){var i={};e instanceof Array?e.forEach(function(t){i[t]=window.user[t]}):i[e]=window.user[e],TVXWindowEvents.emit(t,JSON.stringify(i))},window.onChangeUserAttrInAnotherTab=function(t){var i=new Delegate;return e[t]||(e[t]=[]),e[t].push(i),i},TVXWindowEvents.on(t,function(t){var i,o;t=JSON.parse(t);for(i in t)if(window.user[i]=t[i],e[i])for(o=0;o<e[i].length;o++)e[i][o].fire(t[i])})}(),TradingView.changeLoginState=function(t){window.is_authenticated=!!t,TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user})),loginStateChange.fire()},window.loginUser=loginUser,TradingView.signOut=function(){var t=_.clone(window.user);TradingView.changeLoginState(!1),$.ajax({type:"POST",url:"/accounts/logout/",dataType:"html"}).fail(function(){window.user=t,TradingView.changeLoginState(!0)})},window.loginRequiredDelegate=new Delegate,window.runOrSignIn=function(t,e){if(e||(e={}),e.verifiedPhoneRequired===!0){var i=t;t=function(){whenPhoneVerified({showDialog:!0,source:e.source,verifyPhoneByFeature:!0,verifyPhoneMessage:e.verifyPhoneMessage,noVerifyDelay:e.noVerifyDelay,doNotCheckSuspicious:e.doNotCheckSuspicious}).done(i)}}if(is_authenticated||Featuresets.enabled("charting_library_base"))t();else{if(!Featuresets.enabled("show_login_dialog"))return void window.loginRequiredDelegate.fire(e);showSignModal({source:e.source,sourceMeta:e.sourceMeta,feature:e.feature,signinSuccess:t})}},TradingView.runOrGoPro=function(t,e,i){Featuresets.enabled(e)&&t()},TradingView.dropPrerenderCache=function(){$('link[rel="prerender"]').remove()},window.onLoginStateChange=onLoginStateChange,TradingView.isPro=function(){return is_authenticated&&user.is_pro},TradingView.isProRealtime=function(){return this.isPro()&&("pro_realtime"===user.pro_plan||"pro_realtime_trial"===user.pro_plan)},TradingView.setTrialAvailiable=function(t){TVLocalStorage.setItem("trial_availiable",t?1:0)},$.fn.reverse=[].reverse,$(window).load(function(){window.loaded=!0}),TradingView.notificationsChanged=new Delegate,loginStateChange.subscribe(null,function(t){t||$(".js-billing-link").each(function(){var t=$(this),e=window.is_authenticated&&window.user.show_billing;t.toggleClass("i-hidden",!e),"A"!==this.tagName&&(t=t.find("a")),t.attr("href",e?"/u/"+user.username+"/#billing":"")})})}).call(exports,__webpack_require__(1),__webpack_require__(34),__webpack_require__(44))},,function(t,e,i){(function(t){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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)}function r(){return 0!==m.length}var a,l,h,c,d,p,u,_,f,m,g,v;Object.defineProperty(e,"__esModule",{value:!0}),a=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},l=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=function(t,e,i){for(var o,n,s,r,a,l,h=!0;h;){if(o=t,n=e,s=i,h=!1,null===o&&(o=Function.prototype),void 0!==(r=Object.getOwnPropertyDescriptor(o,n))){if("value"in r)return r.value;if(void 0===(l=r.get))return;return l.call(s)}if(null===(a=Object.getPrototypeOf(o)))return;t=a,e=n,i=s,h=!0,r=a=void 0}},e.isOpenedModals=r,c=i(46),d=o(c),p=i(47),u=o(p),_=i(51),f=i(59),m=[],g={ajax:{},closingDuration:d.default.dur/2,overlayTemplate:'<div class="tv-dialog__overlay"></div>',containerTemplate:'<div class="tv-dialog__modal-wrap"><div class="tv-dialog__modal-container"><div class="tv-dialog__modal-body"></div></div></div>',ajaxErrorTemplate:'<div class="tv-dialog__error js-dialog__close">'+$.t("Error")+"</div>"},v=function(e){function i(){var t=this,e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];n(this,i),h(Object.getPrototypeOf(i.prototype),"constructor",this).call(this,a({},g,e)),this.$overlay=$(this.options.overlayTemplate),this.$modalWrap=$(this.options.containerTemplate),this.$body=this.$modalWrap.find(".tv-dialog__modal-body").append(this.$el),this.options.closeOnOutsideClick&&this.$overlay.add(this.$modalWrap).click(function(e){t.isEventOut(e)&&t.close()}),this.on("change:zIndex",function(){t.$overlay.css("z-index",t.zIndex),t.$modalWrap.css("z-index",t.zIndex)}),this.on("destroy",function(){var e=function(){t.$overlay.remove(),t.$modalWrap.remove()};t.opened?(t.close(),setTimeout(e,t.options.closingDuration)):e()}),this.on("beforeOpen",function(){m.push(t)}),this.options.ajax.url&&function(){var e=t.options.ajax.beforeSend||$.noop,i=t.options.ajax.success||!1,o=t.options.ajax.error||$.noop;$.extend(t.options.ajax,{beforeSend:function(){t.trigger("beforeLoading",t),t.startSpinner(),e(t)},success:function(e){t.trigger("afterLoading",t),t.renderContent(i?i(t,e):e).showContent(),t.trigger("afterLoadingShow",t)},error:function(){t.renderContent(t.options.ajaxErrorTemplate),o(t),t.trigger("errorLoading",t)}})}(),this.on("error",function(e,i){t.$modalWrap[0].getBoundingClientRect().height<t.$content[0].getBoundingClientRect().height&&i.addClass("i-fixed").css({width:t.$el.width()})})}return s(i,e),l(i,[{key:"open",value:function(){var t,e=this;if(!this.opened)return this.opened=!0,u.default.setFixedBodyState(!0),t=function(){e.focus(),e.toTop(),$("body").append(e.$overlay.addClass("i-hidden i-closed").css("z-index",e.zIndex)).append(e.$modalWrap.addClass("i-hidden i-closed").css("z-index",e.zIndex)),e.trigger("beforeOpen",e),e.$overlay.removeClass("i-hidden"),setTimeout(function(){e.$overlay.removeClass("i-closed")},20),e.options.ajax.url?e.ajaxRequest=$.ajax(e.options.ajax):e.showContent()},u.default.isMobileSafari?setTimeout(function(){return t()},50):t(),this}},{key:"close",value:function(){var e=this;if(this.opened)return this.opened=!1,this.trigger("beforeClose",this),this.ajaxRequest&&(this.ajaxRequest.abort(),delete this.ajaxRequest),this.hideContent(),this.$overlay.addClass("i-closed"),setTimeout(function(){e.$modalWrap.addClass("i-hidden").detach(),e.$overlay.addClass("i-hidden").detach(),m=t.without(m,e),u.default.setFixedBodyState(!1),e.trigger("afterClose",e),e.unfocus(),m.length>0&&m[m.length-1].focus(),e.options.destroyOnClose&&e.destroy()},this.options.closingDuration),this}},{key:"showContent",value:function(){var t=this;return this.$modalWrap.removeClass("i-hidden"),setTimeout(function(){t.$modalWrap.removeClass("i-closed")},20),setTimeout(function(){t.trigger("afterOpen",t),t.spinner&&t.stopSpinner()},.75*d.default.dur+20),this}},{key:"hideContent",value:function(){if(this.$el)return this.$modalWrap.addClass("i-closed"),this.unfocus(),this}},{key:"startSpinner",value:function(){return this.spinner=new f({radius:32,width:3,lines:16,length:0,corners:1,color:"#fff",opacity:.3,rotate:0,direction:1,speed:1.5,trail:60,fps:20,className:"spinner",zIndex:!1,top:"50%",left:"50%",shadow:!1,hwaccel:!1}),this.spinner.spin(this.$overlay[0]),this}},{key:"stopSpinner",value:function(){if(this.spinner)return this.spinner.stop(),delete this.spinner,this}}]),i}(_.TVDialogAbstract),e.TVModal=v}).call(e,i(44))},function(t,e){"use strict";e.dur=350,e.easingFunc={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.color={black0:"#000",black30:"#212121",black70:"#4A4A4A",black80:"#535353",black110:"#757575",black140:"#8A8A8A",black170:"#ADAEB0",black180:"#b4b4b4",black200:"#C8C8C8",black220:"#DADDE0",black230:"#ECECEC",black240:"#F2F2F2",black248:"#F8F8F8",brand:"#3BB3E4",brandHover:"#3BABD8",brandActive:"#3898C2",brandDown:"#049DDC",brand220:"#3BB3E0",brand255:"#3BB3FF",brandMedium80:"#3C4650",brandMedium100:"#627384",brandMedium120:"#758696",brandMedium150:"#94959C",brandMedium190:"#9DB2BD",brandMedium220:"#E9EFF2",brandMedium230:"#EAECEF",brandMedium240:"#F1F3F6",brandDark:"#2A2C39",brandDark50:"#252733",brandDark45:"#20222D",brandDarkText:"#6A6B74",danger:"#FF4A68",dangerHover:"#F24965",dangerDown:"#FF173E",success:"#3CBC98",success55:"#37BC9B",success250:"#00FFC0",successHover:"#38B395",successDown:"#00A97F",attention:"#FFC84A",attention50:"#F89E30"}},function(t,e,i){(function(o,n){"use strict";function s(){var t,e,i=l.width();for(c.width=i,c.height=l.height(),t=0;t<d.length;t++)if(i<=c.breakpoints[d[t]]){c.device!==d[t]&&(e=c.device,c.device=d[t],c.trigger("changeDevice",d[t],e));break}return c}var r,a,l,h,c,d;Object.defineProperty(e,"__esModule",{value:!0}),r=i(50),a=$("body"),l=$(window),h=0,c={width:null,height:null,device:null,checkDevice:s,isMobileSafari:!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)||!!navigator.userAgent.match("CriOS"),getScrollbarWidth:function(){var t=void 0;return function(){var e,i,o,n;return void 0===t&&(e=document.createElement("div"),e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e),i=e.offsetWidth,e.style.overflow="scroll",o=document.createElement("div"),o.style.width="100%",e.appendChild(o),n=o.offsetWidth,e.parentNode.removeChild(e),t=i-n),t}}(),hasScroll:function(t){return t.get(0).scrollHeight>t.height()},breakpoints:r.breakpoints,widgetbarBreakpoint:1064,setFixedBodyState:function(t){var e,i;t&&1==++h?(document.body.scrollHeight>document.body.clientHeight&&($(".widgetbar-wrap").css("right",c.getScrollbarWidth()),a.css("padding-right",parseInt(a.css("padding-right").replace("px",""))+c.getScrollbarWidth()+"px").data("wasScroll",!0)),a.css("top",-l.scrollTop()).addClass("i-no-scroll")):!t&&h>0&&0==--h&&(e=-parseInt(a.css("top").replace("px","")),a.removeClass("i-no-scroll").css("top",""),l.scrollTop(e),a.data("wasScroll")&&($(".widgetbar-wrap").css("right",0),i=parseInt(a.css("padding-right").replace("px",""))-c.getScrollbarWidth(),a.css("padding-right",(i<0?0:i)+"px").data("wasScroll",void 0)))}},d=Object.keys(c.breakpoints),o.extend(c,n),s(),$(s),l.on("resize",s),e.default=c,t.exports=e.default}).call(e,i(44),i(48))},,,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={"phone-vertical":479,phone:767,tablet:1019,desktop:1/0};e.breakpoints=i},function(t,e,i){(function(t,o,n){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(){u.forEach(function(t){return t.close()})}var l,h,c,d,p,u,_,f,m,g,v,y,b;Object.defineProperty(e,"__esModule",{value:!0}),l=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},h=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.closeAllDialogs=a,c=i(46),d=s(c),i(54),i(56),i(57),p=0,u=[],_=void 0,f=110,m=$(document),g={closeOnEsc:!0,closeButton:!0,focusFirstControl:!0,closeOnOutsideClick:!0,closeButtonAddClass:"",focusClass:"i-focused",template:'<div class="tv-dialog">',errorTemplate:'<div class="tv-dialog__error i-slided{{# errorMod }} tv-dialog__error--{{ errorMod }}{{/ errorMod }}">{{{ error }}}</div>',titleTemplate:'<div class="tv-dialog__section tv-dialog__section--title js-dialog__drag"><div class="js-title-text tv-dialog__title">{{{ title }}}</div></div>',contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border">',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',closeButtonTemplate:'<div class="tv-dialog__close js-dialog__close">'+i(58)+"</div>",helpButtonTemplate:'<a href="{{{ link }}}" target="_blank" class="tv-dialog__help apply-common-tooltip" title="{{{ title }}}"></a>',helpActionsMod:"tv-dialog__section--actions_with-help"},v={default:"tv-button tv-button--default",primary:"tv-button tv-button--primary",success:"tv-button tv-button--success",danger:"tv-button tv-button--danger",warning:"tv-button tv-button--warning",link:"tv-button tv-button--link","default-ghost":"tv-button tv-button--default_ghost","primary-ghost":"tv-button tv-button--primary_ghost","success-ghost":"tv-button tv-button--success_ghost","danger-ghost":"tv-button tv-button--danger_ghost","warning-ghost":"tv-button tv-button--warning_ghost"},y={_default:'<div data-name="{{ name }}" class="js-dialog__action-click {{ class }}">{{ text }}</div>',"submit-success":'<button type="submit" class="tv-button tv-button--success">{{ text }}</button>'},$(function(){g.$wrap=$(document.all&&!document.querySelector?"html":"body")}),b=function(){function e(){var i,s,a,h,c=this,d=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];for(r(this,e),t.extend(this,o),this.id=p++,this.loadingActions=[],this.disabledActions=[],this.firstFocusControl=null,this.options=l({},g,d),this.$el=$(n.render(this.options.template,{title:this.options.title,closeButton:this.options.closeButton})),this.$el.addClass("js-dialog"),this.el=this.$el[0],this.options.addClass&&this.$el.addClass(this.options.addClass),this.options.width&&this.$el.css({width:"100%","max-width":this.options.width}),this.options.title&&(this.$title=$(n.render(this.options.titleTemplate,{title:this.options.title})).appendTo(this.$el)),this.$content=$(this.options.contentWrapTemplate).appendTo(this.$el),this.$contentIn=this.$content;this.$contentIn.length;)this.$contentIn=this.$contentIn.children();if(this.$contentIn=this.$contentIn.end(),this.options.content&&this.renderContent(this.options.content),(this.options.actions||this.options.help)&&(this.$content.hasClass("tv-dialog__section")&&this.$content.addClass("tv-dialog__section--no-padding_bottom"),this.$actions=$(this.options.actionsWrapTemplate).appendTo(this.$el)),this.options.actions)for(this.actions={},this.$el.on("click",".js-dialog__action-click",function(t){c.actionDispatcher($(t.currentTarget).data("name"))}),i=function(t){var e=c.options.actions[t];e.type||(e.type="default"),e.class||(e.class=v[e.type]?v[e.type]:v.default),c.actions[e.name]=$(n.render(e.template?e.template:y[e.type]||y._default,e,e)).appendTo(c.$actions),e.method&&"function"==typeof c[e.method]&&c.on("action:"+e.name,c[e.method].bind(c)),e.addClass&&c.actions[e.name].addClass(e.addClass),e.key&&function(){var t=$.isArray(e.key)?e.key:[e.key],i=function(i){c.focused&&t.indexOf(i.keyCode)!==-1&&c.actionDispatcher(e.name)};c.on("afterOpen",function(){return m.on("keyup",i)}),c.on("beforeClose",function(){return m.off("keyup",i)})}()},s=this.options.actions.length-1;s>=0;s--)i(s);this.options.help&&$(n.render(this.options.helpButtonTemplate,this.options.help)).prependTo(this.$actions.addClass(this.options.helpActionsMod)),this.options.closeButton&&(a=$(this.options.closeButtonTemplate),a.addClass(this.options.closeButtonAddClass||""),h=this.$el,1===this.$el.find(".js-close-button-place").length&&(h=this.$el.find(".js-close-button-place")),a.appendTo(h)),this.setZIndex(f+u.length),d.errorMod&&(this.errorMod=d.errorMod),this.on("afterOpen",function(){c.options.focusFirstControl&&!Modernizr.touch&&(c.firstFocusControl||c.$el.find('input:not([type="hidden"]), textarea').first()).focus()}),this.$el.on("click",".js-dialog__close",this.close.bind(this)),this.$el.on("mousedown touchstart",this.focus.bind(this)),u.push(this)}return h(e,[{key:"renderContent",value:function(t){return this.$contentIn.html("function"==typeof t?t(this):t),this}},{key:"setZIndex",value:function(t){return this.zIndex=t,this.trigger("change:zIndex",this),this}},{key:"toTop",value:function(){for(var t=u.length-1;t>=0;t--)u[t].zIndex>this.zIndex&&u[t].setZIndex(u[t].zIndex-1);return this.setZIndex(f+u.length),this}},{key:"isEventOut",value:function(t){var e,i,o;return this.options.isClickOutFn&&void 0!==(e=this.options.isClickOutFn(t))?e:(i=!0,o=$(t.target),o.get(0)!==this.$el.get(0)&&($(">*",this.$el).each(function(){o.get(0)===$(this).get(0)&&(i=!1),0===o.closest("HTML",$(this).get(0)).length&&(i=!1)}),i))}},{key:"focus",value:function(){var t=this;_!==this&&(_&&_.unfocus(),this.focused=!0,_=this,this.$el.addClass(this.options.focusClass),this.trigger("focus",this),setTimeout(function(){m.on("mousedown.tv-dialog-unfocus-"+t.id,function(e){t.isEventOut(e)&&(t.unfocus(),m.off("mousedown.tv-dialog-unfocus-"+t.id))})},20))}},{key:"unfocus",value:function(){this.focused=!1,_===this&&(_=void 0),this.$el.removeClass(this.options.focusClass).find(":focus").blur(),this.trigger("unfocus",this)}},{key:"isFocused",value:function(){return this.focused}},{key:"setTitle",value:function(t){var e=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];return this.$title.toggleClass("tv-dialog__section--one-line apply-overflow-tooltip",e),this.$title.html(t),this}},{key:"setTitleText",value:function(t){this.$title.find(".js-title-text").text(t)}},{key:"actionDispatcher",value:function(t){this.disabledActions.includes(t)||this.loadingActions.includes(t)||this.trigger("action:"+t,this)}},{key:"toggleAction",value:function(e,i){return!i&&this.disabledActions.includes(e)?this.disabledActions.push(e):i&&this.disabledActions.includes(e)&&(this.disabledActions=t.without(this.disabledActions,e)),this.actions[e].toggleClass("i-disabled",!i),this}},{key:"actionLoader",value:function(e){var i=this,o=arguments.length<=1||void 0===arguments[1]?"init":arguments[1];return this.actions[e].tvButtonLoader(o),"init"===o&&(this.actions[e].off("tv-button-loader:start.dialog-action").on("tv-button-loader:start.dialog-action",function(){i.loadingActions.push(e)}),this.actions[e].off("tv-button-loader:stop.dialog-action").on("tv-button-loader:stop.dialog-action",function(){i.loadingActions=t.without(i.loadingActions,e)})),this}},{key:"error",value:function(t){var e=$(n.render(this.options.errorTemplate,{error:t,errorMod:this.errorMod})).appendTo(this.$el),i=function(){e.addClass("i-slided"),setTimeout(function(){return e.remove()},.75*d.default.dur)};return setTimeout(function(){return e.removeClass("i-slided")},20),m.one("touchstart mousedown keydown",i),this.trigger("error",this,e),this}},{key:"destroy",value:function(){u=t.without(u,this);for(var e=0;e<u.length;e++)u[e].setZIndex(f+e);this.trigger("destroy",this)}}]),e}(),e.TVDialogAbstract=b,m.on("keyup.tv-dialog-esc",function(t){_&&_.options.closeOnEsc&&27===t.keyCode&&_.close()})}).call(e,i(44),i(48),i(52))},,,function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s,r,a,l,h;Object.defineProperty(e,"__esModule",{value:!0}),s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(55),a=i(46),l=o(a),$.fn.tvButtonLoader=(0,r.createTvBlockWithInstance)("tv-button-loader",function(t,e){return new h(t,e)}),h=function(){function t(e,i){n(this,t),this.$btn=$(e).addClass("tv-button--loader"),0===this.$btn.find(".tv-button__loader").length&&this.$btn.html('<span class="tv-button__text">'+this.$btn.html()+'</span><span class="tv-button__loader"><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span></span>'),this.loading=this.$btn.hasClass("i-loading")}return s(t,[{key:"_start",value:function(){var t=this;this.starting=!0,this.$btn.addClass("i-start-load"),this.$btn.trigger("tv-button-loader:start"),setTimeout(function(){t.loading=!0,t.starting=!1,t._startPromise=!1,t.$btn.addClass("i-loading"),t.$btn.removeClass("i-start-load"),t._stopPromise&&t._stop()},2*l.default.dur)}},{key:"start",value:function(){this.starting||(this.stopping?this._startPromise=!0:this._start())}},{key:"_stop",value:function(){var t=this;this.stopping=!0,this.$btn.addClass("i-stop-load"),this.$btn.trigger("tv-button-loader:stop"),setTimeout(function(){t.loading=!1,t.stopping=!1,t._stopPromise=!1,t.$btn.removeClass("i-loading i-start-load i-stop-load"),t._startPromise&&t._start()},l.default.dur)}},{key:"stop",value:function(){this.stopping||(this.starting?this._stopPromise=!0:this._stop())}},{key:"toggle",value:function(){this.loading?this.stop():this.start()}},{key:"contentHtml",value:function(t){return t?(this.$btn.find(".tv-button__text").html(t),t):this.$btn.find(".tv-button__text").html()}},{key:"contentNojQuery",value:function(){return this.$btn.get(0)}},{key:"disable",value:function(){this.stop(),this.$btn.addClass("i-disabled")}},{key:"enable",value:function(){this.$btn.removeClass("i-disabled")}}]),t}(),e.ButtonLoader=h},function(t,e){"use strict";function i(t){if(t)return function(e,i,o){function n(e,i){return i?t[e](a,i):t[e](a)}var s,r,a=$(this);return"get"===e?(s=i,"function"==typeof t[s]?n(s,o):t[s]):t[e]?a.each(function(){return n(e,r)}):a}}function o(t,e){function i(t,e,i){return void 0===i?t[e]():t[e](i)}if(t&&e)return t=""+t,function(o,n,s){var r,a,l;return"get"===o?r=n:(a=n,"object"==typeof o&&void 0===n?(a=o,o="init"):"string"!=typeof o&&(o="init")),"getInstance"===o?$(this).eq(0).data(t):"get"===o?(l=$(this).eq(0).data(t),l?"function"==typeof l[r]?i(l,r,s):l[r]:void console.warn("[Block Plugin] Trying to get prop or execute method of "+t+" but it has not been inited")):$(this).each(function(){var n=$(this),s=n.data(t);void 0===s?(s=void 0===a?e(n):e(n,a),n.data(t,s)):"init"===o&&(console.warn("[ Block Plugin: "+t+" ] - Try to init but plugin is already inited. Trace:"),console.trace()),"init"!==o&&("function"==typeof s[o]?i(s,o,a):TradingView.logError("[Block Plugin] "+t+" does not support command "+o,!0))})}}t.exports.createTvBlockPlugin=i,t.exports.createTvBlockWithInstance=o},function(t,e){},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M5.182 6.596l-3.889-3.889-.707-.707 1.414-1.414.707.707 3.889 3.889 3.889-3.889.707-.707 1.414 1.414-.707.707-3.889 3.889 3.889 3.889.707.707-1.414 1.414-.707-.707-3.889-3.889-3.889 3.889-.707.707-1.414-1.414.707-.707 3.889-3.889z"/></svg>'},function(t,e,i){var o,n;!function(s,r){"object"==typeof t&&t.exports?t.exports=r():(o=r,void 0!==(n="function"==typeof o?o.call(e,i,e,t):o)&&(t.exports=n))}(0,function(){"use strict";function t(t,e){var i,o=document.createElement(t||"div");for(i in e)o[i]=e[i];return o}function e(t){for(var e=1,i=arguments.length;e<i;e++)t.appendChild(arguments[e]);return t}function i(t,e,i,o){var n=["opacity",e,~~(100*t),i,o].join("-"),s=.01+i/o*100,r=Math.max(1-(1-t)/e*(100-s),t),a=h.substring(0,h.indexOf("Animation")).toLowerCase(),l=a&&"-"+a+"-"||"";return u[n]||(c.insertRule("@"+l+"keyframes "+n+"{0%{opacity:"+r+"}"+s+"%{opacity:"+t+"}"+(s+.01)+"%{opacity:1}"+(s+e)%100+"%{opacity:"+t+"}100%{opacity:"+r+"}}",c.cssRules.length),u[n]=1),n}function o(t,e){var i,o,n=t.style;if(e=e.charAt(0).toUpperCase()+e.slice(1),void 0!==n[e])return e;for(o=0;o<p.length;o++)if(i=p[o]+e,void 0!==n[i])return i}function n(t,e){for(var i in e)t.style[o(t,i)||i]=e[i];return t}function s(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)void 0===t[o]&&(t[o]=i[o])}return t}function r(t,e){return"string"==typeof t?t:t[e%t.length]}function a(t){this.opts=s(t||{},a.defaults,_)}function l(){function i(e,i){return t("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',i)}c.addRule(".spin-vml","behavior:url(#default#VML)"),a.prototype.lines=function(t,o){function s(){return n(i("group",{coordsize:c+" "+c,coordorigin:-h+" "+-h}),{width:c,height:c})}function a(t,a,l){e(p,e(n(s(),{rotation:360/o.lines*t+"deg",left:~~a}),e(n(i("roundrect",{arcsize:o.corners}),{width:h,height:o.scale*o.width,left:o.scale*o.radius,top:-o.scale*o.width>>1,filter:l}),i("fill",{color:r(o.color,t),opacity:o.opacity}),i("stroke",{opacity:0}))))}var l,h=o.scale*(o.length+o.width),c=2*o.scale*h,d=-(o.width+o.length)*o.scale*2+"px",p=n(s(),{position:"absolute",top:d,left:d});if(o.shadow)for(l=1;l<=o.lines;l++)a(l,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(l=1;l<=o.lines;l++)a(l);return e(t,p)},a.prototype.opacity=function(t,e,i,o){var n=t.firstChild;o=o.shadow&&o.lines||0,n&&e+o<n.childNodes.length&&(n=n.childNodes[e+o],n=n&&n.firstChild,(n=n&&n.firstChild)&&(n.opacity=i))}}var h,c,d,p=["webkit","Moz","ms","O"],u={},_={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",opacity:.25,rotate:0,direction:1,speed:1,trail:100,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"absolute"};return a.defaults={},s(a.prototype,{spin:function(e){var i,o,s,r,a,l,c,d,p,u;return this.stop(),i=this,o=i.opts,s=i.el=t(null,{className:o.className}),n(s,{position:o.position,width:0,zIndex:o.zIndex,left:o.left,top:o.top}),e&&e.insertBefore(s,e.firstChild||null),s.setAttribute("role","progressbar"),i.lines(s,i.opts),h||(r=0,a=(o.lines-1)*(1-o.direction)/2,c=o.fps,d=c/o.speed,p=(1-o.opacity)/(d*o.trail/100),u=d/o.lines,function t(){r++;for(var e=0;e<o.lines;e++)l=Math.max(1-(r+(o.lines-e)*u)%d*p,o.opacity),i.opacity(s,e*o.direction+a,l,o);i.timeout=i.el&&setTimeout(t,~~(1e3/c))}()),i},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=void 0),this},lines:function(o,s){function a(e,i){return n(t(),{position:"absolute",width:s.scale*(s.length+s.width)+"px",height:s.scale*s.width+"px",background:e,boxShadow:i,transformOrigin:"left",transform:"rotate("+~~(360/s.lines*c+s.rotate)+"deg) translate("+s.scale*s.radius+"px,0)",borderRadius:(s.corners*s.scale*s.width>>1)+"px"})}for(var l,c=0,d=(s.lines-1)*(1-s.direction)/2;c<s.lines;c++)l=n(t(),{position:"absolute",top:1+~(s.scale*s.width/2)+"px",transform:s.hwaccel?"translate3d(0,0,0)":"",opacity:s.opacity,animation:h&&i(s.opacity,s.trail,d+c*s.direction,s.lines)+" "+1/s.speed+"s linear infinite"}),s.shadow&&e(l,n(a("#000","0 0 4px #000"),{top:"2px"})),e(o,e(l,a(r(s.color,c),"0 0 1px rgba(0,0,0,.1)")));return o},opacity:function(t,e,i){e<t.childNodes.length&&(t.childNodes[e].style.opacity=i)}}),"undefined"!=typeof document&&(c=function(){var i=t("style",{type:"text/css"});return e(document.getElementsByTagName("head")[0],i),i.sheet||i.styleSheet}(),d=n(t("group"),{behavior:"url(#default#VML)"}),!o(d,"transform")&&d.adj?l():h=o(d,"animation")),a})},function(t,e,i){"use strict";function o(t){$(t).attr("title")||t.offsetWidth+s>=t.scrollWidth||$(t).attr("title",$(t).text())}var n,s;i(61),n=i(63),s=$.browser.msie||/\btrident\b/i.test(navigator.userAgent)?1:0,$(function(){$(document).on("mouseenter",".apply-overflow-title",function(){o(this)}),$(document).on("mouseenter",".apply-overflow-tooltip",function(){function t(){n.hide(),e.off("mouseleave mousedown",t)}var e=$(this);e[0].offsetWidth+s>=e[0].scrollWidth||(n.showOnElement(e[0],{text:e.text()}),e.on("mouseleave mousedown",t))})})},,,function(t,e,i){"use strict";function o(t,e){var i,o,n;return void 0===e&&(e=!1),i=t.data("commonTooltipText")||"",o=t.attr("title"),i||o||e?(o&&(i=TradingView.strip_tags(o),t.data("commonTooltipText",i),t.removeAttr("title")),n={h:t.outerHeight(),w:t.outerWidth(),x:t.offset().left-$(window).scrollLeft(),y:t.offset().top-$(window).scrollTop()},{above:t.hasClass("common-tooltip-above"),below:t.hasClass("common-tooltip-below"),html:t.hasClass("common-tooltip-html"),otl:t.hasClass("common-tooltip-otl"),otr:t.hasClass("common-tooltip-otr"),rect:n,text:i,vertical:t.hasClass("common-tooltip-vertical")}):null}function n(t){var e=m.indexOf(t)!==-1?f[t]:"";d.removeClass(m.filter(function(t){return!!t}).map(function(t){return f[t]}).join(" ")),e&&!d.hasClass(e)&&d.addClass(e)}function s(t){var e,i,o,n,s=t.rect;s&&(d.attr("class","common-tooltip-wrapper").css({bottom:"auto",left:"auto",right:"auto",top:"auto"}),Modernizr.pointerevents||d.addClass("no-pointer-events"),p.css({left:"0",width:"auto"}),p.width(p.width()+2),e=$(window).width(),i=$(window).height(),o=t.vertical,(o&&s.w<20||!o&&s.h<20)&&d.addClass("farther"),n="",o?(d.addClass("vertical").css({left:s.x+s.w,top:s.y-(d.outerHeight()-s.h)/2}),n=t.otr?"otr":t.otl||p.offset().left+p.outerWidth()+c>e?"otl":"otr","otl"===n?d.addClass("otl").css({left:"auto",right:e-s.x}):d.addClass("otr")):(d.css({bottom:i-s.y,left:s.x-(d.outerWidth()-s.w)/2}),n=t.above?"above":t.below||p.offset().top-$(window).scrollTop()<c?"below":"above","below"===n?d.addClass("below").css({bottom:"auto",top:s.y+s.h}):d.addClass("above"),p.offset().left-c<0?p.css("left",Math.abs(p.offset().left)+c):p.offset().left+p.outerWidth()+c>e&&p.css("left",e-(p.offset().left+p.outerWidth()+c))))}function r(){clearTimeout(u),clearTimeout(_),document.body.contains(d[0])&&(d.css("opacity","0"),_=setTimeout(d.detach.bind(d),h/2))}function a(t,e){var i,n;void 0===e&&(e={}),i=$(t),0!==i.length&&(n=!(!e.text&&!e.$inner),e=$.extend({},o(i,n),e),$.isEmptyObject(e)||l(e))}function l(t){var e=document.body.contains(d[0]);if(clearTimeout(u),clearTimeout(_),!e)return void(u=setTimeout(function(){d.appendTo(document.body),l(t)},h));t.$inner?p.empty().append(t.$inner):t.html?p.html(t.text||""):p.text(t.text||""),s(t),n(t.colorTheme||"default"),d.addClass(t.addClass||""),d.css("opacity","1")}var h,c,d,p,u,_,f,m;i(61),i(64),h=500,c=10,d=$("<div>").css("opacity","0"),p=$('<div class="common-tooltip-body">').appendTo(d),u=0,_=0,f={default:"",white:"theme-white"},m=Object.keys(f),e.hide=r,e.showOnElement=a,e.show=l,Modernizr.touch||$(document).on("mouseenter",".apply-common-tooltip",function(t){function e(){i.off("mouseleave mousedown",e),$(document).off("scroll",e),r()}var i,o=t;if("buttons"in o){if(1&o.buttons)return}else if(1===t.which)return;i=$(this),a(i),i.on("mouseleave mousedown",e),$(document).on("scroll",e)})},function(t,e){"use strict";var i=window.Modernizr=function(t,e,i){function o(t){v.cssText=t}function n(t,e){return typeof t===e}function s(t,e){return!!~(""+t).indexOf(e)}function r(t,e){var o,n;for(o in t)if(n=t[o],!s(n,"-")&&v[n]!==i)return"pfx"!=e||n;return!1}function a(t,e,o){var s,r;for(s in t)if((r=e[t[s]])!==i)return o===!1?t[s]:n(r,"function")?r.bind(o||e):r;return!1}function l(t,e,i){var o=t.charAt(0).toUpperCase()+t.slice(1),s=(t+" "+w.join(o+" ")+o).split(" ");return n(e,"string")||n(e,"undefined")?r(s,e):(s=(t+" "+S.join(o+" ")+o).split(" "),a(s,e,i))}var h,c,d,p="2.8.3",u={},_=!0,f=e.documentElement,m="modernizr",g=e.createElement(m),v=g.style,y=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),b="Webkit Moz O ms",w=b.split(" "),S=b.toLowerCase().split(" "),T={},C=[],x=C.slice,P=function(t,i,o,n){var s,r,a,l,h=e.createElement("div"),c=e.body,d=c||e.createElement("body");if(parseInt(o,10))for(;o--;)a=e.createElement("div"),a.id=n?n[o]:m+(o+1),h.appendChild(a);return s='&#173;<style id="s'+m+'">'+t+"</style>",h.id=m,(c?h:d).innerHTML+=s,d.appendChild(h),c||(d.style.background="",d.style.overflow="hidden",l=f.style.overflow,f.style.overflow="hidden",f.appendChild(d)),r=i(h,t),c?h.parentNode.removeChild(h):(d.parentNode.removeChild(d),f.style.overflow=l),!!r},L=function(){function t(t,s){s=s||e.createElement(o[t]||"div"),t="on"+t;var r=t in s;return r||(s.setAttribute||(s=e.createElement("div")),s.setAttribute&&s.removeAttribute&&(s.setAttribute(t,""),r=n(s[t],"function"),n(s[t],"undefined")||(s[t]=i),s.removeAttribute(t))),s=null,r}var o={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t}(),k={}.hasOwnProperty;c=n(k,"undefined")||n(k.call,"undefined")?function(t,e){return e in t&&n(t.constructor.prototype[e],"undefined")}:function(t,e){return k.call(t,e)},Function.prototype.bind||(Function.prototype.bind=function(t){var e,i,o=this;if("function"!=typeof o)throw new TypeError;return e=x.call(arguments,1),i=function(){var n,s,r;return this instanceof i?(n=function(){},n.prototype=o.prototype,s=new n,r=o.apply(s,e.concat(x.call(arguments))),Object(r)===r?r:s):o.apply(t,e.concat(x.call(arguments)))}}),T.flexbox=function(){return l("flexWrap")},T.canvas=function(){var t=e.createElement("canvas");return!!t.getContext&&!!t.getContext("2d")},T.canvastext=function(){return!!u.canvas&&!!n(e.createElement("canvas").getContext("2d").fillText,"function")},T.touch=function(){var i;return"ontouchstart"in t||t.DocumentTouch&&e instanceof DocumentTouch?i=!0:P("@media ("+y.join("touch-enabled),(")+m+"){#modernizr{top:9px;position:absolute}}",function(t){i=9===t.offsetTop}),i},T.history=function(){return!!t.history&&!!history.pushState},T.draganddrop=function(){var t=e.createElement("div");return"draggable"in t||"ondragstart"in t&&"ondrop"in t},T.websockets=function(){return"WebSocket"in t||"MozWebSocket"in t},T.multiplebgs=function(){return o("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(v.background)},T.csscolumns=function(){return l("columnCount")},T.csstransitions=function(){return l("transition")},T.localstorage=function(){try{return localStorage.setItem(m,m),localStorage.removeItem(m),!0}catch(t){return!1}};for(d in T)c(T,d)&&(h=d.toLowerCase(),u[h]=T[d](),C.push((u[h]?"":"no-")+h));return u.addTest=function(t,e){if("object"==typeof t)for(var o in t)c(t,o)&&u.addTest(o,t[o]);else{if(t=t.toLowerCase(),u[t]!==i)return u;e="function"==typeof e?e():e,void 0!==_&&_&&(f.className+=" feature-"+(e?"":"no-")+t),u[t]=e}return u},o(""),g=null,u._version=p,u._prefixes=y,u._domPrefixes=S,u._cssomPrefixes=w,u.hasEvent=L,u.testProp=function(t){return r([t])},u.testAllProps=l,u.testStyles=P,f.className=f.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(_?" feature-js feature-"+C.join(" feature-"):""),u}(window,document);!i.touch||"onorientationchange"in window||(i.touch=!1,document.documentElement.className=document.documentElement.className.replace("feature-touch","feature-no-touch")),i.addTest("pointerevents",function(){var t,e=document.createElement("x"),i=document.documentElement,o=window.getComputedStyle,n=!1;return"pointerEvents"in e.style&&(e.style.pointerEvents="auto",e.style.pointerEvents="x",i.appendChild(e),o&&(t=o(e,""),n=!!t&&"auto"===t.pointerEvents),i.removeChild(e),!!n)}),i.addTest("flexbox",i.testAllProps("flexBasis","1px",!0))},function(t,e,i){(function(t,e,o){"use strict";var n,s,r,a=i(30),l=i(66).createNoticeDialog;i(70),n=null,s=function(t){n||(n=l({type:"modal",title:t.title,content:t.content}).open(),n.on("beforeClose",function(){n=null}))},r=window.TVDialogs={modalDialog:null,dialogs:[],messageInterval:null,messageDelay:4e3,NOTIFICATION_ANIMATION_START_OFFSET:"-33px",_constrainDraggableOptionsIfNeeded:function(e){return t.enabled("constraint_dialogs_movement")&&(e.containment=".chart-page"),e},validateHelpers:{isErrorListening:function(t){t.on("keyup.error-checker",r.validateHelpers.isError(t.val(),t))},isError:function(t,e){return function(){e.val()!==t&&(e.removeClass("error"),e.off("keyup.error-checker"))}},makeValidator:function(t,e,i,o,n){return function(s){var a,l,h;if(t.removeClass("error"),$("._tv-dialog-field-error").hide(),""!==s.errors)if("object"==typeof s.errors){for(a in s.errors)l=t.filter("input[name^="+a+"]"),l.addClass("error").data("error",s.errors[a][0]),r.validateHelpers.isErrorListening(l);h=t.filter(".error").first().focus(),r.showError(h.data("error"),n)}else r.showError($.t("Error:")+s.errors,n);else"function"==typeof o&&o(s,i);e.removeClass("process")}}},applyMQMatcher:function(t){var e,i;t||(t=r.modalDialog),e=function(){r.positionDialog()},window.matchMedia&&(i=["(max-height: 645px)","(max-width: 460px)"].map(function(t){var i=matchMedia(t);return i.addListener(e),i}),t.on("destroy",function(){i.forEach(function(t){t.removeListener(e)})}))},showBrowserExtensionDialog:function(t){var o,n;if(t)return o={chrome:{logo:"images/svg/google-chrome-logo.svg",name:"Google Chrome",href:"https://chrome.google.com/webstore/detail/tradingview-free-quotes-a/ommjfbdmijjlbhlhnnnfkmbnkpnjpipj"}},n=i(72),r.createModalDialog("Browser Extension",{noHeader:!0,width:"730px",content:e.render(n.dialogs.browserExtension,{browser:o[t]})}),r.modalDialog.find(".install-extension, ._tv-dialog-title-close").click(function(t){r.destroy()}),r.positionDialog(),r.modalDialog},showIntervalMismatchDialog:function(t){var e,i,o,n,s,a,l=!1;l=l||!1,r.createModalDialog($.t("Interval is not applicable"),{addClass:"tv-interval-is-not-applicable-dialog"}),e=r.modalDialog,e.css({zIndex:1e3}),e.find("._tv-dialog").css("width","400px"),i=r.modalDialog.find("._tv-dialog-content"),i.html('<div class="main"><div class="caption-big">'+$.t("<p>Only <b>D, W, M</b> intervals are supported for this symbol/exchange. You will be automatically switched to a D interval. Intraday intervals are not available because of exchange policies.</p>")+'</div><div class="main-properties"></div></div>'),o=i.find(".main-properties"),n=$('<div class="dialog-buttons"></div>').appendTo(o),t&&(s=$('<label class="dialog-trail-checkbox"><input type="checkbox" /> '+$.t("Do not show this message again")+"</label>").appendTo(n),a=s.find("input"),a.attr("checked",t.silentIntervalChange.value()),a.bind("click",function(){t.silentIntervalChange.setValue(this.checked)})),$('<a class="_tv-button ok">OK</a>').appendTo(n).bind("click",function(){r.destroy()}),r.positionDialog(),r.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:l})},showGoProDialog:function(){},showCMEdataOffer:function(t,o){function n(){c.html(d.cmeOfferDialog.stage1),c.find("._tv-dialog-title-close").on("click",function(){r.destroy()}),c.find(".js-next").on("click",s),l()}function s(){c.html(d.cmeOfferDialog.stage2),c.find(".js-connect").tvButtonLoader(),c.find("form").on("submit",function(t){t.preventDefault(),$(this).tvButtonLoader("start"),$.ajax({method:"GET",url:"/cqg-credentials/",data:{password:$(this).find('input[name="password"]').val(),login:$(this).find('input[name="login"]').val()}}).done(function(t){"ok"===t.status?a({okStatus:!0}):(TradingView.logNormal("Check CGQ credentionals failed. Reason: "+t.message),a({okStatus:!1}))})}),l()}function a(t){c.html(e.render(d.cmeOfferDialog.stage3,t)),c.find("._tv-dialog-title-close").on("click",function(){r.destroy()}),c.find(".js-try-again").on("click",function(t){t.preventDefault(),s()}),t.okStatus===!0&&o(),l()}function l(){r.applyMQMatcher(h),r.positionDialog(),r.applyHandlers(null,{doNotCloseOnBgClick:!0,doNotCloseOnEsc:!0})}var h,c,d;return is_authenticated?(t=$.extend({},t),h=r.createModalDialog($.t("CME Group Non-Professional User Fees"),{addClass:"cme-offer-dialog"}),c=r.modalDialog.find("._tv-dialog-content"),d=i(72),n(),h):void showSignModal()},showFXCMdataOffer:function(t,o){function n(){h.html(e.render(p.fxcmOfferDialog.stage1,{})),h.find("._tv-dialog-title-close").on("click",function(){r.destroy()}),h.find(".js-go-alternative").on("click",function(t){r.destroy(),t.preventDefault()});var i=h.find(".js-type-selector");["real","demo"].forEach(function(t){i.find("a."+t).toggleClass("active",t===d).on("click",function(e){e.preventDefault(),d=t,i.find("a").removeClass("active"),$(e.target).addClass("active")})}),h.find("form").on("submit",function(e){e.preventDefault(),h.find(".js-connect").addClass("process"),t({password:$(this).find('input[name="password"]').val(),login:$(this).find('input[name="login"]').val(),mode:d}).then(function(t){h.find(".js-connect").removeClass("process"),t?(c=!0,s({okStatus:!0})):s({okStatus:!1})}).catch(function(){s({okStatus:!1})})}),a()}function s(t){h.html(e.render(p.fxcmOfferDialog.stage2,t)),h.find("._tv-dialog-title-close").on("click",function(){r.destroy()}),h.find(".js-try-again").on("click",function(t){t.preventDefault(),n()}),h.find(".js-ok").on("click",function(t){t.preventDefault(),r.destroy()}),a()}function a(){r.applyMQMatcher(l),r.positionDialog(),r.applyHandlers(null,{doNotCloseOnBgClick:!0,doNotCloseOnEsc:!0})}var l,h,c=!1,d="demo",p=i(72);window.runOrSignIn(function(){l=r.createModalDialog($.t("FXCM CFD data is available only to FXCM account holders"),{addClass:"cme-offer-dialog"}),h=r.modalDialog.find("._tv-dialog-content"),$(l).on("destroy",function(){o(c)}),n()})},showSignInDialog:function(t,e){},goRegistrate:function(t){},showPublishIntroDialog:function(t){},makeDraggable:function(t){t.draggable({handle:"._tv-dialog-title"})},showAlertTextNotesDialog:function(){s({title:$.t("Oops!"),content:'<div class="tv-text">'+$.t('Text Notes are available only on chart page. Please <a href="/chart/">open a chart</a> and then try again.')+"</div>"})},showNotice:function(t,i,o){var n,s,a,l,h,c;return"object"==typeof i&&(o=i,i=""),o=o||{},n=o.doNotCloseOnBgClick||!1,s=o.html||"",a=o.width||"400px",l={},l.noClose=o.noClose||null,l.addClass=o.modalDialogClass||null,r.createModalDialog(t,l),h=o.centerCaption?"caption-big-center":"caption-big",r.modalDialog.find("._tv-dialog").css("width",a),c=o.customButtonCaption?o.customButtonCaption:$.t("OK"),r.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><div class="{{captionClassName}} {{classSuffix}}">{{text}}'+s+'</div>{{^removeOkButton}}<div class="buttons"><input type="button" class="_tv-button ok" value="'+c+'"/></div>{{/removeOkButton}}</div>',{captionClassName:h,classSuffix:o.classSuffix||"",text:i,removeOkButton:o&&o.removeOkButton})),r.modalDialog.find("._tv-button.ok").on("click",function(){r.destroy(),o.onOkButtonClick&&o.onOkButtonClick()}),r.positionDialog(),r.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:n,beforeDestroy:o.onClose}),r.modalDialog},showConfirm:function(t,i,o,n,s){var a,l;return s=s||{},s.dontAskSetting&&TVSettings.getBool(s.dontAskSetting)?void o():(a=r.createModalDialog(t,s),r.modalDialog.find("._tv-dialog").css("width",s.customWidth?s.customWidth:"400px"),r.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><div class="caption-big">{{{text}}}</div>{{#dontAskSetting}}<input type="checkbox" id="confirm-dialog-checkbox" style="margin: 0; vertical-align: middle;"> <label for="confirm-dialog-checkbox" style="font-size: 11px;">'+$.t("Do not ask again")+'</label>{{/dontAskSetting}}</div><div class="_tv-dialogs-bottom _tv-dialog-center"><input class="_tv-button wide ok" type="button" value="'+$.t("YES")+'" style="margin-right: 10px;"/><input class="_tv-button wide cancel" type="button" value="'+$.t("NO")+'"/></div>',{text:i,dontAskSetting:!!s.dontAskSetting})),s.okButtonText&&r.modalDialog.find(".ok").val(s.okButtonText),s.cancelButtonText&&r.modalDialog.find(".cancel").val(s.cancelButtonText),l=r.modalDialog.find(".ok"),l.click(function(){s.dontAskSetting&&$("#confirm-dialog-checkbox").is(":checked")&&TVSettings.setValue(s.dontAskSetting,!0),o(),s.manualClose||r.destroy()}),r.modalDialog.find(".cancel").click(function(){n&&n(),s.manualCloseOnCancel||r.destroy()}),r.positionDialog(),r.applyHandlers(a,{processEnterButton:l}),a)},showPrompt:function(t,i,o,n,s){function a(){var t,e=c.val();if(h&&(t=h(e)))return t===!0&&(t=$.t("Wrong value")),void r.showError(t,r.modalDialog);r.destroy(),o&&o(e)}var l,h,c;s=s||{},l=s&&s.defaultValue,h=s&&s.validate,r.createModalDialog(t,s),r.modalDialog.find("._tv-dialog").css("width","400px"),r.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><form><div class="caption-big-center slim">{{text}}: <input type="text" name="prompt-value" class="prompt-value"/></div></form></div><div class="_tv-dialogs-bottom _tv-dialog-{{bottomAlign}}"><input class="_tv-button wide ok" type="button" value="'+$.t("OK")+'" style="margin-right: 10px;"/><input class="_tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/></div>',{text:i,bottomAlign:s.bottomAlign?s.bottomAlign:"center"})),c=r.modalDialog.find('[name="prompt-value"]'),l&&c.val(l),r.modalDialog.find("form").submit(function(t){a(),t.preventDefault()}),r.modalDialog.find(".ok").click(function(t){a(),t.preventDefault()}),r.modalDialog.find(".cancel").click(function(){r.destroy(),n&&n()}),r.positionDialog(),r.applyHandlers(),setTimeout(function(){c.focus().select()},0)},showCustomDialog:function(t){function e(e){var i=t.action(r.modalDialog),o=i&&!i.error,n=void 0===i,s=i&&i.notClose;!o&&!n||s?i.error&&r.showError(i.error):r.destroy(),e.preventDefault()}function i(e){"function"==typeof t.onCancel?t.onCancel():r.destroy()}return r.createModalDialog(t.title||$.t("Dialog"),{addClass:t.addClass||""}),r.modalDialog.find("._tv-dialog").css("width",t.width||"400px"),r.modalDialog.find("._tv-dialog-content").html('<div class="main">'+(t.html||$.t("Content"))+"</div>"+(t.noButtons?"":'<div class="_tv-dialogs-bottom _tv-dialog-center">'+(t.noButtonOk?"":'<input class="_tv-button wide ok" type="button" value="'+$.t("OK")+'" style="margin-right: 10px;"/>')+(t.noButtonCancel?"":'<input class="_tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/>')+"</div>")),t.okButtonText&&r.modalDialog.find(".ok").val(t.okButtonText),t.cancelButtonText&&r.modalDialog.find(".cancel").val(t.cancelButtonText),r.modalDialog.find(".ok").click(e),r.modalDialog.find("form").submit(e),r.modalDialog.find(".cancel").click(i),r.modalDialog.find("._tv-dialog-title-close").click(i),r.positionDialog(),r.applyHandlers(),r.modalDialog},createModalDialog:function(t,e){var i,o;return e=e||{},null!==r.modalDialog&&r.destroy(),r.modalDialog=$('<div class="_tv-dialog-shadowbox"><div class="_tv-dialog _tv-dialog-modal'+(e.addClass?" "+e.addClass:"")+'">'+(e.noHeader?"":'<div class="_tv-dialog-title">'+(e.noClose?"":'<a class="_tv-dialog-title-close"></a>')+'<span class="_tv-dialog-title-text">'+t+"</span></div>")+'<div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div></div>').appendTo($("body")).data("title",t),r._addMessageCloseButton(r.modalDialog.find("._tv-dialog-error")),r._addMessageCloseButton(r.modalDialog.find("._tv-dialog-message")),e.noShadowBox&&r.modalDialog.addClass("transparent"),e.addClass&&r.modalDialog.addClass(e.addClass),e.width&&r.modalDialog.find("._tv-dialog").css({width:e.width}),e.content&&r.modalDialog.find("._tv-dialog-content").html(e.content),i=$(".fancybox-overlay"),i.length&&(o=i.css("z-index"),$("._tv-dialog-shadowbox").css("z-index",o+1)),e.draggable&&r.modalDialog.draggable(r._constrainDraggableOptionsIfNeeded({handle:r.modalDialog.find("._tv-dialog-title")})),e.zIndex&&r.modalDialog.css("z-index",e.zIndex),r.modalDialog},_addMessageCloseButton:function(t){var e=$(i(78)).attr({class:"close",title:$.t("Close message")});t.append(e),$(e).on("click",function(){t.animate({marginTop:r.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){t.hide()})})},createDialog:function(t,i){var o,n,s;return r.isOpen(t)?(o=r.get(t),o.find("._tv-dialog-content").html(""),o.data("new",!1),o):(i=i||{},o=$(e.render('<div class="_tv-dialog _tv-dialog-nonmodal {{&addClass}}"><div class="_tv-dialog-title{{#hideTitle}} _tv-dialog-title-hidden{{/hideTitle}}{{#hideCloseCross}} _tv-dialog-title-no-close{{/hideCloseCross}}">{{^hideTitle}} {{&title}}{{/hideTitle}}{{^hideCloseCross}}<a class="_tv-dialog-title-close"></a>{{/hideCloseCross}}</div><div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div>',{addClass:i.addClass||"",hideTitle:i.hideTitle,hideCloseCross:i.hideCloseCross,title:t})).appendTo($("body")),r._addMessageCloseButton(o.find("._tv-dialog-error")),r._addMessageCloseButton(o.find("._tv-dialog-message")),i.width&&o.css({width:i.width}),i.content&&o.find("._tv-dialog-content").html(i.content),n=0,n=r.dialogs&&r.dialogs.length?a.max($.map(r.dialogs,function(t){return parseInt((t.dialog||t).css("z-index"),10)}))+1:110,o.css("z-index",n),o.data("new",!0),o.data("title",t),o.data("id",r.dialogs.length+1),r.dialogs.push({title:t,dialog:o,id:r.dialogs.length+1}),s={start:function(t,e){var i,o,n=e.helper.css("z-index"),s=0,a=null;for(i=0;i<r.dialogs.length;i++)(o=r.dialogs[i].dialog.css("z-index"))>s&&(s=o,a=r.dialogs[i].dialog);e.helper.css("z-index",s),a.css("z-index",n)}},i.dragHandle?s.handle=i.dragHandle:i.hideTitle||(s.handle="._tv-dialog-title"),i.dragOptions&&$.extend(s,i.dragOptions),o.draggable(r._constrainDraggableOptionsIfNeeded(s)),o)},positionDialog:function(t,e,i){function o(){n.css("margin-left",-Math.round(n.outerWidth()/2)+"px"),n.css("margin-top",-Math.round(n.outerHeight()/2)+"px")}var n,s,a,l,h,c,d,p;i=i||{},e=e||i.position,t?(s=t.width(),a=t.height(),l=$(window).width(),h=$(window).height(),e&&e.top&&e.left?(d=i.forcePosition?e.left:Math.max(2,Math.min(l-s-4,e.left))+"px",c=i.forcePosition?e.top:Math.max(2,Math.min(h-a-4,e.top))+"px"):e&&e.considerScroll?(p=$(document),d=Math.round((l-s)/2+p.scrollLeft())+"px",c=Math.round((h-a)/2+p.scrollTop())+"px"):(d=Math.round((l-s)/2)+"px",c=Math.round((h-a)/2)+"px"),i.fadeIn?t.css({left:d,top:c}).hide().fadeIn("fast"):i.smooth?t.animate({left:d,top:c}):t.css({left:d,top:c})):(t=r.modalDialog,n=t.find("._tv-dialog"),o(),n.resize(o))},applyHandlers:function(t,e){var i,o,n=!t||t===this.modalDialog;e=e||{},i=n?function(){r.destroy()}:function(){r.destroy(t.data("title"))},t=t||r.modalDialog.find("._tv-dialog"),e.beforeDestroy&&t.on("destroy",e.beforeDestroy),t.find("._tv-dialog-title ._tv-dialog-title-close, .js-dialog-close").on("click",i),e.doNotCloseOnBgClick||setTimeout(function(){t.on("mousedownoutside",function(o){var n=$(o.target).parents().andSelf();e.doNotCloseOnBgClickIfShadowbox&&n.is("._tv-dialog-shadowbox")||n.is(".colorpicker, .charts-popup-list, ._tv-dialog, .tvcolorpicker-popup, .symbol-edit-popup, .ui-datepicker, .clockpicker-popover, .pac-container, #global-zeroclipboard-html-bridge")||(t.unbind("mousedownoutside"),i())})},0),t.find('input[type="checkbox"]').change(function(){var t=$(this);t.next("._tv-dialog-checkbox-mask").toggleClass("disabled",t.prop("disabled")).toggleClass("_tv-dialog-checkbox-mask-active",t.is(":checked"))}),o=t.find('input[type="text"]').focus(function(){$(this).addClass("_tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textactive")}).first(),Modernizr.touch||e.notFocusFirst||o.focus(),t.find('input[type="password"]').focus(function(){$(this).addClass("_tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textactive")}),t.find("textarea").focus(function(){$(this).addClass("_tv-dialog-content-textareaactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textareaactive")}),t.find("._tv-dialog-checkbox-mask").click(function(){var t=$(this).prev();t.prop("disabled")||(t.prop("checked",!t[0].checked),t.change())}),e.doNotCloseOnEsc||$(window).bind("keyup.hideDialog",function(e){if(27===e.keyCode)return t?r.destroy(t.data("title")):r.destroy(),!1}),e.processEnterButton&&$(window).bind("keyup.confirmAndCloseDialog",function(t){13===t.keyCode&&"textarea"!==t.target.tagName.toLowerCase()&&(e.processEnterButton.click(),$(window).unbind("keyup.confirmAndCloseDialog"))})},showError:function(t,e,i){r.showMessage(t,e,$.extend(i||{},{isError:!0}))},showMessage:function(t,e,i){var o,n,s;e||(e=$("._tv-dialog")),i=i||{},o=i.isError&&"_tv-dialog-error"||"_tv-dialog-message",n=e.find("."+o),s=n.find(".message"),i.html?s.html("string"==typeof i.html?i.html:t):s.text(t),s.css("width",e.width()).toggleClass("selectable",!!i.selectable),n.toggleClass("with-close",!!i.withClose).css({marginTop:r.NOTIFICATION_ANIMATION_START_OFFSET,opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast"),i.withClose||(i.hideWithoutAnimation?n.on("touchstartoutside mousedownoutside keydownoutside",function t(){n.hide(),n.off("touchstartoutside mousedownoutside keydownoutside",t)}):n.on("touchstartoutside mousedownoutside keydownoutside",function t(){n.animate({marginTop:r.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){n.hide()}),n.off("touchstartoutside mousedownoutside keydownoutside",t)}))},isOpen:function(t){for(var e=0;e<r.dialogs.length;e++)if(r.dialogs[e].title===t)return!0;return!1},get:function(t){for(var e=0;e<r.dialogs.length;e++)if(r.dialogs[e].title===t)return r.dialogs[e].dialog},submit:function(t,e){var i=e?$(e):$("._tv-dialog form").first(),o=i.serialize(),n=i.attr("action");$.post(n,o,function(e){void 0!==t&&t(e)},"json")},destroy:function(t,e){if(void 0!==r.chart&&(r.chart.destroy(),delete r.chart),$(window).unbind("keyup.hideDialog"),$(window).unbind("keyup.confirmAndCloseDialog"),t&&"string"==typeof t)for(var i=0;i<r.dialogs.length;i++)r.dialogs[i].title===t&&(r.dialogs[i].dialog.trigger("destroy",e),$(document).unbind("mouseup.hideDialog"+r.dialogs[i].id),$("input",r.dialogs[i].dialog).blur(),r.dialogs[i].dialog.remove(),r.dialogs.splice(i,1));else r.modalDialog&&(r.modalDialog.find("._tv-dialog").trigger("destroy"),r.modalDialog.remove(),r.modalDialog=null)},changeTitle:function(t,e){t&&r.dialogs.forEach(function(i){var o,n;if(i.title===t)return o=i.dialog,n=o.find("._tv-dialog-title"),i.title=e,o.data("title",e),n.html(n.html().replace(t,e)),n.find("a").on("click",function(){r.destroy(e)}),!0})},toggleTitleEl:function(t,e){r.dialogs.filter(function(e){return e.title===t}).map(function(t){return t.dialog}).forEach(function(t){var i=t.find("._tv-dialog-title");"boolean"!=typeof e&&(e=i.hasClass("_tv-dialog-title-hidden")),i.toggleClass("_tv-dialog-title-hidden",!e)})},calcHeight:function(t,e,i){null==i&&(i=20),t+=i;var o=parseInt($("body").height(),10);return t>o&&(e-=t-o,e=Math.max(0,e)),e},resizeContent:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($("body").height(),10),n=e.height(),t>o&&(n-=t-o,n=Math.max(0,n),e.height(n))},resizeContentWidth:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($(window).width(),10),n=e.width(),t>o&&(n-=t-o,n=Math.max(0,n),e.width(n))}},r.ideaDialogs={dialogs:[],add:function(t){r.ideaDialogs.dialogs.push(t)},remove:function(t){r.ideaDialogs.dialogs=$.grep(r.ideaDialogs.dialogs,function(e){return""+e!=""+t})},clear:function(){r.ideaDialogs.dialogs.forEach(function(t){r.destroy(t)})},getDraggableEmptyTitle:function(){return $(document.createElement("div")).css({height:"30px","margin-bottom":"-10px",position:"relative"})}},void 0!==o&&o&&o.exports&&(o.exports=r)}).call(e,i(1),i(52),i(8)(t))},function(t,e,i){"use strict";function o(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return(0,s.createDialog)(n({},r,t))}var n,s,r;Object.defineProperty(e,"__esModule",{value:!0}),n=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},e.createNoticeDialog=o,s=i(67),r={width:400,destroyOnClose:!0,title:$.t("Notification"),content:$.t("You are notified"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',actions:[{name:"ok",type:"primary",text:$.t("Ok"),method:"close",key:[13,32]}]}},function(t,e,i){"use strict";function o(t){var e=t.type||"popup";return delete t.type,"modal"===e?new n.TVModal(t):new s.TVPopup(t)}var n,s;Object.defineProperty(e,"__esModule",{value:!0}),e.createDialog=o,n=i(45),s=i(68)},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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)}var r,a,l,h,c,d,p,u,_,f,m,g,v,y;Object.defineProperty(e,"__esModule",{value:!0}),r=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},a=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),l=function(t,e,i){for(var o,n,s,r,a,l,h=!0;h;){if(o=t,n=e,s=i,h=!1,null===o&&(o=Function.prototype),void 0!==(r=Object.getOwnPropertyDescriptor(o,n))){if("value"in r)return r.value;if(void 0===(l=r.get))return;return l.call(s)}if(null===(a=Object.getPrototypeOf(o)))return;t=a,e=n,i=s,h=!0,r=a=void 0}},h=i(46),c=o(h),d=i(47),p=o(d),u=i(51),_=i(69),f=$("body"),m=$(window),g={closeOnClickAtOtherDialogs:!0,draggable:!0,scrollWrap:'<div class="tv-dialog__scroll-wrap">',scrollWrapInner:'<div class="tv-dialog__scroll-wrap-inner">',withScroll:!0},v="js-dialog__scroll-wrap",y=function(t){function e(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];n(this,e),l(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,r({},g,i)),this.$scrollWrap=this.$content.hasClass(v)?this.$content:this.$content.find("."+v),this.$scrollWrap.length?this.$scrollWrapInner=this.$scrollWrap.children().first():(this.$scrollWrap=this.$content.wrap($(this.options.scrollWrap)).parent(),this.$scrollWrapInner=this.$content.wrap($(this.options.scrollWrapInner)).parent()),this.$actions&&this.$scrollWrap.addClass("i-with-actions"),this.options.withScroll&&(this.scroll=new _.SidebarCustomScroll(this.$scrollWrap,this.$scrollWrapInner),this.scroll.scrolled.subscribe(null,function(){return t.trigger("scroll")})),this.$scrollWrap.css("overflow",""),this.$el.addClass("tv-dialog--popup i-closed i-hidden"),this.options.width&&this.$el.css({width:"calc(100% - 20px)","max-width":this.options.width}),this.$el.on("mousedown touchstart",this.toTop.bind(this)),this.options.closeOnOutsideClick&&(this.on("beforeOpen",function(){setTimeout(function(){$(document).on("click.tv-popup-"+t.id,function(e){var i=$(e.target).closest(".js-dialog");(t.options.closeOnClickAtOtherDialogs||0===i.length)&&t.isEventOut(e)&&t.close()})},0)}),this.on("beforeClose",function(){return $(document).off("click.tv-popup-"+t.id)})),this.on("change:zIndex",function(){t.$el.css("z-index",t.zIndex)}),this.on("destroy",function(){var e=function(){t.$el.remove()};t.opened?(t.close(),setTimeout(e,c.default.dur/2)):e()})}return s(e,t),a(e,[{key:"open",value:function(){var t=this;if(!this.opened)return this.opened=!0,this.trigger("beforeOpen",this),this.$el.appendTo(this.options.$wrap).removeClass("i-hidden").css(function(){var e,i,o,n,s;return t.calcHeight(),e=m.height(),i=m.width(),o=t.$el.height(),n=t.$el.width(),s=t.options.position,s||(s={top:e/2-o/2,left:i/2-n/2}),s.top>e-o&&(s.top=e-o),s.left>i-n&&(s.left=i-n),s}()),this.focus(),this.toTop(),setTimeout(function(){t.opened&&(t.$el.removeClass("i-closed"),t.options.draggable&&(t.$el.draggable({handle:".js-dialog__drag",cancel:"input, textarea, button, select, option, .js-dialog__no-drag, .js-dialog__close",containment:"window",cursor:"-webkit-grabbing"}),t.$el.find(".js-dialog__drag").addClass("tv-dialog__grab")))},20),setTimeout(function(){t.opened&&t.trigger("afterOpen",t)},c.default.dur/2+20),m.on("resize.tv-popup-"+this.id,function(){t.calcHeight(),t.fixPos()}),this}},{key:"close",value:function(){var t=this;if(this.opened)return this.trigger("beforeClose",this),this.$el.addClass("i-closed"),this.opened=!1,setTimeout(function(){t.opened||(t.$el.draggable("destroy").addClass("i-hidden").detach(),f.css("cursor","auto"),t.trigger("afterClose",t),t.options.destroyOnClose&&t.destroy())},c.default.dur/2),m.off("resize.tv-popup-"+this.id),this}},{key:"fixPos",value:function(){var t=this.$el[0].getBoundingClientRect(),e={};t.bottom>p.default.height-10&&(e.top=p.default.height-10-t.height,e.top<10&&(e.top=10)),t.right>p.default.width-10&&(e.left=p.default.width-10-t.width,e.left<10&&(e.left=10)),(e.top||e.left)&&this.$el.css(e)}},{key:"calcHeight",value:function(){var t,e,i;this.$scrollWrap.css({height:""}).removeClass("i-scrollable"),t=this.$el[0].getBoundingClientRect(),e=this.options.height&&this.options.height<p.default.height-20?this.options.height:p.default.height-20,(this.options.height||t.height>e)&&(e-=t.height-this.$scrollWrap[0].getBoundingClientRect().height,e<60&&(e=60),this.$scrollWrap.css({height:e})),this.options.withScroll&&this.scroll.resize(),i=e<this.$scrollWrapInner[0].getBoundingClientRect().height,i||this.$scrollWrapInner.css("top",0),this.$scrollWrap.toggleClass("i-scrollable",i),this.$actions&&this.$actions.toggleClass("tv-dialog__section--actions_with-border",i)}},{key:"updateScroll",value:function(){this.scroll&&(this.scroll.updateScroll(),this.scroll.updateScrollBar())}},{key:"scrollToStart",value:function(){this.scroll&&this.scroll.scrollToStart()}}]),e}(u.TVDialogAbstract),e.TVPopup=y},function(t,e,i){(function(t){"use strict";function i(e,i,o){var n,s,r,a,l,h,c=this;if(this._options=$.extend({},this._defaultOptions,o||{}),this._$wrapper=e,this._$content=i,this._scroll_speed=40,this._shadow_offset=10,this._header_height=this._options.headerHeight,this._scroll_margin_top=this._options.scrollMarginTop,this.scrolled=new t,this.scrolltoend=new t,this.scrolltostart=new t,this.visibilityCallbacks=[],n=navigator.platform.toLowerCase(),s=navigator.userAgent.toLowerCase(),r=s.indexOf("firefox")>-1,a=n.indexOf("android")>-1||s.indexOf("android")>-1,this._touch=Modernizr.touch||navigator.msMaxTouchPoints||r&&a,this._touch)return this._$content.css("position","relative"),void this._$wrapper.css({"overflow-y":"auto","-webkit-overflow-scrolling":"touch","-ms-overflow-style":"-ms-autohiding-scrollbar"}).scroll(this._onScroll.bind(this));this._$wrapper.css("overflow","hidden"),this._$wrapper.on("mouseenter.sidebar-scroll",function(){c._bottomFixed||c._dragging||(c._options.alwaysVisible||c._$scrollBar.addClass("active"),c._onScroll())}).on("mouseleave.sidebar-scroll",function(){c._bottomFixed||c._dragging||(c._options.alwaysVisible||c._$scrollBar.removeClass("active"),c._onScroll())}).on("mousewheel.sidebar-scroll",function(t,e){if(!t.isDefaultPrevented())return c.scroll(e,"MozMousePixelScroll"===t.originalEvent.type?2:null)}),this._options.showTopShadow!==!1&&(this._$shadowTop=$('<div class="sb-inner-shadow top i-invisible">').appendTo(this._$wrapper)),this._options.showBottomShadow!==!1&&(this._$shadowBottom=$('<div class="sb-inner-shadow">').appendTo(this._$wrapper)),this._$shadowTop&&this._header_height&&this._$shadowTop.css("top",this._header_height-this._shadow_offset),l=this._options.additionalClass?" "+this._options.additionalClass:"",h=this._options.alwaysVisible?" active-always":"",this._$scrollBarWrapper=$('<div class="sb-scrollbar-wrap">').appendTo(this._$wrapper),this._$scrollBar=$('<div class="sb-scrollbar sb-scrollbar-body'+l+h+'"></div>').appendTo(this._$scrollBarWrapper),this._onScroll()}i.prototype.getScrollBar=function(){return this._$scrollBar},i.prototype._defaultOptions={headerHeight:0,additionalClass:"",alwaysVisible:!1,showBottomShadow:!0,scrollMarginTop:1,bubbleScrollEvent:!1},i.prototype.initDraggable=function(){if(this._dragInitialized)return this;var t=this;return this._$scrollBar.draggable({axis:"y",containment:this._$scrollBarWrapper,start:function(){t._dragging=!0},stop:function(){t._dragging=!1},drag:function(e,i){t.updateScroll()}}),this._dragInitialized=!0,this},i.prototype.updateScroll=function(){var t,e,i,o,n;return this._touch?this:(t=1,e=Math.ceil(this._$scrollBar.position().top-this._scroll_margin_top-this._header_height),i=this.getContainerHeight(),o=this._$content.outerHeight(),n=o-i-t,i<=0?this:(this._scroll_target_top=n<=0?this._header_height:Math.min(-e*o/i+this._header_height,this._header_height),e+this._$scrollBar.height()+2>=i?this.scrollToEnd():(this._$content.css("top",this._scroll_target_top+"px"),this._onScroll()),this))},i.prototype.getContainerHeight=function(){return this._$wrapper.outerHeight()-this._header_height},i.prototype.updateScrollBar=function(){var t,e,i,o,n,s,r,a,l;return this._touch?this:(t=1,e=this._$content.position().top,i=this._$content.outerHeight(),o=this._$wrapper.outerHeight(),n=o-this._header_height,s=t+this._header_height,r=n-2*t,a=(Math.abs(e)-this._header_height)*r/i,l=o*o/i,i<=n?(this._$scrollBar.addClass("js-hidden"),this._$wrapper.removeClass("sb-scroll-active")):(this._$scrollBar.removeClass("js-hidden").height(l).css("top",s+a),this._$wrapper.addClass("sb-scroll-active"),this.initDraggable()),this)},i.prototype.scroll=function(t,e){var i,o,n,s,r;return this._touch?this:(i=this._$content.position().top,o=this._$content.outerHeight(),n=this.getContainerHeight(),s=o-n-1,r=e||this._scroll_speed,s<=0||(this._scroll_target_top=Math.max(-s+this._header_height,Math.min(this._header_height,i+t*r)),this.setContentTop(this._scroll_target_top),this._onScroll()))},i.prototype.animateTo=function(t){var e,i,o;return this._touch?this:(e=this._$content.outerHeight(),i=this.getContainerHeight(),(o=e-i-1)<=0||(this._scroll_target_top=Math.max(-o+this._header_height,Math.min(this._header_height,-t)),void this._$content.animate({top:this._scroll_target_top},500,function(){this._onScroll()}.bind(this))))},i.prototype.resize=function(){var t,e;if(!this._bottomFixed){if(t=this._$content.outerHeight(),e=this._$wrapper.outerHeight(),!this._options.vAlignBottom&&t<e)return void(this.atStart()||this.scrollToStart());this.atEnd()?this.scrollToEnd():"number"==typeof this._stickyBottom&&this.setContentTop(Math.min(0,this._stickyBottom+this._$wrapper.outerHeight()-this._$content.outerHeight()))}},i.prototype.resizeHeader=function(t){var e=t-this._header_height;this._header_height=t,this._scroll_target_top+=e,this._$shadowTop&&this._$shadowTop.css("top",this._header_height-this._shadow_offset),this.resize()},i.prototype.scrollTo=function(t,e){var i,o,n,s,r,a;if(e=$.extend({position:"visible",areaHeight:t instanceof $?t.height():0},e),t instanceof $&&(t=t.position().top),i=this._$content.position().top,o=this._$content.outerHeight(),n=this.getContainerHeight(),o-n-1<=0)return!0;if(s=-1*(i-this._header_height),r=s+n,a=0,"visible"===e.position){if(t>s&&t+e.areaHeight<r)return!1;a=t+e.areaHeight>r?r-t-e.areaHeight:s-t}else"top"===e.position&&(a=s-t);return this.scroll(a,1),this._onScroll(),!1},i.prototype.scrollToEnd=function(){var t=this._$content.position().top,e=this._$content.outerHeight(),i=this._$wrapper.outerHeight(),o=e+t;return this.setContentTop(t+(i-o)+1),this._onScroll(),this},i.prototype.scrollToStart=function(){return this.setContentTop(this._header_height),this._onScroll(),this},i.prototype.currentPosition=function(){return Math.round(this._$content.position().top)},i.prototype.atStart=function(){return Math.round(this._$content.position().top)>=this._header_height},i.prototype.atEnd=function(t){var e,i,o,n;return"number"==typeof t&&isFinite(t)||(t=0),e=1,i=this._$content.position().top,o=this._$content.outerHeight(),n=this._$wrapper.outerHeight(),o-Math.abs(i)-e<=n+t},i.prototype._onScroll=function(t){var e,i;return this._touch||this._$content.css("bottom","auto"),this.scrolled.fire(),this._dragging&&t!==!0||this.updateScrollBar(),e=this.atStart(),i=this.atEnd(),this._$shadowTop&&this._$shadowTop.toggleClass("i-invisible",!!e),this._$shadowBottom&&this._$shadowBottom.toggleClass("i-invisible",!!i),this._onContentVisible(),!this._atStart&&e?(this._atStart=!0,this.scrolltostart.fire()):this._atStart&&!e&&delete this._atStart,!this._atEnd&&i?(this._atEnd=!0,this.scrolltoend.fire()):this._atEnd&&!i&&delete this._atEnd,this._options.vAlignBottom&&(this._stickyBottom=this._$content.outerHeight()-Math.abs(this._$content.position().top)-this._$wrapper.outerHeight()),!(!this._atStart&&!this._atEnd||("function"==typeof this._options.bubbleScrollEvent?!this._options.bubbleScrollEvent():!this._options.bubbleScrollEvent))},i.prototype.checkContentVisibility=function(){this._onContentVisible()},i.prototype.subscribeToContentVisible=function(t,e,i){this.visibilityCallbacks.push({id:t,$el:e,callback:i})},i.prototype.triggerVisibilityCallbacks=function(t){this._onContentVisible(t)},i.prototype._contentIsVisible=function(t){return t.$el.position().top>-1*this.currentPosition()},i.prototype._onContentVisible=function(t){var e,i,o;this.visibilityCallbacks.length&&(e=t||this._contentIsVisible.bind(this),i=[],o=this.visibilityCallbacks.filter(function(t,o){if(!$.contains(this._$content,t.$el[0]))return!1;var n=e(t);return n&&i.push(o),!n},this),i.forEach(function(e){this.visibilityCallbacks[e].callback(!!t)},this),delete this.visibilityCallbacks,this.visibilityCallbacks=o)},i.prototype.save=function(){return this._saved={top:this._$content.position().top,height:this._$content.outerHeight()},this},i.prototype.restore=function(){if(this._saved){if(this._saved.top===this._$content.position().top&&this._saved.height===this._$content.outerHeight())return delete this._saved,this;this._options.vAlignBottom&&(this._saved.top-=this._$content.outerHeight()-this._saved.height,this._saved.top>this._header_height&&(this._saved.top=this._header_height)),this.setContentTop(this._saved.top),delete this._saved,this._onScroll(!0)}return this},i.prototype.fixBottom=function(){var t,e;return this._bottomFixed?this:(this._touch?(t=this._$content.outerHeight(),e=this._$wrapper.scrollTop(),this._tempIntervalID=setInterval(function(){this._$wrapper.scrollTop(e+(this._$content.outerHeight()-t))}.bind(this),0)):this._$content.css({top:"auto",bottom:this._$wrapper.outerHeight()-this._$content.position().top-this._$content.outerHeight()}),this._bottomFixed=!0,this)},i.prototype.releaseBottom=function(){return this._bottomFixed?(this._touch?clearInterval(this._tempIntervalID):this._$content.css({top:this._$content.position().top,bottom:"auto"}),delete this._bottomFixed,this._onScroll(),this):this},i.prototype.setContentTop=function(t){return this._touch?this._options.vAlignBottom&&this._$content.outerHeight()<this._$wrapper.outerHeight()?(this._$wrapper.css("overflow-y","visible"),this._$content.css({position:"absolute",bottom:0})):(this._$content.css({position:"relative",bottom:"auto"}),this._$wrapper.css("overflow-y","auto"),this._$wrapper.scrollTop(-t)):this._$content.css("top",t),this},i.prototype.destroy=function(){this._$scrollBarWrapper.remove(),this._$shadowBottom&&this._$shadowBottom.remove(),this._$shadowTop&&this._$shadowTop.remove(),this._$wrapper.attr("style","").off("mouseenter.sidebar-scroll").off("mouseleave.sidebar-scroll").off("mousewheel.sidebar-scroll"),this._$content.attr("style","")},e.SidebarCustomScroll=i}).call(e,i(34))},function(t,e,i){"use strict";function o(t){if(t=Math.abs(t),!a.isInteger(t)&&t>1&&(t=parseFloat((""+t).replace(/^.+\./,"0."))),0<t&&t<1){var e=(""+t).length-2;return Math.pow(10,e)}return 1}function n(t,e){var i,n,s,r,l,h;t.trigger("tvticker-beforechange"),i=t.data("TVTicker"),n=i&&i.step,s=0,s=i.parser?i.parser(t.val()):a.isInteger(n)?parseInt(t.val(),10):parseFloat(t.val()),isNaN(s)&&(s=0),r=o(n),l=Math.max(r,o(s)),h=e(s,l),i.formatter&&(h=i.formatter(h)),t.val(h),t.change()}function s(t){var e=t.data("TVTicker"),i=e&&e.step,o=e&&e.max;n(t,function(t,e){var n=(Math.round(t*e)+Math.round(i*e))/e;return void 0!==o&&null!==o&&o<n&&(n=t),n})}function r(t){var e=t.data("TVTicker"),i=e&&e.step,o=e&&e.min;n(t,function(t,e){var n=(Math.round(t*e)-Math.round(i*e))/e;return void 0!==o&&null!==o&&n<o&&(n=t),n})}i(61),i(71);var a=i(28);$.fn.TVTicker=function(t){return void 0===t&&(t={}),this.each(function(){var e,i=!1,o=$(this),n=o.data("TVTicker");n?i=!0:n={step:+o.data("step")||1},"step"in t&&(n.step=+t.step||n.step),"min"in t&&(n.min=t.min),"max"in t&&(n.max=t.max),"formatter"in t&&(n.formatter=t.formatter),"parser"in t&&(n.parser=t.parser),o.data("TVTicker",n),i||(e=$('<div class="tv-ticker">').appendTo(o.parent()),$('<div class="icon up">').appendTo(e),$('<div class="icon down">').appendTo(e),o.next().find(".up, .down").on("mousedown",function(t){t.preventDefault(),o.focus()}),o.next().find(".up").click(function(){o.is(":disabled")||s(o)}),o.next().find(".down").click(function(){o.is(":disabled")||r(o)}),o.keydown(function(t){o.is(":disabled")||(38===t.keyCode?o.next().find(".up").addClass("active"):40===t.keyCode&&o.next().find(".down").addClass("active"))}),o.keyup(function(t){o.is(":disabled")||(38===t.keyCode?(s(o),o.next().find(".up").removeClass("active")):40===t.keyCode&&(r(o),o.next().find(".down").removeClass("active")))}),o.mousewheel(function(t,e){e>0?o.next().find(".up").click():o.next().find(".down").click()}))})}},,function(t,e,i){"use strict";i(41),t.exports=TradingView.templates={dialogs:{},lists:{},billingEarlyAccess:'<div class="tv-site-widget tv-site-widget--dark"><div class="tv-site-widget__background tv-site-widget__background--6mf"></div><div class="tv-site-widget__content"><div class="tv-site-widget__head tv-site-widget__head--dark"><h3 class="tv-site-widget__title tv-site-widget__title--dark">{{#is_1wk}}'+$.t("A Special Offer Just For You &ndash; 25% Off Pro Plus!")+"{{/is_1wk}}{{#is_2wk}}"+$.t("It’s FLASH SALE Time &ndash; 30% off Pro Plus!")+"{{/is_2wk}}{{#is_3wk}}"+$.t("Don’t Miss This Chance &ndash; 40% off Pro Plus!")+"{{/is_3wk}}{{#is_finished}}"+$.t("It’s now or never &ndash; 50% off Pro Plus!")+'{{/is_finished}}</h3></div><div class="tv-site-widget__body tv-site-widget__body--dark tv-text tv-text--darkbg">{{#is_1wk}}<p>'+$.t("Upgrade to Pro Plus right now and get 25% off when compared to the monthly price! Act now, don’t miss this chance to save big!")+"</p><p>"+$.t("3 most important reasons why people upgrade to Pro Plus:")+"</p><ul><li>"+$.t("Multiple Charts Layout")+"</li><li>"+$.t("Server-side Alerts")+"</li><li>"+$.t("Custom resolutions")+"</li></ul>{{/is_1wk}}{{#is_2wk}}<p>"+$.t("You’ve got to work with the best tools and pay less than they are worth! We are offering a great discount so you can focus on what matters:")+"</p><ul><li>"+$.t("Always stay aware with unlimited {0} to your computer and phone").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Alerts" target="_blank">'+$.t("server-side alerts")+"</a>")+"</li><li>"+$.t("Easily identify profitable trends with intraday {0}, {1}, {2}, {3} charts").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Renko_Charts" target="_blank">'+$.t("Renko")+"</a>",'<a href="https://www.tradingview.com/stock-charts-support/index.php/Kagi_Charts" target="_blank">'+$.t("Kagi")+"</a>",'<a href="https://www.tradingview.com/stock-charts-support/index.php/Line_Break_Charts" target="_blank">'+$.t("Line Break")+"</a>",'<a href="https://www.tradingview.com/stock-charts-support/index.php/Point_and_Figure_(PnF)_Charts" target="_blank">'+$.t("PnF")+"</a>")+"</li><li>"+$.t("Master the charts with as many technical indicators on any chart as you need (or want)")+"</li></ul>{{/is_2wk}}{{#is_3wk}}<p>"+$.t("You can’t afford to miss this awesome offer - get 40% the annual plan now and start focusing on trading. Don’t miss this chance!")+"</p><p>"+$.t("Top 3 little known tools in Pro Plus, which are appreciated by professionals:")+"</p><ul><li>"+$.t("Immediately see key trading levels with {0}").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Volume_Profile" target="_blank">'+$.t("volume profile indicators")+"</a>")+"</li><li>"+$.t("See what happens before and after main market activity with {0}").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Extended_Trading_Hours" target="_blank">'+$.t("extended hours")+"</a>")+"</li><li>"+$.t("Get unique insights by comparing any symbol to any another using {0}").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Spread_Charts" target="_blank">'+$.t("spread charts")+"</a>")+"</li></ul>{{/is_3wk}}{{#is_finished}}<p>"+$.t("This is absolutely the last chance to grab a great discount for an annual plan. Hurry up and don’t miss this incredible opportunity.")+"</p><p>"+$.t("With Pro Plus you get:")+"</p><ul><li>"+$.t("Monitor many markets at once using a multiple charts layout")+"</li><li>"+$.t("Find hidden opportunities using the watchlists and hotlists")+"</li><li>"+$.t("Dive into symbol details with custom intervals")+"</li><li>"+$.t("Always be aware with unlimited {0}").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Alerts" target="_blank">'+$.t("server-side alerts")+"</a>")+"</li><li>"+$.t("See where trends are going with intraday {0}, {1}, {2}, {3}").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Renko_Charts" target="_blank">'+$.t("Renko")+"</a>",'<a href="https://www.tradingview.com/stock-charts-support/index.php/Kagi_Charts" target="_blank">'+$.t("Kagi")+"</a>",'<a href="https://www.tradingview.com/stock-charts-support/index.php/Line_Break_Charts" target="_blank">'+$.t("Line Break")+"</a>",'<a href="https://www.tradingview.com/stock-charts-support/index.php/Point_and_Figure_(PnF)_Charts" target="_blank">'+$.t("PnF")+"</a>")+"</li><li>"+$.t("Compare any symbol to another using {0}").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Spread_Charts" target="_blank">'+$.t("spread charts")+"</a>")+"</li><li>"+$.t("Identify key trading levels with {0}").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Volume_Profile" target="_blank">'+$.t("volume profile indicators")+"</a>")+"</li><li>"+$.t("Get the scoop before and after main market activity with {0}").format('<a href="https://www.tradingview.com/stock-charts-support/index.php/Extended_Trading_Hours" target="_blank">'+$.t("extended hours")+"</a>")+"</li><li>"+$.t("Compare market movements with {0}").format('<a href="/stock-charts-support/index.php/Scailing_Options" target="_blank">'+$.t("different scales")+"</a>")+'</li></ul>{{/is_finished}}</div><div class="tv-site-widget__footer tv-site-widget__footer--dark"><div class="tv-site-widget__actions"><input type="button" class="tv-button tv-button--success js-early-access" value="'+$.t("Ready to upgrade")+'"</div></div></div></div>',userBadge:"{{#is_promo}}{{> promoBadge}}{{/is_promo}}{{^is_promo}}{{#is_ad}}{{> adBadge}}{{/is_ad}}{{^is_ad}}{{#is_top}}{{> topBadge}}{{/is_top}}{{^is_top}}{{#is_moderator}}{{> modBadge}}{{/is_moderator}}{{^is_moderator}}{{#is_pro}}{{> proBadge}}{{/is_pro}}{{/is_moderator}}{{/is_top}}{{/is_ad}}{{/is_promo}}",userBadgeChat:"{{#is_top}}{{#is_moderator}}{{> modBadge}}{{/is_moderator}}{{^is_moderator}}{{> topBadge}}{{/is_moderator}}{{/is_top}}{{^is_top}}{{#is_moderator}}{{> modBadge}}{{/is_moderator}}{{^is_moderator}}{{#is_pro}}{{> proBadge}}{{/is_pro}}{{/is_moderator}}{{/is_top}}",proBadge:'<{{badge_tag}}{{^badge_tag}}a href="/gopro/" target="_blank"{{/badge_tag}} class="apply-common-tooltip tv-user-badge tv-user-badge--pro{{#is_realtime}} tv-user-badge--pro_realtime{{/is_realtime}}{{#is_premium}} tv-user-badge--pro_premium{{/is_premium}}{{#is_trial}} tv-user-badge--pro_trial{{/is_trial}}{{#large_badge}} tv-user-badge--size_large{{/large_badge}}" title="{{#is_realtime}}'+$.t("Pro Plus")+"{{/is_realtime}}{{#is_premium}}"+$.t("Premium")+"{{/is_premium}}{{#is_trial}}"+$.t("Pro Trial")+'{{/is_trial}}{{^is_realtime}}{{^is_premium}}{{^is_trial}}Pro{{/is_trial}}{{/is_premium}}{{/is_realtime}}">pro</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>',modBadge:'<{{badge_tag}}{{^badge_tag}}a href="/house-rules/" target="_blank"{{/badge_tag}} class="tv-user-badge apply-common-tooltip tv-user-badge--mod{{#large_badge}} tv-user-badge--size_large{{/large_badge}}" title="'+$.t("Moderator")+'">mod</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>',topBadge:'<{{badge_tag}}{{^badge_tag}}a href="/people/" target="_blank"{{/badge_tag}} class="tv-user-badge apply-common-tooltip tv-user-badge--top{{badge_class}}{{#large_badge}} tv-user-badge--size_large{{/large_badge}} "title="{{badge_title}}">top</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>',promoBadge:'<{{badge_tag}}{{^badge_tag}}a href="/advertising-info/" target="_blank"{{/badge_tag}} class="tv-user-badge apply-common-tooltip tv-user-badge--promo{{badge_class}}{{#large_badge}} tv-user-badge--size_large{{/large_badge}} "title="{{badge_title}}">promo</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>',adBadge:'<{{badge_tag}}{{^badge_tag}}a href="/advertising-info/" target="_blank"{{/badge_tag}} class="tv-user-badge apply-common-tooltip tv-user-badge--ad{{badge_class}}{{#large_badge}} tv-user-badge--size_large{{/large_badge}} "title="{{badge_title}}">ad</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>',chartBadges:"",actionsLog:'<div class="entry"><b>{{#is_system}}<img src="images/small-logo.png" class="log-system-message"/>system{{/is_system}}{{^is_system}}<a href="/u/{{username}}/" target="_blank">{{username}}</a>{{/is_system}}</b><div class="entry-time time-upd">{{ created_timestamp }}</div> <div class="message">{{{text}}}</div></div>',onChartMessage:'<div class="onchart-message"><span class="onchart-message-close"></span><div class="onchart-message-top"><div class="onchart-message-copy"></div></div><div class="onchart-message-bottom"><div class="onchart-message-ear"></div></div></div>',miniWidgetWizardAddSymbol:'<tr class="tv-external-tools__symbol-item"><td class="tv-external-tools__symbol-item-cell">{{symbol}}</td><td class="tv-external-tools__symbol-item-cell">{{description}}</td><td class="tv-external-tools__symbol-item-cell">{{timeframe}}</td><td class="tv-external-tools__remove-cell"><div class="tv-external-tools__remove-symbol"></div></td></tr>',textNotesWidgetLayout:'<div class="notes-block"><div class="textnotes-search-header"><div class="search-input-block">'+i(73)+'<div class="search-clean"></div><input type="text" class="search-input" placeholder="'+$.t("Search Note")+'" maxlength="1000" autocomplete="off"></div><div class="new-note-btn">'+i(74)+$.t("NEW")+'</div></div><div class="notes-wrapper"><div class="notes"></div></div></div><div class="notes-desc-block"><div class="notes-desc-wrapper"><div class="notes-desc-inner"><div class="remove-note-btn">'+i(75)+'</div><div class="title-wrap"><input type="text" maxlength="40" value="" class="title"></div><div class="date"><span class="created">'+$.t("Created ")+'<span class="created-val"></span>. </span><span class="modified">'+$.t("Last edited ")+'<span class="modified-val"></span></span></div><textarea></textarea></div></div></div>',textNotesWidgetItem:'<div class="note"><div class="note-header"><div {{#symbol}}title="'+$.t("Open {{symbol}} Text Note")+'"{{/symbol}} class="title {{#symbol}}title_with-badge{{/symbol}}">{{title}}</div>{{#symbol}}<div class="symbol-badge">'+i(76)+'<span class="symbol">{{symbol}}</span></div>{{/symbol}}</div><div class="note-desc">{{description}}</div><span class="favorite"></span></div>',tvDataTable:'<table class="tv-data-table {{className}}"><thead class="tv-data-table__thead"><tr class="tv-data-table__stroke">{{#columns}}<th class="tv-data-table__cell tv-data-table__cell--bold {{className}}"><span class="tv-data-table__cell-text{{^notSortable}} tv-data-table__sortable{{/notSortable}}{{#help}} apply-common-tooltip{{/help}}{{#htmlHelp}} common-tooltip-html{{/htmlHelp}}" {{#help}}title="{{help}}"{{/help}}>{{label}}</span></th>{{/columns}}</tr></thead>{{#bodys}}<tbody class="tv-data-table__tbody {{className}}">{{#strokes}}<tr class="tv-data-table__stroke">{{#cells}}<td class="tv-data-table__cell {{className}}"{{#colspan}}colspan="{{colspan}}"{{/colspan}}>{{#contain}}{{{contain}}}{{/contain}}</td>{{/cells}}</tr>{{/strokes}}</tbody>{{/bodys}}</table>',tvDataTableRow:'<tr class="tv-data-table__stroke">{{#columns}}<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>{{/columns}}</tr>',tvDataTableCell:'<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>',tvWidgetChartLikeButton:'<div data-id="{{chartId}}" class="tv-widget-chart-like-button {{typeClass}}"><span class="tv-widget-chart-like-button__icon-place">'+i(77)+'</span><span class="js-likes-counter"></span></div>'}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 973.125"><path d="M960 832L710.875 582.875C746.438 524.812 768 457.155 768 384 768 171.97 596 0 384 0 171.97 0 0 171.97 0 384c0 212 171.97 384 384 384 73.156 0 140.812-21.562 198.875-57L832 960c17.5 17.5 46.5 17.375 64 0l64-64c17.5-17.5 17.5-46.5 0-64zM384 640c-141.375 0-256-114.625-256-256s114.625-256 256-256 256 114.625 256 256-114.625 256-256 256z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28"><path fill="#ffffff" d="M18 10V0h-8v10H0v8h10v10h8V18h10v-8"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 18" width="14" height="18"><path fill-rule="evenodd" d="M1 16c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V4H1v12zM14 1h-3.5l-1-1h-5l-1 1H0v2h14V1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 14" width="25" height="14" style="position:relative;top:3px"><path d="M10.43 8.683L9.345 8.68c-.943-.005-1.712-.774-1.716-1.717-.003-.452.172-.877.49-1.195.32-.32.744-.493 1.196-.492l4.002.016c.83.004 2.22.18 2.225 1.316.002.522.427.943.95.942.52-.002.942-.427.94-.95-.007-1.932-1.62-3.188-4.107-3.198l-4.003-.016c-.96-.003-1.862.368-2.54 1.045-.677.68-1.048 1.58-1.044 2.54.003.99.41 1.887 1.06 2.54.652.65 1.55 1.056 2.54 1.06l1.086.004c.522.002.947-.42.948-.942.002-.52-.42-.946-.942-.947zm13.832-1.655c-.008-2.076-1.41-3.59-3.33-3.597l-1.357-.003c-.522-.002-.947.42-.948.942-.002.52.42.946.94.947l1.356.006c.996.003 1.445.863 1.448 1.714.004.453-.17.878-.49 1.196-.317.32-.742.493-1.195.492l-4.27-.017c-1.952-.008-1.955-.924-1.957-1.315-.002-.522-.426-.943-.948-.942-.523.003-.945.428-.943.95.004.896.296 1.63.834 2.17.66.66 1.69 1.023 3.01 1.028l4.27.017c.96.003 1.86-.368 2.54-1.046.675-.678 1.046-1.58 1.043-2.54z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 670 745"><path d="M417.91 738.04c-118.64-22.82-190.57-47.072-218.92-73.807-22.734-21.44-24.27-32.633-24.27-176.81 0-88.1 1.86-140.31 5.373-150.86 11.138-33.44 36.66-57.735 133.93-127.5 67.296-48.267 90.59-69.93 140.55-130.72C509.177 11.903 521.965.078 539.24.046c16.013-.03 25.43 13.07 32.622 45.373 7.83 35.164-3.512 82.774-30.952 129.93-40.764 70.052-39.008 75.19 31.705 92.733 49.08 12.178 81.767 30 91.884 50.097 8.98 17.844 7.335 39.84-7.633 102.04-7.523 31.264-15.156 66.454-16.962 78.203-1.806 11.748-11.588 46.504-21.738 77.236s-18.454 58.25-18.454 61.152c0 8.677-33.212 71.96-44.153 84.13-22.217 24.715-68.287 30.435-137.65 17.093zm-345.68-25.9c-5.722-2.5-22.273-14.2-36.78-26.03-14.506-11.88-28.418-21.59-30.914-21.59-2.82 0-4.538-65.6-4.538-173.26 0-95.29 1.752-173.25 3.893-173.25 2.144 0 17.104-11.498 33.248-25.552 30.614-26.65 49.608-34.114 68.466-26.907 16.703 6.386 18.065 16.296 7.704 56.06-8.34 32-9.423 51.51-9.423 169.55 0 131.23.62 138.49 16.636 194.72 5.75 20.178-24.144 36.41-48.29 26.22z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" width="9px" height="9px"><path d="M2 1L1 2l2.5 2.5L1 7l1 1 2.5-2.5L7 8l1-1-2.5-2.5L8 2 7 1 4.5 3.5z"/></svg>'},function(t,e,i){"use strict";var o=i(38).TVLocalStorage;TradingView.FeatureToggle={force_prefix:"forcefeaturetoggle.",enableFeature:function(t){o.setItem(this.force_prefix+t,"true")},disableFeature:function(t){o.removeItem(this.force_prefix+t)}},TradingView.isFeatureEnabled=function(t){function e(e){return o.setItem(n+e,Math.random()<=t[e]),o.getItem(n+e)}function i(t){return["alerts-maintenance","backtesting","phone_verification","widgetbar.old-my-ideas","japanese_alerts","fxcm-maintenance","oanda-maintenance","paper-maintenance","cqg-maintenance","protobuf-maintenance"].indexOf(t)===-1}var n="featuretoggle.";return function(s){if("local"===window.environment&&i(s))return!0;if(t[s]&&t[s]===-1)return!1;if("true"===o.getItem(TradingView.FeatureToggle.force_prefix+s)||window.is_authenticated&&"undefined"!=typeof user&&user&&user.settings&&user.settings[TradingView.FeatureToggle.force_prefix+s])return!0;if(!t[s])return!1;if(1===t[s])return!0;var r=o.getItem(n+s);return void 0===r||null===r?e(s):"true"===r}}(window.featureToggleState||{}),e.FeatureToggle=TradingView.FeatureToggle,e.isFeatureEnabled=TradingView.isFeatureEnabled},function(t,e){"use strict";!function(t){if(document.createElement("canvas")&&document.createElement("canvas").getContext){var e=function(e){var i=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/i}(document.createElement("canvas").getContext("2d"));e<2||(t.hidpiCanvasRatio=e,function(t){var i=function(t,e){for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},o={fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all",drawImagePatchedSource:[1,2,3,4],drawImagePatchedSourceAndDest:[1,2,3,4,5,6,7,8]};t.drawImagePatchedSource=t.drawImage,t.drawImagePatchedSourceAndDest=t.drawImage,i(o,function(i,o){var n=t[o];t[o]=function(){var t,o;if("all"===i)for(o=[],t=arguments.length;0<t--;)o[t]=arguments[t]*e;else for(o=Array.prototype.slice.call(arguments),t=i.length;0<t--;)o[i[t]]&&(o[i[t]]=o[i[t]]*e);return n.apply(this,o)}}),t.drawImage=function(t){return function(){return arguments[0]instanceof HTMLCanvasElement?t.drawImagePatchedSourceAndDest.apply(this,arguments):t.drawImagePatchedSource.apply(this,arguments)}}(t),t.fillText=function(t){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=e,i[2]*=e,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i*e+o}),t.apply(this,i),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i/e+o})}}(t.fillText),t.strokeText=function(t){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=e,i[2]*=e,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i*e+o}),t.apply(this,i),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i/e+o})}}(t.strokeText)}(CanvasRenderingContext2D.prototype),function(t){t.getContext=function(t){return function(i){var o=t.call(this,i);return"2d"===i&&this.width!=Math.floor(parseInt(this.style.width)*e)&&(this.style.height=this.height+"px",this.style.width=this.width+"px",this.width*=e,this.height*=e),o}}(t.getContext)}(HTMLCanvasElement.prototype))}}(window)},function(t,e,i){(function(t){"use strict";function o(t,e,i,o,n){function s(t,i,o,n){var r,a=i.split("."),l=a[0];if(e&&e[l]&&(l=e[l]),!t.hasOwnProperty(l)&&n&&n===l)return r=a.splice(1).join("."),void s(t,r,o);if(!t.hasOwnProperty(l))throw Error("illegal path");a.length>1?(r=a.splice(1).join("."),s(t[l],r,o)):t[l]&&t[l].setValue?t[l].setValue(o):t[l]=o}if(void 0!==o&&o)for(var r in o)try{s(t,r,o[r],n)}catch(t){void 0!==i&&i||TradingView.logWarn("Path `"+r+"` does not exist.")}}function n(t,e,i,n){"undefined"!=typeof __defaultsOverrides&&__defaultsOverrides&&o(t,e,i,__defaultsOverrides,n)}function s(){var t=/^linetool.+/;Object.keys(TradingView.defaultProperties).forEach(function(e){t.test(e)&&n(TradingView.defaultProperties[e],null,!1,e)})}function r(t,e){var i;/^study_.+/.test(t)&&(i=f.parseIdString(t),g[i.id]=g[i.id]||{},TradingView.merge(g[i.id],e))}function a(t,e){return e?h(t,e):l(t)}function l(t){var e,i=v(t);return window._UNIT_TESTS||(e=TradingView.clone(TVSettings.getJSON(t,null)))&&TradingView.merge(i,e),i}function h(t,e){var i,o,n=v(t);return window._UNIT_TESTS||(i=TradingView.clone(TVSettings.getJSON(t,null)),t.startsWith("study_")&&i&&_.isVersionHead(i.version)&&(o=e.updateStudyState(i,i),i=o),TradingView.merge(n,i)),n}var c=i(82).LineDataSource,d=i(102),p=i(189),u=i(202).LineToolPitchfork,_=i(168),f=i(139),m=i(175).StudyConsts,g={},v=function(e){var i,o,r,a,l,h,_,f,v,y={a:function(t,e){return{color:t,visible:e}},b:function(t,e,i){return{coeff:t,color:e,visible:i}},c:function(t,e,i,o,n){return{coeff:t,color:e,visible:i,linestyle:void 0===o?CanvasEx.LINESTYLE_SOLID:o,linewidth:void 0===n?1:n}},d:function(t,e,i){return{color:t,width:i,visible:e}},e:function(t,e,i,o,n){return{color:t,visible:e,width:i,x:o,y:n}},f:function(t,e,i,o,n,s){return{coeff1:t,coeff2:e,color:i,visible:o,linestyle:void 0===n?CanvasEx.LINESTYLE_SOLID:n,linewidth:void 0===s?1:s}}};if(void 0===TradingView.defaultProperties){switch(window.language){case"ru":i="Europe/Moscow";break;case"ja":case"kr":i="Asia/Tokyo";break;case"es":i="Europe/Madrid";break;case"uk":i="Europe/London";break;case"br":i="America/Sao_Paulo";break;case"in":i="Asia/Kolkata";break;case"pl":i="Europe/Warsaw";break;case"ca":i="America/Toronto";break;case"tr":i="Europe/Athens";break;case"it":i="Europe/Berlin";break;default:i="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:i,timeScale:{barSpacing:TradingView.DEFAULT_BAR_SPACING,rightOffset:TradingView.DEFAULT_RIGHT_OFFSET},dataWindowProperties:{background:"rgba( 255, 254, 206, 0.2)",border:"rgba( 96, 96, 144, 1)",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"rgba( 255, 255, 255, 1)",gridProperties:{color:"#E6E6E6",style:CanvasEx.LINESTYLE_SOLID},vertGridProperties:{color:"rgba( 230, 230, 230, 1)",style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"rgba( 230, 230, 230, 1)",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"rgba( 183, 183, 183, 1)",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:5,bottomMargin:5,leftAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},overlayPropreties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0}},scalesProperties:{showLeftScale:!1,showRightScale:!0,backgroundColor:"rgba( 255, 255, 255, 1)",lineColor:"rgba( 85, 85, 85, 1)",textColor:"rgba( 85, 85, 85, 1)",fontSize:11,scaleSeriesOnly:!1,showSeriesLastValue:!0,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1},mainSeriesProperties:{style:d.STYLE_CANDLES,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"rgba( 226, 116, 91, 1)",style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,showInDataWindow:!0,visible:!0,silentIntervalChange:!1,showPriceLine:!0,priceLineWidth:1,lockScale:!1,minTick:"default",extendedHours:!1,sessVis:!1,statusViewStyle:{fontSize:17,showExchange:!0,showInterval:!0,showSymbolAsDescription:!1},candleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)"},haStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",showRealLastPrice:!1,barColorsOnPrevClose:!1},barStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 60, 120, 216, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:d.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1},renkoStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",upColorProjection:"rgba( 74, 214, 190, 1)",downColorProjection:"rgba( 214, 73, 207, 1)",borderUpColorProjection:"rgba( 34, 84, 55, 1)",borderDownColorProjection:"rgba( 91, 26, 19, 1)",inputs:{source:"close",boxSize:3,style:"ATR",atrLength:14},inputInfo:{source:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR Length"}}},pbStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",upColorProjection:"rgba( 74, 214, 190, 1)",downColorProjection:"rgba( 214, 73, 207, 1)",borderUpColorProjection:"rgba( 34, 84, 55, 1)",borderDownColorProjection:"rgba( 91, 26, 19, 1)",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",upColorProjection:"rgba( 74, 214, 190, 1)",downColorProjection:"rgba( 214, 73, 207, 1)",inputs:{source:"close",style:"Traditional",atrLength:14,reversalAmount:1},inputInfo:{source:{name:"Source"},style:{name:"Style"},atrLength:{name:"ATR Length"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",upColorProjection:"rgba( 74, 214, 190, 1)",downColorProjection:"rgba( 214, 73, 207, 1)",inputs:{sources:"HL",reversalAmount:3,boxSize:1,style:"ATR",atrLength:14},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR Length"}}}},symbolWatermarkProperties:{color:"rgba( 85, 85, 85, 0.15)",transparency:85},chartEventsSourceProperties:{visible:!0,futureOnly:!0,breaks:{color:"rgba(85, 85, 85, 1)",visible:!1,style:CanvasEx.LINESTYLE_DASHED,width:1}},tradingProperties:{showPositions:!0,showOrders:!0,showExecutions:!0,extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:CanvasEx.LINESTYLE_DASHED},alertsProperties:{labels:{visible:!0,color:"rgba( 215, 84, 66, 1)",highlightColor:"rgba( 255, 255, 51, 1)",hoverColor:"rgba( 245, 227, 135, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},fakeLabels:{visible:!0,color:"rgba( 119, 119, 119, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},drawingIcon:{color:"rgba( 170, 170, 170, 1)"}},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},drawings:{magnet:!1,stayInDrawingMode:!1,drawOnAllCharts:!0,crossHairColor:"rgba( 183, 183, 183, 1)",crossHairStyle:CanvasEx.LINESTYLE_DASHED,crossHairWidth:1},linetoolorder:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 255, 0, 0, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 255, 0, 0, 0)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 255, 0, 0, 0)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 255, 0, 0, 0)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 255, 0, 0, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderColor:"rgba( 255, 0, 0, 1)",cancelButtonBorderTransparency:0,cancelButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",cancelButtonBackgroundTransparency:25,cancelButtonIconColor:"rgba( 255, 0, 0, 1)",cancelButtonIconTransparency:0,tooltip:""},linetoolposition:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 0, 113, 224, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 0, 113, 224, 1)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 0, 113, 224, 1)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 0, 113, 224, 1)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 0, 113, 224, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderColor:"rgba( 0, 113, 224, 1)",reverseButtonBorderTransparency:0,reverseButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",reverseButtonBackgroundTransparency:25,reverseButtonIconColor:"rgba( 0, 113, 224, 1)",reverseButtonIconTransparency:0,closeButtonBorderColor:"rgba( 0, 113, 224, 1)",closeButtonBorderTransparency:0,closeButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",closeButtonBackgroundTransparency:25,closeButtonIconColor:"rgba( 0, 113, 224, 1)",closeButtonIconTransparency:0,tooltip:""},linetoolexecution:{singleChartOnly:!0,direction:"buy",arrowHeight:8,arrowSpacing:1,arrowColor:"rgba( 0, 0, 255, 1)",arrowTransparency:0,text:"",textColor:"rgba( 0, 0, 0, 1)",textTransparency:0,fontFamily:"Verdana",fontSize:8,fontBold:!1,fontItalic:!1,tooltip:""},linetoolicon:{singleChartOnly:!0,clonable:!0,color:"rgba( 61, 133, 198, 1)",size:40,icon:9786,angle:.5*Math.PI,scale:1},linetoolbezierquadro:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL},linetoolbeziercubic:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL},linetooltrendline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetooltimecycles:{clonable:!0,linecolor:"rgba(21, 153, 128, 1)",linewidth:1,fillBackground:!0,backgroundColor:"rgba(106, 168, 79, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolsineline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooltrendangle:{singleChartOnly:!0,clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!0,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1},linetooldisjointangle:{clonable:!0,linecolor:"rgba( 18, 159, 92, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 106, 168, 79, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL,font:"Verdana",textcolor:"rgba( 18, 159, 92, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolflatbottom:{clonable:!0,linecolor:"rgba( 73, 133, 231, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL,font:"Verdana",textcolor:"rgba( 73, 133, 231, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolfibspiral:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooldaterange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)"},linetoolpricerange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)"},linetooldateandpricerange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)"},linetoolriskrewardshort:{isShort:!0,clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)"},linetoolriskrewardlong:{isShort:!1,clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)"},linetoolarrow:{clonable:!0,linecolor:"rgba( 111, 136, 198, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_ARROW,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolray:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!0,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolextended:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!0,extendRight:!0,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolhorzline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,text:"",font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolhorzray:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,text:"",font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showTime:!0},linetoolcirclelines:{clonable:!0,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolfibtimezone:{horzLabelsAlign:"right",vertLabelsAlign:"bottom",clonable:!0,baselinecolor:"rgba( 128, 128, 128, 1)",linecolor:"rgba( 0, 85, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showLabels:!0,font:"Verdana",fillBackground:!1,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:y.c(0,"rgba( 128, 128, 128, 1)",!0),level2:y.c(1,"rgba( 0, 85, 219, 1)",!0),level3:y.c(2,"rgba( 0, 85, 219, 1)",!0),level4:y.c(3,"rgba( 0, 85, 219, 1)",!0),level5:y.c(5,"rgba( 0, 85, 219, 1)",!0),level6:y.c(8,"rgba( 0, 85, 219, 1)",!0),level7:y.c(13,"rgba( 0, 85, 219, 1)",!0),level8:y.c(21,"rgba( 0, 85, 219, 1)",!0),level9:y.c(34,"rgba( 0, 85, 219, 1)",!0),level10:y.c(55,"rgba( 0, 85, 219, 1)",!0),level11:y.c(89,"rgba( 0, 85, 219, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltext:{clonable:!0,color:"rgba( 102, 123, 139, 1)",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 91, 133, 191, 0.9)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:400},linetooltextabsolute:{singleChartOnly:!0,clonable:!0,color:"rgba( 102, 123, 139, 1)",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 155, 190, 213, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!0,wordWrap:!1,wordWrapWidth:400},linetoolballoon:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 254, 206, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:12,font:"Arial",transparency:30,text:$.t("Comment")},linetoolbrush:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,smooth:5,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL},linetoolpolyline:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,filled:!1},linetoolarrowmark:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkleft:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkup:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkright:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkdown:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolflagmark:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolnote:{clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,text:$.t("Text"),font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!1,fixedSize:!0},linetoolnoteabsolute:{singleChartOnly:!0,clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,text:$.t("Text"),font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!0,fixedSize:!0},linetoolthumbup:{clonable:!0,color:"rgba( 0, 128, 0, 1)"},linetoolthumbdown:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolpricelabel:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 255, 255, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:11,font:"Arial",transparency:30},linetoolrectangle:{clonable:!0,color:"rgba( 21, 56, 153, 1)",fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",linewidth:1,snapTo45Degrees:!0,transparency:50},linetoolrotatedrectangle:{clonable:!0,color:"rgba( 152, 0, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 142, 124, 195, 0.5)",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolellipse:{clonable:!0,color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolarc:{clonable:!0,color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolprediction:{singleChartOnly:!0,linecolor:"rgba( 28, 115, 219, 1)",linewidth:2,sourceBackColor:"rgba( 241, 241, 241, 1)",sourceTextColor:"rgba( 110, 110, 110, 1)",sourceStrokeColor:"rgba( 110, 110, 110, 1)",targetStrokeColor:"rgba( 47, 168, 255, 1)",targetBackColor:"rgba( 11, 111, 222, 1)",targetTextColor:"rgba( 255, 255, 255, 1)",successBackground:"rgba( 54, 160, 42, 0.9)",successTextColor:"rgba( 255, 255, 255, 1)",failureBackground:"rgba( 231, 69, 69, 0.5)",failureTextColor:"rgba( 255, 255, 255, 1)",intermediateBackColor:"rgba( 234, 210, 137, 1)",intermediateTextColor:"rgba( 109, 77, 34, 1)",transparency:10,centersColor:"rgba( 32, 32, 32, 1)"},linetooltriangle:{clonable:!0,color:"rgba( 153, 21, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:1},linetoolcallout:{clonable:!0,color:"rgba( 255, 255, 255, 1)",backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:2,fontsize:12,font:"Verdana",text:$.t("Text"),bordercolor:"rgba( 153, 21, 21, 1)",bold:!1,italic:!1,wordWrap:!1,wordWrapWidth:400},linetoolparallelchannel:{clonable:!0,linecolor:"rgba( 119, 52, 153, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:"rgba( 180, 167, 214, 0.5)",transparency:50,showMidline:!1,midlinecolor:"rgba( 119, 52, 153, 1)",midlinewidth:1,midlinestyle:CanvasEx.LINESTYLE_DASHED},linetoolelliottimpulse:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliotttriangle:{degree:7,clonable:!0,showWave:!0,color:"rgba( 255, 152, 0, 1)",linewidth:1},linetoolelliotttriplecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolelliottcorrection:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliottdoublecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolbarspattern:{singleChartOnly:!0,color:"rgba( 80, 145, 204, 1)",clonable:!0,mode:p.BARS_MODE,mirrored:!1,flipped:!1},linetoolghostfeed:{singleChartOnly:!0,clonable:!0,averageHL:20,variance:50,candleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375"},transparency:50},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},graphics:{},showInDataWindow:!0,visible:!0,showStudyArguments:!0,precision:"default"},linetoolpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:u.STYLE_ORIGINAL,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:y.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:y.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:y.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:y.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:y.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:y.c(1,"rgba( 0, 0, 153, 1)",!0),level6:y.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:y.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:y.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolpitchfan:{clonable:!0,fillBackground:!0,transparency:80,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:y.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:y.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:y.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:y.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:y.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:y.c(1,"rgba( 0, 0, 153, 1)",!0),level6:y.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:y.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:y.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolgannfan:{clonable:!0,showLabels:!0,font:"Verdana",fillBackground:!0,transparency:80,level1:y.f(1,8,"rgba( 160, 107, 0, 1)",!0),level2:y.f(1,4,"rgba( 105, 158, 0, 1)",!0),level3:y.f(1,3,"rgba( 0, 155, 0, 1)",!0),level4:y.f(1,2,"rgba( 0, 153, 101, 1)",!0),level5:y.f(1,1,"rgba( 128, 128, 128, 1)",!0),level6:y.f(2,1,"rgba( 0, 101, 153, 1)",!0),level7:y.f(3,1,"rgba( 0, 0, 153, 1)",!0),level8:y.f(4,1,"rgba( 102, 0, 153, 1)",!0),level9:y.f(8,1,"rgba( 165, 0, 0, 1)",!0),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolganncomplex:{clonable:!0,fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,levels:[y.d("rgba( 128, 128, 128, 1)",!0,1),y.d("rgba( 160, 107, 0, 1)",!0,1),y.d("rgba( 105, 158, 0, 1)",!0,1),y.d("rgba( 0, 155, 0, 1)",!0,1),y.d("rgba( 0, 153, 101, 1)",!0,1),y.d("rgba( 128, 128, 128, 1)",!0,1)],fanlines:[y.e("rgba( 165, 0, 255, 1)",!1,1,8,1),y.e("rgba( 165, 0, 0, 1)",!1,1,5,1),y.e("rgba( 128, 128, 128, 1)",!1,1,4,1),y.e("rgba( 160, 107, 0, 1)",!1,1,3,1),y.e("rgba( 105, 158, 0, 1)",!0,1,2,1),y.e("rgba( 0, 155, 0, 1)",!0,1,1,1),y.e("rgba( 0, 153, 101, 1)",!0,1,1,2),y.e("rgba( 0, 153, 101, 1)",!1,1,1,3),y.e("rgba( 0, 0, 153, 1)",!1,1,1,4),y.e("rgba( 102, 0, 153, 1)",!1,1,1,5),y.e("rgba( 165, 0, 255, 1)",!1,1,1,8)],arcs:[y.e("rgba( 160, 107, 0, 1)",!0,1,1,0),y.e("rgba( 160, 107, 0, 1)",!0,1,1,1),y.e("rgba( 160, 107, 0, 1)",!0,1,1.5,0),y.e("rgba( 105, 158, 0, 1)",!0,1,2,0),y.e("rgba( 105, 158, 0, 1)",!0,1,2,1),y.e("rgba( 0, 155, 0, 1)",!0,1,3,0),y.e("rgba( 0, 155, 0, 1)",!0,1,3,1),y.e("rgba( 0, 153, 101, 1)",!0,1,4,0),y.e("rgba( 0, 153, 101, 1)",!0,1,4,1),y.e("rgba( 0, 0, 153, 1)",!0,1,5,0),y.e("rgba( 0, 0, 153, 1)",!0,1,5,1)],__collectibleLines:["trendline","levels.0","levels.1","levels.2","levels.3","levels.4","levels.5","fanlines.0","fanlines.1","fanlines.2","fanlines.3","fanlines.4","fanlines.5","fanlines.6","fanlines.7","fanlines.8","fanlines.9","fanlines.10","arcs.0","arcs.1","arcs.2","arcs.3","arcs.4","arcs.5","arcs.6","arcs.7","arcs.8","arcs.9","arcs.10"]},linetoolgannsquare:{clonable:!0,color:"rgba( 21, 56, 153, 0.8)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,reverse:!1,fans:y.a("rgba( 128, 128, 128, 1)",!1),hlevel1:y.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:y.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:y.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:y.b(.5,"rgba( 0, 155, 0, 1)",!0),hlevel5:y.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:y.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:y.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:y.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:y.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:y.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:y.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:y.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:y.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:y.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["fans","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibspeedresistancefan:{clonable:!0,fillBackground:!0,transparency:80,grid:{color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,visible:!0},linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,snapTo45Degrees:!0,hlevel1:y.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:y.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:y.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:y.b(.5,"rgba( 0, 155, 0, 1)",!0),hlevel5:y.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:y.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:y.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:y.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:y.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:y.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:y.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:y.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:y.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:y.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["trendline","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibretracement:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:y.b(0,"rgba( 128, 128, 128, 1)",!0),level2:y.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:y.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:y.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:y.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:y.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:y.b(1,"rgba( 128, 128, 128, 1)",!0),level8:y.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:y.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:y.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:y.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:y.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:y.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:y.b(2,"rgba( 40, 204, 149, 1)",!1),level14:y.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:y.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:y.b(3,"rgba( 40, 149, 204, 1)",!1),level18:y.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:y.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:y.b(4,"rgba( 204, 40, 40, 1)",!1),level21:y.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:y.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:y.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:y.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolfibchannel:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",coeffsAsPercents:!1,levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:y.b(0,"rgba( 128, 128, 128, 1)",!0),level2:y.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:y.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:y.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:y.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:y.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:y.b(1,"rgba( 128, 128, 128, 1)",!0),level8:y.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:y.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:y.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:y.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:y.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:y.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:y.b(2,"rgba( 40, 204, 149, 1)",!1),level14:y.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:y.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:y.b(3,"rgba( 40, 149, 204, 1)",!1),level18:y.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:y.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:y.b(4,"rgba( 204, 40, 40, 1)",!1),level21:y.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:y.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:y.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:y.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolprojection:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,color1:"rgba( 0, 128, 0, 0.2)",color2:"rgba( 255, 0, 0, 0.2)",linewidth:1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linestyle:CanvasEx.LINESTYLE_SOLID},level1:y.c(1,"rgba( 128, 128, 128, 1)",!0)},linetool5pointspattern:{clonable:!0,color:"rgba( 204, 40, 149, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 204, 40, 149, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolcypherpattern:{clonable:!0,color:"#CC2895",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#CC2895",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetooltrianglepattern:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolabcd:{clonable:!0,color:"rgba( 0, 155, 0, 1)",textcolor:"rgba( 255, 255, 255, 1)",font:"Verdana",fontsize:12,bold:!1,italic:!1,linewidth:2},linetoolthreedrivers:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolheadandshoulders:{clonable:!0,color:"rgba( 69, 104, 47, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 69, 168, 47, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolfibwedge:{singleChartOnly:!0,clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:y.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:y.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:y.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:y.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:y.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:y.c(1,"rgba( 128, 128, 128, 1)",!0),level7:y.c(1.618,"rgba( 40, 40, 204, 1)",!1),level8:y.c(2.618,"rgba( 204, 40, 40, 1)",!1),level9:y.c(3.618,"rgba( 149, 40, 204, 1)",!1),level10:y.c(4.236,"rgba( 204, 40, 149, 1)",!1),level11:y.c(4.618,"rgba( 204, 40, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibcircles:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,snapTo45Degrees:!0,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:y.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:y.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:y.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:y.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:y.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:y.c(1,"rgba( 128, 128, 128, 1)",!0),level7:y.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:y.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:y.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:y.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:y.c(4.618,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibspeedresistancearcs:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,fullCircles:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:y.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:y.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:y.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:y.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:y.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:y.c(1,"rgba( 128, 128, 128, 1)",!0),level7:y.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:y.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:y.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:y.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:y.c(4.618,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltrendbasedfibextension:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:y.b(0,"rgba( 128, 128, 128, 1)",!0),level2:y.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:y.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:y.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:y.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:y.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:y.b(1,"rgba( 128, 128, 128, 1)",!0),level8:y.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:y.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:y.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:y.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:y.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:y.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:y.b(2,"rgba( 40, 204, 149, 1)",!1),level14:y.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:y.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:y.b(3,"rgba( 40, 149, 204, 1)",!1),level18:y.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:y.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:y.b(4,"rgba( 204, 40, 40, 1)",!1),level21:y.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:y.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:y.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:y.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetooltrendbasedfibtime:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:y.c(0,"rgba( 128, 128, 128, 1)",!0),level2:y.c(.382,"rgba( 204, 40, 40, 1)",!0),level3:y.c(.5,"rgba( 149, 204, 40, 1)",!1),level4:y.c(.618,"rgba( 40, 204, 40, 1)",!0),level5:y.c(1,"rgba( 40, 204, 149, 1)",!0),level6:y.c(1.382,"rgba( 40, 149, 204, 1)",!0),level7:y.c(1.618,"rgba( 128, 128, 128, 1)",!0),level8:y.c(2,"rgba( 40, 40, 204, 1)",!0),level9:y.c(2.382,"rgba( 204, 40, 40, 1)",!0),level10:y.c(2.618,"rgba( 149, 40, 204, 1)",!0),level11:y.c(3,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolschiffpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:u.STYLE_SCHIFF,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:y.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:y.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:y.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:y.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:y.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:y.c(1,"rgba( 0, 0, 153, 1)",!0),level6:y.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:y.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:y.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolschiffpitchfork2:{clonable:!0,fillBackground:!0,transparency:80,style:u.STYLE_SCHIFF2,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:y.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:y.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:y.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:y.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:y.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:y.c(1,"rgba( 0, 0, 153, 1)",!0),level6:y.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:y.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:y.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolinsidepitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:u.STYLE_INSIDE,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:y.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:y.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:y.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:y.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:y.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:y.c(1,"rgba( 0, 0, 153, 1)",!0),level6:y.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:y.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:y.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetool:{frozen:!1,visible:!0},linetoolvisibilities:{intervalsVisibilities:{seconds:!0,secondsFrom:1,secondsTo:59,minutes:!0,minutesFrom:1,minutesTo:59,hours:!0,hoursFrom:1,hoursTo:24,days:!0,daysFrom:1,daysTo:366,weeks:!0,months:!0}}},n(TradingView.defaultProperties.chartproperties),s()}for(void 0===TradingView.defaultProperties["study_MA@tv-basicstudies"]&&(TradingView.defaultProperties["study_MA@tv-basicstudies"]={description:"Moving Average",shortDescription:"MA",inputs:{length:9,source:"close"},styles:{MovAvg:{visible:!0,color:"rgba( 4, 150, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:m.PLOT_LINE,histogramBase:0,title:"MA"}}}),void 0===TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]={description:"Error On Update",styles:{ErrorOnUpdate:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:m.PLOT_LINE,histogramBase:0}}}),void 0===TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"]={description:"Error On Create",styles:{ErrorOnUpdate:{visible:!0,color:"rgba( 0, 255, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:m.PLOT_LINE,histogramBase:0}}}),void 0===TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]={description:"Error On New Bar",styles:{ErrorOnUpdate:{visible:!0,color:"rgba( 0, 0, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:m.PLOT_LINE,histogramBase:0}}}),void 0===TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"rgba( 83, 143, 31, 1)",backColor:"rgba( 240, 255, 204, 1)",textColor:"rgba( 0, 0, 0, 1)"}),void 0===TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]&&(o="rgba( 212, 121, 40, 1)",r=!0,a=1,TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,font:"Arial",fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:r,"S1/R1":r,"S2/R2":r,"S3/R3":r,"S4/R4":r,"S5/R5":r},colors:{P:o,"S1/R1":o,"S2/R2":o,"S3/R3":o,"S4/R4":o,"S5/R5":o},widths:{P:a,"S1/R1":a,"S2/R2":a,"S3/R3":a,"S4/R4":a,"S5/R5":a}}}),void 0===TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]&&(TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]={color:"rgba( 86, 135, 29, 1)",linewidth:2}),void 0===TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]&&(TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:y.a("rgba( 255, 0, 0, 1)",!1),level1:y.a("rgba( 0, 128, 0, 1)",!1),level2:y.a("rgba( 0, 0, 255, 1)",!1),level3:y.a("rgba( 255, 0, 255, 1)",!1),level4:y.a("rgba( 0, 128, 255, 1)",!0),level5:y.a("rgba( 255, 0, 0, 1)",!0),level6:y.a("rgba( 0, 128, 0, 1)",!0),level7:y.a("rgba( 0, 0, 255, 1)",!0),level8:y.a("rgba( 255, 0, 255, 1)",!0)}),void 0===TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]&&(TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]={styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!0,showPearsons:!0,backgroundColor:"rgba( 153, 21, 21, 0.3)",transparency:70}}),void 0===TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]&&(TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]={linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}}),void 0===TradingView.defaultProperties["study_Compare@tv-basicstudies"]&&(TradingView.defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"}),void 0===TradingView.defaultProperties["study_Overlay@tv-basicstudies"]&&(l="study_Overlay@tv-basicstudies",TradingView.defaultProperties[l]={style:d.STYLE_BARS,showPriceLine:!1,minTick:"default",candleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},barStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 3, 3, 247, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:d.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},styles:{open:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:m.PLOT_LINE,histogramBase:0,title:"open"},high:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:m.PLOT_LINE,histogramBase:0,title:"high"},low:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:m.PLOT_LINE,histogramBase:0,title:"low"},close:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:m.PLOT_LINE,histogramBase:0,title:"close"}}},t.enabled("use_overrides_for_overlay")&&n(TradingView.defaultProperties[l],null,!1,l)),h=e.split("."),_=TradingView.defaultProperties,f=0;f<h.length;f++)_&&(_=_[h[f]]);return v=_?TradingView.clone(_):{},g[e]&&TradingView.merge(v,g[e]),v};a.create=function(t,e){var i,o;e&&(i=f.parseIdString(t),o=v(i.id),TradingView.defaultProperties[i.id]=$.extend(e,o))},a.remove=function(t){TradingView.defaultProperties[t]=void 0},TradingView.saveDefaults=function(t,e){TVSettings.setJSON(t,e)},TradingView.factoryDefaults=v,window.defaults=a,window.applyDefaultsOverrides=n,window.applyPropertiesOverrides=o,window.applyDefaultOverridesToLinetools=s,window.applyOverridesToStudies=r,e.factoryDefaults=v,e.applyDefaultsOverrides=n,e.applyPropertiesOverrides=o,e.applyDefaultOverridesToLinetools=s,e.defaults=a}).call(e,i(1))},function(t,e,i){(function(t){"use strict";function o(t,e){r.call(this,t,e),this._linetool=t,this._pointIndex=e,this._text="",this._coordinate=0,this._background="#5592C9",this._activeBackground="#0F6DBF",this._borderColor="#2E84A6",this._color="white",this._invalidated=!0,this._model=t._model}function n(t,e){l.call(this),this._linetool=t,this._pointindex=e,this._model=t._model,this._text="",this._coordinate=0,this._background="#5592C9",this._activeBackground="#0F6DBF",this._borderColor="#2E84A6",this._color="white",this._visible=!1,this._invalidated=!0}function s(t,e,i){var o,r,a;if(c.call(this),this._model=t,this._properties=i,i.visible&&i.frozen||this._properties.merge(defaults("linetool")),o=defaults("linetoolvisibilities"),i.intervalsVisibilities)for(r in o.intervalsVisibilities)this._properties.intervalsVisibilities[r]||this._properties.intervalsVisibilities.addProperty(r,o.intervalsVisibilities[r]);else this._properties.merge(o);if($.isArray(e)?this._paneViews=e:this._paneViews=[e],this._points=[],this._fixedPoints=[],this._timePoint=[],this._properties.symbol||this._properties.merge({symbol:t.mainSeries().symbol()}),this._properties.interval||this._properties.merge({interval:t.mainSeries().interval()}),this._properties.addExclusion&&(this._properties.addExclusion("symbol"),this._properties.addExclusion("symbolInfo"),this._properties.addExclusion("points"),this._properties.addExclusion("interval"),this._properties.addExclusion("visible"),this._properties.addExclusion("lastUpdateTime")),this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,s.prototype.calcIsActualSymbol),this._properties.listeners().subscribe(this,s.prototype.propertiesChanged),this._createPointsProperties(),"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash)),this.m_priceAxisViews=[],this.m_timeAxisViews=[],this.pointsCount()>0)for(a=0;a<this.pointsCount();a++)this.m_priceAxisViews.push(this.createPriceAxisView(a)),this.m_timeAxisViews.push(new n(this,a));this._properties.visible.listeners().subscribe(this,function(t){t.value()||this._model.selectedSource()!==this||this._model.setSelectedSource(null)}),this.customization=this.customization||{forcePriceAxisLabel:!1,disableSelection:!1,disableErasing:!1,disableSave:!1,showInObjectsTree:!0},$(window).resize(function(){this.isFixed()&&this.restoreFixedPoints()}.bind(this)),this._properties.lastUpdateTime||this._properties.addProperty("lastUpdateTime",0)}var r=i(84),a=i(86),l=i(87),h=i(88),c=i(89).DataSource,d=i(92),p=i(93),u=i(94).DateTimeFormatter,_=i(30),f=i(98),m=i(99),g=i(100),v=g.Action;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.setActive=function(t){this._active=t},o.prototype._updateImpl=function(){var t,e,i,o,n;if(this._visible=!1,this._text="",this._model.timeScale()&&!this._model.timeScale().isEmpty()&&this._linetool.priceScale()&&!this._linetool.priceScale().isEmpty()&&(this._model.selectedSource()===this._linetool||this._linetool.customization.forcePriceAxisLabel)&&(t=this._model.timeScale().visibleBars(),!t.isEmpty()&&(e=this._linetool.axisPoints(),!(e.length<=this._pointIndex)&&(i=e[this._pointIndex],isFinite(i.price))))){if(o=this._linetool.priceScale(),o.isPercent()){if(n=this._linetool.ownerSource().firstValue(),!isNumber(n))return;i.price=o.priceRange().convertToPercent(i.price,n)}this._text=o.formatter().format(i.price),this._coordinate=o.priceToCoordinate(i.price),this._visible=!0}},o.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),new a({text:this._text,coordinate:this._coordinate,color:this._color,borderColor:this._borderColor,background:this._active?this._activeBackground:this._background,visible:this._visible})},o.prototype.text=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),r.prototype.text.call(this)},inherit(n,l),n.prototype.setActive=function(t){this._active=t},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i;this._visible=!1,this._model.timeScale().isEmpty()||(t=this._linetool.axisPoints(),t.length<=this._pointindex||this._linetool===this._model.selectedSource()&&(this._text="",e=t[this._pointindex].index,this._coordinate=this._model.timeScale().indexToCoordinate(e),i=this._model.timeScale().indexToUserTime(e),i&&(this._text=new u(this._model.mainSeries().isDWM()).format(i)),this._visible=!0,this._invalidated=!1))},n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),new h({text:this._text,coordinate:this._coordinate,color:this._color,background:this._active?this._activeBackground:this._background,borderColor:this._borderColor,visible:this._visible})},inherit(s,c),s.LINEEND_NORMAL=0,s.LINEEND_ARROW=1,s.LINEEND_CIRCLE=2,s.PointPriceProperty=function(e,i){t.call(this),this._lineSource=e,this._pointIndex=i},inherit(s.PointPriceProperty,t),s.prototype.enableCurrentIntervalVisibility=function(){var t,e,i,o,n,s,r,a=p.parse(this._model.mainSeries().interval());a.kind()===p.SECONDS&&(a.multiplier()<60?(this.properties().intervalsVisibilities.seconds.setValue(!0),t=Math.min(this.properties().intervalsVisibilities.secondsFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsFrom.setValue(t),e=Math.max(this.properties().intervalsVisibilities.secondsTo.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsTo.setValue(e)):a=new p(p.MINUTES,a.multiplier()/60)),a.kind()===p.MINUTES&&(a.multiplier()<60?(this.properties().intervalsVisibilities.minutes.setValue(!0),t=Math.min(this.properties().intervalsVisibilities.minutesFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesFrom.setValue(t),e=Math.max(this.properties().intervalsVisibilities.minutesTo.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesTo.setValue(e)):(i=Math.floor(a.multiplier()/60),this.properties().intervalsVisibilities.hours.setValue(!0),o=Math.min(this.properties().intervalsVisibilities.hoursFrom.value(),i),this.properties().intervalsVisibilities.hoursFrom.setValue(o),n=Math.max(this.properties().intervalsVisibilities.hoursTo.value(),i),this.properties().intervalsVisibilities.hoursTo.setValue(n))),a.kind()===p.DAYS&&(this.properties().intervalsVisibilities.days.setValue(!0),s=Math.min(this.properties().intervalsVisibilities.daysFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.daysFrom.setValue(s),r=Math.max(this.properties().intervalsVisibilities.daysTo.value(),a.multiplier()),this.properties().intervalsVisibilities.daysTo.setValue(r)),a.kind()===p.WEEKS&&this.properties().intervalsVisibilities.weeks.setValue(!0),a.kind()===p.MONTHS&&this.properties().intervalsVisibilities.months.setValue(!0)},s.prototype.getType=function(){return TradingView.className(this.constructor)},s.prototype.getConstructor=function(){return this._constructor||null},s.prototype.isActualSymbol=function(){return this._isActualSymbol},s.prototype.isActualInterval=function(){return this._isActualInterval},s.prototype.isSavedInChart=function(t){return!this.customization.disableSave},s.prototype.showInObjectTree=function(){return this.customization.showInObjectsTree},s.prototype.visibilityKeyByInterval=function(t){var e,i=p.parse(t);return s.IntervalsVisibilities.forEach(function(t){t.kind===i.kind()&&t.from<=i.multiplier()&&t.to>=i.multiplier()&&(e=t.key)}),e},s.prototype.calcIsActualSymbol=function(){var t=this._properties.symbol,e=this._model.mainSeries();this._isActualSymbol=e.symbolSameAsCurrent(t.value()),this._isActualSymbol&&t.setValue(e.symbol()),this.calcIsActualInterval()},s.prototype.calcIsActualInterval=function(){var t,e,i,o,n=this._properties,s=this._model.mainSeries(),r=p.parse(s.interval()),a=n.intervalsVisibilities;this._isActualInterval=!1,r.kind()===p.SECONDS&&(t=a.seconds.value(),e=a.secondsFrom.value(),i=a.secondsTo.value(),this._isActualInterval=t&&r.multiplier()>=e&&r.multiplier()<=i),r.kind()===p.MINUTES&&r.multiplier()<60&&(t=a.minutes.value(),e=a.minutesFrom.value(),i=a.minutesTo.value(),this._isActualInterval=t&&r.multiplier()>=e&&r.multiplier()<=i),r.kind()===p.MINUTES&&r.multiplier()>=60&&(o=Math.floor(r.multiplier()/60),t=a.hours.value(),e=a.hoursFrom.value(),i=a.hoursTo.value(),this._isActualInterval=t&&o>=e&&o<=i),r.kind()===p.DAYS&&(t=a.days.value(),e=a.daysFrom.value(),i=a.daysTo.value(),this._isActualInterval=t&&r.multiplier()>=e&&r.multiplier()<=i),r.kind()===p.WEEKS&&(this._isActualInterval=a.weeks.value()),r.kind()===p.MONTHS&&(this._isActualInterval=a.months.value()),this._isActualInterval||this._model.selectedSource()!==this||this._model.setSelectedSource(null)},s.PointPriceProperty.prototype.value=function(){var t=this._lineSource.points()[this._pointIndex].price,e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},s.PointPriceProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.price=parseFloat(t),e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},s.PointIndexProperty=function(e,i){t.call(this),this._lineSource=e,this._pointIndex=i},inherit(s.PointIndexProperty,t),s.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},s.PointIndexProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.index=t,e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},s.prototype._syncMultichartState=function(){var t={points:this._timePoint,interval:this._model.mainSeries().interval()};this.linkKey&&!this.properties().singleChartOnly&&d.finishChangingLineTool({model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:t})},s.prototype._createPointProperty=function(t){var e,i=this._properties.points;i.addProperty(t),e=i[t],e.addProperty("price"),e.price=new s.PointPriceProperty(this,t),e.addProperty("bar"),e.bar=new s.PointIndexProperty(this,t)},s.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var t=0;t<this.pointsCount();t++)this._createPointProperty(t)},s.prototype.priceScale=function(){return this._ownerSource?this._ownerSource.m_priceScale:null},s.prototype.symbol=function(){return this._properties.symbol.value()},s.prototype.properties=function(){return this._properties},s.prototype.isSavedInStudyTemplates=function(){return!1},s.prototype.state=function(t){var e=TradingView.className(this.constructor),i={type:e,id:this.id(),state:this.properties().state(),points:this._timePoint,zorder:this.zorder(),linkKey:this.linkKey};return i.state._isActualInterval=this.isActualInterval(),delete i.state.points,t&&(i.indexes=this._points),this.ownerSource()&&(i.ownerSource=this.ownerSource().id()),this.isFixed()&&(i.positionPercents=this._positionPercents||this.calcPositionPercents()),"version"in this&&1!==this.version&&(i.version=this.version),this.hasAlert.value()&&(i.alertId=this._alertId),i},s.prototype.template=function(){var t=this.properties().state();return delete t.points,delete t.symbol,delete t.symbolInfo,t},s.prototype.restoreTemplate=function(t){delete t.symbolInfo,this._model._undoModel.drawingLoadTemplate(this,t)},s.prototype.clearData=function(){this._points=[]},s.prototype.currentPointsetId=function(){return"pointset_"+this._currentPointsetId},s.prototype.stop=function(){this._currentPointsetId&&(this._model.chartApi().removePointset(this.currentPointsetId()),this._currentPointsetId=null),this.hasAlert.value()&&TradingView.alertsDispatcher&&TradingView.alertsDispatcher.deleteAlert(this._alertId)},s.prototype.isStarted=function(){return!!this._currentPointsetId},s.prototype.restart=function(){this.isFixed()||(this._currentPointsetId=0,this.createServerPoints())},s.prototype.tryCreateServerPoints=function(){this.isFixed()||this._currentPointsetId||this.createServerPoints()},s.prototype.normalizePoint=function(t){var e=this._model.timeScale().normalizeBarIndex(t.index);return e.price=t.price,e},s.prototype.normalizePoints=function(){var t,e;for(this._timePoint=[],t=0;t<this._points.length;t++){if(e=this._model.timeScale().normalizeBarIndex(this._points[t].index),!e.time_t){this._timePoint=[];break}e.price=this._points[t].price,this._timePoint.push(e)}},s.prototype.denormalizeTimePoints=function(){var t,e,i=[];for(t=0;t<this._timePoint.length;t++){if(void 0===(e=this._model.timeScale().denormalizeTimePoint(this._timePoint[t]))){i=[];break}i.push({index:e,price:this._timePoint[t].price})}i.length>0&&(this._points=i)},s.prototype.restorePoints=function(t,e,i){this._timePoint=t,this._points=e,i||this.denormalizeTimePoints()},s.prototype.restoreExternalPoints=function(t){this.properties().interval.setValue(t.interval),this._timePoint=t.points,this.denormalizeTimePoints(),this.createServerPoints()},s.prototype.restorePositionPercents=function(t){this._positionPercents=t},s.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},s.prototype.propertiesChanged=function(){if(this.calcIsActualSymbol(),this.updateAllViewsAndRedraw(),this.linkKey){var t=this.properties().state();delete t.interval,d.changeLineStyle({linkKey:this.linkKey,state:t,model:this._model})}},s.prototype.points=function(){var t,e,i=[];for(t=0;t<this._points.length;t++)e=this._points[t],i.push({index:e.index,price:e.price,time:e.time});return this._lastPoint&&i.push({index:this._lastPoint.index,price:this._lastPoint.price,time:this._lastPoint.time}),this._currentMovingPoint&&this._startMovingPoint&&this.correctPoints(i),i},s.prototype.axisPoints=function(){return this.points()},s.prototype.fixedPoints=function(){var t,e,i,o,n=[];if(this._positionPercents&&!this.priceScale().isEmpty())for(t=0;t<this._positionPercents.length;t++)e=this._positionPercents[t],i=this._model.timeScale().width()*e.x,o=this.priceScale().height()*e.y,n.push(new _.Point(i,o));else for(t=0;t<this._fixedPoints.length;t++)n.push(this._fixedPoints[t].clone());return this._lastPoint&&n.push(this._lastPoint.clone()),this._currentMovingPoint&&this._startMovingPoint&&this.correctFixedPoints(n),n},s.prototype._convertPriceFromPercentIfNeeded=function(t){var e,i=this.priceScale();i.isPercent()&&(e=this.ownerSource().firstValue(),t.price=i.priceRange().convertFromPercent(t.price,e))},s.prototype._preparePoint=function(t,e){var i=t;return e&&e.shift&&this.points().length>=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),this._convertPriceFromPercentIfNeeded(i),i},s.prototype.addPoint=function(t,e,i){var o=this._preparePoint(t,e);return this._addPointIntenal(o,e,i)},s.prototype._addPointIntenal=function(t,e,i){this._points.push(t);var o=this._points.length===this.pointsCount();return o?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=t,o},s.prototype.addFixedPoint=function(t){this._fixedPoints.push(t);var e=this._fixedPoints.length===this.pointsCount();return e&&this.calcPositionPercents(),e},s.prototype.calcPositionPercents=function(){var t,e,i,o;if(!this.priceScale()||this.priceScale().isEmpty())return[];for(this._positionPercents=[],t=0;t<this._fixedPoints.length;t++)e=this._fixedPoints[0],i=e.x/this._model.timeScale().width(),o=e.y/this.priceScale().height(),this._positionPercents.push({x:i,y:o});return this._positionPercents},s.prototype.restoreFixedPoints=function(){this._fixedPoints=this.fixedPoints()},s.prototype.onData=function(t){var e,i,o,n,s,r;if(t.params.customId===this.currentPointsetId()&&0!==t.params.plots.length){for(e=0;e<t.params.plots.length;e++)i=t.params.plots[e],o=this._timePoint[i.index],n=i.value[0],s=new Date(1e3*i.value[1]),r={index:n,time:s,price:o.price},this._points.length<=i.index?this._points.push(r):this._points[i.index]=r;this.checkAlert&&this.checkAlert(),this.updateAllViewsAndRedraw()}},s.prototype.correctPricesToPercents=function(){var t,e,i=this.priceScale(),o=this.ownerSource().firstValue();for(t=0;t<this._points.length;t++)e=this._points[t],e.price=i.priceRange().convertFromPercent(e.price,o)},s.prototype.startChanging=function(t,e){t<this.m_priceAxisViews.length&&this.m_priceAxisViews[t].setActive(!0),t<this.m_timeAxisViews.length&&this.m_timeAxisViews[t].setActive(!0),this._properties.lastUpdateTime.setValue((new Date).valueOf())},s.prototype.setPoint=function(t,e,i){if(i&&i.shift&&this._properties.snapTo45Degrees){var o=0===t?1:t-1;this._snapPoint45Degree(e,this.points()[o])}this._convertPriceFromPercentIfNeeded(e),this._points[t]=e,this.normalizePoints()},s.prototype.startMoving=function(t){this.isFixed()&&this.restoreFixedPoints(),this._convertPriceFromPercentIfNeeded(t),this._startMovingPoint=t,this._properties.lastUpdateTime.setValue((new Date).valueOf())},s.prototype.move=function(t){this._convertPriceFromPercentIfNeeded(t),this._currentMovingPoint=t,this.updateAllViews()},s.prototype.correctPoints=function(t){var e,i,o=this._currentMovingPoint.index-this._startMovingPoint.index,n=this._currentMovingPoint.price-this._startMovingPoint.price;for(e=0;e<t.length;e++)i=t[e],i.index+=o,i.price+=n,t[e]=i},s.prototype.correctFixedPoints=function(t){var e,i=this._currentMovingPoint.substract(this._startMovingPoint);for(e=0;e<t.length;e++)t[e]=t[e].add(i)},s.prototype.endMoving=function(t){var e,i;if(this._properties.interval.setValue(this._model.mainSeries().interval()),e=!1,i=!1,this._currentMovingPoint&&this._startMovingPoint&&(e=this._currentMovingPoint.index!==this._startMovingPoint.index,i=this._currentMovingPoint.price!==this._startMovingPoint.price,this.isFixed()?this.correctFixedPoints(this._fixedPoints):this.correctPoints(this._points),this._startMovingPoint=null,this._currentMovingPoint=null),this.isFixed())return this.calcPositionPercents(),void this.updateAllViews();this.normalizePoints(),this.updateAllViews(),e&&!t&&this.createServerPoints(),(i||e)&&this.synchronizeAlert(!this._alertUndoMode)},s.prototype.endChanging=function(t,e){var i;for(this._properties.interval.setValue(this._model.mainSeries().interval()),e||(this.normalizePoints(),this.createServerPoints()),i=0;i<this.m_priceAxisViews.length;i++)this.m_priceAxisViews[i].setActive(!1);for(i=0;i<this.m_timeAxisViews.length;i++)this.m_timeAxisViews[i].setActive(!1);this.synchronizeAlert(!t)},s.prototype.paneViews=function(t){var e,i;if(!this._isActualSymbol||!this._isActualInterval)return null;if(!this._properties.visible.value())return null;if(d.hideAllDrawings().value()&&this.canBeHidden())return null;for(e=[],i=this._paneViews.length-1;i>=0;--i)e.push(this._paneViews[i]);return e},s.prototype.dataWindowView=function(){return null},s.prototype.statusView=function(){return null},s.prototype.priceAxisViews=function(t,e){var i,o,n;return this._isActualSymbol&&t.dataSources().indexOf(this)!==-1&&e===this.priceScale()?this._model.lineBeingEdited()===this?(i=this._model.linePointBeingEdited(),i<this.m_priceAxisViews.length?(o=this.m_priceAxisViews.slice(),n=o[i],o.splice(i,1),o.push(n),o):this.m_priceAxisViews):this.m_priceAxisViews:null},s.prototype.timeAxisViews=function(){var t,e,i;return this._model.lineBeingEdited()===this?(t=this._model.linePointBeingEdited(),t<this.m_timeAxisViews.length?(e=this.m_timeAxisViews.slice(),i=e[t],e.splice(t,1),e.push(i),e):this.m_timeAxisViews):this.m_timeAxisViews},s.prototype.updateAllViews=function(){var t,e,i;if(!this._isActualSymbol)return null;if(!this._properties.visible.value())return null;if(null!==(t=this.paneViews()))for(e=t,i=0;i<e.length;i++)e[i].update();for(e=this.m_priceAxisViews,i=0;i<e.length;i++)e[i].update();for(e=this.m_timeAxisViews,i=0;i<e.length;i++)e[i].update()},s.prototype.setLastPoint=function(t,e){this._lastPoint=this._preparePoint(t,e),this.updateAllViews()},s.prototype.setLastFixedPoint=function(t){this._lastFixedPoint=t,this.updateAllViews()},s.prototype.title=function(){return"Line Tool"},s._pointSetId=1,s.prototype.start=function(){this.createServerPoints()},s.prototype.createServerPoints=function(){var t,e,i,o,n,r;if(!this._recursiveGuard&&this._isActualSymbol&&this._model.chartApi().connected()&&(this._currentPointsetId&&(this._model.chartApi().removePointset(this.currentPointsetId()),this._currentPointsetId=null),!this._model.timeScale().isEmpty()&&(0===this._timePoint.length&&this.normalizePoints(),0!==this._timePoint.length))){for(this._currentPointsetId=++s._pointSetId,t=this._model.mainSeries().symbolId(),e=this.properties().interval.value(),i=[],o=0;o<this._timePoint.length;o++)n=this._timePoint[o],i.push([n.time_t,n.offset]);r=this,this._model.chartApi().createPointset(this.currentPointsetId(),"turnaround",t,e,i,function(t){r.onData(t)})}},s.prototype.isBeingEdited=function(){return this===this._model.lineBeingEdited()||this===this._model.sourceBeingMoved},s.prototype.isFixed=function(){return this.properties().locked&&this.properties().locked.value()},s.prototype.isLocked=s.prototype.isFrozen=function(){return this.properties().frozen&&this.properties().frozen.value()},s.prototype._tooltipFieldsHash={},s.prototype._tooltipFieldsOrder=["time","price","index","time0","price0","time1","price1","time2","price2","time3","price3","time4","price4","distance","term","pointsPerBar"],s.prototype._tooltipFieldsOrdered=null,s.prototype._formatTooltip=function(){return null===this._tooltipFieldsOrdered&&(this._tooltipFieldsOrdered=new f(this._tooltipFieldsHash,f.byOrder(this._tooltipFieldsOrder))),this._tooltipFieldsOrdered.array.filter(function(t){return null!==t.value&&""!==t.value}).map(function(t){return"<span>"+t.title+":</span> "+t.value}).join("<br />")},s.prototype.pointToScreenPoint=function(t){var e,i,o,n,s,r,a=this._model.timeScale(),l=this.priceScale();if(!l||l.isEmpty()||a.isEmpty())return[new _.Point(0,0),new _.Point(0,0)];if(e=null,l.isPercent()){if(!this.ownerSource())return;if(null===(e=this.ownerSource().firstValue())||!isFinite(e))return}return i=a.indexToCoordinate(t.index,!0),o=t.price,l.isPercent()&&(o=l.priceRange().convertToPercent(o,e)),n=l.priceToCoordinate(o,!0),s=new _.Point(i,n),i=a.indexToCoordinate(t.index,!1),n=l.priceToCoordinate(o,!1),r=new _.Point(i,n),[s,r]},s.prototype.screenPointToPoint=function(t){var e=this._model.timeScale(),i=this.priceScale(),o=e.coordinateToIndex(t.x),n=i.coordinateToPrice(t.y),s=null;if(i.isPercent()){if(!this.ownerSource())return;if(null===(s=this.ownerSource().firstValue())||!isFinite(s))return}return i.isPercent()&&(n=i.priceRange().convertFromPercent(n,s)),{price:n,index:o}},s.prototype.tags=function(){return[this._constructor]},s.prototype._snapPoint45Degree=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f=this._model.timeScale(),m=f.indexToCoordinate(e.index),g=f.indexToCoordinate(t.index)-m,v=this.m_priceScale,y=e.price,b=t.price,w=this.ownerSource().firstValue();v.isPercent()&&(y=v.priceRange().convertToPercent(y,w)),o=v.priceToCoordinate(y),n=v.priceToCoordinate(b)-o,s=Math.round(Math.atan2(g,n)/Math.PI*4),2===Math.abs(s)?i||(t.price=y):0===Math.abs(s)||4===Math.abs(s)?i||(t.index=e.index):0===Math.abs(s)||4===Math.abs(s)?i||(t.index=e.index):(r=Math.sqrt(g*g+n*n),a=g<0?-1:1,l=n<0?-1:1,h=Math.max(Math.abs(n),Math.abs(g)),c=h*Math.sqrt(2),d=c/r,h/=d,p=Math.round(f.coordinateToIndex(m+h*a)),u=Math.abs(f.indexToCoordinate(p)-m),_=v.coordinateToPrice(o+u*l),t.index=p,t.price=_)},s.prototype.createPriceAxisView=function(t){return new o(this,t)},s.prototype.version=1,s.isLineTool=function(t){var e=TradingView[t];return!!e&&TradingView.isInherited(e,s)},s.prototype.alertId=function(){return this._alertId},s.prototype.setAlert=function(t,e){},s.prototype._flushAlert=function(t){delete this._alertId,delete this._alert,this.hasAlert.setValue(!1),window.saver&&window.saver.saveChartSilently(null,!1)},s.prototype._processAlertHanders=function(t){var e,i,o,n=this;("unsubscribe"!==(t="subscribe"===t?"subscribe":"unsubscribe")||n._alertCallbacks)&&(i="subscribe"===t?"on":"off",e=n.properties(),o=n._alertCallbacks||{flush:n._flushAlert.bind(n),hovered:function(t,e){e?n._model.setHoveredSource(n):n._model.hoveredSource()===n&&n._model.setHoveredSource(null)},selected:function(t,e){e&&n._model.setSelectedSource(n)},synchronizeSilently:function(t){n.synchronizeAlert(!1)}},n._alertCallbacks||(n._alertCallbacks=o),n.getAlert().done(function(s){s&&(s[i]("destroy",o.flush),s[i]("change:hovered",o.hovered),s[i]("change:selected",o.selected),e.extendLeft&&e.extendLeft[t](n,o.synchronizeSilently),e.extendRight&&e.extendRight[t](n,o.synchronizeSilently))}))},s.prototype.editAlert=function(){},s.prototype.getAlert=function(t){var e,i=this;return t=t||{},e=$.Deferred(),TradingView.alertsDispatcher?TradingView.alertsDispatcher.requestAlert(i._alertId,{success:e.resolve.bind(e),error:e.reject.bind(e),fromCache:t.fromCache}):TradingView.logError("[Alerts] Can't get alert without alerts dispatcher"),e.promise()},s.prototype.synchronizeAlert=function(t){var e=this;e.hasAlert.value()&&setTimeout(function(){function i(){e._alertUndoMode=!0,r.undoToCheckpoint(e._undoCheckpointAlert),setTimeout(function(){e._alertUndoMode=!1,e.localAndServerAlersMismatch=!1},0)}function o(t){t.set("resolution",e.properties().interval.value()),t.get("extra").drawing(e),e.localAndServerAlersMismatch=!0}function n(t){TradingView.alertsDispatcher.restartAlert(t,{success:function(){e.localAndServerAlersMismatch=!1},error:i,complete:function(){delete e._undoCheckpointAlert}})}var s,r=e._model._undoModel;e._undoCheckpointAlert||e._alertUndoMode||(s=r.undoStack().pop(),e._undoCheckpointAlert=r.createUndoCheckpoint(),r.undoStack().push(s)),e.getAlert().done(function(e){o(e),t&&n(e)}).fail(i)},0)},s.prototype.stateForAlert=function(){var t,e;if(this.canHasAlert())return t=this.state(),t.uniqueId=this.uniqueId(),t.title=this.title(),e=this._getAlertPlots(),e&&(t.plots=e),t},s.prototype._getAlertPlots=function(){return null},s.prototype._linePointsToAlertPlot=function(t,e,i,o){if(2!==t.length)return TradingView.logError("[Drawing Alert] Wrong points"),null;var n=this._model.timeScale();return!n||n.isEmpty()?null:{type:"LinePlot",title:e||this.title(),timestamp:Math.round(n.indexToTimePoint(0).getTime()/1e3),offset1:t[0].index,offset2:t[1].index,price1:t[0].price,price2:t[1].price,extendBackward:i||!1,extendForward:o||!1}},s.prototype.getAlertIsActive=function(t){this.getAlert({fromCache:!0}).done(function(e){t(!!e&&e.get("active"))}).fail(function(){t(!1)})},s.prototype.geometry=function(){var t=this,e=function(e){var i=e.x/t._model.timeScale().width(),o=e.y/t.priceScale().height();return new _.Point(i,o)};return this.points().map(function(i){return e(t.pointToScreenPoint(i)[0])})},s.prototype.onlyYMoving=function(){return!1},s.prototype.contextMenuActions=function(){return[]},s.prototype.updateContextMenuActions=function(){},s.prototype._makeAdjustScaleAction=function(t){var e=new v({text:$.t("Adjust Scale")});return e.callbacks().subscribe(this,function(){var e=t?t():this.points();e.length<2||this._adjustScaleForSquare(e[0],e[1])}),e},s.prototype._adjustScaleForSquare=function(t,e){var i,o,n,s=this._model.timeScale(),r=this.priceScale(),a=Math.abs(r.priceToCoordinate(t.price)-r.priceToCoordinate(e.price)),l=Math.abs(s.indexToCoordinate(t.index)-s.indexToCoordinate(e.index));r.setAutoScale(!1),i=r.priceRange().clone(),i.scaleAroundCenter(a/l),o=Math.min(r.priceToLogical(t.price),r.priceToLogical(e.price)),n=Math.max(r.priceToLogical(t.price),r.priceToLogical(e.price)),i.minValue()>o?i.shift(o-i.minValue()):i.maxValue()<n&&i.shift(n-i.maxValue()),r.setPriceRange(i),this._model.invalidate(new m(m.FULL_UPDATE))},e.LineToolPriceAxisView=o,e.LineDataSource=s}).call(e,i(83))},function(t,e,i){(function(e){"use strict";function i(t){if(this._listeners=new e,this._childs=[],void 0!==t&&null!==t)if(this.isPrimitiveType(t))this._value=t;else for(var i in t)this.addProperty(i,t[i])}i.prototype.merge=function(t){var e,i;if(null!=t)if(this.isPrimitiveType(t))this._value=t;else if(Array.isArray(t))for(e=0;e<t.length;e++)this[e]?this[e].merge(t[e]):this.addProperty(e,t[e]);else for(i in t)this[i]?this[i].merge(t[i]):this.addProperty(i,t[i])},i.prototype.state=function(t){var e,i,o,n,s,r=this._value;for(void 0===r&&(r={}),e=0;e<this._childs.length;e++)if(i=this._childs[e],!t||t.indexOf(i)===-1)if(t){for(o=[],n=0;n<t.length;n++)s=t[n],s.startsWith(i+".")&&o.push(s.substr(i.length+1));r[i]=this[i].state(o)}else r[i]=this[i].state();return r},i.prototype.clone=function(t){return new i(this.state())},i.prototype.isPrimitiveType=function(t){return!!isNumber(t)||(!!new TradingView.TypeValidator(String).check(t)||TradingView.isBoolean(t))},i.prototype.value=function(){return this._value},i.prototype.listeners=function(){return this._listeners},i.prototype.childCount=function(){return this._childs.length},i.prototype.setValue=function(t,e){(this._value!==t||e)&&(this._value=t,this._listeners.fire(this))},i.prototype.setValueSilently=function(t){this._value=t},i.prototype.addProperty=function(t,e){var o=new i(e);this[t]=o,this._childs.push(t),o.listeners().subscribe(this,i.prototype.childChanged)},i.prototype.removeProperty=function(t){this[t].listeners().unsubscribe(this,i.prototype.childChanged),delete this[t],this._childs=this._childs.filter(function(e){return e!==t})},i.prototype.addChild=function(t,e){this[t]=e,$.inArray(t,this._childs)===-1&&this._childs.push(t),e.listeners().subscribe(this,i.prototype.childChanged)},i.prototype.childChanged=function(t,e){this.listeners().fire(this)},i.prototype.subscribe=function(t,e){this.listeners().subscribe(t,e)},i.prototype.unsubscribe=function(t,e){this.listeners().unsubscribe(t,e)},i.prototype.unsubscribeAll=function(t){this.listeners().unsubscribeAll(t)},t.exports=i}).call(e,i(34))},function(t,e,i){"use strict";function o(){this._text="",this._background="#585858",this._coordinate=0}var n=i(85).RGBColor;o.prototype.text=function(){return this._text},o.prototype.background=function(){return this._background},o.prototype.color=function(){return new n(this._background).blackWhiteContrast()},o.prototype.coordinate=function(){return this._coordinate},o.prototype.floatCoordinate=function(){return this._floatCoordinate||this._coordinate},t.exports=o},,function(t,e){"use strict";function i(t){this._data=t}i.prototype.draw=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w;this._data.visible&&(i=e.fontSize,t.font=e.font,o=e.tickLength,n=e.borderSize,s=e.paddingTop,r=e.paddingBottom,a=e.paddingInner,l=e.paddingOuter,h=Math.ceil(e.widthCache.measureText(t,this._data.text)),c=e.baselineOffset,t.strokeStyle=this._data.borderColor,t.fillStyle=this._data.background,t.lineWidth=1,d=e.fontSize+s+r,p=n+h+a+l+o,u=this._data.coordinate,_=u-Math.floor(i/2)-s-.5,f=_+d,m=e.isLeft?e.width-n-.5:.5,g=m,this._data.text&&(e.isLeft?(g=m-p,v=m-o,y=g+l):(g=m+p,v=m+o,y=m+n+o+a),t.beginPath(),t.moveTo(m,_),t.lineTo(g,_),t.lineTo(g,f),t.lineTo(m,f),t.fill(),t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(m,u),t.lineTo(v,u),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,y,f-r-c)),this._data.secondLine&&(b=Math.ceil(e.widthCache.measureText(t,this._data.secondLine)),w=b+a+l,t.fillStyle=this._data.background,this._data.text&&(_+=d+1,f+=d+1),e.isLeft?(g=Math.min(g,e.width-o),m=g+w,y=g+l):(m=Math.max(g-w,n),g=m+w,y=m+a),t.beginPath(),t.moveTo(m,_),t.lineTo(g,_),t.lineTo(g,f),t.lineTo(m,f),t.fill(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.secondLine,y,f-r-c)))},i.prototype.height=function(t,e){var i=t.fontSize+t.paddingTop+t.paddingBottom;return this._data.secondLine&&e?2*i+1:i},t.exports=i},function(t,e,i){"use strict";function o(){this._text="",this._background="#585858",this._coordinate=0}var n=i(85).RGBColor;o.prototype.text=function(){return this._text},o.prototype.background=function(){return this._background},o.prototype.color=function(){return new n(this._background).blackWhiteContrast()},o.prototype.coordinate=function(){return this._coordinate},t.exports=o},function(t,e){"use strict";function i(t){this._data=t}i.prototype.draw=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g;this._data.visible!==!1&&(t.font=e.font,i=e.paddingHorizontal,(o=e.widthCache.measureText(t,this._data.text))<=0||(n=o+2*i,s=Math.floor(this._data.coordinate-n/2)+.5,r=s,a=r+n,l=a,h=Math.round(this._data.coordinate+1),c=h,d=.5,p=d+e.borderSize+e.tickLength+e.paddingTop+e.fontSize+e.paddingBottom,u=p,_=d,f=_,m=f+e.borderSize+e.tickLength,g=p-e.baselineOffset-e.paddingBottom,t.fillStyle=this._data.background,t.lineWidth=1,t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(s,d),t.lineTo(r,p),t.lineTo(a,u),t.lineTo(l,_),t.fill(),t.beginPath(),t.moveTo(h,f),t.lineTo(c,m),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,s+i,g)))},t.exports=i},function(t,e,i){(function(t){"use strict";function o(){this._zorder=0,this.m_priceScale=null,this._id=TradingView.randomHashN(6),this._ownerSource=null,this._userEditEnabled=!0,this.hasAlert=new t(!1)}function n(t){o.call(this),this._isOverlay=null,this._model=t}var s=i(91).DefaultProperty;o.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i)},o.prototype.id=function(){return this._id},o.prototype.uniqueId=function(){return this._id},o.prototype.setId=function(t){this._id=t},o.prototype.zorder=function(){return this._zorder},o.prototype.setZorder=function(t){"number"==typeof t&&this._zorder!==t&&(this._zorder=t)},o.prototype.title=function(){throw Error("Implement this fun in a subclass")},o.prototype.priceScale=function(){return this.m_priceScale},o.prototype.setPriceScale=function(t){this.m_priceScale=t},o.prototype.ownerSource=function(){return this._ownerSource},o.prototype.setOwnerSource=function(t){this._ownerSource=t,t&&this.setPriceScale(t.priceScale())},o.prototype.isSavedInChart=function(t){return!0},o.prototype.isSavedInStudyTemplates=function(){return!0},o.prototype.isRemovedByStudyTemplates=function(){return!0},o.prototype.hasContextMenu=function(){return!0},o.prototype.showInObjectTree=function(){return!0},o.prototype.setUserEditEnabled=function(t){this._userEditEnabled=t},o.prototype.userEditEnabled=function(){return this._userEditEnabled},o.prototype.canBeHidden=function(){return this.userEditEnabled()},o.prototype.isUserDeletable=function(){return this.userEditEnabled()},o.prototype.canHasAlert=function(){return!1},o.prototype.properties=function(){throw Error("Implement this fun in a subclass")},o.prototype.statusView=function(){return null},o.prototype.dataWindowView=function(){return null},o.prototype.priceAxisViews=function(t,e){return null},o.prototype.updateAllViews=function(){},o.prototype.paneViews=function(t){return null},o.prototype.isChildStudy=function(){return!1},o.prototype.hasChildren=function(){return!1},o.prototype.canHaveChildren=function(){return!1},inherit(n,o),n.prototype.isNoScale=function(){return!!this._isOverlay},n.prototype.base=function(){return 0},n.prototype.formatter=function(){return null},n.prototype.model=function(){return this._model},n.prototype.priceRange=function(t,e){return null},n.prototype.isDraggable=function(){return!this._metaInfo||!this._metaInfo.linkedToSeries},e.DataSource=o,e.PriceDataSource=n}).call(e,i(90))},function(t,e,i){(function(t){"use strict";function e(){}function i(t){if(!(this instanceof i))return new i(t);arguments.length>0&&(this._value=t),this._listeners=[]}i.prototype.value=function(){return this._owner?this._owner._value:this._value},i.prototype.setValue=function(t,e){var i,o,n,s=this._owner?this._owner:this;if("function"==typeof s.hook&&(t=s.hook(t)),s.writeLock)return s._value;if(!e&&s._value===t&&s.hasOwnProperty("_value"))return t;for(s._value=t,i=s._listeners.slice(),o=0,n=0;n<i.length;n++)i[n].once&&(s._listeners.splice(n-o,1),o++),i[n].cb(t);return t},i.prototype.deleteValue=function(){var t,e,i,o=this._owner?this._owner:this;if(o.hasOwnProperty("_value")){if(o.writeLock)return o._value;for(delete o._value,t=o._listeners.slice(),e=0,i=0;i<t.length;i++)t[i].once&&(o._listeners.splice(i-e,1),e++),t[i].cb()}},i.prototype.subscribe=function(t,e){var i,o,n;if("function"!=typeof t)throw new TypeError("callback must be a function");i=!!e&&!!e.once,o=!!e&&!!e.callWithLast,n=this._owner?this._owner:this,o&&n.hasOwnProperty("_value")&&(t(n._value),i)||n._listeners.push({cb:t,owner:this,once:!!e&&!!e.once})},i.prototype.unsubscribe=function(t){var e,i,o=this._owner?this._owner:this;for(void 0===t&&(t=null),e=o._listeners,i=e.length;i--;)e[i].owner!==this&&o!==this||e[i].cb!==t&&null!==t||e.splice(i,1)},i.prototype.listeners=function(){return(this._owner?this._owner:this)._listeners},i.prototype.readonly=function(){if(this._readonlyInstance)return this._readonlyInstance;var t=this._readonlyInstance=new e;return t.subscribe=this.subscribe.bind(this),t.unsubscribe=this.unsubscribe.bind(this),t.value=this.value.bind(this),t.when=this.when.bind(this),t},i.prototype.spawn=function(){var t=new i;return delete t._listeners,t._owner=this._owner||this,t.destroy=function(){this.unsubscribe(),delete this._owner},t},i.prototype.when=function(t){var e,i=this;if(this.value())return void t();e=function(o){o&&(i.unsubscribe(e),t())},i.subscribe(e)},i.prototype.opposite=function(){var t,e;return this._opposite||(t=this,e=new i(!this.value()),this.subscribe(function(t){e.setValue(!t)}),e.subscribe(function(e){t.setValue(!e)}),this._opposite=e),this._opposite},"undefined"!=typeof window&&(window.WatchedValue=i),void 0!==t&&t&&t.exports&&(t.exports=i)}).call(e,i(8)(t))},function(t,e,i){"use strict";function o(t,e,i){this._defaultName=t;var n;i?n=e:(n=TradingView.clone(defaults(t)),e&&TradingView.merge(n,e)),s.call(this,n),this._defaultName=t,this.listeners().subscribe(this,o.prototype.onPropertyChanged),this._exclusions=[]}function n(t){o._saveDefaults=t}var s=i(83);inherit(o,s),o._saveDefaults=!1,o.prototype.addExclusion=function(t){this._exclusions.push(t)},o.prototype.restoreFactoryDefaults=function(){var t,e={};this._defaultName.startsWith("study_")&&(e=TradingView.clone(TradingView.factoryDefaults("study"))),this._defaultName.startsWith("linetool")&&(e=TradingView.clone(TradingView.factoryDefaults("linetoolvisibilities"))),t=TradingView.clone(TradingView.factoryDefaults(this._defaultName)),this._defaultName.startsWith("study_")&&t.inputs&&delete t.inputs.symbol,"linetoolicon"===this._defaultName&&(t.icon=defaults(this._defaultName).icon),~["linetooltext","linetooltextabsolute","linetoolnote","linetoolnoteabsolute","linetoolcallout","linetoolballoon","linetoolarrowmark","linetoolarrowmarkleft","linetoolarrowmarkup","linetoolarrowmarkright","linetoolarrowmarkdown","linetoolhorzline","linetoolhorzray"].indexOf(this._defaultName)&&delete t.text,this._exclusions.forEach(function(e){delete t[e]}),TradingView.merge(e,t),this.merge(e),this._defaultName.startsWith("study_")||TradingView.saveDefaults(this._defaultName,this.state(this._exclusions)),this.listeners().fire(this)},o.prototype.cleanupFactoryDefaults=function(){var t={};TradingView.saveDefaults(this._defaultName,t),this.listeners().fire(this)},o.prototype.onPropertyChanged=function(){o._saveDefaults&&!this._defaultName.startsWith("study_")&&this.saveDefaults()},o.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions))},o.prototype.clone=function(t){return new o(this._defaultName,this.state(),t&&t.replaceByState)},e.DefaultProperty=o,e.saveDefaultProperties=n},function(t,e,i){(function(e,o,n){"use strict";function s(t){return"cursor"===t||"arrow"===t||"dot"===t}function r(t){!t&&d&&d.stayInDrawingMode.value()||this.tool.setValue(this.cursorTool.value())}function a(t,e){return function(e){t.inFire||(t.inFire=!0,t.fire(e),t.inFire=!1)}}function l(){K||(g.setValue(TVSettings.getValue("chart.cursorPreference","cursor")),g.subscribe(function(t){s(t)&&v.setValue(t)},{callWithLast:!0}),v.subscribe(function(t){t&&TVSettings.setValue("chart.cursorPreference",t)}),d=new h("drawings"),p=new n,u=new n,_=new n,f=new n,p.setValue(!1),u.setValue(!1),_.setValue(!1),f.setValue(!1),g.subscribe(function(){c.emit("onSelectedLineToolChanged")}),K=!0)}var h=i(91).DefaultProperty,c=i(36),d=null,p=null,u=null,_=null,f=null,m=new e,g=new e,v=new e,y=new o,b=new o,w=new o,S=new o,T=new o,C=new o,x=new o,P=new o,L=new o,k=new o,I=new o,E=new o,A=new o,V=new o,M=new o,$=a(y),D=a(b),O=a(w),B=a(S),R=a(T),N=a(C),F=a(x),W=a(P),z=a(L),H=a(k),U=a(I),j=a(E),q=a(A),Y=a(V),G=a(M),K=!1;t.exports={tool:g,cursorTool:v,toolIsCursor:s,resetToCursor:r,init:l,createdLineTool:y,continuedLineTool:b,cancelledLineTool:w,createLineTool:$,continueLineTool:D,cancelLineTool:O,startedMovingLineTool:S,movedLineTool:T,finishedMovingLineTool:C,startMovingLineTool:B,moveLineTool:R,finishMovingLineTool:N,startedChangingLineTool:x,changedLineTool:P,finishedChangingLineTool:L,startChangingLineTool:F,changeLineTool:W,finishChangingLineTool:z,removedLineTool:k,removeLineTool:H,restoredLineTool:V,restoreLineTool:Y,restoredLineToolState:M,restoreLineToolState:G,finishedLineTool:I,finishLineTool:U,changedLineStyle:E,changeLineStyle:j,copiedLineTool:A,copyLineTool:q,properties:function(){return d},hideAllDrawings:function(){return p},hideMarksOnBars:function(){return _},lockDrawings:function(){return u},drawOnAllCharts:function(){return d.drawOnAllCharts},lockTimeAxis:function(){return f},lockTimeAxisTime:m}}).call(e,i(90),i(34),i(83))},function(t,e){(function(e){"use strict";function i(t,e){if(void 0===e&&t!==i.INVALID)return i.parse(t);this._kind=t,this._multiplier=e}"undefined"==typeof window&&(e.TradingView={}),i.SECONDS="seconds",i.MINUTES="minutes",i.HOURS="hours",i.DAYS="days",i.WEEKS="weeks",i.MONTHS="months",i.INVALID="invalid",i.KIND_TO_MS={},i.KIND_TO_MS[i.SECONDS]=1e3,i.KIND_TO_MS[i.MINUTES]=60*i.KIND_TO_MS[i.SECONDS],i.KIND_TO_MS[i.HOURS]=60*i.KIND_TO_MS[i.MINUTES],i.KIND_TO_MS[i.DAYS]=24*i.KIND_TO_MS[i.HOURS],i.KIND_TO_MS[i.WEEKS]=7*i.KIND_TO_MS[i.DAYS],i.IntadayRegExp=RegExp("^([0-9]*)$"),i.DWMSRegExp=RegExp("^(\\d*)([DWMS])$"),i.prototype.kind=function(){return this._kind},i.prototype.multiplier=function(){return this._multiplier},i.prototype.isValid=function(){return this.kind()!==i.INVALID},i.prototype.isDWM=function(){return this.isValid()&&!this.isIntraday()},i.prototype.isIntraday=function(){return[i.SECONDS,i.MINUTES,i.HOURS].indexOf(this.kind())!==-1},i.prototype.letter=function(){return this.isValid()&&this.kind()!==i.MINUTES?this.kind()[0].toUpperCase():""},i.prototype.value=function(){return this.isValid()?this.kind()===i.MINUTES?this.multiplier()+"":this.multiplier()+this.letter():""},i.prototype.isEqualTo=function(t){if(!(t instanceof i))throw Error("Argument is not an Interval");return this.kind()!==i.INVALID&&t.kind()!==i.INVALID&&(this.kind()===t.kind()&&this.multiplier()===t.multiplier())},i.prototype.inMilliseconds=function(){if(this.isValid()&&this.kind()!==i.MONTHS)return i.KIND_TO_MS[this.kind()]*this.multiplier()},i.isEqual=function(t,e){return i.parse(t).isEqualTo(i.parse(e))},i.parse=function(t){var e,o;return t=(t+"").toUpperCase().split(",")[0],e={D:i.DAYS,W:i.WEEKS,M:i.MONTHS,H:i.HOURS,S:i.SECONDS},(o=i.IntadayRegExp.exec(t))?new i(i.MINUTES,parseInt(t,10)):(o=i.DWMSRegExp.exec(t),o?new i(e[o[2]],parseInt(o[1],10)?parseInt(o[1],10):1):new i(i.INVALID))},i.isDWM=function(t){return i.parse(t).isDWM()},i.kind=function(t){return i.parse(t).kind()},i.isValid=function(t){return i.parse(t).isValid()},t.exports=i}).call(e,function(){return this}())},function(t,e,i){(function(t){"use strict";function o(t,e){var i;if(!f.isNumber(t))return"n/a";if(!f.isInteger(e))throw new TypeError("invalid length");if(e<0||e>16)throw new TypeError("invalid length");return 0===e?""+t:(i="0000000000000000",(i+""+t).right(e))}var n,s,r,a,l,h,c,d,p,u,_,f=i(28);i(96),n=i(31),i(41),e.customFormatters={dateFormatter:null,timeFormatter:null},e.formatterOptions={decimalSign:".",decimalSignFractional:"'"},s={custom:$.t("Price format is invalid."),fraction:$.t("Fraction part is invalid."),secondFraction:$.t("Second fraction part is invalid.")},e.numberToStringWithLeadingZero=o,r=function(){function t(t,e,i,o){if(e||(e=1),f.isInteger(t)||(t=100),t<0)throw new TypeError("invalid base");if(this._priceScale=t,this._minMove=e,this._minMove2=o,i&&o>0&&2!==o&&4!==o&&8!==o)return void n.logDebugChart("invalid minmove2");this._fractional=i,this.calculateDecimal()}return t.prototype.isFractional=function(){return!!this._fractional},t.prototype.state=function(){return{fractional:this._fractional,fractionalLength:this._fractionalLength,minMove:this._minMove,minMove2:this._minMove2}},t.prototype.calculateDecimal=function(){if(this._fractionalLength=0,this._priceScale>0&&this._minMove>0){var t=this._priceScale;for(this._fractional&&this._minMove2&&(t/=this._minMove2);t>1;)t/=10,this._fractionalLength++}},t.prototype.format=function(t,e,i){var o="";return t<0?(o=e===!0?"−":"-",t=-t):t&&e===!0&&(o="+"),this._fractional?o+this.formatAsFractional(t,i):o+this.formatAsDecimal(t,i)},t.prototype._removeEndingZeros=function(t,e){for(var i=0;i<e&&"0"===t[t.length-1];i++)t=t.substr(0,t.length-1);return t},t.prototype.formatAsDecimal=function(t,i){var n,s,r,a;return i=i||0,n=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,i)*this._priceScale/this._minMove,s=Math.floor(t),r=+(Math.round(t*n)-s*n).toFixed(this._fractionalLength),r>=n&&(r-=n,s+=1),a="",1!==n&&(a=e.formatterOptions.decimalSign+o(+r.toFixed(this._fractionalLength)*this._minMove,this._fractionalLength+i),a=this._removeEndingZeros(a,i)),""+s+a},t.prototype.formatAsFractional=function(t,i){var n,s,r,a,l,h,c,d,p,u=this._priceScale/this._minMove,_=Math.floor(t),f=i?Math.floor(t*u)-_*u:Math.round(t*u)-_*u;if(f===u&&(f=0,_+=1),n="",i&&(s=(t-_-f/u)*u,s=Math.round(s*Math.pow(10,i)),n=o(s,i),n=this._removeEndingZeros(n,i)),!this._fractionalLength)throw Error("_fractionalLength is not calculated");return r="",this._minMove2?(a=["0","5"],l=["0","2","5","7"],h=["0","1","2","3","4","5","6","7"],c=f%this._minMove2,f=(f-c)/this._minMove2,d=o(f,this._fractionalLength),p=2===this._minMove2?a[c]:8===this._minMove2?h[c]:l[c],r=d+e.formatterOptions.decimalSignFractional+p):r=o(f*this._minMove,this._fractionalLength),""+_+e.formatterOptions.decimalSignFractional+r+n},t.prototype._parseAsDecimal=function(t){var i,o,n;return RegExp(/^(\-?)[0-9]+$/).exec(t)?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^(-?)[0-9]+\\"+e.formatterOptions.decimalSign+"[0-9]*$"),n=o.exec(t),n?(i=parseFloat(t.replace(e.formatterOptions.decimalSign,".")),{price:i,res:!0,suggest:this.format(i)}):{error:s.custom,res:!1})},t.prototype._patchFractPart=function(t,e){var i={0:0,5:1},o={0:0,2:1,5:2,7:3};return 2===e?void 0===i[t]?-1:i[t]:4===e?void 0===o[t]?-1:o[t]:t},t.prototype._parseAsSingleFractional=function(t){var i,o,n,r,a,l;return RegExp(/^[0-9]+$/).exec(t)?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)$"),n=o.exec(t),n?(r=parseInt(n[1]),a=this._priceScale,(l=this._patchFractPart(parseInt(n[2]),a))>=a||l<0?{error:s.fraction,res:!1}:(i=r+l/a,{price:i,res:!0,suggest:this.format(i)})):{error:s.custom,res:!1})},t.prototype._parseAsDoubleFractional=function(t){var i,o,n,r,a,l,h,c;return RegExp(/^[0-9]+$/).exec(t)?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)$"),n=o.exec(t),n?(r=parseInt(n[1]),a=this._priceScale/this._minMove2,l=this._minMove2,h=this._patchFractPart(parseInt(n[2]),a),c=this._patchFractPart(parseInt(n[3]),l),h>=a||h<0?{error:s.fraction,res:!1}:c>=l||c<0?{error:s.secondFraction,res:!1}:(i=r+h/a+c/(a*l),{price:i,res:!0,suggest:this.format(i)})):{error:s.custom,res:!1})},t.prototype.parse=function(t){return this._fractional?this._minMove2?this._parseAsDoubleFractional(t):this._parseAsSingleFractional(t):this._parseAsDecimal(t)},t}(),e.PriceFormatter=r,a=function(e){function i(){e.call(this,100)}return t(i,e),i.prototype.state=function(){var t=r.prototype.state.call(this);return t.percent=!0,t},i.prototype.format=function(t,i){return e.prototype.format.call(this,t,i)+"%"},i}(r),e.PercentageFormatter=a,l=function(){function t(){}return t.prototype.format=function(t){return e.customFormatters&&e.customFormatters.dateFormatter?e.customFormatters.dateFormatter.format(t):o(t.getUTCFullYear(),4)+"-"+o(t.getUTCMonth()+1,2)+"-"+o(t.getUTCDate(),2)},t.prototype.formatLocal=function(t){return e.customFormatters.dateFormatter?e.customFormatters.dateFormatter.formatLocal?e.customFormatters.dateFormatter.formatLocal(t):e.customFormatters.dateFormatter.format(t):o(t.getFullYear(),4)+"-"+o(t.getMonth()+1,2)+"-"+o(t.getDate(),2)},t}(),e.DateFormatter=l,h=function(){function t(t){this._formatStr=t||"%h:%m:%s"}return t.prototype.format=function(t){return e.customFormatters.timeFormatter?e.customFormatters.timeFormatter.format(t):this._formatStr.replace("%h",o(t.getUTCHours(),2)).replace("%m",o(t.getUTCMinutes(),2)).replace("%s",o(t.getUTCSeconds(),2))},t.prototype.formatLocal=function(t){return e.customFormatters.timeFormatter?e.customFormatters.timeFormatter.formatLocal?e.customFormatters.timeFormatter.formatLocal(t):e.customFormatters.timeFormatter.format(t):this._formatStr.replace("%h",o(t.getHours(),2)).replace("%m",o(t.getMinutes(),2)).replace("%s",o(t.getSeconds(),2))},t}(),e.TimeFormatter=h,c=function(){function t(t){void 0===t&&(t=!1),this._dwm=t}return t.prototype.format=function(t){var e=(new l).format(t);return this._dwm||(e+=" "+(new h).format(t)),e},t.prototype.formatLocal=function(t){var e=(new l).formatLocal(t);return this._dwm||(e+=" "+(new h).formatLocal(t)),e},t}(),e.DateTimeFormatter=c,d=function(){function t(t){this._precision=t}return t.prototype.format=function(t){return(this._precision?t.toFixed(this._precision):t+"").replace(".",e.formatterOptions.decimalSign)},t.prototype.parse=function(t){var i=t.replace(e.formatterOptions.decimalSign,"."),o=parseFloat(i);return this._precision&&(o=+o.toFixed(this._precision)),o},t}(),e.NumericFormatter=d,p=function(){function t(t){this._numericFormatter=new d(t),this._fractionalValues=t>0}return t.prototype.format=function(t){function e(t){return i._numericFormatter.format(t).replace(/(\.[1-9]*)0+$/,function(t,e){return e})}var i,o;return f.isNumber(t)?(i=this,o="",t<0&&(o="-",t=-t),t>=1e100?"N/A":((!this._fractionalValues||t>=995)&&(t=Math.round(t)),t<995?o+e(t):t<999995?o+e(t/1e3)+"K":t<999999995?(t=1e3*Math.round(t/1e3),o+e(t/1e6)+"M"):(t=1e6*Math.round(t/1e6),o+e(t/1e9)+"B"))):"---"},t.prototype.parse=function(t){var e,i,o;return"---"===t?{error:"not a number",res:!1,value:NaN}:(e={K:1e3,M:1e6,B:1e9},i=t.slice(-1),e.hasOwnProperty(i)?(o=this._numericFormatter.parse(t.slice(0,-1)),f.isNumber(o)?{res:!0,value:o*e[i]}:{error:"not a number",res:!1,value:NaN}):(o=this._numericFormatter.parse(t),f.isNumber(o)?{res:!0,value:o}:{error:"not a number",res:!1,value:NaN}))},t}(),e.VolumeFormatter=p,u=function(){function t(){}return t.prototype.format=function(t){var e,i,o,n,s=t<0;return t=Math.abs(t),e=Math.floor(t/86400),t-=86400*e,i=Math.floor(t/3600),t-=3600*i,o=Math.floor(t/60),t-=60*o,n="",e&&(n+=e+$.t("d",{context:"dates"})+" "),i&&(n+=i+$.t("h",{context:"dates"})+" "),o&&(n+=o+$.t("m",{context:"dates"})+" "),t&&(n+=t+$.t("s",{context:"dates"})+" "),s&&(n="-"+n),n.trimmed()},t}(),e.TimeSpanFormatter=u,_=function(){function t(){}return t.formatSign=function(t,e){return 0===t?e?e.neutral:"#5A5D66":t>0?e?e.up:"#27AC66":e?e.down:"#DA563E"},t.formatDiff=function(t,e){return this.formatSign(e-t)},t.domDifference=function(t,e,i,o,n){function s(t){if(t.indexOf("&")!==-1){var e=document.createElement("span");return e.innerHTML=t,e}return document.createTextNode(t)}var r,a,l,h,c,d;if(void 0===i&&(i=0),void 0===o&&(o=""),void 0===n&&(n=""),!i)return $(s(t));if(r=t+"",a=e+"",l=null,r.length===a.length){for(h=0;h<r.length;h++)if(r.charAt(h)!==a.charAt(h)){l=h;break}}else l=0;return null===l?$(s(r)):(c=s(r.substr(0,l)),d=document.createElement("span"),d.className=i<0?o:n,d.appendChild(s(r.substr(l))),$(c).add(d))},t}(),e.PriceColorer=_}).call(e,i(95))},function(t,e){var i=this&&this.__extends||function(t,e){function i(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)};t.exports=i},,,function(t,e){"use strict";function i(t,e){this.array=[];for(var i in t)t[i].key=i,this.array.push(t[i]);this.rearrange(e)}i.prototype.rearrange=function(t){if("function"!=typeof t)throw Error("sort param is not a function");return this.array.sort(t)},i.byValue=function(t){return function(t,e){return t-e}},i.byField=function(t){return function(e,i){return e[t]>i[t]?1:e[t]<i[t]?-1:e[t]===i[t]?0:void 0}},i.byOrder=function(t){return function(e,i){return t.indexOf(e.key)-t.indexOf(i.key)}},t.exports=i},function(t,e){"use strict";function i(t){this._invalidationLevel=t||i.UPDATE_CURSOR_ONLY,this._invalidatedPanes={}}i.UPDATE_CURSOR_ONLY=1,i.LIGHT_UPDATE=2,i.FULL_UPDATE=3,i.prototype.invalidatePane=function(t,e){this._invalidatedPanes[t]?this._invalidatedPanes[t]=Math.max(this._invalidatedPanes[t],e):this._invalidatedPanes[t]=e},i.prototype.invalidateAll=function(t){this._invalidationLevel=Math.max(this._invalidationLevel,t)},i.prototype.fullInvalidation=function(){return this._invalidationLevel},i.prototype.invalidateForPane=function(t){return this._invalidatedPanes[t]?Math.max(this._invalidatedPanes[t],this._invalidationLevel):this._invalidationLevel},i.prototype.merge=function(t){this.force=this.force||t.force,this._invalidationLevel=Math.max(this._invalidationLevel,t._invalidationLevel);for(var e in t._invalidatedPanes)this._invalidatedPanes[e]?this._invalidatedPanes[e]=Math.max(this._invalidatedPanes[e],t._invalidatedPanes[e]):this._invalidatedPanes[e]=t._invalidatedPanes[e]},i.prototype.exclude=function(t){this._invalidationLevel<=t&&(this._invalidationLevel=0);for(var e in this._invalidatedPanes)this._invalidatedPanes[e]<=t&&(this._invalidatedPanes[e]=0)},i.prototype.start=function(){this._timeStart=window.performance.now()},i.prototype.end=function(){this._timeEnd=window.performance.now()},t.exports=i},function(t,e,i){(function(t){"use strict";function o(e){e||(e={}),this.checkable=e.checkable||!1,this.checked=e.checked||null,this.enabled=void 0===e.enabled||e.enabled,this.visible=e.visible||!0,this.active=!0,this.font=e.font||"Arial",this.icon=e.icon||null,this.iconText=e.iconText||null,this.iconVisibleInMenu=e.iconVisibleMenu||!0,this.deleteButton=e.deleteButton||null,this.shortcut=null,this.setShortCut(e.shortcut,e.doNotBindShortcut),this.statusTip=e.statusTip||null,this.text=e.text||null,this.toolTip=e.toolTip||null,this.htmlclass=e.htmlclass||null,this._callbackContext=e.callbackContext||this,this._callbacks=new t,this.subActions=e.subActions||[]}function n(){o.call(this),this.font=null,this.subActions=null,this.htmlclass="action-separator"}function s(t){o.call(this),this.deferred=t}var r=i(101);o.prototype.callbacks=function(){return this._callbacks},o.prototype.callbackContext=function(){return this._callbackContext},o.prototype.setCallbackContext=function(t){this._callbackContext=t},o.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length},o.prototype.setChecked=function(t){this.checked=t},o.prototype._toggleChecked=function(){this.checked=!this.checked},o.prototype.setVisible=function(t){this.visible=t},o.prototype.setEnabled=function(t){this.enabled=t},o.prototype.disable=function(){this.setEnabled(!1)},o.prototype.enable=function(){this.setEnabled(!0)},o.prototype.setActive=function(t){this.active!==t&&(this.active=t,this.shortcut&&!this.doNotBindShortcut&&(t?this._bindShortCut():this._unbindShortCut()))},o.prototype.setShortCut=function(t,e){t&&(this.shortcut=t,e!==!0&&this._bindShortCut())},o.prototype._bindShortCut=function(){r.bind(this.shortcut,function(t){if(t.preventDefault(),this.enabled)return this.executeCallback(),!1}.bind(this))},o.prototype._unbindShortCut=function(){r.unbind(this.shortcut)},o.prototype.setIconVisible=function(t){this.iconVisibleInMenu=t},o.prototype.executeCallback=function(t){this._lastEvent=t,this._toggleChecked(),this._callbacks.fire(this)},inherit(n,o),inherit(s,o),e.Action=o,e.ActionSeparator=n,e.ActionPlaceholder=s}).call(e,i(34))},function(t,e){"use strict";function i(){return this.bindings={},this.$doc=$(document),this}i.prototype.parseName=function(t){return"."+t.replace("+","")},i.prototype.bind=function(t,e){var i=this.parseName(t);this.$doc.unbind("keydown"+i).bind("keydown"+i,t,function(t){$(t.target).is("input[type=password]")||e.apply(null,Array.prototype.slice.call(arguments))}),this.bindings[t]=e},i.prototype.unbind=function(t){this.$doc.unbind("keydown"+this.parseName(t)),delete this.bindings[t]},t.exports=new i},function(t,e,i){(function(e,o,n,s){"use strict";function r(t){this._series=t,this._model=t.m_model,this._points=[new M.Point(0,0)],this._invalidated=!0}function a(){return{count:TradingView.DEFAULT_BAR_COUNT}}function l(t,n,s){var u,_=i(143);x.call(this,t),this._boxSizeChanged=new e,this._tagsChanged=new e,this._symbolIntervalChanged=new e,this._symbolResolved=new e,this._symbolError=new e,this._symbolNotPermitted=new e,this._symbolGroupNotPermitted=new e,this._intervalChanged=new e,this._extendedHoursChanged=new e,this._extendedHoursNotPermitted=new e,this.chartTypeNotPermitted=new e,this.intradaySpreadNotPermitted=new e,this.intradayExchangeNotPermitted=new e,this.customIntervalNotPermitted=new e,this.chartWidgetInitialized=new e,this._startLoading=new e,this._dataLoaded=new e,this._tickmarksRangeChanged=new e,this._barReceived=new e,this._onChangedStyle=new e,this._onCompleted=new e,this._onStatusChanged=new e,this._onRestarted=new e,this._onSessionsStudyCreated=new e,this.requestingIntradayWhenNotSupported=new e,this.requestingResolutionWhenNotSupported=new e,this.priceScaleChanged=new e,this._requestOptions=s||a(),this.m_model=t,this._chartApi=t._chartApi,this.m_data=new A(this,t),this.setProperties(n),this._prevChartStyle=n.style.value(),this.createPaneView(),this._dataWindowView=new p(this,t),this._statusView=new h(this,t.properties()),this._priceAxisViews=[new d(this,t),new c(this,t)],this._symbolInfo=null,this._status=l.STATUS_OFFLINE,this._syncModel=null,u=this,this._turnaroundCounter=1,this._turnaround="s"+this._turnaroundCounter,this._handler=function(t){u.onData(t)},this._properties.addExclusion&&this._properties.addExclusion("visible"),this._base=100,this._formatter=new B(this._base),this._predictBars=0,this._futureBarsPaneView=null,this._properties.showInDataWindow.listeners().subscribe(t,_.prototype.fullUpdate),this.marketStatus=new o,this._seriesLoaded=!1,this.properties().minTick.listeners().subscribe(this,l.prototype._recreateFormatter),u=this,this.properties().minTick.listeners().subscribe(null,function(){u.m_model.invalidate(new V(V.FULL_UPDATE))}),this._priceLineView=new r(this),this._gotoDateView=new C(this),this.bindStyleChange(),this.bindJapChartsInputs(),this.createExtendedHoursProperty(),this.extendedHours.listeners().subscribe(this,function(){this._extendedHoursChanged.fire()}),this._extendedHoursNotPermitted.subscribe(this,function(){this._properties.extendedHours.setValue(!1)}),this._extendedHoursChanged.subscribe(this,function(){this._status!==l.STATUS_SNAPSHOT&&this.restart()}),this._symbolIntervalChanged.subscribe(this,this.checkInterval),this.properties().showCountdown.listeners().subscribe(this,l.prototype._onChangeShowCountdown),this._onChangeShowCountdown(this.properties().showCountdown),this._recreateFormatter(),this._isDWMCached=null}var h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,M,D,O,B,R,N,F,W,z;TradingView.DEFAULT_BAR_COUNT=300,TradingView.TIME_PLOT=0,TradingView.OPEN_PLOT=1,TradingView.HIGH_PLOT=2,TradingView.LOW_PLOT=3,TradingView.CLOSE_PLOT=4,TradingView.ADT_PLOT=6,TradingView.STYLE_PLOT=7,TradingView.SEARCH_FROM_LEFT=-1,TradingView.SEARCH_FROM_RIGHT=1,h=i(104),c=i(106),d=i(107),p=i(108),u=i(111),_=u.SeriesAreaPaneView,f=u.SeriesLinePaneView,m=u.SeriesHollowCandlesPaneView,g=u.SeriesCandlesPaneView,v=u.SeriesBarsPaneView,y=u.SeriesHeikenAshiPaneView,b=i(1),w=i(120),S=i(121).SeriesBarColorer,T=i(122).HorzLineRenderer,C=i(125),x=i(89).PriceDataSource,P=i(126),L=i(129).FutureBarsPaneView,k=i(93),I=i(113),E=i(131),A=i(132),V=i(99),M=i(30),D=i(134),O=i(94),B=O.PriceFormatter,R=i(133),N=i(139),F=i(141).SyncModel,W=i(35).trackEvent,z=i(110).translatedIntervalString,r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){if(this._visible=!1,this._series.properties().showPriceLine.value()){var t=this._series.lastValueData(TradingView.CLOSE_PLOT,!0);t.noData||(this._visible=!0,this._points=[new M.Point(0,t.coordinate)],this._color=t.color)}},r.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.points=this._points,t.color=this._color,t.linewidth=this._series.properties().priceLineWidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.hitTestResult=I.REGULAR,t.visible=this._visible,new T(t)},inherit(l,x),l.prototype.endOfData=function(){return this._endOfData},l.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},l.prototype._onChangeShowCountdown=function(t){var e=this;t.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){e.isDWM()||(e._priceAxisViews[0].update(),e.m_model.invalidate(new V(V.LIGHT_UPDATE)))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)},l.prototype.lastValueData=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u={noData:!0};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return u;if(o=this.m_model.timeScale().visibleBars(),o.isEmpty())return u;if(e){if(null===(r=this.data().bars().last())||void 0===r)return u;n=r.value,s=parseInt(r)}else{if(null===(a=this.data().bars().search(o.lastBar(),TradingView.SEARCH_NEAREST_LEFT))||void 0===a)return u;n=this.data().bars().valueAt(a.index),s=a.index}return l={noData:!1},h=n[TradingView.CLOSE_PLOT],i&&(l.price=h),this.priceScale().properties().percentage.value()&&(c=this.firstValue(),h=this.priceScale().priceRange().convertToPercent(h,c)),l.text=this.priceScale().formatter().format(h),d=this.barColorer(),p=d.barStyle(s,!1),l.color=p.barColor,l.floatCoordinate=this.priceScale().priceToCoordinate(h,!0),l.coordinate=Math.round(l.floatCoordinate),l.index=s,l},l.prototype._prepareChartApiParams=function(){return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||TradingView.DEFAULT_BAR_COUNT},l.prototype._nextSymbolId=1,l.prototype._nextSeriesId=1,l.STYLE_BARS=0,l.STYLE_CANDLES=1,l.STYLE_LINE=2,l.STYLE_LINE_TYPE_MARKERS=0,l.STYLE_LINE_TYPE_STEP=1,l.STYLE_LINE_TYPE_SIMPLE=2,l.STYLE_AREA=3,l.STYLE_RENKO=4,l.STYLE_KAGI=5,l.STYLE_PNF=6,l.STYLE_PB=7,l.STYLE_HEIKEN_ASHI=8,l.STYLE_HOLLOW_CANDLES=9,Object.assign(l,i(272)),l.PERMISSION_DENIED="permission denied",l.PD_REASON_SYMBOL="symbol",l.PD_REASON_EXTENDED_HOURS="extended_hours",l.PD_REASON_GROUP_PERMISSION="group",l.STUDY_NOT_AUTH="study_not_auth",l.STYLE_SHORT_NAMES={},l.STYLE_SHORT_NAMES[l.STYLE_BARS]="bar",l.STYLE_SHORT_NAMES[l.STYLE_CANDLES]="candle",l.STYLE_SHORT_NAMES[l.STYLE_HOLLOW_CANDLES]="hollowCandle",l.STYLE_SHORT_NAMES[l.STYLE_LINE]="line",l.STYLE_SHORT_NAMES[l.STYLE_AREA]="area",l.STYLE_SHORT_NAMES[l.STYLE_RENKO]="renko",l.STYLE_SHORT_NAMES[l.STYLE_PB]="pb",l.STYLE_SHORT_NAMES[l.STYLE_KAGI]="kagi",l.STYLE_SHORT_NAMES[l.STYLE_PNF]="pnf",l.STYLE_SHORT_NAMES[l.STYLE_HEIKEN_ASHI]="ha",l._SYMBOL_STRING_DATA={},l._SYMBOL_STRING_DATA[l.STYLE_RENKO]={type:"BarSetRenko@tv-prostudies-1!",inputNames:["source","style","boxSize","atrLength"]},l._SYMBOL_STRING_DATA[l.STYLE_PB]={type:"BarSetPriceBreak@tv-prostudies-1!",inputNames:["source","lb"]},l._SYMBOL_STRING_DATA[l.STYLE_KAGI]={type:"BarSetKagi@tv-prostudies-1!",inputNames:["source","style","atrLength","reversalAmount"]},l._SYMBOL_STRING_DATA[l.STYLE_PNF]={type:"BarSetPnF@tv-prostudies-1!",inputNames:["sources","style","boxSize","atrLength","reversalAmount"]},l._SYMBOL_STRING_DATA[l.STYLE_HEIKEN_ASHI]={type:"BarSetHeikenAshi@tv-basicstudies-1!",inputNames:[]},l.prototype.model=function(){return this.m_model},l.prototype.fixLastBar=function(t){this._futureBarsPaneView||(this._futureBarsPaneView=new L(this,this.data().bars().lastTimeIndex()+1,t))},l.prototype.clearData=function(){this.data().clear()},l.prototype.data=function(){return this.m_data},l.prototype.symbolId=function(){return this._symbolId},l.prototype.isPulse=function(){return this._symbolInfo&&this._symbolInfo.resolutions.length>0},l.prototype.onTagsChanged=function(){return this._tagsChanged},l.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},l.prototype.onSymbolResolved=function(){return this._symbolResolved},l.prototype.onSymbolError=function(){return this._symbolError},l.prototype.onSymbolNotPermitted=function(){return this._symbolNotPermitted},l.prototype.onSymbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},l.prototype.onIntervalChanged=function(){return this._intervalChanged},l.prototype.onExtendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},l.prototype.onStartLoading=function(){return this._startLoading},l.prototype.onDataLoaded=function(){return this._dataLoaded},l.prototype.onStatusChanged=function(){return this._onStatusChanged},l.prototype.onTickmarksRangeChanged=function(){return this._tickmarksRangeChanged},l.prototype.onBarReceived=function(){return this._barReceived},l.prototype.onChangedStyle=function(){return this._onChangedStyle},l.prototype.onCompleted=function(){return this._onCompleted},l.prototype.onRestarted=function(){return this._onRestarted},l.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},l.prototype.status=function(){return this._status},l.prototype.isDWM=function(){var t,e;return null!==this._isDWMCached?this._isDWMCached:(t=new k(this._properties.interval.value()),t.isDWM()?this._isDWMCached=!0:(e=t.kind()===k.SECONDS?t.multiplier():60*t.multiplier(),this._isDWMCached=!(e<216e3)),this._isDWMCached)},l.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},l.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._symbolLabelView=new P(this.m_model,this,TradingView.CLOSE_PLOT,"firstShortName","showSymbolLabels");var t=this._properties.style.value();switch(t){case l.STYLE_BARS:this._paneView=new v(this,this.m_model);break;case l.STYLE_CANDLES:this._paneView=new g(this,this.m_model);break;case l.STYLE_LINE:this._paneView=new f(this,this._properties.lineStyle.priceSource.value(),this.m_model);break;case l.STYLE_AREA:this._paneView=new _(this,this._properties.areaStyle.priceSource.value(),this.m_model);break;case l.STYLE_HEIKEN_ASHI:this._paneView=new y(this,this.m_model);break;case l.STYLE_HOLLOW_CANDLES:this._paneView=new m(this,this.m_model);break;default:throw Error("Unknown chart style assigned: "+t)}},l.prototype._clearStylePlot=function(t,e){var i,o;t.size()&&(i=e||+t.first(),o=+t.last()+1,t.range(i,o).each(function(t,e){e[TradingView.STYLE_PLOT]=null}))},l.prototype.invalidateBarStylesCache=function(t){TradingView.logDebugChart("Invalidate style cache starting from "+t),this._clearStylePlot(this.m_data.m_bars,t),this._clearStylePlot(this.m_data.m_nsBars)},l.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},l.prototype.barColorer=function(){var t,e,i,o;if(this._barColorerCache)return this._barColorerCache;for(t=null,e=this.m_model.dataSources().length-1;e>=0;e--)i=this.m_model.dataSources()[e],i.metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()&&(o=i.barColorer(),null===t?t=o:t.pushBackBarColorer(o));return null===t?t=new S(this):t.pushBackBarColorer(new S(this)),this._barColorerCache=t,this._barColorerCache},l.prototype.properties=function(){return this._properties},l.prototype._barsState=function(t){var e=t.state();return e.columns=e.columns.filter(function(t){return"style"!==t}),e.data.forEach(function(t){t.value.splice(7,1)}),e},l.prototype.state=function(t){var e=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),i={type:e,id:this.id(),state:this.properties().state(),zorder:this.zorder()};return this._symbolInfo&&this._symbolInfo.ticker&&(i.state.symbol=this._symbolInfo.ticker),t&&(i.bars=this._barsState(this.m_data.m_bars),i.nsBars=this._barsState(this.m_data.m_nsBars),i.symbolInfo=this._symbolInfo,i.rtPrice=this.data().lastProjectionPrice),i.boxSize=this.data().boxSize,i.reversalAmount=this.data().reversalAmount,i},l.prototype.stateForAlert=function(){var t=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor);return{id:this.id(),uniqueId:this.uniqueId(),type:t,proSymbol:this.proSymbol(),actualSymbol:this.actualSymbol(),symbolString:this.getSymbolString(),interval:this.interval(),style:this.properties().style.value(),styleInputs:this.getInputsProperties().state(),extendedHours:this.extendedHours.value(),boxSize:this.data().boxSize,reversalAmount:this.data().reversalAmount}},l.prototype.uniqueId=function(){return this.actualSymbol()+"|"+this.interval()},l.prototype.restoreData=function(t,e,i,o,n,s){this._status=l.STATUS_SNAPSHOT,this.m_data.m_bars.restoreState(t),this.m_data.m_nsBars.restoreState(e),this.updateSymbolInfo(i),this.m_data.lastProjectionPrice=o,this.m_data.boxSize=n,n||(this.properties().style.value()===l.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===l.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=s,s||this.properties().style.value()===l.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value())},l.prototype.setProperties=function(t){t.timeframe||t.merge({timeframe:""}),t.shortName||t.merge({shortName:""}),this._properties=t,this._properties.symbol.listeners().subscribe(this,l.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,l.prototype.changeInterval),this._properties.timeframe.listeners().subscribe(this,l.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,l.prototype.changeProperties)},l.prototype.changeSymbol=function(){this.setSymbolIntervalDelayed(),this.m_model.checkLineToolSelection()},l.prototype.changeInterval=function(){this.setSymbolIntervalDelayed()},l.prototype.changeTimeFrame=function(){W("GUI","Change timeframe")},l.prototype.title=function(){return this.properties().symbol.value()+", "+z(this.properties().interval.value())},l.generateTitleForGui=function(t){function e(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)||""}var i,o,n,s=t||{},r="QUANDL"===s.exchange,a="",h={symbolDescription:"",interval:"",exchange:"",chartStyle:""};switch(s.description&&r?2===s.description.split("/").length?h.symbolDescription=s.description.split("/")[1]:(i=s.description.split("'").filter(function(t){return t.length}),i.forEach(function(t){t=t&&("/"===t[0]||/\d+\/\(?/.test(t))?[t]:t.split("/").filter(function(t){return t.length}),h.symbolDescription+=t[2===t.length?1:0]})):s.description?h.symbolDescription=s.description:h.symbolDescription=s.symbol,s.interval&&(h.interval=z(s.interval)),r&&s.description&&(o=/[\w_]+\/[\w_]+/.exec(s.description),o&&o[0]?h.provider=o[0].split("/")[0]:h.provider=s.description.split("/")[0]),s.exchange&&(h.exchange=s.exchange),s.style){case l.STYLE_RENKO:n=s.inputs.style+("ATR"===s.inputs.style?"("+s.inputs.atrLength+")":""),h.chartStyle=$.t("Renko")+" ["+s.inputs.source+", "+n+", "+e(s.boxSize,4)+"]";break;case l.STYLE_PB:h.chartStyle=$.t("Line Break")+" ["+s.inputs.source+", "+s.inputs.lb+"]";break;case l.STYLE_KAGI:n=s.inputs.style+("ATR"===s.inputs.style?"("+s.inputs.atrLength+")":""),h.chartStyle=$.t("Kagi")+" ["+s.inputs.source+", "+n+", "+e(s.reversalAmount,4)+"]";break;case l.STYLE_PNF:n=s.inputs.style+("ATR"===s.inputs.style?"("+s.inputs.atrLength+")":""),h.chartStyle=$.t("PnF")+" ["+s.inputs.sources+", "+n+", "+e(s.boxSize,4)+", "+s.inputs.reversalAmount+"]";break;case l.STYLE_HEIKEN_ASHI:h.chartStyle=$.t("Heikin Ashi")}return a=h.symbolDescription+(h.interval?", "+h.interval:"")+(h.provider?", "+h.provider:"")+(h.exchange?", "+h.exchange:"")+(h.chartStyle?", "+h.chartStyle:""),a=a.replace(/\'/g,"")},l.prototype.changeProperties=function(t){t!==this._properties.symbol&&t!==this._properties.interval&&t!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this))},l.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},l.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},l.prototype._clearLoadingTimer=function(){this.loadingTimer&&(clearTimeout(this.loadingTimer),this.loadingTimer=null)},l.prototype.onData=function(t){var e,i,o,n,s,r,a,h,c,d,p,u,_,f,m,g=this;switch(t.method){case"symbol_resolved":if(t.params[0]!==this._symbolId){TradingView.logNormalChart("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0]);break}this.updateSymbolInfo(t.params[1]),this.m_model.updateSource(this),this._symbolResolved.fire(this._symbolInfo),this.m_model.realignLineTools(),TradingView.onWidget()||W("Symbol",t.params[1].listed_exchange,t.params[1].name),e=this.symbolInfo().minmov/this.symbolInfo().pricescale,i=this.properties(),i.style.value()===l.STYLE_RENKO&&i.renkoStyle.inputs.boxSize.value()<e?i.renkoStyle.inputs.merge({boxSize:e}):i.style.value()===l.STYLE_PNF&&i.pnfStyle.inputs.boxSize.value()<e?i.pnfStyle.inputs.merge({boxSize:e}):i.style.value()===l.STYLE_KAGI&&i.kagiStyle.inputs.reversalAmount.value()<e&&i.kagiStyle.inputs.merge({reversalAmount:e});break;case"symbol_error":if(t.params[0]!==this._symbolId){TradingView.logNormalChart("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0]);break}if(this._clearLoadingTimer(),this._setStatus(l.STATUS_INVALID_SYMBOL),this._properties.shortName.setValue(this._properties.symbol.value()),this.m_model.clearAllStudies(),this.updateAllViews(),this.m_model.updateSource(this),t.params[1]===l.PERMISSION_DENIED)switch(t.params[2]){case l.PD_REASON_EXTENDED_HOURS:this._extendedHoursNotPermitted.fire();break;case l.PD_REASON_SYMBOL:this._symbolNotPermitted.fire(t.params[3]);break;case l.PD_REASON_GROUP_PERMISSION:this._symbolGroupNotPermitted.fire(t.params[3]);break;default:this._symbolNotPermitted.fire(t.params[2])}else this.m_model.resetTimeScale(),this._symbolError.fire(),Telemetry.sendReport("symbol_error",{chartSession:g._chartApi._sessionid,symbol:g.getSymbolString()});this.m_model.realignLineTools();break;case"series_timeframe":if(t.params[1]!==this._turnaround)break;o=t.params[2],n=t.params[3],s=t.params[4],r=void 0!==s&&s?n:n+10,this.m_model.setTimeViewport(o,r);break;case"series_error":a=t.params[2],this._clearLoadingTimer(),delete this._loadingStartTime,b.enabled("charting_library_debug_mode")&&TradingView.logNormal("Error reason: "+a),this._setStatus(b.enabled("no_bars_status")&&this._symbolInfo?l.STATUS_NO_BARS:l.STATUS_INVALID_SYMBOL),a&&a.startsWith("study_not_auth:")?(h=a.split(":",2)[1].split("@",2)[0],h in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this.chartTypeNotPermitted.fire(h):"BarSetSpread"===h&&this.intradaySpreadNotPermitted.fire()):"resolution_not_entitled"===a?this.intradayExchangeNotPermitted.fire():"custom_resolution"===a&&this.customIntervalNotPermitted.fire(),this._seriesLoaded=!0;break;case"series_loading":if(t.params[1]!==this._turnaround)break;if(t.params[0]!==this._seriesId){TradingView.logNormalChart("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}this._setStatus(l.STATUS_LOADING),g._loadingStartTime=(new Date).getTime(),g.loadingTimer=setTimeout(function(){var t={chartSession:g._chartApi._sessionid,symbol:g.getSymbolString(),interval:g.interval()};Telemetry.sendReport("series_loading",t)},15e3);break;case"series_completed":if(t.params[2]!==this._turnaround)break;if(t.params[0]!==this._seriesId){TradingView.logNormalChart("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}switch(c="chartSession:"+g._chartApi._sessionid,TradingView.logDebugChart(c+", Series loading took "+((new Date).getTime()-this._loadingStartTime)+" ms, eod:"+this._endOfData),delete this._loadingStartTime,d=t.params[1],"pulsed"===d&&(d="delayed"),d){case"streaming":this._setStatus(l.STATUS_READY);break;case"endofday":this._setStatus(l.STATUS_EOD);break;case"delayed":this._setStatus(l.STATUS_DELAYED);break;case"pulsed":this._setStatus(l.STATUS_PULSE)}d.match(/delayed_streaming/)&&this._setStatus(l.STATUS_DELAYED_STREAMING),p=this.m_model.paneForSource(this),p.recalculatePriceScale(this.priceScale()),this.m_model.invalidate(new V(V.FULL_UPDATE)),this.m_data.size()&&this._tickmarksRangeChanged.fire({start:this.data().first().value[TradingView.TIME_PLOT],end:this.data().last().value[TradingView.TIME_PLOT]}),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0),this.model().recalcStudyBasedLineTools(),!this.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),u=this.model().timeScale().visibleBars(),this.priceScale().setPriceRange(this.priceRange(u.firstBar(),u.lastBar()))),this._seriesLoaded=!0,this._onCompleted.fire(this._endOfData),this.requestMoreData();break;case"series_deleted":break;case"data_update":if(t.params.customId!==this._seriesId){TradingView.logNormalChart("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}if(this.status()===l.STATUS_INVALID_SYMBOL)break;this._clearLoadingTimer(),t.params.plots.length>0&&(this._endOfData=!1),t.params.plots.length?(_=this.m_data.m_bars.size(),f=this.m_data.m_bars.merge(t.params.plots),m="Merge bars. Changes:{length:"+f.length+", earliestRow:"+f.earliestRow.index+"} ",m+="bars state:{firstBar:"+this.m_data.m_bars.first()+",lastBar:"+this.m_data.m_bars.last()+",size:"+this.m_data.m_bars.size()+"}",TradingView.logDebugChart(m),_!==this.bars().size()&&(this._barReceived.fire(this.m_data.m_bars.size()),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0))):(this.m_data.clear(),this._startLoading.fire()),new Promise(function(e){var i=g.properties().style.value();!t.params.nonseries||i!==l.STYLE_RENKO&&i!==l.STYLE_KAGI&&i!==l.STYLE_PNF&&i!==l.STYLE_HEIKEN_ASHI&&i!==l.STYLE_PB?(t.params.nonseries||(g.m_data.m_nsBars.clear(),g.m_data.lastProjectionPrice=void 0),e(),e()):g.parseJapProjBars(t.params.nonseries).then(function(t){g.m_data.m_nsBars=t.nsBars,g.m_data.lastProjectionPrice=t.lastPrice;var i=g.m_data.boxSize!==t.boxSize;g.m_data.boxSize=t.boxSize,g.m_data.reversalAmount=t.reversalAmount,i&&g._boxSizeChanged.fire(g.m_data.boxSize),e()})}).then(function(){var t=g.m_model.paneForSource(g);g.m_model.updateAllVolumeStudies(),g.m_model.recalculatePane(t),g.m_model.updateSource(g),g.m_model.updateLineTools(),g.m_model.updateCrossHair()})}this._dataLoaded.fire(t)},l.prototype.fixBoxSize=function(){var t=this.model().timeScale(),e=this.priceScale();e.isEmpty()||t.isEmpty()||(this.m_data.boxSize=Math.abs(e.coordinateToPrice(t.barSpacing())-e.coordinateToPrice(0)))},l.prototype.parseJapProjBars=function(t){var e,i,o,n=new R(["time","open","high","low","close","adt","style"]),s=this.model().timeScale(),r=this.properties().style.value(),a=this;return new Promise(function(h){t.d&&""!==t.d?TradingView.Study.prototype._makeJSONForNSData.call(a,{params:{nonseries:t}}).then(function(a){var c,d,p,u,_=a.data;for(e=_.price,i=_.boxSize,o=_.reversalAmount,c=_.bars,d=0;c&&d<c.length;d++)p=[],u=t.indexes[c[d].time],p.push(s.points().valueAt(u)),p.push(c[d].open),p.push(c[d].high),p.push(c[d].low),p.push(c[d].close),p.push(c[d].volume),r===l.STYLE_KAGI?p.push(c[d].additionalPrice):r===l.STYLE_PNF&&p.push(c[d].factor),n.add(u,p);h({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})}):h({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})})},l.prototype.disconnect=function(){this._symbolId=null,this._seriesId=null,this._predictBars=0,this._status=l.STATUS_OFFLINE},l.prototype.isStarted=function(){return!!this._symbolId},l.prototype.restart=function(){var t,e=i(143);this._onRestarted.fire(),this._setStatus(l.STATUS_RESOLVING),this.m_data=new A(this,this.model()),this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),t=this._properties.interval.value(),this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._chartApi.resolveSymbol(this._symbolId,this.getSymbolString(),this._handler),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)===!1&&(this._seriesId=void 0)),this._properties.showInDataWindow.listeners().subscribe(this.m_model,e.prototype.fullUpdate),this.m_symbol=this._properties.symbol.value(),this.m_interval=this._properties.interval.value()},l.prototype._generateTimeframe=function(t,e){var i,o=e.right(1),n=t;return"ytd"===e?n+=",YTD":"d"===o?(i=e.left(e.length-1),n+=","+i,b.enabled("daily_timeframe_suffix")&&(n+="D")):"m"===o?(i=e.left(e.length-1),n+=","+i+"M"):"all"===e&&(n+=",ALL"),n},l.prototype.hasDelayedSymbolIntervalChange=function(){return!!this._setSymbolIntervalDelay},l.prototype.setSymbolIntervalDelayed=function(){this._isDWMCached=null,(this._checkSymbolWillChanged(this._properties.symbol.value())||this._checkIntervalWillChanged(this._parseInterval(this._properties.interval.value()).interval))&&(this._setSymbolIntervalDelay&&clearTimeout(this._setSymbolIntervalDelay),this._setSymbolIntervalDelay=setTimeout(function(){delete this._setSymbolIntervalDelay,this._setSymbolInterval(this._properties.symbol.value(),this._properties.interval.value())}.bind(this),30))},l.prototype._checkSymbolWillChanged=function(t){return!this.symbolSameAsCurrent(t)||b.enabled("same_data_requery")},l.prototype._checkIntervalWillChanged=function(t){return this.m_interval!==t||b.enabled("same_data_requery")},l.prototype._parseInterval=function(t){var e=(t+"").split(",");return{interval:2===e.length?e[0]:t,timeframe:2===e.length?e[1]:0}},l.prototype.rerequestData=function(){this._setSymbolInterval(this.m_symbol,this.m_interval,!0)},l.prototype._setSymbolInterval=function(t,e,i){var o,n,s,r,a,h,c;delete this._gotoDateResult,o=this._parseInterval(e),n=o.interval,s=o.timeframe,r=this._checkSymbolWillChanged(t),a=this._checkIntervalWillChanged(n),(r||a||i)&&(this._syncModel=null,this.m_symbol=t,this.m_interval=n,this.m_timeframe=s,this._symbolId&&!r||this.updateSymbolInfo(null),this.m_model.realignLineTools(),this._status!==l.STATUS_SNAPSHOT&&(this._setStatus(l.STATUS_RESOLVING),this._symbolIntervalChanged.fire(),a&&(h={timeframe:this._pendingTimeRange},this._intervalChanged.fire(this.m_interval,h),this._pendingTimeRange=h.timeframe&&h.timeframe.toLowerCase()),this._onRestarted.fire(),this._seriesLoaded=!1,this._chartApi&&this._chartApi.connected()&&(this._symbolId&&!r||(this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),c=this.getSymbolString(),this._chartApi.resolveSymbol(this._symbolId,c,this._handler)),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._pendingTimeRange&&(e=this._generateTimeframe(e,this._pendingTimeRange),delete this._pendingTimeRange),this._predictBars=0,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,e,this._prepareChartApiParams(),this._handler)))))},l.prototype.setDefaultTimeframe=function(t){this._pendingTimeRange=t},l.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().full_name:this.symbol()},l.prototype.proSymbol=function(){return this.symbolInfo()?this.symbolInfo().pro_name:this.symbol()},l.prototype.symbol=function(){return this.properties().symbol.value()},l.prototype.interval=function(){return this.properties().interval.value()},l.prototype.isIntradayInterval=function(){return!!/^\d*$/.test(this.interval())&&this.interval()<=1440},l.prototype.bars=function(){return this.m_data.m_bars},l.prototype.nsBars=function(){return this.m_data.m_nsBars},l.prototype.open=function(t){return this.m_data.valueAt(t)[TradingView.OPEN_PLOT]},l.prototype.high=function(t){return this.m_data.valueAt(t)[TradingView.HIGH_PLOT]},l.prototype.low=function(t){return this.m_data.valueAt(t)[TradingView.LOW_PLOT]},l.prototype.close=function(t){return this.m_data.valueAt(t)[TradingView.CLOSE_PLOT]},l.prototype.hl2=function(t){return(this.high(t)+this.low(t))/2},l.prototype.hlc3=function(t){return(this.high(t)+this.low(t)+this.close(t))/3},l.prototype.ohlc4=function(t){return(this.open(t)+this.high(t)+this.low(t)+this.close(t))/4},l.prototype.priceRange=function(t,e){var i,o,s,r,a,l,h,c;return TradingView.isInteger(t)?TradingView.isInteger(e)?this.data().isEmpty()?null:(o=this.data().boxSize,this.isLockScale()?(void 0===o&&this.fixBoxSize(),s=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/this.data().boxSize),r=this.data().search(e,TradingView.SEARCH_NEAREST_LEFT),a=(r.value[TradingView.HIGH_PLOT]+r.value[TradingView.LOW_PLOT])/2,i=new n(a-.5*s,a+.5*s),l=this.data().search(t,TradingView.SEARCH_NEAREST_RIGHT),this.priceScale().properties().percentage.value()&&i?i.convertToPercents(l.value[TradingView.CLOSE_PLOT]):i):(h=this.data().bars().minMaxOnRange2(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),c=this.data().nsBars().minMaxOnRange(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),null!=c.min&&(h.min=Math.min(h.min,c.min)),null!=c.max&&(h.max=Math.max(h.max,c.max)),i=new n(h.min,h.max),i&&i.minValue()===i.maxValue()&&(i=new n(i.minValue()-.5,i.maxValue()+.5)),this.priceScale().properties().percentage.value()&&i?(l=this.data().search(t,TradingView.SEARCH_NEAREST_RIGHT),i.convertToPercents(l.value[TradingView.CLOSE_PLOT])):this.priceScale().isLog()&&i?new n(this.priceScale().priceToLogical(i.minValue()),this.priceScale().priceToLogical(i.maxValue())):i)):(TradingView.logDebugChart("Series.priceRange: incorrect endBar"),null):(TradingView.logDebugChart("Series.priceRange: incorrect startBar"),null)},l.prototype.nearestData=function(t,e){return TradingView.isInteger(t)?this.data().search(t,e)||void 0:void TradingView.logDebugChart("Series.nearestData: incorrect logicalPoint")},l.prototype.nearestIndex=function(t,e){var i=this.nearestData(t,e);return i?i.index:void 0},l.prototype.paneViews=function(t){if(!this.properties().visible.value())return null;var e=[this._paneView];return this._futureBarsPaneView&&e.push(this._futureBarsPaneView),this._projectionBarsPaneView&&e.push(this._projectionBarsPaneView),e.push(this._priceLineView),e.push(this._symbolLabelView),e.push(this._gotoDateView),e},l.prototype.dataWindowView=function(){return this._dataWindowView},l.prototype.statusView=function(){return this._statusView},l.prototype.priceAxisViews=function(t,e){return this.m_model.paneForSource(this)===t&&e===this.priceScale()&&(this.m_model.properties().scalesProperties.showSeriesLastValue.value()||this.properties().showCountdown.value())?this._priceAxisViews:null},l.prototype.base=function(){return this._base},l.prototype.formatter=function(){return this._formatter},l.prototype.purgeSymbolInfo=function(){this._symbolInfo=null},l.prototype.symbolInfo=function(){return this._symbolInfo},l.prototype._recreateFormatter=function(){var t,e,i,o;"default"===this.properties().minTick.value()?this._formatter=new B(this._symbolInfo?this._symbolInfo.pricescale:100,this._symbolInfo?this._symbolInfo.minmov:1,!!this._symbolInfo&&this._symbolInfo.fractional,this._symbolInfo?this._symbolInfo.minmove2:void 0):(t=this.properties().minTick.value().split(","),e=parseInt(t[0]),i=parseInt(t[1]),o="true"===t[2],this._formatter=new B(e,i,o)),this.priceScale()&&this.priceScale().updateFormatter()},l.prototype.updateSymbolInfo=function(t){var e=this,i=t&&(t.pro_name||t.full_name||t.name);b.enabled("charting_library_single_symbol_request")&&this.m_symbol&&(i=this.m_symbol),this._symbolInfo=t,t&&(this._properties.shortName.setValue(t.name),i&&this._properties.symbol.value().toUpperCase()!==i.toUpperCase()&&this._properties.symbol.setValue(i)),this._base=t?t.pricescale/t.minmov:100,this._recreateFormatter(),this._statusView.update(),this.priceScale().updateFormatter(),"undefined"!=typeof quoteSessionMultiplexerInstance&&this._quoteSessionSymbol!==i&&(this._quoteSessionClientId||(this._quoteSessionClientId="series-"+TradingView.guid()),this._quoteSessionSymbol&&(quoteSessionMultiplexerInstance.simple.unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=void 0),i&&(this._quoteSessionSymbol=i,quoteSessionMultiplexerInstance.simple.subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,function(t,i){e.quoteData=t&&t.values||null,i&&i.values&&i.values.current_session&&e.marketStatus.setValue(i.values.current_session)}))),this.checkInterval(),this.dataPoweredBy=E(t)},l.prototype.symbolSameAsCurrent=function(t){if(this.m_symbol===t)return!0;var e=this._symbolInfo;if(e){if(e.full_name===t||e.pro_name===t)return!0;if(e.ticker===t)return!0;if(e.aliases&&e.aliases.indexOf(t)!==-1)return!0;if(e.alternatives&&e.alternatives.indexOf(t)!==-1)return!0}return!1},l.prototype.updateAllViews=function(){this._paneView.update(),this._dataWindowView.update(),this._statusView.update(),this._priceAxisViews[0].update(),this._priceAxisViews[1].update(),this._futureBarsPaneView&&this._futureBarsPaneView.update(),this._projectionBarsPaneView&&this._projectionBarsPaneView.update(),this._priceLineView.update(),this._gotoDateView.update(),this._symbolInfo&&this._symbolLabelView.update()},l.prototype._setStatus=function(t){this._status=t,this._statusView.update(),this.m_model.updateSource(this),this._onStatusChanged.fire()},l.prototype.requestMoreData=function(t){var e,i,o,n;this._status!==l.STATUS_READY&&this._status!==l.STATUS_PULSE&&this._status!==l.STATUS_DELAYED&&this._status!==l.STATUS_DELAYED_STREAMING&&this._status!==l.STATUS_EOD||this.m_model.timeScale().isEmpty()||(e=this.m_model.timeScale().visibleBars(),e.isEmpty()||0!==this.bars().size()&&(i=t||e.lastBar()-this.data().last(),this._predictBars<i&&(this._predictBars=i,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreTickmarks(this._seriesId,i,this._handler)),this._endOfData||(o=this.bars()._indexAt(0),(n=t||o-e.firstBar())<=0||(this._endOfData=!0,this._chartApi&&this._chartApi.connected()&&(this._chartApi.requestMoreData(this._seriesId,n,this._handler),b.enabled("charting_library_base")&&(this._predictBars=0)),this._setStatus(l.STATUS_LOADING)))))},l.prototype.bindStyleChange=function(){var t=this;["candleStyle","hollowCandleStyle","haStyle","barStyle","lineStyle","areaStyle","renkoStyle","pbStyle","kagiStyle","pnfStyle"].forEach(function(e){t._properties[e].listeners().subscribe(t,l.prototype.invalidateBarStylesCache)})},l.prototype.bindJapChartsInputs=function(){this._properties.style.listeners().subscribe(this,this.onChartStyleChanged),this._properties.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.source.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.lb.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.source.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.source.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.sources.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);var t=this;this._properties.lockScale.listeners().subscribe(this,function(e){e.value()&&t.model().timeScale().recalcLockedScale()})},l.prototype.createExtendedHoursProperty=function(){function t(){var t="undefined"!=typeof productFeatures&&b.enabled(productFeatures.EXTENDED_SESSION),i=e.model().readOnly(),o=e._properties.extendedHours.value(),n=b.enabled("widget");!o||n||i||t||(e._extendedHoursNotPermitted.fire(),o=!1),o&&!e.isIntradayInterval()&&(o=!1),e.extendedHours.setValue(o)}var e=this;e.extendedHours=new s,e._properties.extendedHours.listeners().subscribe(null,t),e._properties.interval.listeners().subscribe(null,t),e.chartWidgetInitialized.subscribe(null,t),t()},l.prototype.isNeedRestart=function(t){if(void 0===t&&(t=this.properties().style.value()),this._prevChartStyle!==t){var e=[l.STYLE_BARS,l.STYLE_CANDLES,l.STYLE_HOLLOW_CANDLES,l.STYLE_LINE,l.STYLE_AREA];if(!(e.indexOf(this._prevChartStyle)>-1&&e.indexOf(t)>-1))return!0}return!1},l.prototype.onChartStyleChanged=function(){this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart()),this._prevChartStyle=this.properties().style.value(),this._onChangedStyle.fire(this.properties().style.value()),this.invalidateBarStylesCache()},l.prototype.onInputChanged=function(){this.restart()},l.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged},l.prototype.getSymbolString=function(){var t,e,i;return t=b.enabled("pay_attention_to_ticker_not_symbol")&&this._symbolInfo?this._symbolInfo.ticker:this.actualSymbol(),this.extendedHours.value()&&(t={symbol:t,session:"extended"}),l._SYMBOL_STRING_DATA.hasOwnProperty(this._properties.style.value())&&(e=this.getInputsProperties(),i=l._SYMBOL_STRING_DATA[this._properties.style.value()],t={symbol:t,type:i.type,inputs:i.inputNames.map(function(t){return e[t].value()})}),"string"!=typeof t&&(t="="+JSON.stringify(t)),t},l.parseSymbolString=function(t){var e,i,o,n,s,r,a,h=Object.keys(l._SYMBOL_STRING_DATA),c={symbol:null,style:null,extendedHours:null,inputs:null};if(t&&0===t.indexOf("=")){if(e=t.slice(1),e=JSON.parse(e),c.symbol=e.symbol,e.type)for(r=0;r<h.length;r++)if(o=h[r],i=l._SYMBOL_STRING_DATA[o],i.type===e.type){for(c.style=parseInt(o),c.inputs={},a=0;a<i.inputNames.length;a++)s=e.inputs[a],n=i.inputNames[a],c.inputs[n]=s;break}"extended"===c.symbol.session&&(c.extendedHours=!0,c.symbol=c.symbol.symbol)}else c.symbol=t;return c},l.prototype.getStyleShortName=function(){var t=this._properties.style.value();if(l.STYLE_SHORT_NAMES.hasOwnProperty(t))return l.STYLE_SHORT_NAMES[t];throw Error("Missed short name for style "+t)},l.prototype.getInputsProperties=function(){return this._properties[this.getStyleShortName()+"Style"].inputs||new s},l.prototype.getRealVisibleRange=function(){var t=this.model().timeScale().visibleBars(),e=this.data().search(t.m_firstBar,TradingView.SEARCH_NEAREST_RIGHT),i=this.data().search(t.m_lastBar,TradingView.SEARCH_NEAREST_LEFT);return void 0===e||void 0===i?null:new w(e.index,i.index)},l.prototype.isLockScale=function(){return this.properties().lockScale.value()},l.prototype.firstValue=function(){return this.data().firstValue()},l.prototype.firstBar=function(){return this.data().firstBar()},l.prototype.sessionsStudy=function(){var t,e,i,o;if(this._sessionsStudy)return this._sessionsStudy;for(t=this.model().paneForSource(this),e=t.dataSources(),i=0;i<e.length;i++)if((o=e[i])instanceof TradingView.Study&&"Sessions"===o.metaInfo().shortId)return this._sessionsStudy=o,this._sessionsStudy;return!1},l.prototype.createSessStudy=function(){if(!b.enabled("charting_library_base")&&!this.sessionsStudy()){var t=N.findStudyMetaInfo(this.model().studiesMetaData(),"Sessions@tv-basicstudies");this.model().insertStudy(t,!1,!0),this._onSessionsStudyCreated.fire()}};l.prototype.checkSessStudy=function(){b.enabled("charting_library_base")||(this.sessionsStudy()||this.createSessStudy(),this.sessionsStudy().start())},l.prototype.isSpread=function(){return"spread"===this._symbolInfo.type},l.prototype.firstSymbol=function(){return this._symbolInfo?this._symbolInfo.legs[0]:""},l.prototype.firstShortName=function(){return D.ticker(this.firstSymbol())},l.prototype.onSessionsStudyCreated=function(){return this._onSessionsStudyCreated},l.prototype.loadDataTo=function(t){this._turnaround="s"+ ++this._turnaroundCounter;var e=this._properties.interval.value();e=this._generateTimeframe(e,t),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler)},l.prototype.checkInterval=function(){if(this._symbolInfo&&(k.kind(this.interval())!==k.MINUTES||this._symbolInfo.has_intraday||this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){var t=this._properties.interval.value();this._symbolInfo.supported_resolutions.indexOf(t)===-1&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}},l.prototype.setPriceScale=function(t){this.m_priceScale!==t&&(this.m_priceScale=t,this.priceScaleChanged.fire(t))},l.prototype.setGotoDateResult=function(t){this._gotoDateResult=t},l.prototype.gotoDateResult=function(){return this._gotoDateResult},l.prototype.syncModel=function(){var t,e;if(!this._syncModel){if(t=this.symbolInfo(),e=this.interval(),!t||!e)return null;this._syncModel=new F(t,e)}return this._syncModel},l.prototype.turnaround=function(){return this._turnaround},TradingView.Series=l,t.exports=l}).call(e,i(34),i(90),i(103),i(83))},function(t,e){"use strict";function i(t,e){this.m_minValue=t,this.m_maxValue=e}i.prototype.equals=function(t){return this.m_minValue===t.m_minValue&&this.m_maxValue===t.m_maxValue},i.prototype.clone=function(){return new i(this.m_minValue,this.m_maxValue)},i.prototype.minValue=function(){return this.m_minValue},i.prototype.maxValue=function(){return this.m_maxValue},i.prototype.length=function(){return this.m_maxValue-this.m_minValue},i.prototype.isEmpty=function(){return this.m_maxValue===this.m_minValue||this.m_maxValue!==this.m_maxValue||this.m_minValue!==this.m_minValue},i.prototype.state=function(){return{min:this.m_minValue,max:this.m_maxValue}},i.prototype.merge=function(t){return new i(Math.min(this.minValue(),t.minValue()),Math.max(this.maxValue(),t.maxValue()))},i.prototype.apply=function(t,e){this.m_minValue=Math.min(this.m_minValue,t),this.m_maxValue=Math.max(this.m_maxValue,e)},i.prototype.scaleAroundCenter=function(t){var e,i,o,n;if(!isNumber(t))return void TradingView.logDebugChart("PriceRange.scaleAroundCenter: invalid coeff");0!==(e=this.m_maxValue-this.m_minValue)&&(i=.5*(this.m_maxValue+this.m_minValue),o=this.m_maxValue-i,n=this.m_minValue-i,o*=t,n*=t,this.m_maxValue=i+o,this.m_minValue=i+n)},i.prototype.shift=function(t){if(!isNumber(t))return void TradingView.logDebugChart("PriceRange.shift: invalid coeff");this.m_maxValue+=t,this.m_minValue+=t},i.prototype.convertToPercent=function(t,e){return 100*(t-e)/e},i.prototype.convertFromPercent=function(t,e){return t/100*e+e},i.prototype.convertToPercents=function(t){return new i(100*(this.m_minValue-t)/t,100*(this.m_maxValue-t)/t)},i.prototype.convertFromPercents=function(t){return new i(this.m_minValue/100*t+t,this.m_maxValue/100*t+t)},t.exports=i},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._series=t,this._series.onRestarted().subscribe(this,o.prototype.invalidate),this._series.onSymbolResolved().subscribe(this,o.prototype.invalidate),this._series.onCompleted().subscribe(this,o.prototype.invalidate),this._series.onBoxSizeChanged().subscribe(this,o.prototype.invalidate)}var n=i(105);inherit(o,n),o.prototype.invalidate=function(){delete this._text,this.update()},o.prototype.getSeriesPrecision=function(){var t=4;return this._series._symbolInfo&&this._series._symbolInfo.pricescale&&(t=Math.round(Math.log(this._series._symbolInfo.pricescale)/Math.log(10))),t},o.prototype.round=function(t){var e=this.getSeriesPrecision(),i=Math.round(t*Math.pow(10,e))/Math.pow(10,e);return i?i:""},o.prototype.update=function(){if(!("_text"in this)){var t=this._series.symbolInfo()||{};this._bold=!1,this._size=this._props.mainSeriesProperties.statusViewStyle.fontSize.value()+"px",this._text=this._series.constructor.generateTitleForGui({description:this._props.mainSeriesProperties.statusViewStyle.showSymbolAsDescription.value()?t.name:t.description,exchange:this._props.mainSeriesProperties.statusViewStyle.showExchange.value()?t.exchange:null,symbol:this._series.symbol(),interval:this._props.mainSeriesProperties.statusViewStyle.showInterval.value()?this._series.interval():null,style:this._series._properties.style.value(),inputs:this._series.getInputsProperties().state(),boxSize:this._series.data().boxSize,reversalAmount:this._series.data().reversalAmount,precision:this.getSeriesPrecision()})}},t.exports=o},function(t,e){"use strict";function i(t){this._props=t,this._text="",this._size="12px",this._bold=!1}i.prototype.text=function(){return this._text},i.prototype.setText=function(t){this._text=t},i.prototype.color=function(){return this._props?this._props.scalesProperties.textColor.value():"#444"},i.prototype.bold=function(){return this._bold},i.prototype.size=function(){return this._size},t.exports=i},function(t,e,i){(function(e){"use strict";function o(t,e){n.call(this,t,e)}var n=i(107);inherit(o,n),o.prototype.lastPrice=function(){return this._series.data().lastProjectionPrice},o.prototype._updateImpl=function(t){var i,o,n,s,r,a,l,h,c,d,p,u=this._rendererData;u.visible=!1,u.text="",this._model.properties().scalesProperties.showSeriesLastValue.value()&&(this._model.timeScale().isEmpty()||this._series.priceScale().isEmpty()||!this.lastPrice()||(t=this._model.timeScale().visibleBars(),t.isEmpty()||void 0!==(i=this._series.data().search(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT))&&(u.visible=!0,o=this._series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),n=this._series.data().valueAt(o)[TradingView.CLOSE_PLOT],s=this.lastPrice(),this._series.priceScale().properties().percentage.value()&&(s=100*(s-n)/n),u.text=this._series.priceScale().formatter().format(s),r=this._series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI,r?this._series.properties().haStyle.showRealLastPrice.value()?(a=this._series.lastValueData(TradingView.CLOSE_PLOT,!0),a.noData||a.color===this._background||(this._background=a.color),e.enabled("countdown")&&this._series.properties().showCountdown.value()?u.secondLine=this._countdownInfo():u.secondLine=null,l=this._series.lastValueData(TradingView.CLOSE_PLOT,!1).index,h=a.index,c=l===h,u.visible=c):u.visible=!1:(d=this._series.barColorer(),p=d.barStyle(i.index,!0),this._background=p.barColor),this._background!==u.background&&(u.background=this._background,u.color=this.color()),u.coordinate=this._series.priceScale().priceToCoordinate(s))))},t.exports=o}).call(e,i(1))},function(t,e,i){(function(e){"use strict";function o(t,e){this._series=t,this._model=e,this._text="",this._coordinate=0,this._background="black",this._color="white",this._invalidated=!0,this._rendererData={text:"",coordinate:null,color:"#FFF",background:"#000",visible:!1,secondLine:null}}var n=i(84),s=i(86),r=i(93);inherit(o,n),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(t){var i,o,n,s,r=this._rendererData;r.visible=!1,r.text="",this._model.properties().scalesProperties.showSeriesLastValue.value()&&(i=this._series.lastValueData(null,e.enabled("price_scale_always_last_bar_value")),!i.noData&&i.text&&(this._series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI&&this._series.properties().haStyle.showRealLastPrice.value()&&(o=this._series.lastValueData(TradingView.CLOSE_PLOT,!1).index,n=this._series.lastValueData(TradingView.CLOSE_PLOT,!0).index,o===n)||(r.visible=!0,r.text=i.text,i.color!==this._background&&(this._background=i.color,r.color=this.color(),r.background=this._background),r.coordinate=i.coordinate,this._floatCoordinate=i.floatCoordinate,this._coordinate=i.coordinate,r.secondLine=null,e.enabled("countdown")&&this._series.properties().showCountdown.value()&&(s=[TradingView.Series.STYLE_BARS,TradingView.Series.STYLE_CANDLES,TradingView.Series.STYLE_LINE,TradingView.Series.STYLE_AREA,TradingView.Series.STYLE_HOLLOW_CANDLES,TradingView.Series.STYLE_HEIKEN_ASHI],s.indexOf(this._series.properties().style.value())!==-1&&(r.secondLine=this._countdownInfo())))))},o.prototype.coordinate=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),n.prototype.coordinate.call(this)},o.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer||(this._renderer=new s(this._rendererData)),this._renderer},o.prototype.dump=function(){return{text:this._rendererData.text,coordinate:this._rendererData.coordinate,color:this._rendererData.color,background:this._rendererData.background,visible:this._rendererData.visible}},o.prototype.text=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._rendererData.text},o.prototype._countdownInfo=function(){var t,e,i,o,n,s,a,l,h,c,d=null;return this._series.isDWM()?d:(t=1e3*this._series.data().bars().last().value[0],e=1e3*this._series.serverTimeOffset(),i=r.parse(this._series.interval()),o=i.kind()===r.SECONDS?i.multiplier():60*i.multiplier(),n=t.valueOf()+1e3*o,s=(new Date).valueOf()+e,a=Math.round((n-s)/1e3),a>0&&(a=Math.min(a,o),l="",a>=3600&&(l=Math.floor(a/3600)+":"),a%=3600,h=("0"+Math.floor(a/60)).right(2),a%=60,c=("0"+Math.floor(a)).right(2),d=l+h+":"+c),d)},t.exports=o}).call(e,i(1))},function(t,e,i){"use strict";function o(t,e){s.call(this),this._series=t,this._model=e,this._items.push(new r($.t("Open",{context:"in_legend"}),"")),this._items.push(new r($.t("High",{context:"in_legend"}),"")),this._items.push(new r($.t("Low",{context:"in_legend"}),"")),this._items.push(new r($.t("Close",{context:"in_legend"}),"")),this._invalidated=!0,this.update()}var n=i(109),s=n.DataWindowView,r=n.DataWindowItem,a=i(85),l=a.invertColor,h=a.colorsAreSimilar,c=a.RGBColor,d=i(110).translatedIntervalString;inherit(o,s),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,p,u,_,f;if(this._series.symbolInfo()?(this._header=[this._series.symbolInfo().name,d(this._series.interval()),this._series.symbolInfo().exchange].join(", "),this._title=this._series.symbolInfo().description):this._header=this._series.symbol(),this._items[0].setValue($.t("n/a")),this._items[1].setValue($.t("n/a")),this._items[2].setValue($.t("n/a")),this._items[3].setValue($.t("n/a")),!this._model.timeScale().isEmpty()&&0!==this._series.bars().size()&&(t=this._series.barColorer(),e=this._series.data().size()-1,i=this._model.crossHairSource().appliedIndex(),void 0!==(o=isNumber(i)?this._series.nearestIndex(i,TradingView.SEARCH_NEAREST_LEFT):this._series.nearestIndex(e,TradingView.SEARCH_NEAREST_LEFT))))for(n=this._series.data().valueAt(o),s=this._series.formatter(),this._items[0].setValue(s.format(n[TradingView.OPEN_PLOT])),this._items[1].setValue(s.format(n[TradingView.HIGH_PLOT])),this._items[2].setValue(s.format(n[TradingView.LOW_PLOT])),this._items[3].setValue(s.format(n[TradingView.CLOSE_PLOT])),r=t.barStyle(o,!1),a=r.barColor,p=this._series.model().paneForSource(this._series),u=p._properties.background.value(),_=new c(a).toHex(),h(_,u)&&(a=l(_)),f=0;f<4;f++)this._items[f].setColor(a)},o.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},o.prototype.dump=function(){return{header:this._header,items:this._items}},o.prototype.additional=function(){if(this._series.dataPoweredBy)return"(Data Provided by "+this._series.dataPoweredBy+")"},t.exports=o},function(t,e){"use strict";function i(t,e){this.m_title=t,this.m_value=e,this._visible=!0,this._color=void 0}function o(){this._header="",this._title="",this._items=[]}i.prototype.title=function(){return this.m_title},i.prototype.text=function(){return this.m_value},i.prototype.visible=function(){return this._visible},i.prototype.color=function(){return this._color},i.prototype.setVisible=function(t){this._visible=t},i.prototype.setValue=function(t){this.m_value=t},i.prototype.setColor=function(t){this._color=t},i.prototype.value=function(){return this.m_value},o.prototype.header=function(){return this._header},o.prototype.title=function(){return this._title},o.prototype.items=function(){return this._items},o.prototype.update=function(){},e.DataWindowItem=i,e.DataWindowView=o},function(t,e,i){"use strict";function o(t){var e=(""+t).match(/(.*)([DWM])/);return e?e[1]+$.t(e[2],{context:"dates"}):t}i(96),e.translatedIntervalString=o},function(t,e,i){"use strict";function o(t,e){this.m_series=t,this.m_model=e,this.m_bars=[],this._invalidated=!0}function n(t,e){o.call(this,t,e)}function s(t,e){o.call(this,t,e)}function r(t,e){o.call(this,t,e)}function a(t,e){o.call(this,t,e)}function l(t,e,i){this.m_series=t,this.m_priceSource=e,this.m_model=i,this.m_items=[],this._barGetter={open:function(t){return t[TradingView.OPEN_PLOT]},high:function(t){return t[TradingView.HIGH_PLOT]},low:function(t){return t[TradingView.LOW_PLOT]},close:function(t){return t[TradingView.CLOSE_PLOT]},hl2:function(t){return(t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT])/2},hlc3:function(t){return(t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT]+t[TradingView.CLOSE_PLOT])/3},ohlc4:function(t){return(t[TradingView.OPEN_PLOT]+t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT]+t[TradingView.CLOSE_PLOT])/4}}[this.m_priceSource]}function h(t,e,i){l.call(this,t,e,i),this._invaidated=!0}function c(t,e,i){l.call(this,t,e,i),this._invaidated=!0}var d=i(30),p=i(112).SelectionRenderer,u=i(113),_=i(114),f=_.PaneRendererBars,m=_.PaneRendererLine,g=_.PaneRendererArea,v=_.PaneRendererCandles,y=i(117),b=i(118),w=i(119);o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,p,_,f,m,g=this;if(this.m_bars=[],!this.m_model.timeScale().isEmpty()&&!this.m_series.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars(),!t.isEmpty()&&0!==this.m_series.bars().size())){for(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT);e<=i&&void 0===this.m_series.bars().valueAt(e);e++);if(!(e>i)&&(t=this.m_series.bars().range(e,i),n=this.m_series.priceScale(),s=n.properties().percentage.value(),r=this.m_series.barColorer(),a={},t.each(function(t,e){var i,n;void 0!==e[TradingView.OPEN_PLOT]&&void 0!==e[TradingView.HIGH_PLOT]&&void 0!==e[TradingView.LOW_PLOT]&&void 0!==e[TradingView.CLOSE_PLOT]&&(void 0===o&&(o=e[TradingView.CLOSE_PLOT]),i={},i.time=Math.round(t),s?(i.open=100*(e[TradingView.OPEN_PLOT]-o)/o,i.high=100*(e[TradingView.HIGH_PLOT]-o)/o,i.low=100*(e[TradingView.LOW_PLOT]-o)/o,i.close=100*(e[TradingView.CLOSE_PLOT]-o)/o):(i.open=e[TradingView.OPEN_PLOT],i.high=e[TradingView.HIGH_PLOT],i.low=e[TradingView.LOW_PLOT],i.close=e[TradingView.CLOSE_PLOT]),a.value=e,n=e[TradingView.STYLE_PLOT]?e[TradingView.STYLE_PLOT]:r.barStyle(t,!1,a),e[TradingView.STYLE_PLOT]=n,a.previousValue=e,i.color=n.barColor,i.borderColor=n.barBorderColor,i.wickColor=n.barWickColor,i.hollow=n.isBarHollow,g.m_bars.push(i))},this),n.barPricesToCoordinates(this.m_bars),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_series===this.m_model.selectedSource()))for(l=b(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=u.REGULAR,h=0;h<l.length;h++)c=l[h],(p=this.m_series.bars().valueAt(c))&&(_=.5*(p[TradingView.OPEN_PLOT]+p[TradingView.CLOSE_PLOT]),n.properties().percentage.value()&&(_=100*(_-o)/o),f=this.m_model.timeScale().indexToCoordinate(c),m=this.m_series.priceScale().priceToCoordinate(_),this._selectionData.points.push(new d.Point(f,m)))}},o.prototype.items=function(){return this.m_bars},o.prototype.dump=function(){var t={};return t.bars=this.m_bars,t},inherit(n,o),n.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value(),e=new y,e.append(new f(t)),this.m_series===this.m_model.selectedSource()&&e.append(new p(this._selectionData)),e},inherit(s,o),s.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().candleStyle.drawWick.value(),t.drawBorder=this.m_series.properties().candleStyle.drawBorder.value(),t.borderColor=this.m_series.properties().candleStyle.borderColor.value(),t.wickColor=this.m_series.properties().candleStyle.wickColor.value(),e=new y,e.append(new v(t)),this.m_series===this.m_model.selectedSource()&&e.append(new p(this._selectionData)),e},inherit(r,o),r.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().haStyle.drawWick.value(),t.drawBorder=this.m_series.properties().haStyle.drawBorder.value(),t.borderColor=this.m_series.properties().haStyle.borderColor.value(),t.wickColor=this.m_series.properties().haStyle.wickColor.value(),e=new y,e.append(new v(t)),this.m_series===this.m_model.selectedSource()&&e.append(new p(this._selectionData)),e},inherit(a,o),a.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().hollowCandleStyle.drawWick.value(),t.drawBorder=this.m_series.properties().hollowCandleStyle.drawBorder.value(),t.borderColor=this.m_series.properties().hollowCandleStyle.borderColor.value(),t.wickColor=this.m_series.properties().hollowCandleStyle.wickColor.value(),e=new y,e.append(new v(t)),this.m_series===this.m_model.selectedSource()&&e.append(new p(this._selectionData)),e},l.prototype.update=function(){var t,e,i,o,n,s,r,a,l,h,c,p,_,f,m,g,v;if(this.m_items=[],!this.m_model.timeScale().isEmpty()&&this.m_series.priceScale()&&!this.m_series.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars(),!t.isEmpty()&&0!==this.m_series.bars().size())){for(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),t=this.m_series.bars().range(e,i),o=this,s=o.m_series.priceScale(),r={color:this.m_series.properties().lineStyle.color.value()},a=s.properties().percentage.value(),l=t._start;l<t._end;++l)h=t._indexAt(l),c=t._valueAt(l),void 0!==(p=this._barGetter(c))&&null!==p&&(void 0===n&&(n=p),a&&(p=100*(p-n)/n),_=new d.Point(h,p),_.style=r,o.m_items.push(_));if(s.pointsArrayToCoordinates(o.m_items),o.m_model.timeScale().indexesToCoordinates(o.m_items),this.m_series===this.m_model.selectedSource())for(f=b(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=u.REGULAR,l=0;l<f.length;l++)h=f[l],m=this.m_series.data().valueAt(h),p=this._barGetter(m),s.properties().percentage.value()&&(p=100*(p-n)/n),g=this.m_model.timeScale().indexToCoordinate(h),v=this.m_series.priceScale().priceToCoordinate(p),this._selectionData.points.push(new d.Point(g,v))}},inherit(h,l),h.prototype.update=function(){this._invalidated=!0},h.prototype.renderer=function(){var t,e,i,o;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t=this.m_series.properties().lineStyle,e={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:t.color.value(),lineStyle:t.linestyle.value(),withMarkers:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,withSteps:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP,lineWidth:t.linewidth.value(),simpleMode:!0},i=new m(e),this.m_series===this.m_model.selectedSource()?(o=new y,o.append(i),o.append(new p(this._selectionData))):o=i,o},inherit(c,l),c.prototype.update=function(){this._invalidated=!0},c.prototype.renderer=function(){var t,e,i;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t={},t.simpleMode=!1,t.barSpacing=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.lineColor=this.m_series.properties().areaStyle.linecolor.value(),t.lineStyle=this.m_series.properties().areaStyle.linestyle.value(),t.lineWidth=this.m_series.properties().areaStyle.linewidth.value(),e=this.m_series.properties().areaStyle.transparency.value(),t.isSeries=!0,t.color1=w.generateColor(this.m_series.properties().areaStyle.color1.value(),e),t.color2=w.generateColor(this.m_series.properties().areaStyle.color2.value(),e),t.bottom=this.m_series.priceScale().height(),i=new y,i.append(new g(t)),this.m_series===this.m_model.selectedSource()&&i.append(new p(this._selectionData)),i},e.SeriesBarsPaneView=n,e.SeriesCandlesPaneView=s,e.SeriesHollowCandlesPaneView=a,e.SeriesLinePaneView=h,e.SeriesAreaPaneView=c,e.SeriesHeikenAshiPaneView=r},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){this._data=t,this._model=e,this.radius=this._data.radius||n.OUTER_RADIUS}function s(t){o.call(this,t)}var r=i(113),a=i(114).PaneRendererArrowsUpDown;o.RADIUS=3.5,o.prototype.tolerance=2,o.prototype.draw=function(t){function e(t){return void 0===t.x||TradingView.isNaN(t.x)||null===t.x||void 0===t.y||TradingView.isNaN(t.y)||null===t.y}var i,o,n;if(this._data)for(t.strokeStyle="#6B6B6B",t.fillStyle="#D6D6D6",i=this._data.vertOffset||0,o=0;o<this._data.points.length;o++)n=this._data.points[o],e(n)||this._drawMarker(t,n,i)},o.prototype._drawMarker=function(t,e,i){t.beginPath(),t.arc(e.x+.5,e.y+.5+i,o.RADIUS,0,2*Math.PI,!0),t.closePath(),t.fill(),t.stroke()},o.prototype.hitTest=function(t){var e,i;if(!this._data)return null;for(e=0;e<this._data.points.length;e++)if(i=this._data.points[e],i.substract(t).length()<=o.RADIUS+this.tolerance)return new r(this._data.hittestResult,i.data);return null},n.OUTER_RADIUS=TradingView.isMobile.any()?16:8,n.prototype.tolerance=2,n.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c=this._data.currentPoint,d=this._data.outerStrokeWidth||1;for(e=0;e<this._data.points.length;e++)i=this._data.points[e],o=i.substract(c).length(),n=TradingView.isInteger(i.data)&&this._data.linePointBeingEdited===i.data,s=this.radius,r=this._data.strokeWidth||2,a=o<=s+this.tolerance,l=a?1:0,s+=l,r+=l,n||(i.square?(t.fillStyle=this._data.backgroundColor,t.fillRect(i.x-s,i.y-s,2*s,2*s),t.fillStyle=this._data.color,h=s-d,t.fillRect(i.x-h,i.y-h,2*h,2*h),h=s-d-r,t.fillStyle=this._data.backgroundColor,t.fillRect(i.x-h,i.y-h,2*h,2*h)):(t.beginPath(),t.arc(i.x,i.y,s,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.backgroundColor,t.fill(),t.beginPath(),t.arc(i.x,i.y,s-d,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.color,t.fill(),t.beginPath(),t.arc(i.x,i.y,s-d-r,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.backgroundColor,t.fill()))},n.prototype.hitTest=function(t){var e,i,o;for(e=0;e<this._data.points.length;e++)if(i=this._data.points[e],o=i.substract(t).length(),o<=this.radius+this.tolerance)return new r(this._data.hittestResult,i.data);return null},inherit(s,o),s.prototype._drawMarker=function(t,e,i){var n=e.isUp?1:-1,s=a.prototype._calculateVerticalOffset(this._data.barSpacing),r=a.prototype._calculateMinHeight(this._data.barSpacing),l=i+n*s+n*r;t.beginPath(),t.arc(e.x+.5,e.y+.5+l,o.RADIUS,0,2*Math.PI,!0),t.closePath(),t.fill(),t.stroke()},e.SelectionRenderer=o,e.LineAnchor=n,e.SelectionRendererArrowsUpDown=s},function(t,e){"use strict";function i(t,e,i){this._result=t,this._data=e,this._eraseMarker=i}i.MOVEPOINT_BACKGROUND=1,i.REGULAR=2,i.MOVEPOINT=3,i.CHANGEPOINT=4,i.CUSTOM=5,i.prototype.result=function(){return this._result},i.prototype.data=function(){return this._data},i.prototype.eraseMarker=function(){return this._eraseMarker},t.exports=i},function(t,e,i){"use strict";function o(t){this.bars=t.bars,this.barSpacing=t.barSpacing,this.barWidth=N.optimalBarWidth(t.barSpacing),this.barLineWidth=Math.max(1,Math.round(this.barWidth)),this.dontDrawOpen=t.dontDrawOpen}function n(t){this.bars=t.bars,this.barWidth=t.barWidth,this.barLineWidth=1}function s(t){this.bars=t.bars,this.barSpacing=t.barSpacing,this.barLineWidth=Math.max(1,N.optimalBarWidth(t.barSpacing))}function r(t){this.bars=t.bars,this.barSpacing=t.barSpacing,this.blockSize=t.blockSize,this.barWidth=t.barSpacing}function a(t){this.items=t.items,this.barSpacing=t.barSpacing,this.histogramBase=t.histogramBase,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth}function l(t){this.items=t.items,this.barSpacing=t.barSpacing,this.histogramBase=t.histogramBase,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth}function h(t){this.items=t.items,this._simpleMode=t.simpleMode,this.barSpacing=t.barSpacing,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth,this.lineStyle=t.lineStyle,this.withMarkers=t.withMarkers,this.withSteps=t.withSteps,this.hittest=t.hittest,this.ignorePaletteLineWidth=t.ignorePaletteLineWidth,this.forceLineColor=!!t.forceLineColor}function c(t){t.forceLineColor=!1,h.call(this,t),this.color1=t.color1,this.color2=t.color2,this.bottom=t.bottom,this.isSeries=!!t.isSeries,this._simpleMode=t.simpleMode}function d(t){this._data=t,this.bars=t.bars,this._barWidth=N.optimalBarWidth(t.barSpacing),this._barBorderWidth=1}function p(t){this.items=t.items,this.barSpacing=t.barSpacing,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth,this.lineStyle=t.lineStyle}function u(t){this.items=t.items,this.barSpacing=t.barSpacing,this.lineColor=t.lineColor||t.color,this.radius=t.lineWidth||t.height/2,this.vertOffset=t.vertOffset||0}function _(t,e,i,o){this.x=t,this.y=e,this.height=i,this.isUp=o}function f(t){this.items=t.items,this.barSpacing=t.barSpacing,this.colorUp=t.colorup,this.colorDn=t.colordown,this.colorBorder=t.colorBorder,this.width=this._calculateWidth(t.barSpacing),this.minHeight=t.minHeight,this.vertOffset=this._calculateVerticalOffset(t.barSpacing)}function m(t){this.items=t.items,this.height=t.height||t.width,this.width=t.width||t.height,this._color=t.color,this._borderColor=t.borderColor,this._vertOffset=t.vertOffset||0,t.textCache&&(this._textCache=t.textCache,this._textColor=t.textColor,this._textVertOffset=this._vertOffset>0?this.height:-this.height,this._textImageWidth=this._textCache.textImageWidth,this._textImageHeight=this._textCache.textImageHeight)}function g(t){m.call(this,t),this.ch=t.char[0]||" ",this.fontFamily=t.fontFamily||"Arial",this._charCache=new W(this.ch,!1,!1,this.fontFamily,this.height)}function v(t){m.call(this,t)}function y(t){m.call(this,t)}function b(t){m.call(this,t)}function w(t){m.call(this,t)}function S(t){m.call(this,t)}function T(t){m.call(this,t)}function C(t){m.call(this,t)}function x(t){m.call(this,t),this.width=this._calculateWidth(t.barSpacing),this._isUp=!1}function P(t){x.call(this,t),this._isUp=!0}function L(t){x.call(this,t),this._isUp=!1}function k(t,e){m.call(this,t),this._isUp=e,this._stepX=Math.round(this.height/2*.65)+.5,this._stepY=Math.round(this.height/2)+.5,this._textCache?(this._padding=this._stepX/2,this._shapeWidth=this._textImageWidth+2*this._stepX,this._shapeHeight=this._textImageHeight+2*this._padding+this._stepY,0===this._vertOffset?this._isUp?this._textVertOffset=this._stepY+this._padding+this._textImageHeight:this._textVertOffset=-this._stepY-this._padding:this._textVertOffset=this._vertOffset>0?this._stepY+this._padding:-this._stepY-this._padding):(this._padding=0,this._shapeWidth=2*this._stepX,this._shapeHeight=2.5*this._stepY)}function I(t){k.call(this,t,!0)}function E(t){k.call(this,t,!1)}function A(t){m.call(this,t)}function V(t){m.call(this,t)}function M(t){this._items=t.items,this._y=t.y,this._h=t.h,this._w=t.w}function $(t){var e,i,o,n,s,r,a,l,h,c;t.point2||(t.point2=t.point1),e=t.point1.x,i=t.point1.y,o=t.point2.x,n=t.point2.y,s=16,r=s-6,a=s-6,l=e<=o?e-r:e+r,h=i<=n?i+a:i-a,l-=1,h-=3,c={items:[new R.Point(l,h)],char:[String.fromCharCode("0xF017").toUpperCase()],color:t.color,vertOffset:0,height:s,fontFamily:"FontAwesome"},g.call(this,c)}function D(t,e){this._items=t.items,this._color=t.color,this._orderArrow=t.orderArrow,this._exitLineWidth=t.exitLineWidth,this._priceArrow=t.priceArrow,this._text=t.text,this._textWidths=e}function O(t){this.data=t}function B(t){this._data=t}var R=i(30),N=i(115),F=i(113),W=i(116);o.prototype.draw=function(t){var e,i,o;for(t.save(),t.translate(.5,.5),i=0;i<this.bars.length;++i)o=this.bars[i],e!==o.color&&(t.fillStyle=o.color,e=o.color),t.fillRect(Math.round(o.time-this.barLineWidth/2),Math.round(o.high-this.barWidth/2),Math.round(this.barLineWidth),Math.round(o.low-o.high+this.barWidth)),this.barLineWidth<this.barSpacing-1&&(this.dontDrawOpen||t.fillRect(Math.round(o.time-1.5*this.barWidth),Math.round(o.open-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)),t.fillRect(Math.round(o.time),Math.round(o.close-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)));t.restore()},o.prototype.hitTest=function(t){var e,i,o,n,s=this.bars,r=.5*this.barSpacing;if(0===s.length)return null;if(t.x<s[0].time-r)return null;if(t.x>s[s.length-1].time+r)return null;for(e=null,i=0;i<s.length;++i)if(o=s[i],t.x<=o.time+r){e=o;break}return n=N.selectionTolerance(this.barLineWidth),e&&e.high-n<=t.y&&t.y<=e.low+n?new F(F.REGULAR):null},n.prototype.draw=function(t){var e,i,o,n,s,r,a;for(t.save(),t.lineCap="butt",t.translate(.5,.5),t.lineWidth=this.barLineWidth,e=this.barWidth/2,i=0;i<this.bars.length;++i)o=this.bars[i],n=o.exactTime-e,s=o.exactTime+e-n,r=Math.round(o.high),a=o.low-o.high==0?1:Math.round(o.low-o.high),t.fillStyle=o.borderColor,t.fillRect(n,r,s,a),t.fillStyle=o.color,t.fillRect(n+this.barLineWidth,r+this.barLineWidth,s-2*this.barLineWidth,a-2*this.barLineWidth);t.restore()},n.prototype.hitTest=function(t){var e,i,o,n,s=this.bars,r=.5*this.barWidth;if(0===s.length)return null;if(t.x<s[0].time-r)return null;if(t.x>s[s.length-1].time+r)return null;for(e=null,i=0;i<s.length;++i)if(o=s[i],t.x<=o.time+r){e=o;break}return n=N.selectionTolerance(this.barLineWidth),e&&e.high-n<=t.y&&t.y<=e.low+n?new F(F.REGULAR):null},s.prototype.draw=function(t){var e,i,o;for(t.save(),t.lineCap="square",t.translate(.5,.5),e=0;e<this.bars.length;++e)i=this.bars[e],o=Math.round(.5*this.barLineWidth),i.isTwoColorBar?(t.fillStyle=i.upColor,t.fillRect(Math.round(i.exactTime-o),Math.round(i.high-o),Math.round(2*o),Math.round(i.additionalPrice-i.high+o)),t.fillStyle=i.downColor,t.fillRect(Math.round(i.exactTime-o),Math.round(i.additionalPrice),Math.round(2*o),Math.round(i.low-i.additionalPrice+o))):(t.fillStyle=i.color,t.fillRect(Math.round(i.exactTime-o),Math.round(i.high-o),Math.round(2*o),Math.round(i.low-i.high)+2*o)),i.combinedWithProjection||(i.isTwoColorBar?t.fillStyle=i.isUp?i.downColor:i.upColor:t.fillStyle=i.color,t.fillRect(Math.round(i.exactTime-this.barSpacing+o),Math.round(i.open-o),Math.round(this.barSpacing-2*o+1),Math.round(2*o)));t.restore()},s.prototype.hitTest=function(t){var e,i,o,n,s=this.bars,r=.5*this.barLineWidth;if(0===s.length)return null;if(t.x<s[0].time-r)return null;if(t.x>s[s.length-1].time+r)return null;for(e=null,i=0;i<s.length;++i)if(o=s[i],t.x<=o.time+r){e=o;break}return n=N.selectionTolerance(.5*this.barLineWidth),e&&e.high-n<=t.y&&t.y<=e.low+n?new F(F.REGULAR):null},r.prototype.draw=function(t){var e,i,o,n;for(t.save(),t.lineCap="butt",t.translate(.5,.5),e=0;e<this.bars.length;++e){for(i=this.bars[e],o=(i.low-i.high)/i.additionalNum,t.beginPath(),n=0;n<i.additionalNum;n++)i.isUp?(t.moveTo(Math.round(i.time-.5*this.barWidth)+.5,i.high+n*o),t.lineTo(Math.round(i.time+.5*this.barWidth)-.5,i.high+(n+1)*o),t.moveTo(Math.round(i.time+.5*this.barWidth)-.5,i.high+n*o),t.lineTo(Math.round(i.time-.5*this.barWidth)+.5,i.high+(n+1)*o)):this.drawEllipse(t,i.time-.45*this.barWidth+.5,i.high+n*o,Math.round(.9*this.barWidth),Math.round(o));t.strokeStyle=i.color,t.lineWidth=1,t.stroke()}t.restore()},r.prototype.drawEllipse=function(t,e,i,o,n){t.save(),t.translate(e+o/2,i+n/2),t.scale(o/2,n/2),t.moveTo(1,0),t.arc(0,0,.95,0,2*Math.PI,!1),t.restore()},r.prototype.hitTest=function(t){var e,i,o,n,s=this.bars,r=.5*this.barSpacing;if(0===s.length)return null;if(t.x<s[0].time-r)return null;if(t.x>s[s.length-1].time+r)return null;for(e=null,i=0;i<s.length;++i)if(o=s[i],t.x<=o.time+r){e=o;break}return n=N.selectionTolerance(this.barWidth),e&&e.high-n<=t.y&&t.y<=e.low+n?new F(F.REGULAR):null},a.prototype.draw=function(t){var e,i,o,n,s;for(t.translate(.5,.5),t.fillStyle=this.lineColor,e=this.lineWidth,i=0;i<this.items.length;++i)o=this.items[i],n=o.x,s=o.y,o.style&&(t.fillStyle=o.style.color,e=o.style.width),t.fillRect(Math.round(n-.5*e),s,e,this.histogramBase-s)},a.prototype.hitTest=function(t){var e,i,o,n,s,r=N.selectionTolerance(this.lineWidth);for(s=0;s<this.items.length;++s)if(e=this.items[s],i=e.x,o=e.y,n=R.distanceToSegment(new R.Point(i,o),new R.Point(i,this.histogramBase),new R.Point(t.x,t.y)),n.distance<=r)return new F(F.REGULAR);return null},l.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,u;if(0!==this.items.length){for(e=this.barSpacing,i=this.lineColor,o=this.histogramBase,t.translate(.5,.5),n={},s=this.items,r=0;r<s.length;++r)a=s[r],l=0===r?null:s[r-1],h=a.style?a.style.color:i,c=n[h]||[],c.push({item:a,prev:l}),n[h]=c;for(h in n){for(c=n[h],t.fillStyle=h,t.strokeStyle=h,t.lineWidth=1,t.beginPath(),r=0;r<c.length;r++)a=c[r].item,d=Math.ceil(a.x-.5*e),p=Math.ceil(d+e),u=a.y,t.rect(d,u,p-d,o-u);for(t.fill(),t.beginPath(),r=0;r<c.length;r++)a=c[r].item,d=Math.ceil(a.x-.5*e),p=Math.ceil(d+e),u=a.y,l=c[r].prev,t.moveTo(p-.5,o),t.lineTo(p-.5,u+.5),t.lineTo(d+.5,u+.5),l&&l.y>u&&t.lineTo(d+.5,l.y);t.stroke()}}},l.prototype.hitTest=function(t){var e,i,o,n=.5*this.barSpacing+this.lineWidth,s=t.x-n,r=t.x+n,a=this.items;for(e=a.length;e--;)if((i=a[e].x)>=s&&i<=r&&(o=a[e].y,t.y>=Math.min(o,this.histogramBase)&&t.y<=Math.max(o,this.histogramBase)))return new F(F.REGULAR);return null},h.prototype.draw=function(t){t.lineCap="square",t.lineJoin=this.withMarkers?"round":"miter",t.strokeStyle=this.lineColor,t.fillStyle=this.lineColor,t.lineWidth=this.lineWidth,t.lineStyle=this.lineStyle,this._simpleMode?this._drawSimpleMode(t):this._drawLines(t)},h.prototype._drawSimpleMode=function(t){var e,i,o,n;if(t.beginPath(),this.walkLine(t,this.items),t.stroke(),this.withMarkers){for(e=this.lineWidth+2,i=2*Math.PI,t.beginPath(),n=this.items.length;n--;)(o=this.items[n])&&(t.moveTo(o.x,o.y),t.arc(o.x,o.y,e,0,i));t.fill()}},h.prototype.walkLine=function(t,e,i,o){var n,s,r,a,l,h,c,d,p,u,_;if(e){for(n=.25*this.barSpacing,c=N.paneRendererCoordinateIsValid,d=0,p=e.length;d<p;d++)if(u=e[d],c(u.y)){r=u,s=d;break}if(void 0!==s&&r)for(_=this.withSteps&&this.lineWidth&&this.lineWidth%2==0?.5:0,d=s,p=e.length;d<p;d++){if(l=e[d],h=e[d+1]||{},c(l.y))if(a&&c(a.y))this.withSteps&&t.lineTo(a.x+_,l.y+_),t.lineTo(l.x+_,l.y+_),i&&!c(h.y)&&t.lineTo(l.x+_,o);else if(h&&c(h.y))i?(d!==s&&t.lineTo(l.x+_,o),t.lineTo(l.x+_,l.y+_)):t.moveTo(l.x+_,l.y+_);else if(i){if(0===d)continue;d!==s&&t.lineTo(l.x-n+_,o),t.lineTo(l.x-n+_,l.y+_),t.lineTo(l.x+n+_,l.y+_),t.lineTo(l.x+n+_,o)}else t.moveTo(l.x-n+_,l.y+_),t.lineTo(l.x+n+_,l.y+_);a=l}}},h.prototype._drawLines=function(t){function e(e,i,o){r(i.y)&&(r(e.y)?t.lineTo(i.x,i.y):o&&r(o.y)?t.moveTo(i.x,i.y):(t.moveTo(i.x-s,i.y),t.lineTo(i.x+s,i.y)))}var i,o,n,s,r,a,l,h,c,d,p,u,_,f;if(this.items.length){for(s=.25*this.barSpacing,r=N.paneRendererCoordinateIsValid,t.beginPath(),a=this.items[0],a&&t.moveTo(a.x,a.y),l=t.strokeStyle,h=t.lineWidth,c=t.lineStyle,d=1;d<this.items.length;++d)i=this.items[d-1],o=this.items[d],n=this.items[d+1],o.style&&!this.forceLineColor?(p=o.style.color,u=o.style.width,_=o.style.style):(p=this.lineColor,u=this.lineWidth,_=this.lineStyle),this.ignorePaletteLineWidth&&(u=this.lineWidth),f=p!==l||u!==h||_!==c,f?(l=p,h=u,c=_,t.stroke(),t.beginPath(),t.strokeStyle=p,t.lineWidth=u,t.lineStyle=_,_===CanvasEx.LINESTYLE_SOLID?(t.moveTo(i.x,i.y),e(i,o,n)):CanvasEx.drawLine(t,i.x,i.y,o.x,o.y)):e(i,o,n);t.stroke()}},h.prototype.hitTest=function(t){for(var e,i,o,n,s,r,a,l,h=N.selectionTolerance(this.lineWidth),c=0,d=this.items.length-1;d-c>2;)r=Math.round((d+c)/2),a=this.items[r],a.x<=t.x?c=r:d=r;for(c=Math.max(1,c-1),d=Math.min(this.items.length-1,d+1),l=c;l<=d;++l)if(e=this.items[l-1],i=this.items[l],o=e.x,n=i.x,s=R.distanceToSegment(new R.Point(o,e.y),new R.Point(n,i.y),new R.Point(t.x,t.y)),s.distance<=h)return this.hittest?this.hittest:new F(F.REGULAR);return null},inherit(c,h),c.prototype.draw=function(t){var e,i,o,n,s,r,a,l,c,d,p,u;if(0!==this.items.length){for(t.lineCap="square",t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,t.lineStyle=this.lineStyle,t.lineWidth=1,e=0;e<this.items.length&&!N.paneRendererCoordinateIsValid(this.items[e].y);)e++;for(i=this.items.length-1;i>=0&&!N.paneRendererCoordinateIsValid(this.items[i].y);)i--;if(!(e>=i)){for(t.translate(.5,.5),o={},n=this.items,s=e;s<=i;s++)r=n[s],a=r.style?r.style.color:this.lineColor,s<i&&n[s+1].style&&(l=n[s+1].style.color,a!==l&&(c=o[l]||[],c.push(r),o[l]=c)),d=o[a]||[],d.push(r),o[a]=d;for(a in o){for(d=o[a],t.beginPath(),p=0,s=0;s<d.length;s++)d[s].style&&d[s].style.color!==a&&(t.moveTo(d[p].x,this.bottom),this.walkLine(t,d.slice(p,s),!0,this.bottom),p=s);t.moveTo(d[p].x,this.bottom),this.walkLine(t,d.slice(p,d.length),!0,this.bottom),t.closePath(),this.isSeries?(u=t.createLinearGradient(0,0,0,this.bottom),u.addColorStop(0,this.color1),u.addColorStop(1,this.color2),t.fillStyle=u,this._simpleMode=!0):t.fillStyle=a,t.fill()}t.lineWidth=this.lineWidth,h.prototype.draw.call(this,t)}}},d.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,u,_,f=this.bars,m=this._data.barSpacing,g=this._data.drawWick,v=this._data.drawBorder,y=this._data.wickColor,b=this._barBorderWidth,w=this._barWidth;if(t.lineCap="square",t.lineStyle=this._data.lineStyle,m<1){if(g){for(t.strokeStyle=y,t.lineWidth=1,t.beginPath(),c=f.length;c-- >0;)d=f[c],t.moveTo(d.time,d.low),t.lineTo(d.time,d.high);t.stroke()}for(t.lineWidth=1,p="",u=!1,t.beginPath(),c=f.length;c-- >0;)d=f[c],h=d.time,p!==d.color&&(u&&(t.stroke(),t.beginPath(),u=!1),t.strokeStyle=d.color,p=d.color),t.moveTo(d.time,d.open),t.lineTo(d.time,d.close),u=!0;u&&t.stroke()}else{if(f=f.slice().sort(function(t,e){return t.color>e.color?-1:t.color<e.color?1:0}),t.translate(.5,.5),t.lineWidth=b,g)for(_=y,t.fillStyle=y,c=f.length;c--;)d=f[c],h=d.time,e=d.open,i=d.high,o=d.low,n=d.close,d.wickColor&&d.wickColor!==_&&(t.fillStyle=d.wickColor,_=d.wickColor),a=Math.min(e,n),l=Math.max(e,n),d.hollow?(t.fillRect(h,i,1,a-i),t.fillRect(h,l,1,o-l)):t.fillRect(h,i,1,o-i);if(v)for(c=f.length;c--;)d=f[c],f[c+1]&&d.borderColor===f[c+1].borderColor||(t.fillStyle=d.borderColor),d.hollow||(h=d.time,e=d.open,n=d.close,s=Math.round(h-w),r=Math.round(h+w),a=Math.min(e,n),l=Math.max(e,n),t.fillRect(s,a,r-s+1,l-a+1));for(c=f.length;c--;)d=f[c],h=d.time,e=d.open,i=d.high,o=d.low,n=d.close,s=Math.round(h-w),r=Math.round(h+w),a=Math.min(e,n),l=Math.max(e,n),f[c+1]&&d.color===f[c+1].color||(t.fillStyle=d.color,t.strokeStyle=d.color),d.hollow?(t.translate(-.5,-.5),t.strokeRect(s+1,a+1,r-s,l-a),t.translate(.5,.5)):(v&&(s+=1,a+=1,r-=1,l-=1),t.fillRect(s,a,r-s+1,l-a+1))}},d.prototype.hitTest=function(t){var e,i,o,n,s=this.bars,r=.5*this._data.barSpacing;if(0===s.length)return null;if(t.x<s[0].time-r)return null;if(t.x>s[s.length-1].time+r)return null;for(e=null,i=0;i<s.length;++i)if(o=s[i],t.x<=o.time+r){e=o;break}return n=N.selectionTolerance(this._barBorderWidth),e&&e.high-n<=t.y&&t.y<=e.low+n?this._data.hittest||new F(F.REGULAR):null},p.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h=!1;for(o=0;o<this.items.length;++o)n=this.items[o],s=n.x,r=n.y,TradingView.isNaN(s)||TradingView.isNaN(r)||(null!=n.style?(a=n.style.color,e=n.style.width):(a=this.lineColor,e=this.lineWidth),a!==i&&(i=a,h&&t.fill(),t.beginPath(),t.fillStyle=a),l=3*e,t.rect(s-l/2,r-e/2,l,e),t.rect(s-e/2,r-l/2,e,l),h=!0);h&&t.fill()},p.prototype.hitTest=function(t){var e,i,o,n,s,r,a=N.selectionTolerance(this.lineWidth);for(r=1;r<this.items.length;++r)if(e=this.items[r-1],i=this.items[r],o=e.x,n=i.x,s=R.distanceToSegment(new R.Point(o,e.y),new R.Point(n,i.y),new R.Point(t.x,t.y)),s.distance<=a)return new F(F.REGULAR);return null},u.prototype.draw=function(t){var e,i,o,n,s,r,a,l=2*Math.PI,h=!1;for(o=0;o<this.items.length;++o)n=this.items[o],s=n.x,r=n.y+this.vertOffset,TradingView.isNaN(s)||TradingView.isNaN(r)||(null!=n.style?(a=n.style.color,e=n.style.width):(a=this.lineColor,e=this.radius),a!==i&&(i=a,h&&t.fill(),t.beginPath(),t.fillStyle=a),t.moveTo(s+e,r),t.arc(s,r,e,0,l,!1),h=!0);h&&t.fill()},u.prototype.hitTest=function(t){var e,i,o,n=2*this.radius,s=this.vertOffset,r=N.selectionTolerance(n);for(e=0;e<this.items.length;++e)if((i=this.items[e])&&(o=new R.Point(i.x,i.y+s),o.substract(t).length()+this.radius<=r))return new F(F.REGULAR);return null},inherit(_,R.Point),f.prototype._calculateVerticalOffset=function(t){return Math.round((t||0)/4)},f.prototype._calculateMinHeight=function(t){return this.width||this._calculateWidth(t)},f.prototype._calculateWidth=function(t){var t=t||this.barSpacing;return Math.round(t/2)},f.prototype.draw=function(t){var e,i,o,n,s,r,a=this.width,l=a<4,h=Math.max(parseInt(a/2),1),c=Math.round(this.width/2),d=Math.round(this.width);for(t.translate(1,1),e=0,i=this.items.length;e<i;e++)o=this.items[e],n=o.isUp?-1:1,s=Math.abs(o.height),r=o.y-n*this.vertOffset,t.beginPath(),t.translate(o.x,r),l?(t.moveTo(0,0),t.lineTo(-c,-c*n),t.moveTo(0,0),t.lineTo(c,-c*n),t.moveTo(0,0),t.lineTo(0,-s*n),t.moveTo(-c,-s*n),t.lineTo(c,-s*n),t.lineWidth=h,t.strokeStyle=o.isUp?this.colorUp:this.colorDn,t.stroke()):(t.moveTo(0,0),s<d?(t.lineTo(a,-s*n),t.lineTo(-a,-s*n)):(t.lineTo(a,-d*n),t.lineTo(c,-d*n),t.lineTo(c,-s*n),t.lineTo(-c,-s*n),t.lineTo(-c,-d*n),t.lineTo(-a,-d*n)),t.lineTo(0,0),t.strokeStyle=this.colorBorder,t.stroke(),t.fillStyle=o.isUp?this.colorUp:this.colorDn,t.fill()),t.translate(-o.x,-r);t.translate(-1,-1)},f.prototype.hitTest=function(t){var e,i,o,n,s,r,a,l,h,c=Math.round(this.width/2),d=Math.round(this.width);for(e=0;e<this.items.length;++e)if((i=this.items[e])&&void 0!==i.x&&null!==i.x&&!TradingView.isNaN(i.x)&&void 0!==i.y&&null!==i.y&&!TradingView.isNaN(i.y)&&(o=Math.abs(i.height),n=i.isUp?-1:1,s=o+d,r=i.y-n*this.vertOffset,a=r-n*s,l=i.x-c,h=i.x+c,l<t.x&&t.x<h&&(i.isUp?r<t.y&&t.y<a:a<t.y&&t.y<r)))return new F(F.REGULAR)},m.prototype.draw=function(t){this.drawShape(t),this.drawText(t)},m.prototype.drawShape=function(t){throw Error("Not implemented")},m.prototype.drawText=function(t){var e,i,o,n,s,r;if(this._textCache)for(e=0,i=this.items.length;e<i;e++)o=this.items[e],n=o.x,s=o.y+this._vertOffset+this._textVertOffset,r=o.style&&null!=o.style.textColor?o.style.textColor:this._textColor,this._textCache.paintTo(t,r,n,s,"center",this._vertOffset>0?"top":"bottom")},m.prototype.hitTest=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f=Math.max(this.height,this.width),m=this._vertOffset,g=this._textVertOffset;for(e=e||F.REGULAR,o=0;o<this.items.length;++o)if(n=this.items[o]){if(i=new R.Point(n.x,n.y+m),i.substract(t).length()<=f)return new F(e,{});if(this._textCache&&(s=this._textImageWidth/2,r=n.y+m+g,a=m>0?0:-this._textImageHeight,l=m>0?this._textImageHeight:0,h=t.x,c=t.y,d=n.x-s,p=r+a,u=n.x+s,_=r+l,h>d&&h<u&&c>p&&c<_))return new F(e,{})}return null},inherit(g,m),g.prototype.drawShape=function(t){var e,i,o,n,s,r,a=this._vertOffset>0?1:-1;for(e=0,i=this.items.length;e<i;e++)o=this.items[e],n=o.x,s=o.y+this._vertOffset-a*Math.round(this.height/2),r=o.style&&null!=o.style.color?o.style.color:this._color,this._charCache.paintTo(t,r,n,s,"center",this._vertOffset>0?"middle":"bottom")},g.prototype.hitTest=function(t){var e,i,o,n=this._vertOffset,s=N.selectionTolerance(this.height);for(e=0;e<this.items.length;++e)if((i=this.items[e])&&(o=new R.Point(i.x,i.y+n),o.substract(t).length()<=s))return new F(F.REGULAR);return null},inherit(v,m),v.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h,c,d;for(t.lineWidth=2,e=this.width,i=this.height,o=this._vertOffset,s=!1,r=0,a=this.items.length;r<a;r++)l=this.items[r],h=l.style&&null!=l.style.color?l.style.color:this._color,h!==n&&(n=h,s&&t.stroke(),t.beginPath(),t.strokeStyle=h),c=l.x-e/2,d=l.y-i/2+o,t.moveTo(c,d),t.lineTo(c+e,d+i),t.moveTo(c,d+i),t.lineTo(c+e,d),s=!0;s&&t.stroke()},inherit(y,m),y.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h=this.width,c=this.height,d=Math.round(c/3),p=this._vertOffset-2*d,u=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(s=n.style.color,r=n.style.borderColor):(s=this._color,r=this._borderColor),s!==e&&(e=s,u&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=s,t.strokeStyle=r),a=n.x,l=n.y+p,t.moveTo(a,l),t.lineTo(a+h/2,l+c),t.lineTo(a-h/2,l+c),t.lineTo(a,l),u=!0;u&&(t.fill(),t.stroke())},inherit(b,m),b.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h=this.width,c=this.height,d=Math.round(c/3),p=this._vertOffset-d,u=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(s=n.style.color,r=n.style.borderColor):(s=this._color,r=this._borderColor),s!==e&&(e=s,u&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=s,t.strokeStyle=r),a=n.x-h/2,l=n.y+p,t.moveTo(a,l),t.lineTo(a+h,l),t.lineTo(a+h/2,l+c),t.lineTo(a,l),u=!0;u&&(t.fill(),t.stroke())},inherit(w,m),w.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l=this.width,h=this.height,c=this._vertOffset,d=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],s=n.style&&null!=n.style.color?n.style.color:this._color,s!==e&&(e=s,d&&t.fill(),t.beginPath(),t.fillStyle=s),r=n.x+l/2,a=n.y-h/2+c,t.moveTo(r,a),t.lineTo(r,a+h),t.lineTo(r-l,a+h/2),t.lineTo(r,a),d=!0;d&&t.fill()},inherit(S,m),S.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h=this.width,c=this.height,d=c/2,p=this._vertOffset,u=3,_=(h-u)/3,f=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(s=n.style.color,r=n.style.borderColor):(s=this._color,r=this._borderColor),s!==e&&(e=s,f&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=s,t.strokeStyle=r),a=n.x-h/2,l=n.y-d+p,t.moveTo(a,l),t.lineTo(a+u,l),t.bezierCurveTo(a+_,l-_,a+2*_,l+_,a+h,l),t.lineTo(a+h,l+d),t.bezierCurveTo(a+h-_,l+d+_,a+h-2*_,l+d-_,a+u,l+d),t.lineTo(a+u,l+c),t.lineTo(a,l+c),t.lineTo(a,l),f=!0;f&&(t.fill(),t.stroke())},inherit(T,m),T.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h,c,d;for(t.lineWidth=2,e=this.width,i=this.height,o=this._vertOffset,s=!1,r=0,a=this.items.length;r<a;r++)l=this.items[r],h=l.style&&null!=l.style.color?l.style.color:this._color,h!==n&&(n=h,s&&t.stroke(),t.beginPath(),t.strokeStyle=h),c=l.x-e/2,d=l.y-i/2+o,t.moveTo(c+e/2,d),t.lineTo(c+e/2,d+i),t.moveTo(c,d+i/2),t.lineTo(c+e,d+i/2),s=!0;s&&t.stroke()},inherit(C,m),C.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h=Math.max(this.width,this.height)/2,c=this._vertOffset,d=2*Math.PI,p=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(s=n.style.color,r=n.style.borderColor):(s=this._color,r=this._borderColor),s!==e&&(e=s,p&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=s,t.strokeStyle=r),a=n.x,l=n.y+c,t.moveTo(a+h,l),t.arc(a,l,h,0,d,!1),p=!0;p&&(t.fill(),t.stroke())},inherit(x,m),x.prototype._calculateWidth=function(t){return t=t||this.barSpacing,Math.round(t/4)},x.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h=!1,c=this.width,d=Math.abs(this.height),p=c<4,u=Math.max(parseInt(c/2),1),_=Math.round(this.width/2),f=Math.round(this.width),m=this._isUp?-1:1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],s=n.x,r=n.y+this._vertOffset+m*Math.round(d/2),n.style&&null!=n.style.color?(a=n.style.color,l=n.style.borderColor):(a=this._color,l=this._borderColor),a!==e&&(e=a,h&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=a,t.strokeStyle=l),t.translate(s,r),p?(t.moveTo(0,0),t.lineTo(-_,-_*m),t.moveTo(0,0),t.lineTo(_,-_*m),t.moveTo(0,0),t.lineTo(0,-d*m),t.moveTo(-_,-d*m),t.lineTo(_,-d*m),t.lineWidth=u):(t.moveTo(0,0),d<f?(t.lineTo(c,-d*m),t.lineTo(-c,-d*m)):(t.lineTo(c,-f*m),t.lineTo(_,-f*m),t.lineTo(_,-d*m),t.lineTo(-_,-d*m),t.lineTo(-_,-f*m),t.lineTo(-c,-f*m)),t.lineTo(0,0)),t.translate(-s,-r),h=!0;h&&(t.fill(),t.stroke())},inherit(P,x),inherit(L,x),inherit(k,m),k.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h=!1,c=this._isUp?1:-1,d=Math.round(this._shapeWidth/2)-.5,p=Math.round(this._shapeHeight)-.5,u=0;for(0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(u=-c*Math.round(p+this._stepY)),i=0,o=this.items.length;i<o;i++)n=this.items[i],s=n.x+.5,r=n.y+this._vertOffset+u+.5,n.style&&null!=n.style.color?(a=n.style.color,l=n.style.borderColor):(a=this._color,l=this._borderColor),a!==e&&(e=a,h&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=a,t.strokeStyle=l),t.translate(s,r),t.moveTo(0,0),t.lineTo(this._stepX,this._stepY*c),t.lineTo(d,this._stepY*c),t.lineTo(d,p*c),t.lineTo(-d,p*c),t.lineTo(-d,this._stepY*c),t.lineTo(-this._stepX,this._stepY*c),t.lineTo(0,0),t.translate(-s,-r),h=!0;h&&(t.fill(),t.stroke())},k.prototype.hitTest=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f,m=this._stepY/2,g=this._vertOffset,v=this._isUp?1:-1;for(o=0;o<this.items.length;++o)if(n=this.items[o]){if(s=v*m,0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(s=-v*(this._shapeHeight+m)),i=new R.Point(n.x,n.y+g+s),i.substract(t).length()<=m)return new F(F.REGULAR);if(r=this._shapeWidth/2,s=0,0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(s=-v*(this._shapeHeight+this._stepY)),a=n.y+g+s,l=this._isUp?this._stepY:-this._shapeHeight,h=this._isUp?this._shapeHeight:-this._stepY,c=t.x,d=t.y,p=n.x-r,u=a+l,_=n.x+r,f=a+h,c>p&&c<_&&d>u&&d<f)return new F(F.REGULAR)}return null},inherit(I,k),inherit(E,k),inherit(A,m),A.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h=!1,c=Math.round(this.height/2);for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(s=n.style.color,r=n.style.borderColor):(s=this._color,r=this._borderColor),s!==e&&(e=s,h&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=s,t.strokeStyle=r),a=n.x-c,l=n.y+this._vertOffset-c,t.rect(a,l,this.height,this.height),h=!0;h&&(t.fill(),t.stroke())},inherit(V,m),V.prototype.drawShape=function(t){var e,i,o,n,s,r,a,l,h=!1,c=Math.round(this.height/2);for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(s=n.style.color,r=n.style.borderColor):(s=this._color,r=this._borderColor),s!==e&&(e=s,h&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=s,t.strokeStyle=r),a=n.x,l=n.y+this._vertOffset,t.moveTo(a,l-c),t.lineTo(a+c,l),t.lineTo(a,l+c),t.lineTo(a-c,l),t.lineTo(a,l-c),h=!0;h&&(t.fill(),t.stroke())},M.prototype.draw=function(t){},M.prototype.drawBackground=function(t){var e,i,o;for(t.save(),"undefined"==typeof FlashCanvas&&t.translate(-.5,-.5),e=0;e<this._items.length;++e)i=this._items[e],null!=i.color&&(t.fillStyle=i.color,o=e===this._items.length-1?this._w:this._items[e+1].x-i.x,t.fillRect(i.x,this._y,o,this._h));t.restore()},M.prototype.hitTest=function(t){return null},inherit($,g),D.prototype._drawOrderArrow=function(t,e,i,o){var n,s=e.x,r=e.y;o?(t.rotate(Math.PI),s=-s-this._orderArrow.width/2,r=-r-this._orderArrow.height):(s-=this._orderArrow.width/2,r-=this._orderArrow.height),i&&(r-=i),n=o?"floor":"ceil",s=Math[n](s)+(o?-.5:.5),r=Math[n](r)+.5,t.translate(s,r),t.moveTo(.25*this._orderArrow.width,0),t.lineTo(.75*this._orderArrow.width,0),t.lineTo(.75*this._orderArrow.width,.45*this._orderArrow.height),t.lineTo(this._orderArrow.width,.45*this._orderArrow.height),t.lineTo(.5*this._orderArrow.width,this._orderArrow.height),i&&(t.lineTo(this._orderArrow.width,this._orderArrow.height),t.lineTo(this._orderArrow.width,this._orderArrow.height+i),t.lineTo(0,this._orderArrow.height+i),t.lineTo(0,this._orderArrow.height),t.lineTo(.5*this._orderArrow.width,this._orderArrow.height)),t.lineTo(0,.45*this._orderArrow.height),t.lineTo(.25*this._orderArrow.width,.45*this._orderArrow.height)},D.prototype._drawPriceArrow=function(t,e,i){var o=e.x,n=e.y;i?(t.rotate(Math.PI),o=-o-this._priceArrow.width,n=-n-this._priceArrow.height/2):(o-=this._priceArrow.width,n-=this._priceArrow.height/2),o=Math.round(o)+(i?-1.5:.5),n=Math.floor(n)+.5,t.translate(o,n),t.moveTo(0,0),t.lineTo(this._priceArrow.width,.5*this._priceArrow.height),t.lineTo(0,this._priceArrow.height)},D.prototype.draw=function(t){t.beginPath();for(var e,i,o=0;o<this._items.length;o++)e=this._items[o],i="lower"===e.pos,t.save(),t.translate(0,i?this._orderArrow.vMargin:-this._orderArrow.vMargin),this._drawOrderArrow(t,e.orderPoint,this._exitLineWidth,i),t.restore(),t.save(),this._drawPriceArrow(t,e.pricePoint,!i),t.restore();if(t.closePath(),t.fillStyle=this._color,t.fill(),this._text)for(t.font=this._text.fontSize+"px "+this._text.font,t.textAlign="center",t.textBaseline="top",o=0;o<this._items.length;o++)e=this._items[o],i="lower"===e.pos,t.save(),t.translate(0,i?this._orderArrow.vMargin:-this._orderArrow.height-this._orderArrow.vMargin),e.label&&(t.translate(0,i?this._text.fontSize+this._text.vMargin+this._exitLineWidth:-this._text.fontSize-this._text.vMargin-this._exitLineWidth),t.fillText(e.label,Math.ceil(e.orderPoint.x),e.orderPoint.y),"number"!=typeof this._textWidths[e.label]&&(this._textWidths[e.label]=t.measureText(e.label).width)),e.qty&&(t.translate(0,i?this._text.fontSize+this._text.vMargin+this._exitLineWidth:-this._text.fontSize-this._text.vMargin-this._exitLineWidth),t.fillText(e.qty,Math.ceil(e.orderPoint.x),e.orderPoint.y),"number"!=typeof this._textWidths[e.qty]&&(this._textWidths[e.qty]=t.measureText(e.qty).width)),t.restore()},D.prototype._testOrderArrows=function(t){for(var e,i,o,n,s,r,a,l=0,h=this._orderArrow.width/2;l<this._items.length;l++)if(e=this._items[l].orderPoint,!(t.x<e.x-h||t.x>e.x+h||(i=this._items[l],o="lower"===i.pos,n=this._orderArrow.height+this._exitLineWidth,o||(n=-n),s=e.y+(o?this._orderArrow.vMargin:-this._orderArrow.vMargin),r=Math.min(s,s+n),a=Math.max(s,s+n),t.y<r||t.y>a)))return!0;return!1},D.prototype._testText=function(t){for(var e,i,o,n,s,r,a,l,h,c,d,p=0;p<this._items.length;p++)if(e=this._items[p],i=e.orderPoint,o="lower"===e.pos,n=this._orderArrow.vMargin+this._orderArrow.height+this._exitLineWidth,o||(n=-n),s=i.y+n,r=this._text.vMargin+this._text.fontSize*(!!e.label+!!e.qty),o||(r=-r),a=Math.min(s,s+r),l=Math.max(s,s+r),!(t.y<a||t.y>l||(h=e.label&&e.qty?o&&t.y<s+this._text.fontSize||!o&&t.y>s-this._text.fontSize?e.label:e.qty:e.label||e.qty,c=this._textWidths[h],d=c&&c/2,!c||t.x<i.x-d||t.x>i.x+d)))return!0;return!1},D.prototype.hitTest=function(t){var e=this._testOrderArrows(t),i=!e&&this._text&&this._testText(t);if(e||i)return new F(F.REGULAR)},O.prototype.draw=function(t){var e,i,o,n,s,r=this.data.vertLinesVisible,a=this.data.horzLinesVisible;(r||a)&&this.data&&(t.lineStyle=this.data.lineStyle,t.lineWidth=this.data.lineWidth,t.strokeStyle=this.data.color,e=this.data.lineWidth%2==0?.5:0,i=this.data.x+1+e,o=this.data.y+e,n=this.data.w,s=this.data.h,r&&i>=0&&CanvasEx.drawLine(t,i,0,i,s),a&&o>=0&&CanvasEx.drawLine(t,0,o,n,o),this.data.drawCenter&&(t.beginPath(),t.arc(i,o,3,0,2*Math.PI,!0),t.fillStyle=this.data.color,t.fill()))},B.prototype._drawShackle=function(t){var e=this._data.width-3,i=e/2,o=this._data.height-this._data.bodyHeight;t.moveTo(1.5,i),t.arc(this._data.width/2,i,i,Math.PI,2*Math.PI),o>i&&(t.moveTo(1.5,i),t.lineTo(1.5,o),t.moveTo(this._data.width-1.5,i),t.lineTo(this._data.width-1.5,o))},B.prototype.draw=function(t){var e,i,o,n;t.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),e="rgba(153,153,153,.3)",i="rgba(153,153,153,.7)",o="#777",n="rgba(255,255,255,.7)",t.strokeStyle=e,t.lineWidth=2,t.beginPath(),this._drawShackle(t),t.stroke(),t.closePath(),t.strokeStyle=i,t.lineWidth=1,t.beginPath(),t.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),t.closePath(),t.stroke(),t.translate(0,-1),t.strokeStyle=o,t.beginPath(),this._drawShackle(t),t.stroke(),t.closePath(),t.fillStyle=n,t.beginPath(),t.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),t.fill(),t.beginPath(),t.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),t.stroke(),t.closePath(),t.fillStyle=o,t.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)},e.PaneRendererBars=TradingView.PaneRendererBars=o,e.PaneRendererRenkoPB=TradingView.PaneRendererRenkoPB=n,e.PaneRendererKagi=TradingView.PaneRendererKagi=s,e.PaneRendererPnF=TradingView.PaneRendererPnF=r,e.PaneRendererHistogram=TradingView.PaneRendererHistogram=a,e.PaneRendererColumns=TradingView.PaneRendererColumns=l,e.PaneRendererLine=TradingView.PaneRendererLine=h,e.PaneRendererArea=TradingView.PaneRendererArea=c,e.PaneRendererCandles=TradingView.PaneRendererCandles=d,e.PaneRendererCross=TradingView.PaneRendererCross=p,e.PaneRendererCircles=TradingView.PaneRendererCircles=u,e.PaneRendererCrossShape=TradingView.PaneRendererCrossShape=T,e.PaneRendererCrossHair=TradingView.PaneRendererCrossHair=O,e.PaneRendererCrossHairLock=TradingView.PaneRendererCrossHairLock=B,e.PaneRendererArrowsUpDownItem=TradingView.PaneRendererArrowsUpDownItem=_,e.PaneRendererArrowsUpDown=TradingView.PaneRendererArrowsUpDown=f,e.PaneRendererAbstractShape=TradingView.PaneRendererAbstractShape=m,e.PaneRendererUnicodeChar=TradingView.PaneRendererUnicodeChar=g,e.PaneRendererXCross=TradingView.PaneRendererXCross=v,e.PaneRendererTriangleApexUp=TradingView.PaneRendererTriangleApexUp=y,e.PaneRendererTriangleApexDown=TradingView.PaneRendererTriangleApexDown=b,e.PaneRendererTriangleApexLeft=TradingView.PaneRendererTriangleApexLeft=w,e.PaneRendererFlagShape=TradingView.PaneRendererFlagShape=S,e.PaneRendererCircleShape=TradingView.PaneRendererCircleShape=C,e.PaneRendererArrowsBase=TradingView.PaneRendererArrowsBase=x,e.PaneRendererArrowUp=TradingView.PaneRendererArrowUp=P,e.PaneRendererArrowDown=TradingView.PaneRendererArrowDown=L,e.PaneRendererLabelsBase=TradingView.PaneRendererLabelsBase=k,e.PaneRendererLabelUp=TradingView.PaneRendererLabelUp=I,e.PaneRendererLabelDown=TradingView.PaneRendererLabelDown=E,e.PaneRendererSquare=TradingView.PaneRendererSquare=A,e.PaneRendererDiamond=TradingView.PaneRendererDiamond=V,e.PaneRendererBackground=TradingView.PaneRendererBackground=M,e.PaneRendererClockIcon=TradingView.PaneRendererClockIcon=$,e.PaneRendererStudyStrategyOrders=TradingView.PaneRendererStudyStrategyOrders=D},function(t,e){"use strict";e.optimalBarWidth=function(t){return.3*t},e.selectionTolerance=function(t){return 2+.5*t},e.paneRendererCoordinateIsValid=function(t){return null!==t&&void 0!==t&&!TradingView.isNaN(t)}},function(t,e){"use strict";function i(t,e,i,o,n){var s,r,a,l,h;for(this._canvasesMap={},this._lines=t.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=this._fontStyle(e,i,o,n),this._fontSize=n,s=$("<canvas>"),r=s.get(0).getContext("2d"),r.font=this._font,a=0,l=0;l<this._lines.length;l++)h=r.measureText(this._lines[l]).width,a=Math.max(a,h);this.textImageWidth=a+1,this.textImageHeight=this._lines.length*n}i.prototype.paintTo=function(t,e,i,o,n,s){var r=this._getTextImage(e),a=this._x(i,n,this.textImageWidth),l=this._y(o,s,this.textImageHeight);t.drawImage(r,a-.5,l-.5)},i.prototype._getTextImage=function(t){var e,i,o,n,s;if(this._canvasesMap[t])return this._canvasesMap[t].get(0);for(e=$("<canvas>").attr("width",this.textImageWidth).attr("height",this.textImageHeight),i=e.get(0).getContext("2d"),i.textBaseline="top",i.font=this._font,i.textAlign="center",i.fillStyle=t,o=Math.round(this.textImageWidth/2),n=0,s=0;s<this._lines.length;s++)i.fillText(this._lines[s],o,n),n+=this._fontSize;return this._canvasesMap[t]=e,e.get(0)},i.prototype._x=function(t,e,i){var o=t;switch(e){case"left":break;case"right":o-=i;break;case"center":o-=i/2}return Math.round(o)},i.prototype._y=function(t,e,i){var o=t;switch(e){case"top":break;case"bottom":o-=i;break;case"middle":o-=i/2}return Math.round(o)},i.prototype._fontStyle=function(t,e,i,o){return(t?"bold ":"")+(e?"italic ":"")+o+"px "+i},t.exports=i},function(t,e){"use strict";function i(){this._renderers=[],this._globalAlpha=1}i.prototype.setGlobalAlpha=function(t){this._globalAlpha=t},i.prototype.append=function(t){this._renderers.push(t)},i.prototype.insert=function(t,e){this._renderers.splice(e,0,t)},i.prototype.draw=function(t){for(var e=0;e<this._renderers.length;e++)t.save(),t.globalAlpha=this._globalAlpha,this._renderers[e].draw(t),t.restore()},i.prototype.drawBackground=function(t){t.save(),t.globalAlpha=this._globalAlpha;for(var e=0;e<this._renderers.length;e++)this._renderers[e].drawBackground&&this._renderers[e].drawBackground(t);t.restore()},i.prototype.hitTest=function(t){var e,i,o=null;for(e=this._renderers.length-1;e>=0;e--)(i=this._renderers[e].hitTest(t))&&(null==o||i.result()>o.result())&&(o=i);return o},t.exports=i},function(t,e){"use strict";t.exports=function(t,e){var i,o=10,n=t%o;for(n&&(t=t-n+o),i=[];t<=e;t+=o)i.push(t);return i}},,function(t,e){"use strict";function i(t,e){return null===t||TradingView.isInteger(t)?null===e||TradingView.isInteger(e)?(this.m_firstBar=t,void(this.m_lastBar=e)):void TradingView.logDebugChart("BarsRange: incorrect lastBar"):void TradingView.logDebugChart("BarsRange: incorrect firstBar")}i.prototype.isEmpty=function(){return null===this.m_firstBar||null===this.m_lastBar||void 0===this.m_firstBar||void 0===this.m_lastBar},i.prototype.clone=function(){return new i(this.m_firstBar,this.m_lastBar)},i.prototype.firstBar=function(){return this.m_firstBar},i.prototype.lastBar=function(){return this.m_lastBar},i.prototype.count=function(){return this.m_lastBar-this.m_firstBar+1},i.prototype.resizeRight=function(t){if(!TradingView.isInteger(t)||t<0)return void TradingView.logDebugChart("BarsRange: incorrect newWidth");this.m_firstBar=this.m_lastBar-t+1},i.prototype.shift=function(t){if(!isNumber(t))return void TradingView.logDebugChart("BarsRange.shift: incorrect coeff");this.m_firstBar=Math.round(this.m_firstBar+t),this.m_lastBar=Math.round(this.m_lastBar+t)},i.prototype.contains=function(t){return this.m_firstBar<=t&&this.m_lastBar>=t},t.exports=i},function(t,e){"use strict";function i(){this.backColorers=[]}function o(t){i.call(this),this._series=t}function n(t,e){i.call(this),this._study=t,this._plotIndex=e}i.prototype.barStyle=function(t,e,i){var o,n={};for(o=this.backColorers.length-1;o>=0;o--)this.backColorers[o].applyBarStyle(t,e,n,i);return this.applyBarStyle(t,e,n,i),n},i.prototype.pushBackBarColorer=function(t){this.backColorers.push(t)},i.prototype.applyBarStyle=function(t,e,i){throw Error("This function is supposed to be reimplemented in a subclass")},inherit(o,i),o.prototype.applyBarStyle=function(t,e,i,o){var n,s,r,a,l,h,c,d,p,u,_;switch(i||(i={}),i.barColor=null,i.barBorderColor=null,i.barWickColor=null,i.isBarHollow=null,i.isBarUp=null,i.upColor=null,i.downColor=null,i.isTwoColorBar=null,n=this._series.properties(),n.style.value()){case TradingView.Series.STYLE_LINE:i.barColor=n.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:i.barColor=n.areaStyle.linecolor.value();break;case TradingView.Series.STYLE_BARS:s=n.barStyle.upColor.value(),r=n.barStyle.downColor.value(),a=s,l=r,h=this.findBar(t,!1,o),n.barStyle.barColorsOnPrevClose.value()?(c=this.findPrevBar(t,!1,o),i.barColor=c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]?s:r,i.barBorderColor=c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]?a:l):(i.barColor=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?s:r,i.barBorderColor=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?a:l);break;case TradingView.Series.STYLE_CANDLES:s=n.candleStyle.upColor.value(),r=n.candleStyle.downColor.value(),a=n.candleStyle.borderUpColor?n.candleStyle.borderUpColor.value():n.candleStyle.borderColor.value(),l=n.candleStyle.borderDownColor?n.candleStyle.borderDownColor.value():n.candleStyle.borderColor.value(),d=n.candleStyle.wickUpColor?n.candleStyle.wickUpColor.value():n.candleStyle.wickColor.value(),p=n.candleStyle.wickDownColor?n.candleStyle.wickDownColor.value():n.candleStyle.wickColor.value(),h=this.findBar(t,!1,o),n.candleStyle.barColorsOnPrevClose.value()?(c=this.findPrevBar(t,!1,o),u=c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]):u=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],i.barColor=u?s:r,i.barBorderColor=u?a:l,i.barWickColor=u?d:p;break;case TradingView.Series.STYLE_HOLLOW_CANDLES:s=n.hollowCandleStyle.upColor.value(),r=n.hollowCandleStyle.downColor.value(),a=n.hollowCandleStyle.borderUpColor?n.hollowCandleStyle.borderUpColor.value():n.hollowCandleStyle.borderColor.value(),l=n.hollowCandleStyle.borderDownColor?n.hollowCandleStyle.borderDownColor.value():n.hollowCandleStyle.borderColor.value(),d=n.hollowCandleStyle.wickUpColor?n.hollowCandleStyle.wickUpColor.value():n.hollowCandleStyle.wickColor.value(),p=n.hollowCandleStyle.wickDownColor?n.hollowCandleStyle.wickDownColor.value():n.hollowCandleStyle.wickColor.value(),h=this.findBar(t,!1,o),c=this.findPrevBar(t,!1,o),c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]?(i.barColor=s,i.barBorderColor=a,i.barWickColor=d):(i.barColor=r,i.barBorderColor=l,i.barWickColor=p),h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?i.isBarHollow=!0:i.isBarHollow=!1;break;case TradingView.Series.STYLE_HEIKEN_ASHI:s=n.haStyle.upColor.value(),r=n.haStyle.downColor.value(),a=n.haStyle.borderUpColor.value(),l=n.haStyle.borderDownColor.value(),d=n.haStyle.wickUpColor.value(),p=n.haStyle.wickDownColor.value(),h=this.findBar(t,e,o),n.haStyle.barColorsOnPrevClose.value()?(c=this.findPrevBar(t,e,o),u=c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]):u=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],i.barColor=u?s:r,i.barBorderColor=u?a:l,i.barWickColor=u?d:p;break;case TradingView.Series.STYLE_RENKO:h=this.findBar(t,e,o),u=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],s=e?n.renkoStyle.upColorProjection.value():n.renkoStyle.upColor.value(),r=e?n.renkoStyle.downColorProjection.value():n.renkoStyle.downColor.value(),a=e?n.renkoStyle.borderUpColorProjection.value():n.renkoStyle.borderUpColor.value(),l=e?n.renkoStyle.borderDownColorProjection.value():n.renkoStyle.borderDownColor.value(),i.barColor=u?s:r,i.barBorderColor=u?a:l,i.isBarUp=u;break;case TradingView.Series.STYLE_PB:h=this.findBar(t,e,o),u=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],s=e?n.pbStyle.upColorProjection.value():n.pbStyle.upColor.value(),r=e?n.pbStyle.downColorProjection.value():n.pbStyle.downColor.value(),a=e?n.pbStyle.borderUpColorProjection.value():n.pbStyle.borderUpColor.value(),l=e?n.pbStyle.borderDownColorProjection.value():n.pbStyle.borderDownColor.value(),i.barColor=u?s:r,i.barBorderColor=u?a:l,i.isBarUp=u;break;case TradingView.Series.STYLE_KAGI:i.upColor=e?n.kagiStyle.upColorProjection.value():n.kagiStyle.upColor.value(),i.downColor=e?n.kagiStyle.downColorProjection.value():n.kagiStyle.downColor.value(),_=null,h=this.findBar(t,e,o),h[TradingView.LOW_PLOT]<h[TradingView.ADT_PLOT]&&h[TradingView.ADT_PLOT]<h[TradingView.HIGH_PLOT]?(_=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],i.isTwoColorBar=!0):(_=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?h[TradingView.OPEN_PLOT]===h[TradingView.ADT_PLOT]:h[TradingView.OPEN_PLOT]!==h[TradingView.ADT_PLOT],i.isTwoColorBar=!1),i.barColor=_?i.upColor:i.downColor,i.isBarUp=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT];break;case TradingView.Series.STYLE_PNF:h=this.findBar(t,e,o),u=h[TradingView.ADT_PLOT]>0,s=e?n.pnfStyle.upColorProjection.value():n.pnfStyle.upColor.value(),r=e?n.pnfStyle.downColorProjection.value():n.pnfStyle.downColor.value(),i.isBarUp=u,i.barColor=u?s:r}return i},o.prototype.getSeriesBars=function(t){return t?this._series.nsBars():this._series.bars()},o.prototype._findBarFieldValue=function(t,e,i){var o=this.getSeriesBars(i).valueAt(t);if(void 0!==o)return o[e]},o.prototype.findBar=function(t,e,i){return i?i.value:this.getSeriesBars(e).valueAt(t)||[]},o.prototype.findPrevBar=function(t,e,i){var o,n;return i&&i.previousValue?i.previousValue:(o=this._series.bars(),n=o._search(t,TradingView.SEARCH_EXACT),n>0?this._series.bars()._valueAt(n-1):[])},inherit(n,i),n.prototype.applyBarStyle=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f;return i||(i={}),e?i:(o=this._study.properties(),o.visible.value()?(n=this._study.metaInfo(),(s=this._study.data())&&0!==s.size()?(r=n.plots[this._plotIndex],a=o.styles[r.id],a.visible&&!a.visible.value()?i:(l=this._study.offset(r.id),(h=s.valueAt(t-l))?null==(c=h[this._plotIndex+1])?i:(c=Math.round(c),d=n.plots[this._plotIndex].palette,p=o.palettes,u=p[d],_=n.palettes[d].valToIndex?n.palettes[d].valToIndex[c]:c,f=u.colors[_].color.value(),i.barColor=f,i.upColor=f.color,i.downColor=f.color,i):i)):i):i)},e.SeriesBarColorer=o,e.StudyBarColorer=n},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){h.call(this,t,e),this._rendererCache={}}function s(t,e){this._source=t,this._model=e,this._text="",this._coordinate=0,this._background="black",this._color="white",this._invaildated=!0}function r(t,e){this._constructor="LineToolHorzLine";var i=e||new f("linetoolhorzline");this._priceAxisView=new s(this,t),l.call(this,t,new n(this,t),i)}var a=i(30),l=i(82).LineDataSource,h=i(123),c=i(84),d=i(86),p=i(124).TextRenderer,u=i(113),_=i(117),f=i(91).DefaultProperty;o.prototype.draw=function(t){var e,i;if(0===this._data.points.length)return null;this._data.visible!==!1&&(e=this._data.points[0].y,i=t.canvas.width,t.lineCap="square",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,CanvasEx.drawLine(t,0,e,i,e))},o.prototype.hitTest=function(t){return this._data.visible===!1?null:0===this._data.points.length?null:Math.abs(t.y-this._data.points[0].y)<=3?new u(this._data.hitTestResult):null},inherit(n,h),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){h.prototype.update.call(this)},n.prototype.renderer=function(){var t,e,i,n,s,r,l,h,c,d,f;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,e={},e.points=this._points,e.color=this._source.properties().linecolor.value(),e.linewidth=this._source.properties().linewidth.value(),e.linestyle=this._source.properties().linestyle.value(),e.hitTestResult=u.MOVEPOINT,i=this._source.properties(),t.append(new o(e)),this._source.properties().showLabel.value()&&1===this._points.length&&(n=i.vertLabelsAlign.value(),s=i.horzLabelsAlign.value(),r=this._points[0],l=0,h=0,"left"===s?r.x=3:"right"===s?(r.x=this._model.timeScale().width(),h=-5):r.x=this._model.timeScale().width()/2,"middle"===n?l=-this._source.properties().fontsize.value()/6:"bottom"===n&&(l=-4),c={points:[r],text:i.text.value(),color:i.textcolor.value(),vertAlign:n,horzAlign:s,font:i.font.value(),offsetX:h,offsetY:l,bold:this._source.properties().bold.value(),italic:this._source.properties().italic.value(),fontsize:this._source.properties().fontsize.value()},t.append(new p(c,this._rendererCache))),1===this._points.length&&this.isAnchorsRequired()&&(d=new a.Point(this._model.timeScale().width()/2,this._points[0].y),d.data=0,t.append(this.createLineAnchor({points:[d]}))),TradingView.printing||!this._source.hasAlert.value()||this._model.readOnly()||1!==this._points.length||(f=new a.Point(this._model.timeScale().width()/2,this._points[0].y),this._source.getAlertIsActive(function(i){t.append(new TradingView.PaneRendererClockIcon({point1:f,color:i?e.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))})),t},inherit(s,c),s.prototype.update=function(){this._invaildated=!0},s.prototype.updateImpl=function(){var t,e,i;if(0!==this._source.points().length&&this._source.priceScale()&&!this._source.priceScale().isEmpty()){if(t=this._source.properties().linecolor.value(),t!==this._background&&(this._background=t,this._color=this.color()),e=this._source.points()[0].price,this._source.priceScale().isPercent()){if(null===(i=this._source.ownerSource().firstValue()))return;e=this._source.priceScale().priceRange().convertToPercent(e,i)}this._floatCoordinate=this._source.priceScale().priceToCoordinate(e,!0),this._coordinate=Math.round(this._floatCoordinate),this._source.priceScale().formatter()&&(this._text=this._source.priceScale().formatter().format(e))}},s.prototype.renderer=function(){return this._invaildated&&(this.updateImpl(),this._invaildated=!1),new d({text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,visible:!0})},s.prototype.coordinate=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),c.prototype.coordinate.call(this)},inherit(r,l),r.prototype.state=function(t){var e=l.prototype.state.call(this,t);return e.points&&0!==e.points.length&&(e.points[0].offset=0),e},r.prototype.pointsCount=function(){return 1},r.prototype.title=function(){return"Horizontal Line"},r.prototype.priceAxisViews=function(t,e){return this.isActualSymbol()&&e===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===t?[this._priceAxisView]:null},r.prototype.updateAllViews=function(){l.prototype.updateAllViews.call(this),this._priceAxisView.update()},r.prototype.canHasAlert=function(){return!0},r.prototype._getAlertPlots=function(){return[this.points()[0].price]},e.HorzLineRenderer=o,e.LineToolHorzLine=r},function(t,e,i){"use strict";function o(t,e){this._source=t,this._model=e,this._points=[],this._floatPoints=[]}var n=i(30),s=i(113),r=i(112).LineAnchor;o.prototype.priceToCoordinate=function(t){var e,i=this._source.priceScale();return i.isPercent()&&(e=this._source.ownerSource().firstValue(),t=i.priceRange().convertToPercent(t,e)),i.priceToCoordinate(t)},o.prototype.addAnchors=function(t){if(this.isAnchorsRequired()){var e=this._points;this._model.lineBeingCreated()===this._source&&(e=e.slice(0,-1)),t.append(this.createLineAnchor({points:e}))}},o.prototype.update=function(){var t,e,i,o,n,s,r,a;if(this._points=[],t=this._source.priceScale(),e=this._model.timeScale(),t&&!t.isEmpty()&&!e.isEmpty())for(this._floatPoints=[],i=this._source.points(),o=0;o<i.length;o++){if(n=i[o],!(s=this._source.pointToScreenPoint(n)))return;r=s[0],r.data=o,a=s[1],a.data=o,this._floatPoints.push(r),this._points.push(a)}},o.prototype.currentPoint=function(){var t=this._model.crossHairSource();return new n.Point(t.x,t.y)},o.prototype.anchorColor=function(){return this._source.isBeingEdited()?"#D61AD3":this._model.isDark()?"#FFFFFF":"#606060"},o.prototype.isHoveredSource=function(){return this._source===this._model.hoveredSource()},o.prototype.isSelectedSource=function(){return this._source===this._model.selectedSource()},o.prototype.isAnchorsRequired=function(){return(this.isHoveredSource()||this.isSelectedSource())&&!this._model.isSnapshot()},o.prototype.createLineAnchor=function(t){return new r($.extend({color:this.anchorColor(),backgroundColor:this._model.backgroundColor(),currentPoint:this.currentPoint(),linePointBeingEdited:this._model.linePointBeingEdited(),hittestResult:s.CHANGEPOINT,radius:(TradingView.isMobile.any()?15:7)+(this.isSelectedSource()?1:0),strokeWidth:(TradingView.isMobile.any()?3:1)+(this.isSelectedSource()?1:0)},t))},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this._textSizeCache=e,this._data=t,this._fontSize=t.fontsize?t.fontsize:t.fontSize?t.fontSize:20,t.lines=this._lines=this.wordWrap(t.text,t.wordWrapWidth),this._hittest=i||new d(d.MOVEPOINT)}function n(t,e,i,o,n,s){l.call(this,t,e),this._offsetX=i,this._offsetY=o,this._vertAlign=n,this._horzAlign=s,this._rendererCache={},this._renderer=null,this._invalidated=!0}function s(t,e){this._constructor="LineToolText";var i=e||new u("linetooltext");h.call(this,t,new n(this,t),i),this._timeScale=t.timeScale(),this._barSpacing=t.timeScale().barSpacing()}function r(t,e){var i=e||new u("linetooltextabsolute");i.locked.value()||i.locked.setValue(!0),s.call(this,t,i)}var a=i(30),l=i(123),h=i(82).LineDataSource,c=i(89).DataSource,d=i(113),p=i(117),u=i(91).DefaultProperty;!function(){function t(){var t=document.createElement("canvas");t.width=0,t.height=0,e=t.getContext("2d"),t=null}var e;o.prototype.setPoints=function(t,e){this._data.points=t,this._hittest=e||new d(d.MOVEPOINT)},o.prototype._calcLinesWidths=function(){var i,o,n,s;if(e||t(),e.textBaseline="alphabetic",e.font=this.fontStyle(),i=[],this._data.wordWrapWidth)for(o=this._data.wordWrapWidth,n=0;n<this._lines.length;n++)i.push(this._data.wordWrapWidth);else for(o=0,n=0;n<this._lines.length;n++)s=e.measureText(this._lines[n]).width,i.push(s),o=Math.max(o,s);return{widths:i,maxWidth:o}},o.prototype.measure=function(){var t=this._fontSize,e=this._calcLinesWidths().maxWidth,i=t*this._lines.length,o=~~(t/6);return this._data.backgroundHorzInflate&&(e+=2*this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(i+=2*this._data.backgroundVertInflate),e=Math.ceil(e+2*o),i=Math.ceil(i+2*o),e%2!=0&&e++,this._data.padding&&(i+=this._data.padding),{width:e,height:i,textBgPadding:o}},o.prototype.wordWrap=function(i,o,n){var s,r,a,l,h,c,d,p,u;if(e||t(),o=+o,i+="",s=i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/),s[s.length-1]||s.pop(),!isFinite(o)||o<=0)return s;for(e.font=n||this.fontStyle(),r=[],a=0;a<s.length;a++)if(l=s[a],(h=e.measureText(l).width)<=o)r.push(l);else for(c=l.split(/([-\)\]\},.!?:;])|(\s+)/);c.length;){if((d=~~(o/h*(c.length+2)/3))<=0||e.measureText(c.slice(0,3*d-1).join("")).width<=o)for(;e.measureText(c.slice(0,3*(d+1)-1).join("")).width<=o;)d++;else for(;d>0&&e.measureText(c.slice(0,3*--d-1).join("")).width>o;);if(d>0)r.push(c.slice(0,3*d-1).join("")),c.splice(0,3*d);else{if(p=c[0]+(c[1]||""),u=1===u?1:~~(o/e.measureText(p)*p.length),e.measureText(p.substr(0,u)).width<=o)for(;e.measureText(p.substr(0,u+1)).width<=o;)u++;else for(;u>1&&e.measureText(p.substr(0,--u)).width>o;);u<1&&(u=1),r.push(p.substr(0,u)),c[0]=p.substr(u),c[1]=""}if((h=e.measureText(c.join("")).width)<=o){r.push(c.join(""));break}}return r}}(),o.prototype._x=function(){return this._data.points[0].x+this._data.offsetX},o.prototype._y=function(){var t,e=this._fontSize*this._lines.length;switch(this._data.scaleY&&(e*=this._data.scaleY),t=this._data.points[0].y+this._data.offsetY+e,this._data.vertAlign){case"top":break;case"bottom":t-=e;break;case"middle":t-=e/2}return t},o.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m;if(0!==this._data.points.length){switch(e=this._x(),i=this._y(),o=this._fontSize,this._data.scaleY&&(o*=this._data.scaleY),i-=o*(this._lines.length-1),t.textBaseline="alphabetic",t.font=this.fontStyle(),this._data.horzAlign){case"left":t.textAlign="start";break;case"right":t.textAlign="end";break;case"center":t.textAlign="center"}if(t.translate(e+.5,i+.5),e=0,i=0,o=this._fontSize,this._data.scaleX&&this._data.scaleY&&(n=Math.min(this._data.scaleX,this._data.scaleY),t.scale(n,n)),s=this._calcLinesWidths(),r=s.maxWidth,a=0,this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){switch(l=e,this._data.horzAlign){case"left":break;case"right":l-=r;break;case"center":l-=r/2}h=o*this._lines.length,c=~~(o/6),this._data.backgroundHorzInflate&&(r+=2*this._data.backgroundHorzInflate,l-=this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(h+=2*this._data.backgroundVertInflate,i+=this._data.backgroundVertInflate),d={x:Math.floor(l-c),y:Math.floor(i-o),w:Math.ceil(r+2*c),h:Math.ceil(h+2*c)},d.w%2!=0&&d.w++,this._data.padding&&(d.h+=this._data.padding,a=this._data.padding),this._data.backgroundVertInflate&&(i+=this._data.backgroundVertInflate),this._data.backgroundRoundRect?(t.roundRect(d.x,d.y,d.w,d.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.fill()),this._data.borderColor&&(p=~~Math.max(o/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=p,t.stroke())):(this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.fillRect(d.x,d.y,d.w,d.h)),this._data.borderColor?(p=~~Math.max(o/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=p,t.strokeRect(d.x-p/2,d.y-p/2,d.w+p,d.h+p)):this._data.highlightBorder&&(t.strokeStyle=this._data.color,t.lineWidth=1,t.beginPath(),f=[3,1],t.dashedLineTo(d.x-.5,_=d.y-.5,u=d.x+d.w+.5,_,f),t.dashedLineTo(u,_,u,_=d.y+d.h+.5,f),t.dashedLineTo(u=d.x-.5,_,d.x+d.w+.5,_,f),t.dashedLineTo(u,d.y-.5,u,_,f),t.stroke()))}for(this._data.backgroundVertInflate&&!this._data.backgroundColor&&(i+=2*this._data.backgroundVertInflate),t.fillStyle=this._data.color,m=0;m<this._lines.length;m++)t.fillText(this._lines[m],e,i),i+=o+a;this._textSizeCache&&(this._textSizeCache.widths=s.widths)}},o.prototype.hitTest=function(t){var e,i,o,n,s,r,a,l;if(0===this._data.points.length)return null;if(e=this._fontSize,this._data.scaleY&&(e*=this._data.scaleY),!(i=this._textSizeCache.widths))return null;for(o=0,n=0;n<i.length;n++)o=Math.max(o,i[n]);return this._data.scaleX&&(o*=this._data.scaleX),s=this._data.points[0].x+this._data.offsetX,r=this._data.points[0].y+this._data.offsetY,"bottom"===this._data.vertAlign&&(r-=this._lines.length*this._fontSize),"middle"===this._data.vertAlign&&(r-=this._lines.length*this._fontSize/2),"right"===this._data.horzAlign?s-=o:"center"===this._data.horzAlign&&(s-=o/2),a=this._data.backgroundColor||this._data.borderColor?~~(e/6):0,l=this._data.borderColor?~~Math.max(e/12,1):0,t.x>=s-a-l&&t.x<=s+o+a+l&&t.y>=r-l&&t.y<=r+this._lines.length*this._fontSize+2*a+l?this._hittest:null},inherit(n,l),n.prototype.update=function(){this._renderer=null,this._invalidated=!0},n.prototype.updateImpl=function(){l.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,n,s,r,l,h,c,d,u,_;return this._invalidated&&this.updateImpl(),this._renderer?this._renderer:!(t=this._source.priceScale())||t.isEmpty()?(this._renderer=new p,this._renderer):(e={},i=this._source.properties(),n=i.locked&&i.locked.value(),e.points=n?this._source.fixedPoints():this._points,e.text=i.text.value(),e.color=i.color.value(),e.font=i.font.value(),e.offsetX=this._offsetX?this._offsetX:0,e.offsetY=this._offsetY?this._offsetY:0,e.vertAlign=this._vertAlign?this._vertAlign:"top",e.horzAlign=this._horzAlign?this._horzAlign:"left",e.fontsize=i.fontsize.value(),i.fillBackground&&i.fillBackground.value()&&(e.backgroundColor=i.backgroundColor.value(),e.backgroundTransparency=1-i.backgroundTransparency.value()/100||0),i.drawBorder&&i.drawBorder.value()&&(e.borderColor=i.borderColor.value()),i.wordWrap&&i.wordWrap.value()&&(e.wordWrapWidth=i.wordWrapWidth.value()),e.bold=i.bold&&i.bold.value(),e.italic=i.italic&&i.italic.value(),e.highlightBorder=this._model.selectedSource()===this._source,n||!i.fixedSize||i.fixedSize.value()||(e.scaleX=this._source._model.timeScale().barSpacing()/this._source._barSpacing,s=t.height()/t.priceRange().length(),this._source._isPriceDencityLog&&!t.isLog()&&(r=t.priceRange().minValue(),l=t.priceRange().maxValue(),r=t._toLog(r),l=t._toLog(l),h=l-r,s=t.height()/h),!this._source._isPriceDencityLog&&t.isLog()&&(r=t.priceRange().minValue(),l=t.priceRange().maxValue(),r=t._fromLog(r),l=t._fromLog(l),h=l-r,s=t.height()/h),e.scaleY=s/this._source._priceDencity,(!isFinite(e.scaleY)||e.scaleY<=0)&&delete e.scaleY),c=new o(e,this._rendererCache),this.isAnchorsRequired()&&1===e.points.length&&!this._noSelection?(d=e.points[0],u=new p,u.append(c),e.wordWrapWidth&&(_=new a.Point(d.x+e.wordWrapWidth+~~(e.fontsize/6),d.y+(e.lines?e.lines.length*e.fontsize/2+~~(e.fontsize/6):0)),_.data=0,u.append(this.createLineAnchor({points:[_]}))),this._renderer=u,this._renderer):(this._renderer=c,this._renderer))},inherit(s,h),s.MIN_WIDTH=100,s.prototype.setPoint=function(t,e){var i,o,n=this.properties();if(0===t&&n.wordWrapWidth&&n.wordWrapWidth.value()){if(i=n.locked&&n.locked.value()?this.fixedPoints()[0].x:this._timeScale.indexToCoordinate(this.points()[0].index),o=this._timeScale.indexToCoordinate(e.index)-i-~~(n.fontsize.value()/6),!isFinite(o))return;n.wordWrapWidth.setValue(Math.max(s.MIN_WIDTH,o))}},s.prototype.pointsCount=function(){return 1},s.prototype.title=function(){return $.t("Text")},s.prototype.setPriceScale=function(t){c.prototype.setPriceScale.call(this,t),t&&t.priceRange()&&(this._priceDencity=t.height()/t.priceRange().length(),this._isPriceDencityLog=t.isLog())},s.prototype.restoreSize=function(){this._barSpacing=this._model.timeScale().barSpacing(),this._priceDencity=this.priceScale().height()/this.priceScale().priceRange().length(),this.updateAllViews(),this._model.updateSource(this)},s.prototype.restoreTemplate=function(t){delete t.locked,delete t.text,h.prototype.restoreTemplate.call(this,t)},inherit(r,s),r.prototype.title=function(){return $.t("Anchored Text")},s.prototype.state=function(t){var e=h.prototype.state.call(this,t);return t&&(e.state.fixedSize=!1),e},e.TextRenderer=o,e.TextPaneView=n,e.LineToolText=s,e.LineToolTextAbsolute=r},function(t,e,i){"use strict";function o(t){this._data=t}function n(t){this._series=t,this._invalidated=!0}var s=i(30),r=i(117),a=i(94),l=a.DateFormatter,h=a.TimeFormatter;o.prototype.hittest=function(){},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d=5,p=12,u=5,_=8,f=13,m=0;t.save(),t.setFont(f+"px Arial"),o=$.t("Last available bar"),this._data.eod?m=t.measureText(o).width:(e=t.measureText(this._data.dateString||"").width,i=t.measureText(this._data.timeString||"").width,m=Math.max(e,i)),n=this._data.timeString?2:1,t.fillStyle=this._data.eod?"#FF4040":"#58A3CD",t.translate(this._data.point.x+.5,this._data.point.y+.5),s=Math.round(-m/2)-_,r=-(f+d)*n-d-p-u,a=Math.round(s+m+2*_),l=-p-u,t.beginPath(),t.moveTo(s,r),t.lineTo(a,r),t.lineTo(a,l),t.lineTo(p,l),t.lineTo(0,l+p),t.lineTo(-p,l),t.lineTo(s,l),t.fill(),t.fillStyle="#FFFFFF",t.textBaseline="top",this._data.eod?t.fillText(o,s+_,r+d):(h=s+_+(m-e)/2,t.fillText(this._data.dateString,h,r+d),this._data.timeString&&(c=s+_+(m-i)/2,t.fillText(this._data.timeString,c,r+2*d+f))),t.restore()},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,r;delete this._point,delete this._dateString,delete this._timeString,delete this._eod,void 0!==(t=this._series.gotoDateResult())&&(e=t.index,(i=this._series.bars().valueAt(e))&&(o=this._series.priceScale().priceToCoordinate(i[TradingView.HIGH_PLOT]),n=this._series.model().timeScale().indexToCoordinate(e),this._point=new s.Point(n,o),t.eod?this._eod=!0:(r=this._series.model().timeScale().indexToUserTime(e),this._dateString=(new l).format(r),this._series.isDWM()||(this._timeString=(new h).format(r)))))},n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._point?new o({point:this._point,dateString:this._dateString,timeString:this._timeString,eod:this._eod}):new r},t.exports=n},function(t,e,i){(function(e){"use strict";function o(t){this._data=t,this._textWidthCache=new s}function n(t,e,i,o,n){this._model=t,this._source=e,this._plotIndex=i,this._getterName=o||"symbol",this._propertyName=n,this._cache={},this._invalidated=!0,this._rendererData={}}var s=i(127),r=i(117),a=i(85).RGBColor,l=i(128).makeFont;o.prototype.hitTest=function(t){return null},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c;this._data.visible&&(this._textWidthCache.font!==this._data.font&&(this._textWidthCache.reset(),this._textWidthCache.font=this._data.font),t.font=this._data.font,e=this._data.fontSize,i=Math.floor(e/4.5),o=Math.ceil(e/4.5),n=Math.ceil(e/3),s=Math.ceil(this._textWidthCache.measureText(t,this._data.text)),r=Math.round(e/10),a=e+i+o,l=s+2*n,h=this._data.x-.5,"right"===this._data.align&&(h-=l),c=this._data.y-Math.floor(e/2)-i-.5,t.fillStyle=this._data.backColor,t.fillRect(h,c,l,a),t.fillStyle=this._data.color,t.textAlign="left",t.fillText(this._data.text,h+n,c+i+e-r))},n.prototype.isPropertyEnabled=function(){return this._model.properties().scalesProperties[this._propertyName].value()},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,i,o,n,s,h,c,d=this._rendererData;if(d.visible=!1,d.text="",this.isPropertyEnabled()&&this._source.properties().visible.value()&&(t=this._source.lastValueData(this._plotIndex,e.enabled("price_scale_always_last_bar_value")),!t.noData)){if(i=this._model.paneForSource(this._source),o="right",i.leftPriceScale()===this._source.priceScale()&&(o="left"),n=this._model.properties(),s=!i.leftPriceScale().mainSource()||!i.rightPriceScale().mainSource(),s&&n.scalesProperties.showLeftScale.value()&&!n.scalesProperties.showRightScale.value()&&(o="left"),!s){if("left"===o&&!n.scalesProperties.showLeftScale.value())return new r;if("right"===o&&!n.scalesProperties.showRightScale.value())return new r}h=t.coordinate,c=this._source.m_data.m_series&&this._source.m_data.m_series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI,this._source.lastPriceLabelFixedCoordinate&&!c&&"showSymbolLabels"===!this._propertyName&&(h=this._source.lastPriceLabelFixedCoordinate(this._plotIndex)||h),d.visible=!0,t.color!==d.backColor&&(d.backColor=t.color,d.color=new a(t.color).blackWhiteContrast()),d.text=this._source[this._getterName](this._plotIndex),d.align=o,d.x="right"===o?this._model.timeScale().width():0,d.y=h,d.fontSize=this._model.properties().scalesProperties.fontSize.value(),d.font=l(d.fontSize,"Arial","")}},n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._renderer||(this._renderer=new o(this._rendererData)),this._renderer},t.exports=n}).call(e,i(1))},function(t,e){"use strict";function i(t){this._maxSize=t||50,this.reset()}i.prototype.measureText=function(t,e){var i,o,n=(e+"").replace(this._re,"0");return this._cache[n]?this._cache[n].width:(this._actualSize===this._maxSize&&(i=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[i],this._oldestTick++,this._actualSize--),0===(o=t.measureText(n).width)&&e.length?0:(this._cache[n]={width:o,tick:this._usageTick},this._tick2Labels[this._usageTick]=n,this._actualSize++,this._usageTick++,o))},i.prototype.reset=function(){this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}},i.prototype._re=/[2-9]/g,t.exports=i},function(t,e){"use strict";function i(t,e,i){return i&&(i+=" "),i+t+"px "+e}e.makeFont=i},function(t,e,i){"use strict";function o(t,e){this._data=t,this._colors=this.getBackgroundColor(e)}function n(t,e,i){this._series=t,this._lastBar=e,this._direction=i}i(130);o.prototype.hitTest=function(){return null},o.prototype.getBackgroundColor=function(t){return[{background:"rgba(255, 158, 171, 0.3)",line:"#7E202F"},{background:"rgba(244, 255, 158, 0.3)",line:"#EBFF3F"},{background:"rgba(195, 255, 160, 0.3)",line:"#308020"}][t+1]},o.prototype.draw=function(t){t.fillStyle=this._colors.background,t.fillRect(Math.max(0,this._data.x),0,this._data.width,this._data.height),t.strokeStyle=this._colors.line,t.beginPath(),t.lineWidth=1;var e=Math.round(this._data.x);t.moveTo(e,0),t.lineTo(e,this._data.height),t.stroke()},n.prototype.update=function(){this._x=this._series.m_model.timeScale().indexToCoordinate(this._lastBar)-.5*this._series.m_model.timeScale().barSpacing()+1},n.prototype.renderer=function(){var t={x:this._x,height:this._series.priceScale().height(),width:this._series.m_model.timeScale().width()},e=this._series.data().bars(),i=e.last().value[TradingView.CLOSE_PLOT]>e.valueAt(this._lastBar)[TradingView.CLOSE_PLOT]?1:-1,n=0;return 1===this._direction?n=i:2===this._direction&&(n=-1*i),new o(t,n)},e.FutureBarsPaneView=n},function(t,e){"use strict";function i(t,e){this._chartApi=t,this.generateSessionId(),this._sessionDisabled=!1,this._disableStatistics=!!e}i.prototype.destroy=function(){this._sessionDisabled||this.stopSession()},i.prototype.generateSessionId=function(){this._sessionid="cs_"+TradingView.randomHash()},i.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},i.prototype.connected=function(){return this._chartApi.connected()&&!this._sessionDisabled},i.prototype.disconnected=function(){var t=this;this.restartSession(),Object.keys(this).forEach(function(e){/^(s|st|symbol_)\d+$/.test(e)&&delete t[e]})},i.prototype.initSession=function(){return this._chartApi.createSession(this._sessionid,this)},i.prototype.stopSession=function(){return this._chartApi.removeSession(this._sessionid)},i.prototype.restartSession=function(){this.stopSession(),this.generateSessionId(),this.initSession()},i.prototype.setHandler=function(t){this._globalHandler=t},i.prototype.sessionId=function(){return this._sessionid},i.prototype.connect=function(t){return this._globalHandler=t,this.initSession(),this._chartApi.connect()},i.prototype.disconnect=function(){return this._chartApi.disconnect()},i.prototype.switchTimezone=function(t){return this._chartApi.switchTimezone(this._sessionid,t)},i.prototype.resolveSymbol=function(t,e,i){return this._chartApi.resolveSymbol(this._sessionid,t,e,i)},i.prototype.createSeries=function(t,e,i,o,n,s){return this._chartApi.createSeries(this._sessionid,t,e,i,o,n,s)},i.prototype.removeSeries=function(t,e){return this._chartApi.removeSeries(this._sessionid,t,e)},i.prototype.modifySeries=function(t,e,i,o,n){return this._chartApi.modifySeries(this._sessionid,t,e,i,o,n)},i.prototype.requestMoreData=function(t,e,i){return this._chartApi.requestMoreData(this._sessionid,t,e,i)},i.prototype.requestMetadata=function(t,e){this._chartApi.requestMetadata(this._sessionid,t,e)},i.prototype.isCanCreateStudy=function(t,e){return this._chartApi.isCanCreateStudy(t,e)},i.prototype.createStudy=function(t,e,i,o,n,s,r){return this._chartApi.createStudy(this._sessionid,t,e,i,o,n,s,r)},i.prototype.rebindStudy=function(t,e,i,o,n,s,r){return this._chartApi.rebindStudy(this._sessionid,t,e,i,o,n,s,r)},i.prototype.removeStudy=function(t,e,i){return this._chartApi.removeStudy(this._sessionid,t,e,i)},i.prototype.modifyStudy=function(t,e,i,o){return this._chartApi.modifyStudy(this._sessionid,t,e,i,o)},i.prototype.createPointset=function(t,e,i,o,n,s){return this._chartApi.createPointset(this._sessionid,t,e,i,o,n,s)},i.prototype.modifyPointset=function(t,e,i,o){return this._chartApi.modifyPointset(this._sessionid,t,e,i,o)},i.prototype.removePointset=function(t,e){return this._chartApi.removePointset(this._sessionid,t,e)},i.prototype.requestMoreTickmarks=function(t,e,i){return this._chartApi.requestMoreTickmarks(this._sessionid,t,e,i)},i.prototype.requestFirstBarTime=function(t,e,i){return this._chartApi.requestFirstBarTime(this._sessionid,t,e,i)},i.prototype.setVisibleTimeRange=function(t,e,i,o){return this._chartApi.setVisibleTimeRange(t,this._sessionid,e,i,o)},i.prototype.onMessage=function(t){switch(t.method){case"connected":this._chartApi.chartCreateSession(this._sessionid,this._disableStatistics);break;case"disconnected":this.disconnected();break;case"critical_error":}this._globalHandler&&this._globalHandler(t)},i.prototype.disable=function(){this._sessionDisabled=!0},i.prototype.chartApi=function(){return this._chartApi},t.exports=i},function(t,e){"use strict";function i(t){if(t)return"QUANDL"===t.exchange?"Quandl.com":~["BMFBOVESPA","ASX","BME","NAG","NZX"].indexOf(t.exchange)?"ICE Data services":void 0}t.exports=i},function(t,e,i){"use strict";function o(t,e){this.m_bars=new n(["time","open","high","low","close","adt","style"]),this.m_nsBars=new n(["time","open","high","low","close","adt","style"]),this.m_series=t,this.m_model=e,this.lastProjectionPrice=void 0,this.boxSize=void 0,this.reversalAmount=void 0}var n=i(133);o.prototype.bars=function(){return this.m_bars},o.prototype.nsBars=function(){return this.m_nsBars},o.prototype.size=function(){return this.m_nsBars._end-this.m_nsBars._start+(this.m_bars._end-this.m_bars._start)},o.prototype.each=function(t){var e;for(e=this.m_bars._start;e<this.m_bars._end&&!t(this.m_bars._indexAt(e),this.m_bars._valueAt(e));++e);for(e=this.m_nsBars._start;e<this.m_nsBars._end&&!t(this.m_nsBars._indexAt(e),this.m_nsBars._valueAt(e));++e);},o.prototype.clear=function(){this.m_bars=new n(["time","open","high","low","close","adt","style"]),this.m_nsBars=new n(["time","open","high","low","close","adt","style"]),this.lastProjectionPrice=void 0},o.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars._items[0]:this.m_bars._items[0]},o.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()},o.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars._items[this.m_bars._end-1]:this.m_nsBars._items[this.m_nsBars._end-1]},o.prototype.search=function(t,e){return this.nsBars().isEmpty()?this.bars().search(t,e):this.bars().isEmpty()?this.nsBars().search(t,e):this.nsBars().firstTimeIndex()<=t?this.nsBars().search(t,e):this.bars().search(t,e)},o.prototype.valueAt=function(t){var e=this.search(t);if(e)return e.value},o.prototype.firstBar=function(){var t,e,i;return this.m_model.timeScale().isEmpty()?null:(t=this.m_model.timeScale().visibleBars(),e=t.firstBar(),i=this.search(e,TradingView.SEARCH_NEAREST_RIGHT),i?i.value:null)},o.prototype.firstValue=function(){var t=this.firstBar();return t?t[TradingView.CLOSE_PLOT]:null},o.prototype.calculateATR=function(){var t,e,i,o=[];for(t=this.m_bars.lastIndex();t>=this.m_bars.firstIndex();t--)e=this.m_bars._valueAt(t),o.push(e[TradingView.HIGH_PLOT]-e[TradingView.LOW_PLOT]);return i=0===o.length?0:o.reduce(function(t,e){return t+e},0)/o.length,i*=this.m_series.base()},o.prototype.timeToBarIndex=function(t,e){var i,o;if(null===t)return TradingView.logDebugChart("SeriesData.timeToBarIndex: time should be a number of seconds since 1970. But it is null"),0;if(e===TradingView.SEARCH_FROM_RIGHT){for(i=this.m_bars.lastIndex();i>=this.m_bars.firstIndex();i--)if(o=this.m_bars._valueAt(i),t>=o[TradingView.TIME_PLOT])return i;for(i=this.m_nsBars.lastIndex();i>=this.m_nsBars.firstIndex();i--)if(o=this.m_nsBars._valueAt(i),t>=o[TradingView.TIME_PLOT])return i;return this.m_bars.firstIndex()}if(e===TradingView.SEARCH_FROM_LEFT){for(i=this.m_bars.firstIndex();i<=this.m_bars.lastIndex();i++)if(o=this.m_bars._valueAt(i),t<=o[TradingView.TIME_PLOT])return i;for(i=this.m_nsBars.firstIndex();i<=this.m_nsBars.lastIndex();i++)if(o=this.m_nsBars._valueAt(i),t<=o[TradingView.TIME_PLOT])return i;return this.m_bars.lastIndex()}return TradingView.logDebugChart("SeriesData.timeToBarIndex: Incorrect options value"),0},t.exports=o},function(t,e){"use strict";function i(){this._chunks={}}function o(t){var e,o;for(this._items=[],this._columns=t||[],this._start=0,this._end=0,this._shareread=!1,this._plotCaches={},this._itemsSearchCache={},e=0;e<this._columns.length;e++)o=this._columns[e],this._plotCaches[o]=new i}i.CHUNK_SIZE=30,o.prototype.clear=function(){this._items=[],this._itemsSearchCache={},this._columns=[],this._start=0,this._end=0,this._shareread=!1,this._plotCaches={}},o.prototype.columns=function(){return this._columns},o.prototype.last=function(){return this._items[this._end-this._start-1]},o.prototype.first=function(){return this._items[0]},o.prototype.firstIndex=function(){return this._start},o.prototype.lastIndex=function(){return this._end-this._start-1},o.prototype.size=function(){return this._end-this._start},o.prototype.isEmpty=function(){return 0===this.size()},o.prototype.contains=function(t){return-1!==this._search(t)},o.prototype.valueAt=function(t){var e=this.search(t);if(e)return e.value},o.prototype.add=function(t,e){var i,o;return this._shareread?(TradingView.logDebugChart("PlotList.add: readonly collection modification attempt"),!1):(i=this._createPair(t,e),o=this._search(t),this._itemsSearchCache={},o<0?(o=this._lowerbound(t,-1),this._items.splice(o,0,i),this._start=0,this._end=this._items.length,!0):(this._items[o]=i,!1))},TradingView.SEARCH_NEAREST_LEFT=-1,TradingView.SEARCH_EXACT=0,TradingView.SEARCH_NEAREST_RIGHT=1,o.prototype.search=function(t,e){var i,o;return this._itemsSearchCache[t]&&this._itemsSearchCache[t][e]?this._itemsSearchCache[t][e]:(i=this._search(t,e))<0?void 0:(o={index:this._indexAt(i),value:this._valueAt(i)},this._itemsSearchCache[t]=this._itemsSearchCache[t]||{},this._itemsSearchCache[t][e]=o,o)},o.prototype.fold=function(t,e){var i,o=e;for(i=this._start;i<this._end;++i)o=t(this._indexAt(i),this._valueAt(i),o);return o},o.prototype.each=function(t){for(var e=this._start;e<this._end&&!t(this._indexAt(e),this._valueAt(e));++e);},o.prototype.reduce=function(t,e){var i,o=e;for(i=this._start;i<this._end;++i)o=t(o,this._indexAt(i),this._valueAt(i));return o},o.prototype.range=function(t,e){var i=new o;return i._items=this._items,i._start=this._lowerbound(t),i._end=Math.min(this._lowerbound(e)+1,i._items.length),i._shareread=!0,i},o.prototype.minMaxOnRange2=function(t,e,o){var n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b=null,w=null;if(0===this._items.length)return{min:b,max:w};for(n=this._items[0],s=0;s<o.length;s++){for(r=o[s],a=t-r.offset,l=e-r.offset,a=Math.max(a,n),l=Math.min(l,n+this._items.length-1),h=Math.ceil(a/i.CHUNK_SIZE)*i.CHUNK_SIZE,c=Math.max(h,Math.floor(l/i.CHUNK_SIZE)*i.CHUNK_SIZE),this._plotCaches[r.index]||(this._plotCaches[r.index]={}),d=this._plotCaches[r.index],p=a;p<=Math.min(l,h)&&p<=e;p++)u=this._items[p-n].value,void 0!==(_=u[r.index])&&null!==_&&((null===b||_<b)&&(b=_),(null==w||_>w)&&(w=_));for(f=Math.max(h+1,a);f<c;f+=i.CHUNK_SIZE)m=Math.floor(f/i.CHUNK_SIZE),g=d[m],g||(v=m*i.CHUNK_SIZE,y=(m+1)*i.CHUNK_SIZE-1,g=this.minMaxOnRange(v,y,[r]),d[m]=g),null!==g.min&&(g.min<b||null===b)&&(b=g.min),null!==g.max&&(g.max>w||null===w)&&(w=g.max);for(p=c;p<=l;p++)u=this._items[p-n].value,void 0!==(_=u[r.index])&&null!==_&&((null===b||_<b)&&(b=_),(null==w||_>w)&&(w=_));void 0!==r.baseValue&&(b=Math.min(r.baseValue,b),w=Math.max(r.baseValue,w))}return{min:b,max:w}},o.prototype.minMaxOnRange=function(t,e,i){var o,n,s,r,a,l,h,c=this._lowerbound(t),d=Math.min(this._lowerbound(e)+1,this._items.length);for(this._items[this._end-1]>e&&(d=c),o=null,n=null,s=0;s<i.length;s++){for(r=i[s],c=this._lowerbound(t-r.offset),d=Math.min(this._lowerbound(e-r.offset)+1,this._items.length),this._items[d-1]>e-r.offset&&(d=c),a=c;a<d;a++)l=this._items[a].value,void 0!==(h=l[r.index])&&null!==h&&((null===o||h<o)&&(o=h),(null==n||h>n)&&(n=h));void 0!==r.baseValue&&(o=Math.min(r.baseValue,o),n=Math.max(r.baseValue,n))}return{min:o,max:n}},o.prototype.merge=function(t){var e,o,n,s,r;if(this._shareread)return TradingView.logDebugChart("PlotList.merge: shared collection modification attempt"),[];for(e=[],e.earliestRow=null,o=0;o<t.length;++o){for(n=t[o],s=Math.floor(n.index/i.CHUNK_SIZE),r=0;r<this._columns.length;r++)this._plotCaches[r]&&delete this._plotCaches[r][s];(null===e.earliestRow||e.earliestRow>n)&&(e.earliestRow=n),this.add(n.index,n.value)?e.push({insert:n}):e.push({update:n})}return e},o.prototype.addTail=function(t,e){var i,o,n=0;for(e&&this._end-this._start>0&&(n=1,this._items[this._end-this._start-1].value=t[0].value),i=n;i<t.length;++i)o=t[i],this.add(parseInt(this.last(),10)+1,o.value);this._itemsSearchCache={}},o.prototype._createPair=function(t,e){var i=new Number(t);return i.value=e,i},o.prototype._valueAt=function(t){return this._items[t].value},o.prototype._length=function(t){return this._items.length},o.prototype._indexAt=function(t){return this._items[t].valueOf()},o.prototype._search=function(t,e){var i=this._bsearch(t);return i===-1&&e?e<0?(i=this._lowerbound(t),i>this._start&&(i-=1),i!==this._end&&this._indexAt(i)<t?i:-1):(i=this._upperbound(t),i!==this._end&&t<this._indexAt(i)?i:-1):i},o.prototype._bsearch=function(t){var e=this._lowerbound(t);return e===this._end||t<this._items[e]?-1:e},o.prototype._lowerbound=function(t){for(var e,i,o=this._start,n=this._end,s=n-o;0<s;)e=s>>1,i=o+e,this._items[i]<t?(o=i+1,s-=e+1):s=e;return o},o.prototype._upperbound=function(t){for(var e,i,o=this._start,n=this._end,s=n-o;0<s;)e=s>>1,i=o+e,t<this._items[i]?s=e:(o=i+1,s-=e+1);return o},o.prototype.state=function(){var t,e={};e.columns=this._columns,e.start=this._start,e.end=this._end,e.shareread=this._shareread,e.data=[];for(t in this._items)e.data.push({index:new Number(this._items[t]),value:this._items[t].value});return e},o.prototype.restoreState=function(t){var e,i;if(!t)return void this.clear();for(this._columns=t.columns,this._start=t.start,this._end=t.end,this._shareread=t.shareread,this._items=[],this._itemsSearchCache={},e=0;e<t.data.length;e++)i=new Number(t.data[e].index),i.value=t.data[e].value,this._items.push(i)},o.prototype.firstTimeIndex=function(){return this._indexAt(this._start)},o.prototype.lastTimeIndex=function(){return this._indexAt(this._end-1)},t.exports=o},function(t,e,i){(function(e){"use strict";var o=i(135).futuresRoots,n=function(){function t(t,e){var i=function(){};return i.prototype=e.prototype,t.prototype=new i,t}function i(t){return t.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&")}function n(){}function s(t){this.value=t}function r(){}function a(){}function l(){}function h(){}function c(){}function d(){}function p(){}function u(){}function _(t){this.value=t}function f(t){this.value=t}function m(t){this.value=t}function g(){_.apply(this,arguments)}function v(){f.apply(this,arguments)}function y(t,e){var i,o,n,r,a,l,h,c,d=[];t:for(;i=W.exec(t);){for(o=z.length;o--;)if(i[o+1]){z[o].ctor&&(n=new z[o].ctor(i[o+1]),n._offset=i.index,d.push(n));continue t}r=new m(i[0]),r._offset=i.index,d.push(r)}if(e&&e.recover)for(o=d.length;o--;)l=d[o],l instanceof f||l instanceof _?(void 0!==a&&(h=new _(""),c=d.splice(o,a-o+1,h),h.value=c.map(function(t){return t.value}).join("")),a=o):l instanceof s||(a=void 0);return d}function b(t){var i,o,n,h,c,d,p,u,g,v;if(e.enabled("charting_library_base"))return{currentState:"var"};for(i="init",o="var",n="operator",h=i,c={warnings:[],errors:[],isEmpty:!0},d=[],p=0;p<t.length;p++)if(!((u=t[p])instanceof s))if(delete c.isEmpty,u.isIncomplete&&(g={status:"incomplete",reason:"incomplete_token",offset:u._offset,token:u},u.incompleteSuggest&&(g.recover={append:u.incompleteSuggest()}),c.warnings.push(g),p!==t.length-1))g.status="error";else if(u instanceof _||u instanceof f){if(h===o){c.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}h=o}else if(u instanceof l){if(h!==o){c.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}h=n}else if(u instanceof r){if(h===o){c.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}d.push(u),h=i}else if(u instanceof a){if(h!==o){c.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}v=d.pop(),v||c.errors.push({status:"error",reason:"unbalanced_brace",offset:u._offset,token:u,recover:{prepend:new r}}),h=o}else u instanceof m&&c.errors.push({status:"error",reason:"unparsed_entity",offset:u._offset,token:u});for(c.braceBalance=d.length,h!==o&&c.warnings.push({status:"incomplete"}),v=null;d.length;)u=d.pop(),g={status:"incomplete",reason:"unbalanced_brace",offset:u._offset,token:u},h===o&&(g.recover={append:new a}),c.warnings.push(g);return c.currentState=h,0===c.warnings.length&&delete c.warnings,0===c.errors.length&&delete c.errors,c}function w(t){var e,i=[];for(e=0;e<t.length;e++)t[e]instanceof s||i.push(t[e]);return i}function S(t){var e,i,o,n,s,h,c;for(t=w(t),e=[],i=[],n=0;n<t.length;n++)s=t[n],s instanceof l?i.length&&i[i.length-1].minPrecedence>s.precedence&&(i[i.length-1].minPrecedence=s.precedence):s instanceof r?i.push(o={minPrecedence:1/0,openBraceIndex:n}):s instanceof a&&(o=i.pop(),h=t[o.openBraceIndex-1],(c=t[n+1])instanceof l&&!(c.precedence<=o.minPrecedence)||!(!(h instanceof l)||h.precedence<o.minPrecedence||h.precedence===o.minPrecedence&&h.commutative)||(e.unshift(o.openBraceIndex),e.push(n),i.length&&i[i.length-1].minPrecedence>o.minPrecedence&&(i[i.length-1].minPrecedence=o.minPrecedence)));for(n=e.length;n--;)t.splice(e[n],1);return t}function T(t){for(var e=0;e<t.length;e++)t[e].parse&&t[e].parse();return t}function C(t){var e=x(t);return S(e?e:[new f("1"),new p,new r].concat(t).concat(new a))}function x(t){var e,i,o,n=0,h=1,c=2,d=3,u=n,_=0;for(i=0;i<t.length;i++)if(!((o=t[i])instanceof s))switch(u){case n:if(!(o instanceof f&&1==+o.value))return!1;u=h;break;case h:if(!(u===h&&o instanceof p))return!1;u=c,e=i+1;break;case c:if(o instanceof r)u=d,_=1;else if(o instanceof l)return!1;break;case d:o instanceof r?_++:o instanceof a&&--_<=0&&(u=c)}return t.slice(e)}function P(t){return new _(t).ticker()}function L(t){if("string"!=typeof t)throw new TypeError("expression must be a string");return t=y(t),t.filter(function(t){return t instanceof _}).map(function(t){return t.exchange()}).filter(function(t){return t})}function k(t){return t=L(t),1!==t.length?null:t[0]}function I(t,e){return t=L(t),t.some(function(t){return!!~e.indexOf((t||"").toUpperCase())})}function E(t){return I(t,["BATS"])}function A(t){return(t=k(t))&&t.toUpperCase().indexOf("_EOD")!==-1}function V(t){return I(t,["CHXEUR"])}function M(t){return I(t,["CHXJPY"])}function $(t){return I(t,["MOEX_DLY","LSE_DLY","LSIN_DLY","BSE_DLY","CME_DL","CME_MINI_DL","CBOT_DL","CBOT_MINI_DL","COMEX_DL","COMEX_MINI_DL","NYMEX_DL","NYMEX_MINI_DL","ASX_DLY","BME_DLY","NZX_DLY","NAG_DLY","BMFBOVESPA_DLY","TSE_DLY","TFX_DLY"])}function D(t,e){return!!(t=k(t))&&t.substr(0,e.length)===e}function O(t){if("string"!=typeof t)throw new TypeError("expression must be a string");var e=S(w(y(t)));return e.forEach(function(t){t instanceof _&&t.exchange(null)}),R(e)}function B(t){if("string"!=typeof t)throw new TypeError("expression must be a string");return R(S(w(y(t))))}function R(t){return t.join("")}var N,F,W,z=[{pattern:"(",ctor:r},{pattern:")",ctor:a},{pattern:"+",ctor:h},{pattern:"-",ctor:c},{pattern:"*",ctor:d},{pattern:"/",ctor:p},{pattern:"^",ctor:u},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:f},{pattern:/\./,ctor:v},{pattern:e.enabled("charting_library_base")?/[a-zA-Z0-9_\u4e00-\u9fa5^][a-zA-Z0-9_\u4e00-\u9fa5_!:\.&]*|'.+?'/:/[a-zA-Z0-9][a-zA-Z0-9_!|:\.&]*|'.+?'/,ctor:_},{pattern:/'[^']*/,ctor:g},{pattern:/[\0-\x20\s]+/,ctor:s}];return n.prototype.toString=function(){return this.value},t(s,n),t(r,n),r.prototype.value="(",t(a,n),a.prototype.value=")",t(l,n),t(h,l),h.prototype.value="+",h.prototype.precedence=0,h.prototype.commutative=!0,t(c,l),c.prototype.value="-",c.prototype.precedence=0,c.prototype.commutative=!1,t(d,l),d.prototype.value="*",d.prototype.precedence=1,d.prototype.commutative=!0,t(p,l),p.prototype.value="/",p.prototype.precedence=1,p.prototype.commutative=!1,t(u,l),u.prototype.value="^",u.prototype.precedence=2,u.prototype.commutative=!1,N=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,F=/[\+\-\/\*]/,t(_,n),_.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var t=F.test(this._ticker)?"'":"";return t+(this._exchange?this._exchange+":":"")+this._ticker+t}return this.value},_.prototype.parse=function(){var t=N.exec(this.value);t[1]&&(this._exchange=t[1]),this._ticker=t[2]},_.prototype.parseAsFutures=function(){var t,e,i;if(o)for(this.hasOwnProperty("_ticker")||this.parse(),t=function(t){return o.some(function(e){return e.t===t})},e=2;e>=1;--e)if(i=this._ticker.slice(0,e),t(i)){this._root=i,this._contract=this._ticker.slice(e);break}},_.prototype.exchange=function(t){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null===t||void 0===t?delete this._exchange:this._exchange=t+""},_.prototype.ticker=function(t){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null===t||void 0===t?delete this._ticker:this._ticker=t+"",delete this._root,delete this._contract},_.prototype.root=function(t){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===t||void 0===t?delete this._root:(this._root=t+"",this._root&&(this._ticker=this._root+(this._contract||"")))},_.prototype.contract=function(t){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===t||void 0===t?delete this._contract:(this._contract=t+"",this._root&&(this._ticker=this._root+this._contract))},t(f,n),f.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},f.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},m.prototype.toString=function(){return this.value},t(g,_),g.prototype.isIncomplete=!0,g.prototype.incompleteSuggest=function(){if("'"!==this.value)return"'"},t(v,f),v.prototype.isIncomplete=!0,W=RegExp(z.map(function(t){return"("+("string"==typeof t.pattern?i(t.pattern):t.pattern.source)+")"}).concat(".").join("|"),"g"),{tokenize:y,validate:b,factorOutBraces:S,normalizeTokens:T,flip:C,hasBatsSymbols:E,hasEodSymbols:A,hasChxeurSymbols:V,hasChxjpySymbols:M,hasFreeDelaySymbols:$,getExchange:k,isExchange:D,SymbolToken:_,IncompleteSymbolToken:g,NumberToken:f,BinaryOperatorToken:l,OpenBraceToken:r,CloseBraceToken:a,ticker:P,shortName:O,normalize:B}}();t.exports=n}).call(e,i(1))},function(t,e,i){"use strict";function o(t){for(var i=0;i<e.availableTimezones.length;i++)if(t===e.availableTimezones[i].id)return!0;return!1}var n,s,r;for(i(96),n=i(136),e.availableTimezones=[{id:"Etc/UTC",title:$.t("UTC")},{id:"exchange",title:$.t("Exchange")},{id:"Pacific/Honolulu",title:$.t("Honolulu")},{id:"America/Vancouver",title:$.t("Vancouver")},{id:"America/Los_Angeles",title:$.t("Los Angeles")},{id:"America/Phoenix",title:$.t("Phoenix")},{id:"America/Chicago",title:$.t("Chicago")},{id:"America/El_Salvador",title:$.t("San Salvador")},{id:"America/Toronto",title:$.t("Toronto")},{id:"America/New_York",title:$.t("New York")},{id:"America/Bogota",title:$.t("Bogota")},{id:"America/Argentina/Buenos_Aires",title:$.t("Buenos Aires")},{id:"America/Sao_Paulo",title:$.t("Sao Paulo")},{id:"Europe/London",title:$.t("London")},{id:"Europe/Madrid",title:$.t("Madrid")},{id:"Europe/Paris",title:$.t("Paris")},{id:"Europe/Berlin",title:$.t("Berlin")},{id:"Europe/Warsaw",title:$.t("Warsaw")},{id:"Europe/Athens",title:$.t("Athens")},{id:"Europe/Moscow",title:$.t("Moscow")},{id:"Asia/Tehran",title:$.t("Tehran")},{id:"Asia/Dubai",title:$.t("Dubai")},{id:"Asia/Ashkhabad",title:$.t("Ashkhabad")},{id:"Asia/Kolkata",title:$.t("Kolkata")},{id:"Asia/Almaty",title:$.t("Almaty")},{id:"Asia/Bangkok",title:$.t("Bangkok")},{id:"Asia/Taipei",title:$.t("Taipei")},{id:"Asia/Singapore",title:$.t("Singapore")},{id:"Asia/Shanghai",title:$.t("Shanghai")},{id:"Asia/Hong_Kong",title:$.t("Hong Kong")},{id:"Asia/Seoul",title:$.t("Seoul")},{id:"Asia/Tokyo",title:$.t("Tokyo")},{id:"Australia/Brisbane",title:$.t("Brisbane")},{id:"Australia/Adelaide",title:$.t("Adelaide")},{id:"Australia/Sydney",title:$.t("Sydney")},{id:"Pacific/Auckland",title:$.t("New Zealand")},{id:"Pacific/Fakaofo",title:$.t("Tokelau")},{id:"Pacific/Chatham",title:$.t("Chatham Islands")}],s=0;s<e.availableTimezones.length;s++)["Etc/UTC","exchange"].indexOf(e.availableTimezones[s].id)===-1&&(r=n.parseTzOffset(e.availableTimezones[s].id).string,e.availableTimezones[s].title="("+r+") "+e.availableTimezones[s].title);e.timezoneIsAvailable=o,e.monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e.futuresRoots=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}]},function(t,e,i){"use strict";function o(t){var e,i=n.get_timezone(t).offset_utc(Date.now()),o="",s=i/1e3/60/60;return s%1&&(o=":"+s%1*60),e="",e=s>0?"+"+(s-s%1)+o:0===s?"":s-s%1+o+"",{offset:i,string:"UTC"+e}}var n=i(137);e.parseTzOffset=o},function(t,e,i){"use strict";function o(t){var e,i,o,n,s,r;if(this._name=t,e=d[t],e||("UTC"!==t&&"Etc/UTC"!==t&&TradingView.logError("unknown timezone: "+t),e={time:[],offset:[]},this._invalid=!0),e.time.length!==e.offset.length&&(TradingView.logError("timezone transition table doesn't match offset table"),e={time:[],offset:[]},this._invalid=!0),!e.time_utc){for(i=e.time,o=e.offset,n=i.length,s=Array(n),r=0;r<n;r++)i[r]*=1e3,o[r]*=1e3,s[r]=i[r]-o[r];e.time_utc=s}this.tz=e}function n(t,e){var i,o,n,r=t.length;if(0===r)return-1;if(isNaN(e))throw Error("Key is NaN");for(i=0,o=r-1,n=s((i+o)/2);;){if(t[n]>e){if((o=n-1)<i)return n}else if(i=n+1,o<i)return n<r-1?n+1:-1;n=s((i+o)/2)}}var s,r,a,l,h,c,d=i(138);o.prototype.offset_utc=function(t){return o._offset(this.tz.time_utc,this.tz.offset,t)},o.prototype.offset_loc=function(t){return o._offset(this.tz.time,this.tz.offset,t)},o.prototype.is_valid=function(){return!this._invalid},o._offset=function(t,e,i){var o=n(t,i);return o===-1?0:e[o]},s=function(t){return 0|t},r=function(t){return 60*t*1e3},a=function(t){return 1e3*t},l=function(t,e){return s((s(t/1e3)-s(e/1e3))/60)},h=function(t,e){return s(s(t/1e3)-s(e/1e3))},c={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,DECEMBER:11,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,DAY_OF_MONTH:5,DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,secondsPerDay:r(1440),get_year:function(t){return t.getUTCFullYear()},get_month:function(t){return t.getUTCMonth()},get_hours:function(t){return t.getUTCHours()},get_minutes:function(t){return t.getUTCMinutes()},get_seconds:function(t){return t.getUTCSeconds()},get_day_of_month:function(t){return t.getUTCDate()},get_day_of_week:function(t){return t.getUTCDay()+1},get_day_of_year:function(t){var e=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0);return s((t.getTime()-e)/c.secondsPerDay)+1},get_week_of_year:function(t){var e=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),i=c.clone(t);return c.set_hms(i,0,0,0,0),i.setUTCDate(i.getUTCDate()+4-(i.getUTCDay()||7)),s(((i.getTime()-e)/c.secondsPerDay+1)/7)},get_minutes_from_midnight:function(t){return 60*c.get_hours(t)+c.get_minutes(t)},set_hms:function(t,e,i,o,n){t.setUTCHours(e),t.setUTCMinutes(i),t.setUTCSeconds(o),t.setUTCMilliseconds(n)},add_days_considering_dst:function(t,e,i){var o,n=t.offset_utc(e),s=this.clone(e);return this.add_date(s,i),o=t.offset_utc(s),s.setTime(s.getTime()+n-o),s},add_date:function(t,e){t.setTime(t.getTime()+e*c.secondsPerDay)},clone:function(t){return new Date(t.getTime())},get_days_per_year:function(t){var e=t.getUTCFullYear();return this.days_per_year(e)},days_per_year:function(t){return t%4!=0||t%100==0&&t%400!=0?365:366},get_part:function(t,e){switch(e){case c.YEAR:return c.get_year(t);case c.MONTH:return c.get_month(t);case c.DAY_OF_MONTH:return c.get_day_of_month(t);case c.WEEK_OF_YEAR:return c.get_week_of_year(t);case c.DAY_OF_WEEK:return c.get_day_of_week(t);case c.HOUR_OF_DAY:return c.get_hours(t);case c.MINUTE:return c.get_minutes(t);case c.DAY_OF_YEAR:return c.get_day_of_year(t);case c.SECOND:return c.get_seconds(t);default:return t.getTime()}},time_minutes:r,time_seconds:a,time_minutes_diff:l,time_seconds_diff:h,utc_to_cal:function(t,e){var i=t.offset_utc(e);return new Date(e+i)},get_cal:function(t,e,i,o){var n=new Date(Date.UTC(e,i,o)),s=t.offset_utc(+n);return new Date(n.valueOf()-s)},get_cal_utc:function(t,e,i){return new Date(Date.UTC(t,e,i))},cal_to_utc:function(t,e){var i=e.getTime();return i-t.offset_loc(i)},get_timezone:function(t){return new o(t)},shift_day:function(t,e){var i=t-1;return i+=e,i>6?i%=7:i<0&&(i=(7+i%7)%7),i+1}},t.exports=c},function(t,e){!function(){var e={"America/New_York":{time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1536530400,-1523224800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-76941e4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-17762,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Los_Angeles":{time:[-2717668378,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-769420800,-765410400,-687996e3,-662680800,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356e3,-337212e3,-323906400,-305762400,-292456800,-273708e3,-261007200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Chicago":{time:[-2717668236,-1633298400,-1615154400,-1601848800,-1583704800,-1563746400,-1551650400,-1538949600,-1520200800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1067810400,-1045432800,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-769413600,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-21036,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"America/Phoenix":{time:[-2717670498,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-820540740,-812678340,-796867140,-84405600,-68680800,1924966800],offset:[-26898,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"America/Toronto":{time:[-2366755200,-1632088800,-1615154400,-1601771400,-1583712e3,-1567375200,-1554681600,-1534716e3,-1524088800,-1503266400,-149238e4,-1471816800,-1460930400,-1440972e3,-1428876e3,-1409522400,-1397426400,-1378072800,-1365976800,-1346623200,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1188770400,-1176069600,-1157320800,-1144015200,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-880232400,-76941e4,-765410400,-747266400,-733960800,-715824e3,-702518400,-684374400,-671068800,-652924800,-634176e3,-620863200,-602719200,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-19052,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Vancouver":{time:[-2713910400,-1632088800,-1615154400,-880236e3,-769420800,-765410400,-747266400,-732751200,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356e3,-337212e3,-323906400,-305762400,-292456800,-273708e3,-261007200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-29548,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Argentina/Buenos_Aires":{time:[-2372112e3,-1567468800,-1233446400,-1222992e3,-1205971200,-1194048e3,-117288e4,-1162512e3,-1141344e3,-1130976e3,-1109808e3,-109944e4,-1078272e3,-1067817600,-1046649600,-1036281600,-1015113600,-1004745600,-983577600,-973209600,-952041600,-941587200,-931046400,-900892800,-890352e3,-83376e4,-82728e4,-752284800,-733795200,-197337600,-190857600,-184204800,-164505600,-152668800,-132969600,-121132800,-101433600,-86832e3,-71107200,-54777600,-39052800,-23328e3,-7603200,128131200,136598400,596937600,605059200,624412800,636508800,656467200,667958400,687916800,699408e3,719366400,731462400,938912400,952041600,1198972800,1205625600,1224374400,1237075200,1924981200],offset:[-14028,-15408,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-10800,-10800,-7200,-10800,-7200,-10800]},"America/El_Salvador":{time:[-1546300800,546998400,559699200,578448e3,591148800,1924970400],offset:[-21408,-21600,-18e3,-21600,-18e3,-21600]},"America/Sao_Paulo":{time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184e4,-570758400,-560217600,-539136e3,-53136e4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816e3,761702400,782265600,793152e3,813715200,823996800,84456e4,856051200,876096e3,888710400,908064e3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904e3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232e4,1203206400,1224374400,1234656e3,1255824e3,1266710400,1287273600,129816e4,1318723200,1330214400,1350777600,1361059200,1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576e3,1487462400,1508025600,1518912e3,154008e4,1550361600,1571529600,1581811200,1602979200,1613865600,1634428800,1645315200,1665878400,1677369600,1697328e3,1708214400,1729382400,1739664e3,1760832e3,1771718400,1792281600,1803168e3,1823731200,1834617600,1855180800,1866067200,1887235200,1897516800,1918684800,1928966400],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,1924974e3],offset:[-17776,-17776,-18e3,-14400,-18e3]},"Europe/Moscow":{time:[-2840140800,-1688256e3,-165681e4,-1641340800,-1627956e3,-1618700400,-1596416400,-1593813600,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670388400,686113200,695786400,701823600,717548400,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1414288800,1925002800],offset:[9017,9017,9079,12679,9079,16279,12679,16279,14400,10800,14400,18e3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,-1182988800,-1178150400,-906854400,-904867200,-85725e4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036e3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Berlin":{time:[-2422051200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-776552400,-765925200,-761173200,-748476e3,-733266e3,-717627600,-714603600,-71037e4,-701902800,-684972e3,-670453200,-654127200,-639003600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{time:[-3852662400,-1691964e3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034e3,-1570399200,-1552165200,-1538344800,-152253e4,-15075e5,-1490562e3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732e3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314e3,-1315778400,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-118998e4,-1175461200,-1159135200,-1143406800,-1126476e3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058e3,-1032127200,-1017608400,-1001282400,-986158800,-969228e3,-950475600,-942012e3,-904514400,-896043600,-875484e3,-864594e3,-844034400,-832539600,-812584800,-798066e3,-781048800,-772059600,-764802e3,-748476e3,-733352400,-719445600,-717026400,-706741200,-699483600,-687996e3,-668034e3,-654732e3,-636584400,-622072800,-605739600,-590623200,-57429e4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422e4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298e3,-306972e3,-291848400,-276732e3,-257979600,-245282400,-22653e4,-213228e3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484e3,-100731600,-88034400,-68677200,-59004e3,57726e3,69818400,89175600,101268e3,120625200,132717600,152074800,164167200,183524400,196221600,214974e3,227671200,246423600,259120800,278478e3,290570400,309927600,32202e4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676e3,543978e3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428e3,76473e4,782877600,796179600,814327200,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],offset:[-75,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Madrid":{time:[-2177452800,-1661734800,-1648425600,-1631926800,-1616889600,-1601254800,-1585353600,-1442451600,-1427673600,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1029114e3,-1017619200,-1002848400,-986169600,-969238800,-954115200,-940208400,-873075600,-862531200,-842835600,-828230400,-811386e3,-796003200,-779936400,-765414e3,-748486800,-733881600,-652323600,-639183600,135126e3,150253200,167180400,181702800,196815600,212547600,22887e4,243997200,260406e3,276051600,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[-884,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Paris":{time:[-2486678340,-1855958340,-1689814800,-1680393600,-1665363600,-1648339200,-1635123600,-1616889600,-1604278800,-158544e4,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1470618e3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224e3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1253494800,-1238371200,-1221440400,-1206921600,-1191200400,-1175472e3,-1160355600,-1143417600,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942012e3,-932432400,-85725e4,-844552800,-828219600,-812498400,-800064e3,-796258800,-781048800,-766616400,196822800,212547600,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Warsaw":{time:[-2840140800,-1717027200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1600466400,-1587157200,-1501718400,-931730400,-85725e4,-844552800,-828219600,-812498400,-796600800,-778723200,-762652800,-748483200,-733266e3,-715212e3,-701902800,-684972e3,-670453200,-654127200,-639003600,-397090800,-386805600,-371084400,-355356e3,-334191600,-323301600,-307580400,-291852e3,-271292400,-260402400,-239842800,-228952800,-208393200,-197503200,-176338800,-166053600,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404e3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Australia/Sydney":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Australia/Brisbane":{time:[-2366755200,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,625629600,636519600,657079200,667969200,688528800,699418800,1925028e3],offset:[36728,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3]},"Australia/Adelaide":{time:[-2364076800,-2230156800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,637729200,657079200,667969200,688528800,701233200,719978400,731473200,752032800,764132400,783482400,796186800,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,972784800,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[33260,32400,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800]},"Australia/ACT":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Asia/Almaty":{time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,701823600,717548400,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1925013600],offset:[18468,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600]},"Asia/Ashkhabad":{time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670388400,686113200,688521600,695786400,192501e4],offset:[14012,14400,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,18e3,14400,14400,18e3]},"Asia/Tokyo":{time:[-2587678861,-2335219200,-1017792e3,-683762400,-672357600,-654732e3,-640908e3,-620258400,-609458400,-588808800,-578008800,1925024400],offset:[33539,32400,32400,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400]},"Asia/Taipei":{time:[-2335219200,-1017792e3,-766191600,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-639100800,-620784e3,-607564800,-589248e3,-576028800,-562896e3,-541728e3,-528681600,-510192e3,-497145600,-478656e3,-465609600,-449798400,-433987200,-418176e3,-402451200,-38664e4,-370915200,-355104e3,-339379200,-323568e3,-302486400,-291945600,-270950400,-260409600,134006400,149817600,165542400,181353600,299635200,307584e3,1925020800],offset:[29160,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Singapore":{time:[-2177452800,-2038176e3,-1167609600,-1073001600,-894153600,-879638400,-766972800,-138758400,378691200,1925020800],offset:[24925,24925,25200,26400,26400,27e3,32400,27e3,27e3,28800]},"Asia/Shanghai":{time:[-2177452800,-933465600,-923097600,-908755200,-891561600,515548800,52704e4,545184e3,558489600,576633600,589939200,608688e3,621993600,640137600,653443200,671587200,684892800,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Seoul":{time:[-1948752e3,-1830384e3,-1017792e3,-767318400,-498096e3,-462672e3,-451699200,-429753600,-418262400,-399513600,-387417600,-368064e3,-355968e3,-336614400,-324518400,-305164800,-293068800,-264902400,547610400,560919600,57906e4,592369200,1925024400],offset:[30472,30600,32400,32400,32400,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,32400,36e3,32400,36e3,32400]},"Asia/Tehran":{time:[-1704153600,-757382400,247190400,259286400,277776e3,283996800,290822400,306547200,322444800,338515200,673228800,685497600,701222400,71712e4,732758400,748656e3,764294400,780192e3,795830400,811728e3,827366400,843264e3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768e4,1253577600,1269216e3,1285113600,1300752e3,1316649600,1332288e3,1348185600,1363910400,1379808e3,1395446400,1411344e3,1426982400,144288e4,1458518400,1474416e3,1490140800,1506038400,1521676800,1537574400,1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1679443200,1695340800,1710979200,1726876800,1742601600,1758499200,1774137600,1790035200,1805673600,1821571200,1837209600,1853107200,1868745600,1884643200,1900368e3,1916265600,1931904e3],offset:[12344,12344,12600,14400,18e3,14400,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Dubai":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Kolkata":{time:[-2840140800,-891561600,-872035200,-862617600,-764121600,1925011800],offset:[21208,21200,23400,19800,23400,19800]},"Asia/Hong_Kong":{time:[-2056665600,-907360200,-891635400,-884217600,-766713600,-747952200,-728512200,-717021e3,-694470600,-683757e3,-668032200,-654726600,-636582600,-623277e3,-605133e3,-591827400,-573683400,-559773e3,-542320200,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877e3,-308781e3,-288822600,-277331400,-257373e3,-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509e3,-132784200,-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381e3,9343800,25068600,40793400,56518200,72243e3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371e3,295414200,309324600,1925020800],offset:[27402,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],offset:[24124,24124,25200]},"Pacific/Auckland":{time:[-3192393600,-1330293600,-1320012e3,-1300658400,-1287352800,-1269208800,-1255903200,-1237759200,-1224453600,-1206309600,-1192399200,-117486e4,-1160949600,-1143410400,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,152676e3,162356400,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,510116400,530676e3,541566e3,562125600,573620400,59418e4,60507e4,623815200,637729200,655264800,669178800,686714400,700628400,718164e3,732682800,749613600,764132400,781063200,795582e3,812512800,827031600,844567200,858481200,876016800,889930800,907466400,921985200,938916e3,953434800,970365600,984884400,100242e4,1016334e3,1033869600,1047783600,1065319200,1079838e3,1096768800,1111287600,1128218400,1142737200,1159668e3,1174186800,1191117600,1207450800,1222567200,1238900400,1254016800,127035e4,1285466400,1301799600,1316916e3,1333249200,1348970400,1365303600,138042e4,1396753200,1411869600,1428202800,1443319200,1459652400,1474768800,1491102e3,1506218400,1522551600,1538272800,1554606e3,1569722400,1586055600,1601172e3,1617505200,1632621600,1648954800,1664071200,1680404400,1695520800,1712458800,1727575200,1743908400,1759024800,1775358e3,1790474400,1806807600,1821924e3,1838257200,1853373600,1869706800,1885428e3,1901761200,1916877600,1933210800],offset:[41944,41400,45e3,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800]},"Pacific/Chatham":{time:[-3192393600,-757382400,152678700,162359100,183523500,195018300,215577900,226467900,247027500,257917500,278477100,289367100,309926700,320816700,341376300,352266300,372825900,384320700,404880300,415770300,436329900,447219900,467779500,478669500,499229100,510119100,530678700,541568700,562128300,573623100,594182700,605072700,623817900,637731900,655267500,669181500,686717100,700631100,718166700,732685500,749616300,764135100,781065900,795584700,812515500,827034300,844569900,858483900,876019500,889933500,907469100,921987900,938918700,953437500,970368300,984887100,1002422700,1016336700,1033872300,1047786300,1065321900,1079840700,1096771500,1111290300,1128221100,1142739900,1159670700,1174189500,1191120300,1207453500,1222569900,1238903100,1254019500,1270352700,1285469100,1301802300,1316918700,1333251900,1348973100,1365306300,1380422700,1396755900,1411872300,1428205500,1443321900,1459655100,1474771500,1491104700,1506221100,1522554300,1538275500,1554608700,1569725100,1586058300,1601174700,1617507900,1632624300,1648957500,1664073900,1680407100,1695523500,1712461500,1727577900,1743911100,1759027500,1775360700,1790477100,1806810300,1821926700,1838259900,1853376300,1869709500,1885430700,1901763900,1916880300,1933213500],offset:[44028,44100,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500]},"Pacific/Fakaofo":{time:[-2177452800,1325203200,1925038800],offset:[-41096,-39600,46800]},"Pacific/Honolulu":{time:[-2334139200,-1157320800,-1155470400,-880236e3,-765410400,-712188e3,1924956e3],offset:[-37886,-37800,-34200,-37800,-34200,-37800,-36e3]},"America/Mexico_City":{time:[-1514763396,-1343091600,-1234828800,-1220317200,-1207180800,-1191369600,-975283200,-963187200,-917136e3,-907372800,-821923200,-810086400,-627523200,-613008e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,989114400,1001815200,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1175392800,1193536800,1207447200,1224986400,1238896800,1256436e3,1270346400,1288490400,1301796e3,131994e4,1333245600,1351389600,13653e5,1382839200,1396749600,1414288800,1428199200,1445738400,1459648800,1477792800,1491098400,1509242400,1522548e3,1540692e3,1554602400,1572141600,1586052e3,1603591200,1617501600,1635645600,1648951200,1667095200,1680400800,1698544800,1712455200,1729994400,1743904800,1761444e3,1775354400,1792893600,1806804e3,1824948e3,1838253600,1856397600,1869703200,1887847200,1901757600,1919296800,1933207200],offset:[-23796,-25200,-21600,-25200,-21600,-25200,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"Africa/Johannesburg":{time:[-2458166400,-2109283200,-860968800,-845244e3,-829519200,-813794400,1924999200],offset:[6720,5400,7200,10800,7200,10800,7200]},"Asia/Kathmandu":{time:[-1577923200,504921600,1925012700],offset:[20476,19800,20700]},"US/Mountain":{time:[-2717668796,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1538949600,-1534111200,-880236e3,-769417200,-765410400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-25196,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]}};void 0!==t&&t.exports?t.exports=e:window.TzData=e}()},function(t,e,i){(function(t,e){function o(t){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}}),TradingView.merge(this,t);var e=t.fullId||t.id;TradingView.merge(this,o.parseIdString(e)),this.name=this.id}var n=i(140).assert;o.VERSION_STUDY_ARG_SOURCE=41,o.METAINFO_FORMAT_VERSION_SOS_V2=42,o.VERSION_PINE_PROTECT_TV_4164=43,o.CURRENT_METAINFO_FORMAT_VERSION=43,o.CHILD_STUDY_ALLOWED_PLOT_TYPES=["line"],o.CHILD_STUDY_EXCLUDE_IDS=["CorrelationCoefficient@tv-basicstudies"],o.CHILD_STUDY_PARENT_EXCLUDE_IDS=[],o.FilledArea={},o.FilledArea.TYPE_PLOTS="plot_plot",o.FilledArea.TYPE_HLINES="hline_hline",o.versionOf=function(t){var e="_metainfoVersion"in t&&isNumber(t._metainfoVersion)?t._metainfoVersion:0;return e<0&&TradingView.logError("Metainfo format version cannot be negative: "+e),e>o.CURRENT_METAINFO_FORMAT_VERSION&&TradingView.logWarn("Client doesn't support this version of metainfo format: "+e),e},o.parseIdString=function(t){var e,i,o,n,s={};if(t.indexOf("@")===-1)s.shortId=t,s.packageId="tv-basicstudies",s.id=t+"@"+s.packageId,s.version=1;else if(e=t.split("@"),s.shortId=e[0],i=e[1].split("-"),3===i.length)s.packageId=i.slice(0,2).join("-"),s.id=s.shortId+"@"+s.packageId,s.version=i[2];else if(1===i.length&&"decisionbar"===i[0])s.packageId="les-"+i[0],s.id=s.shortId+"@"+s.packageId,s.version=1;else{if(1!==i.length)throw Error("unexpected study id:"+t);s.packageId="tv-"+i[0],s.id=s.shortId+"@"+s.packageId,s.version=1}return s.fullId=s.id+"-"+s.version,"tv-scripting"===s.packageId?(o=s.shortId,0===o.indexOf("Script$")||0===o.indexOf("StrategyScript$")?(n=o.indexOf("_"),s.productId=n>=0?o.substring(0,n):s.packageId):s.productId=s.packageId):s.productId=s.packageId,s},o.getPackageName=function(t){return(/^[^@]+@([^-]+-[^-]+)/.exec(t||"")||[0,"tv-basicstudies"])[1]},o.cutFullId=function(t){return t.replace(/(@[^-]+-[^-]+).*$/,"$1")},o.cutDollarHash=function(t){var e,i,o=t.indexOf("$"),n=t.indexOf("@");return o===-1?t:(e=t.substr(0,o),i=n>=0?t.substr(n):"",e+i)},o.cutScriptIdPart=function(t){var e=t.indexOf("$"),i=t.indexOf("@");return e<0&&i>=0?"":t.substring(Math.max(e+1,0),i>=0?i:t.length)},o.hasUserIdSuffix=function(t){return/^USER;[\d\w]+;\d+$/.test(t)},o.getSourceIdByInputs=function(t,e){var i,n,s;if(!Array.isArray(t)||!e)return null;for(i=0;i<t.length;++i)if(n=t[i],o.isSourceInput(n)&&"string"==typeof e[n.id])return s=e[n.id],~s.indexOf("$")&&(s=s.split("$")[0]),s;return null},o.getSourceInputIds=function(t){var e,i,n=[],s=t.inputs;for(e=0;e<s.length;++e)i=s[e],o.isSourceInput(i)&&n.push(i.id);return n},o.setChildStudyMetaInfoPropertiesSourceId=function(e,i,n){var s,r,a,l;for(s=0;s<e.inputs.length;++s)r=e.inputs[s],o.isSourceInput(r)&&n instanceof t&&n.inputs&&n.inputs[s]&&(a=n.inputs[r.id].value(),a.indexOf("$")>0&&(l=a.replace(/^[^\$]+/,i),n.inputs[r.id].setValue(l)))},o.patchChildStudyMetaInfoState=function(t){function e(t){if("object"==typeof t)for(var i in t)"string"==typeof t[i]&&/^[^\$]+\$\d+$/.test(t[i])?t[i]=t[i].replace(/^[^\$]+/,"{pid}"):e(t[i])}t.state&&e(t.state.inputs),t.state.isChildStudy=!0},o.prototype.parseValue=function(t,e){return"bool"===t?TradingView.parseBool(e):e},o.prototype.defaultInputs=function(){var t,e=[];for(t=0;t<this.inputs.length;t++)e.push(this.inputs[t].defval);return e},o.prototype.state=function(t){var e,i={};for(e in this)this.hasOwnProperty(e)&&(i[e]=this[e],t!==!0&&"id"===e&&(i[e]+="-"+this.version));return i},o.findStudyMetaInfoByDescription=function(t,e){if(t){for(var i=0;i<t.length;++i)if(t[i].description.toLowerCase()===e.toLowerCase())return t[i];throw Error("unexpected study id:"+e)}throw Error("There is no studies metainfo")},o._findStudyMetaInfo=function(t,e){for(var i=0;i<t.length;i+=1)if(t[i].id===e)return[i,t[i]];return[]},o.findStudyMetaInfo=function(t,e){if(!t)throw new ReferenceError("There is no studies metainfo");var i=o._findStudyMetaInfo(t,e)[1];if(!i)throw new ReferenceError("unexpected study id:"+e);return i},o.isParentSourceId=function(t){return"string"==typeof t&&/^[^\$]+\$\d+$/.test(t)},o.isSourceInput=function(t){return t.id&&(("source"===t.id||"src"===t.id)&&("text"===t.type||"source"===t.type)||"source"===t.type)},o.getChildSourceInputTitles=function(t,e,i){var n,s,r,a,l={};if(e.plots&&e.plots.length&&t.options&&t.options.length)for(n=0;n<t.options.length;++n)s=t.options[n],r=s&&+s.split("$")[1],(a=isFinite(r)&&e.plots[r])&&~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(a.type)&&(l[s]=e.styles&&e.styles[a.id]&&e.styles[a.id].title||a.id,i&&(l[s]=i+":"+l[s]));return l},o.removeStudyMetaInfo=function(t,e,i){var n=function(i){return void 0!==(i=void 0!==i?i:o._findStudyMetaInfo(t,e)[0])&&(t.splice(i,1),defaults.remove("study_"+e),!0)};if(t)return n(i);throw Error("There are no studies metainfo")},o.addOrReplaceStudyMetaInfo=function(t,e){var i,n=new o(e),s=o._findStudyMetaInfo(t,n.id),r=s[0];if(s[1])o.removeStudyMetaInfo(t,n.id,r);else{if(0===e.id.indexOf("ElliottWave@tv-basicstudies-"))return null;o.removeStudyMetaInfo(t,n.id,r)&&TradingView.logDebug("Study with id="+n.id+" already exists in the model!")}return t.push(n),n.defaults&&(i=TradingView.clone(n.defaults),i.precision="default",defaults.create("study_"+n.fullId,i)),n},o.createDefaultsForStudy=function(t){var e,i=new o(t);i.defaults&&(e=TradingView.clone(i.defaults),applyOverridesToStudies("study_"+i.fullId,e))},o.createMetaInfoStub=function(t,e){var i,o,s;return n(TradingView.isExistent(t.scriptIdPart),"scriptIdPart is missing, study: "+JSON.stringify(t)),i=t.extra&&"strategy"===t.extra.kind||t.isTVScriptStrategy===!0,o=TVScript.createScriptStudyId(t.scriptIdPart,e,i),s={isTVScriptStubToCompile:!0,id:o,scriptIdPart:t.scriptIdPart,description:t.scriptName,TVScriptSourceCode:t.scriptSource,is_hidden_study:t.extra&&t.extra.is_hidden_study,extra:t.extra,version:e},s.pine={},s.pine.version=TradingView.isExistent(t.version)?t.version:-1,s.pine.access=TVScript.Access.MAP_ID_TO_NAME[t.access],i===!0&&(s.isTVScriptStrategy=!0),s},o.isScriptStrategy=function(t){if(t.extra&&t.extra.kind)return t.extra.kind===TVScript.Kinds.STRATEGY;if(t.isTVScriptStrategy===!0)return!0;var e=t.TVScriptSourceCode||t.scriptSource;return!!e&&TVScript.isStrategy(e)},o.replaceWithFullStudyMetaInfoAsync=function(t,e){var i=$.Deferred();return e.isTVScriptStubToCompile||i.resolve(e),i.promise()},o.getOrderedInputIds=function(t){var e,i,o=[],n=t.inputs;for(e=0;e<n.length;++e)i=n[e],o.push(i.id);return o},o.canBeChild=function(t){var e,i,n;if(t&&"string"==typeof t)return!0;if(!t||t.extra&&null!=t.extra.sourceInputsCount&&1!==t.extra.sourceInputsCount||t.canNotBeChild===!0||t.canBeChild===!1||~o.CHILD_STUDY_EXCLUDE_IDS.indexOf(t.id)||t.isTVScriptStrategy||t.TVScriptSourceCode&&TVScript.isStrategy(t.TVScriptSourceCode))return!1;if(t.isTVScriptStubToCompile)return!0;for(e=t.inputs,i=0,n=0;n<e.length;++n)o.isSourceInput(e[n])&&++i;return 1===i},o.canHaveChildren=function(t){if(t){if(t.isTVScriptStrategy||t.TVScriptSourceCode&&TVScript.isStrategy(t.TVScriptSourceCode))return!1;if(t.id&&!~o.CHILD_STUDY_PARENT_EXCLUDE_IDS.indexOf(t.id)&&Array.isArray(t.plots))for(var e=0;e<t.plots.length;++e)if(~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(t.plots[e].type))return!0}return!1},TradingView.StudyMetaInfo=o,void 0!==e&&e&&e.exports&&(e.exports=o)}).call(e,i(83),i(8)(t))},function(t,e){"use strict";function i(t,e){if(!t)throw Error("Assertion failed"+(e?": "+e:""))}e.assert=i},function(t,e,i){"use strict";function o(t){return t+"("+new Date(1e3*t).toUTCString()+")"}function n(t){var e,i,o,n;return t+="",e=t.slice(0),i=!1,o=e[e.length-1],"DWM".indexOf(o)===-1&&"S"!==o&&(i=!0,o=""),n=parseInt(i?e:e.length>1?e.slice(0,e.length-1):1),{resolution:o,interval:n}}var s,r=i(142),a=i(137),l=i(93),h=!1,c=null,d=0,p=function(t,e){this._session=new r.Session,this._session.init(t.timezone,t.session),this._symbolInfo=t,this._resolution=e,this._extrapolatedData=[],this._modelId=d++,this._valid=!!t.timezone&&!!t.session,h&&console.log('Created model "{0}", interval "{1}", session "{2}", tz "{3}"'.format(this._modelId,this._resolution,t.session,t.timezone))};p.prototype.uniqueId=function(){return this._modelId},p.prototype.isValid=function(){return this._valid},p.prototype._barBuilder=function(){if(!this._builderCache){var t=n(this._resolution);this._builderCache=r.newBarBuilder(t.resolution,t.interval,this._session,this._session)}return this._builderCache},p.prototype.distance=function(t,e){var i,n,s,a,l;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||1e3*e>n)&&(s=500,a=r.extrapolateBarsFrontToTime(this._barBuilder(),n||1e3*t,1e3*e,s),this._extrapolatedData=this._extrapolatedData.concat(a)),(n=this._extrapolatedData[this._extrapolatedData.length-1])<1e3*e?{success:!1}:(l=this._extrapolatedData.indexOf(1e3*e),l!==-1?(h&&console.log('Model "{0}" "{1}", distance between "{2}" and "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),o(e),l)),{success:!0,result:l}):{success:!1})):{success:!1}},p.prototype.projectTime=function(t,e){var i,n,s,a;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||e>=this._extrapolatedData.length)&&(s=r.extrapolateBarsFrontByCount(this._barBuilder(),n||1e3*t,e-this._extrapolatedData.length+1),this._extrapolatedData=this._extrapolatedData.concat(s)),e<this._extrapolatedData.length?(a=this._extrapolatedData[e]/1e3,h&&console.log('Model "{0}" "{1}", proj.time from "{2}" offset "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),e,o(a))),a):t):t},s=function(t,e){this._source=t,this._target=e,this._isSessionTheSame=t._symbolInfo.timezone===e._symbolInfo.timezone&&t._symbolInfo.session===e._symbolInfo.session,this._isResolutionTheSame=t._resolution===e._resolution,this._shouldCorrectTradingDay=l.isDWM(t._resolution)&&!this._isSessionTheSame,this._cache={},null===c&&(c=new r.Session,c.init("UTC","24x7"))},s.prototype._sourceTargetBuilder=function(){var t,e;return this._sourceTargetBuilderCache||(t=n(this._target._resolution),e=this._isSessionTheSame?this._target._session:c,this._sourceTargetBuilderCache=r.newBarBuilder(t.resolution,t.interval,this._target._session,e)),this._sourceTargetBuilderCache},s.prototype.sourceTimeToTargetTime=function(t){var e,i,n,s,r,l;return this._isSessionTheSame&&this._isResolutionTheSame?t:isNumber(t)&&this._source.isValid()&&this._target.isValid()?(e=this._cache[t],e||(i=1e3*t,this._shouldCorrectTradingDay&&(n=a.utc_to_cal(this._source._session.timezone,i),n=this._source._session.spec.correctTradingDay(n,this._source._session.timezone),s=new Date(n),a.set_hms(s,0,0,0,0),i=s.valueOf()),r=this._sourceTargetBuilder(),r.moveTo(i),l=r.indexOfBar(i),e=r.startOfBar(Math.max(0,l))/1e3,this._cache[t]=e),h&&console.log('Model "{0}" "{1}" sourceTime "{2}" => model "{3}" "{4}" targetTime "{5}"'.format(this._source.uniqueId(),this._source._resolution,o(t),this._target.uniqueId(),this._target._resolution,o(e))),e):t},t.exports.SyncPoint=s,t.exports.SyncModel=p},function(t,e,i){(function(e){"use strict";var o=function(){function t(t,e,i,n){return""===t?new h(60*e,i):"S"===t?new h(e,i):new c(i,n,e,o(t,i))}function o(t,e){switch(t){case"D":return new S(e);case"W":return new T(e);case"M":return new C(e)}return console.error("unknown dwm resolution: "+t),null}function n(t,e,i,o,n){var s,r,a,l,h,c,d,p=(new A).init("UTC",t),u=""!==e;return u?(r=i*F[e],s=F.D):(r=60*i*1e3,s=60*p.spec.findSession(0,0)._length*1e3),a=s/r,l=u?7:7-p.spec.weekEndsCount(),h=l*a,o<h?(c=o/a,n-c*F.D):(d=o/h,n-d*F.W)}function s(t,e,i,o){if("number"!=typeof i||"number"!=typeof e||isNaN(i)||isNaN(e))throw Error("Cannot extrapolate from "+e+" to "+i);return a(t,e,function(t,e){return e>i||o&&t.length>o})}function r(t,e,i){return a(t,e,function(t,e){return t.length>=i})}function a(t,e,i){var o,n,s,r,a,l=e;for(t.moveTo(l),o=[],n=0,s=0;!i(o,l);){if(n>5)throw console.trace(["0x10",new Date(e),"->",new Date(l)]),Error("Internal error 0x10 while extrapolating.");if((r=t.indexOfBar(l))===O)l=t.startOfBar(0);else if(r===B)l=t.startOfBar(B);else{if((a=t.startOfBar(r))!==e){if(s&&s===a)throw console.trace(["0x11",new Date(e),"->",new Date(a)]),Error("Internal error 0x11 while extrapolating.");s=a,n=0,o.push(a)}l=t.startOfBar(r+1)}t.moveTo(l),n++}return o}function l(t){if(isNaN(t))return NaN;var e=this.indexOfBar(t);return e===B&&(this.moveTo(t),e=this.indexOfBar(t)),e<0?NaN:this.startOfBar(e)}function h(t,e){this.period=t,this.session=e,this.sessionStart=Number.MIN_VALUE,this.sessionEnd=Number.MIN_VALUE}function c(t,e,i,o){this.period=i,this.sessionTgt=t,this.sessionSrc=e||t,this.builder=o,this.periodStart=-Number.MAX_VALUE,this.periodEnd=-Number.MAX_VALUE,this.periodLastBarStart=-Number.MAX_VALUE}function d(t,e,i){var o=6e4,n=new Date(e.valueOf()+t*o);return t+(i.offset_loc(e)/o-i.offset_loc(n)/o)}function p(t,e,i){var o=N.clone(i);return e.alignToSessionStart(o,t),N.cal_to_utc(t,o)}function u(t){return t.firstDayOfWeek}function _(t,e){var i=N.get_day_of_week(e)-u(t);return i<0?i+7:i}function f(t,e){var i=e+u(t);return i>N.SATURDAY?i-N.SATURDAY:i}function m(t,e){var i=N.get_day_of_year(e)-1,o=_(t,e)-i%7;return 0===o?x(i/7):(o>=0&&(o-=7),x((o+i)/7))}function g(t,e,i){var o,n=0;for(o=e;o<i;++o)n+=t.isWeekEnd(f(t,o))?1:0;return n}function v(t,e){var i=new Date(Date.UTC(e,11,31,23,59)),o=N.days_per_year(e)-y(t,i);return N.get_day_of_week(i)!==N.SUNDAY&&N.get_day_of_week(i)!==N.SATURDAY||o--,o}function y(t,e){var i,o,n=N.get_day_of_year(e)-1,s=_(t,e),r=s-n%7;return r<0&&(r+=7),i=0,n<7-r?i+=g(t,r,s):(o=0===r?0:g(t,r,7),i+=g(t,0,s)+o),i+m(t,e)*t.weekEndsCount()}function b(){}function w(t){this.sessionsSpec=t}function S(t){this.session=t}function T(t){this.session=t}function C(t){this.session=t}function x(t){return 0|t}function P(t){return t%100+60*x(t/100)}function L(t,e,i){this._dayOfWeek=t,this._start=e,this._length=i}function k(t,e){return t.compareTo(e)}function I(t){function e(t){var e,i,o,s=t.split(";");return s.length>2?(console.error("Only one `first day` specification expected @ session "+t),t):1===s.length?t:(e=1,i=s[0].indexOf("-")>=0,o=i?NaN:parseInt(s[0]),isNaN(o)&&(e=0,o=parseInt(s[1])),o<N.SUNDAY||o>N.SATURDAY?(console.error("Unexpected day index @ session: "+t+"; day index "+o),t):(n.firstDayOfWeek=o,s[e]))}var i,o,n=this;t=t||"0000-0000",this.entries=[],this.firstDayOfWeek=N.MONDAY,"24x7"===t.toLowerCase()?D.forEach(function(t){this.addSessionEntry(t,0,0)},this):(t=e(t),i=!1,o={},t.split("|").forEach(function(t){var e,n,s=t.split(":");1!==s.length&&2!==s.length&&console.error("bad session section: "+t),e=1===s.length,e&&(i&&console.error("duplicated default section: "+t),i=!0),n=e?$:E(s[1]),n.forEach(function(t){e&&o[t]||(o[t]=s[0])},this)},this),D.forEach(function(e){var i=o[e];i&&i.split(",").forEach(function(i){var o,n,s=i.split("-");2!==s.length&&(console.error("bad sessions spec: "+t),s=["0000","0000"]),o=parseInt(s[0]),n=parseInt(s[1]),this.addSessionEntry(e,P(o),P(n))},this)},this)),this.entries.sort(k)}function E(t){var e,i,o=[];for(e=0;e<t.length;e++)i=t.charAt(e)-"0",-1===o.indexOf(i)&&o.push(i);return o}function A(){}function V(t,e,i){var o,n,s,r,a=t.length;if(0===a)return-1;for(o=0,n=a-1,s=x((o+n)/2);;){if(0===(r=i(t[s],e))||r>0){if((n=s-1)<o)return s}else if(o=s+1,n<o)return s<a-1?s+1:-1;s=x((o+n)/2)}}function M(t,e){var i=N.utc_to_cal(e.timezone,+t),o=N.get_day_of_week(i),n=N.get_minutes_from_midnight(i),s=e.spec.findSession(o,n);return s.isOvernight()&&n>s._start+s._length&&o===s._dayOfWeek-1&&(o++,n-=1440),o===s._dayOfWeek&&n>=s._start&&n<s._start+s._length}var $,D,O=-1,B=-2,R="undefined"!=typeof window?window:e,N=R.PineJsCalendar?R.PineJsCalendar:i(137),F={S:1e3,D:864e5,W:6048e5,M:2592e6};return h.prototype.alignTime=l,h.prototype.alignTimeIfPossible=function(t){var e=this.alignTime(t);return isNaN(e)?t:e},h.prototype.indexOfBar=function(t){return t<this.sessionStart?O:t>=this.sessionEnd?B:x(N.time_seconds_diff(t,this.sessionStart)/this.period)},h.prototype.startOfBar=function(t){if(t===B)return this.sessionEnd;if(t<0)throw Error("Negative offset is not supported");return this.sessionStart+N.time_seconds(this.period*t)},h.prototype.isLastBar=function(t,e){return e>=this.sessionStart+N.time_seconds(this.period*(t+1)-1)},h.prototype.moveTo=function(t){var e=this.session.timezone,i=N.utc_to_cal(e,t),o=this.session.spec,n=o.alignToSessionStart(i,this.session.timezone);this.sessionStart=N.cal_to_utc(e,i),this.sessionEnd=this.sessionStart+N.time_minutes(n)},c.prototype.alignTime=l,c.prototype.alignTimeIfPossible=function(){throw Error("not implemented")},c.prototype.tradingDayToSessionStart=function(t){return this.moveTo(t),this.startOfBar(0)},c.prototype.indexOfBar=function(t){return t<this.periodStart?O:t>=this.periodEnd?B:0},c.prototype.startOfBar=function(t){if(t===B||t>0)return this.periodEnd;if(t===O)throw Error("PRE_SESSION is not supported");return this.periodStart},c.prototype.isLastBar=function(t,e){return e>=this.periodLastBarStart},c.prototype.moveTo=function(t){var e,i,o,n,s,r,a,l,h=N.utc_to_cal(this.sessionSrc.timezone,t);h=this.sessionSrc.spec.correctTradingDay(h,this.sessionSrc.timezone),e=this.sessionTgt.timezone,i=this.builder.indexOfPeriod(h,e),o=x(i/this.period)*this.period,n=N.get_year(h),s=this.sessionTgt.spec,r=this.builder.startOfPeriod(e,o,n),this.periodStart=p(e,s,r),a=o+this.period,l=this.builder.startOfPeriod(e,a,n),this.periodEnd=p(e,s,l)},c.prototype.moveToPrevWorkDay=function(t,e){for(;t.isWeekEnd(N.get_day_of_week(e));)N.add_date(e,-1)},b.prototype.indexOfPeriod=function(t){return N.get_day_of_year(t)-1},b.prototype.startOfPeriod=function(t,e,i){var o=N.get_cal(t,i,N.JANUARY,1),n=N.add_days_considering_dst(t,o,e);return N.utc_to_cal(t,+n)},w.prototype.uber=new b,w.prototype.indexOfPeriod=function(t){return this.uber.indexOfPeriod(t)-y(this.sessionsSpec,t)},w.prototype.startOfPeriod=function(t,e,i){function o(t,e){this.weekEnds=g(t,e,7),this.calendarDays=7-e,this.businessDays=this.calendarDays-this.weekEnds}function n(t,e){var i,o=0;for(i=t;i<7&&(r.sessionsSpec.isWeekEnd(f(r.sessionsSpec,i))||!(--e<0));++i)o++;return o}function s(t,e,i){var o,n,s,a,l,h,c=0,d=i%(7-r.sessionsSpec.weekEndsCount());for(o=0,n=d-(0===t?0:e.businessDays);o<7&&n>0;++o)s=r.sessionsSpec.isWeekEnd(f(r.sessionsSpec,o)),c+=s?1:0,n-=s?0:1;return a=e.weekEnds+c,l=x((i-e.businessDays)/(7-r.sessionsSpec.weekEndsCount())),h=a+r.sessionsSpec.weekEndsCount()*l,i+h}var r,a,l,h,c;return e>=v(this.sessionsSpec,i)&&(i++,e=0),r=this,a=new Date(Date.UTC(i,N.JANUARY,1)),l=_(this.sessionsSpec,a),h=new o(this.sessionsSpec,l),c=e<h.businessDays?n(l,e):s(l,h,e),this.uber.startOfPeriod(t,c,i)},S.prototype.indexOfPeriod=function(t){return this.builder().indexOfPeriod(t)},S.prototype.startOfPeriod=function(t,e,i){return this.builder().startOfPeriod(t,e,i)},S.prototype.builder=function(){return this._builder||(this._builder=this.session.spec.hasWeekEnds()?new w(this.session.spec):new b),this._builder},T.prototype.indexOfPeriod=function(t,e){var i=m(this.session.spec,t);return 0===i&&t<this.startOfPeriod(e,0,N.get_year(t))&&(i=-1),i},T.prototype.startOfPeriod=function(t,e,i){var o,n,s=new Date(Date.UTC(i,N.JANUARY,1)),r=_(this.session.spec,s),a=0===r?7*e:7*(e+1)-r,l=N.get_days_per_year(s);return a>l?this.startOfPeriod(t,0,i+x(a/l)):(o=N.get_cal(t,i,N.JANUARY,1),n=N.add_days_considering_dst(t,o,a),N.utc_to_cal(t,+n))},C.prototype.indexOfPeriod=function(t){return N.get_month(t)},C.prototype.startOfPeriod=function(t,e,i){var o,n,s,r;return e<0?(o=x((11-e)/12),i-=o,e+=12*o):e>N.DECEMBER&&(i++,e=N.JANUARY),n=N.get_cal_utc(i,e,1),s=_(this.session.spec,n),s>4&&(r=7-s,N.add_date(n,r)),n},L.prototype.start=function(){return this._start<0?this._start+N.minutesPerDay:this._start},L.prototype.isOvernight=function(){return this._start<0},L.prototype.dayOfWeek=function(){return this._dayOfWeek},L.prototype.length=function(){return this._length},L.prototype.weight=function(){return this._dayOfWeek*N.minutesPerDay+this._start},L.prototype.compareTo=function(t){var e=this.weight(),i=e+this._length,o=t.weight();return e<=o&&o<i?0:e>o?1:-1},$=[N.MONDAY,N.TUESDAY,N.WEDNESDAY,N.THURSDAY,N.FRIDAY],D=[N.SUNDAY,N.MONDAY,N.TUESDAY,N.WEDNESDAY,N.THURSDAY,N.FRIDAY,N.SATURDAY],I.prototype.addSessionEntry=function(t,e,i){i<=e&&0!==e&&(e-=N.minutesPerDay);var o=i===e?N.minutesPerDay:i-e;this.entries.push(new L(t,e,o))},I.prototype.isWeekEnd=function(t){var e=V(this.entries,new L(t,0,0),function(t,e){return t.dayOfWeek()-e.dayOfWeek()});return e<0||this.entries[e].dayOfWeek()!==t},I.prototype.hasWeekEnds=function(){return this.weekEndsCount()>0},I.prototype.weekEndsCount=function(){if(void 0===this._weekEndsCount){var t=[];this.entries.forEach(function(e){t[e.dayOfWeek()]=1},this),this._weekEndsCount=7-t.reduce(function(t,e){return t+(e||0)},0)}return this._weekEndsCount},I.prototype.indexOfSession=function(t,e){var i=V(this.entries,new L(t,e,0),k);return-1===i?0:i},I.prototype.findSession=function(t,e){return this.entries[this.indexOfSession(t,e)]},I.prototype.correctTradingDay=function(t,e){var i=N.get_day_of_week(t),o=60*N.get_hours(t)+N.get_minutes(t),n=this.findSession(i,o),s=n.dayOfWeek(),r=(s-i+7)%7;return 0!==r?N.add_days_considering_dst(e,t,r):t},I.prototype.alignToSessionStart=function(t,e){var i,o=N.get_day_of_week(t),n=N.get_minutes_from_midnight(t),s=this.findSession(o,n),r=s.dayOfWeek(),a=s.isOvernight(),l=(r-o+7)%7-(a?1:0);return 0!==l&&N.add_date(t,l),i=s.start(),N.set_hms(t,x(i/60),i%60,0,0),d(s.length(),t,e)},A.prototype.init=function(t,e){return this.timezone="string"==typeof t?N.get_timezone(t):t,this.spec=new I(e),this},{PRE_SESSION:O,POST_SESSION:B,LASTBAR_SESSION:-3,newBarBuilder:t,Session:A,alignPeriodsBack:n,extrapolateBarsFrontByCount:r,extrapolateBarsFrontToTime:s,lower_bound:V,isTradingNow:M,numberOfFullWeeks:m,numberOfWeekEndsSinceYearStart:y,BusinessDaysBuilder:w,alignExchangeTimeToSessionStartAndReturnUTC:p}}();t.exports=o}).call(e,function(){return this}())},function(t,e,i){"use strict";var o,n=i(144),s=i(259),r=i(271),a=i(145),l=i(82).LineDataSource,h=i(165).StudyLineDataSource,c=i(189),d=i(226),p=i(171),u=p.Study,_=p.prepareStudyPropsStateForLoadChart,f=p.prepareStudyPropertiesForLoadChart,m=p.createStudy,g=i(102),v=i(91).DefaultProperty,y=i(139),b=i(1),w=i(156).LineToolParallelChannel,S=i(196),T=i(232),C=i(161).LineToolElliott,x=i(89).PriceDataSource,P=i(258),L=i(99),k=i(140).assert,I=i(119);n.version=2,n.prototype.state=function(t,e){var i,o,s,r={};for(r.panes=[],i=0;i<this.panes().length;i++)r.panes.push(this.panes()[i].state(!0,t,!1,e));return r.timeScale=this.m_timeScale.state(t),o=null,s=this.properties(),r.chartProperties={paneProperties:s.paneProperties.state(),scalesProperties:s.scalesProperties.state(),publishedChartsTimelineProperties:o?o.state(t):void 0,chartEventsSourceProperties:s.chartEventsSourceProperties.state()},s.chartEventsSourceProperties&&(r.chartProperties.chartEventsSourceProperties=s.chartEventsSourceProperties.state()),r.version=n.version,r.timezone=this.timezone(),r},n.prototype.chartPropertiesTransparencyMigrate=function(t){var e,i,o;t.chartProperties.paneProperties.crossHairProperties&&(o=t.chartProperties.paneProperties.crossHairProperties,I.isHexColor(o.color)&&(i=o.transparency/100,e=I.hexRgbDecomp(o.color),o.color=I.rgbaComp(e,i))),t.chartProperties.paneProperties.dataWindowProperties&&(o=t.chartProperties.paneProperties.dataWindowProperties,I.isHexColor(o.color)&&(i=o.transparency/100,e=I.hexRgbDecomp(o.color),o.color=I.rgbaComp(e,i)))},n.prototype.resetDeferredStudies=function(){new o(this).reset()},n.prototype._getExceedingChildStudies=function(t){var e,i,o,n,s,r,a,l,h=[];for(e=0;e<t.length;++e)h=h.concat(t[e].sources||[]);for(i=0,o=1,n=[],s={},r=0,a=1e6;h.length&&--a;)l=h[r],(l.ownerSource&&s[l.ownerSource]||!l.ownerSource)&&(s[l.id]=l,h.splice(h.indexOf(l),1),l.ownerSource&&"Study"===l.type&&l.state&&l.state.isChildStudy&&++i>o&&n.push(l)),r=(r+1)%h.length;return n},n.prototype.restoreState=function(t,e){var i,n,s,r,a,h,c,d,p,u,_,f;if(new o(this).reset(),i={},!t.panes)return void TradingView.logDebugChart("ChartModel.restoreState: invalid state");if(!Array.isArray(t.panes))return void TradingView.logDebugChart("ChartModel.restoreState: invalid state");if(t.panes.length<1)return void TradingView.logDebugChart("ChartModel.restoreState: invalid state");if(t.chartProperties&&!t.chartProperties.timezone&&(t.chartProperties.timezone=t.timezone),t.chartProperties&&(n=TradingView.factoryDefaults("chartproperties").scalesProperties,TradingView.merge(n,t.chartProperties.scalesProperties),!("showLastValue"in n)||"showSeriesLastValue"in n||"showStudyLastValue"in n||(n.showSeriesLastValueProperty=n.showLastValue,n.showStudyLastValueProperty=n.showLastValue),"showSeriesLastValue"in n&&(i.showSeriesLastValueProperty=!0),"showStudyLastValue"in n&&(i.showStudyLastValueProperty=!0),t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||TradingView.clone(t.chartProperties.paneProperties.gridProperties),t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||TradingView.clone(t.chartProperties.paneProperties.gridProperties),this._properties.paneProperties.merge(t.chartProperties.paneProperties),this._properties.scalesProperties.merge(n),t.chartProperties.timezone&&this._properties.timezone.setValue(t.chartProperties.timezone),t.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.merge(t.chartProperties.chartEventsSourceProperties),this.m_timeScale.restoreState(t.timeScale,e)),t.timeScale&&this.m_timeScale.restoreState(t.timeScale,e),!this.readOnly()&&(s=this._getExceedingChildStudies(t.panes),s.length)){for(r=t.panes.length-1;r>=0;--r){for(a=t.panes[r],h=a.sources.length-1;h>=0;--h)c=a.sources[h],~s.indexOf(c)&&a.sources.splice(h,1);a.sources.length||t.panes.splice(r,1)}setTimeout(function(){goProDialog({feature:"studyOnStudy"}).open()},500)}for(d=t.panes,this.panes()[0].restoreState(d[0],e,t.version,i),r=1;r<t.panes.length;r++)a=this.panes()[r]||this.createPane(),a.restoreState(t.panes[r],e,t.version,i);for(this._invalidateBarColorerCaches(),p=this.dataSources(),u=0,r=0;r<p.length;r++)_=p[r],TradingView.isInherited(_.constructor,l)&&(u++,_.calcIsActualSymbol());return this._version=t.version,this.timeScale().recalcLockedScale(),this.recalculateAllPanes(),this.invalidate(new L(L.FULL_UPDATE)),window.saver&&window.is_authenticated&&this.isJustClonedChart()&&this.mainSeries().onSymbolResolved().subscribe(this,function(){window.saver.saveChartSilently()},!0),f=TVLocalStorage.getItem("linetools_limit")||1e3,window.is_authenticated&&window.user&&window.user.settings&&(f=window.user.settings.linetools_limit||f),u>f?{lines_limit_exceeded:!0,line_tools_count:u}:{}},n.prototype.restoreAxisState=function(t){var e,i;if(!t.panes)return void TradingView.logDebugChart("ChartModel.restoreAxisState: invalid state");if(!Array.isArray(t.panes))return void TradingView.logDebugChart("ChartModel.restoreAxisState: invalid state");if(t.panes.length<1)return void TradingView.logDebugChart("ChartModel.restoreAxisState: invalid state");for(this.m_timeScale.restoreState(t.timeScale,!1,!0),e=0;e<t.panes.length;e++)i=this.panes()[e],i.m_leftPriceScale.restoreState(t.panes[e].leftAxisState),i.m_rightPriceScale.restoreState(t.panes[e].rightAxisState);this.recalculateAllPanes(),this.invalidate(new L(L.FULL_UPDATE))},P.prototype.state=function(t,e,i,o){function n(t){return i&&!t.isSavedInStudyTemplates()||!t.state||!t.state()||!t.isSavedInChart(e)||o&&t.isActualSymbol&&!t.isActualSymbol()}var s,r,a={};if(t)for(a.sources=[],s=0;s<this.m_dataSources.length;s++)n(this.m_dataSources[s])||a.sources.push(this.m_dataSources[s].state(e));for(a.leftAxisState=this.m_leftPriceScale.state(),a.leftAxisSources=[],s=0;s<this.m_leftPriceScale.dataSources().length;s++)n(this.m_leftPriceScale.dataSources()[s])||a.leftAxisSources.push(this.m_leftPriceScale.dataSources()[s].id());for(a.rightAxisState=this.m_rightPriceScale.state(),a.rightAxisSources=[],s=0;s<this.m_rightPriceScale.dataSources().length;s++)n(this.m_rightPriceScale.dataSources()[s])||a.rightAxisSources.push(this.m_rightPriceScale.dataSources()[s].id());for(a.overlayPriceScales={},s=0;s<this.m_dataSources.length;s++)r=this.m_dataSources[s],this.isOverlay(r)&&r.isSavedInChart(e)&&(a.overlayPriceScales[r.id()]=r.priceScale().state());return a.stretchFactor=this._stretchFactor,this.m_mainDataSource&&(a.mainSourceId=this.m_mainDataSource.id()),a},P.prototype.sourceById=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},P.prototype.isESDStudy=function(t){return"Script$TV_EARNINGS@tv-scripting"===t.id||"Script$TV_DIVIDENDS@tv-scripting"===t.id||"Script$TV_SPLITS@tv-scripting"===t.id||"ESD$TV_EARNINGS@tv-scripting"===t.id||"ESD$TV_DIVIDENDS@tv-scripting"===t.id||"ESD$TV_SPLITS@tv-scripting"===t.id},P.prototype.restoreState=function(t,e,i,o){var n,r,a,h,c,d,p,_,f,m,v,y;if(o=o||{},!t.leftAxisState||!t.rightAxisState)throw Error("invalid state");if(!t.leftAxisSources||!t.rightAxisSources)throw Error("invalid state");if(t.stretchFactor&&(this._stretchFactor=t.stretchFactor),n={},t.sources)for(r=this.m_dataSources.indexOf(this._model.mainSeries())!==-1,this.clearSeries(),this.m_mainDataSource=null,r&&this.m_dataSources.push(this._model.mainSeries()),a=0;a<t.sources.length;a++)h=t.sources[a],Math.abs(h.zorder)>1e200&&(c=-1,TradingView.logWarn("Datasource zorder has bad value: "+h.zorder+" Resetting it to "+c),h.zorder=c),d=h.id,n[d]=h.ownerSource,(p=h.type)&&("MainSeries"===p?this._restoreMainSeries(h,e,r,o):p.toLowerCase().startsWith("study")?this._restoreStudy(h,e,o):TradingView.isInherited(TradingView[p],l)?this._restoreLineTool(h,e):TradingView[p]&&TradingView[p].createFromState&&this._restoreSpecialSource(h,e));for(this.m_leftPriceScale.dataSources().splice(0,1/0),this.m_leftPriceScale._hasSeries=!1,_=defaults("chartproperties").paneProperties.leftAxisProperties,TradingView.merge(_,t.leftAxisState),this.m_leftPriceScale.restoreState(_),a=0;a<t.leftAxisSources.length;a++)(f=this.dataSourceForId(t.leftAxisSources[a]))&&(void 0!==_.m_showSymbolLabels&&f instanceof g&&this.model().properties().scalesProperties.showSymbolLabels.setValue(_.m_showSymbolLabels),f.setPriceScale(this.m_leftPriceScale),this.m_leftPriceScale.addDataSource(f));for(this.m_rightPriceScale.dataSources().splice(0,1/0),this.m_rightPriceScale._hasSeries=!1,_=defaults("chartproperties").paneProperties.rightAxisProperties,TradingView.merge(_,t.rightAxisState),this.m_rightPriceScale.restoreState(_),a=0;a<t.rightAxisSources.length;a++)(f=this.dataSourceForId(t.rightAxisSources[a]))&&(void 0!==_.m_showSymbolLabels&&f instanceof g&&this.model().properties().scalesProperties.showSymbolLabels.setValue(_.m_showSymbolLabels),f.setPriceScale(this.m_rightPriceScale),this.m_rightPriceScale.addDataSource(f));for(a=0;a<this.m_dataSources.length;a++)f=this.m_dataSources[a],this.m_rightPriceScale.dataSources().indexOf(f)===-1&&this.m_leftPriceScale.dataSources().indexOf(f)===-1?(f._isOverlay=!0,m=new s(this._properties.overlayPropreties,this._model.properties().scalesProperties),m.setHeight(this.m_height),m.setTopMargin(this.m_rightPriceScale.topMargin()),m.setBottomMargin(this.m_rightPriceScale.bottomMargin()),m.addDataSource(f),t.overlayPriceScales&&t.overlayPriceScales[f.id()]&&(_=t.overlayPriceScales[f.id()],_.m_isAutoScale=!0,_.m_isLog=!1,_.m_isPercentage=!1,m.restoreState(_)),f.setPriceScale(m)):f._isOverlay=!1;for(d in n)(v=n[d])&&(f=this.sourceById(d))&&this.sourceById(d).setOwnerSource(this.sourceById(v));if(t.mainSourceId&&!this.m_mainDataSource&&(this.m_mainDataSource=this.dataSourceForId(t.mainSourceId)),!this.m_mainDataSource)for(a=0;a<this.m_dataSources.length;a++)if(f=this.m_dataSources[a],TradingView.isInherited(f.constructor,x)){this.m_mainDataSource=f;break}for(a=0;a<this.m_dataSources.length;a++)f=this.m_dataSources[a],TradingView.isInherited(f.constructor,l)?(f.ownerSource()||f.setOwnerSource(this.mainDataSource()),f.isFixed()&&f.restoreFixedPoints(),1===i&&f.priceScale().isPercent()&&!f.isFixed()&&f.correctPricesToPercents(),f.fixAfterRestorePriceAxis&&f.fixAfterRestorePriceAxis()):TradingView.isInherited(f.constructor,u)&&(y=f.properties(),y.linkedToSeries&&y.linkedToSeries.value()&&(f.ownerSource()||f.setOwnerSource(this.model().mainSeries())));this._updateMargins(),this._cachedOrderedSoruces=null,this._cachedHitTestSources=null},P.prototype._restoreMainSeries=function(t,e,i,o){var n,s,r,a,l=t.id,h=t.state,c=t.zorder;h&&["candleStyle","hollowCandleStyle","haStyle"].forEach(function(t){h[t]&&(h[t].wickUpColor=h[t].wickUpColor||h[t].wickColor,h[t].wickDownColor=h[t].wickDownColor||h[t].wickColor)}),i||(n=this._model.paneForSource(this._model.mainSeries()),n.removeDataSource(this._model.mainSeries()),this.m_dataSources.push(this._model.mainSeries())),this.m_mainDataSource=this._model.mainSeries(),s=h&&h.style?h.style:void 0,r=s===g.STYLE_PNF&&h.pnfStyle.lockScale,h&&!h.lockScale&&(h.lockScale=r),s===g.STYLE_PNF&&"ATR"===this._model.mainSeries().properties().pnfStyle.inputs.style.value()?this._model.mainSeries().properties().pnfStyle.inputs.style._value="Traditional":s===g.STYLE_RENKO&&"ATR"===this._model.mainSeries().properties().renkoStyle.inputs.style.value()&&(this._model.mainSeries().properties().renkoStyle.inputs.style._value="Traditional"),h&&!h.hasOwnProperty("showSessions")&&(h.showSessions=!1),h&&!h.extendedHours&&(h.extendedHours=!1),h&&e&&(h.showCountdown=!1),h&&(e&&!("showSeriesLastValueProperty"in o)&&"showLastValue"in h&&this._model.properties().scalesProperties.showSeriesLastValue.setValue(h.showLastValue),delete h.showLastValue),this._model.mainSeries().properties().merge(h),this._model.mainSeries()._prevChartStyle=this._model.mainSeries().properties().style.value(),this._model.mainSeries().createPaneView(),this._model.mainSeries().setId(l),e&&this._model.mainSeries().restoreData(t.bars,t.nsBars,t.symbolInfo,t.rtPrice,t.boxSize,t.reversalAmount),void 0!==c&&this._model.mainSeries().setZorder(c),this._model.mainSeries().properties().extendedHours.listeners().fire(this._model.mainSeries().properties().extendedHours),(a=this._model.mainSeries().symbolInfo())&&this._model.mainSeries().onSymbolResolved().fire(this._model.mainSeries().symbolInfo())},P.prototype._restoreStudy=function(t,e,i){var n,s,a,l,h,c,d,p,u,_;return e&&void 0===t.data&&void 0===t.nonSeriesData&&void 0===t.indexes?void TradingView.logError("Cannot restore (skipping) study without data "+t.id+", "+t.metaInfo.id):(n=t.id,s=t.state,a=t.zorder,l=t.ownerSource,h=TradingView.clone(t.metaInfo),$.extend(h,y.parseIdString(h.id)),this.isESDStudy(h)&&!e||!TradingView.isFeatureEnabled("backtesting")&&h.isTVScriptStrategy&&!e?void 0:(c=s,d=this._model.studyVersioning(),p=d.patchPropsStateAndMetaInfo(c,h,{oldShowStudyLastValueProperty:e&&!i.showStudyLastValueProperty}),c=p.propsState,h=p.metaInfo,u=new r(this._model,t,h.shortDescription),u.setId(n),_=this,d.updateMetaInfoAsync(h,e).done(function(i){function s(o){var s,l=f(h,i,c,null,d,o),p=m(_._model,l,o||_._model.mainSeries(),r);p.setId(n),e&&(s=d.patchStudyData(h,t.data,t.nonSeriesData,t.indexes),p.restoreData(s.data,s.nsData,s.indexes)),_._model.replaceStudyStub(u,p)||(u=p),a.add(n,p)}var r,a,p;u.setStatus(""),r=i||h,a=new o(_._model),p=l&&t.state.isChildStudy,p?a.get(l).done(s):s()}).fail(function(t){u.setStatus("error: "+t),u.setFailed(!0)}),u&&this.m_dataSources.push(u),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,u&&void 0!==a&&u.setZorder(a),u))},P.prototype._restoreLineTool=function(t,e,i){var o,n,s,p,u,f,m,g,x,P,L,I,E,A,V,M,D,O,B,R,N,F,W;for(i=void 0===i||i,C.migrateState(t),o=t.type,n=t.id,s=t.state,p=i?t.zorder:this._newZOrderForLineTool(),u=TradingView[o],k(TradingView.isInherited(u,l),"invalid data source type:"+o+" (expected to be a Line Tool)"),f=t.points,m=!1,g=0;g<f.length;g++)if(Math.abs(f[g].offset)>1e4){m=!0;break}if(!m){if(x=null,P=TradingView.factoryDefaults("linetool"),TradingView.isInherited(u,h)){if(x=this._model.studyVersioning(),t=x.patchPointsBasedStudyState(t),TradingView.merge(P,s),E=t.metaInfo,$.extend(E,y.parseIdString(E.fullId)),!e&&(A=E.productId,!pro.hasPackage(A)))return V=new r(this._model,t,E.shortDescription),V.setId(n),this.m_dataSources.push(V),void 0!==p&&V.setZorder(p),V.setStatus($.t("not authorized")),void V.setFailed(!0);M=x.updateMetaInfo(E),D=M||E,P=_(D,E,P,null,x),e?TradingView.merge(P,{fixedSize:!1}):TradingView.merge(P,{fixedSize:!0}),I=new v("study_"+D.id,P,!0),L=a.create(o,this._model,I,D,this.mainDataSource())}else O=o.toLowerCase(),TradingView.merge(P,TradingView.factoryDefaults(O)),I=TradingView[o].prototype.createPropertiesObject(O,P),I.merge(s),e?I.merge({fixedSize:!1}):I.merge({fixedSize:!0}),L=new TradingView[o](this._model,I,!0);return L.setId(n),L.linkKey=t.linkKey,B=t.alertId,B&&"function"==typeof L.setAlert&&b.enabled("alerts")&&!this._model.readOnly()&&!this._model.isJustClonedChart()&&L.setAlert(B,{noChartSave:!0}),R=t.indexes?t.indexes:[],R=R.slice(0,t.points.length),L.isFixed()?L.restorePositionPercents(t.positionPercents):L.restorePoints(t.points,R,e),L instanceof c||L instanceof d||L instanceof S||L instanceof T||L instanceof w?L.restoreData(t):e&&L.restoreData&&(N=t,x&&(N.graphics=x.patchPointsBasedStudyData(N.metaInfo,N.graphics)),L.restoreData(N)),F=null==t.version?1:t.version,W=null==L.version?1:L.version,F!==W&&"function"==typeof L.migrateVersion&&L.migrateVersion(F,W,{pane:this,model:this._model,properties:I}),this.m_dataSources.push(L),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,void 0!==p&&L.setZorder(p),L}},P.prototype._restoreSpecialSource=function(t,e){var i,o=TradingView[t.type];o&&o.createFromState&&(i=o.createFromState(t,e,this._model))&&(i.setId(t.id),this.m_dataSources.push(i),i.zorder&&i.setZorder(i.zorder))},n.prototype.studyTemplate=function(t){var e,i,o,s,r={};for(r.panes=[],e=0;e<this.panes().length;e++)i=!0,o=!1,s=!0,r.panes.push(this.panes()[e].state(i,o,s));return t&&(r.interval=this.mainSeries().interval()),r.version=n.version,r},n.prototype.restoreStudyTemplate=function(t,e){this._undoModel.studyLoadTemplate(this._undoModel,this.studyTemplate(),t,e)},n.prototype.theme=function(){var t={};return t.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.state(),symbolWatermarkProperties:this.properties().symbolWatermarkProperties.state()},t.mainSourceProperties=this.mainSeries().state().state,delete t.mainSourceProperties.symbol,delete t.mainSourceProperties.interval,delete t.chartProperties.paneProperties.topMargin,delete t.chartProperties.paneProperties.bottomMargin,t.version=n.version,t},n.prototype.restoreTheme=function(t){var e,i,o={hollowCandle:{related:"candle"}};for(e in o)t.mainSourceProperties[e+"Style"]||(i=t.mainSourceProperties[o[e].related+"Style"],t.mainSourceProperties[e+"Style"]=TradingView.clone(i));this._undoModel.chartLoadTheme(this,t)},o=function(){function t(o){var n=e.indexOf(o);return~n?i[n]:this instanceof t?(this._source=o,this._studies={},this._deferreds={},e.push(o),void i.push(this)):new t(o)}var e=[],i=[];return t.prototype.add=function(t,e){this._deferreds[t]&&(this._deferreds[t].resolve(e),delete this._deferreds[t]),this._studies[t]=e},t.prototype.get=function(t){return this._studies[t]?$.Deferred().resolve(this._studies[t]):(this._deferreds[t]||(this._deferreds[t]=$.Deferred()),this._deferreds[t].promise())},t.prototype.reset=function(){var t=e.indexOf(this._source);~t&&(e.splice(t,1),i.splice(t,1))},t}(),t.exports=n},function(t,e,i){(function(e,o,n,s){"use strict";function r(t,i,s,a,l,h,m,v,b){var w,S,T,C;this._version=r.version,this._readOnly=a,this._undoModel=v,this._properties=s,this._isSnapshot=b,this._studiesMetaData=h,this._studyVersioning=new P(this._studiesMetaData,m),this.m_timeScale=new f(this),this.m_panes=[],this.m_gridSource=new u,this.m_crossHairSource=new c(this,A.properties()),this.m_width=0,this._tagsChanged=new e,this._lineCancelled=new e,this._magnet=new _(A.properties().magnet,this.m_timeScale,s.paneProperties.magnetSensivity),w=new V("chartproperties.mainSeriesProperties"),w.addExclusion("lockScale"),w.addExclusion("minTick"),w.addExclusion("priceAxisProperties.percentage"),w.addExclusion("priceAxisProperties.log"),this.createPane(void 0,!1,{rightAxisProperties:w.priceAxisProperties.state(["autoScale"])}),this.m_panes[0]._stretchFactor=2*d.DEFAULT_STRETCH_FACTOR,this.m_panes[0]._isMainPane=!0,this.m_selectedSource=null,this._selectedSourceChanged=new e,this._chartApi=t,this._invalidateHandler=i,this.m_hoveredSource=null,this._properties.listeners().subscribe(this,r.prototype.propertyChangeHandler),S=this,this._properties.timezone.listeners().subscribe(null,function(){S._chartApi&&S._chartApi.connected()&&S._chartApi.switchTimezone(S.timezone())}),this._properties.timeScale.rightOffset.listeners().subscribe(null,function(){S.m_timeScale.setOffset(S._properties.timeScale.rightOffset.value()),S.recalculateAllPanes()}),w.merge(s.mainSeriesProperties.state()),this.m_mainSeries=new E(this,w,l),this.m_panes[0].addDataSource(this.m_mainSeries,this.m_panes[0].rightPriceScale()),this.m_mainSeries.onCompleted().subscribe(this,function(){S.clearCurrentPosition(),S._scrollingState&&S.gotoTime()}),a||(w.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),w.lockScale.listeners().subscribe(this,function(t){var e=t.value();e&&(w.priceAxisProperties.percentage.setValue(!1),w.priceAxisProperties.logDisabled.setValue(!1)),w.priceAxisProperties.percentageDisabled.setValue(e),w.priceAxisProperties.logDisabled.setValue(e)}),this._properties.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,function(t){t.value()||S._properties.paneProperties.legendProperties.showStudyArguments.setValue(!1)})),this._barsMarksSources=[],this._syncPointCache={},o.enabled("charting_library_base")&&(T=new y(this),T.setOwnerSource(this.m_mainSeries),this._barsMarksSources.push(T),C=new g(this),C.setOwnerSource(this.m_mainSeries),this._barsMarksSources.push(C)),this.m_watermarkSource=new p(this.m_mainSeries),this.strategySources=[],this.strategySources.change=new e,this._activeStrategySource=new n(null),this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1,this._currentTool="",A.hideAllDrawings().subscribe(this,r.prototype.visibilityChangeHandler),this._properties.scalesProperties.listeners().subscribe(this,r.prototype.fullUpdate),this._id=TradingView.guid(),this._studyInserted=new e}var a=i(30),l=i(145),h=i(82).LineDataSource,c=i(254),d=i(258),p=i(261),u=i(262),_=i(263),f=i(264),m=i(259),g=i(267),v=i(269).BarsMarksContainer,y=i(270),b=i(99),w=i(85).RGBColor,S=i(171),T=S.Study,C=S.createStudy,x=S.prepareStudyProperties,P=i(168),L=i(271),k=i(165).StudyLineDataSource,I=i(175).StudyConsts,E=i(102),A=i(92),V=i(91).DefaultProperty,M=i(141).SyncPoint,D=i(35).trackEvent;r.prototype.isSnapshot=function(){return this._isSnapshot},r.prototype.currentTool=function(){return this._currentTool},r.prototype.setCurrentTool=function(t){this._currentTool=t},r.prototype.timezone=function(){return this._properties.timezone.value()},r.prototype.version=function(){return this._version},r.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())},r.prototype.dumpViews=function(){var t,e,i,o,n={};for(n.panes=[],t=0;t<this.m_panes.length;t++)n.panes.push(this.m_panes[t].dumpViews());for(n.dataWindow=[],e=this.dataSources(),t=0;t<e.length;t++)i=e[t],(o=i.dataWindowView())&&n.dataWindow.push(o.dump());return n},r.prototype._paneInvalidationMask=function(t,e){var i=new b,o=this.m_panes.indexOf(t);return void 0===e&&(e=b.LIGHT_UPDATE),i.invalidatePane(o,e),i},r.prototype.updatePane=function(t){var e=this._paneInvalidationMask(t);this.invalidate(e)},r.prototype.fullUpdate=function(){this.invalidate(new b(b.FULL_UPDATE))},r.prototype.updateSource=function(t){var e=this.paneForSource(t),i=this._paneInvalidationMask(e);this.invalidate(i)},r.prototype.studiesMetaData=function(){return this._studiesMetaData},r.prototype.studyVersioning=function(){return this._studyVersioning},r.prototype.disconnect=function(){var t,e,i=this.dataSources();for(e=0;e<i.length;e++)t=i[e],t.disconnect&&t.disconnect()},r.prototype.restart=function(){var t,e,i;for(this.initConnection(),this.m_timeScale.reset(),this.m_mainSeries.restart(),t=this.dataSources(),e=0;e<t.length;e++)i=t[e],i.restart&&i!==this.m_mainSeries&&i.restart()},r.prototype.startNotStartedStudies=function(){var t,e;if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(t=this.dataSources(),e=0;e<t.length;e++)t[e]instanceof T&&!t[e].isStarted()&&t[e].restart&&t[e]!==this.m_mainSeries&&t[e].restart()},r.prototype.updateLineTools=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;t++)TradingView.isInherited(i[t].constructor,h)&&(e=i[t],e.tryCreateServerPoints(),e.checkAlert&&e.checkAlert())},r.prototype.realignLineTools=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;t++)TradingView.isInherited(i[t].constructor,h)&&(e=i[t],e.calcIsActualSymbol());for(t=0;t<this.m_panes.length;t++)this.m_panes[t].invalidateSourcesCache()},r.prototype.readOnly=function(){return this._readOnly},r.prototype.properties=function(){return this._properties},r.prototype.lineCancelled=function(){return this._lineCancelled},r.prototype.crossHairMoved=function(){return this.m_crossHairSource.moved()},r.prototype.chartApi=function(){return this._chartApi},r.prototype.propertyChangeHandler=function(){this.invalidate(new b(b.LIGHT_UPDATE))},r.prototype.visibilityChangeHandler=function(){this.setSelectedSource(),this.invalidate(new b(b.LIGHT_UPDATE))},r.prototype.updateAllPaneViews=function(){var t,e;for(t=0;t<this.m_panes.length;t++)e=this.m_panes[t],e.updateAllViews()},r.prototype.mainSeries=function(){return this.m_mainSeries},r.prototype.timeScale=function(){return this.m_timeScale},r.prototype.panes=function(){return this.m_panes},r.prototype.gridSource=function(){return this.m_gridSource},r.prototype.watermarkSource=function(){return this.m_watermarkSource},r.prototype.crossHairSource=function(){return this.m_crossHairSource},r.prototype.barsMarksSources=function(){return this._barsMarksSources},r.prototype.width=function(){return this.m_width},r.prototype.setPaneHeight=function(t,e){t.setHeight(e),this.recalculateAllPanes(),this.invalidate(new b(b.LIGHT_UPDATE))},r.prototype.setWidth=function(t){var e,i;for(this.m_width=t,this.m_timeScale.setWidth(this.m_width),e=0;e<this.m_panes.length;++e)i=this.m_panes[e],i.setWidth(t);this.recalculateAllPanes()},r.prototype.createPane=function(t,e,i){var o,n;if(this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),o=this._properties.paneProperties,i&&o.merge(i),n=new d(this.m_timeScale,o,this,e),"number"==typeof t&&isFinite(t)){if(t<0||t>this.m_panes.length)return void TradingView.logDebugChart("ChartModel.createPane: invalid index: "+t);this.m_panes.splice(t,0,n)}else this.m_panes.push(n);return n.onTagsChanged().subscribe(this,r.prototype.onPaneTagsChanged),n},r.prototype.removePane=function(t){this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),t.destroy();var e=this.m_panes.indexOf(t);e!==-1&&this.m_panes.splice(e,1),this.invalidate(new b(b.FULL_UPDATE))},r.prototype.startScalePrice=function(t,e,i){t.startScalePrice(e,i)},r.prototype.scalePriceTo=function(t,e,i){t.scalePriceTo(e,i),this.mainSeries().properties().lockScale.value()?this.invalidate(new b(b.LIGHT_UPDATE)):this.invalidate(this._paneInvalidationMask(t,b.LIGHT_UPDATE))},r.prototype.endScalePrice=function(t,e){t.endScalePrice(e),this.invalidate(this._paneInvalidationMask(t,b.LIGHT_UPDATE))},r.prototype.startScrollPrice=function(t,e,i){t.startScrollPrice(e,i)},r.prototype.scrollPriceTo=function(t,e,i){t.scrollPriceTo(e,i),this.invalidate(this._paneInvalidationMask(t,b.LIGHT_UPDATE))},r.prototype.endScrollPrice=function(t,e){t.endScrollPrice(e),this.invalidate(this._paneInvalidationMask(t,b.LIGHT_UPDATE))},r.prototype.setPriceAutoScale=function(t,e,i){t.setPriceAutoScale(e,i),this.invalidate(this._paneInvalidationMask(t,b.LIGHT_UPDATE))},r.prototype.restorePriceScaleState=function(t,e,i){t.restorePriceScaleState(e,i),this.invalidate(this._paneInvalidationMask(t,b.LIGHT_UPDATE))},r.prototype.resetPriceScale=function(t,e){t.resetPriceScale(e),this.invalidate(this._paneInvalidationMask(t,b.LIGHT_UPDATE))},r.prototype.updateScales=function(t,e){this._undoModel._chartWidget._updateScalesActions()},r.prototype.startScaleTime=function(t){this.m_timeScale.startScale(t)},r.prototype.scaleTimeTo=function(t){this.m_timeScale.scaleTo(t),this.recalculateAllPanes(),this.invalidate(new b(b.LIGHT_UPDATE))},r.prototype.endScaleTime=function(){this.m_timeScale.endScale(),this.invalidate(new b(b.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources())},r.prototype.startScrollTime=function(t){this.m_timeScale.startScroll(t),this._isTimeScrolling=!0},r.prototype.scrollTimeTo=function(t){this.m_timeScale.scrollTo(t),this.recalculateAllPanes(),this.invalidate(new b(b.LIGHT_UPDATE))},r.prototype.endScrollTime=function(){this.m_timeScale.endScroll(),this.invalidate(new b(b.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._isTimeScrolling=!1},r.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach(function(t){t instanceof k&&t.recalcStudyIfNeeded&&t.recalcStudyIfNeeded()})},r.prototype.recalcVisibleRangeStudy=function(t,e){void 0!==this._recalcVRTimerId&&clearTimeout(this._recalcVRTimerId);var i=this;this._recalcVRTimerId=setTimeout(function(){i._recalcVisibleRangeStudy(t,e)},500)},r.prototype._recalcVisibleRangeStudy=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f,m;if(!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),o=this.mainSeries().nearestData(i.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),n=this.mainSeries().nearestData(i.lastBar(),TradingView.SEARCH_NEAREST_LEFT),s=o?o.index:void 0,r=n?n.index:void 0,a=s===this._oldStartVisibleIndex,l=r===this._oldEndVisibleIndex,!a||!l||e))for(this._oldStartVisibleIndex=s,this._oldEndVisibleIndex=r,h=0;h<t.length;h++)if(t[h]instanceof T){for(c=t[h],d=c.metaInfo().inputs,p=null,u=null,_=0;_<d.length;_++)"first_visible_bar_time"===d[_].id?(f=o&&o.value?o.value[TradingView.TIME_PLOT]:0,p=1e3*Math.floor(f)):"last_visible_bar_time"===d[_].id&&(f=n&&n.value?n.value[TradingView.TIME_PLOT]:0,u=1e3*Math.floor(f));m=c.properties().inputs,p&&(u?m.first_visible_bar_time.setValueSilently(p):m.first_visible_bar_time.setValue(p,!0)),u&&m.last_visible_bar_time.setValue(u,!0)}},r.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this.invalidate(new b(b.LIGHT_UPDATE))},r.prototype.restoreTimeScaleState=function(t){this.m_timeScale.restoreState(t),this.recalculateAllPanes(),this.invalidate(new b(b.LIGHT_UPDATE))},r.prototype.restoreFactoryDefaults=function(t){t.restoreFactoryDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},r.prototype.setSelectedSource=function(t,e){if(!(this.m_selectedSource===t&&this._lastHittestData===e||t&&t.customization&&t.customization.disableSelection)){this._lastHittestData=e;var i=new b;this.m_selectedSource&&(this.m_selectedSource.updateAllViews(),TradingView.alertsDispatcher&&this.m_selectedSource.hasAlert.value()&&this.m_selectedSource.getAlert({fromCache:!0}).done(function(t){t&&t.set("selected",!1)})),this.m_selectedSource=t,this._selectedSourceChanged.fire(t),t&&(t.updateAllViews(),TradingView.alertsDispatcher&&t.hasAlert.value()&&t.getAlert({fromCache:!0}).done(function(t){t&&t.set("selected",!0)})),i.force=!0,this.invalidate(new b(b.LIGHT_UPDATE)),this.setHoveredSource(t,e)}},r.prototype.checkLineToolSelection=function(){this.m_selectedSource&&this.m_selectedSource instanceof h&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))},r.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},r.prototype.setHoveredSource=function(t,e){if(this.m_hoveredSource!==t||this._lastHittestData!==e){this._lastHittestData=e;var i=null;this.m_hoveredSource&&(this.m_hoveredSource.updateAllViews(),i||(i=new b),TradingView.alertsDispatcher&&this.m_hoveredSource.hasAlert.value()&&this.m_hoveredSource.getAlert({fromCache:!0}).done(function(t){t&&t.set("hovered",!1)}),i.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),b.LIGHT_UPDATE))),this.m_hoveredSource=t,t&&(t.updateAllViews(),i||(i=new b),i.merge(this._paneInvalidationMask(this.paneForSource(t),b.LIGHT_UPDATE)),TradingView.alertsDispatcher&&t.hasAlert.value()&&t.getAlert({fromCache:!0}).done(function(t){t&&t.set("hovered",!0)})),i&&this.invalidate(i)}},r.prototype.selectedSource=function(){return this.m_selectedSource},r.prototype.hoveredSource=function(){return this.m_hoveredSource},r.prototype.lastHittestData=function(){return this._lastHittestData},r.prototype.invalidate=function(t){this._invalidateHandler&&this._invalidateHandler(t)},r.prototype.dataSources=function(){var t,e,i,o=[];for(o.push(this.m_crossHairSource),t=0;t<this.m_panes.length;++t)for(e=this.m_panes[t].dataSources(),i=0;i<e.length;i++)o.push(e[i]);return o},r.prototype.dataSourceForId=function(t){var e,i;for(i=0;i<this.m_panes.length;++i)if(e=this.m_panes[i].dataSourceForId(t))return e;return null},r.prototype.children=function(t,e){return this.dataSources().filter(function(i){return!(e===!0&&i instanceof T&&i.isChildStudy())&&i.ownerSource()===t})},r.prototype.setCurrentPosition=function(t,e,i,o){var n,s,r,a,l,c,d,p,u,_,f,m,g,v=NaN,y=Math.round(this.m_timeScale.coordinateToIndex(t));if(i&&(n=i.defaultPriceScale(),n.isEmpty()||(v=n.coordinateToPrice(e))),(this._lineBeingCreated||h.isLineTool(this.currentTool()))&&(v=this._magnet.align(v,y,i)),this._isTimeScrolling)return void this.m_crossHairSource.setPosition(this.m_crossHairSource.index,v,i);for(this.m_crossHairSource.setPosition(y,v,i),this.m_crossHairSource.dataWindowView().update(),s=this.m_panes,r=s.length;r--;)for(a=s[r].dataSources(),l=a.length;l--;)(c=a[l].dataWindowView())&&c.update();this._lineBeingCreated?(this._lineBeingCreated.setLastPoint({index:y,price:v},o),this._lineBeingCreated.updateAllViews(),this.invalidate(new b(b.LIGHT_UPDATE))):this.crossHairSource().startMeasurePoint()?this.invalidate(new b(b.LIGHT_UPDATE)):this.invalidate(new b(b.UPDATE_CURSOR_ONLY)),this._isSettingsExternalPosition||(d=this._undoModel._chartWidget,d._chartWidgetCollection&&(p=this.mainSeries(),(u=p.syncModel())&&(_=this.m_timeScale.points().roughTime(y,u.projectTime.bind(u)),f={timeStamp:_},m=i.mainDataSource(),m instanceof E&&(f.price=v,f.symbol=m.symbol()),f.syncModel=u,g=this._lineBeingCreated||this._linePointBeingEdited||this._sourceBeingMoved,g=g&&A.drawOnAllCharts().value(),d._chartWidgetCollection.syncCrosshair(f,d,g,o))))},r.prototype.clearCurrentPosition=function(){var t,e,i,o,n,s,r=this.crossHairSource();for(r.clearPosition(),r.dataWindowView().update(),t=this.m_panes,e=t.length;e--;)for(i=t[e].dataSources(),o=i.length;o--;)(n=i[o].dataWindowView())&&n.update();this.invalidate(new b(b.UPDATE_CURSOR_ONLY)),s=this._undoModel._chartWidget,s._chartWidgetCollection&&s._chartWidgetCollection.syncCrosshair(NaN,s)},r.prototype.onSyncScrollNeeded=function(t){var e,i,o,n=this._undoModel._chartWidget;n._chartWidgetCollection&&(e=this.mainSeries(),(i=e.syncModel())&&(o=1e3*this.m_timeScale.points().roughTime(t,i.projectTime.bind(i)),n._chartWidgetCollection.syncScroll(o,this)))},r.prototype.gotoTime=function(t,e){function i(){return p.tickMarks().indexToTime(p.tickMarks().minIndex).valueOf()-t}function o(e){var o,n,s,r,a;if(i()<0){for(o=p.tickMarks().nearestIndex(t),n=+u.bars().last(),o=Math.min(o,n),s=p.tickMarks().indexToTime(o).valueOf();s<t&&o<n;)o++,s=p.tickMarks().indexToTime(o).valueOf();return r=p.visibleBars(),a=r.lastBar()-r.firstBar(),!e&&r.contains(o)||(p.zoomToBarsRange(o-a/2,o+a/2),u.requestMoreData()),{index:o}}}var n,s,r,a,l,h,c,d,p=this.timeScale(),u=this.mainSeries();if(e&&e.model&&(n=u.syncModel())&&(s=this._createSyncPoint(e.model.mainSeries().syncModel(),n),t=1e3*s.sourceTimeToTargetTime(t/1e3)),e=e||{centerIfVisible:!0},t)this._scrollingState&&this._scrollingState.deferred.reject(),r=$.Deferred(),this._scrollingState={targetDate:t,deferred:r,centerIfVisible:e.centerIfVisible};else{if(!this._scrollingState)return TradingView.logError("scrollTo called without an argument"),$.Deferred().reject().promise();t=this._scrollingState.targetDate,r=this._scrollingState.deferred}return a=o(this._scrollingState.centerIfVisible),a||(l=p.tickMarks().minIndex,h=p.visibleBars(),c=h.lastBar()-h.firstBar(),u.endOfData()?(p.zoomToBarsRange(l-c/2,l+c/2),a={index:l,eod:!0}):(d=this.timeScale().tickMarks().estimateLeft(t),u.requestMoreData(Math.ceil(d+c/2)))),a&&(this.fullUpdate(),this._scrollingState=null,r.resolve(a)),r.promise()},r.prototype._createSyncPoint=function(t,e){var i,o,n=this._syncPointCache[t.uniqueId()];if(n){if(i=n[e.uniqueId()])return i}else this._syncPointCache[t.uniqueId()]={};return o=new M(t,e),this._syncPointCache[t.uniqueId()][e.uniqueId()]=o,o},r.prototype.setExternalPosition=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u;if(!Number.isNaN(t)&&isNumber(t.timeStamp)&&(o=this.mainSeries(),(n=o.syncModel())&&(s=this._createSyncPoint(t.syncModel,n),r=s.sourceTimeToTargetTime(t.timeStamp),i=this.m_timeScale.points().roughIndex(r,n.distance.bind(n)))),this.mainSeries().symbol()===t.symbol)return this._isSettingsExternalPosition=!0,a=this.paneForSource(this.mainSeries()),l=this.m_timeScale.indexToCoordinate(i),h=this.mainSeries().priceScale().priceToCoordinate(t.price,!0),this.setCurrentPosition(l,h,a,e||{}),void delete this._isSettingsExternalPosition;for(isFinite(i)?this.crossHairSource().setPosition(i,NaN,null):(c=this.crossHairSource(),c.clearPosition(),c.dataWindowView().update()),d=this.dataSources(),p=d.length;p--;)(u=d[p].dataWindowView())&&u.update();this.invalidate(new b(b.UPDATE_CURSOR_ONLY))},r.prototype.updateCrossHair=function(){this.m_crossHairSource.updateIndex()},r.prototype.updateTimeScale=function(t,e,i,o,n){var s,r,a;if(n)for(this.m_timeScale.reset(),s=this.dataSources(),r=0;r<s.length;r++)s[r].clearData&&s[r].clearData();this.m_timeScale.update(t,e,i,o),a="ChartModel.prototype.updateTimeScale("+t+","+e+","+i.length+","+o.length+","+n+")",a+="TimeScale: {first:"+this.m_timeScale.m_points.firstTimePointIndex()+",last:"+this.m_timeScale.m_points.lastTimePointIndex()+"}",TradingView.logDebugChart(a),this.recalculateAllPanes(),this.invalidate(new b(b.LIGHT_UPDATE))},r.prototype.recalculatePane=function(t){t&&t.recalculate()},r.prototype.paneForSource=function(t){for(var e=this.m_panes.length-1;e>=0;e--)if(this.m_panes[e].dataSources().indexOf(t)!==-1)return this.m_panes[e];return t instanceof v?this.paneForSource(this.m_mainSeries):null},r.prototype.recalculateAllPanes=function(){for(var t=0;t<this.m_panes.length;++t)this.m_panes[t].recalculate();this.timeScale().recalcLockedScale(),this.updateAllPaneViews()},r.prototype._invalidateBarColorerCaches=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;++t)(e=i[t])instanceof E&&e.invalidateBarColorerCache()},r.prototype.addStrategySource=function(t){~this.strategySources.indexOf(t)||(this.strategySources.push(t),this.strategySources.change.fire())},r.prototype.removeStrategySource=function(t){var e=this.strategySources.indexOf(t);~e&&(this.strategySources.splice(e,1),this.strategySources.change.fire())},r.prototype.setActiveStrategySource=function(t){~this.strategySources.indexOf(t)&&this._activeStrategySource.setValue(t)},r.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)},r.prototype.activeStrategySource=function(){return this._activeStrategySource},r.prototype.insertStudy=function(t,e,i,o){var n,s,r,a,l,h=null;return["Study_ESD$TV_SPLITS@tv-scripting","Study_ESD$TV_DIVIDENDS@tv-scripting","Study_ESD$TV_SPLITS@tv-scripting","Volume@tv-basicstudies","Sessions@tv-basicstudies"].indexOf(t.id)===-1&&D("studies","Study_"+t.id),n=!1,i||t.is_price_study?h=this.paneForSource(o||this.mainSeries()):(h=this.createPane(void 0,!0),e&&e.paneSize&&h.setPaneSize(e.paneSize),n=!0),"Compare@tv-basicstudies"===t.id&&(D("compare","symbol:"+e.inputs.symbol),this.m_mainSeries.priceScale().properties().log.setValue(!1),this.m_mainSeries.priceScale().properties().percentage.setValue(!0)),s=x(t,e,h,this.studyVersioning(),o),r=C(this,s,o||this.mainSeries(),t),r.start(),r.childStudyByRebind().subscribe(null,function(){D("SOS","Apply SOS","Rebind SOS")}),a=r.metaInfo().priceScale||I.SCALE_RIGHT,!n&&o instanceof T&&(l=o.isNoScale()?null:o.priceScale()),l||(a===I.SCALE_RIGHT?l=h.rightPriceScale():a===I.SCALE_LEFT?l=h.leftPriceScale():t.is_price_study?l=null:(TradingView.logWarn("Cannot add study "+r.metaInfo().id+" with 'No Scale' setting, because study is not a price study. Using right price scale."),l=h.rightPriceScale())),i?h.addDataSource(r,null):h.addDataSource(r,l),r.properties().linkedToSeries&&r.properties().linkedToSeries.value()&&r.setOwnerSource(this.mainSeries()),this.recalculatePane(h),this.invalidate(new b(b.FULL_UPDATE)),this._invalidateBarColorerCaches(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this._studyInserted.fire(r),r},r.prototype.studyInserted=function(){return this._studyInserted},r.prototype.replaceStudyStub=function(t,e){var i,o,n,s=this.paneForSource(t);return null!==s&&(i=t.isNoScale()?null:t.priceScale(),o=t.zorder(),n=t.ownerSource(),s.insertDataSource(e,i,o),e.setOwnerSource(n),this.panes().forEach(function(i){i.dataSources().forEach(function(i){i._ownerSource===t&&i.setOwnerSource(e)})}),this.removeSource(t),e.start(),this.recalculatePane(s),this.invalidate(new b(b.FULL_UPDATE)),!0)},r.prototype.insertStudyStub=function(t){var e=this.mainSeries(),i=this.paneForSource(e),o=new L(this,null,t);return i.addDataSource(o,null),this.recalculatePane(i),this.invalidate(new b(b.FULL_UPDATE)),o},r.prototype.removeStudyStub=function(t){var e=this.dataSourceForId(t);return void 0===e?(TradingView.logNormal("StudyStub id="+t+" is not found in chart model"),!1):(this.removeSource(e),!0)},r.prototype.detachSource=function(t,e){var i=this.paneForSource(t);if(i)return i.removeDataSource(t),i.isEmpty()?(this._lineBeingCreated&&i===this._paneBeingCreatedLineOn&&this.cancelCreatingLine(),this.removePane(i,e),!0):(this.invalidate(new b(b.FULL_UPDATE)),!1)},r.prototype.removeSource=function(t,e){var i,o,n,s;if(t===this.m_selectedSource&&this.setSelectedSource(null),t===this._sourceBeingMoved&&(this._sourceBeingMoved=null,this._linePointBeingMoved=null),t.stop&&t.stop(),i=this.detachSource(t,e),t.metaInfo&&t.metaInfo()&&"Compare@tv-basicstudies"===t.metaInfo().id){for(o=this.paneForSource(this.m_mainSeries),n=o.dataSources(),s=0;s<n.length;s++)if(n[s].metaInfo&&"Compare@tv-basicstudies"===n[s].metaInfo().id)return;this.m_mainSeries.priceScale().properties().percentage.setValue(!1)}return this.invalidate(new b(b.FULL_UPDATE)),this._invalidateBarColorerCaches(),t.linkKey&&A.removeLineTool({model:this,linkKey:t.linkKey}),t instanceof T&&t.isChildStudy()&&t.source().unsetChild(t),i},r.prototype.move=function(t,e,i){var o,n,s,r,a=this.children(t,!0),l=this.paneForSource(t),h=e?e.priceScaleName(i):"right";if(l===e){for(o=e.priceScaleByName(h),n=0;n<a.length;n++)e.move(a[n],o);e.move(t,o)}else{for(s=e||this.createPane(),r=s.priceScaleByName(h),n=0;n<a.length;n++)this.detachSource(a[n]);for(n=0;n<a.length;n++)s.addDataSource(a[n],r);this.detachSource(t),s.addDataSource(t,r)}this.invalidate(new b(b.FULL_UPDATE))},r.prototype.isSingleInstanceLineTool=function(t){return"LineStudyMtpRiskReward"===t||"LineStudyMtpAnalysis"===t},r.prototype._externalTimeStamp=function(t){var e=this.mainSeries().syncModel();return this.m_timeScale.points().roughTime(t,e&&e.projectTime.bind(e))},r.prototype.createLineTool=function(t,e,i,o,n){var s,r,h,c,d,p,u,_;return l.isValid(i)?(this.isSingleInstanceLineTool(i)&&this._undoModel.removeAllDrawingTools(i),"LineToolExecution"!==i&&D("drawings","Study_Drawing_"+i),s=l.create(i,this,o,null,t.mainDataSource()),r=!s.linkKey&&!n,A.drawOnAllCharts().value()?s.linkKey=n||TradingView.randomHash():s.linkKey=n,s.toolname=i,s.setOwnerSource(t.mainDataSource()),h=t.defaultPriceScale(),t.addDataSource(s,h),d=this.m_timeScale.indexToCoordinate(e.index),p=h.priceToCoordinate(e.price),s.isFixed()?c=s.addFixedPoint(new a.Point(d,p)):(u=s.constructor,u.skipMagnetting||(e.price=this._magnet.align(e.price,e.index,t)),c=s.addPoint(e)),c||(this._lineBeingCreated=s,this._paneBeingCreatedLineOn=t),r&&s.enableCurrentIntervalVisibility(),this.invalidate(new b(b.FULL_UPDATE)),n||!A.drawOnAllCharts().value()||s.properties().singleChartOnly||(_=this._externalTimeStamp(e.index),A.createLineTool({point:{price:e.price,timeStamp:_},linetool:i,properties:s.properties(),symbol:this.mainSeries().symbol(),model:this,linkKey:s.linkKey})),s):null},r.prototype.lineBeingCreated=function(){return this._lineBeingCreated},r.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},r.prototype.coninueCreatingLine=function(t,e,i,o){var n,s,r,a,l,h=this.paneForSource(this._lineBeingCreated);return t.price=this._magnet.align(t.price,t.index,h),n=this._lineBeingCreated.addPoint(t,e,i),s=this._lineBeingCreated,this._lineBeingCreated.updateAllViews(),r=new b(b.LIGHT_UPDATE),a=null,n&&(a={points:this._lineBeingCreated._timePoint,interval:this.mainSeries().interval()},this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null,r.force=!0),this.invalidate(r),o||!A.drawOnAllCharts().value()||s.properties().singleChartOnly||(l=this._externalTimeStamp(t.index),A.continueLineTool({point:{price:t.price,timeStamp:l},envState:e,finalState:a,model:this})),n},r.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var t=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),A.drawOnAllCharts().value()&&!t.properties().singleChartOnly&&A.cancelLineTool({model:this})}},r.prototype.startChangingLinetool=function(t,e,i,o){var n,s,r;this._lineBeingEdited=t,this._linePointBeingEdited=i,this._lineBeingEdited.startChanging(i,e),n=this.paneForSource(t),e.price=this._magnet.align(e.price,e.index,n),this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(i,e),this._lineBeingEdited.setPoint(i,e,o),this._lineBeingEdited.updateAllViews(),s=this._paneInvalidationMask(n,b.LIGHT_UPDATE),s.force=!0,this.invalidate(s),t.linkKey&&!t.properties().singleChartOnly&&(r=this._externalTimeStamp(e.index),A.startChangingLineTool({linkKey:t.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:e.price,timeStamp:r},pointIndex:i,envState:o}))},r.prototype.lineBeingEdited=function(){return this._lineBeingEdited},r.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},r.prototype.changeLinePoint=function(t,e){var i,o,n,s,r=this.paneForSource(this._lineBeingEdited);void 0!==t.x&&void 0!==t.y?(n=this._lineBeingEdited.priceScale(),i=n.coordinateToPrice(t.y),o=Math.round(this.timeScale().coordinateToIndex(t.x)),i=this._magnet.align(i,o,r),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:i,index:o},e)):this._lineBeingEdited.setPoint(this._linePointBeingEdited,t,e),this._lineBeingEdited.updateAllViews(),this.invalidate(new b(b.LIGHT_UPDATE)),this._lineBeingEdited.linkKey&&!this._lineBeingEdited.properties().singleChartOnly&&(s=this._externalTimeStamp(o),A.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:i,timeStamp:s},envState:e}))},r.prototype.endChangingLinetool=function(t){var e,i,o=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,t),this._lineBeingEdited=null,this._linePointBeingEdited=null,e=new b(b.LIGHT_UPDATE),e.force=!0,this.invalidate(e),i={points:o._timePoint,interval:this.mainSeries().interval()},o.linkKey&&!o.properties().singleChartOnly&&A.finishChangingLineTool({model:this,linkKey:o.linkKey,symbol:this.mainSeries().symbol(),finalState:i})},r.prototype.startMovingSource=function(t,e,i){var o,n,s;this._sourceBeingMoved=t,this._linePointBeingMoved=i,this._sourceBeingMoved.startMoving(e,i),o=this.paneForSource(this._sourceBeingMoved),n=this._paneInvalidationMask(o,b.LIGHT_UPDATE),n.force=!0,this.invalidate(n),t.linkKey&&!t.properties().singleChartOnly&&(s=this._externalTimeStamp(e.index),A.startMovingLineTool({linkKey:t.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:e.price,timeStamp:s}}))},r.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved},r.prototype.moveSource=function(t){if(this._sourceBeingMoved.move(t,this._linePointBeingMoved),this.invalidate(new b(b.LIGHT_UPDATE)),this._sourceBeingMoved.linkKey&&!this._sourceBeingMoved.properties().singleChartOnly){var e=this._externalTimeStamp(t.index);A.moveLineTool({linkKey:this._sourceBeingMoved.linkKey,model:this,point:{price:t.price,timeStamp:e}})}},r.prototype.endMovingSource=function(t){var e,i,o=this._sourceBeingMoved,n=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving(t),this._sourceBeingMoved=null,this._linePointBeingMoved=null,e=this._paneInvalidationMask(n,b.LIGHT_UPDATE),e.invalidateAll(b.LIGHT_UPDATE),e.force=!0,this.invalidate(e),o instanceof h&&(i={points:o._timePoint,interval:this.mainSeries().interval()},o.linkKey&&!o.properties().singleChartOnly&&A.finishMovingLineTool({linkKey:o.linkKey,model:this,finalState:i}))},r.prototype.finishLineTool=function(t){var e=this.lineBeingCreated();e&&(e.finish&&e.finish(),!t&&A.drawOnAllCharts().value()&&e.linkKey&&!e.properties().singleChartOnly&&A.finishLineTool({linkKey:e.linkKey,model:this}))},r.prototype.calculateDefaultTags=function(){var t,e,i=[],o=this.dataSources();for(t=0;t<o.length;t++)e=o[t],e.tags&&(i=i.concat(e.tags()));return i},r.prototype.changeZOrder=function(t,e){this.paneForSource(t).changeZOrder(t,e),this.invalidate(new b(b.FULL_UPDATE))},r.prototype.sendToBack=function(t){this.paneForSource(t).sendToBack(t),this.invalidate(new b(b.FULL_UPDATE))},r.prototype.bringToFront=function(t){this.paneForSource(t).bringToFront(t),this.invalidate(new b(b.FULL_UPDATE))},r.prototype.onTagsChanged=function(){return this._tagsChanged},r.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},r.prototype.setTimeViewport=function(t,e){this.timeScale().zoomToBarsRange(t,e),this.recalculateAllPanes(),this.invalidate(new b(b.LIGHT_UPDATE))},r.prototype.zoomToViewport=function(t,e,i,o,n){var r,a,l;this.setTimeViewport(t,e),r=Math.min(i,o),a=Math.max(i,o),l=n.defaultPriceScale(),l.setAutoScale(!1),l.isLog()&&(r=l.priceToLogical(r),a=l.priceToLogical(a)),l.setPriceRange(new s(r,a)),this.recalculateAllPanes(),this.invalidate(this._paneInvalidationMask(n,b.LIGHT_UPDATE))},r.prototype.clearAllStudies=function(){var t,e=this.dataSources();for(t=0;t<e.length;t++)e[t].clearData&&e[t].clearData()},r.prototype.allStudies=function(){var t,e,i,o,n,s,r=[],a=this.m_panes,l=a.length;for(t=0;t<l;++t)for(e=a[t],i=e.dataSources(),o=i.length,n=0;n<o;++n)(s=i[n])instanceof T&&r.push(s);return r},r.prototype.allLineTools=function(){var t,e,i,o,n,s,r=[],a=this.m_panes,l=a.length;for(t=0;t<l;++t)for(e=a[t],i=e.dataSources(),o=i.length,n=0;n<o;++n)s=i[n],TradingView.isInherited(s.constructor,h)&&r.push(s);return r},r.prototype.backgroundColor=function(){return this._properties.paneProperties.background._value},r.prototype.backgroundCounterColor=function(){return new w(this.backgroundColor()).blackWhiteContrast()},r.prototype.isDark=function(){return"white"===this.backgroundCounterColor()},r.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()},r.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()},r.prototype.updateAllVolumeStudies=function(){var t,e,i,o,n,s,r=this.m_panes;for(t=r.length;t--;)for(e=!1,i=r[t],o=i.dataSources(),n=o.length;n--;)(s=o[n])instanceof T&&"Volume"===s.metaInfo().shortId&&(s.updateAllViews(),e||(this.updatePane(i),e=!0))},r.prototype.alertsList=function(){return this._alertsList},r.prototype._modelIntervals=[],r.prototype.setInterval=function(t,e){var i=setInterval(t,e);return this._modelIntervals.push(i),i},r.prototype.clearInterval=function(t){clearInterval(t);var e=this._modelIntervals.indexOf(t);e>-1&&this._modelIntervals.splice(e,1)},r.prototype.clearIntervals=function(){for(var t=0;t<this._modelIntervals.length;t++)clearInterval(this._modelIntervals[t]);this._modelIntervals=[]},r.prototype.destroy=function(){this.clearIntervals()},r.prototype.countUserStudies=function(){var t,e,i,o,n=0;for(t=0;t<this.m_panes.length;t++)for(e=this.m_panes[t].dataSources(),i=0;i<e.length;i++)(o=e[i])instanceof T&&o.showInObjectTree()&&n++;return n},r.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()},r.prototype.copyToOtherCharts=function(t){var e,i,o,n;t.linkKey=t.linkKey||TradingView.randomHash(),e=this,i=t.state(),o=this.mainSeries(),(n=o.syncModel())&&(i.points=t._timePoint.map(function(t){var i=e.timeScale().timePointToIndex(t.time_t)+t.offset;return{price:t.price,timeStamp:e._externalTimeStamp(i)}}),i.linetool=t.getType(),i.model=this,i.symbol=this.mainSeries().symbol(),A.copyLineTool(i))},r.prototype.restoreSource=function(t,e,i,o,n){var s,r,a,l,h,c,d,p;return s=t?this.createPane(e):this.panes()[e],a=o.type,r=a.toLowerCase().startsWith("study")?s._restoreStudy(o):s._restoreLineTool(o),l=r.ownerSource()?r.ownerSource().priceScale():s.priceScaleByName(n),l?(r.setPriceScale(l),l.addDataSource(r)):(l=new m(s._properties.overlayPropreties,this.properties().scalesProperties),l.setHeight(s.m_height),h=r.metaInfo&&"Volume@tv-basicstudies"===r.metaInfo().id,c=h?.75:s.m_rightPriceScale.topMargin(),d=h?0:s.m_rightPriceScale.bottomMargin(),l.setTopMargin(c),l.setBottomMargin(d),l.addDataSource(r),r.setPriceScale(l),r._isOverlay=!0),p=null,o.ownerSource&&(p=s.dataSourceForId(o.ownerSource)),r.setOwnerSource(p),r.setPriceScale(l),r.start(),r.restore&&r.restore(),t&&s.restoreState(i),this.recalculateAllPanes(),this.mainSeries().invalidateBarColorerCache(),this.invalidate(new b(b.FULL_UPDATE,!0)),r.linkKey&&A.restoreLineTool({model:this,linkKey:r.linkKey,state:{restorePane:t,paneIndex:e,paneState:i,sourceState:o,priceScaleName:n}}),r},r.prototype.restoreLineToolState=function(t,e){t.restorePoints(e.points,e.indexes||[]),t.properties().merge(e.state),t.restoreData&&t.restoreData(e),t.createServerPoints(),this.invalidate(new b(b.FULL_UPDATE)),t.linkKey&&A.restoreLineToolState({model:this,linkKey:t.linkKey,state:e})},t.exports=r}).call(e,i(34),i(1),i(90),i(103))},function(t,e,i){"use strict";function o(){}var n=i(146),s=i(243),r=i(140).assert;o.isValid=function(t){return!(!n[t]&&!s[t])},o.create=function(t,e,i,a,l){var h;return r(o.isValid(t),"Unknown line tool: "+t),h=n[t]||s[t],"LineToolVbPFixed"===t?new h(e,i,a,l):"LineToolRegressionTrend"===t?new h(e,i,a):["LineStudyMtpAnalysis","LineStudyMtpDecisionPoint","LineStudyMtpRiskReward","LineStudyMtpElliotWaveMain","LineStudyMtpElliotWaveMajor","LineStudyMtpElliotWaveMinor","LineStudyMtpDownWave1OrA","LineStudyMtpDownWave2OrB","LineStudyMtpDownWave3","LineStudyMtpDownWave4","LineStudyMtpDownWave5","LineStudyMtpDownWaveC","LineStudyMtpUpWave1OrA","LineStudyMtpUpWave2OrB","LineStudyMtpUpWave3","LineStudyMtpUpWave4","LineStudyMtpUpWave5","LineStudyMtpUpWaveC"].indexOf(t)>=0?new h(e,i,a):new h(e,i)},t.exports=o},function(t,e,i){"use strict";for(var o={LineToolFibRetracement:i(147),LineToolFibChannel:i(155),LineToolFibSpeedResistanceArcs:i(157),LineToolProjection:i(158),LineToolTrendBasedFibExtension:i(160),LineToolElliott:i(161).LineToolElliott,LineToolFibCircles:i(162).LineToolFibCircles,LineToolTrading:i(163),LineToolVbPFixed:i(164),LineStudyMtp:i(188),LineToolVertLine:i(166).LineToolVertLine,LineToolBarsPattern:i(189),LineToolTrendBasedFibTime:i(190),LineToolFibTimeZone:i(191),LineToolCircleLines:i(192),LineToolDateRange:i(193),LineToolPriceRange:i(194),LineToolDateAndPriceRange:i(195),LineToolParallelChannel:i(156).LineToolParallelChannel,LineToolTrendAngle:i(196),LineToolTrendLine:i(152).LineToolTrendLine,LineToolArrowMark:i(197).LineToolArrowMark,LineToolExecution:i(199).LineToolExecution,LineToolPitchfan:i(201),LineToolGannSquare:i(203),LineToolFibSpeedResistanceFan:i(204),LineToolGannComplex:i(205),LineToolGannFan:i(206),LineToolFibWedge:i(159).LineToolFibWedge,LineToolPitchfork:i(202).LineToolPitchfork,LineToolDisjointAngle:i(207),LineToolFlatBottom:i(208),LineToolIcon:i(209),LineToolRotatedRectangle:i(210),LineToolFibSpiral:i(211),LineToolHeadAndShoulders:i(212),LineToolTriangle:i(213).LineToolTriangle,LineToolTrianglePattern:i(214),LineTool5PointsPattern:i(215).LineTool5PointsPattern,LineToolThreeDrivers:i(216),LineToolABCD:i(217),LineToolRiskReward:i(218).LineToolRiskReward,LineToolPolyline:i(219),LineToolPrediction:i(220),LineToolPriceLabel:i(222),LineToolNote:i(223).LineToolNote,LineToolNoteAbsolute:i(223).LineToolNoteAbsolute,LineToolBrush:i(224),LineToolArc:i(225),LineToolCallout:i(226),LineToolBalloon:i(227),LineToolText:i(124).LineToolText,LineToolHorzLine:i(122).LineToolHorzLine,LineToolHorzRay:i(228),LineToolRectangle:i(150).LineToolRectangle,LineToolEllipse:i(229),LineToolTimeCycles:i(230),LineToolSineLine:i(231),LineToolGhostFeed:i(232),LineToolBezierQuadro:i(233).LineToolBezierQuadro,LineToolBezierCubic:i(233).LineToolBezierCubic,LineToolArrow:i(234),LineToolRay:i(235),LineToolExtended:i(236),LineToolSchiffPitchfork:i(237),LineToolSchiffPitchfork2:i(238),LineToolInsidePitchfork:i(239),LineToolTextAbsolute:i(124).LineToolTextAbsolute,LineToolArrowMarkLeft:i(197).LineToolArrowMarkLeft,LineToolArrowMarkRight:i(197).LineToolArrowMarkRight,LineToolArrowMarkUp:i(197).LineToolArrowMarkUp,LineToolArrowMarkDown:i(197).LineToolArrowMarkDown,LineToolFlagMark:i(240),LineToolCypherPattern:i(215).LineToolCypherPattern,LineToolElliottImpulse:i(161).LineToolElliottImpulse,LineToolElliottTriangle:i(161).LineToolElliottTriangle,LineToolElliottTripleCombo:i(161).LineToolElliottTripleCombo,LineToolElliottCorrection:i(161).LineToolElliottCorrection,LineToolElliottDoubleCombo:i(161).LineToolElliottDoubleCombo,LineToolRiskRewardLong:i(218).LineToolRiskRewardLong,LineToolRiskRewardShort:i(218).LineToolRiskRewardShort,LineToolPosition:i(241),LineToolOrder:i(242)},n=Object.keys(o),s=n.length;s--;)TradingView[n[s]]=o[n[s]];t.exports=o},function(t,e,i){"use strict";function o(){h.call(this)}function n(t,e){d.call(this,t,e),this._rendererCache={},this._invalidated=!0}function s(t,e){this._constructor="LineToolFibRetracement";var i=e||this.createPropertiesObject("linetoolfibretracement");c.call(this,t,new n(this,t),i),this.version=s.version,this._properties._stateVersion=1,t._fibRetracementLabelsCache||(t._fibRetracementLabelsCache=new o)}var r=i(30),a=i(148),l=i(150).RectangleTransparencyRenderer,h=i(151),c=i(82).LineDataSource,d=i(123),p=i(152).TrendLineRenderer,u=i(154),_=i(113),f=i(117);inherit(o,h),o.prototype.levelsCount=function(){return s.LevelsCount},inherit(n,d),n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var t,e,i,o,n,r,a,l,h,c,p,u,_,f;if(d.prototype.update.call(this),this._cacheState=this._model._fibRetracementLabelsCache.updateSource(this._source),!(this._source.points().length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(t=this._source.points()[0],e=this._source.points()[1],i=!1,o=this._source.properties(),o.reverse&&o.reverse.value()&&(i=o.reverse.value()),this._levels=[],n=i?e.price-t.price:t.price-e.price,r=i?t.price:e.price,!this._source.priceScale().isPercent()||null!==(a=this._source.ownerSource().firstValue())))for(l=1;l<=s.LevelsCount;l++)h="level"+l,c=o[h],c.visible.value()&&(p=c.coeff.value(),u=c.color.value(),_=r+p*n,this._source.priceScale().isPercent()&&(_=this._source.priceScale().priceRange().convertToPercent(_,a)),f=this._source.priceScale().priceToCoordinate(_),this._levels.push({color:u,y:f,linewidth:o.levelsStyle.linewidth.value(),linestyle:o.levelsStyle.linestyle.value(),index:l}))},n.prototype.renderer=function(){var t,e,i,o,n,s,a,h,d,m,g,v,y,b,w,S,T,C,x,P,L,k;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new f,this._points.length<2)return t;for(e=this._points[0],i=this._points[1],o=Math.min(e.x,i.x),n=Math.max(e.x,i.x),s=this._source.properties(),a=s.fillBackground.value(),h=s.transparency.value(),d=s.extendLines.value()?this._model.timeScale().width():n,m=this._model._fibRetracementLabelsCache,g=m.canvas().get(0),v=0;v<this._levels.length;v++)if(v>0&&a&&(y=this._levels[v-1],e=new r.Point(o,this._levels[v].y),i=new r.Point(d,y.y),b={},b.points=[e,i],b.color=this._levels[v].color,b.linewidth=0,b.backcolor=this._levels[v].color,b.fillBackground=!0,b.transparency=h,t.append(new l(b))),e=new r.Point(o,this._levels[v].y),i=new r.Point(n,this._levels[v].y),w={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._levels[v].color,linewidth:this._levels[v].linewidth,linestyle:this._levels[v].linestyle,extendleft:!1,extendright:s.extendLines.value(),leftend:c.LINEEND_NORMAL,rightend:c.LINEEND_NORMAL},S=new _(_.MOVEPOINT,null,this._levels[v].index),t.append(new p(w,S)),s.showCoeffs.value()||s.showPrices.value()){if(!this._cacheState.preparedCells)continue;if(!(T=this._cacheState.preparedCells.cells[this._levels[v].index-1]))continue;switch(s.horzLabelsAlign.value()){case"left":C=e;break;case"center":C=e.add(i).scaled(.5),C.x+=T.width/2,C.x=Math.round(C.x);break;case"right":s.extendLines.value()?C=new r.Point(d-4,this._levels[v].y):(C=new r.Point(d+4,this._levels[v].y),C.x+=T.width,C.x=Math.round(C.x))}x={left:T.left,top:m.topByRow(this._cacheState.row),width:T.width,height:m.rowHeight(this._cacheState.row)},P={left:C.x-x.width,top:C.y,width:T.width,height:x.height},L=s.vertLabelsAlign.value(),"middle"===L&&(P.top-=P.height/2),"bottom"===L&&(P.top-=P.height),k=new u(g,x,P),t.append(k)}return s.trendline.visible.value()&&(w={points:[this._points[0],this._points[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:s.trendline.color.value(),linewidth:s.trendline.linewidth.value(),linestyle:s.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.LINEEND_NORMAL,rightend:c.LINEEND_NORMAL},t.append(new p(w))),this.addAnchors(t),t},inherit(s,c),s.version=2,s.LevelsCount=24,s.prototype.stop=function(){c.prototype.stop.call(this),this._model._fibRetracementLabelsCache.removeSource(this.id())},s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Fib Retracement"},s.prototype.migrateVersion=function(t,e,i){1===t&&this.properties().extendLines.setValue(!0)},s.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},s.prototype.createPropertiesObject=function(t,e,i){return new a(t,e,i,{range:[1,24],names:["coeff","color","visible"]})},t.exports=s},function(t,e,i){(function(e){"use strict";function o(t,e,i,o){this._map=$.extend({},this._map,o),e&&(e=this.unpackLevels(e)),s.call(this,t,e,i),this.updateCollectibleProperty()}var n=i(28).isSameType,s=i(91).DefaultProperty,r=i(149);inherit(o,s),o.prototype.state=function(t,i){t=t||[],t.push("__collectibleLines");var o=e.prototype.state.call(this,t);return i?o:this.packLevels(o)},o.prototype.clone=function(){var t=this.state();return this.__collectibleLines&&(t.__collectibleLines=this.__collectibleLines.state()),new o(this._defaultName,t)},o.prototype.merge=function(t){e.prototype.merge.call(this,this.unpackLevels(t)),this.updateCollectibleProperty()},o.prototype._map={prefixes:[""],range:[0,0],names:["coeff","color","visible","linestyle","linewidth"],typecheck:{pack:Object,unpack:Array}},o.prototype._packLvlTpl=function(){return[]},o.prototype._unpackLvlTpl=function(){return{}},o.prototype._packLvlFill=function(t,e,i,o){return o.push(i[e]),o},o.prototype._unpackLvlFill=function(t,e,i,o){return o[e]=i[t],o},o.prototype._iterateLevels=function(t,e){var i,o,s,r,a;for(i in this._map.prefixes)for(o=(this._map.prefixes[i]||"")+"level",s=this._map.range[0];s<=this._map.range[1];s++)if(t[o+s]&&n(t[o+s],e.typecheck())){r=e.tpl();for(a in this._map.names)r=e.fill(a,this._map.names[a],t[o+s],r);t[o+s]=r}return t},o.prototype.packLevels=function(t){return this._iterateLevels(t,{tpl:this._packLvlTpl,fill:this._packLvlFill,typecheck:this._map.typecheck.pack})},o.prototype.unpackLevels=function(t){return this._iterateLevels(t,{tpl:this._unpackLvlTpl,fill:this._unpackLvlFill,typecheck:this._map.typecheck.unpack})},o.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions,!0))},o.prototype.updateCollectibleProperty=function(){var t,e;this.__collectibleLines&&(t=this,e=[],this.__collectibleLines._childs.forEach(function(i){var o,n=t.__collectibleLines[i].value(),s=n.split("."),r=t[s[0]];for(o=1;o<s.length&&r;++o)r=r[s[o]];r&&e.push({property:r.color,defaultValue:r.color.value()})}),this.collectibleColors?this.collectibleColors.reloadProperties(e):this.collectibleColors=new r(e))},t.exports=o}).call(e,i(83))},function(t,e,i){(function(e){"use strict";function i(t){e.call(this,""),this.subscribe(this,i.prototype.checkSelfColor),this.reloadProperties(t)}inherit(i,e),i.prototype.reloadProperties=function(t){for(;this._childs.length>0;)this.removeProperty(this._childs[0]);this._initValues=[];for(var e=0;e<t.length;++e)this._initValues.push(t[e].defaultValue),this.addChild(e,t[e].property);this.checkSelfColor()},i.prototype.setValue=function(t,i){if(this._value!==t||i){var o=this;this._childs.forEach(function(e){o[e].setValue(t||o._initValues[e])}),e.prototype.setValue.call(this,t,i)}},i.prototype.checkSelfColor=function(){var t,i=!0;for(t=0;t<this._initValues.length;++t)if(this[t].value()!==this[0].value()){i=!1;break}e.prototype.setValue.call(this,i?this[0].value():"")},t.exports=i}).call(e,i(83))},function(t,e,i){"use strict";function o(t,e,i){this._data=t,this._hittestResult=e||new c(c.MOVEPOINT),this._backHittestResult=i||new c(c.MOVEPOINT_BACKGROUND)}function n(t,e){h.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolRectangle";var i=e||new p("linetoolrectangle");l.call(this,t,new n(this,t),i)}function r(t,e,i){o.call(this,t,e,i)}var a=i(30),l=i(82).LineDataSource,h=i(123),c=i(113),d=i(117),p=i(91).DefaultProperty,u=i(119);o.prototype.getColor=function(){return u.generateColor(this._data.backcolor,this._data.transparency)},o.prototype.draw=function(t){var e,i,o;this._data.points.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.points[0],i=this._data.points[1],o=i.substract(e),t.beginPath(),t.rect(e.x,e.y,o.x,o.y),this._data.linewidth>0&&t.stroke(),this._data.fillBackground&&(t.fillStyle=this.getColor(),t.fill()))},o.prototype.hitTest=function(t){var e,i,o,n,s,r,l,h,c,d;return this._data.points.length<2||this._data.nohittest?null:(e=3,i=this._data.points[0],o=this._data.points[1],n=new a.Point(o.x,i.y),s=new a.Point(i.x,o.y),r=a.distanceToSegment(i,n,t),r.distance<=e?this._hittestResult:(r=a.distanceToSegment(n,o,t),r.distance<=e?this._hittestResult:(r=a.distanceToSegment(o,s,t),r.distance<=e?this._hittestResult:(r=a.distanceToSegment(s,i,t),r.distance<=e?this._hittestResult:this._data.fillBackground&&(l=Math.min(i.x,o.x),h=Math.max(i.x,o.x),c=Math.min(i.y,o.y),d=Math.max(i.y,o.y),i=new a.Point(l,c),o=new a.Point(h,d),a.pointInRect(t,i,o))?this._backHittestResult:null))))},inherit(n,h),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){h.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,n,s,r;return this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().color.value(),t.linewidth=this._source.properties().linewidth.value(),t.backcolor=this._source.properties().backgroundColor.value(),t.fillBackground=this._source.properties().fillBackground.value(),t.transparency=this._source.properties().transparency.value(),this.isAnchorsRequired()?(e=new d,e.append(new o(t)),i=this._points[0],n=this._points[1],s=new a.Point(i.x,n.y),s.data=2,r=new a.Point(n.x,i.y),r.data=3,e.append(this.createLineAnchor({points:[i,n,s,r]})),e):new o(t)},inherit(s,l),s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Rectangle"},s.prototype.setPoint=function(t,e,i){var o,n,s;if(t<2)return void l.prototype.setPoint.call(this,t,e,i);i&&i.shift&&this._properties.snapTo45Degrees&&(o=this.points()[0],n=this.points()[1],s={price:2===t?o.price:n.price,index:2===t?n.index:o.index},this._snapPoint45Degree(e,s)),this._convertPriceFromPercentIfNeeded(e),3===t?(this._points[0].price=e.price,this._points[1].index=e.index):(this._points[1].price=e.price,this._points[0].index=e.index),this.normalizePoints()},inherit(r,o),r.prototype.getColor=function(){return u.generateColor(this._data.backcolor,this._data.transparency,!0)},e.RectangleRenderer=o,e.RectangleTransparencyRenderer=r,e.LineToolRectangle=s},function(t,e,i){"use strict";function o(){this._registeredSources={},this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=0,this._actualWidth=1,this._numericFormatter=new r,this._percentageFormatter=new s}var n=i(94),s=n.PercentageFormatter,r=n.NumericFormatter;o.prototype.levelsCount=function(){return 0},o.prototype.topByRow=function(t){return t*o.ROW_HEIGHT},o.prototype.rowHeight=function(t){return o.ROW_HEIGHT},o.prototype.canvas=function(){if(!this._canvas){this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this._canvas.prop("width",100).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0);this._canvas.get(0).getContext("2d").font="12px Verdana"}return this._canvas},o.ROW_HEIGHT=14,o.prototype.points=function(t){return[t.points()[0],t.points()[1]]},o.prototype.startPoint=function(t,e){return e?t.points()[0]:t.points()[1]},o.prototype.priceRange=function(t,e){var i=this.points(t),o=i[0],n=i[1];return e?n.price-o.price:o.price-n.price},o.prototype.sourceIsReady=function(t){return t.points().length>=2},o.prototype._calculateWidth=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T;if(!this.sourceIsReady(t))return null;if(e=this.canvas().get(0).getContext("2d"),e.font="12px Verdana",i=!!t.properties().showPrices&&t.properties().showPrices.value(),o=!!t.properties().coeffsAsPercents&&t.properties().coeffsAsPercents.value(),n=t.properties().showCoeffs.value(),s=t.priceScale().formatter(),r=this.points(t),a=r[0],l=r[1],!a||!l)return null;if(h=!1,c=t.properties(),c.reverse&&c.reverse.value()&&(h=c.reverse.value()),d=this.priceRange(t,h),p=this.startPoint(t,h).price,t.priceScale().isPercent()&&null===(u=t.ownerSource().firstValue()))return 0;for(_=0,f=[],m=1;m<=this.levelsCount();m++)g="level"+m,v=c[g],y=v.coeff.value(),b=p+y*d,t.priceScale().isPercent()&&(b=t.priceScale().priceRange().convertToPercent(b,u)),w="",n&&(w+=o?this._percentageFormatter.format(Math.round(1e4*y)/100):this._numericFormatter.format(y)),i&&(w+="("+s.format(b)+")"),S=e.measureText(w).width,T={text:w,left:_,width:S+4},f.push(T),_+=T.width;return{totalWidth:_,cells:f}},o.prototype._effectiveState=function(t){var e,i,o,n,s,r,a={},l=t.properties();for(l.showPrices&&(a.showPrices=l.showPrices.value()),l.coeffsAsPercents&&(a.coeffsAsPercents=l.coeffsAsPercents.value()),a.showCoeffs=l.showCoeffs.value(),t.priceScale()&&t.priceScale().formatter().state&&(a.formatter=t.priceScale().formatter().state()),l.reverse&&(a.reverse=l.reverse.value()),a.p1=t.points()[0],a.p2=t.points()[1],3===t.points().length&&(a.p3=t.points()[2]),a.items=[],e=1;e<=this.levelsCount();e++)i="level"+e,o=l[i],n=o.coeff.value(),s=o.color.value(),r={coeff:n,color:s},a.items.push(r);return a},o.prototype._findEmptyRow=function(t){for(var e,i=0;this._rowsToSources[i];)i++;return this._rowsToSources[i]=t,i>=this._actualCapacity&&(this._actualCapacity++,e=this.canvas(),TradingView.resizeCanvas(e,this._actualWidth,o.ROW_HEIGHT*this._actualCapacity)),i},o.prototype._repaintSource=function(t,e,i){var n,s,r=o.ROW_HEIGHT*i.row,a=this.canvas().get(0).getContext("2d");for(a.clearRect(0,r,this._actualWidth,o.ROW_HEIGHT),a.textBaseline="bottom",a.font="12px Verdana",r+=o.ROW_HEIGHT,n=0;n<t.cells.length;n++)s=t.cells[n],a.fillStyle=e.items[n].color,a.fillText(s.text,s.left,r)},o.prototype.removeSource=function(t){var e,i;this._sourcesToRow[t]&&(e=this._sourcesToRow[t].row,i=this.canvas().get(0).getContext("2d"),i.save(),i.clearRect(0,this.topByRow(e),this._actualWidth,o.ROW_HEIGHT),i.restore(),delete this._sourcesToRow[t],delete this._rowsToSources[e])},o.prototype._effectiveStatesEquals=function(t,e){var i,o=function(t,e){return!(!t&&!e)&&(!(!t||e)||(!(t||!e)||(t.minMove!==e.minMove||(t.minMove2!==e.minMove2||(t.fractional!==e.fractional||t.fractionalLength!==e.fractionalLength)))))},n=function(t,e){return!(!t&&!e)&&(!(!t||e)||(!(t||!e)||(t.index!==e.index||t.price!==e.price)))},s=function(t,e){return t.coeff!==e.coeff||t.color!==e.color};if(t&&!e)return!1;if(!t&&e)return!1;if(t.showPrices!==e.showPrices)return!1;if(t.coeffsAsPercents!==e.coeffsAsPercents)return!1;if(t.showCoeffs!==e.showCoeffs)return!1;if(t.reverse!==e.reverse)return!1;if(o(t.formatter,e.formatter))return!1;if(n(t.p1,e.p1))return!1;if(n(t.p2,e.p2))return!1;if(n(t.p3,e.p3))return!1;if(t.items.length!==e.items.length)return!1;for(i=0;i<t.items.length;i++)if(s(t.items[i],e.items[i]))return!1;return!0},o.prototype.updateSource=function(t){var e,i,n,s,r=t.properties().symbol.value();return this._currentSymbol!==r&&(this._currentSymbol=r,this._sourcesToRow={},this._rowsToSources={}),this._sourcesToRow[t.id()]||(e=this._findEmptyRow(t.id()),this._sourcesToRow[t.id()]={effectiveState:null,row:e}),i=this._sourcesToRow[t.id()].effectiveState,n=this._effectiveState(t),this._effectiveStatesEquals(i,n)||(s=this._calculateWidth(t),s?(this._sourcesToRow[t.id()].effectiveState=n,s.totalWidth>this._actualWidth&&(TradingView.resizeCanvas(this.canvas(),s.totalWidth,o.ROW_HEIGHT*this._actualCapacity),this._actualWidth=s.totalWidth),e=this._sourcesToRow[t.id()],this._repaintSource(s,n,e),this._sourcesToRow[t.id()].effectiveState=n,this._sourcesToRow[t.id()].preparedCells=s):this._sourcesToRow[t.id()].effectiveState=null),this._sourcesToRow[t.id()]},t.exports=o},function(t,e,i){"use strict";function o(){var t,e,i,o;this._registeredSources={},this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=0,this._actualWidth=0,this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this._currentWidth=400,this._canvas.prop("width",this._currentWidth).prop("height",1).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0),this._ctx=this._canvas.get(0).getContext("2d"),this._ctx.font=l.LABEL_FONTSIZE+"px"+l.LABEL_FONT,t=l.LABEL_FONTSIZE,e=l.LABEL_LINESPACING,i=t+e,o=3,this._padding=8,this._rowHeight=i*o-e+2*this._padding+2}function n(t,e,i){this._textSizeCache=e,this._data=t,this._fontSize=t.fontsize?t.fontsize:t.fontSize?t.fontSize:12,this._lineSpacing="number"==typeof this._data.lineSpacing&&this._data.lineSpacing?this._data.lineSpacing:0,t.lines=this._lines=f.prototype.wordWrap.call(this,t.text,t.wordWrapWidth),this._hittest=i||new g(g.MOVEPOINT)}function s(){var t=document.createElement("canvas");t.width=0,t.height=0,h=t.getContext("2d"),t=null}function r(t,e){this._data=t,this._hittest=e||new g(g.MOVEPOINT)}function a(t,e){u.call(this,t,e),this._label=null,this._rendererCache={},this._invalidated=!0,this._labelDataInvalidated=!0,this._percentageFormatter=new S,this._numericFormatter=new T}function l(t,e){this._constructor="LineToolTrendLine";var i=e||new b("linetooltrendline");_.call(this,t,new a(this,t),i),t._trendLineStatsCache||(t._trendLineStatsCache=new o)}var h,c,d=i(30),p=i(153).clipSegmentToViewport,u=i(123),_=i(82).LineDataSource,f=i(124).TextRenderer,m=i(154),g=i(113),v=i(114).PaneRendererClockIcon,y=i(117),b=i(91).DefaultProperty,w=i(94),S=w.PercentageFormatter,T=w.NumericFormatter,C=w.TimeSpanFormatter;o.prototype.canvas=function(){return this._canvas},o.prototype.topByRow=function(t){return t*this._rowHeight},o.prototype.rowHeight=function(t){return this._rowHeight},o.prototype.rowWidth=function(t){var e=this._rowsToSources[t];return this._sourcesToRow[e].width},o.prototype.currentWidth=function(){return this._currentWidth},o.prototype._findEmptyRow=function(t){for(var e=0;this._rowsToSources[e];)e++;return this._rowsToSources[e]=t,e>=this._actualCapacity&&(this._actualCapacity++,TradingView.resizeCanvas(this._canvas,this._currentWidth,this._rowHeight*this._actualCapacity),this._ctx=this._canvas.get(0).getContext("2d"),TradingView.logDebugChart("TrendLineCache. Expanging cache to "+this._actualCapacity+" items")),e},o.prototype._effectiveState=function(t){var e,i={};return i.p1=$.extend({},t.points()[0]),i.p2=$.extend({},t.points()[1]),e=t.properties(),i.showBars=e.showBarsRange.value(),i.showTimeRange=e.showDateTimeRange.value(),i.showDistance=e.showDistance.value(),i.showPriceRange=e.showPriceRange.value(),i.showAngle=e.showAngle.value(),i.color=e.textcolor.value(),i.showAngle&&(i.priceRange=t.priceScale().priceRange().state(),i.barSpacing=t._model.timeScale().barSpacing()),i},o.prototype._effectiveStatesEquals=function(t,e){var i=function(t,e){return!(!t&&!e)&&(!(!t||e)||(!(t||!e)||(t.index!==e.index||t.price!==e.price)))};if(t&&!e)return!1;if(!t&&e)return!1;if(i(t.p1,e.p1))return!1;if(i(t.p2,e.p2))return!1;if(t.color!==e.color)return!1;if(t.showBars!==e.showBars)return!1;if(t.showTimeRange!==e.showTimeRange)return!1;if(t.showDistance!==e.showDistance)return!1;if(t.showPriceRange!==e.showPriceRange)return!1;if(t.showAngle!==e.showAngle)return!1;if(t.showAngle){if(t.priceRange.min!==e.priceRange.min)return!1;if(t.priceRange.max!==e.priceRange.max)return!1;if(t.barSpacing!==e.barSpacing)return!1}return!0},o.prototype.removeSource=function(t){if(this._sourcesToRow[t]){var e=this._sourcesToRow[t].row;this._ctx.save(),this._ctx.clearRect(0,this.topByRow(e),this._currentWidth,this.rowHeight(e)),this._ctx.restore(),delete this._sourcesToRow[t],delete this._rowsToSources[e]}},o.prototype._repaintSource=function(t,e,i){var o,s;this._ctx.save(),this._ctx.translate(0,this.topByRow(e)+.5),i.points[0]=new d.Point(0,0),i.offsetX=0,i.offsetY=0,delete i.horzAlign,delete i.vertAlign,this._ctx.clearRect(0,0,this._currentWidth,this.rowHeight(e)),o=new n(i,{}),s=o.draw(this._ctx),this._sourcesToRow[t].width=s.width,this._ctx.restore()},o.prototype.updateSource=function(t,e){var i,o,n,s,r,a=t.properties().symbol.value();return this._currentSymbol!==a&&(TradingView.logDebugChart("TrendLineCache. Clearing canvas because of changing symbol from "+this._currentSymbol+" to "+a),this._currentSymbol=a,this._sourcesToRow={},this._rowsToSources={}),i=t.id(),this._sourcesToRow[i]||(o=this._findEmptyRow(i),this._sourcesToRow[i]={effectiveState:null,row:o}),n=this._sourcesToRow[t.id()].effectiveState,s=this._effectiveState(t),this._effectiveStatesEquals(n,s)||(o=this._sourcesToRow[t.id()],r=e(),this._repaintSource(i,o.row,r),this._sourcesToRow[i].effectiveState=s),this._sourcesToRow[i]},c={priceRange:{width:15,height:14,data:[134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,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,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,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,0,0,0,0,0,0,0,134,134,138,255,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,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,134,134,138,255,134,134,138,255,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,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,0,0,134,134,138,255,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,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,0,0,134,134,138,255,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,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,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,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,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,134,134,138,255,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,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,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,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]},barsRange:{width:16,height:15,data:[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,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,0,0,134,134,138,255,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,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,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,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,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,0,0,0,0,0,0,134,134,138,255,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,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,0,0]},angle:{width:14,height:12,data:[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,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]}},n.prototype._preRender=function(){var t,e,i,o,n,r,a,l,c,p,u,_,f,m,g,v,y,b,w,S,T,C,x;if(!this._preRendered){if(h||s(),t=this._data.points[0].x+(this._data.offsetX||0),e=t,i=this._data.points[0].y+(this._data.offsetY||0),o=i,n=this._fontSize,r=this._lineSpacing,a=n+r,l=a*this._lines.length-r,h.textBaseline="top",h.font=this.fontStyle(),c=[],this._data.wordWrapWidth)for(p=this._data.wordWrapWidth,u=0;u<this._lines.length;u++)c.push(this._data.wordWrapWidth);else for(p=0,u=0;u<this._lines.length;u++)_=h.measureText(this._lines[u]).width,c.push(_),p=Math.max(p,_);if(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){f={top:this._data.paddingTop||0,right:this._data.paddingRight||0,bottom:this._data.paddingBottom||0,left:this._data.paddingLeft||0},m={x:0,y:0},this._data.backgroundHorzInflate&&(g=this._data.backgroundHorzInflate/2,f.left+=g,f.right+=g,m.x=-g),this._data.backgroundVertInflate&&(v=this._data.backgroundVertInflate/2,f.top+=v,f.bottom+=v,m.y=-v),y="number"==typeof this._data.padding?this._data.padding:~~(n/6);for(u in f)f[u]||(f[u]=y);b={x:Math.floor(t+m.x),y:Math.floor(i+m.y),w:Math.ceil(p+f.left+f.right),h:Math.ceil(l+f.top+f.bottom)},e+=f.left+m.x,o+=f.top+m.y,"bottom"!==this._data.vertAlign&&"middle"!==this._data.vertAlign||(w="middle"===this._data.vertAlign?i-b.h/2:i-b.h-(b.y-i),S=w-b.y,o+=S,b.y=w),"right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(T="center"===this._data.horzAlign?t-b.w/2:t-b.w-(b.x-t),C=T-b.x,e+=C,b.x=T,this._data.doNotAlignText!==!0&&("right"===this._data.horzAlign?(h.textAlign="end",e+=p):(h.textAlign="center",e+=p/2))),b.w%2!=0&&b.w++,b.x+=.5,b.y+=.5,this._boundingRect=[new d.Point(b.x,b.y),new d.Point(b.x+b.w,b.y+b.h)],this._rect=b,this._padding=f,this._defaultPadding=y}else"bottom"!==this._data.vertAlign&&"middle"!==this._data.vertAlign||(o-=Math.round(l*("middle"===this._data.vertAlign?.5:1))),x=e,"right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(x-=Math.round(p*("center"===this._data.horzAlign?.5:1))),this._boundingRect=[new d.Point(x,o),new d.Point(x+p,o+l)];this._textPoint={x:e,y:o},this._textSizeCache&&(this._textSizeCache.widths=c),this._preRendered=!0,this._maxWidth=p}},n.prototype._drawIcon=function(t,e,i,o){var n,s,r,a;if(c.hasOwnProperty(o)){if(n=c[o],!n.src){for(n.src=document.createElement("canvas"),n.src.width=n.width,n.src.height=n.height,s=n.src.getContext("2d"),r=s.createImageData(n.width,n.height),a=0;a<n.data.length;a++)r.data[a]=n.data[a];s.putImageData(r,0,0)}t.drawImage(n.src,e,i)}},n.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},n.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d;if(0!==this._data.points.length){for(this._preRender(),e=this._fontSize,i=this._lineSpacing,o=e+i,t.textBaseline="top",t.font=this.fontStyle(),n=this._rect,(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth)&&this._rect?("right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||this._data.doNotAlignText!==!0&&(t.textAlign="right"===this._data.horzAlign?"end":"center"),this._data.backgroundRoundRect?(t.roundRect(n.x,n.y,n.w,n.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.globalAlpha=this._data.backgroundTransparency,t.fill(),t.globalAlpha=1),this._data.borderColor&&(s="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(e/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=s,t.stroke())):(this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.globalAlpha=this._data.backgroundTransparency,t.fillRect(n.x,n.y,n.w,n.h),t.globalAlpha=1),this._data.borderColor?(s="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(e/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=s,t.strokeRect(n.x-s/2,n.y-s/2,n.w+s,n.h+s)):this._data.highlightBorder&&(t.strokeStyle=this._data.color,t.lineWidth=1,t.beginPath(),l=[3,1],t.dashedLineTo(n.x-.5,a=n.y-.5,r=n.x+n.w+.5,a,l),t.dashedLineTo(r,a,r,a=n.y+n.h+.5,l),t.dashedLineTo(r=n.x-.5,a,n.x+n.w+.5,a,l),t.dashedLineTo(r,n.y-.5,r,a,l),t.globalAlpha=.5,t.stroke(),t.globalAlpha=1)),this._data.icons&&this._data.icons.forEach(function(e,i){var s=n.x+this._defaultPadding,r=n.y+this._padding.top+o*i;this._drawIcon(t,s,r,e)},this)):"right"===this._data.horzAlign?t.textAlign="end":"center"===this._data.horzAlign&&(t.textAlign="center"),h=this._textPoint.x,c=this._textPoint.y,t.fillStyle=this._data.color,d=0;d<this._lines.length;d++)t.fillText(this._lines[d],h,c),c+=o;return{width:n.w+2}}},n.prototype.hitTest=function(t){return 0===this._data.points.length?null:(this._preRender(),this._boundingRect&&d.pointInRect(t,this._boundingRect[0],this._boundingRect[1])?this._hittest:null)},r.prototype.drawArrow=function(t,e,i,o){var n,s,r,a,l,h,c,d,p;e.substract(t).length()<1||(n=e.substract(t).normalized(),s=5*o,r=n.scaled(s),a=e.substract(r),l=n.transponed(),h=3*o,c=l.scaled(h),d=a.add(c),p=a.substract(c),CanvasEx.drawLine(i,Math.round(d.x),Math.round(d.y),e.x,e.y),CanvasEx.drawLine(i,Math.round(p.x),Math.round(p.y),e.x,e.y))},r.prototype.expandPoints=function(t,e,i,o){var n,s,r=new d.Point(0,0),a=new d.Point(i,o);return this._data.extendleft&&(n=t.substract(e),(s=d.intersectRayWithRect(t,t.add(n),r,a))&&(t=s)),this._data.extendright&&(n=e.substract(t),(s=d.intersectRayWithRect(e,e.add(n),r,a))&&(e=s)),[t,e]},r.prototype.drawCircle=function(t,e,i,o){o=$.extend({fillStyle:"#000000"},o),e.save(),e.fillStyle=o.fillStyle,e.beginPath(),e.arc(t.x,t.y,i,0,2*Math.PI,!1),e.fill(),o.strokeWidth&&(e.lineWidth=o.strokeWidth,e.stroke()),e.restore()},r.prototype.draw=function(t){var e,i,o,n,s,r;this._data.points&&this._data.points.length<2||this._data.floatPoints&&this._data.floatPoints.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.floatPoints||this._data.points,i=e[0],o=e[1],this._data.overlayLineEndings?n=[$.extend(!0,{},i),$.extend(!0,{},o)]:this.drawEnds(t,[i,o]),s=this.expandPoints(i,o,this._data.width,this._data.height),r=p(s[0],s[1],this._data.width,this._data.height),r&&this._data.linewidth>0&&CanvasEx.drawLine(t,r[0].x,r[0].y,r[1].x,r[1].y),this._data.overlayLineEndings&&this.drawEnds(t,n))},r.prototype.drawEnds=function(t,e){var i=e[0],o=e[1];switch(this._data.leftend){case _.LINEEND_ARROW:this.drawArrow(o,i,t,t.lineWidth);break;case _.LINEEND_CIRCLE:this.drawCircle(i,t,t.lineWidth,this._data.endstyle)}switch(this._data.rightend){case _.LINEEND_ARROW:this.drawArrow(i,o,t,t.lineWidth);break;case _.LINEEND_CIRCLE:this.drawCircle(o,t,t.lineWidth,this._data.endstyle)}},r.prototype.hitTest=function(t){var e,i,o,n,s,r;return this._data.points&&this._data.points.length<2?null:this._data.floatPoints&&this._data.floatPoints.length<2?null:(e=TradingView.isMobile.any()?24:3,i=this._data.floatPoints||this._data.points,o=i[0],n=i[1],s=this.expandPoints(o,n,this._data.width,this._data.height),r=d.distanceToSegment(s[0],s[1],t),r.distance<=e?this._hittest:null)},inherit(a,u),a.prototype.update=function(){this._invalidated=!0,this._labelDataInvalidated=!0},a.prototype.updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c=this._source.points();c.length<2||(t=c[0],e=c[1],void 0===(i=this._model.timeScale().visibleBars())||i.isEmpty()||(i=i.clone(),o=this._source.properties(),t.index<i.firstBar()&&e.index<i.firstBar()&&!o.extendLeft.value()&&!o.extendRight.value()||(u.prototype.update.call(this),this._points.length<2||(n=o.showBarsRange.value(),s=o.showDateTimeRange.value(),r=o.showDistance.value(),a=o.showPriceRange.value(),l=o.showAngle.value(),a||n||s||r||l?(h=this,this._statCache=this._model._trendLineStatsCache.updateSource(this._source,function(){return h._statLabelData()})):(this._model._trendLineStatsCache.removeSource(this._source.id()),this._label=null,this._labelData&&(this._labelData.text="",this._labelData.lines=[])),this._invalidated=!1))))},a.prototype._statLabelData=function(){var t,e,i,o,n,s,r,a,h,c,p,u,_,f,m,g,v,y,b,w,S,T,x,P,L,k,I,E;return this._labelDataInvalidated&&(t=this._source.points(),e=t[0],i=t[1],o=this._source.properties(),n=[],p=o.showPriceRange.value(),p&&this._source.priceScale()&&(h=i.price-e.price,u=h/e.price,s=this._source.priceScale().formatter().format(h)+" ("+this._percentageFormatter.format(100*u)+")",_=this._model.mainSeries().base(),_&&(f=Math.round(h*_),s+=", "+f),n.push("priceRange")),m=o.showBarsRange.value(),g=o.showDateTimeRange.value(),v=o.showDistance.value(),(m||g||v)&&(r="",m&&(c=i.index-e.index,r+=$.t("{0} bars").format(c)),g&&(y=this._model.timeScale().indexToUserTime(e.index),b=this._model.timeScale().indexToUserTime(i.index),y&&b&&(w=(b.valueOf()-y.valueOf())/1e3,(S=(new C).format(w))&&(r+=m?" ("+S+")":S))),v&&(r&&(r+=", "),void 0===h&&(h=i.price-e.price),void 0===c&&(c=i.index-e.index),T=Math.round(1e5*Math.sqrt(h*h+c*c))/1e5,r+=$.t("distance: {0}").format(this._numericFormatter.format(T))),r&&n.push("barsRange")),x=o.showAngle.value(),x&&(P=this._source.pointToScreenPoint(e),L=this._source.pointToScreenPoint(i),P=P instanceof Array?P[0]:P instanceof d.Point?P:null,L=L instanceof Array?L[0]:L instanceof d.Point?L:null,P instanceof d.Point&&L instanceof d.Point&&(I=L.substract(P),I.length()>0&&(I=I.normalized(),k=Math.acos(I.x),I.y>0&&(k=-k))),"number"!=typeof k||TradingView.isNaN(k)||(a=Math.round(180*k/Math.PI)+"º",n.push("angle"))),this._label=[s,r,a].filter(function(t){return t}).join("\n")||null,this._icons=n,this._labelDataInvalidated=!1),E={points:[this._points[1]],text:this._label,color:this._source.properties().textcolor.value(),font:l.LABEL_FONT,fontsize:l.LABEL_FONTSIZE,lineSpacing:l.LABEL_LINESPACING,backgroundColor:l.LABEL_BGCOLOR,borderColor:l.LABEL_BORDERCOLOR,borderWidth:1,padding:l.LABEL_PADDING,paddingLeft:30,doNotAlignText:!0,icons:this._icons},this._points[1].y<this._points[0].y&&(E.vertAlign="bottom"),this._points[1].x<this._points[0].x&&(E.horzAlign="right"),this._labelData=E,E},a.prototype.renderer=function(){var t,e,i,o,n,s,a,h,c;return this._invalidated&&this.updateImpl(),t=new y,this._invalidated?t:this._source.priceScale()?(e={},e.points=this._points,e.floatPoints=this._floatPoints,e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.color=this._source.properties().linecolor.value(),e.linewidth=this._source.properties().linewidth.value(),e.linestyle=this._source.properties().linestyle.value(),e.extendleft=this._source.properties().extendLeft.value(),e.extendright=this._source.properties().extendRight.value(),e.leftend=this._source.properties().leftEnd.value(),e.rightend=this._source.properties().rightEnd.value(),t.append(new r(e)),i=this.isAnchorsRequired(),o=i||this._source.properties().alwaysShowStats.value(),o&&this._label&&2===this._points.length&&(n=this._points[1],s={left:0,top:this._model._trendLineStatsCache.topByRow(this._statCache.row),width:this._model._trendLineStatsCache.rowWidth(this._statCache.row),height:this._model._trendLineStatsCache.rowHeight(this._statCache.row)},a={left:n.x,top:n.y,width:s.width,height:s.height},"right"===this._labelData.horzAlign?a.left-=l.LABEL_PADDING+a.width:a.left+=l.LABEL_PADDING,"bottom"===this._labelData.vertAlign?a.top-=l.LABEL_PADDING+a.height:a.top+=l.LABEL_PADDING,h=this._model._trendLineStatsCache.canvas(),c=new m(h.get(0),s,a),t.append(c)),this.addAnchors(t),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&e.points.length>=2&&this._source.getAlertIsActive(function(i){t.append(new v({point1:e.points[0],point2:e.points[1],color:i?e.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),t):t},inherit(l,_),l.LABEL_OFFSET=8,l.LABEL_FONT="Arial",l.LABEL_FONTSIZE=12,l.LABEL_LINESPACING=10,l.LABEL_BGCOLOR="rgba(255,255,255,.8)",l.LABEL_BORDERCOLOR="#e3e3e3",l.LABEL_PADDING=8,l.prototype.stop=function(){_.prototype.stop.call(this),this._model._trendLineStatsCache.removeSource(this.id())},l.prototype.pointsCount=function(){return 2},l.prototype.title=function(){return"Trend Line"},l.prototype.canHasAlert=function(){return!0},l.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},e.TrendLineStatsRenderer=n,e.LineToolTrendLine=l,e.TrendLineRenderer=r},function(t,e,i){"use strict";function o(t,e,i,o,n,s,r,a){function l(t,e,i,o,n,s){var r=h.Inside;return t<i?r|=h.Left:t>n&&(r|=h.Right),e<o?r|=h.Bottom:e>s&&(r|=h.Top),r}var h,c,d,p,u,_,f,m;for(!function(t){t[t.Inside=0]="Inside",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Top=8]="Top"}(h||(h={})),c=l(t,e,n,s,r,a),d=l(i,o,n,s,r,a),p=!1,u=0;;){if(u>1e3)throw Error("Cohen - Sutherland algorithm: infinity loop");if(u++,!(c|d)){p=!0;break}if(c&d)break;_=c||d,f=void 0,m=void 0,_&h.Top?(f=t+(i-t)*(a-e)/(o-e),m=a):_&h.Bottom?(f=t+(i-t)*(s-e)/(o-e),m=s):_&h.Right?(m=e+(o-e)*(r-t)/(i-t),f=r):(m=e+(o-e)*(n-t)/(i-t),f=n),_===c?(t=f,e=m,c=l(t,e,n,s,r,a)):(i=f,o=m,d=l(i,o,n,s,r,a))}return p?[t,e,i,o]:null}function n(t,e,i,n){var r=o(t.x,t.y,e.x,e.y,0,0,i,n);return null!=r?[new s.Point(r[0],r[1]),new s.Point(r[2],r[3])]:null}var s=i(30);e.clipSegmentToViewport=n},function(t,e,i){"use strict";function o(t,e,i){this._cache=t,this._cacheRect=e,this._targetRect=i}var n=i(30),s=i(113);o.prototype.draw=function(t){t.translate(.5,.5),t.drawImage(this._cache,this._cacheRect.left,this._cacheRect.top,this._cacheRect.width,this._cacheRect.height,this._targetRect.left,this._targetRect.top,this._targetRect.width,this._targetRect.height),t.translate(-.5,-.5)},o.prototype.hitTest=function(t){var e=new n.Point(this._targetRect.left,this._targetRect.top),i=e.add(new n.Point(this._targetRect.width,this._targetRect.height));return n.pointInRect(t,e,i)?new s(s.REGULAR):null},t.exports=o},function(t,e,i){"use strict";function o(){p.call(this)}function n(t,e,i){l.call(this,t,e,i)}function s(t,e){c.call(this,t,e),this._rendererCache={},this._invalidated=!0}function r(t,e){this._constructor="LineToolFibChannel";var i=e||this.createPropertiesObject("linetoolfibchannel");h.call(this,t,new s(this,t),i),this.version=r.version,t._fibChannelLabelsCache||(t._fibChannelLabelsCache=new o)}var a=i(147),l=i(156).ParallelChannelRenderer,h=i(82).LineDataSource,c=i(123),d=i(148),p=i(151),u=i(152).TrendLineRenderer,_=i(154),f=i(117),m=i(119);inherit(o,p),o.prototype.levelsCount=function(){return r.LevelsCount},inherit(n,l),n.prototype.getColor=function(){return m.generateColor(this._data.backcolor,this._data.transparency,!0)},inherit(s,c),s.prototype.update=function(){this._invalidated=!0},s.prototype._updateImpl=function(){c.prototype.update.call(this),this._cacheState=this._model._fibChannelLabelsCache.updateSource(this._source),this._floatPoints.length<3||this._source.points().length<3||(this.norm=this._floatPoints[2].substract(this._floatPoints[0]))},s.prototype.renderer=function(){function t(t,o,n){var s,r,a,h,p;switch(i.horzLabelsAlign.value()){case"left":s=t;break;case"center":s=t.add(o).scaled(.5),s.x+=n.width/2,s.x=Math.round(s.x);break;case"right":s=o.clone(),s.x+=n.width,s.x=Math.round(s.x)}r={left:n.left,top:l.topByRow(d._cacheState.row),width:n.width,height:l.rowHeight(d._cacheState.row)},a={left:Math.round(s.x-r.width),top:Math.round(s.y),width:n.width,height:r.height},h=i.vertLabelsAlign.value(),"middle"===h&&(a.top-=a.height/2),"bottom"===h&&(a.top-=a.height),p=new _(c,r,a),e.append(p)}var e,i,o,s,r,l,c,d,p,m,g,v,y,b,w,S,T,C,x,P,L,k;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new f,this._floatPoints.length<2)return this.addAnchors(e),e;if(i=this._source.properties(),o=this._floatPoints[0],s=this._floatPoints[1],this._floatPoints.length<3)return r={points:[o,s],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:i.level1.color.value(),linewidth:i.levelsStyle.linewidth.value(),linestyle:i.levelsStyle.linestyle.value(),extendleft:i.extendLeft.value(),extendright:i.extendRight.value(),leftend:h.LINEEND_NORMAL,rightend:h.LINEEND_NORMAL},e.append(new u(r)),this.addAnchors(e),e;for(l=this._model._fibChannelLabelsCache,c=l.canvas().get(0),d=this,p=1;p<a.LevelsCount;p++)if(m=i["level"+p],m.visible.value()){for(g=null,v=p+1;v<=a.LevelsCount;v++)if(y=i["level"+v],y.visible.value()){g=y;break}if(!g)break;b=this.norm.scaled(m.coeff.value()),w=o.add(b),S=s.add(b),T=this.norm.scaled(g.coeff.value()),C=o.add(T),x=s.add(T),P={},P.points=[w,S,C,x],P.color=m.color.value(),P.width=this._model.timeScale().width(),P.height=this._source.priceScale().height(),P.linewidth=i.levelsStyle.linewidth.value(),P.linestyle=i.levelsStyle.linestyle.value(),P.extendleft=i.extendLeft.value(),P.extendright=i.extendRight.value(),P.backcolor=m.color.value(),P.transparency=i.transparency.value(),P.skipTopLine=!0,P.fillBackground=i.fillBackground.value(),P.hittestOnBackground=!0,e.append(new n(P)),(i.showCoeffs.value()||i.showPrices.value())&&(L=this._cacheState.preparedCells.cells[p-1],t(w,S,L))}for(k=null,p=a.LevelsCount;p>=1;p--)if(m=i["level"+p],m.visible.value()){k=p;break}return null!=k&&(m=i["level"+k],m.visible.value()&&(b=this.norm.scaled(m.coeff.value()),w=o.add(b),S=s.add(b),r={points:[w,S],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:m.color.value(),linewidth:i.levelsStyle.linewidth.value(),linestyle:i.levelsStyle.linestyle.value(),extendleft:i.extendLeft.value(),extendright:i.extendRight.value(),leftend:h.LINEEND_NORMAL,rightend:h.LINEEND_NORMAL},e.append(new u(r)),(i.showCoeffs.value()||i.showPrices.value())&&t(w,S,this._cacheState.preparedCells.cells[k-1]))),this.addAnchors(e),e},inherit(r,h),r.LevelsCount=24,r.version=2,r.prototype.migrateVersion=function(t,e,i){i.properties.removeProperty("reverse")},r.prototype.pointsCount=function(){return 3},r.prototype.title=function(){return"Fib Channel"},r.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},r.prototype.createPropertiesObject=function(t,e,i){return new d(t,e,i,{range:[1,24],names:["coeff","color","visible"]})},t.exports=r},function(t,e,i){"use strict";function o(t,e,i){this._data=t,this._hittestResult=e||new c(c.MOVEPOINT),this._backHittestResult=i||new c(c.MOVEPOINT_BACKGROUND)}function n(t,e){l.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolParallelChannel";var i=e||new u("linetoolparallelchannel");h.call(this,t,new n(this,t),i)}var r=i(30),a=i(153).clipSegmentToViewport,l=i(123),h=i(82).LineDataSource,c=i(113),d=i(114).PaneRendererClockIcon,p=i(117),u=i(91).DefaultProperty,_=i(119);o.prototype.extendPoints=function(t,e,i,o){var n,s,a=new r.Point(0,0),l=new r.Point(i,o);return this._data.extendleft&&(n=t.substract(e),(s=r.intersectRayWithRect(t,t.add(n),a,l))&&(t=s)),this._data.extendright&&(n=e.substract(t),(s=r.intersectRayWithRect(e,e.add(n),a,l))&&(e=s)),this._data.extendleft&&!r.pointInRect(t,a,l)&&r.pointInRect(e,a,l)&&(s=r.intersectRayWithRect(e,t,a,l))&&(t=s),this._data.extendright&&!r.pointInRect(e,a,l)&&r.pointInRect(t,a,l)&&(s=r.intersectRayWithRect(t,e,a,l))&&(e=s),[t,e]},o.prototype.getColor=function(){return _.generateColor(this._data.backcolor,this._data.transparency)},o.prototype.draw=function(t){var e,i,o,n,s,l,h,c,d,p,u,_,f,m,g;if(!(this._data.points.length<2)&&(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.points[0],i=this._data.points[1],o=this.extendPoints(e,i,this._data.width,this._data.height),n=a(o[0],o[1],this._data.width,this._data.height),n&&!this._data.skipLines&&CanvasEx.drawLine(t,n[0].x,n[0].y,n[1].x,n[1].y),4===this._data.points.length)){if(s=this._data.points[2],l=this._data.points[3],!s||!l)return;if(h=this.extendPoints(s,l,this._data.width,this._data.height),n=a(h[0],h[1],this._data.width,this._data.height),!n||this._data.skipLines||this._data.skipTopLine||CanvasEx.drawLine(t,n[0].x,n[0].y,n[1].x,n[1].y),this._data.fillBackground){if(c=Math.max(o[1].x,h[1].x),d=Math.max(o[1].y,h[1].y),p=Math.min(h[0].x,o[0].x),u=Math.min(h[0].y,o[0].y),!(isFinite(c)&&isFinite(d)&&isFinite(p)&&isFinite(u)))return;t.fillStyle=this.getColor(),t.beginPath(),t.moveTo(o[0].x,o[0].y),t.lineTo(o[1].x,o[1].y),this._data.extendright&&(_=r.optionalCorner(o[1],h[1],this._data.width,this._data.height))&&t.lineTo(_.x,_.y),t.lineTo(h[1].x,h[1].y),t.lineTo(h[0].x,h[0].y),this._data.extendleft&&(f=r.optionalCorner(h[0],o[0],this._data.width,this._data.height))&&t.lineTo(f.x,f.y),t.lineTo(o[0].x,o[0].y),t.fill()}this._data.showMidline&&!this._data.skipLines&&(t.strokeStyle=this._data.midcolor,t.lineWidth=this._data.midlinewidth,t.lineStyle=this._data.midlinestyle,m=this._data.points[0].add(this._data.points[2]).scaled(.5),g=this._data.points[1].add(this._data.points[3]).scaled(.5),h=this.extendPoints(m,g,this._data.width,this._data.height),(n=a(h[0],h[1],this._data.width,this._data.height))&&CanvasEx.drawLine(t,n[0].x,n[0].y,n[1].x,n[1].y))}},o.prototype.hitTest=function(t){var e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v;if(this._data.points.length<2)return null;if(e=3,i=this._data.floatPoints||this._data.points,o=i[0],n=i[1],s=i[2],a=i[3],l=this.extendPoints(o,n,this._data.width,this._data.height),h=r.distanceToSegment(l[0],l[1],t),h.distance<=e)return this._hittestResult;if(4===this._data.points.length&&!this._data.skipTopLine){if(!s||!a)return null;if(l=this.extendPoints(s,a,this._data.width,this._data.height),h=r.distanceToSegment(l[0],l[1],t),h.distance<=e)return this._hittestResult;if(this._data.showMidline&&!this._data.skipLines&&(c=o.add(s).scaled(.5),d=n.add(a).scaled(.5),l=this.extendPoints(c,d,this._data.width,this._data.height),h=r.distanceToSegment(l[0],l[1],t),h.distance<=e))return this._hittestResult}if(this._data.hittestOnBackground&&this._data.fillBackground&&4===this._data.points.length){if(p=(n.y-o.y)/(n.x-o.x),u=o.y+p*(t.x-o.x),_=s.y+p*(t.x-s.x),f=Math.max(u,_),m=Math.min(u,_),g=Math.min(o.x,n.x),v=Math.max(o.x,n.x),!this._data.extendleft&&t.x<g)return null;if(!this._data.extendright&&t.x>v)return null;if(t.y>=m&&t.y<=f)return this._backHittestResult}return null},inherit(n,l),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,s,r,a,h,c,d;l.prototype.update.call(this),this._source.priceScale()&&!this._source.priceScale().isEmpty()&&0!==this._source.points().length&&(this._source._priceOffset||this._source.calculatePriceDiff(),3===this._points.length&&this._source._priceOffset&&(t=this._points[0],e=this._points[1],i=this._source._priceOffset+this._source.points()[0].price,o=this._source._priceOffset+this._source.points()[1].price,this._p3=t.clone(),this._p4=e.clone(),n=this._source.priceScale(),n.isLog()?(s=.5*(i+o)-this._source._priceOffset,r=.5*(i+o),a=this._source.priceScale().priceToCoordinate(s),h=this._source.priceScale().priceToCoordinate(r),c=h-a,this._p3.y+=c,this._p4.y+=c):(n.isPercent()&&(d=this._source.ownerSource().firstValue(),i=n.priceRange().convertToPercent(i,d),o=n.priceRange().convertToPercent(o,d)),this._p3.y=this._source.priceScale().priceToCoordinate(i),this._p4.y=this._source.priceScale().priceToCoordinate(o))))},n.prototype.renderer=function(){var t,e,i,n,s,r;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t={},t.points=[],this._points.length>1&&(t.points.push(this._points[0]),t.points.push(this._points[1])),this._points.length>2&&(t.points.push(this._p3),t.points.push(this._p4)),t.color=this._source.properties().linecolor.value(),t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),e=this._source.properties(),t.linewidth=e.linewidth.value(),t.linestyle=e.linestyle.value(),t.extendleft=e.extendLeft.value(),t.extendright=e.extendRight.value(),t.fillBackground=e.fillBackground.value(),t.backcolor=e.backgroundColor.value(),t.transparency=e.transparency.value(),t.showMidline=e.showMidline.value(),t.midlinewidth=e.midlinewidth.value(),t.midlinestyle=e.midlinestyle.value(),t.midcolor=e.midlinecolor.value(),t.fillBackground=e.fillBackground.value(),t.hittestOnBackground=!0,i=new p,i.append(new o(t)),this.isAnchorsRequired()&&(n=[],n.push(this._points[0]),this._points[1]&&n.push(this._points[1]),this._p3&&(n.push(this._p3.add(this._p4).scaled(.5)),n[2].data=2),s=3===this._points.length&&!this._p3,this._model.lineBeingCreated()!==this._source||s||n.pop(),i.append(this.createLineAnchor({points:n}))),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&this._points.length>=2&&(r=this._points,this._source.getAlertIsActive(function(t){i.append(new d({point1:r[0],point2:r[1],color:t?e.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))})),i},inherit(s,h),s.prototype.addPoint=function(t){var e,i=h.prototype.addPoint.call(this,t);return i&&(e=this.points()[0],this._points[2].index=e.index,this._points[2].price=e.price+this._priceOffset),i},s.prototype.calculatePriceDiff=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v;if(3===this.points().length){if(t=this.points()[0],e=this.points()[1],i=this.points()[2],t.index===e.index)return;if(null===(o=this.priceScale()))return;if(o.isLog()){if(n=this._model.timeScale(),n.isEmpty())return;s=n.indexToCoordinate(t.index),r=n.indexToCoordinate(e.index),a=o.priceToCoordinate(t.price),l=o.priceToCoordinate(e.price),h=n.indexToCoordinate(i.index),c=(l-a)/(r-s),d=a+c*(h-s),p=o.priceToCoordinate(i.price),u=p-d,_=.5*(a+l),f=o.coordinateToPrice(_),m=_+u,g=o.coordinateToPrice(m),this._priceOffset=g-f}else c=(e.price-t.price)/(e.index-t.index),v=t.price+c*(i.index-t.index),this._priceOffset=i.price-v}},s.prototype.setLastPoint=function(t,e){e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[0]),h.prototype.setLastPoint.call(this,t),this.calculatePriceDiff()},s.prototype.restorePoints=function(t,e,i){h.prototype.restorePoints.call(this,t,e,i),t&&t.length>=3&&(this._priceOffset=t[2].price-t[0].price)},s.prototype.setPoint=function(t,e,i){i&&i.shift&&t<2&&this._snapPoint45Degree(e,this.points()[1-t]),h.prototype.setPoint.call(this,t,e,i),2===t&&this.calculatePriceDiff();var o=this.points()[0];this._points[2].index=o.index,this._points[2].price=o.price+this._priceOffset},s.prototype.pointsCount=function(){return 3},s.prototype.title=function(){return"Parallel Channel"},s.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[0]),h.prototype.addPoint.call(this,t,e)},s.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset},s.prototype.cloneData=function(t){this._priceOffset=t._priceOffset},s.prototype.restoreData=function(t){t.priceOffset&&(this._priceOffset=t.priceOffset)},s.prototype.state=function(t){var e=h.prototype.state.call(this,t);return e.priceOffset=this._priceOffset,e},s.prototype.canHasAlert=function(){return!0},s.prototype._getAlertPlots=function(){function t(t,e){return t.index<=e.index?[t,e]:[e,t]}var e,i,o,n,s,r,a,l,h=[].concat(this._points).splice(0,2);return h=h.concat([{price:h[0].price+this._priceOffset,time:h[0].time,index:h[0].index},{price:h[1].price+this._priceOffset,time:h[1].time,index:h[1].index}]),e=t(h[0],h[1]),i=t(h[2],h[3]),this._priceOffset<0?(n=i,o=e):(n=e,o=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),h[0].index<=h[1].index?(s=a,r=l):(s=l,r=a),[this._linePointsToAlertPlot(o,"Upper",s,r),this._linePointsToAlertPlot(n,"Lower",s,r)]},e.LineToolParallelChannel=s,e.ParallelChannelRenderer=o},function(t,e,i){"use strict";function o(){d.call(this)}function n(t,e,i){this._data=t,this._hittest=e||new _(_.MOVEPOINT),this._backHittest=i||new _(_.MOVEPOINT_BACKGROUND)}function s(t,e){h.call(this,t,e),this._rendererCache={},this._invalidated=!0}function r(t,e){this._constructor="LineToolFibSpeedResistanceArcs";var i=e||this.createPropertiesObject("linetoolfibspeedresistancearcs");l.call(this,t,new s(this,t),i),t._fibSpeedResistanceArcsLabelsCache||(t._fibSpeedResistanceArcsLabelsCache=new o)}var a=i(30),l=i(82).LineDataSource,h=i(123),c=i(148),d=i(151),p=i(152).TrendLineRenderer,u=i(154),_=i(113),f=i(117),m=i(119);inherit(o,d),o.prototype.levelsCount=function(){return r.LevelsCount},n.prototype.draw=function(t){t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.translate(this._data.center.x,this._data.center.y),t.beginPath(),this._data.fullCircles?t.arc(0,0,this._data.radius,2*Math.PI,0,!1):this._data.dir>0?t.arc(0,0,this._data.radius,0,Math.PI,!1):t.arc(0,0,this._data.radius,Math.PI,0,!1),t.stroke(),this._data.fillBackground&&(this._data.radius2&&(this._data.fullCircles?t.arc(0,0,this._data.radius2,2*Math.PI,0,!0):this._data.dir>0?t.arc(0,0,this._data.radius2,Math.PI,0,!0):t.arc(0,0,this._data.radius2,0,Math.PI,!0)),t.fillStyle=m.generateColor(this._data.color,this._data.transparency,!0),t.fill())},n.prototype.hitTest=function(t){var e,i,o;return a.sign(t.y-this._data.center.y)===this._data.dir||this._data.fullCircles?(e=t.substract(this._data.center),i=e.length(),o=3,Math.abs(i-this._data.radius)<o?this._hittest:this._data.hittestOnBackground&&Math.abs(i)<=this._data.radius+o?this._backHittest:null):null},inherit(s,h),s.prototype.update=function(){this._invalidated=!0},s.prototype._updateImpl=function(){var t,e,i,o,n,s,l,c,d,p,u,_;if(h.prototype.update.call(this),this._cacheState=this._model._fibSpeedResistanceArcsLabelsCache.updateSource(this._source),!(this._floatPoints.length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty())for(t=this._floatPoints[0],e=this._floatPoints[1],i=t.substract(e).length(),this._levels=[],o=this._source.properties(),n=1;n<=r.LevelsCount;n++)s="level"+n,l=o[s],l.visible.value()&&(c=l.coeff.value(),d=l.color.value(),p=e.substract(t).length()*c,u=a.sign(e.y-t.y),_=new a.Point(t.x,t.y+u*i*c),this._levels.push({color:d,radius:p,dir:u,labelPoint:_,linewidth:l.linewidth.value(),linestyle:l.linestyle.value(),index:n}))},s.prototype.renderer=function(){var t,e,i,o,s,r,a,h,c,d,m,g,v,y,b,w;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new f,this._floatPoints.length<2)return t;for(e=this._floatPoints[0],i=this._source.properties(),o=i.fillBackground.value(),s=i.transparency.value(),r=this._model._fibSpeedResistanceArcsLabelsCache,a=r.canvas().get(0),h=0;h<this._levels.length;h++)if(c=this._levels[h],d={},d.center=e,d.color=c.color,d.linewidth=c.linewidth,d.radius=c.radius,d.dir=c.dir,d.transparency=s,d.fillBackground=o,d.hittestOnBackground=!0,d.fullCircles=i.fullCircles.value(),h>0&&(d.radius2=this._levels[h-1].radius),m=new _(_.MOVEPOINT,null,c.index),t.append(new n(d,m)),i.showCoeffs.value()){if(!(g=this._cacheState.preparedCells.cells[this._levels[h].index-1]))continue;v={left:g.left,top:r.topByRow(this._cacheState.row),width:g.width,height:r.rowHeight(this._cacheState.row)},y={left:Math.round(c.labelPoint.x-v.width),top:Math.round(c.labelPoint.y-v.height/2),width:g.width,height:v.height},b=new u(a,v,y),t.append(b)}return i.trendline.visible.value()&&(w={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:i.trendline.color.value(),linewidth:i.trendline.linewidth.value(),linestyle:i.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(w))),this.addAnchors(t),t},inherit(r,l),r.LevelsCount=11,r.prototype.pointsCount=function(){return 2},r.prototype.title=function(){return"Fib Speed Resistance Arcs"},r.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},r.prototype.createPropertiesObject=function(t,e,i){return new c(t,e,i,{range:[1,11]})},t.exports=r},function(t,e,i){"use strict";function o(){d.call(this)}function n(t,e){h.call(this,t,e)}function s(t,e){this._constructor="LineToolProjection";var i=e||this.createPropertiesObject("linetoolprojection");p.call(this,t,new n(this,t),i)}var r=i(148),a=i(159),l=a.ArcWedgeRenderer,h=a.FibWedgePaneView,c=a.LineToolFibWedge,d=i(151),p=i(82).LineDataSource,u=i(152).TrendLineRenderer,_=i(117);inherit(o,d),o.prototype.levelsCount=function(){return 1},inherit(n,h),n.prototype.update=function(){h.prototype.update.call(this)},n.prototype._levelsCount=function(){return 1},n.prototype.renderer=function(){var t,e,i,o,n,s,r,a,h,c,d,f;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new _,this._points.length<2?t:(e=this._source.properties(),i=this._points,o=i[0],n=i[1],s={points:[o,n],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:e.trendline.color.value(),linewidth:e.linewidth.value(),linestyle:e.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:p.LINEEND_NORMAL,rightend:p.LINEEND_NORMAL},t.append(new u(s)),this._points.length<3?(this.addAnchors(t),t):(r=i[2],a=r.data,h=n.substract(o).length(),c=r.substract(o).normalized(),r=o.add(c.scaled(h)),r.data=a,s={points:[o,r],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:e.trendline.color.value(),linewidth:e.linewidth.value(),linestyle:e.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:p.LINEEND_NORMAL,rightend:p.LINEEND_NORMAL},t.append(new u(s)),d=this._levels[0],f={},f.center=this._points[0],f.radius=d.radius,f.prevRadius=0,f.edge=this._edge,f.color=e.trendline.color.value(),f.color1=e.color1.value(),f.color2=e.color2.value(),f.linewidth=e.linewidth.value(),f.edge1=this._edge1,f.edge2=this._edge2,f.p1=d.p1,f.p2=d.p2,f.fillBackground=e.fillBackground.value(),f.transparency=e.transparency.value(),f.gradient=!0,t.append(new l(f)),this.addAnchors(t),t))},inherit(s,c),s.prototype.title=function(){return"Projection"},s.prototype.getCache=function(){return this._model._projectionLabelsCache||(this._model._projectionLabelsCache=new o),this._model._projectionLabelsCache},s.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,1]})},t.exports=s},function(t,e,i){"use strict";function o(){d.call(this)}function n(t,e,i){this._data=t,this._hittest=e||new _(_.MOVEPOINT),this._backHittest=i||new _(_.MOVEPOINT_BACKGROUND),this._rendererCache={}}function s(t,e){h.call(this,t,e),this._rendererCache={},this._levels=[],this._invalidated=!0}function r(t,e){this._constructor="LineToolFibSpeedResistanceArcs";var i=e||this.createPropertiesObject("linetoolfibwedge");l.call(this,t,new s(this,t),i),t._fibWedgeLabelsCache||(t._fibWedgeLabelsCache=new o)}var a=i(30),l=i(82).LineDataSource,h=i(123),c=i(148),d=i(151),p=i(152).TrendLineRenderer,u=i(154),_=i(113),f=i(117),m=i(119);inherit(o,d),o.prototype.levelsCount=function(){return r.LevelsCount},n.prototype.draw=function(t){if(t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.arc(this._data.center.x,this._data.center.y,this._data.radius,this._data.edge1,this._data.edge2,!0),t.stroke(),this._data.fillBackground){if(t.arc(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.edge2,this._data.edge1,!1),this._data.gradient){var e=t.createRadialGradient(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.center.x,this._data.center.y,this._data.radius);e.addColorStop(0,m.generateColor(this._data.color1,this._data.transparency)),e.addColorStop(1,m.generateColor(this._data.color2,this._data.transparency)),t.fillStyle=e}else t.fillStyle=m.generateColor(this._data.color,this._data.transparency,!0);t.fill()}},n.prototype.hitTest=function(t){var e,i,o,n,s,r,a,l,h,c=t.substract(this._data.center).length();return Math.abs(c-this._data.radius)<=4&&(e=t.substract(this._data.p1).length(),i=t.substract(this._data.p2).length(),o=Math.max(e,i),n=this._data.p1.substract(this._data.p2).length(),o<=n)?this._hittest:this._data.fillBackground&&c<=this._data.radius&&(s=this._data.p1.substract(this._data.center).normalized(),r=this._data.p2.substract(this._data.center).normalized(),c=t.substract(this._data.center).normalized(),a=s.dotProduct(r),l=c.dotProduct(s),h=c.dotProduct(r),l>=a&&h>=a)?this._backHittest:null},inherit(s,h),s.prototype.update=function(){this._invalidated=!0},s.prototype._updateImpl=function(){var t,e,i,o,n,s,r,l,c,d,p,u,_,f,m,g,v,y,b;if(h.prototype.update.call(this),this._cacheState=this._source.getCache().updateSource(this._source),this._levels=[],!(this._points.length<3))for(t=this._points,e=t[0],i=t[1],o=t[2],n=i.substract(e).normalized(),s=o.substract(e).normalized(),r=new a.Point(1,0),l=new a.Point(0,1),c=Math.acos(n.dotProduct(r)),n.dotProduct(l)<0&&(c=2*Math.PI-c),this._edge1=c,d=Math.acos(s.dotProduct(r)),s.dotProduct(l)<0&&(d=2*Math.PI-d),this._edge2=d,c<d&&(this._edge1=Math.max(c,d),this._edge2=Math.min(c,d)+2*Math.PI),Math.abs(c-d)>Math.PI&&(this._edge1=Math.min(c,d),this._edge2=Math.max(c,d)-2*Math.PI),p=this._source.properties(),u=1;u<=this._source.getCache().levelsCount();u++)_="level"+u,f=p[_],f.visible.value()&&(m=f.coeff.value(),g=f.color.value(),v=i.substract(e).length()*m,y=n.add(s).scaled(.5).normalized().scaled(v),b=e.add(y),this._levels.push({coeff:m,color:g,radius:v,labelPoint:b,p1:e.add(n.scaled(v)),p2:e.add(s.scaled(v)),linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),index:u}))},s.prototype.renderer=function(){var t,e,i,o,s,r,a,h,c,d,m,g,v,y,b,w,S,T,C,x;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new f,this._points.length<2)return t;if(e=this._source.properties(),i=this._points,o=i[0],s=i[1],r={points:[o,s],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:e.trendline.color.value(),linewidth:e.trendline.visible.value()?e.trendline.linewidth.value():0,linestyle:e.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(r)),this._points.length<3)return this.addAnchors(t),t;for(a=i[2],h=a.data,c=s.substract(o).length(),d=a.substract(o).normalized(),a=o.add(d.scaled(c)),a.data=h,r={points:[o,a],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:e.trendline.color.value(),linewidth:e.trendline.visible.value()?e.trendline.linewidth.value():0,linestyle:e.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(r)),m=this._model._fibWedgeLabelsCache,g=m.canvas().get(0),v=this._levels.length-1;v>=0;v--)if(y=this._levels[v],b={},b.center=this._points[0],b.radius=y.radius,b.prevRadius=v>0?this._levels[v-1].radius:0,b.edge=this._edge,b.color=y.color,b.linewidth=y.linewidth,b.edge1=this._edge1,b.edge2=this._edge2,b.p1=y.p1,b.p2=y.p2,b.fillBackground=e.fillBackground.value(),b.transparency=e.transparency.value(),w=new _(_.MOVEPOINT,null,y.index),t.append(new n(b,w)),e.showCoeffs.value()){if(!(S=this._cacheState.preparedCells.cells[this._levels[v].index-1]))continue;T={left:S.left,top:m.topByRow(this._cacheState.row),width:S.width,height:m.rowHeight(this._cacheState.row)},C={left:Math.round(y.labelPoint.x-T.width),top:Math.round(y.labelPoint.y-T.height/2),width:S.width,height:T.height},x=new u(g,T,C),t.append(x)}return this.isAnchorsRequired()&&(i=[o,s],this._model.lineBeingCreated()!==this._source&&i.push(a),t.append(this.createLineAnchor({points:i}))),t},inherit(r,l),r.LevelsCount=11,r.prototype.getCache=function(){return this._model._fibWedgeLabelsCache||(this._model._fibWedgeLabelsCache=new o),this._model._fibWedgeLabelsCache},r.prototype.pointsCount=function(){return 3},r.prototype.title=function(){return"Fib Wedge"},r.prototype.setPoint=function(t,e){var i,o,n,s,r,a,h;l.prototype.setPoint.call(this,t,e),this._recursiveGuard||(this._recursiveGuard=!0,2===t?(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],s=n.substract(i).length(),r=o.substract(i).normalized(),o=i.add(r.scaled(s)),a=this.screenPointToPoint(o),this._properties.points[1].price.setValue(a.price),this._properties.points[1].bar.setValue(a.index)):(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],h=o.substract(i).length(),r=n.substract(i).normalized(),n=i.add(r.scaled(h)),a=this.screenPointToPoint(n),this._properties.points[2].price.setValue(a.price),this._properties.points[2].bar.setValue(a.index)),this._recursiveGuard=!1)},r.prototype.addPoint=function(t){var e,i,o,n,s,r,a,h;return 2===this._points.length&&(e=this.pointToScreenPoint(this._points[0])[0],i=this.pointToScreenPoint(this._points[1])[0],this.priceScale().isPercent()&&(o=this.ownerSource().firstValue(),t.price=this.priceScale().priceRange().convertFromPercent(t.price,o)),n=this.pointToScreenPoint(t)[0],s=i.substract(e).length(),r=n.substract(e).normalized(),n=e.add(r.scaled(s)),a=this.priceScale().coordinateToPrice(n.y),h=Math.round(this._model.timeScale().coordinateToIndex(n.x)),t={index:h,price:a}),l.prototype.addPoint.call(this,t)},r.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},r.prototype.createPropertiesObject=function(t,e,i){return new c(t,e,i,{range:[1,11]})},e.ArcWedgeRenderer=n,e.FibWedgePaneView=s,e.LineToolFibWedge=r},function(t,e,i){"use strict";function o(){d.call(this)}function n(t,e){a.call(this,t,e),this._rendererCache={}}function s(t,e){this._constructor="LineToolTrendBasedFibExtension";var i=e||new this.createPropertiesObject("linetooltrendbasedfibextension");l.call(this,t,new n(this,t),i),this.version=s.version,t._trendBasedFibExtensionLabelsCache||(t._trendBasedFibExtensionLabelsCache=new o)}var r=i(30),a=i(123),l=i(82).LineDataSource,h=i(148),c=i(150).RectangleTransparencyRenderer,d=i(151),p=i(152).TrendLineRenderer,u=i(154),_=i(113),f=i(117);inherit(o,d),o.prototype.levelsCount=function(){return s.LevelsCount},o.prototype.points=function(t){return[t.points()[0],t.points()[1]]},o.prototype.startPoint=function(t,e){return t.points()[2]},o.prototype.priceRange=function(t,e){var i=this.points(t),o=i[0],n=i[1];return e?o.price-n.price:n.price-o.price},o.prototype.sourceIsReady=function(t){return t.points().length>=3},inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var t,e,i,o,n,r,l,h,c,d,p,u,_,f;if(a.prototype.update.call(this),this._cacheState=this._model._trendBasedFibExtensionLabelsCache.updateSource(this._source),!(this._source.points().length<3)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty())for(t=this._source.points()[0],e=this._source.points()[1],i=this._source.points()[2],o=!1,n=this._source.properties(),n.reverse&&n.reverse.value()&&(o=n.reverse.value()),this._levels=[],r=o?t.price-e.price:e.price-t.price,this._source.priceScale().isPercent()&&(l=this._source.ownerSource().firstValue()),h=1;h<=s.LevelsCount;h++)c="level"+h,d=n[c],d.visible.value()&&(p=d.coeff.value(),u=d.color.value(),_=i.price+p*r,this._source.priceScale().isPercent()&&(_=this._source.priceScale().priceRange().convertToPercent(_,l)),f=this._source.priceScale().priceToCoordinate(_),this._levels.push({color:u,y:f,linewidth:n.levelsStyle.linewidth.value(),linestyle:n.levelsStyle.linestyle.value(),index:h}))},n.prototype.renderer=function(){var t,e,i,o,n,s,a,h,d,m,g,v,y,b,w,S,T,C,x,P,L,k,I;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new f,this._points.length<2)return t;if(e=this._points[0],i=this._points[1],o=this._source.properties(),o.trendline.visible.value()&&(n={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(n))),this._points.length<3)return this.addAnchors(t),t;for(s=this._points[2],o.trendline.visible.value()&&(n={points:[i,s],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(n))),a=Math.min(s.x,i.x),h=Math.max(s.x,i.x),d=o.fillBackground.value(),m=o.transparency.value(),g=o.extendLines.value()?this._model.timeScale().width():h,v=this._model._trendBasedFibExtensionLabelsCache,y=v.canvas().get(0),b=0;b<this._levels.length;b++)if(b>0&&d&&(w=this._levels[b-1],e=new r.Point(a,this._levels[b].y),i=new r.Point(g,w.y),S={},S.points=[e,i],S.color=this._levels[b].color,S.linewidth=0,S.backcolor=this._levels[b].color,S.fillBackground=!0,S.transparency=m,t.append(new c(S))),e=new r.Point(a,this._levels[b].y),i=new r.Point(h,this._levels[b].y),n={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._levels[b].color,linewidth:this._levels[b].linewidth,linestyle:this._levels[b].linestyle,extendleft:!1,extendright:o.extendLines.value(),leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},T=new _(_.MOVEPOINT,null,this._levels[b].index),t.append(new p(n,T)),o.showCoeffs.value()||o.showPrices.value()){if(!(C=this._cacheState.preparedCells.cells[this._levels[b].index-1]))continue;switch(o.horzLabelsAlign.value()){case"left":x=e;break;case"center":x=e.add(i).scaled(.5),x.x+=C.width/2,x.x=Math.round(x.x);break;case"right":o.extendLines.value()?x=new r.Point(g-4,this._levels[b].y):(x=new r.Point(g+4,this._levels[b].y),x.x+=C.width,x.x=Math.round(x.x))}P={left:C.left,top:v.topByRow(this._cacheState.row),width:C.width,height:v.rowHeight(this._cacheState.row)},L={left:x.x-P.width,top:x.y,width:C.width,height:P.height},k=o.vertLabelsAlign.value(),"middle"===k&&(L.top-=L.height/2),"bottom"===k&&(L.top-=L.height),I=new u(y,P,L),t.append(I)}return this.addAnchors(t),t},inherit(s,l),s.version=2,s.LevelsCount=24,s.prototype.stop=function(){l.prototype.stop.call(this),this._model._trendBasedFibExtensionLabelsCache.removeSource(this.id())},s.prototype.pointsCount=function(){return 3},s.prototype.title=function(){return"Trend-Based Fib Extension"},s.prototype.migrateVersion=function(t,e,i){1===t&&this.properties().extendLines.setValue(!0)},s.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},s.prototype.createPropertiesObject=function(t,e,i){return new h(t,e,i,{range:[0,8]})},TradingView.LineToolTrendBasedFibExtension=s,t.exports=s},function(t,e,i){"use strict";function o(t,e){f.call(this,t,e),this._rendererCache=[{},{},{},{},{},{}],this._invalidated=!0}function n(t,e){var i=e||new S("linetoolelliott");_.call(this,t,new o(this,t),i)}function s(t,e){var i=e||new S("linetoolelliott");_.call(this,t,new o(this,t),i),this.version=s.version}function r(t,e){this._constructor="LineToolElliottImpulse";var i=e||new S("linetoolelliottimpulse");s.call(this,t,i)}function a(t,e){this._constructor="LineToolElliottTriangle";var i=e||new S("linetoolelliotttriangle");s.call(this,t,i)}function l(t,e){this._constructor="LineToolElliottTripleCombo";var i=e||new S("linetoolelliotttriplecombo");s.call(this,t,i)}function h(t,e){var i=e||new S("linetoolelliott");_.call(this,t,new o(this,t),i),this.version=h.version}function c(t,e){this._constructor="LineToolElliottCorrection";var i=e||new S("linetoolelliottcorrection");h.call(this,t,i)}function d(t,e){this._constructor="LineToolElliottLineToolElliottDoubleCombo";var i=e||new S("linetoolelliottdoublecombo");h.call(this,t,i)}var p=i(162).EllipseRendererSimple,u=i(124).TextRenderer,_=i(82).LineDataSource,f=i(123),m=i(152).TrendLineRenderer,g=i(100).Action,v=i(113),y=i(117),b=i(30),w=i(85).RGBColor,S=i(91).DefaultProperty,T=i(119);inherit(o,f),o.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h,c,d,_,f,g,S,T,C,x,P,L;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),!this._wave)return null;for(t=this.isAnchorsRequired()?0:1,e=new y,i=this._source.properties(),o=0;o<this._wave.length;o++)e.append(new m(this._wave[o]));for(n=1,this._points.length>2&&(s=this._points[2],r=this._points[1],n=b.sign(s.y-r.y)),a=[],l=0,this._model.lineBeingCreated()===this._source&&(l=1),h=new w(this._model.backgroundColor()).blackWhiteContrast(),c=i.color.value(),o=0;o<this._points.length-l;o++,n=-n)o<t||(d=this._source.label(o),_=d.label,"circle"===d.decoration&&(f=this._points[o].clone(),1===n?f.y+=13+d.fontIncrease/2:f.y-=14+d.fontIncrease/2,g=(12+d.fontIncrease)/2+2,s=f.substract(new b.Point(g,g)),r=f.add(new b.Point(g,g)),S={points:[s,r],color:new w(c).darken("black"===h?15:-15).toHex(),linewidth:1,fillBackground:!1},T=new p(S),e.append(T)),"brackets"===d.decoration&&(_="("+_+")"),C={points:[this._points[o]],text:_,color:new w(c).darken("black"===h?15:-15).toHex(),vertAlign:1===n?"top":"bottom",horzAlign:"center",font:"Arial",offsetX:0,offsetY:1===n?5:-10,fontsize:12+d.fontIncrease,bold:d.bold},a.push(C),""!==d&&e.append(new u(C,this._rendererCache[o],new v(v.CHANGEPOINT,o))));if(this.isAnchorsRequired()){for(x=[],P=0;P<a.length;P++)L=this._points[P].clone(),L.y=a[P].points[0].y,L.data=P,x.push(L);this._model.lineBeingCreated()===this._source&&x.pop(),e.append(this.createLineAnchor({points:x}))}return e},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,m,g;if(f.prototype.update.call(this),this._wave=[],t=this._source.properties(),e=this._source.priceScale(),i=this._model.timeScale(),e&&!e.isEmpty()&&!i.isEmpty()&&(this._source.priceScale().isPercent()&&(o=this._source.ownerSource().firstValue()),n=t.color.value(),t.showWave.value()))for(s=this._source.points(),r=1;r<s.length;r++)a=s[r-1],l=s[r],h=i.indexToCoordinate(a.index),c=i.indexToCoordinate(l.index),d=a.price,p=l.price,this._source.priceScale().isPercent()&&(d=this._source.priceScale().priceRange().convertToPercent(d,o),p=this._source.priceScale().priceRange().convertToPercent(p,o)),u=e.priceToCoordinate(d),m=e.priceToCoordinate(p),g={points:[new b.Point(h,u),new b.Point(c,m)],width:i.width(),height:e.height(),color:T.generateColor(n,0),linewidth:t.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:_.LINEEND_CIRCLE,rightend:_.LINEEND_CIRCLE,endstyle:{strokeWidth:1,fillStyle:this._model.backgroundColor()},overlayLineEndings:!0},this._wave.push(g)},inherit(n,_),n.migrateState=function(t){var e={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottMinor"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottCircle"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottMinorRetr"===t.type&&(t.type="LineToolElliottCorrection",t.state.degree=i[t.state.wavesize]),"LineToolElliottMajorRetr"===t.type&&(t.type="LineToolElliottCorrection",t.state.degree=i[t.state.wavesize])},n.prototype.title=function(){return"Elliott Labels"},n.degrees=[$.t("Supermillennium"),$.t("Millennium"),$.t("Submillennium"),$.t("Grand Supercycle"),$.t("Supercycle"),$.t("Cycle"),$.t("Primary"),$.t("Intermediate"),$.t("Minor"),$.t("Minute"),$.t("Minuette"),$.t("Subminuette"),$.t("Micro"),$.t("Submicro"),$.t("Miniscule")],n.prototype.additionalActions=function(t){var e=new g({text:$.t("Degree")}),i=this;return e.subActions=n.degrees.map(function(e,o){var n=new g({text:e,checkable:!0,checked:i.properties().degree.value()===o});return n.callbacks().subscribe(null,function(){t.setProperty(i.properties().degree,o,"Change Elliott Degree")}),n}),[e]},n.prototype.label=function(t){var e=n.degrees.length-this.properties().degree.value()-1,i=Math.floor(e/3),o=e%3;return{fontIncrease:4*Math.floor(i),bold:!!(i%2),decoration:["","brackets","circle"][o],label:this.labelsGroup()[i][t]}},inherit(s,n),s.version=3,s.prototype.pointsCount=function(){return 6},s.prototype.migrateVersion=function(t,e,i){if(1===t){var o=$.extend({},this._timePoint[0]);this._timePoint.unshift(o),this._points.length>0&&(o=$.extend({},this._points[0]),this._points.unshift(o))}},inherit(r,s),r._labelsGroups=[["0","1","2","3","4","5"],["0","i","ii","iii","iv","v"],["0","1","2","3","4","5"],["0","I","II","III","IV","V"],["0","1","2","3","4","5"]],r.prototype.labelsGroup=function(){return r._labelsGroups},inherit(a,s),a._labelsGroups=[["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"]],a.prototype.labelsGroup=function(){return a._labelsGroups},inherit(l,s),l._labelsGroups=[["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"]],l.prototype.labelsGroup=function(){return l._labelsGroups},inherit(h,n),h.version=3,h.prototype.pointsCount=function(){return 4},h.prototype.migrateVersion=function(t,e,i){if(1===t){var o=$.extend({},this._timePoint[0]);this._timePoint.insert(o,0),this._points.length>0&&(o=$.extend({},this._points[0]),this._points.insert(o,0))}},inherit(c,h),c._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],c.prototype.labelsGroup=function(){return c._labelsGroups},inherit(d,h),d._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],d.prototype.labelsGroup=function(){return d._labelsGroups},e.LineToolElliott=n,e.LineToolElliottImpulse=r,e.LineToolElliottTriangle=a,e.LineToolElliottTripleCombo=l,e.LineToolElliottCorrection=c,e.LineToolElliottDoubleCombo=d},function(t,e,i){"use strict";function o(){d.call(this)}function n(t,e,i){this._data=t,this._hittest=e||new _(_.MOVEPOINT),this._backHittest=i||new _(_.MOVEPOINT_BACKGROUND)}function s(t,e){l.call(this,t,e),this._rendererCache={},this._invalidated=!0,this._numericFormatter=new g}function r(t,e){this._constructor="LineToolFibCircles";var i=e||this.createPropertiesObject("linetoolfibcircles");h.call(this,t,new s(this,t),i),t._fibCirclesLabelsCache||(t._fibCirclesLabelsCache=new o)}var a=i(30),l=i(123),h=i(82).LineDataSource,c=i(148),d=i(151),p=i(152).TrendLineRenderer,u=i(154),_=i(113),f=i(117),m=i(94),g=m.NumericFormatter,v=i(119);inherit(o,d),o.prototype.levelsCount=function(){return r.LevelsCount},n.prototype.draw=function(t){var e,i,o,n,s,r,a,l;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.points[0],i=this._data.points[1],o=Math.abs(e.x-i.x),n=Math.abs(e.y-i.y),s=e.add(i).scaled(.5),o<1||n<1||(this._data.wholePoints&&(a=this._data.wholePoints[0],l=this._data.wholePoints[1],r=Math.abs(a.x-l.x)),t.save(),t.translate(s.x,s.y),t.scale(1,n/o),t.beginPath(),t.arc(0,0,o/2,0,2*Math.PI,!1),t.restore(),t.stroke(),this._data.fillBackground&&(this._data.wholePoints&&(t.translate(s.x,s.y),t.scale(1,n/o),t.arc(0,0,r/2,0,2*Math.PI,!0)),t.fillStyle=v.generateColor(this._data.backcolor,this._data.transparency,!0),t.fill()))},n.prototype.hitTest=function(t){var e,i,o,n,s,r,l,h,c,d,p;return this._data.points.length<2?null:(e=this._data.points[0],i=this._data.points[1],o=.5*Math.abs(e.x-i.x),n=Math.abs(e.x-i.x),s=Math.abs(e.y-i.y),r=e.add(i).scaled(.5),l=t.substract(r),n<1||s<1?null:(h=(i.y-e.y)/(i.x-e.x),l.y/=h,c=l.x*l.x+l.y*l.y,d=c-o*o,d=a.sign(d)*Math.sqrt(Math.abs(d/o)),p=3,Math.abs(d)<p?this._hittest:this._data.fillBackground&&!this._data.noHitTestOnBackground&&d<p?this._backHittest:null))},inherit(s,l),s.prototype.update=function(){this._invalidated=!0},s.prototype._updateImpl=function(){var t,e,i,o,n,s,h,c,d,p,u,_;if(l.prototype.update.call(this),this._cacheState=this._model._fibCirclesLabelsCache.updateSource(this._source),!(this._source.points().length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty())for(t=this._points[0],e=this._points[1],this._center=t.add(e).scaled(.5),i=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y),this._levels=[],n=this._source.properties(),s=1;s<=r.LevelsCount;s++)h="level"+s,c=n[h],c.visible.value()&&(d=c.coeff.value(),p=c.color.value(),u=[],u.push(new a.Point(this._center.x-.5*i*d,this._center.y-.5*o*d)),u.push(new a.Point(this._center.x+.5*i*d,this._center.y+.5*o*d)),_=new a.Point(this._center.x,this._center.y+.5*o*d),this._levels.push({color:p,points:u,labelPoint:_,linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),index:s}))},s.prototype.renderer=function(){var t,e,i,o,s,r,a,l,c,d,m,g,v,y,b;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new f,this._points.length<2)return t;for(e=this._source.properties(),i=e.fillBackground.value(),o=e.transparency.value(),s=this._model._fibCirclesLabelsCache,r=s.canvas().get(0),a=0;a<this._levels.length;a++)if(l=this._levels[a],c={},c.points=l.points,c.color=l.color,c.linewidth=l.linewidth,c.backcolor=l.color,a>0&&(c.wholePoints=this._levels[a-1].points),c.fillBackground=i,c.transparency=o,d=new _(_.MOVEPOINT,null,l.index),t.append(new n(c,d)),e.showCoeffs.value()){if(!(m=this._cacheState.preparedCells.cells[this._levels[a].index-1]))continue;g={left:m.left,top:s.topByRow(this._cacheState.row),width:m.width,height:s.rowHeight(this._cacheState.row)},v={left:Math.round(l.labelPoint.x-g.width),top:Math.round(l.labelPoint.y-g.height/2),width:m.width,height:g.height},y=new u(r,g,v),t.append(y)}return e.trendline.visible.value()&&(b={points:[this._points[0],this._points[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:e.trendline.color.value(),linewidth:e.trendline.linewidth.value(),linestyle:e.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LINEEND_NORMAL,rightend:h.LINEEND_NORMAL},t.append(new p(b))),this.addAnchors(t),t},inherit(r,h),r.LevelsCount=11,r.prototype.pointsCount=function(){return 2},r.prototype.title=function(){return"Fib Circles"},r.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},r.prototype.createPropertiesObject=function(t,e,i){return new c(t,e,i,{range:[1,11]})},e.EllipseRendererSimple=n,e.LineToolFibCircles=r},function(t,e,i){"use strict";function o(t,e,i){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0},n.call(this,t,e,i)}var n=i(82).LineDataSource;inherit(o,n),o.POINTS_COUNT=1,o.prototype.pointsCount=function(){return o.POINTS_COUNT},o.prototype.hasContextMenu=function(){return!1},o.prototype.state=function(){return null},o.prototype.startMoving=function(){n.prototype.startMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.endMoving=function(){n.prototype.endMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.correctPoints=function(t){var e,i,o,n,s;for(this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1,e=this.priceScale(),i=e.mainSource().base(),o=1/i,n=0;n<t.length;n++)s=t[n],this._cursorMoved&&(s.price=this._currentMovingPoint.price),s.price=o*Math.round(s.price/o),t[n]=s},o.prototype.userEditEnabled=function(){return!0},o.prototype.canBeHidden=function(){return!1},o.prototype.isUserDeletable=function(){return!1},o.prototype.showInObjectTree=function(){return!1},t.exports=o},function(t,e,i){"use strict";function o(t,e,i,o){var n,s,l,m,g,v,y,b,w,S,T,C,x,P,L,k="VbPFixed@tv-volumebyprice",I=h.lineToolNameForPointsBasedStudy(k);if(i=i||f.findStudyMetaInfo(t.studiesMetaData(),k),n=t.studyVersioning(),s=e||c(i,null,null,n),this._metaInfo=i,this.m_data=new _,this._plotOffsets={},this._plotOffsetsMetaInfoOverride={},l=this,m=new a(l,t),g=new h.StudyPaneView_hhists(l,t),v=new h.StudyPaneView_horizlines(l,t),y=new h.StudyPaneView_polygons(l,t),b=[m,g,v,y],o=t.mainSeries(),i.plots.length>0&&(w=new d(l,o,t,i.plots[0].id),b.push(w)),i.plots.length>1&&(S=new d(l,o,t,i.plots[1].id),b.push(S)),i.plots.length>2&&(T=new d(l,o,t,i.plots[2].id),b.push(T)),r.call(this,t,b,s,I),this._turnaroundCounter=1,this._turnaround="vbpfixed_"+this._turnaroundCounter,this._metaInfo=i,this._graphics=new p(i),this._plotFields=[],C=this.metaInfo().plots)for(x=0,P=C.length;x<P;x++)L=C[x].id,this._plotFields.push(L);this.clearData(),this._formatter=new u}var n=i(165),s=i(82).LineDataSource,r=n.StudyLineDataSource,a=n.StudyLineDataSourcePaneView,l=i(171),h=l.Study,c=l.prepareStudyProperties,d=i(174).StudyPaneView,p=i(167),u=i(94).VolumeFormatter,_=i(133),f=i(139);inherit(o,r),o.prototype.pointsCount=function(){return 2},o.prototype._requestStudy=function(){var t,e,i,o,n,s,r=this.points()[0],a=this.points()[1],l=Math.min(r.index,a.index),c=Math.max(r.index,a.index);if(l===c)return void this.clearData();t=this._model.mainSeries().bars().valueAt(l),e=this._model.mainSeries().bars().valueAt(c),t&&e&&(i=1e3*t[TradingView.TIME_PLOT],o=1e3*e[TradingView.TIME_PLOT],n=[],void 0!==this.properties().inputs.rowsLayout&&n.push(this.properties().inputs.rowsLayout.value()),n.push(this.properties().inputs.rows.value()),n.push(this.properties().inputs.volume.value()),n.push(i),n.push(o),n.push(this.properties().inputs.vaVolume.value()),s=this,this._studyId?(this._turnaround="vbpfixed_"+ ++this._turnaroundCounter,this._model.chartApi().modifyStudy(this._studyId,this._turnaround,n,function(t){s.onData(t)})):(this._studyId=h.makeNextStudyId(),this._model.chartApi().createStudy(this._studyId,this._turnaround,this._model.mainSeries()._seriesId,this._metaInfo.id+"-1!",n,function(t){s.onData(t)})))},o.prototype.onData=function(t){var e=this;if("data_update"===t.method&&t.params.customId==="pointset_"+this._currentPointsetId)s.prototype.onData.call(this,t),2===this._points.length&&this._requestStudy();else if("data_update"===t.method&&t.params.customId===this._studyId){if(!this._checkTurnaround(t.params.turnaround))return;h.prototype._makeJSONForNSData.call(this,t).then(function(i){t.params.nonseries.d=i,e._processPlotOffsets(t.params),e._mergeData(t.params.plots),""!==t.params.nonseries.d&&(e._graphics.process(t.params.nonseries),e._correctPoints(e._graphics.graphics())),t.params.nonseries.indexes.length>0&&(e._indexes=t.params.nonseries.indexes),e.updateAllViews(),e._model.updateSource(e)})}},o.prototype._correctPoints=function(t){var e,i,o,n,s,r;if(t&&(void 0===t.indexes||0!==t.indexes.length)&&t.hhists){for(e=t.hhists[0].data,i=null,o=null,n=0;n<e.length;++n)s=e[n].priceLow,r=e[n].priceHigh,(!i||s<i)&&(i=s),(!o||r>o)&&(o=r);this._points[0].price=o,this._points[1].price=i}},o.prototype.calcIsActualSymbol=function(){this._isActualSymbol=!0,this.calcIsActualInterval()},o.prototype.formatter=function(){return this._formatter},o.prototype.isSelfColorerPlot=function(t){return h.isSelfColorerPlot(this,t)},o.prototype.offset=function(t){return h.offset(this,t)},o.prototype.data=function(){return this.m_data},o.prototype._processPlotOffsets=function(t){h.processPlotOffsets(this,t)},o.prototype._mergeData=function(t){this.m_data.merge(t)},t.exports=o},function(t,e,i){"use strict";function o(t,e,i,s){var a=new n(this,t);e.push(a),r.call(this,t,e,i),this.properties().listeners().subscribe(this,o.prototype.changeStyles),this._constructor=s,this._studyId=null,this._nonseriesdata=null,this._indexes=null,this._metaInfo=null,this._graphics=null,this._inputs=null}function n(t,e){a.call(this,t,e)}function s(t,e){a.call(this,t,e)}var r=i(82).LineDataSource,a=i(123),l=i(166).VertLineRenderer,h=i(152).TrendLineRenderer,c=i(112).SelectionRenderer,d=i(117),p=i(167),u=i(133),_=i(139);inherit(o,r),o.prototype.pointsCount=function(){throw Error("Reimplement this in a child class")},o.prototype.title=function(){return this._metaInfo.description},o.prototype.studyId=function(){return this._metaInfo.id},o.prototype._requestStudy=function(){throw Error("Reimplement this in a child class")},o.prototype.changeStyles=function(){var t,e,o,n=i(168);if(this._inputs){t=n.splitInputs(this.properties().inputs.state()),e=t.obj;for(o in e)if(e[o]!==this._inputs[o]){this._inputs=e,this._requestStudy(),this._properties.lastUpdateTime.setValue((new Date).valueOf());break}}else t=n.splitInputs(this.properties().inputs.state()),this._inputs=TradingView.clone(t.obj),this._requestStudy(),this._properties.lastUpdateTime.setValue((new Date).valueOf())},o.prototype._checkTurnaround=function(t){return t===this._turnaround||t===this._model.mainSeries()._turnaround||t===this._model.mainSeries()._turnaround+"_"+this._turnaround},o.prototype.stop=function(){r.prototype.stop.call(this),this._studyId&&this._model.chartApi().removeStudy(this._studyId)},o.prototype.onData=function(t){throw Error("Reimplement this in a child class")},o.prototype._correctedPoint=function(t){var e=parseInt(this._model.mainSeries().bars().first(),10),i=parseInt(this._model.mainSeries().bars().last(),10);return t.index=Math.max(t.index,e),t.index=Math.min(t.index,i),t},o.prototype.addPoint=function(t){return r.prototype.addPoint.call(this,this._correctedPoint(t))},o.prototype.setLastPoint=function(t){return r.prototype.setLastPoint.call(this,this._correctedPoint(t))},o.prototype.move=function(t){},o.prototype.clearData=function(){void 0!==this.m_data&&(this.m_data=new u(this._plotFields)),this._nonseriesdata=null,this._indexes=null,this._graphics=new p(this._metaInfo),this.updateAllViews()},o.prototype.state=function(t){var e=r.prototype.state.call(this,t);return t&&(void 0!==this.m_data&&(e.data=this.m_data.state()),e.nonseriesdata=this._nonseriesdata,e.nonseriesindexes=this._indexes,e.graphics=this._graphics.graphics()),this.metaInfo()instanceof _?e.metaInfo=this.metaInfo().state():(e.metaInfo=$.extend({},this.metaInfo()),e.metaInfo.id=_.parseIdString(e.metaInfo.id+(e.metaInfo.version?"-"+e.metaInfo.version:"")).fullId),e},o.prototype.restoreData=function(t){void 0!==this.m_data&&void 0!==t.data&&this.m_data.restoreState(t.data),this._nonseriesdata=t.nonseriesdata?t.nonseriesdata:null,this._indexes=t.nonseriesindexes?t.nonseriesindexes:null,this._graphics.setGraphics(t.graphics?t.graphics:p.emptyGraphics())},o.prototype.setPoint=function(t,e){this._nonseriesdata=null,this._indexes=null,r.prototype.setPoint.call(this,t,this._correctedPoint(e))},o.prototype.disconnect=function(){this._studyId=0},o.prototype.graphics=function(){return this._graphics.graphics()},o.prototype.firstValue=function(){return this._model.mainSeries().data().firstValue()},o.prototype.formatter=function(){return this._model.mainSeries().data().formatter()},o.prototype.metaInfo=function(){return this._metaInfo},inherit(n,a),n.prototype.renderer=function(){var t,e,i,o,n,s=new d;return this._points.length<2?s:this._source._nonseriesdata?s:this._source._graphics&&!this._source._graphics.isEmpty()?s:(t=this._points[0],e=this._points[1],i={},i.points=[t],i.color="#808080",i.linewidth=this._source._doNotNeedLine?0:1,i.linestyle=CanvasEx.LINESTYLE_SOLID,s.append(new l(i)),o={},o.points=[e],o.color="#808080",o.linewidth=this._source._doNotNeedLine?0:1,o.linestyle=CanvasEx.LINESTYLE_SOLID,s.append(new l(o)),n={points:[t,e],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:"#808080",linewidth:this._source._doNotNeedLine?0:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},s.append(new h(n)),s)},inherit(s,a),s.prototype.renderer=function(){var t=new d;return this.isAnchorsRequired()&&(t.append(new c({points:this._points})),t.append(this.createLineAnchor({points:this._points}))),t},e.StudyLineDataSource=o,e.StudyLineDataSourcePaneView=s},function(t,e,i){"use strict";function o(t,e){this._data=t,this._hittest=e}function n(t,e){l.call(this,t,e),this._invalidated=!0}function s(t,e){c.call(this),this._source=t,this._model=e,this._invalidated=!0}function r(t,e){this._constructor="LineToolVertLine";var i=e||new f("linetoolvertline");this._timeAxisView=new s(this,t),h.call(this,t,new n(this,t),i)}var a=i(30),l=i(123),h=i(82).LineDataSource,c=i(87),d=i(88),p=i(113),u=i(114).PaneRendererClockIcon,_=i(117),f=i(91).DefaultProperty,m=i(94).DateTimeFormatter;o.prototype.draw=function(t){var e,i;0!==this._data.points.length&&(this._data.linewidth<=0||(e=this._data.points[0].x,t.translate(1,0),i=t.canvas.height,t.lineCap="square",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,CanvasEx.drawLine(t,e,0,e,i)))},o.prototype.hitTest=function(t){var e,i;return 0===this._data.points.length?null:(e=3,i=this._hittest||new p(p.MOVEPOINT),Math.abs(t.x-this._data.points[0].x)<=e?i:null)},inherit(n,l),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){l.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i;return this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().linecolor.value(),t.linewidth=this._source.properties().linewidth.value(),t.linestyle=this._source.properties().linestyle.value(),e=new _,e.append(new o(t)),this.addAnchors(e),TradingView.printing||!this._source.hasAlert.value()||this._model.readOnly()||1!==t.points.length||(i=new a.Point(this._points[0].x,this._source.priceScale().height()/2),this._source.getAlertIsActive(function(o){e.append(new u({point1:i,color:o?t.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))})),e},inherit(s,c),s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){var t,e;this._model.timeScale().isEmpty()||0!==this._source.points().length&&(this._text="",this._background=this._source.properties().linecolor.value(),t=this._source.points()[0].index,this._coordinate=this._model.timeScale().indexToCoordinate(t),e=this._model.timeScale().indexToUserTime(t),e&&(this._text=new m(this._model.mainSeries().isDWM()).format(e)),this._invalidated=!1)},s.prototype.renderer=function(){return this._invalidated&&this.updateImpl(),new d({text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background})},inherit(r,h),r.prototype.pointsCount=function(){return 1},r.prototype.title=function(){return"Vertical Line"},r.prototype.timeAxisViews=function(){return this.symbol()!==this._model.mainSeries().symbol()?null:this.properties().showTime.value()?[this._timeAxisView]:null},r.prototype.updateAllViews=function(){h.prototype.updateAllViews.call(this),this._timeAxisView.update()},r.prototype.canHasAlert=function(){return!0},r.prototype._getAlertPlots=function(){var t=this._points[0],e={index:t.index,price:t.price+1};return[this._linePointsToAlertPlot([t,e],null,!0,!0)]},e.VertLineRenderer=o,e.LineToolVertLine=r},function(t,e,i){"use strict";function o(t){this._graphics=o.emptyGraphics(),n(!!t,"Study metaInfo is absent!"),this._metaInfo=t}var n=i(140).assert;o.emptyGraphics=function(){return{indexes:[]}},o.prototype.isEmpty=function(){var t=Object.keys(this._graphics).length>1;return 0===this._graphics.indexes.length&&!t},o.prototype.graphics=function(){return this._graphics},o.prototype.setGraphics=function(t){this._graphics=t,this._postProcessGraphicsData()},o.prototype.process=function(t){if(""!==t.d)return t.d.indexes_replace?void this.replaceIndexes(t):void(t.d.graphicsCmds&&(this.processEraseCmds(t.d.graphicsCmds.erase),this.processCreateCmds(t.d.graphicsCmds.create,t.indexes)))},o.prototype.replaceIndexes=function(t){""!==t.d&&(n(!!t.d.indexes_replace),this._graphics.indexes=t.indexes)},o.prototype.processEraseCmds=function(t){var e,i,s,r,a;if(t)for(n(!!this._graphics,"_graphics object doesn't exist in the study!"),n(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!"),e=0;e<t.length;++e)if(i=t[e],"all"===i.action)this._graphics=o.emptyGraphics();else{if("one"!==i.action)throw Error("Unknown graphics command "+i.action);for(s in this._graphics[i.type])r=this._graphics[i.type][s],(a=o._findGraphicsObjIndexById(r.data,i.id))>=0&&r.data.splice(a,1)}},o._findGraphicsObjIndexById=function(t,e){for(var i=0;i<t.length;++i)if(t[i].id===e)return i;return-1},o.prototype.processCreateCmds=function(t,e){var i,o,s,r,a,l;if(t){n(!!e,"indexes are missing in the study nonseries response!"),n(!!this._graphics,"_graphics object doesn't exist in the study!"),n(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!");for(i in t){n(i in this._metaInfo.graphics,"There is a '"+i+"' in study response, but it doesn't present in metaInfo!");for(o=0;o<t[i].length;++o){s=t[i][o],r=s.styleId,n(r in this._metaInfo.graphics[i]),this._graphics[i]||(this._graphics[i]=[]),a=null;for(l=0;l<this._graphics[i].length;++l)if(this._graphics[i][l].styleId===r){a=this._graphics[i][l];break}null===a&&(a={styleId:r,data:[]},this._graphics[i].push(a)),a.data=a.data.concat(s.data)}}"nochange"===e||(n(Array.isArray(e)),this._graphics.indexes=e),this._postProcessGraphicsData()}},o.prototype._postProcessGraphicsData=function(){var t,e,i;if(this._graphics)for(t in this._graphics.hhists)e=this._graphics.hhists[t],o._sortHHistItemsByPrice(e.data),i=this._graphics.indexes,e.dataObj=o._splitHHistItemsBySession(e.data,i)},o._sortHHistItemsByPrice=function(t){t.sort(function(t,e){return t.priceLow-e.priceLow})},o._splitHHistItemsBySession=function(t,e){var i,o,n,s={};for(i=0;i<t.length;++i)o=t[i],n=e[o.firstBarTime],void 0!==n?(n in s||(s[n]=[]),s[n].push(o)):TradingView.logError("Cannot find index "+o.firstBarTime+" in study timescale indexes");return s},t.exports=o},function(t,e,i){"use strict";function o(t,e){var o,n,s,r,a,l,h,c,d,p,u;if(!t)throw Error("No studies metainfo");if(o=i(169),this._studiesMetainfo=t,!e)throw Error("No studies migrations");for(this._studiesMigrations=e,this._migrations={},n=0;n<this._studiesMigrations.length;n++)for(s=this._studiesMigrations[n],r=0;r<s.length;r++)for(a=s[r],l=a.versFrom,h=a.versTo,c=0;c<a.studyMigrations.length;c++){if(d=a.studyMigrations[c],p=d.studyId,0===d.rules.length)throw Error("Study Migration should have at least one convertion rule");u=p in this._migrations?this._migrations[p]:new o(p),u.addMigration(l,h,d.rules),this._migrations[p]=u}this._clientMigrations=[function(t,e){var i,o,n,s,r;if(0===this._studiesMetainfo.length||!t.isTVScript||t.version>=22)return e;for(i={},o=0,n=0;void 0!==(s=e[n]);)r=e[s.id],s.isFake&&(s.id="in_"+o++),i[n]=s,i[s.id]=r,n++;return i}]}var n=i(32),s=i(139),r=i(140).assert;o.prototype.updateMetaInfo=function(t){var e,i,o;if(!t)return t;for(r(!t.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync"),e=null,i=this._studiesMetainfo,o=0;o<i.length;o++)if(i[o].id===t.id){e=i[o];break}return TradingView.clone(e)},o.prototype.updateMetaInfoAsync=function(t,e){var i,o,n,r,a,l=$.Deferred(),h=l.promise();if(!t)return l.reject("No old metaInfo was given"),h;if(e)return l.resolve(null),h;if(i=t.isTVScript&&t.scriptIdPart&&TVScript.pineType(t.scriptIdPart)===TVScript.PineType.Addon,o=s.versionOf(t),t.isTVScript&&!t.pine&&!i&&o<s.VERSION_PINE_PROTECT_TV_4164);else if((t.isTVScript||t.isTVScriptStubToCompile)&&t.pine&&!i);else{for(n=null,r=this._studiesMetainfo,a=0;a<r.length;a++)if(r[a].id===t.id){n=r[a];break}n?l.resolve(TradingView.clone(n)):l.resolve(null)}return h},o.prototype.updateStudyState=function(t,e,i){var n,r,a,l,h,c,d,p,u,_,f,m,g,v,y;if(t){t=TradingView.clone(t),n=e.id,n in this._migrations&&(r=this._migrations[n].updateInputs(e.version,t.inputs),t.inputs=r);for(a=0;a<this._clientMigrations.length;++a)r=this._clientMigrations[a].call(this,e,t.inputs),Object.keys(r).length===Object.keys(t.inputs).length?t.inputs=r:TradingView.logWarn("StudyVersioning._clientMigrations application returned bad result. Skipping it...")}if((l=TradingView.clone(i))&&t&&(h={},o.mergeInputs(h,l.inputs),o.mergeInputs(h,l.defaults.inputs),o.mergeInputs(h,t.inputs),t.inputs=h,c=s.versionOf(e),e.isTVScript&&e.TVScriptSourceCode&&c>=12&&c<=26)){for(d={},a=0;a<e.plots.length;++a)p=e.plots[a],u=l.plots[a],d[p.id]=u.id;for(_=Object.keys(t.styles),a=0;a<_.length;++a)f=_[a],m=t.styles[f],delete t.styles[f],g=d[f],t.styles[g]=m;for(v=Object.keys(t.plots),a=0;a<v.length;++a)y=v[a],f=t.plots[y].id,t.plots[y].id=d[f]}return t},o.prototype.patchPointsBasedStudyState=function(t){return o._fixInputsMaxValue(t.state,t.metaInfo),t},o.prototype.patchPointsBasedStudyData=function(t,e){if("battle"!==n())return e;if(!t||!e)return e;var i=TradingView.clone(e);return"VbPFixed@tv-volumebyprice"===t.id&&t.version&&t.version<=4&&o._patchOldVolumeProfiles(0,i),i},o.prototype.patchStudyData=function(t,e,i,r){var a,l,h,c,d,p,u;if("battle"!==n())return{data:e,nsData:i,indexes:r};if(a=TradingView.clone(e),l=TradingView.clone(i),h=TradingView.clone(r),"VbPVisible@tv-volumebyprice"===t.id&&t.version&&t.version<=4&&o._patchOldVolumeProfiles(0,a.graphics),"VbPSessions@tv-volumebyprice"===t.id&&t.version&&t.version<=4&&o._patchOldVolumeProfiles(0,a.graphics),c=s.versionOf(t),t.isTVScript&&t.TVScriptSourceCode&&c>=12&&c<=26)for(d=a.columns,a.columns=[],p=0;p<d.length;++p)u="plot_"+p,a.columns.push(u);return{data:a,nsData:l,indexes:h}},o._patchOldVolumeProfiles=function(t,e){var i,o=e.hhists[t].data,n=[];for(i in o)n=n.concat(o[i]);e.hhists[0].data=n},o._fixInputsOrder=function(t,e){var i,n,r,a,l=s.getOrderedInputIds(e),h=o.splitInputs(t.inputs),c=h.arr,d=h.obj,p=TradingView.merge({},d);for(i=0;i<l.length;++i)n=l[i],null!==(r=o.findInputKeyById(c,n))&&(a=c[r],p[i]=a);t.inputs=p},o.INPUT_MAX_VALUE=1e12,o._verifyInputsMaxValue=function(t){var e,i,n=o.INPUT_MAX_VALUE;if(t.inputs)for(e=0;e<t.inputs.length;e++)i=t.inputs[e],"integer"===i.type&&i.max&&i.max>n&&TradingView.logWarn("Bad integer input max value in metaInfo id="+t.id+" title="+t.description)},o._fixInputsMaxValue=function(t,e){var i,n,s,r,a,l;if(!TradingView.isAbsent(e)){if(i=o.INPUT_MAX_VALUE,e.inputs)for(n=0;n<e.inputs.length;n++)s=e.inputs[n],"integer"===s.type&&s.max&&s.max>i&&(s.max=i);if(t&&t.inputs){r=o.splitInputs(t.inputs),a=r.arr;for(l in a)s=a[l],"integer"===s.type&&s.max&&s.max>i&&(s.max=i);t.inputs=TradingView.merge(r.obj,r.arr)}}},o.prototype.patchPropsStateAndMetaInfo=function(t,e,i){var n,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w;if(o._fixInputsOrder(t,e),o._fixInputsMaxValue(t,e),s.versionOf(e)<s.METAINFO_FORMAT_VERSION_SOS_V2&&e.isChildStudy&&(t.isChildStudy=e.isChildStudy),n=60,e.isTVScript&&e.version<n&&("Script$TV_EARNINGS@tv-scripting"!==e.id&&"Script$TV_DIVIDENDS@tv-scripting"!==e.id&&"Script$TV_SPLITS@tv-scripting"!==e.id||delete e.TVScriptSourceCode),"Volume"!==e.id&&"Volume@tv-basicstudies"!==e.id||0!==e.inputs.length||(e.inputs=[{id:"length",type:"integer",defval:20,min:1,max:1e3}],e.plots.push({id:"vol_ma",type:"line"})),"Volume@tv-basicstudies"===e.id&&e.version&&e.version<=46&&(t.styles.vol.transparency=t.transparency||87),"PivotPointsStandard@tv-basicstudies"===e.id&&(0===e.inputs.length?(t.inputs={kind:"Traditional",showHistoricalPivots:!0},e.inputs=[{defval:"Traditional",id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]):1===e.inputs.length&&(t.inputs={kind:"Traditional"},e.inputs=[{defval:"Traditional",id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]),void 0===t._hardCodedDefaultsVersion&&(t._hardCodedDefaultsVersion=1,r=t.color,delete t.color,t.levelsStyle={colors:{P:r,"S1/R1":r,"S2/R2":r,"S3/R3":r,"S4/R4":r,"S5/R5":r}})),"CMF"===e.shortId&&2===e.inputs.length&&(t.inputs={length:t.inputs["length fast"]},e.inputs=e.inputs.splice(0,1),e.inputs[0].id="length"),e.defaults&&void 0===e.defaults.precision&&(["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(e.id)!==-1?e.defaults.precision=0:e.defaults.precision=4),a=60,e.version<a)for(l=["TV_DIVIDENDS","TV_SPLITS","TV_EARNINGS"],h=6,c=0;c<l.length;c++)e.id.startsWith("Script$"+l[c]+"@tv-scripting")&&(e.fullId="ESD"+e.fullId.substring(h),e.id="ESD"+e.id.substring(h),e.name="ESD"+e.name.substring(h),e.shortId="ESD"+e.shortId.substring(h),e.productId="ESD"+e.productId.substring(h));if(s.versionOf(e)<s.VERSION_PINE_PROTECT_TV_4164&&(d={"StrategyScript$STD;Consecutive%1Ups/Downs%1Strategy":{pineId:"STD;Consecutive%1Ups%1Downs%1Strategy",className:"StrategyScript"},Script$EDGR_NET_INCOME_FROM_CONTINUING_OPERATIONS_APPLICABLE_TO_COMMON_V2:{pineId:"Script$EDGR_NET_INCOME_FROM_CONTINUING_OPS_APPLICABLE_TO_COMMON_V2",className:"Script"}},e.shortId in d&&(p=d[e.shortId].className+"$"+d[e.shortId].pineId,u={scriptIdPart:d[e.shortId].pineId,fullId:e.fullId.replace(e.shortId,p),id:e.id.replace(e.shortId,p),name:e.name.replace(e.shortId,p),shortId:p},TradingView.merge(e,u),TradingView.merge(t,u)),_=TradingView.StudyMetaInfo.cutScriptIdPart(e.fullId),(f=_.match(/^(USER)(_\d+)(;)(.*)$/))&&(m=f[0],g=f[1]+f[3]+f[2]+f[4],u={scriptIdPart:g,fullId:e.fullId.replace(m,g),id:e.id.replace(m,g),name:e.name.replace(m,g),shortId:e.shortId.replace(m,g)},TradingView.merge(e,u),TradingView.merge(t,u))),"MA"===e.id){switch(v=new s({id:"MAExp",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgExp",type:"line"}],palettes:{}}),y=new s({id:"MASimple",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgSimple",type:"line"}],palettes:{}}),b=new s({id:"MAVolumeWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgVolumeWeighted",type:"line"}],palettes:{}}),w=new s({id:"MAWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgWeighted",type:"line"}],palettes:{}}),t.inputs.type){case"exp":e=v;break;case"simple":e=y;break;case"weighted":e=w;break;case"volume weighted":e=b}t.styles[e.plots[0].id]=t.styles.MovAvg,delete t.styles.MovAvg,delete t.inputs.type}return i.oldShowStudyLastValueProperty&&(t.oldShowLastValue=t.showLastValue),delete t.showLastValue,delete t.showStudyArguments,{propsState:t,metaInfo:e}},o.isVersionTesting=function(t){var e;return!!t&&(t=""+t,e=RegExp("\\d+.\\d+"),e.exec(t)===t)},o.isVersionHead=function(t){var e;return!!t&&(t=""+t,e=RegExp("\\d+"),e.exec(t)===t)},o.mergeInputs=function(t,e){o.mergeInputsArrPart(t,e),o.mergeInputsObjPart(t,e)},o.mergeInputsArrPart=function(t,e){var i,n,s=o.splitInputs(e);for(i in s.arr)n=o.findInputKeyById(t,s.arr[i].id),n?TradingView.merge(t[n],s.arr[i]):o.appendInputInfoToArr(t,s.arr[i])},o.mergeInputsObjPart=function(t,e){var i=o.splitInputs(e);TradingView.merge(t,i.obj)},o.appendInputInfoToArr=function(t,e){var i,o,n=-1;for(i in t)o=parseInt(i,10),isNumber(o)&&o>n&&(n=o);t[n+1]=e},o.splitInputs=function(t){var e,i={},o={};for(e in t)isNumber(parseInt(e,10))?i[e]=t[e]:o[e]=t[e];return{arr:i,obj:o}},o.findInputKeyById=function(t,e){var i,o=null;for(i in t)if(isNumber(parseInt(i,10))&&t[i].id===e){o=i;break}return o},o.getInputKeyById=function(t,e){var i=o.findInputKeyById(t,e);if(!i)throw Error("Cannot find input with id: "+e);return i},t.exports=o},function(t,e,i){"use strict";function o(t){this._studyId=t,this._maxToVers=s.ZERO,this._maxFromVers=s.ZERO,this._migrs=[]}var n=i(168),s=i(170).Version;o.prototype.addMigration=function(t,e,i){var o=s.parse(t),n=s.parse(e);o.isGreater(this._maxFromVers)&&(this._maxFromVers=o),n.isGreater(this._maxToVers)&&(this._maxToVers=n),this._migrs.push({fromVers:o,toVers:n,rules:i})},o.prototype.updateInputs=function(t,e){var i,o,n;if(!e)return e;for(i=TradingView.clone(e),o=t;o.isLess(this._maxToVers);){if(n=this._findMigration(o),i=this._applyMigration(i,n),!o.isLess(n.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");o=n.toVers,TradingView.logDebugChart("Applied migration rule to study: "+this._studyId+" from vers: "+n.fromVers+" to vers: "+n.toVers)}return i},o.prototype._findMigration=function(t){var e,i,o=-1,n=this._maxFromVers;for(e=0;e<this._migrs.length;e++)i=this._migrs[e],i.fromVers.isLess(t)||i.fromVers.isLessOrEqual(n)&&(n=i.fromVers,o=e);if(o<0)throw Error("Could not find matching migration for study: "+this._studyId+" vers: "+t);return this._migrs[o]},o.prototype._applyMigration=function(t,e){var i,o,n,s=t;for(i=0;i<e.rules.length;i++)o=e.rules[i],n=this._getApplyRuleFun(o.type),s=n(s,o);return s},o.prototype._getApplyRuleFun=function(t){if("inputRemoved"===t)return o._applyInputRemovedRule;if("inputChangedType"===t)return o._applyInputChangedTypeRule;throw Error("Unknown migration rule type: "+t)},o._applyInputRemovedRule=function(t,e){var i,o,s,r;if(!(e.inputId in t))return t;if(!(i=n.findInputKeyById(t,e.inputId)))return t;delete t[i],delete t[e.inputId],o={},s=0;for(r in t)isNumber(parseInt(r,10))?(o[s]=t[r],s++):o[r]=t[r];return o},o._applyInputChangedTypeRule=function(t,e){var i=n.getInputKeyById(t,e.inputId);if("resetToDefVal"!==e.action)throw Error("Unknown action "+e.action+" for rule with type "+e.type);return t[e.inputId]=e.defVal,t[i].defval=e.defVal,t[i].type=e.inputType,t},t.exports=o},function(t,e,i){"use strict";var o=i(140),n=function(){function t(t,e){this._major=t,this._minor=e}return t.prototype.major=function(){return this._major},t.prototype.minor=function(){return this._minor},t.prototype.isZero=function(){return 0===this._major&&0===this._minor},t.parse=function(e){var i,n,s;if(e instanceof t)return new t(e.major(),e.minor());if("number"==typeof e)return o.assert(Math.floor(e)===e,"Version should not be a float number"),new t(e,0);if("string"==typeof e){if(i=e.split("."),1===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),new t(n,0);if(2===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),s=parseInt(i[1],10),o.assert(!isNaN(s),"Bad version string: "+e),new t(n,s);throw Error("Bad version string (one dot expected): "+e)}throw Error("Bad version: "+e)},t.prototype.toString=function(){return this._major+"."+this._minor},t.prototype.compareTo=function(t){return this._major<t._major?-1:this._major>t._major?1:this._minor<t._minor?-1:this._minor>t._minor?1:0},t.prototype.isLess=function(t){return this.compareTo(t)<0},t.prototype.isLessOrEqual=function(t){return this.compareTo(t)<=0},t.prototype.isEqual=function(t){return 0===this.compareTo(t)},t.prototype.isGreater=function(t){return this.compareTo(t)>0},t.prototype.isGreaterOrEqual=function(t){return this.compareTo(t)>=0},t.ZERO=new t(0,0),t}();e.Version=n},function(t,e,i){(function(e,o,n,s){"use strict";function r(t,e,i,o){this._study=t,this.m_series=e,this.m_model=i,this._plotName=o,this._visible=!1,this._points=[new Z.Point(0,0)],this._invalidated=!0}function a(){return{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,plottype:ht.PLOT_LINE,histogramBase:0,transparency:50,trackPrice:!1,joinPoints:!1}}function l(t,e,i,o){var n,s;return o.isTVScriptStrategy?n="StudyStrategy":(s="study_"+(o.classId||o.shortId),n=s in TradingView?s:"Study"),new TradingView[n](t,e,i,o)}function h(t,e,i,o,n){return c(t,e,i,o,"study_"+t.id,n)}function c(t,e,i,o,n,s){var r,a,l,h,c,d=u(t,e,i,o);for(s instanceof T&&(r=lt.getSourceInputIds(t),r.length>0&&(a=r[0],d.inputs[a]="{pid}$0")),l=new it(n,d,!0),l.addExclusion("visible"),l.addExclusion("precision"),l.addExclusion("minTick"),h=0;h<t.inputs.length;++h)c=t.inputs[h],c.isHidden&&(l.addExclusion("inputs."+h),l.addExclusion("inputs."+c.id));return l}function d(t,e,i,o,n,s){return p(t,e,i,o,n,"study_"+t.id,s)}function p(t,e,i,o,n,s,r){var a,l,h,c=_(t,e,i,o,n),d=new it(s,c,!0);for(d.addExclusion("visible"),d.addExclusion("precision"),d.addExclusion("minTick"),a=e||t,l=0;l<a.inputs.length;++l)h=a.inputs[l],h.isHidden&&(d.addExclusion("inputs."+l),d.addExclusion("inputs."+h.id));return d}function u(t,o,n,s){var r,a,l,h,c,d,p=i(168);if(lt.versionOf(t)<1)throw Error("This function cannot work with metainfo of the old format version. Required format version >= 1");return r=TradingView.clone(defaults("study")),v(r,t),a=TradingView.clone(defaults("study_"+t.id,s)),t.isTVScript&&t.TVScriptSourceCode!==a.TVScriptSourceCode&&(a=TradingView.clone(TradingView.factoryDefaults("study_"+t.id,s))),TradingView.merge(r,a),o&&(ct(!(o instanceof e),"propsState should not be an instance of Property"),TradingView.merge(r,o)),l=y(t),h={},p.mergeInputs(h,l.defaults.inputs),p.mergeInputsObjPart(h,r.inputs),p.mergeInputsArrPart(h,l.inputs),r.inputs=h,delete l.inputs,delete l.defaults.inputs,c={},TradingView.merge(c,l.defaults),TradingView.merge(c,TradingView.factoryDefaults("study_"+l.id)),TradingView.merge(c,r),TradingView.merge(c,l),delete c.defaults,r=c,d=b(n,t),TradingView.merge(r,w(r,d)),o&&TradingView.merge(r.styles,o.styles),r}function _(t,e,o,n,s){var r,a,l,h,c,d,p=i(168),u=lt.versionOf(t);return t.version&&o.version&&t.version!==o.version&&TradingView.logWarn("Serialized metaInfo version "+t.version+" is not equal to the saved state version "+o.version),r=TradingView.clone(defaults("study")),0===u?(TradingView.merge(r,TradingView.clone(t)),a=y(t),TradingView.merge(r.inputs,a.inputs)):u>=1&&TradingView.merge(r,TradingView.clone(t.defaults)),TradingView.merge(r,TradingView.factoryDefaults("study_"+t.id)),v(r,t),TradingView.merge(r,o),u>=1&&(TradingView.merge(r,TradingView.clone(t)),delete r.defaults),r=s.updateStudyState(r,t,e),l=e||t,l&&lt.versionOf(l)>=1&&(l=y(l),h={},p.mergeInputs(h,l.defaults.inputs),p.mergeInputs(h,r.inputs),p.mergeInputsArrPart(h,l.inputs),r.inputs=h,delete l.inputs,delete l.defaults.inputs,c={},TradingView.merge(c,l.defaults),TradingView.merge(c,TradingView.factoryDefaults("study_"+l.id)),TradingView.merge(c,r),TradingView.merge(c,l),delete c.defaults,r=c),d=b(n,l),TradingView.merge(r,w(r,d)),r}function f(t){var e=JSON.stringify(t);return e=e.replace(/'/g,"\\'")}function m(t,e){var i,o,n,s,r,a={};if(e.isTVScript)i=e.defaults.inputs.text,a.text=TVScript.patchILTemplate(i,e,t);else for(o=Object.keys(t),n=o.length-1;n>=0;n--)s=o[n],(r=t[s]?t[s].id:null)&&t[r]&&(a[r]=t[r]);return f(a)}function g(t){return f(t.filter(function(t){return t instanceof TradingView.Study}).map(function(t){var e={id:t._studyId,study:TradingView.StudyMetaInfo.cutDollarHash(t._metaInfo.fullId),inputs:t.inputs({asObject:!0,onlyAtomValues:!0})};return t._metaInfo.pine&&(e.scriptIdPart=t._metaInfo.scriptIdPart,e.scriptVersion=t._metaInfo.pine.version),e}))}function v(t,e){var i,o,n,s;if(e.plots)for(i=0;i<e.plots.length;i++)o=e.plots[i].id,(n=e.plots[i].type)!==ht.PLOT_TYPE_COLORER&&(s=a(),n===ht.PLOT_TYPE_BAR_COLORER&&(s.transparency=0),s.plottype=n,s.title=o,t.styles&&o in t.styles&&TradingView.merge(s,t.styles[o]),t.styles[o]=s)}function y(t){var e,i,o=TradingView.clone(t);if(o.inputs={},t.inputs)for(e=0;e<t.inputs.length;e++)i=t.inputs[e].id,o.inputs[i]=t.inputs[e].defval,o.inputs[e]=t.inputs[e];return o}function b(t,e){var i,o,n=0;if(t)for(i=0;i<t.dataSources().length;i++)o=t.dataSources()[i],o.metaInfo&&o.metaInfo()&&o.metaInfo().id===e.id&&n++;return n}function w(t,e){var i,o;if(!e)return t;for(i in t.styles)(o=t.styles[i].color)&&(t.styles[i].color=S(o,e));return t}function S(t,e){var i,o,n;return t=new Q(t),i=tt(t.r,t.g,t.b),o=i[0]+.05*e,i[0]=o-Math.floor(o),n=et(i[0],i[1],i[2]),t.r=n[0],t.g=n[1],t.b=n[2],t.toHex()}function T(t,e,s,r){var a,l,h,c,d,p,u,_,f=i(143);this._titleCache={},this._resolvedSymbols={},this._priceAxisViewsBase=[],this._paneViews=[],this._hlinesPriceAsisViews=[],this._horizlinesPriceAsisViews=[],H.call(this,t),this.m_data=new at,this._graphics=new G(r),this._plotOffsets={},this._plotOffsetsMetaInfoOverride={},this._model=t,this._chartApi=t._chartApi,this._series=s instanceof TradingView.Series?s:this._model.mainSeries(),s instanceof T&&(this._source=s,this._isChildStudy=!0,this._source.setChild(this)),this._numericFormatter=new rt,this._metaInfo=r,this._properties=e,this._properties.listeners().subscribe(this,this.changeStyles),this._properties.visible.listeners().subscribe(this,this.visibleChanged),this._properties.visible.listeners().subscribe(this,this.processHibernate);for(a in this._metaInfo.graphics)for(l in this._metaInfo.graphics[a])h=this._properties.graphics[a][l],h.visible&&h.visible.listeners().subscribe(this,this.processHibernate);if(this._showStudyArgumentsProperty=this.model().properties().paneProperties.legendProperties.showStudyArguments,this._turnaroundCounter=1,this._turnaround="st"+this._turnaroundCounter,this._status="",this._plotFields=[],c=this.metaInfo().plots)for(d=0,p=c.length;d<p;d++)l=c[d].id,this._plotFields.push(l);this.clearData(),this._studyModified=!1,this._tagsChanged=new o,this.createViews(),u=this,this._handler=function(t){u.onData(t)},this._createFormatter(),u=this,this._properties.precision.listeners().subscribe(null,function(){u._createFormatter(),u._model.invalidate(new K(K.FULL_UPDATE))}),this._showStudyArgumentsProperty.listeners().subscribe(this,this.invalidateTitleCache),this._properties.description.listeners().subscribe(this,this.invalidateTitleCache),this._properties.shortDescription&&this._properties.shortDescription.listeners().subscribe(this,this.invalidateTitleCache),n.enabled("update_study_formatter_on_symbol_resolve")&&t.mainSeries().onSymbolResolved().subscribe(this,T.prototype._createFormatter),u=this,_={},this._simplePlotsCount=r.plots.filter(function(t,e){if(u.isLinePlot(e))return!0;if(u.isOHLCSeriesPlot(e)){var i=u.metaInfo().plots[e].target;return!_[i]&&(_[i]=i,!0)}return!1}).length,this._properties.showInDataWindow.listeners().subscribe(t,f.prototype.fullUpdate),this.hasBarColorer()&&this._properties.visible.listeners().subscribe(t.mainSeries(),TradingView.Series.prototype.invalidateBarStylesCache),this.onStart=new o,this._childStudyByRebind=new o}var C=i(121).StudyBarColorer,x=i(122).HorzLineRenderer,P=i(172),L=P.BandPaneView,k=P.BandBackgroundPaneView,I=P.HlineFillPaneView,E=i(173),A=i(174),V=A.StudyPaneView,M=A.StudyBackgroundPaneView,D=A.StudyPlotShapesPaneView,O=A.StudyPlotCharsPaneView,B=A.StudyPlotArrowsPaneView,R=A.StudyPlotBarsPaneView,N=A.StudyPlotCandlesPaneView,F=i(177),W=F.PlotFillPaneView,z=F.AreaBackgroundPaneView,H=i(89).PriceDataSource,U=i(126),j=i(178).StudyDataWindowView,q=i(179),Y=i(113),G=i(167),K=i(99),X=i(28).parseJSONorNot,Z=i(30),J=i(85),Q=J.RGBColor,tt=J.rgbToHsl,et=J.hslToRgb,it=i(91).DefaultProperty,ot=i(94),nt=ot.PriceFormatter,st=ot.VolumeFormatter,rt=ot.NumericFormatter,at=i(133),lt=i(139),ht=i(175).StudyConsts,ct=i(140).assert;r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){this._visible=!1;var t=this._study.lastValueData(this._plotName,!0);t.noData||(this._visible=!0,this._points=[new Z.Point(0,t.coordinate)],this._color=t.color)},r.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.points=this._points,t.color=this._color,t.linewidth=this._study.properties().styles[this._plotName].linewidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.hitTestResult=Y.REGULAR,t.visible=this._visible,new x(t)},inherit(T,H),TradingView.Study=T,i(180),T.prototype.lastValueData=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return S;if(o=this._model.timeScale().visibleBars(),o.isEmpty())return S;if(!this.properties().visible.value())return S;if(n=this.properties().styles,s=this.properties().ohlcPlots,n&&n[t]&&(r=n[t]),s&&s[t]&&(r=s[t]),!r||!r.visible.value())return S;if(a=this.offset(t),null==(l=this.nearestIndex(o.lastBar()-a,TradingView.SEARCH_NEAREST_LEFT))||void 0===l)return S;for(c=this.metaInfo().plots,h=0;h<c.length&&!(c[h].id===t||this.isOHLCClosePlot(h)&&c[h].target===t);h++);if(!(d=e?this.data().last().value:this.data().valueAt(l))||!isNumber(d[h+1]))return S;for(p={noData:!1},u=null,_=null,m=0;m<c.length;m++)c[m].target===t&&(this.isSelfColorerPlot(m)||this.isOHLCColorerPlot(m))&&(u=m,_=this.metaInfo().palettes[c[m].palette],f=this.properties().palettes[c[m].palette]);if(g=d[h+1],i&&(p.price=g),this.priceScale().properties().percentage.value()){if(!(v=this.firstValue(!0)))return S;g=this.priceScale().priceRange().convertToPercent(g,v)}return p.text=this.priceScale().formatter().format(g),y=r.color.value(),u&&d.length>u+1?(b=d[u+1],void 0!==b&&null!==b?(w=_.valToIndex?_.valToIndex[b]:b,p.color=f.colors[w].color.value()):p.color=y):p.color=y,p.floatCoordinate=this.priceScale().priceToCoordinate(g,!0),p.coordinate=Math.round(p.floatCoordinate),p.item=d,p},T.prototype.series=function(){return this._series},T.prototype.model=function(){return this._model},T.prototype.clearData=function(){this.m_data=new at(this._plotFields),this._graphics=new G(this._metaInfo),this._plotOffsets={}},T.prototype.onTagsChanged=function(){return this._tagsChanged},T.prototype.properties=function(){return this._properties},T.prototype.state=function(t){var e,i,o,n,s=TradingView.className(this.constructor),r={type:s,id:this.id(),state:this.properties().state(),zorder:this.zorder()};for(this.metaInfo()instanceof lt?r.metaInfo=TradingView.clone(this.metaInfo().state()):(r.metaInfo=TradingView.clone(this.metaInfo()),r.metaInfo.id=lt.parseIdString(r.metaInfo.id+(r.metaInfo.version?"-"+r.metaInfo.version:"")).fullId),t&&(r.data=this.m_data.state(),r.data.symbols=this._resolvedSymbols,r.data.graphics=this._graphics.graphics(),r.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(r.ownerSource=this.ownerSource().id()),e=0;e<this._metaInfo.inputs.length;e++)"bar_time"===this._metaInfo.inputs[e].type&&(i=this._metaInfo.inputs[e].id,(o=r.state.inputs[i])<0&&(n=this._rightOffsetToUnixTime(-o),r.state.inputs[i]=n&&n>=0?n:0));return this._isChildStudy&&lt.patchChildStudyMetaInfoState(r),r},T.prototype.stateForAlert=function(){var t,e,i,o=this,n=this._metaInfo,s=this.inputs({asObject:!0,onlyAtomValues:!0});return s.text&&(t=s.text,s.text=TVScript.patchILTemplate(t,this._metaInfo,s)),e=[ht.PLOT_TYPE_LINE,ht.PLOT_TYPE_SHAPES,ht.PLOT_TYPE_CHARS,ht.PLOT_TYPE_ARROWS,ht.PLOT_TYPE_OHLC_OPEN,ht.PLOT_TYPE_OHLC_HIGH,ht.PLOT_TYPE_OHLC_LOW,ht.PLOT_TYPE_OHLC_CLOSE],i=n.plots.map(function(t,e){return t.pinePlotIndex=e,t}).filter(function(t){return e.indexOf(t.type)!==-1}).map(function(t){var e={id:t.id,type:t.type,pinePlotIndex:t.pinePlotIndex,offset:o.offset(t.id)};return n.styles&&void 0!==n.styles[t.id]&&(e.title=n.styles[t.id].title||""),t.target&&n.ohlcPlots&&n.ohlcPlots[t.target]&&(e.ohlcTitle=n.ohlcPlots[t.target].title),e}),{id:this.id(),uniqueId:this.uniqueId(),type:TradingView.className(this.constructor),title:TradingView.clean(this.title(),!0),shortDescription:TradingView.clean(n.shortDescription||"Study",!0),fullId:n.fullId,isTVScript:n.isTVScript,scriptIdPart:n.scriptIdPart,scriptVersion:n.pine?n.pine.version:"-1",plots:i,inputs:s,alerts:n.alerts,callStudyDependencies:g(this.getAllOwnerSources())}},T.prototype.uniqueId=function(){var t=this.inputsForAlert();return t=JSON.stringify(t).replace(/\W/g,""),this.id()+"|"+t},T.prototype.isSavedInStudyTemplates=function(){for(var t=0;t<this._metaInfo.inputs.length;t++)if("bar_time"===this._metaInfo.inputs[t].type)return!1;return!0},T.prototype.restoreData=function(t){this.m_data.restoreState(t),this._resolvedSymbols=t.symbols,this._graphics.setGraphics(t.graphics),this._postProcessGraphics(),this._plotOffsets=t.plotOffsets},T.prototype.restart=function(){this._restarting=!0,this.clearData(),n.enabled("stop_study_on_restart")&&this.stop(),this._clearLoadingTimer(),setTimeout(this.start.bind(this),0)},T.prototype._clearLoadingTimer=function(){this.loadingTimer&&(clearTimeout(this.loadingTimer),this.loadingTimer=null)},T.prototype.stop=function(t){if(t===!0&&this._children)for(var e=0;e<this._children.length;++e)this._children[e].stop(!0);this._clearLoadingTimer(),this._chartApi&&this._chartApi.connected()&&this._studyId&&this._chartApi.removeStudy(this._studyId,this._handler,this._isChildStudy),n.enabled("update_study_formatter_on_symbol_resolve")&&this._model.mainSeries().onSymbolResolved().unsubscribe(this,T.prototype._createFormatter),this._studyId=null,this.clearData(),this._unsubscribeExtendedHours(),this.recalculate()},T.prototype._resolveSymbol=function(t){var e=function e(i,o){this._chartApi.resolveSymbol(this._makeNextSymbolId(),i,function(i){switch(i.method){case"symbol_resolved":this._resolvedSymbols[t]=i.params[1],this.invalidateTitleCache(!0),o.resolve(t);break;case"symbol_error":if("permission denied"===i.params[1]&&i.params[2])switch(i.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:break;case TradingView.Series.PD_REASON_SYMBOL:if(i.params[3])return void e(i.params[3],o);break;default:return void e(i.params[2],o)}o.reject(t)}}.bind(this))}.bind(this),i=$.Deferred();return e(t,i),i.promise()},T.prototype._allSymbolsAreResolved=function(){var t,e,i,o,n=$.Deferred(),s=[];for(t=0;t<this._metaInfo.inputs.length;t++)"symbol"===this._metaInfo.inputs[t].type&&(e=this._metaInfo.inputs[t].id,i=this._properties.inputs[e].value(),this._resolvedSymbols[i]||(o=this._resolveSymbol(i),s.push(o)));return s.length>0?$.when.apply($,s).done(function(){0!==this._studyId&&this.stop(!0),this.start(!0),n.resolve("All symbols are resolved now")}.bind(this)).fail(function(t){this._status=$.t("Invalid Symbol"),this.stop(!0),this._model.updateSource(this),n.reject("Invalid symbol, "+t)}.bind(this)):n.resolve("There are no symbols to resolve"),n.promise()},T.prototype._allInputsAreValid=function(){var t,e,i;for(t=0;t<this._metaInfo.inputs.length;t++)if("bar_time"===this._metaInfo.inputs[t].type&&(e=this._metaInfo.inputs[t].id,void 0===(i=this._properties.inputs[e].value())||null==i))return!1;return!0},T.prototype.sourceId=function(){return this._studyId},T.prototype.source=function(){return this._source||this._series},T.prototype.ownerSource=function(){return this._isChildStudy?this._source:H.prototype.ownerSource.call(this)},T.prototype.getAllOwnerSources=function(){for(var t=[],e=this.ownerSource();null!=e;)t.push(e),e=e.ownerSource();return t},T.prototype.isChildStudy=function(){return!!this._isChildStudy},T.prototype.setChild=function(t){t instanceof T&&t.source()===this&&(this._children||(this._children=[]),this._children.indexOf(t)===-1&&this._children.push(t))},T.prototype.unsetChild=function(t){if(t instanceof T&&t.source()===this&&this._children){var e=this._children.indexOf(t);~e&&this._children.splice(e,1)}},T.prototype.hasChildren=function(){return!(!this._children||!this._children.length)},T.prototype.getAllChildren=function(){var t,e,i,o;if(!Array.isArray(this._children))return[];for(t=this._children.slice(),e=0;e<t.length;++e)for(i=t[e].getAllChildren(),o=0;o<i.length;++o)~t.indexOf(i[o])||t.push(i[o]);return t},T.prototype._debugId=function(){var t=[];return this._studyId&&t.push(this._studyId),t.push(this._metaInfo.fullId),t.push(this._metaInfo.description),JSON.stringify({study:t})},T.prototype.isStarted=function(){return!!this._studyId},T.prototype.isRestarting=function(){return!!this._restarting},T.prototype.isVisible=function(){var t,e,i,o;if(!this.properties().visible.value())return!1;if(this._metaInfo.plots.length>0)for(t=0;t<this._metaInfo.plots.length;t++)if(!(e=this.properties().plots[t].visible)||e.value())return!0;for(i in this._metaInfo.graphics)for(o in this._metaInfo.graphics[i])if(e=this.properties().graphics[i][o],!e.visible||e.visible.value())return!0;return!!this._metaInfo.isTVScriptStrategy},T.prototype.start=function(t,e){var i,o=this._model.mainSeries();if(!o.isStarted())return void o.onCompleted().subscribe(this,function(){this.start(t,e)},!0);this._isChildStudy&&this._source.isHibernated()&&this._source.start(),i=!this._isChildStudy&&!this.hasChildren()&&TradingView.isFeatureEnabled("tv5176_HibernateStudies")&&!this.isVisible(),!this._chartApi||!this._chartApi.connected()||i&&e!==!0||this._allSymbolsAreResolved().done(function(i){this._startAfterSymbolsResolved(t,e)}.bind(this)).fail(function(t){TradingView.logNormalChart("ERROR: "+this._debugId()+" start failed, "+t),delete this._restarting}.bind(this))},T.prototype._startAfterSymbolsResolved=function(t,e){var i,o;if(!this.isStarted()||this._restarting){if(this._isChildStudy){if(!this._source.isStarted()||this._source.isRestarting())return void this._source.onStart.subscribe(this,this._startAfterSymbolsResolved,!0);lt.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=T.makeNextStudyId(),delete this._restarting,this._allInputsAreValid()&&(this._inputs=this.inputs(),i=this._metaInfo.id+"-"+(this._metaInfo.version||"1"),i=lt.cutDollarHash(i),(i.startsWith("Script@tv-scripting")||i.startsWith("StrategyScript@tv-scripting")||i.startsWith("ESD@tv-scripting"))&&(i+="!"),this._chartApi.createStudy(this._studyId,this._turnaround,this._isChildStudy?this._source.sourceId():this._series._seriesId,i,this._inputs,this._handler,this._isChildStudy),this._studyName=i,this._subscribeExtendedHours(),this.onStart.fire(this._studyId),t===!0&&this._children))for(o=0;o<this._children.length;++o)this._children[o].start(!0,e)}},T._nextSymbolId=0,T.prototype._makeNextSymbolId=function(){return"ss_"+ ++T._nextSymbolId},T._nextStudyId=0,T.makeNextStudyId=function(){return"st"+ ++T._nextStudyId},T.prototype._rightOffsetToUnixTime=function(t){return this._series.bars().size()>=t&&this._series.bars()._valueAt(this._series.bars().lastIndex()-t)[TradingView.TIME_PLOT],null},T.prototype.getSymbolString=function(t){return this._series&&this._series.extendedHours.value()?"="+JSON.stringify({symbol:t,session:"extended"}):t},T.prototype.inputsForGUI=function(){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1})},T.prototype.inputsForAlert=function(){var t=this.offset(),e=this.inputs({symbolsForDisplay:!0,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,asObject:!1});return t&&e.push(t),e},T.prototype.inputs=function(t){var e={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,asObject:!0};return TradingView.merge(e,t),this._buildInputs(e)},T.prototype._buildInputs=function(t){var e,i;ct(!!t,"options not set"),e={};try{e=this._prepareInputs(t)}catch(t){TradingView.logWarn("Failed to prepare study inputs: "+t)}return t.asObject?(i={},Object.keys(e).forEach(function(t){null!=e[t]&&(i[t]=e[t])}),i):(i=[],Object.keys(e).forEach(function(t){null!=e[t]&&i.push(e[t])}),i)},T.prototype._prepareInputs=function(t){var e,i,o,s;for(ct(!!t,"options not set"),e={},i=0;i<this._metaInfo.inputs.length;i++)o=this._metaInfo.inputs[i],o.isFake&&t.skipFakeInputs||o.isHidden&&t.skipHiddenInputs||"bool"===o.type&&t.skipHiddenInputs&&n.enabled("dont_show_boolean_study_arguments")||(s=this._prepareInput(o,t),e[o.id]=TradingView.clone(s));return e},T.prototype._prepareInput=function(t,e){var i=this._prepareInputValue(t,e);return!t.isFake||e.fakeInputsForDisplay?i:e.onlyAtomValues?i:{v:i,f:!0,t:t.type}},T.prototype._prepareInputValue=function(t,e){var i,o,n,s,r=t.id;return"symbol"===t.type?(i=this._properties.inputs[r].value(),e&&e.symbolsForDisplay?this._resolvedSymbols&&this._resolvedSymbols[i]&&(i=this._resolvedSymbols[i].name+", "+this._resolvedSymbols[i].exchange):(this._resolvedSymbols&&this._resolvedSymbols[i]&&(o=this._resolvedSymbols[i],i=o.ticker||o.full_name),e&&e.symbolsForChartApi&&(i=this.getSymbolString(i))),i):"bar_time"===t.type?(n=this._properties.inputs[r].value(),n<0&&(s=this._rightOffsetToUnixTime(-n),n=s&&s>=0?s:n),n):(this._metaInfo.isTVScript||this._metaInfo.pine)&&"text"===r?this._metaInfo.defaults.inputs.text:this._properties.inputs[r].value()},T.prototype._rebindToSource=function(t,e){var i,o,n,s,r,a,l,h,c,d;if(this._isChildStudy){if(this._source.unsetChild(this),delete this._nonPriceParent,o=null,t===this._model.mainSeries()){for(n=this._model.studiesMetaData(),r=0;r<n.length;++r)if(this._metaInfo.id===n[r].id){s=n[r];break}if(!s)return void TradingView.logError("Can not find "+this._metaInfo.id+" meta info");delete this._source,delete this._isChildStudy,delete this._ownerSource,this._metaInfo=s.state(!0),i=this._series._seriesId,o=TradingView.ChartApiInterface.REBIND_STUDY_CHILD_TO_STANDALONE}else{if(!(t instanceof T))return TradingView.logError("Unable to rebind study to source of this type"),!1;this._ownerSource=t,this._source=t,i=this._source.sourceId(),this._source.setChild(this),this._source.isHibernated()&&this._source.start()}this._chartApi.rebindStudy(this._studyId,this._turnaround,i,this._studyName,e,this._handler,o)}else{if(!(t instanceof T))return TradingView.logError("Unable to rebind study to source of this type"),!1;if(a=t.isHibernated(),a&&t.start(),!this._chartApi.rebindStudy(this._studyId,this._turnaround,t.sourceId(),this._studyName,e,this._handler,TradingView.ChartApiInterface.REBIND_STUDY_STANDALONE_TO_CHILD))return a&&t.stop(),!1;this._metaInfo=TradingView.clone(this._metaInfo),this._isChildStudy=!0,this._ownerSource=t,this._source=t,this._source.setChild(this),this._childStudyByRebind.fire()}return l=this.m_priceScale,h=t.priceScale(),l!==h&&(c=this._model.paneForSource(this),d=this._model.paneForSource(t),c===d&&(~l.dataSources().indexOf(this)&&l.removeDataSource(this),h.addDataSource(this),this.setPriceScale(h))),!0},T.prototype.childStudyByRebind=function(){return this._childStudyByRebind},T.prototype._changeInputsImpl=function(t,e){var i,o,n,s,r=this.source(),a=this._properties.inputs&&this._properties.inputs.state(),l=lt.getSourceIdByInputs(this._metaInfo.inputs,a),h=!0;if(l)if("high"===l||"open"===l||"low"===l||"close"===l||"hl2"===l||"ohl3"===l||"ohlc4"===l)r=this._model.mainSeries();else for(i=this._model.dataSources(),o=0;o<i.length;++o)if(i[o]instanceof T&&i[o].sourceId()===l){r=i[o];break}if(r!==this.source()){if(!this._rebindToSource(r,t)&&a){for(n=null,s=null,o=0;o<e.length;++o)if(e[o]!==t[o]&&0===t[o].indexOf(l)){n=this._properties.inputs[a[o].id],s=e[o],h=!1;break}n&&n.setValue(s)}}else this._chartApi.modifyStudy(this._studyId,this._turnaround,t,this._handler);h&&(this._studyModified=h)},T.prototype._changeInputs=function(t){var e=TradingView.clone(this._inputs);this._studyId&&this._chartApi.connected()?(this._turnaround="st"+ ++this._turnaroundCounter,this._allInputsAreValid()?this._allSymbolsAreResolved().done(this._changeInputsImpl.bind(this,t,e)).fail(function(t){TradingView.logError("ERROR: "+this._debugId()+" _changeInputs: cannot modify study, "+t)}.bind(this)):this.stop()):(this.stop(!0),this.start(!0)),this._inputs=t,this._tagsChanged.fire(),this._titleCache={}},T.prototype.testInputValue=function(t,e){var i;return!lt.canBeChild(this._metaInfo)||!lt.isSourceInput(t)||(!(i=this._properties.inputs&&this._properties.inputs[t.id])||(!(T.getInputRebindType(t,i.value(),e)===TradingView.ChartApiInterface.REBIND_STUDY_STANDALONE_TO_CHILD&&!this._chartApi.isCanCreateStudy(!0))||(goProDialog({feature:"studyOnStudy"}).open(),!1)))},T.prototype.changeStyles=function(){var t,e=null!=this._metaInfo.inputs.filter(function(t){return"symbol"===t.type})[0];!this.isStarted()&&!e||this._restarting||(this._inputs?(t=this.inputs(),JSON.stringify(t)!==JSON.stringify(this._inputs)&&this._changeInputs(t)):this._chartApi&&this._chartApi.connected()&&this.restart(),this.hasBarColorer()&&this._model.mainSeries().invalidateBarStylesCache(),e&&this.invalidateBarStylesCache(),this.createViews(),this.recalculate(!0),this.updateAllViews())},T.prototype._isModifiedStudyInputs=function(t){if(void 0===this._oldStudyInputs)return this._oldStudyInputs=t,!0;var e=Object.keys(this._oldStudyInputs);return ct(e.length===Object.keys(t).length,"keys quantity should be equal"),e.forEach(function(e){ct(t.hasOwnProperty(e),"key '"+e+"' should existing in studyInputs"),this._oldStudyInputs[e]!==t[e]&&(this._oldStudyInputs=t)},this),this._oldStudyInputs===t},T.prototype.visibleChanged=function(){this._series instanceof TradingView.Series&&this._series.invalidateBarColorerCache()},T.prototype.invalidateBarStylesCache=function(){var t,e,i=this.m_data;0!==i.size()&&(t=+i.first(),e=+i.last()+1,i.range(t,e).each(function(t,e){e[TradingView.STYLE_PLOT]=null}))},T.prototype.processHibernate=function(){this.isHibernateAllowed()&&(!this._studyId&&this.isVisible()&&this.start(),this._studyId&&!this.isVisible()&&this.stop())},T.prototype.isHibernated=function(){return TradingView.isFeatureEnabled("tv5176_HibernateStudies")&&!this.isVisible()&&!this._studyId},T.prototype.isHibernateAllowed=function(){return TradingView.isFeatureEnabled("tv5176_HibernateStudies")&&!this._isChildStudy&&!this.hasChildren()},T.prototype.lastPriceLabelFixedCoordinate=function(t){return this._priceAxisViewsCache[t]._fixedCoordinate},T.prototype.priceLabelText=function(t){var e,i,o,n;return 1===this._simplePlotsCount?this._metaInfo.shortDescription:(e=this._metaInfo.styles,i=this._metaInfo.ohlcPlots,e&&e[t]&&(o=e[t]),i&&i[t]&&(o=i[t]),n=o.title,this._metaInfo.is_price_study?this._metaInfo.shortDescription+":"+n:n)},T.prototype.createPlotLabels=function(t){for(var e=0;e<t.length;e++)this._paneViews.push(new U(this._model,this,t[e],"priceLabelText","showStudyPlotLabels"))},T.prototype.createViews=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u;if(this._priceAxisViewsBase=[],this._paneViews=[],t={},this._priceAxisViewsCache={},e=[],this.metaInfo().plots)for(i=0;i<this.metaInfo().plots.length;i++)if(!(this.isSelfColorerPlot(i)||this.isBarColorerPlot(i)||this.isBarColorerPlot(i)||this.isOHLCColorerPlot(i)))if(o=this.metaInfo().plots[i].id,this.isBgColorerPlot(i))this._paneViews.push(new M(this,this._series,this._model,o));else if(this.isPlotShapesPlot(i))this._paneViews.push(new D(this,this._series,this._model,o));else if(this.isPlotCharsPlot(i))this._paneViews.push(new O(this,this._series,this._model,o));else if(this.isPlotArrowsPlot(i))this._paneViews.push(new B(this,this._series,this._model,o));else if(this.isOHLCSeriesPlot(i)){if(n=this.metaInfo().plots[i].target,t[n])continue;t[n]=n,this.isOHLCBarsPlot(i)?this._paneViews.push(new R(this,this._series,this._model,n)):this.isOHLCCandlesPlot(i)&&this._paneViews.push(new N(this,this._series,this._model,n)),s=new E(this,this._model,n),this._priceAxisViewsCache[n]=s,this._priceAxisViewsBase.push(s),e.push(n)}else s=new E(this,this._model,o),this._priceAxisViewsCache[o]=s,this._priceAxisViewsBase.push(s),this._paneViews.push(new V(this,this._series,this._model,o)),this.properties().styles[o].trackPrice.value()&&this._paneViews.push(new r(this,this._series,this._model,o)),e.push(o);if(this._properties.bands)for(i=0;i<this._properties.bands.childCount();i++)this._properties.bands[i].visible.value()&&this._paneViews.push(new L(this._properties.bands[i],this));this._properties.bandsBackground&&this._paneViews.push(new k(this)),a=[],this.metaInfo().graphics&&(a=Object.keys(this.metaInfo().graphics),a.sort(function(t,e){return T.graphicsZOrderPriority(t)-T.graphicsZOrderPriority(e)}));for(l in a)h=a[l],c="_paneView"+h,d="StudyPaneView_"+h,TradingView.Study[d]&&(this[c]=new TradingView.Study[d](this,this._model),this._paneViews.push(this[c])),this._dataWindowView||"hhists"!==h||(this._dataWindowView=new TradingView.StudyHHistsDataWindowView(this,this._model));if(this._properties.areaBackground&&this._paneViews.push(new z(this)),this._properties.filledAreas&&this._metaInfo.filledAreas)for(i=0;i<this._metaInfo.filledAreas.length;++i)p=this._metaInfo.filledAreas[i],u=this._properties.filledAreasStyle[p.id],p.type===lt.FilledArea.TYPE_PLOTS||p.palette?this._paneViews.push(new W(this,p,u)):p.type===lt.FilledArea.TYPE_HLINES?this._paneViews.push(new I(this,p,u)):TradingView.logWarn("Unsupported filledArea type: "+p.type);this.createPlotLabels(e),this._dataWindowView||(this._dataWindowView=new j(this,this._model)),this._statusView||(this._statusView=new q(this,this._model.properties())),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},T.prototype.recalculate=function(t){var e=this._model.paneForSource(this);this._model.recalculatePane(e,t),this._model.updateSource(this)},T.prototype.data=function(){return this.m_data},T.prototype.metaInfo=function(){return this._metaInfo},T.prototype.status=function(){return this._status},T.prototype.title=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f,m,g=JSON.stringify([t,e,i]);if(this._titleCache[g])return this._titleCache[g];if(o=t?this._metaInfo.shortDescription||this._properties.shortDescription&&this._properties.shortDescription.value()||"Study":this._metaInfo.description||this._properties.description&&this._properties.description.value()||"Study",o=$.t(o),i!==!0&&(n=this._showStudyArgumentsProperty.value(),s=this.inputsForGUI()||[],r=this,e&&"object"==typeof e||(e={}),n&&s.length>0)){if(a={},this._isChildStudy)for(l=0;l<this._metaInfo.inputs.length;++l)if(h=this._metaInfo.inputs[l],lt.isSourceInput(h)){c=h.id,d=this._properties.inputs[c].value(),d.indexOf("$")>=0&&this._source&&(p=this._source.metaInfo(),u=this._source.title(t,null,!0),1===p.plots.length?a[d]=u:(_=d.split("$")[1],f=p.plots[_].id,m=p.styles&&p.styles[f]&&p.styles[f].title||f,a[d]=u+":"+m));break}s=s.map(function(t){var i=isNumber(t)?r._numericFormatter.format(t):a&&a[t]||t;return e[i]&&(i=e[i]),i}),o+=" ("+s.join(", ")+")"}return this._titleCache[g]=o,o},T.prototype.invalidateTitleCache=function(t){if(this._titleCache={},t===!0&&this._children)for(var e=0;e<this._children.length;++e)this._children[e].invalidateTitleCache(t)},T.prototype.graphics=function(){return this._graphics.graphics()},T.prototype.turnaround=function(t){return t===!0?this.source().turnaround(!0)+"_"+this._turnaround:this._turnaround},T.prototype._checkTurnaround=function(t){return t===this._turnaround||t===this._model.mainSeries().turnaround()||t===this.turnaround(!0)},T.prototype._makeJSONForNSData=function(t,e){var i=""!==t.params.nonseries.d?X(t.params.nonseries.d):e||"";return Promise.resolve(i)},T.prototype.onData=function(t){var e,i,o,n=this;switch(t.method){case"study_loading":this._status=$.t("loading..."),this._failed=!1,this._statusView.update(),this._model.updateSource(this),this._clearLoadingTimer(),["Plot splits","Plot earnings","Plot dividends"].indexOf(n._metaInfo.description)===-1&&(n._loadingStartTime=(new Date).getTime(),n.loadingTimer=setTimeout(function(){var t={chartSession:n._chartApi._sessionid,studyName:n._metaInfo.description,arguments:n.inputs()};Telemetry.sendReport("study_loading",t)},15e3));break;case"study_error":this._clearLoadingTimer(),delete this._loadingStartTime,this._failed=!0,this.clearData(),t.params[2]?this._status=$.t(t.params[2].split(":",2)[0]):this._status="",["Sessions"].indexOf(n._metaInfo.description)===-1&&Telemetry.sendReport("study_error",{chartSession:n._chartApi._sessionid,studyName:n._metaInfo.description,arguments:n.inputs()}),this._statusView.update(),this._model.updateSource(this);break;case"study_completed":if(!this._checkTurnaround(t.params[1]))return Promise.resolve();e="chartSession:"+n._chartApi._sessionid,TradingView.logDebugChart(e+", Study "+this._metaInfo.description+" loading took "+((new Date).getTime()-this._loadingStartTime)+" ms"),this._clearLoadingTimer(),delete this._loadingStartTime,this._status="",this._statusView.update(),i=this._model.paneForSource(this),this._model.recalculatePane(i),this._updateSources(),this._model.invalidate(new K(K.FULL_UPDATE));break;case"study_deleted":break;case"data_update":return this._checkTurnaround(t.params.turnaround)?(n._clearLoadingTimer(),this._studyModified&&(this.clearData(),this._studyModified=!1),o=0===this.m_data.size()&&this._metaInfo.plots.length>0,ct(!!t.params.nonseries,"data.params.nonseries is missing"),new Promise(function(e){n._makeJSONForNSData(t).then(function(i){var s,r;t.params.nonseries.d=i,n._processPlotOffsets(t.params),n.transformData(t.params.plots),s=n._mergeData(t.params.plots).earliestRow,n.hasBarColorer()&&(null!==s?n._model.mainSeries().invalidateBarStylesCache(s.index):TradingView.logNormalChart("ERROR: No earliestRow in studies plots, "+n._debugId())),n._graphics.process(t.params.nonseries),n._postProcessGraphics(),r=n._model.paneForSource(n),n._model.recalculatePane(r,o),n._updateSources(),e()})})):Promise.resolve()}return Promise.resolve()},T.prototype.transformData=function(t){},T.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},T.processPlotOffsets=function(t,e){if(!e.nonseries||"nochange"!==e.nonseries.indexes){var i=e.nonseries.d;if(!i||!i.indexes_replace)return i&&i.offsets?void(t._plotOffsets=i.offsets):void(t._plotOffsets={})}},T.prototype._processPlotOffsets=function(t){T.processPlotOffsets(this,t)},T.prototype._mergeData=function(t){return this.m_data.merge(t)},T.prototype._postProcessGraphics=function(){var t=this,e=function(e){var i,o,n,s=t._graphics.graphics(),r=[];if(s&&s[e])for(n=s[e],i=0;i<n.length;i+=1)if(n[i].data)for(o=0;o<n[i].data.length;o+=1)r.push(new T.StudyPriceAxisView_hlines(t,t._model,n[i].data[o],n[i].styleId,e));return r};this._hlinesPriceAsisViews=e("hlines"),this._horizlinesPriceAsisViews=e("horizlines"),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},T.prototype._getNonPriceParent=function(){var t,e;if(this._nonPriceParent)return this._nonPriceParent;for(t=this.source();t instanceof T;){if(e=t.metaInfo(),!e.is_price_study||"Compare@tv-basicstudies"===e.id)return this._nonPriceParent=t,t;t=t.source()}},T.prototype.firstValue=function(t){var e,i,o,n,s,r;return!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study?(e=this._model.timeScale().visibleBars(),i=e.firstBar(),o=e.lastBar(),0===this.m_data.size()?null:(s=this,this.m_data.range(i,o).each(function(e,i){var o,r,a;for(o=1;o<i.length;++o)if(void 0!==i[o-1]&&null!==i[o-1]&&!s.isSelfColorerPlot(o-1)&&(r=s._metaInfo.plots[o-1].id,a=s.properties().styles[r],a.visible&&a.visible.value()&&!(t&&Math.abs(i[o])<1e-10||void 0===i[o]||null===i[o]||n)))return n=i[o],!0}),this._nonPriceFirstValue=n,n)):this._isChildStudy&&(r=this._getNonPriceParent())&&this.priceScale()===r.priceScale()?void 0!==r._nonPriceFirstValue?r._nonPriceFirstValue:r.firstValue():this._series.data().firstValue()},T.offset=function(t,e){var i=0;return t._plotOffsets&&void 0!==t._plotOffsets[e]&&(i+=t._plotOffsets[e]),void 0!==t._plotOffsetsMetaInfoOverride[e]?i+=t._plotOffsetsMetaInfoOverride[e]:t.properties().offsets&&void 0!==t.properties().offsets[e]&&(i+=t.properties().offsets[e].val.value()),t.properties().offset&&(i+=t.properties().offset.val.value()),i},T.prototype.offset=function(t){return T.offset(this,t)},T.prototype.priceRange=function(t,e){var i,o,n,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S;if(!TradingView.isInteger(t))return void TradingView.logDebugChart("Study.priceRange: incorrect startBar");if(!TradingView.isInteger(e))return void TradingView.logDebugChart("Study.priceRange: incorrect endBar");if(0===this.m_data.size())return null;if(i=null,o=this,n=o._metaInfo,0===n.plots.length)return null;for(a=[],h=0;h<n.plots.length;++h)if(!(o.isSelfColorerPlot(h)||o.isTextColorerPlot(h)||o.isBarColorerPlot(h)||o.isBgColorerPlot(h)||o.isOHLCColorerPlot(h))&&(c=n.plots[h].id,o.isOHLCSeriesPlot(h)?(p=n.plots[h].target,d=o.properties().ohlcPlots[p]):d=o.properties().styles[c],d.visible.value()&&(l=null,d.location&&(l=d.location.value()),r||(u=[CanvasEx.MARKLOC_ABSOLUTE,CanvasEx.MARKLOC_TOP,CanvasEx.MARKLOC_BOTTOM].indexOf(l)<0,_=o.isPlotShapesPlot(h)||o.isPlotCharsPlot(h),r=_&&u||o.isPlotArrowsPlot(h)),o.isLinePlot(h)||(o.isPlotShapesPlot(h)||o.isPlotCharsPlot(h))&&d.location.value()===CanvasEx.MARKLOC_ABSOLUTE||o.isOHLCSeriesPlot(h)))){if(f={index:h+1,offset:o.offset(c)},m=o.properties().styles[c].plottype.value(),!o.properties().skipHistogramBaseOnAutoScale&&[ht.PLOT_HISTOGRAM,ht.PLOT_COLUMNS,ht.PLOT_AREA].indexOf(m)>=0){if(g=o.properties().styles[c].histogramBase.value(),!isNumber(g))continue;f.baseValue=g}a.push(f)}if(v=o.m_data.minMaxOnRange2(t,e,a),r&&(a=[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}],y=o.series().data().bars().minMaxOnRange2(t,e,a),v.min=null==v.min||void 0===v.min?y.min:Math.min(v.min,y.min),v.max=null==v.max||void 0===v.max?y.max:Math.max(v.max,y.max)),null!==v.min&&(i=new s(v.min,v.max)),n.bands)for(h=0;h<n.bands.length;h++)if(o.properties().bands[h].visible.value()){if(g=o.properties().bands[h].value.value(),!isNumber(g))continue;i?i.apply(g,g):i=new s(g,g)}return i&&i.minValue()===i.maxValue()&&(b=.005*i.minValue(),i=new s(i.minValue()-b,i.maxValue()+b)),w=this.priceScale(),w&&w.properties().percentage.value()&&i?(S=this.firstValue(),S?i.convertToPercents(S):null):w&&w.isLog()&&i?new s(o.priceScale().priceToLogical(i.minValue()),o.priceScale().priceToLogical(i.maxValue())):i},T.prototype.paneViews=function(t){return this.properties().visible.value()?this._paneViews:null},T.prototype.dataWindowView=function(){return this._dataWindowView},T.prototype.statusView=function(){return this._statusView},T.prototype.priceAxisViews=function(t,e){return this._model.paneForSource(this)===t&&e===this.priceScale()&&(this._model.properties().scalesProperties.showStudyLastValue.value()||this.properties().oldShowLastValue&&this.properties().oldShowLastValue.value())?this._priceAxisViews:null},T.prototype.isLinePlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_LINE},T.isSelfColorerPlot=function(t,e){return t._metaInfo.plots[e].type===ht.PLOT_TYPE_COLORER},T.prototype.isSelfColorerPlot=function(t){return T.isSelfColorerPlot(this,t)},T.prototype.isTextColorerPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_TEXT_COLORER},T.prototype.isBarColorerPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_BAR_COLORER},T.prototype.isBgColorerPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_BG_COLORER},T.prototype.isPlotShapesPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_SHAPES},T.prototype.isPlotCharsPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_CHARS},T.prototype.isPlotArrowsPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_ARROWS},T.prototype.isOHLCBarsPlot=function(t){var e=this._metaInfo.plots[t].target,i=this.metaInfo().defaults.ohlcPlots[e];return i&&this.isOHLCSeriesPlot(t)&&i.plottype===ht.OHLC_TYPE_BARS},T.prototype.isOHLCCandlesPlot=function(t){var e=this._metaInfo.plots[t].target,i=this.metaInfo().defaults.ohlcPlots[e];return i&&this.isOHLCSeriesPlot(t)&&i.plottype===ht.OHLC_TYPE_CANDLES},T.prototype.isOHLCSeriesPlot=function(t){var e=this._metaInfo.plots[t].type;return e===ht.PLOT_TYPE_OHLC_OPEN||e===ht.PLOT_TYPE_OHLC_HIGH||e===ht.PLOT_TYPE_OHLC_LOW||e===ht.PLOT_TYPE_OHLC_CLOSE},T.prototype.isOHLCOpenPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_OHLC_OPEN},T.prototype.isOHLCHighPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_OHLC_HIGH},T.prototype.isOHLCLowPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_OHLC_LOW},T.prototype.isOHLCClosePlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_OHLC_CLOSE},T.prototype.isOHLCColorerPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_OHLC_COLORER},T.prototype.isDataOffsetPlot=function(t){return this._metaInfo.plots[t].type===ht.PLOT_TYPE_DATAOFFSET},T.prototype.hasBarColorer=function(){for(var t=0;t<this._metaInfo.plots.length;++t)if(this.isBarColorerPlot(t))return!0;return!1},T.prototype.barColorer=function(){var t,e,i=null;for(t=0;t<this._metaInfo.plots.length;++t)this.isBarColorerPlot(t)&&(e=new C(this,t),null==i?i=e:i.pushBackBarColorer(e));if(null==i)throw Error("Cannot create BarColorer: study doesn't have a bar_colorer plot!");return i},T.prototype.base=function(){return"Volume"===this._metaInfo.id?1:0},T.prototype._createFormatter=function(){var t,e,i;"default"===this.properties().precision.value()?this.metaInfo().defaults&&(t=parseInt(this.metaInfo().defaults.precision)):t=parseInt(this.properties().precision.value()),isFinite(t)||(t=["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(this._metaInfo.id)!==-1?0:1e4),e=this.series().symbolInfo(),0===t?(i=0,e&&(i=e.volume_precision?e.volume_precision:e.has_fractional_volume?2:0),this._formatter=new st(i)):this._formatter=new nt(Math.pow(10,t)),this.priceScale()&&this.priceScale().updateFormatter()},T.prototype.formatter=function(){return this._formatter},T.prototype.nearestIndex=function(t,e){if(!TradingView.isInteger(t))return void TradingView.logDebugChart("Study.nearestIndex: incorrect logicalPoint");var i=this._series.data().bars().search(t,e);return i?i.index:void 0},T.prototype.updateAllViews=function(){var t;for(t=0;t<this._paneViews.length;t++)this._paneViews[t].update();for(this._dataWindowView.update(),this._statusView.update(),t=0;t<this._priceAxisViews.length;t++)this._priceAxisViews[t].update()},T.prototype.tags=function(){return!this._metaInfo||!this._metaInfo.description||this._metaInfo.isTVScriptStub||this._metaInfo.is_hidden_study||this._metaInfo.isTVScript&&"tv-scripting"===this._metaInfo.productId?[]:[this._metaInfo.description]},T.isPointsBasedStudy=function(t){switch(t){case"VbPFixed@tv-volumebyprice":case"mtp_tsanalysis@mtp-mtpredictor":case"mtp_riskreward@mtp-mtpredictor":case"mtp_decisionpoint@mtp-mtpredictor":case"mtp_ew_main@mtp-mtpredictor":case"mtp_ew_major@mtp-mtpredictor":case"mtp_ew_minor@mtp-mtpredictor":case"mtp_wpt_down1ora@mtp-mtpredictor":case"mtp_wpt_down2orb@mtp-mtpredictor":case"mtp_wpt_down3@mtp-mtpredictor":case"mtp_wpt_down4@mtp-mtpredictor":case"mtp_wpt_down5@mtp-mtpredictor":case"mtp_wpt_downc@mtp-mtpredictor":case"mtp_wpt_up1ora@mtp-mtpredictor":case"mtp_wpt_up2orb@mtp-mtpredictor":case"mtp_wpt_up3@mtp-mtpredictor":case"mtp_wpt_up4@mtp-mtpredictor":case"mtp_wpt_up5@mtp-mtpredictor":case"mtp_wpt_upc@mtp-mtpredictor":return!0;default:return!1}},T.lineToolNameForPointsBasedStudy=function(t){switch(t){case"VbPFixed@tv-volumebyprice":return"LineToolVbPFixed";case"RegressionTrend@tv-basicstudies":return"LineToolRegressionTrend";case"mtp_tsanalysis@mtp-mtpredictor":return"LineStudyMtpAnalysis";case"mtp_riskreward@mtp-mtpredictor":return"LineStudyMtpRiskReward";case"mtp_decisionpoint@mtp-mtpredictor":return"LineStudyMtpDecisionPoint";case"mtp_ew_main@mtp-mtpredictor":return"LineStudyMtpElliotWaveMain";case"mtp_ew_major@mtp-mtpredictor":return"LineStudyMtpElliotWaveMajor";case"mtp_ew_minor@mtp-mtpredictor":return"LineStudyMtpElliotWaveMinor";case"mtp_wpt_down1ora@mtp-mtpredictor":return"LineStudyMtpDownWave1OrA";case"mtp_wpt_down2orb@mtp-mtpredictor":return"LineStudyMtpDownWave2OrB";case"mtp_wpt_down3@mtp-mtpredictor":return"LineStudyMtpDownWave3";case"mtp_wpt_down4@mtp-mtpredictor":return"LineStudyMtpDownWave4";case"mtp_wpt_down5@mtp-mtpredictor":return"LineStudyMtpDownWave5";case"mtp_wpt_downc@mtp-mtpredictor":return"LineStudyMtpDownWaveC";case"mtp_wpt_up1ora@mtp-mtpredictor":return"LineStudyMtpUpWave1OrA";case"mtp_wpt_up2orb@mtp-mtpredictor":return"LineStudyMtpUpWave2OrB";case"mtp_wpt_up3@mtp-mtpredictor":return"LineStudyMtpUpWave3";case"mtp_wpt_up4@mtp-mtpredictor":return"LineStudyMtpUpWave4";case"mtp_wpt_up5@mtp-mtpredictor":return"LineStudyMtpUpWave5";case"mtp_wpt_upc@mtp-mtpredictor":return"LineStudyMtpUpWaveC";default:throw Error("There is no line tool name, associated with study id "+t)}},T.isStudyLineTool=function(t){var e=i(165).StudyLineDataSource,o=TradingView[t];return"function"==typeof o&&o.prototype instanceof e},T.prototype.onExtendedHoursChanged=function(){this.restart()},T.prototype.hasSymbolInputs=function(){for(var t=this._metaInfo.inputs.length;t--;)if("symbol"===this._metaInfo.inputs[t].type)return!0;return!1},T.prototype._subscribeExtendedHours=function(){!this._isSubscribedToExtendedHours&&this.hasSymbolInputs()&&(this._series.extendedHours.listeners().subscribe(this,this.onExtendedHoursChanged),this._isSubscribedToExtendedHours=!0)},T.prototype._unsubscribeExtendedHours=function(){this._isSubscribedToExtendedHours&&(this._series.extendedHours.listeners().unsubscribe(this,this.onExtendedHoursChanged),delete this._isSubscribedToExtendedHours)},T.prototype.removeByRemoveAllStudies=function(){return!0},T.prototype.canHaveChildren=function(){return void 0===this._canHaveChildren&&(this._canHaveChildren=!!lt.canHaveChildren(this._metaInfo)),this._canHaveChildren},T.getInputRebindType=function(t,e,i){var o=lt.isSourceInput(t);return o&&!~e.indexOf("$")&&~i.indexOf("$")?TradingView.ChartApiInterface.REBIND_STUDY_STANDALONE_TO_CHILD:o&&~e.indexOf("$")&&!~i.indexOf("$")?TradingView.ChartApiInterface.REBIND_STUDY_CHILD_TO_STANDALONE:0},T.prototype.getPlotFields=function(){return this._plotFields},t.exports={Study:T,createStudy:l,prepareCallStudyArgs:m,prepareStudyProperties:h,prepareStudyPropertiesForLoadChart:d,prepareStudyPropsStateForLoadChart:_,shiftColor:S}}).call(e,i(83),i(34),i(1),i(103))},function(t,e,i){"use strict";function o(t,e){this._source=e,this._properties=t,this._points=[new a.Point(-1,-1)],this._invalidated=!0}function n(t){this._data=t}function s(t){this._source=t,this._points=[]}function r(t,e,i){this._source=t,this._points=[],d(e.type===c.FilledArea.TYPE_HLINES,"Wrong filledArea type: "+e.type),this._initBandIndexes(e.objAId,e.objBId),this._fillStyleProps=i}var a=i(30),l=i(122).HorzLineRenderer,h=i(113),c=i(139),d=i(140).assert,p=i(119);o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e=this._source.priceScale();if(!e||e.isEmpty())return void(this._points[0]=new a.Point(-1,-1));t=this._properties.value.value(),isNumber(t)?this._points[0]=new a.Point(-1,e.priceToCoordinate(t)):this._points[0]=new a.Point(-1,NaN)},o.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.points=this._points,t.color=this._properties.color.value(),t.linewidth=this._properties.linewidth.value(),t.linestyle=this._properties.linestyle.value(),t.hitTestResult=h.REGULAR,new l(t)},n.prototype.draw=function(t){var e,i,o;0!==this._data.points.length&&(e=t.canvas.width,t.fillStyle=p.generateColor(this._data.backcolor,this._data.transparency),i=Math.min(this._data.points[0],this._data.points[1]),o=Math.max(this._data.points[0],this._data.points[1]),t.fillRect(0,i,e,o-i))},n.prototype.hitTest=function(t){return null},s.prototype.update=function(){var t,e,i,o;this._points=[],t=this._source.properties().bandsBackground,t.fillBackground.value()&&(e=this._source.properties().bands[0],i=this._source.properties().bands[1],(o=this._source.priceScale())&&!o.isEmpty()&&(this._points.push(o.priceToCoordinate(e.value.value())),this._points.push(o.priceToCoordinate(i.value.value()))))},s.prototype.renderer=function(){var t={};return t.points=this._points,t.backcolor=this._source.properties().bandsBackground.backgroundColor.value(),t.transparency=this._source.properties().bandsBackground.transparency.value(),new n(t)},r.prototype._initBandIndexes=function(t,e){var i,o;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)o=this._source.metaInfo().bands[i],null!==this._bandAKey||o.id!==t?null!==this._bandBKey||o.id!==e||(this._bandBKey=i):this._bandAKey=i},r.prototype.update=function(){var t,e,i;this._points=[],this._fillStyleProps.visible.value()&&(t=this._source.properties().bands[this._bandAKey],e=this._source.properties().bands[this._bandBKey],(i=this._source.priceScale())&&!i.isEmpty()&&(this._points.push(i.priceToCoordinate(t.value.value())),this._points.push(i.priceToCoordinate(e.value.value()))))},r.prototype.renderer=function(){var t={};return t.points=this._points,t.backcolor=this._fillStyleProps.color.value(),t.transparency=this._fillStyleProps.transparency.value(),new n(t)},e.BandPaneView=o,e.BandBackgroundPaneView=s,e.HlineFillPaneView=r},function(t,e,i){"use strict";function o(t,e,i){this._study=t,this._model=e,this._plotIndex=i,this._text="",this._coordinate=0,this._background="black",this._color="white",this._invalidated=!0,this._cache=new n}var n=i(127),s=i(84),r=i(86);inherit(o,s),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){this._visible=!1,this._text="";var t=this._study.lastValueData(this._plotIndex);t.noData||(this._visible=!0,this._text=t.text,this._coordinate=t.coordinate,this._floatCoordinate=t.floatCoordinate,this._background!==t.color&&(this._background=t.color,this._color=this.color()))},o.prototype.coordinate=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),s.prototype.coordinate.call(this)},o.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),new r({text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,visible:this._visible},this._cache)},o.prototype.text=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),s.prototype.text.call(this)},t.exports=o},function(t,e,i){"use strict";function o(t,e,i,o){var n,s;for(this.m_study=t,this.m_series=e,this.m_model=i,this._plotName=o,this.m_items=[],this._invalidated=!0,n=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._plotIndex=0,s=0;s<n.length;s++)n[s].id===this._plotName&&(this._plotIndex=s),this.m_study.isSelfColorerPlot(s)&&n[s].target===this._plotName&&(this._colorer=s,this._palette=this.m_study.metaInfo().palettes[n[s].palette],this._paletterProps=this.m_study.properties().palettes[n[s].palette])}function n(t,e,i,o){var n,s;for(this._study=t,this._series=e,this._model=i,this._plotName=o,this._items=[],this._invalidated=!0,n=this._study.metaInfo().plots,s=0;s<n.length;s++)n[s].id===this._plotName&&(this._plotIndex=s,F(this._study.isBgColorerPlot(s),"Plot '"+this._plotName+"' is not a background colorer!"))}function s(t,e,i,o){var n,s;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_items=[],this.m_invalidated=!0,this.m_plotIndex=null,n=this.m_study.metaInfo().plots,s=0;s<n.length;s++)if(n[s].id===this.m_plotName){this.m_plotIndex=s;break}for(n=this.m_study.metaInfo().plots,this._colorer=null,this._textColorer=null,this._palette=null,this._textPalette=null,this._paletterProps=null,this._textPaletterProps=null,this._plotIndex=0,s=0;s<n.length;s++)n[s].id===this.m_plotName&&(this._plotIndex=s),this.m_study.isSelfColorerPlot(s)&&n[s].target===this.m_plotName&&(this._colorer=s,this._palette=this.m_study.metaInfo().palettes[n[s].palette],this._paletterProps=this.m_study.properties().palettes[n[s].palette]),this.m_study.isTextColorerPlot(s)&&n[s].target===this.m_plotName&&(this._textColorer=s,this._textPalette=this.m_study.metaInfo().palettes[n[s].palette],this._textPaletterProps=this.m_study.properties().palettes[n[s].palette])}function r(t,e,i,o){s.call(this,t,e,i,o)}function a(t,e,i,o){r.call(this,t,e,i,o)}function l(t,e,i,o){s.call(this,t,e,i,o),this._maxAbsValue=0}function h(t,e,i,o){var n,s;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_bars=[],this._invalidated=!0,n=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._ohlcPlotIndexes={},s=0;s<n.length;s++)n[s].target===this.m_plotName&&(this.m_study.isOHLCOpenPlot(s)&&(this._ohlcPlotIndexes[TradingView.OPEN_PLOT]=s),this.m_study.isOHLCHighPlot(s)&&(this._ohlcPlotIndexes[TradingView.HIGH_PLOT]=s),this.m_study.isOHLCLowPlot(s)&&(this._ohlcPlotIndexes[TradingView.LOW_PLOT]=s),this.m_study.isOHLCClosePlot(s)&&(this._ohlcPlotIndexes[TradingView.CLOSE_PLOT]=s),this.m_study.isOHLCColorerPlot(s)&&(this._colorer=s,this._palette=this.m_study.metaInfo().palettes[n[s].palette],this._paletterProps=this.m_study.properties().palettes[n[s].palette]))}function c(t,e,i,o){h.call(this,t,e,i,o)}function d(t,e,i,o){h.call(this,t,e,i,o)}var p=i(113),u=i(112),_=u.SelectionRenderer,f=u.SelectionRendererArrowsUpDown,m=i(114),g=m.PaneRendererBars,v=m.PaneRendererHistogram,y=m.PaneRendererColumns,b=m.PaneRendererLine,w=m.PaneRendererArea,S=m.PaneRendererCandles,T=m.PaneRendererCross,C=m.PaneRendererCircles,x=m.PaneRendererArrowsUpDownItem,P=m.PaneRendererArrowsUpDown,L=m.PaneRendererUnicodeChar,k=m.PaneRendererBackground,I=i(116),E=i(117),A=i(118),V=i(30),M=i(85),$=M.RGBColor,D=M.rgbToHsl,O=M.hslToRgb,B=i(175).StudyConsts,R=i(175).StudyPlotShapes,N=i(176),F=i(140).assert,W=i(119);o.isIndexValid=function(t,e){return t>=0&&t<e._length()},o.prototype.items=function(){return this.m_items},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,n,s,r,a,l,h,c,d,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,M,$,D,O,R;if(this._histogramBase=null,this.m_items=[],!this.m_model.timeScale().isEmpty()&&!this.m_study.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars().clone(),!t.isEmpty())){if(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),n=this.m_study.offset(this._plotName),n>0?(e-=n,i+=n):(e+=n,i-=n),s=this.m_study.properties().styles[this._plotName].plottype.value(),r=[B.PLOT_LINE,B.PLOT_AREA,B.PLOT_CIRCLES,B.PLOT_CROSS].indexOf(s)>=0,a=this.m_study.data(),l=this.m_study.firstValue(),r&&a._length()>0){for(h=a._bsearch(e);o.isIndexValid(h,a)&&void 0===a._valueAt(h)[this._plotIndex+1];)h-=1;for(e=o.isIndexValid(h,a)?a._indexAt(h):e,c=a._bsearch(i);o.isIndexValid(c,a)&&void 0===a._valueAt(c)[this._plotIndex+1];)c+=1;i=o.isIndexValid(c,a)?a._indexAt(c):i}for(d=a.range(e,i),u=this.m_study.priceScale(),_=u.properties().percentage.value(),f=this._getTranspValue(),m={},g=function(t,e){var i=t+"@"+e;return m[i]||(this._plotName&&"vol"===this._plotName?m[i]=W.generateColor(t,e):m[i]=W.generateColor(t,e,!0)),m[i]}.bind(this),v=d._start;v<d._end;++v)y=d._indexAt(v),y+=n,y=Math.floor(y),b=d._valueAt(v),w=b[this._plotIndex+1],S=void 0===w||null===w,w=S?NaN:w,_&&!S&&(w=100*(w-l)/l),r&&S||(T=new V.Point(y,w),C=void 0!==b[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&C&&(w=b[this._colorer+1],T.style={},x=this.m_study.properties().styles[this._plotName],void 0!==w&&null!==w?(P=this._palette.valToIndex?this._palette.valToIndex[w]:w,L=this._paletterProps.colors[P],k=L.color.value(),T.style.color=W.isHexColor(k)?g(k,f):k):(k=x.color.value(),T.style.color=g(k,100)),I=void 0!==P?L.width.value():x.linewidth.value(),E=void 0!==P?L.style.value():x.linestyle.value(),T.style.width=I,T.style.style=E),this.m_items.push(T));if(u.pricesToCoordinates(this.m_items),this.m_model.timeScale().indexesToCoordinates(this.m_items),this.m_study.properties().styles[this._plotName].histogramBase&&(this._histogramBase=this.m_study.priceScale().priceToCoordinate(this.m_study.properties().styles[this._plotName].histogramBase.value())),this.m_study===this.m_model.selectedSource())for(M=A(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=p.REGULAR,v=0;v<M.length;v++)y=M[v],b=this.m_study.data().valueAt(y),y+=n,void 0!==b&&(w=b[this._plotIndex+1],u.properties().percentage.value()&&(w=100*(w-l)/l),$=this.m_model.timeScale().indexToCoordinate(Math.floor(y)),D=this.m_study.priceScale().priceToCoordinate(w),this._selectionData.points.push(new V.Point($,D)));O=this.m_study.properties().styles[this._plotName],this._lineColor=W.generateColor(O.color.value(),f),this._lineWidth=O.linewidth.value(),R=O.color.value(),this._colorer&&(R=this._paletterProps.colors[0].color.value(),this._lineWidth=this._paletterProps.colors[0].width.value(),this._lineColor=W.generateColor(this._paletterProps.colors[0].color.value(),f)),this._color2=W.generateColor(R,f),this._color1=W.generateColor(o.addHueForColor(R),f)}},o.addHueForColor=N(function(t){var e,i=new $(t),o=D(i.r,i.g,i.b),n=o[0]+.05;return o[0]=n-Math.floor(n),e=O(o[0],o[1],o[2]),i.r=e[0],i.g=e[1],i.b=e[2],i.toHex()}),o.prototype._getTranspValue=function(){var t=this.m_study.properties(),e=t.styles[this._plotName],i=0,o=0,n=this.m_study.metaInfo();return"Volume@tv-basicstudies"===n.id&&n.version<=46&&"transparency"in t?(i=t.transparency.value(),i=isNumber(i)?i:o):(e.transparency&&(i=e.transparency.value(),i=isNumber(i)?i:o),i)},o.prototype.renderer=function(){var t,e,i,o,n=this.m_study.properties().styles[this._plotName];if(n.visible.value()&&this.m_study.priceScale()){switch(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.barSpacing=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.histogramBase=this._histogramBase?this._histogramBase:this.m_study.priceScale().height(),t.lineIndex=0,t.lineStyle=n.linestyle.value(),t.lineColor=this._lineColor,t.lineWidth=this._lineWidth,t.lineWidth=isNumber(t.lineWidth)?t.lineWidth:1,t.color1=this._color1,t.color2=this._color2,t.bottom=t.histogramBase,this._colorer||(t.simpleMode=!0),e=new E,i=!!n.joinPoints&&n.joinPoints.value(),n.plottype.value()){case B.PLOT_LINE:case B.PLOT_LINE_WITH_BREAKS:e.append(new b(t));break;case B.PLOT_AREA:case B.PLOT_AREA_WITH_BREAKS:e.append(new w(t));break;case B.PLOT_HISTOGRAM:e.append(new v(t));break;case B.PLOT_COLUMNS:e.append(new y(t));break;case B.PLOT_CROSS:e.append(new T(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.forceLineWidth=!0,e.append(new b(o)));break;case B.PLOT_CIRCLES:e.append(new C(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.ignorePaletteLineWidth=!0,e.append(new b(o)));break;default:e.append(new b(t))}return this.m_study===this.m_model.selectedSource()&&e.append(new _(this._selectionData)),e}},n.prototype.items=function(){return this._items},n.prototype.update=function(){this._invalidated=!0},n.prototype._scalesReady=function(){var t=this._model.timeScale(),e=this._study.priceScale();return t&&e&&!t.isEmpty()&&!e.isEmpty()},n.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v;if(this._items=[],F(this._scalesReady(),"Scales must be ready!"),t=this._model.timeScale().visibleBars().clone(),!t.isEmpty()){for(e=this._study.metaInfo().plots,i=e[this._plotIndex].palette,o=this._study.properties().palettes[i],n=o.colors,s=this._study.metaInfo().palettes[i],r=this._study.properties().styles[this._plotName].transparency.value(),a=this._series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),l=this._series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),h=this._study.offset(this._plotName),h>0?(a-=h,l+=h):(a+=h,l-=h),c=this._study.data(),d=c.range(a,l),p=d._start;p<d._end;++p)u=d._indexAt(p),u+=h,_=d._valueAt(p),f=_[this._plotIndex+1],m=new V.Point(Math.floor(u)-.5),g=isNumber(r)?r:50,g=Math.min(g,100),g=Math.max(g,0),void 0!==f&&null!==f?(v=s.valToIndex?s.valToIndex[f]:f,m.color=W.generateColor(n[v].color.value(),g)):m.color=null,this._items.push(m);this._model.timeScale().indexesToCoordinates(this._items)}},n.prototype.renderer=function(){var t,e;if(this._study.properties().styles[this._plotName].visible&&this._study.properties().styles[this._plotName].visible.value()&&this._scalesReady())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={items:this._items,y:0,h:this._study.priceScale().height(),w:Math.ceil(this._model.timeScale().barSpacing())},e=new E,e.append(new k(t)),e},s.prototype.items=function(){return this.m_items},s.prototype.update=function(){this.m_invalidated=!0},s.prototype._scalesReady=function(){var t=this.m_model.timeScale(),e=this.m_study.priceScale();return t&&e&&!t.isEmpty()&&!e.isEmpty()},s.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I;if(this.m_items=[],this._scalesReady()&&(t=this.m_model.timeScale(),e=this.m_study.priceScale(),i=t.visibleBars().clone(),!i.isEmpty())){for(o=this.m_series.nearestIndex(i.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),n=this.m_series.nearestIndex(i.lastBar(),TradingView.SEARCH_NEAREST_LEFT),s=this.m_study.offset(this.m_plotName),s>0?(o-=s,n+=s):(o+=s,n-=s),r=this.m_study.data(),a=this.m_study.firstValue(),l=r.range(o,n),h=e.properties().percentage.value(),c=this._getTranspValue(),d=A(o,n),u=this.m_study===this.m_model.selectedSource(),u&&(this.m_selectionData={points:[],hittestResult:p.REGULAR,vertOffset:0}),_=this.m_series.properties().style.value(),f=_===TradingView.Series.STYLE_LINE?"lineStyle":_===TradingView.Series.STYLE_AREA?"areaStyle":null,f?(m=this.m_series.properties()[f].priceSource.value(),g=m):(m="high",g="low"),this._topCoord=e.coordinateToPrice(e.height()*e.topMargin()),this._bottomCoord=e.coordinateToPrice(e.height()*(1-e.bottomMargin())),v=l._start;v<l._end;++v)y=l._indexAt(v),b=Math.floor(y+s),w=l._valueAt(v),null!==(S=w[this.m_plotIndex+1])&&void 0!==S&&void 0!==(T=this._createItem(b,S,m,g,h,a))&&null!==T&&(C=void 0!==w[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&C&&(S=w[this._colorer+1],T.style={},void 0!==S&&null!==S?(P=this._palette.valToIndex?this._palette.valToIndex[S]:S,x=this._paletterProps.colors[P].color.value(),T.style.color=W.generateColor(x,c)):(x=this.m_study.properties().styles[this.m_plotName].color.value(),T.style.color=W.generateColor(x,100)),L=c>9?c-10:0,T.style.borderColor=W.generateColor(x,L)),k=void 0!==w[this._textColorer+1]||this._textPalette&&this._textPalette.addDefaultColor,this._textColorer&&k&&(S=w[this._textColorer+1],T.style||(T.style={}),void 0!==S&&null!==S?(P=this._textPalette.valToIndex?this._textPalette.valToIndex[S]:S,I=this._textPaletterProps.colors[P].color.value(),T.style.textColor=W.generateColor(I,c)):(I=this.m_study.properties().styles[this.m_plotName].textColor.value(),T.style.textColor=W.generateColor(I,100))),u&&d.indexOf(y)!==-1&&this.m_selectionData.points.push(T),this.m_items.push(T));this._convertItemsToCoordinates()}},s.prototype._getSeriesVal=function(t,e){var i;t=t||"close",i=null;try{i=this.m_series[t](e)}catch(t){}return i},s.prototype._getTranspValue=function(){var t,e=0;return this.m_study.properties().transparency&&(e=this.m_study.properties().transparency.value(),e=isNumber(e)?e:50),t=this.m_study.properties().styles[this.m_plotName],t.transparency&&(e=t.transparency.value(),e=isNumber(e)?e:50),e},s.prototype._createItem=function(t,e,i,o,n,s){var r,a,l,h=this.m_study.properties().styles[this.m_plotName].location.value();if(!e&&h!==CanvasEx.MARKLOC_ABSOLUTE)return null;switch(h){case CanvasEx.MARKLOC_ABOVEBAR:if(void 0===(r=this._getSeriesVal(i,t))||null==r)return null;a=r;break;case CanvasEx.MARKLOC_BELOWBAR:if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l;break;case CanvasEx.MARKLOC_TOP:a=this._topCoord;break;case CanvasEx.MARKLOC_BOTTOM:a=this._bottomCoord;break;case CanvasEx.MARKLOC_ABSOLUTE:a=e;break;default:throw Error("Bad value: "+h)}return n&&h!==CanvasEx.MARKLOC_TOP&&h!==CanvasEx.MARKLOC_BOTTOM&&(a=100*(a-s)/s),new V.Point(t,a)},s.prototype._convertItemsToCoordinates=function(){var t=this.m_model.timeScale(),e=this.m_study.priceScale();t.indexesToCoordinates(this.m_items),e.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e})},s.prototype._calculateVerticalOffset=function(t,e){var i=0;switch(t){case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BOTTOM:i=-e;break;case CanvasEx.MARKLOC_BELOWBAR:case CanvasEx.MARKLOC_TOP:i=e}return i},s.prototype._calculateShapeHeight=function(t,e){var i=t;switch(e){case CanvasEx.SIZE_TINY:i=.3*t;break;case CanvasEx.SIZE_SMALL:i=.6*t;break;case CanvasEx.SIZE_NORMAL:i=t;break;case CanvasEx.SIZE_LARGE:i=1.5*t;break;case CanvasEx.SIZE_HUGE:i=2*t}return i},s.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),n=this._calculateShapeHeight(o),s=this.m_study.properties().styles[this.m_plotName].location.value(),r=this._calculateVerticalOffset(s,n+n/2),e.barSpacing=o,e.items=this.m_items,e.color=W.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),i),e.height=n,e.vertOffset=r,a=this.m_study.properties().styles[this.m_plotName].plottype.value(),l=R.Data[a],h=new E,l&&h.append(new TradingView[l.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=r,h.append(new _(this.m_selectionData))),h},inherit(r,s),r.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,f,m,g,v,y,b,w=this.m_study.properties().styles[this.m_plotName];if(w.visible&&w.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),w.size?(s=w.size.value(),n=this._calculateShapeHeight(25,s)):n=Math.round(o/2),r=w.location.value(),a=W.generateColor(w.color.value(),i),l=i>19?i-10:0,h=this._calculateVerticalOffset(r,Math.round(1.5*n)),e.barSpacing=o,e.items=this.items(),e.color=a,e.borderColor=W.generateColor(w.color.value(),l),e.height=n,e.vertOffset=h,c=w.plottype.value(),d=R.Data[c],p=new E,u=w.text?w.text.value():void 0,void 0!==u&&""!==u.trim()&&(f=u.trim().replace(/\\n/gm,"\n"),f=TradingView.cleanButAmpersand(f,!0),m=!1,g=!1,v="Arial",y=12,e.textCache=new I(f,m,g,v,y),b=w.textColor?w.textColor.value():void 0,e.textColor=b?W.generateColor(b,i):a),null!=d&&p.append(new TradingView[d.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=h,p.append(new _(this.m_selectionData))),p},inherit(a,r),a.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,f,m,g,v=this.m_study.properties().styles[this.m_plotName];if(v.visible&&v.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),v.size?(s=v.size.value(),n=this._calculateShapeHeight(50,s)):n=Math.round(o),r=v.location.value(),a=W.generateColor(v.color.value(),i),l=this._calculateVerticalOffset(r,n),e.items=this.items(),e.char=v.char.value(),e.height=n,e.vertOffset=l,e.color=a,h=new E,c=v.text?v.text.value():void 0,void 0!==c&&""!==c.trim()&&(d=c.trim().replace(/\\n/gm,"\n"),d=TradingView.cleanButAmpersand(d,!0),p=!1,u=!1,f="Arial",m=12,e.textCache=new I(d,p,u,f,m),g=v.textColor?v.textColor.value():void 0,e.textColor=g?W.generateColor(g,i):a),h.append(new L(e)),this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=l,h.append(new _(this.m_selectionData))),h},inherit(l,s),l.prototype.renderer=function(){var t,e,i,o,n;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),t={},e=this._getTranspValue(),i=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.barSpacing=i,t.colorup=W.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),e),t.colordown=W.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),e),t.colorBorder=W.generateColor("#000000",e),t.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value(),t.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value(),o=new E,o.append(new P(t)),this.m_study===this.m_model.selectedSource()&&(n=this.m_selectionData,n.barSpacing=i,o.append(new f(n))),o},l.prototype._createItem=function(t,e,i,o,n,s){var r,a,l,h;if(0!==e){if(Math.abs(e)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(e)),r=e>0){if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l}else{if(void 0===(h=this._getSeriesVal(i,t))||null==h)return null;a=h}return n&&(a=100*(a-s)/s),new x(t,a,e,r)}},l.prototype._convertItemsToCoordinates=function(){var t,e,i,o,n,s,r,a,l,h=this.m_model.timeScale(),c=this.m_study.priceScale();for(h.indexesToCoordinates(this.m_items),c.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e}),t=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value()),e=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value()),t>e&&(i=t,t=e,e=i),o=e-t,n=o/this._maxAbsValue,s=this.m_items,r=0;r<s.length;r++)a=s[r],l=Math.abs(a.height),a.height=l*n+t},h.prototype.update=function(){this._invalidated=!0},h.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,M,B,R,N,F;if(this.m_bars.length=0,!this.m_model.timeScale().isEmpty()&&!this.m_study.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars().clone(),!t.isEmpty())){for(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),o=this.m_study.data(),n=this.m_study.firstValue(),s=o.range(e,i),r=this.m_study.priceScale(),a=r.properties().percentage.value(),l=0,h=this.m_study.properties().ohlcPlots[this.m_plotName],c={},d=function(t,e){var i=t+"@"+e;return c[i]||(c[i]=W.generateColor(t,e)),c[i]},u=s._start;u<s._end;++u){for(_=s._indexAt(u),_=Math.floor(_),f=s._valueAt(u),m=!0,g={},v=TradingView.OPEN_PLOT;v<=TradingView.CLOSE_PLOT;++v){if(void 0===(y=f[this._ohlcPlotIndexes[v]+1])||null===y){m=!1;break}g[v]=y}m&&(b=g[TradingView.OPEN_PLOT],w=g[TradingView.CLOSE_PLOT],S=Math.max(b,g[TradingView.HIGH_PLOT],g[TradingView.LOW_PLOT],w),T=Math.min(b,g[TradingView.HIGH_PLOT],g[TradingView.LOW_PLOT],w),C={},C.time=Math.round(_),a?(C.open=100*(b-n)/n,C.high=100*(S-n)/n,C.low=100*(T-n)/n,C.close=100*(w-n)/n):(C.open=b,C.high=S,C.low=T,C.close=w),x=h.color.value(),P=void 0!==f[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&P&&void 0!==(y=f[this._colorer+1])&&null!==y&&(L=this._palette.valToIndex?this._palette.valToIndex[y]:y,k=this._paletterProps.colors[L],x=k.color.value()),C.color=d(x,l),I=new $(x),E=D(I.r,I.g,I.b),M=E[2]>.25?E[2]-.26:E[2]+.75,B=O(E[0],E[1],M),I.r=B[0],I.g=B[1],I.b=B[2],C.borderColor=d(I.toHex(),l),C.hollow=null,this.m_bars.push(C))}if(r.barPricesToCoordinates(this.m_bars),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_study===this.m_model.selectedSource())for(R=A(e,i),this._selectionData={points:[],hittestResult:p.REGULAR},u=0;u<R.length;u++)_=R[u],void 0!==(f=this.m_study.data().valueAt(_))&&(y=f[this._plotIndex+1],r.properties().percentage.value()&&(y=100*(y-n)/n),N=this.m_model.timeScale().indexToCoordinate(Math.floor(_)),F=this.m_study.priceScale().priceToCoordinate(y),this._selectionData.points.push(new V.Point(N,F)))}},h.prototype.items=function(){return this.m_bars},inherit(c,h),c.prototype.renderer=function(){var t,e;if(this.m_study.properties().ohlcPlots[this.m_plotName].visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value(),e=new E,e.append(new g(t)),this.m_series===this.m_model.selectedSource()&&e.append(new _(this._selectionData)),e},inherit(d,h),d.prototype.renderer=function(){var t,e,i,o=this.m_study.properties().ohlcPlots[this.m_plotName];if(o.visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=o.drawWick.value(),t.drawBorder=o.drawBorder.value(),e=o.wickColor.value(),t.borderColor=e,t.wickColor=e,i=new E,i.append(new S(t)),this.m_series===this.m_model.selectedSource()&&i.append(new _(this._selectionData)),i},e.StudyPaneView=o,e.StudyBackgroundPaneView=n,e.StudyPlotShapesPaneView=r,e.StudyPlotCharsPaneView=a,e.StudyPlotArrowsPaneView=l,e.StudyPlotCandlesPaneView=d,e.StudyPlotBarsPaneView=c},function(t,e,i){var o={PLOT_TYPE_LINE:"line",PLOT_TYPE_COLORER:"colorer",PLOT_TYPE_BAR_COLORER:"bar_colorer",PLOT_TYPE_BG_COLORER:"bg_colorer",PLOT_TYPE_TEXT_COLORER:"text_colorer",PLOT_TYPE_OHLC_COLORER:"ohlc_colorer",PLOT_TYPE_SHAPES:"shapes",PLOT_TYPE_CHARS:"chars",PLOT_TYPE_ARROWS:"arrows",PLOT_TYPE_DATAOFFSET:"dataoffset",PLOT_TYPE_OHLC_OPEN:"ohlc_open",PLOT_TYPE_OHLC_HIGH:"ohlc_high",PLOT_TYPE_OHLC_LOW:"ohlc_low",PLOT_TYPE_OHLC_CLOSE:"ohlc_close",OHLC_TYPE_BARS:"ohlc_bars",OHLC_TYPE_CANDLES:"ohlc_candles",PLOT_LINE:0,PLOT_HISTOGRAM:1,PLOT_CROSS:3,PLOT_AREA:4,PLOT_COLUMNS:5,PLOT_CIRCLES:6,PLOT_LINE_WITH_BREAKS:7,PLOT_AREA_WITH_BREAKS:8,SCALE_RIGHT:0,SCALE_LEFT:1,SCALE_NONE:2},n={};n.Data={},n.registerPlotShape=function(t,e,i,o){if(t in n.Data)throw Error("Plot shape "+t+" already registered!");n.Data[t]={id:t,pineName:e,guiName:i,paneRendererClass:o}},n.SHAPE_CROSS="shape_cross",n.SHAPE_XCROSS="shape_xcross",n.SHAPE_CIRCLE="shape_circle",n.SHAPE_TRIANGLE_UP="shape_triangle_up",n.SHAPE_TRIANGLE_DOWN="shape_triangle_down",n.SHAPE_FLAG="shape_flag",n.SHAPE_ARROW_UP="shape_arrow_up",n.SHAPE_ARROW_DOWN="shape_arrow_down",n.SHAPE_SQUARE="shape_square",n.SHAPE_DIAMOND="shape_diamond",n.SHAPE_LABEL_UP="shape_label_up",n.SHAPE_LABEL_DOWN="shape_label_down",n.registerPlotShape(n.SHAPE_CROSS,"shape.cross","Cross","PaneRendererCrossShape"),n.registerPlotShape(n.SHAPE_XCROSS,"shape.xcross","X Cross","PaneRendererXCross"),n.registerPlotShape(n.SHAPE_CIRCLE,"shape.circle","Circle","PaneRendererCircleShape"),n.registerPlotShape(n.SHAPE_TRIANGLE_UP,"shape.triangleup","Triangle Up","PaneRendererTriangleApexUp"),n.registerPlotShape(n.SHAPE_TRIANGLE_DOWN,"shape.triangledown","Triangle Down","PaneRendererTriangleApexDown"),n.registerPlotShape(n.SHAPE_FLAG,"shape.flag","Flag","PaneRendererFlagShape"),n.registerPlotShape(n.SHAPE_ARROW_UP,"shape.arrowup","Arrow Up","PaneRendererArrowUp"),n.registerPlotShape(n.SHAPE_ARROW_DOWN,"shape.arrowdown","Arrow Down","PaneRendererArrowDown"),n.registerPlotShape(n.SHAPE_SQUARE,"shape.square","Square","PaneRendererSquare"),n.registerPlotShape(n.SHAPE_DIAMOND,"shape.diamond","Diamond","PaneRendererDiamond"),n.registerPlotShape(n.SHAPE_LABEL_UP,"shape.labelup","Label Up","PaneRendererLabelUp"),n.registerPlotShape(n.SHAPE_LABEL_DOWN,"shape.labeldown","Label Down","PaneRendererLabelDown"),TradingView.StudyConsts=o,TradingView.StudyPlotShapes=n,e.StudyConsts=o,e.StudyPlotShapes=n},function(t,e){"use strict";function i(t,e){var i=function i(o){var n=i.cache,s=""+(e?e.apply(this,arguments):o);return n.hasOwnProperty(s)||(n[s]=t.apply(this,arguments)),n[s]};return i.cache={},i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,t.exports=e.default},function(t,e,i){"use strict";function o(t){this._data=t}function n(t){this._source=t,this._points1=[],this._points2=[],this._timePoints=[],this._getBarSpacing=t.model().timeScale().barSpacing.bind(t.model().timeScale()),this._invalidated=!0}function s(t){n.call(this,t)}function r(t,e,i){var o,s;if(n.call(this,t),this._isHlineFill=e.type===h.FilledArea.TYPE_HLINES,c(this._isHlineFill||e.type===h.FilledArea.TYPE_PLOTS,"Wrong filledArea type: "+e.type),this._isHlineFill&&this._initBandIndexes(e.objAId,e.objBId),this._fillMetaInfo=e,this._fillStyleProps=i,o=t._metaInfo,e.palette)for(s in o.plots)if(o.plots[s].palette===e.palette){this._colorPlotOffset=parseInt(s),this._colorsMap=o.palettes[e.palette].valToIndex,this._colorValues=t.properties().palettes[e.palette].colors;break}}var a=i(113),l=i(115),h=i(139),c=i(140).assert,d=i(119);o.prototype.hitTest=function(t){var e,i,o;for(o=1;o<this._data.points1.length;++o)if(e=this._data.points1[o],i=this._data.points2[o],this._data.timePoints[o]===t.x&&(t.y>=e&&t.y<=i||t.y<=e&&t.y>=i))return new a(a.REGULAR);return null},o.prototype.draw=function(t){var e,i,o,n,s,r,a,h,c,p,u,_,f,m,g,v,y,b,w=this._data.isHlineFill;if(w||0!==this._data.points1.length&&0!==this._data.points2.length){for(e=this._data.timePoints,i=this._data.points1,o=this._data.points2,n=this._data.colors,s=l.paneRendererCoordinateIsValid,r=isNumber(this._data.transparency)?this._data.transparency:50,r=Math.min(r,100),r=Math.max(r,0),a={},h=[],p=0;p<this._data.timePoints.length;p++)u={point1:w?this._data.level1:i[p],point2:w?this._data.level2:o[p],timePoint:e[p]},_=s(u.point1)&&s(u.point2),_&&(c=n&&n[p]?n[p]:this._data.backcolor,h.push(u)),(p===this._data.timePoints.length-1||n&&c!==n[p+1]||!_)&&(h.length>0&&(f=a[c]||[],f.push(h),a[c]=f),h=_?[u]:[]);for(m in a){for(g=a[m],t.beginPath(),v=0;v<g.length;v++){for(y=g[v],t.moveTo(y[0].timePoint,y[0].point1),b=1;b<y.length;b++)t.lineTo(y[b].timePoint,y[b].point1);for(b=y.length-1;b>=0;b--)t.lineTo(y[b].timePoint,y[b].point2)}t.closePath(),t.fillStyle=d.generateColor(m,r),t.fill()}}},n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L;if(this._points1=[],this._points2=[],this._colorsMap&&(this._colors=[]),this._timePoints=[],this._visible()&&(t=this._source.priceScale(),e=this._source._model.timeScale(),t&&!t.isEmpty()&&!this._source._model.timeScale().isEmpty()&&!this._source._series.bars().isEmpty()&&(this._isHlineFill&&(i=this._source.properties().bands[this._bandAKey],o=this._source.properties().bands[this._bandBKey],this._level1=t.priceToCoordinate(i.value.value()),this._level2=t.priceToCoordinate(o.value.value())),n=this._source.data()._columns.indexOf(this._plotAId())+1,s=this._source.data()._columns.indexOf(this._plotBId())+1,r=this._source._model.timeScale().visibleBars(),!r.isEmpty()))){if(a=this._source._series.nearestIndex(r.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),l=this._source._series.nearestIndex(r.lastBar(),TradingView.SEARCH_NEAREST_LEFT),h=this._source.data().range(a,l),this._source.data()._items.length>0)for(c=this._source.firstValue(),d=h._start,p=h._end,u=this._source.offset(this._plotAId()),_=this._source.offset(this._plotBId()),f=Math.max(u,_),m=Math.min(u,_),g=d+f,v=0,d>v&&(g=d<f?f:d),y=p+m,b=h._items.length,p>b+m&&p<b&&(y=b+m),m<0&&p<=b+m&&(y=p),w=h._indexAt(d),g<d?w+=f:g>p?w+=f:w=h._indexAt(g),S=g;S<y;++S)this._timePoints.push(e.indexToCoordinate(w++)),this._colors&&void 0!==(T=h._valueAt(S-m)[this._colorPlotOffset+1])&&this._colors.push(this._colorValues[this._colorsMap[T]].color.value()),this._isHlineFill||(C=h._valueAt(S-u),x=h._valueAt(S-_),P=C[n],L=x[s],t.properties().percentage.value()&&(P=100*(P-c)/c,L=100*(L-c)/c),this._points1.push(P),this._points2.push(L));t.pricesArrayToCoordinates(this._points1),t.pricesArrayToCoordinates(this._points2)}},n.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={};return t.points1=this._points1,t.points2=this._points2,t.timePoints=this._timePoints,t.getBarSpacing=this._getBarSpacing,t.backcolor=this._color(),t.transparency=this._transparency(),t.isHlineFill=this._isHlineFill,t.level1=this._level1,t.level2=this._level2,this._colors&&(t.colors=this._colors),new o(t)},n.prototype._plotAId=function(){c(!1,"Pure virtual call!")},n.prototype._plotBId=function(){c(!1,"Pure virtual call!")},n.prototype._color=function(){c(!1,"Pure virtual call!")},n.prototype._transparency=function(){c(!1,"Pure virtual call!")},n.prototype._visible=function(){c(!1,"Pure virtual call!")},inherit(s,n),s.prototype._plotAId=function(){return this._source.properties().area[0].name.value()},s.prototype._plotBId=function(){return this._source.properties().area[1].name.value()},s.prototype._color=function(){return this._source.properties().areaBackground.backgroundColor.value()},s.prototype._transparency=function(){return this._source.properties().areaBackground.transparency.value()},s.prototype._visible=function(){return this._source.properties().areaBackground.fillBackground.value()},inherit(r,n),r.prototype._initBandIndexes=function(t,e){var i,o;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)o=this._source.metaInfo().bands[i],null!==this._bandAKey||o.id!==t?null!==this._bandBKey||o.id!==e||(this._bandBKey=i):this._bandAKey=i},r.prototype._plotAId=function(){return this._fillMetaInfo.objAId},r.prototype._plotBId=function(){return this._fillMetaInfo.objBId},r.prototype._color=function(){return this._fillStyleProps.color.value()},r.prototype._transparency=function(){return this._fillStyleProps.transparency.value()},r.prototype._visible=function(){return this._fillStyleProps.visible.value()},e.PlotFillPaneView=r,e.AreaBackgroundPaneView=s},function(t,e,i){(function(t){"use strict";function o(t,e){var i,o,n,s,l;if(r.call(this),this._study=t,this._model=e,i=t.metaInfo().plots){for(o=0;o<i.length;++o)if(!(this._study.isSelfColorerPlot(o)||this._study.isBarColorerPlot(o)||this._study.isBgColorerPlot(o)||this._study.isDataOffsetPlot(o)||this._study.isOHLCColorerPlot(o))){if(n=i[o].id,"Compare@tv-basicstudies"===this._study.metaInfo().id)s=new a(this._study.inputsForGUI()[1],"");else{l=this._study.title();try{l=this._study.properties().styles[n].title.value()}catch(t){}s=new a(l,"")}s.plotId=n,s.plotIndex=o,this._items.push(s)}this.update(),this._invalidated=!0}}function n(t,e){o.call(this,t,e)}var s=i(109),r=s.DataWindowView,a=s.DataWindowItem,l=i(131);inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b=!0;for(this._header=this._study.title(b),this._title=this._study.title(),e=this._study.isVisible()?$.t("n/a"):"",i=0;i<this._items.length;++i)this._items[i].setValue(e);if(t.enabled("hide_last_na_study_output")&&this._items.length&&this._items[this._items.length-1].setValue(""),!this._model.timeScale().isEmpty()){if(o=this._study.metaInfo().plots,n=null,s={},o)for(i=0;i<o.length;i++)(this._study.isSelfColorerPlot(i)||this._study.isOHLCColorerPlot(i))&&(s[o[i].target]={index:i},s[o[i].target].palette=this._study.metaInfo().palettes[o[i].palette],s[o[i].target].paletterProps=this._study.properties().palettes[o[i].palette]);for(r=this._study.data().size()-1,a=this._model.crossHairSource().appliedIndex(),l=this._study.formatter(),i=0;i<this._items.length;++i)h=this._items[i],c=h.plotId,d=h.plotIndex,p=this._study.offset(c),void 0!==(u=isNumber(a)?this._study.nearestIndex(a-p,TradingView.SEARCH_NEAREST_LEFT):r)&&(_=this._study.data().valueAt(u)||this._study.data().last())&&(f=_[d+1],isNumber(f)&&(h.setValue(l.format(f)),m=this._study.properties().styles[c].color.value(),this._study.isOHLCSeriesPlot(d)&&(c=o[d].target,m=this._study.properties().ohlcPlots[c].color.value()),s[c]&&_.length>s[c].index+1?(g=_[s[c].index+1],void 0!==g&&null!==g?(n=s[c].palette,v=s[c].paletterProps,y=n.valToIndex?n.valToIndex[g]:g,this._items[i].setColor(v.colors[y].color.value())):this._items[i].setColor(m)):this._items[i].setColor(m)))}},o.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},inherit(n,o),n.prototype.additional=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._additional},n.prototype._updateImpl=function(){var t=l(this._study.symbolInfo());return this._additional=t?"(Data Provided by "+t+")":void 0,o.prototype._updateImpl.call(this)},e.StudyDataWindowView=o,e.DataVendorStudyDataWindowView=n}).call(e,i(1))},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._study=t,this._inputValueReplacements={NONE:"Default"}}var n=i(105);inherit(o,n),o.prototype.color=function(){return this._study._failed||this._study.metaInfo&&this._study.metaInfo().isTVScriptStub?"#ff0000":n.prototype.color.call(this)},o.prototype.update=function(){this._study._failed?this._text=this._study.title(!0,this._inputValueReplacements)+": "+this._study.status():this._text=this._study.title(!0,this._inputValueReplacements)+" "+this._study.status()},t.exports=o},function(t,e,i){"use strict";function o(t){this._data=t}function n(t){this._data=t}function s(t,e){for(var i,o,n,s=0,r=t.length-1;s<=r;)if(i=s+r>>>1,o=t[i].y1,n=t[i].y2,o>e)s=i+1;else{if(!(n<e))return t[i+1]&&o===t[i+1].y1?i+1:i;r=i-1}return-1}var r=i(30),a=i(124).TextRenderer,l=i(122).HorzLineRenderer,h=i(152).TrendLineRenderer,c=i(84),d=i(86),p=i(181),u=TradingView.Study,_=i(182),f=i(113),m=i(117),g=i(183),v=g.clearRect,y=i(119);u.graphicsZOrderPriority=function(t){switch(t){case"polygons":return-100;case"trendchannels":return-90;default:return 0}},u.StudyPaneView_horizlines=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_horizlines.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_horizlines.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new h(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_horizlines.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S;if(this._data=[],(t=this._study.graphics().horizlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(h=t[l],h.data&&(c=this._study.properties().graphics.horizlines[h.styleId],c.visible.value()))for(d=0;d<h.data.length;d++)p=h.data[d],u=o[p.startIndex],_=o[p.endIndex],!p.extendRight&&Math.max(u,_)<s||!p.extendLeft&&Math.min(u,_)>a||(f={},m=i.indexToCoordinate(u),g=i.indexToCoordinate(_),v=p.level,e.isPercent()&&(y=this._study.firstValue(),v=e.priceRange().convertToPercent(v,y)),b=e.priceToCoordinate(v),w=new r.Point(m,b),S=new r.Point(g,b),f.points=[w,S],f.extendleft=p.extendLeft,f.extendright=p.extendRight,f.width=i.width(),f.height=e.height(),f.color=c.color.value(),f.linewidth=c.width.value(),f.linestyle=c.style.value(),this._data.push(f))},u.StudyPaneView_vertlines=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_vertlines.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_vertlines.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new h(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_vertlines.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w;if(this._data=[],(t=this._study.graphics().vertlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(h=t[l],h.data&&(c=this._study.properties().graphics.vertlines[h.styleId],c.visible.value()))for(d=0;d<h.data.length;d++)p=h.data[d],u={},o[p.index]<s||o[p.index]>a||(_=i.indexToCoordinate(o[p.index])+1,f=null,p.extendBottom?m=e.height():(v=p.startPrice,e.isPercent()&&(f=f||this._study.firstValue(),v=e.priceRange().convertToPercent(v,f)),m=e.priceToCoordinate(v)),p.extendTop?g=0:(y=p.endPrice,e.isPercent()&&(f=f||this._study.firstValue(),y=e.priceRange().convertToPercent(y,f)),g=e.priceToCoordinate(y)),b=new r.Point(_,m),w=new r.Point(_,g),u.points=[b,w],u.extendleft=p.extendBottom,u.extendright=p.extendTop,u.width=i.width(),u.height=e.height(),u.color=c.color.value(),u.linewidth=c.width.value(),u.linestyle=c.style.value(),this._data.push(u))},u.StudyPaneView_lines=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_lines.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_lines.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new h(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_lines.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C;if(this._data=[],(t=this._study.graphics().lines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(h=t[l],h.data&&(c=this._study.properties().graphics.lines[h.styleId],c.visible.value()))for(d=0;d<h.data.length;d++)p=h.data[d],u=o[p.startIndex]+(p.startOffset||0),_=o[p.endIndex]+(p.endOffset||0),!p.extendRight&&Math.max(u,_)<s||!p.extendLeft&&Math.min(u,_)>a||(f={},m=i.indexToCoordinate(u),g=i.indexToCoordinate(_),v=p.startPrice,y=p.endPrice,e.isPercent()&&(b=this._study.firstValue(),v=e.priceRange().convertToPercent(v,b),y=e.priceRange().convertToPercent(y,b)),w=e.priceToCoordinate(v),S=e.priceToCoordinate(y),T=new r.Point(m,w),C=new r.Point(g,S),f.points=[T,C],f.color=c.color.value(),f.linewidth=c.width.value(),f.linestyle=c.style.value(),this._data.push(f))},u.StudyPaneView_hlines=function(t,e){this._study=t,this._model=e,this._data=[],this._textData=[],this._textRendererCache={}},u.StudyPaneView_hlines.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_hlines.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new l(this._data[e]));for(e=0;e<this._textData.length;e++)t.append(new a(this._textData[e],this._textRendererCache,new f(f.REGULAR)));return t},u.StudyPaneView_hlines.prototype._updateViewInternal=function(){this._calcHorzLinesData(),this._calcTextData()},u.StudyPaneView_hlines.prototype._calcTextData=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f;if(this._textData=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=0;o<t.length;o++)if(n=t[o],n.data&&(s=this._study.properties().graphics.hlines[n.styleId],s.enableText.value()&&s.showText.value()))for(a=0;a<n.data.length;a++)l=n.data[a],h={},h.text=void 0===l.text?"":l.text,h.color=s.color.value(),h.font="arial",h.fontsize=s.fontSize.value(),c=l.level,e.isPercent()&&(d=this._study.firstValue(),c=e.priceRange().convertToPercent(c,d)),p=e.priceToCoordinate(c),u=s.textPos.value(),u===CanvasEx.TEXTPOS_TOPLEFT||u===CanvasEx.TEXTPOS_MIDDLELEFT||u===CanvasEx.TEXTPOS_BOTTOMLEFT?(_=4,h.horzAlign="left"):u===CanvasEx.TEXTPOS_TOPCENTER||u===CanvasEx.TEXTPOS_MIDDLECENTER||u===CanvasEx.TEXTPOS_BOTTOMCENTER?(_=i.width()/2,h.horzAlign="center"):u!==CanvasEx.TEXTPOS_TOPRIGHT&&u!==CanvasEx.TEXTPOS_MIDDLERIGHT&&u!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(_=i.width(),h.horzAlign="right"),u===CanvasEx.TEXTPOS_TOPLEFT||u===CanvasEx.TEXTPOS_TOPCENTER||u===CanvasEx.TEXTPOS_TOPRIGHT?(h.vertAlign="bottom",p-=4):u===CanvasEx.TEXTPOS_MIDDLELEFT||u===CanvasEx.TEXTPOS_MIDDLECENTER||u===CanvasEx.TEXTPOS_MIDDLERIGHT?(h.vertAlign="middle",p-=2):u!==CanvasEx.TEXTPOS_BOTTOMLEFT&&u!==CanvasEx.TEXTPOS_BOTTOMCENTER&&u!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(h.vertAlign="top"),f=new r.Point(_,p),h.points=[f],h.offsetX=0,h.offsetY=0,this._textData.push(h)},u.StudyPaneView_hlines.prototype._calcHorzLinesData=function(){var t,e,i,o,n,s,a,l,h,c,d,p;if(this._data=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale())&&!e.isEmpty())for(i=0;i<t.length;i++)if(o=t[i],o.data&&(n=this._study.properties().graphics.hlines[o.styleId],n.visible.value()))for(s=0;s<o.data.length;s++)a=o.data[s],l={},h=0,c=a.level,e.isPercent()&&(d=this._study.firstValue(),c=e.priceRange().convertToPercent(c,d)),p=e.priceToCoordinate(c),l.points=[new r.Point(h,p)],l.color=n.color.value(),l.linewidth=n.width.value(),l.linestyle=n.style.value(),l.hitTestResult=f.REGULAR,this._data.push(l)},u.StudyPriceAxisView_hlines=function(t,e,i,o,n){this._study=t,this._model=e,this._line=i,this._styleId=o,this._data={},this._lineType=n,this._invalidated=!0},inherit(u.StudyPriceAxisView_hlines,c),u.StudyPriceAxisView_hlines.prototype.update=function(){this._invalidated=!0},u.StudyPriceAxisView_hlines.prototype.updateImpl=function(){var t,e,i,o;if(this._data={},this._data.visible=!1,(t=this._study.priceScale())&&!t.isEmpty()&&this._study.properties().visible.value()&&(e=this._study.properties().graphics[this._lineType][this._styleId],e.visible&&e.visible.value()&&e.showPrice&&e.showPrice.value())){if(this._data.visible=!0,this._data.color="white",this._data.background=e.color.value(),i=this._line.level,t.isPercent()){if(o=this._study.firstValue(),!isNumber(o))return;i=t.priceRange().convertToPercent(i,o)}this._data.coordinate=t.priceToCoordinate(i),this._data.text=t.formatter().format(i)}},u.StudyPriceAxisView_hlines.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),new d(this._data)},TradingView.TriangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.TriangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.TriangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,s,r,a;if(this._data){switch(e="up"===this._data.direction?1:-1,i=this._data.point.x,"left"===this._data.halign?i-=this._data.size:"right"===this._data.halign&&(i+=this._data.size),o=this._data.point.y,t.font=this.fontStyle(),n=t.measureText(this._data.text).width,this._textCache.textWidth=n,s=this._data.fontSize,r=.65*s,a=1*s,t.save(),t.translate(i+.5,o+.5),t.beginPath(),t.moveTo(0,0),this._data.direction){case"up":case"down":t.lineTo(r,a*e),t.lineTo(.5*n+r,a*e),t.lineTo(.5*n+r,(a+1.75*s)*e),t.lineTo(.5*-n-r,(a+1.75*s)*e),t.lineTo(.5*-n-r,a*e),t.lineTo(-r,a*e),t.lineTo(0,0),t.strokeStyle=this._data.borderColor,t.stroke(),t.fillStyle=this._data.color,t.fill(),t.fillStyle=this._data.fontColor,t.fillText(this._data.text,.5*-n,e<0?e*a-.5*s:a+1.25*s);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}t.restore()}},TradingView.TriangleTextMarkRenderer.prototype.hitTest=function(t){var e,i,o,n,s,a,l,h,c,d,p,u=this._textCache.textWidth,_=this._data.fontSize;switch(this._data.direction){case"up":case"down":if(e="up"===this._data.direction?1:-1,i=.65*_,o=1*_,n=this._data.point.x,"left"===this._data.halign?n-=this._data.size:"right"===this._data.halign&&(n+=this._data.size),s=this._data.point.y,a=n-.5*u-i,l=n+.5*u+i,h=s+o*e,c=s+(o+1.75*_)*e,c<h&&(s=h,h=c,c=s),r.pointInRect(t,new r.Point(a,h),new r.Point(l,c)))return new f(f.REGULAR);if(d=[],d[0]={},d[0].x=this._data.point.x,d[0].y=this._data.point.y,d[1]={},d[1].x=this._data.point.x+.65*_,d[1].y=this._data.point.y+_*e,d[2]={},d[2].x=this._data.point.x-.65*_,d[2].y=this._data.point.y+_*e,p=(t.x-d[0].x)*(d[1].y-d[0].y)-(t.y-d[0].y)*(d[1].x-d[0].x),((t.x-d[1].x)*(d[2].y-d[1].y)-(t.y-d[1].y)*(d[2].x-d[1].x))*p>0&&((t.x-d[2].x)*(d[0].y-d[2].y)-(t.y-d[2].y)*(d[0].x-d[2].x))*p>0)return new f(f.REGULAR);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}return null},TradingView.RectangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.RectangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.RectangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,s;if(this._data){switch(e=this._data.point.x,i=this._data.point.y,t.font=this.fontStyle(),o=t.measureText(this._data.text).width,this._textCache.textWidth=o,t.save(),t.translate(e+.5,i+.5),t.beginPath(),t.moveTo(0,0),n=this._data.halign,s=this._data.valign,t.textAlign=n,s){case"middle":t.textBaseline="middle";break;case"top":t.textBaseline="bottom";break;case"bottom":t.textBaseline="hanging"}t.fillStyle=this._data.fontColor,t.fillText(this._data.text,0,0),t.restore()}},TradingView.RectangleTextMarkRenderer.prototype.hitTest=function(t){var e,i,o=this._data.point.x+.5,n=this._data.point.y+.5,s=this._textCache.textWidth,a=this._data.fontSize,l=this._data.halign;switch(this._data.valign){case"middle":n-=a/2;break;case"bottom":n-=a}switch(l){case"right":o-=s;break;case"center":o-=s/2}return e=new r.Point(o,n),i=new r.Point(o+s,n+a),r.pointInRect(t,e,i)?new f(f.REGULAR):null},TradingView.CircleShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.CircleShapeMarkRenderer.prototype.draw=function(t){var e,i,o;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=this._data.point.x,o=this._data.point.y,t.save(),t.fillStyle=this._data.color,t.beginPath(),t.arc(i+1,o+2*this._data.size*e+.5,this._data.size,0,2*Math.PI),t.closePath(),t.fill(),t.stroke())},TradingView.CircleShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0;return Math.pow(this._data.point.x+.5-t.x,2)+Math.pow(this._data.point.y+.5+2*this._data.size*e-t.y,2)<=Math.pow(this._data.size,2)?new f(f.REGULAR):null},TradingView.SquareShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.SquareShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,s;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new r.Point(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new r.Point(this._data.point.x+i/2,this._data.point.y+i/2+e*i),s=n.substract(o),t.beginPath(),t.fillStyle=this._data.color,t.rect(o.x,o.y,s.x,s.y),t.stroke(),t.fill())},TradingView.SquareShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new r.Point(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new r.Point(this._data.point.x+i/2,this._data.point.y+i/2+e*i),s=new r.Point(Math.min(o.x,n.x),Math.min(o.y,n.y)),a=new r.Point(Math.max(o.x,n.x),Math.max(o.y,n.y));return r.pointInRect(t,s,a)?new f(f.REGULAR):null},TradingView.ArrowShapeMarkRenderer=function(t,e,i){this._data=t,this._textCache=e,this._arrowDirection=i},TradingView.ArrowShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d;if(this._data){switch(e=this._arrowDirection,i=1*this._data.size,o=this._data.color,n=this._data.point.x+1,s=this._data.point.y,r=1.1*i,e){case"up":s-=r;break;case"down":s+=r}switch(a=i/6,l=i/4,h=i/3,c=i/2,d=.6666666*i,t.save(),t.fillStyle=o,t.beginPath(),e){case"up":t.moveTo(n,s),t.lineTo(n-c,s+d),t.lineTo(n-l,s+d),t.lineTo(n,s+h),t.lineTo(n+l,s+d),t.lineTo(n+c,s+d),t.lineTo(n,s);break;case"down":t.moveTo(n,s+i),t.lineTo(n-c,s+h),t.lineTo(n-l,s+h),t.lineTo(n,s+d),t.lineTo(n+l,s+h),t.lineTo(n+c,s+h),t.lineTo(n,s+i);break;case"right":t.moveTo(n+a,s),t.lineTo(n-a,s-l),t.lineTo(n-a,s+l),t.lineTo(n+a,s);break;case"left":t.moveTo(n-a,s),t.lineTo(n+a,s-l),t.lineTo(n+a,s+l),t.lineTo(n-a,s)}t.closePath(),t.fill(),t.stroke()}},TradingView.ArrowShapeMarkRenderer.prototype.hitTest=function(t){var e,i,o,n,s,a,l,h=this._data.point.x,c=this._data.point.y,d=this._arrowDirection,p=1*this._data.size,u=p/2,_=1.1*p;switch(d){case"up":c-=_;break;case"down":c+=_}switch(e=p/6,i=p/4,o=p/3,u=p/2,n=.6666666*p,d){case"up":s=new r.Point(h,c),a=new r.Point(h+u,c+n),l=new r.Point(h-u,c+n);break;case"down":s=new r.Point(h,c+p),a=new r.Point(h+u,c+o),l=new r.Point(h-u,c+o);break;case"right":s=new r.Point(h+e,c),a=new r.Point(h-e,c-i),l=new r.Point(h-e,c+i);break;case"left":s=new r.Point(h-e,c),a=new r.Point(h+e,c-i),l=new r.Point(h+e,c+i)}return r.pointInTriangle(s,a,l,t)?new f(f.REGULAR):null},u.StudyPaneView_textmarks=function(t,e){this._study=t,this._model=e,this._data=[],this._textCache=[]},inherit(u.StudyPaneView_textmarks,_),u.StudyPaneView_textmarks.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_textmarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"triangle":t.append(new TradingView.TriangleTextMarkRenderer(this._data[e],this._textCache[e]));break;case"rectangle":t.append(new TradingView.RectangleTextMarkRenderer(this._data[e],this._textCache[e]))}return t},u.StudyPaneView_textmarks.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,b,w,S;if(this._data=[],(t=this._study.graphics().textmarks)&&(e=this._study.priceScale(),i=this._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(h=t[l],h.data&&(c=this._study.properties().graphics.textmarks[h.styleId],c.visible.value()))for(d=h.data,p=0;p<d.length;p++)if(u=d[p],_={},f=c.location.value(),m=c.shape.value(),!((g=o[u.time])<s||g>a)&&this._study.series().bars().valueAt(g)){switch(g=o[u.time]+(u.offset||0),_.font=c.fontFamily.value(),_.color=y.generateColor(c.color.value(),c.transparency.value()),_.bold=c.fontBold.value(),_.fontColor=y.generateColor(c.fontColor.value(),c.transparency.value()),_.italic=c.fontItalic.value(),_.fontSize=c.fontSize.value(),_.text=u.text?u.text:"",_.halign=c.halign.value(),_.valign=void 0!==c.valign?c.valign.value():"middle",_.shape=c.shape.value(),_.size=.5*i.barSpacing(),_.borderColor="rgb(0, 0, 0)",v=50,m){case"triangle":S=this._calcCoordsForTriangleShape(f,g,v,u.price,e),_.direction=S.direction,b=Math.round(i.indexToCoordinate(g)),w=S.y;break;case"rectangle":S=this._calcCoordsForRectangleShape(f,g,u.price,e,i),b=S.x,w=S.y}_.point=new r.Point(b,w),this._data.push(_),this._textCache.push({})}},u.StudyPaneView_textmarks.prototype._calcCoordsForTriangleShape=function(t,e,i,o,n){var s,r,a;switch(t){case CanvasEx.MARKLOC_TOP:s=n.height()-i,r="down";break;case CanvasEx.MARKLOC_BOTTOM:s=i,r="up";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:n.isPercent()&&(a=this._study.firstValue(),o=n.priceRange().convertToPercent(o,a)),s=n.priceToCoordinate(o),r="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:n.isPercent()&&(a=this._study.firstValue(),o=n.priceRange().convertToPercent(o,a)),s=n.priceToCoordinate(o),r="up";break;case CanvasEx.MARKLOC_ABOVEBAR:s=this._locationToY(t,e),r="down";break;case CanvasEx.MARKLOC_BELOWBAR:s=this._locationToY(t,e),r="up";break;default:s=this._locationToY(t,e),r="up"}return{y:s,direction:r}},u.StudyPaneView_textmarks.prototype._calcCoordsForRectangleShape=function(t,e,i,o,n){var s,r,a=Math.round(n.indexToCoordinate(e));switch(t){case CanvasEx.MARKLOC_ABSOLUTEDOWN:case CanvasEx.MARKLOC_ABSOLUTEUP:case CanvasEx.MARKLOC_ABSOLUTE:o.isPercent()&&(r=this._study.firstValue(),i=o.priceRange().convertToPercent(i,r)),s=o.priceToCoordinate(i);break;case CanvasEx.MARKLOC_ABOVEBAR:s=this._locationToY(t,e);break;case CanvasEx.MARKLOC_BELOWBAR:s=this._locationToY(t,e);break;case CanvasEx.MARKLOC_RIGHT:a=n.width(),o.isPercent()&&(r=this._study.firstValue(),i=o.priceRange().convertToPercent(i,r)),s=o.priceToCoordinate(i);break;case CanvasEx.MARKLOC_LEFT:a=n.width(),o.isPercent()&&(r=this._study.firstValue(),i=o.priceRange().convertToPercent(i,r)),s=o.priceToCoordinate(i);break;default:s=this._locationToY(t,e)}return{x:a,y:s}},u.StudyPaneView_shapemarks=function(t,e){this._study=t,this._model=e,this._data=[],this._textCache=[]},inherit(u.StudyPaneView_shapemarks,_),u.StudyPaneView_shapemarks.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_shapemarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"circle":t.append(new TradingView.CircleShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"square":t.append(new TradingView.SquareShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"arrowUp":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"up"));break;case"arrowDown":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"down"));break;case"arrowRight":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"right"));break;case"arrowLeft":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"left"))}return t},u.StudyPaneView_shapemarks.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,b,w,S;if(this._data=[],(t=this._study.graphics().shapemarks)&&(e=this._study.priceScale(),i=this._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(h=t[l],h.data&&(c=this._study.properties().graphics.shapemarks[h.styleId],c.visible.value()))for(d=h.data,p=0;p<d.length;p++)if(u=d[p],!((_=o[u.time])<s||_>a)&&(f={},null!=u.time&&this._study.series().bars().valueAt(_))){switch(f.color=y.generateColor(c.color.value(),c.transparency.value()),m=0,"left"===c.halign.value()?m-=i.barSpacing()/2+1:"right"===c.halign.value()&&(m+=i.barSpacing()/2+1),f.size=c.size.value(),f.shape=c.shape.value(),g=Math.round(i.indexToCoordinate(_))+m,v=u.price,e.isPercent()&&(b=this._study.firstValue(),v=e.priceRange().convertToPercent(v,b)),w=e.priceToCoordinate(v),S=c.location.value()){case CanvasEx.MARKLOC_ABSOLUTE:f.direction="";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:f.direction="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:f.direction="up";break;case CanvasEx.MARKLOC_ABOVEBAR:w=this._locationToY(S,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="up";break;case CanvasEx.MARKLOC_BELOWBAR:w=this._locationToY(S,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="down";break;default:TradingView.logWarn("Bad location value: "+S),w=this._locationToY(CanvasEx.MARKLOC_ABSOLUTEUP,_),f.direction="up"}f.point=new r.Point(g,w),this._data.push(f),this._textCache.push({})}},o.prototype.draw=function(t){},o.prototype.drawBackground=function(t){var e=this._data;v(t,e.x1,e.y1,e.x2-e.x1,e.y2-e.y1,y.generateColor(this._data.color,this._data.transparency))},o.prototype.hitTest=function(t){return null},u.StudyPaneView_backgrounds=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_backgrounds.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_backgrounds.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new o(this._data[e]));return t},u.StudyPaneView_backgrounds.prototype._hideExtendedHours=function(t){return("inSession"===t||"outOfSession"===t)&&!this._study._series.properties().extendedHours.value()},u.StudyPaneView_backgrounds.prototype._updateViewInternal=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b;if(this._data=[],(t=this._study.graphics().backgrounds)&&(e=this._model.timeScale(),(i=this._study.priceScale())&&!i.isEmpty()&&e&&!e.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),r=n.lastBar(),a=0;a<t.length;a++)if(l=t[a],h=l.styleId,c=l.data,d=this._study.properties().graphics.backgrounds[h],!this._hideExtendedHours(h)&&d.visible.value())for(_=0;_<c.length;_++)f=c[_],m={},g=o[f.start],(v=o[f.stop])<s||g>r||null!=f.start&&null!=f.stop&&(y=Math.ceil(e.indexToCoordinate(g,!0)-.5*e.barSpacing()),b=Math.ceil(e.indexToCoordinate(v,!0)+.5*e.barSpacing()),u===g-1&&(y=p),p=b,u=v,y<0&&b<0||y>e.width()&&b>e.width()||(m.x1=y,m.x2=b,m.y1=0,m.y2=i.height(),m.color=d.color.value(),m.transparency=d.transparency.value(),this._data.push(m)))},u.StudyPaneView_polygons=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_polygons.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_polygons.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new p(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_polygons.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T;if(this._data=[],(t=this._study.graphics().polygons)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(h=t[l],h.data&&(c=this._study.properties().graphics.polygons[h.styleId],100!==c.transparency.value()))for(d=0;d<h.data.length;d++){for(p=h.data[d],u=1/0,_=-(1/0),f=0;p.points&&f<p.points.length;f++)m=o[p.points[f].index]+(p.points[f].offset||0),u=Math.min(u,m),_=Math.max(_,m);if(!(_<s||u>a)){for(g={},g.points=[],f=0;p.points&&f<p.points.length;f++)v=p.points[f],y=i.indexToCoordinate(o[v.index]+(v.offset||0)),b=v.level,e.isPercent()&&(w=this._study.firstValue(),b=e.priceRange().convertToPercent(b,w)),S=e.priceToCoordinate(b),T=new r.Point(y,S),T.data=f,g.points.push(T);g.color=c.color.value(),g.backcolor=c.color.value(),g.linewidth=void 0!==c.showBorder&&c.showBorder.value()?1:0,g.linestyle=CanvasEx.LINESTYLE_SOLID,g.filled=!0,g.fillBackground=!0,g.transparency=c.transparency.value(),g.mouseTouchable=c.mouseTouchable.value(),this._data.push(g)}}},u.StudyPaneView_trendchannels=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_trendchannels.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_trendchannels.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new p(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_trendchannels.prototype._convertToYCoord=function(t){var e=this._study.priceScale(),i=this._study.firstValue();return e.isPercent()&&(t=e.priceRange().convertToPercent(t,i)),e.priceToCoordinate(t)},u.StudyPaneView_trendchannels.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E;if(this._data=[],(t=this._study.graphics().trendchannels)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=function(t,e,i,o,n,s){var a,l,h=new r.Point(0,0),c=new r.Point(i,o);return n&&(a=t.substract(e),l=r.intersectRayWithRect(t,t.add(a),h,c),l?t=l:e.x=i),s&&(a=e.substract(t),l=r.intersectRayWithRect(e,e.add(a),h,c),l?e=l:e.x=i),[t,e]},n=this._study.graphics().indexes,s=this._model.timeScale().visibleBars(),a=s.firstBar(),l=s.lastBar(),h=0;h<t.length;h++)if(c=t[h],c.data)for(d=this._study.properties().graphics.trendchannels[c.styleId],p=0;p<c.data.length;p++)u=c.data[p],_=n[u.startIndex],f=n[u.endIndex],Math.max(_,f)<a&&!u.extendRight||Math.min(_,f)>l&&!u.extendLeft||(m=this._convertToYCoord(u.startHighPrice),g=this._convertToYCoord(u.startLowPrice),v=this._convertToYCoord(u.endHighPrice),y=m-g,b=v-y,w=i.indexToCoordinate(_),S=i.indexToCoordinate(f),T=new r.Point(w,m),C=new r.Point(w,g),x=new r.Point(S,v),P=new r.Point(S,b),L=o(T,x,i.width(),e.height(),u.extendLeft,u.extendRight),k=o(C,P,i.width(),e.height(),u.extendLeft,u.extendRight),T=L[0],x=L[1],C=k[0],P=k[1],I={},I.points=[T,C,P,x],I.color=d.color.value(),I.backcolor=d.color.value(),I.linewidth=void 0!==d.borderWidth?d.borderWidth.value():0,I.linestyle=CanvasEx.LINESTYLE_SOLID,I.filled=!0,I.fillBackground=!0,u.transparency?(E=u.transparency+d.transparency.value(),I.transparency=Math.min(E,100)):I.transparency=d.transparency.value(),I.mouseTouchable=!0,this._data.push(I))},u.StudyPaneView_hhists=function(t,e){this._study=t,this._model=e,this._data=[],this._textData=[],this._textRendererCache={}},u.StudyPaneView_hhists.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_hhists.prototype.renderer=function(){var t,e;this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m;for(e in this._data)t.append(new n(this._data[e]));for(e=0;e<this._textData.length;e++)t.append(new a(this._textData[e],this._textRendererCache,new f(f.REGULAR)));return t},u.StudyPaneView_hhists.prototype._updateViewInternal=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f;if(this._data=[],this._textData=[],t=this._study.priceScale(),e=this._model.timeScale(),t&&!t.isEmpty()&&e&&!e.isEmpty()&&(i=this._study.graphics().hhists))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),r=n.lastBar(),a=0;a<i.length;a++)if(l=i[a],h=this._study.properties().graphics.hhists[l.styleId],h.visible.value()){c=l.dataObj;for(d in c){for(p=c[d],u=1/0,_=-(1/0),f=p.length;f--;)u=Math.min(u,o[p[f].firstBarTime]),_=Math.max(_,o[p[f].lastBarTime]);_<s||u>r||this._updateDataForRenderers(p,h,t,e,o)}}},u.StudyPaneView_hhists.prototype._updateDataForRenderers=function(t,e,o,n,s){var a,l,h,c,d,p,u,_,f,m,g,v,b,w,S,T,C,x,P,L,k,I,E,A=[],V=this._findMaxRate(t),M=null,$=null,D=null,O={},B=i(171).shiftColor,R=function(t,e,i){if(i===CanvasEx.HHISTDIR_LEFTTORIGHT)return t+e;if(i===CanvasEx.HHISTDIR_RIGHTTOLEFT)return e+t;throw Error("Unknown direction value: "+i)};for(p=0;p<t.length;p++)for(u=t[p],null==$&&($=this._findActualRateLength(u.rate)),null==M&&(_=Math.abs(n.indexToCoordinate(s[u.firstBarTime])-n.indexToCoordinate(s[u.lastBarTime])),M=e.percentWidth.value()*_/100,M-=$,M=Math.max(M,0)),f=!1,v=0;v<$;v++)if(0!==u.rate[v]){if(void 0===O[v]?O[v]=u.rate[v]:O[v]+=u.rate[v],o.isPercent()?(b=this._study.firstValue(),a=o.priceRange().convertToPercent(u.priceHigh,b),l=o.priceRange().convertToPercent(u.priceLow,b)):(a=u.priceHigh,l=u.priceLow),w={},w.y1=o.priceToCoordinate(a)+1,w.y2=o.priceToCoordinate(l)-1,0===p&&(m=w.y2,g=w.y2-w.y1),S=e.location.value(),T=e.direction.value(),S===CanvasEx.HHISTLOC_ABSOLUTE&&T===CanvasEx.HHISTDIR_LEFTTORIGHT)c=n.indexToCoordinate(s[u.firstBarTime]),h=1,d="left";else if(S===CanvasEx.HHISTLOC_ABSOLUTE&&T===CanvasEx.HHISTDIR_RIGHTTOLEFT)c=n.indexToCoordinate(s[u.lastBarTime]),h=-1,d="right";else if(S===CanvasEx.HHISTLOC_RELATIVE&&T===CanvasEx.HHISTDIR_LEFTTORIGHT)c=0,h=1,d="left";else{if(S!==CanvasEx.HHISTLOC_RELATIVE||T!==CanvasEx.HHISTDIR_RIGHTTOLEFT)throw Error("Unknown location/direction values: "+S+"/"+T);c=n.width(),h=-1,d="right"}if(w.x1=0===v?c:c+h*(M*u.rate[v-1]/V+$),w.x2=w.x1+h*(M*u.rate[v]/V),w.colorBg=e.colors[v].value(),w.transparency=e.transparencies[v].value(),w.blendedColor=y.generateColor(w.colorBg,w.transparency),w.x0=c,A.push(w),D||(D=.6*(w.y2-w.y1)),!f&&e.showValues.value()&&D>=7.5){for(f=!0,C={},x=this._study.formatter(),C.text="",P=0;P<$;P++)C.text=R(C.text,x.format(u.rate[P]),T),P!==$-1&&(C.text=R(C.text,"x",T));if(C.color=e.valuesColor.value(),C.font="arial",C.fontsize=D,C.horzAlign=d,C.vertAlign="middle",L=new r.Point(c+3*h,w.y2-.61*(w.y2-w.y1)),C.points=[L],C.offsetX=0,C.offsetY=0,this._textData.push(C),p===t.length-1){for(k=c+3*h,I=m+.39*g,E={text:"",color:B(e.valuesColor.value(),1.5),font:"arial",fontsize:D,horzAlign:d,vertAlign:"middle",points:[new r.Point(k,I)],offsetX:0,offsetY:0},P=0;P<$;P++)E.text=R(E.text,x.format(O[P]),T),P!==$-1&&(E.text=R(E.text,"x",T));this._textData.push(E)}}}A.length>0&&this._data.push(A)},u.StudyPaneView_hhists.prototype._findMaxRate=function(t){var e,i,o=0,n=0;for(e=0;e<t.length;e++){for(n=0,i=0;i<t[e].rate.length;i++)n+=t[e].rate[i];o=Math.max(o,n)}return o},u.StudyPaneView_hhists.prototype._findActualRateLength=function(t){var e,i,o=0;for(e=0;e<t.length&&(null!==(i=t[e])&&void 0!==i);++e)o++;return o},n.prototype.hitTest=function(t){var e,i,o=s(this._data,t.y);return o<0?null:(e=Math.min(this._data[o].x0,this._data[o].x2),i=Math.max(this._data[o].x0,this._data[o].x2),e<=t.x&&t.x<=i?new f(f.REGULAR):null)},n.prototype.draw=function(t){var e,i,o,n,s,r,a;for(t.save(),e={},i=[],n=0;n<this._data.length;n++)s=this._data[n],e[s.blendedColor]?e[s.blendedColor].push(s):(i.push(s.blendedColor),e[s.blendedColor]=[s]);for(r=0;r<i.length;r++){for(a=i[r],t.fillStyle=a,t.strokeStyle=a,t.beginPath(),o=e[a],n=0;n<o.length;n++)s=o[n],t.rect(s.x1,s.y1,s.x2-s.x1,s.y2-s.y1);t.stroke(),t.fill()}t.restore()},t.exports=u},function(t,e,i){"use strict";function o(t,e,i){this._data=t,this._hittest=e||new a(a.MOVEPOINT),this._backHittest=i||new a(a.MOVEPOINT_BACKGROUND),this._points=t.points}var n=i(30),s=i(82).LineDataSource,r=i(152).TrendLineRenderer,a=i(113),l=i(119);o.prototype.draw=function(t){var e,i,o;if(0!==this._points.length){for(t.beginPath(),t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._points[0],t.moveTo(e.x,e.y),i=0;i<this._points.length;i++)o=this._points[i],t.lineTo(o.x,o.y);this._data.filled&&this._data.fillBackground&&(t.fillStyle=l.generateColor(this._data.backcolor,this._data.transparency),t.fill()),this._data.filled&&!this._data.skipClosePath&&t.closePath(),this._data.linewidth>0&&t.stroke(),this._points.length>1&&(this._data.leftend===s.LINEEND_ARROW&&r.prototype.drawArrow(this._points[1],this._points[0],t,t.lineWidth),this._data.rightend===s.LINEEND_ARROW&&r.prototype.drawArrow(this._points[this._points.length-2],this._points[this._points.length-1],t,t.lineWidth))}},o.prototype.hitTest=function(t){var e,i,o,s,r;if(void 0!==this._data.mouseTouchable&&!this._data.mouseTouchable)return null;for(e=TradingView.isMobile.any()?24:3,i=1;i<this._points.length;i++)if(o=this._points[i-1],s=this._points[i],r=n.distanceToSegment(o,s,t),r.distance<=e)return this._hittest;return this._data.filled&&this._data.fillBackground&&this._points.length>0&&(o=this._points[0],s=this._points[this._points.length-1],r=n.distanceToSegment(o,s,t),r.distance<=e)?this._hittest:this._data.filled&&this._data.fillBackground&&n.isInPolygon(this._data.points,t)?this._backHittest:null},t.exports=o},function(t,e,i){"use strict";function o(){}var n=i(30);o.prototype._locationToY=function(t,e,i){var o,s,r,a,l,h,c;switch(i||(i=0),o=[],s=this._study.priceScale(),t){case CanvasEx.MARKLOC_ABOVEBAR:r=TradingView.HIGH_PLOT;break;case CanvasEx.MARKLOC_BELOWBAR:r=TradingView.LOW_PLOT}for(a=this._study.firstValue(),i>=1&&(i-=1),l=-i;l<=i;l++)(h=this._study.series().bars().valueAt(e+l))&&(c=h[r],s.isPercent()&&(c=s.priceRange().convertToPercent(c,a)),o.push(s.priceToCoordinate(c)));switch(t){case CanvasEx.MARKLOC_ABOVEBAR:return n.min(o)-15;case CanvasEx.MARKLOC_BELOWBAR:return n.max(o)+15}},t.exports=o},function(t,e,i){(function(t,o){"use strict";var n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,M,D,O,B=i(119);"undefined"!=typeof FlashCanvas&&FlashCanvas.setOptions({disableContextMenu:!0}),n=function(t,e){if(t.width=e.w,t.height=e.h,"undefined"==typeof FlashCanvas){t.getContext("2d").translate(.5,.5)}},e.setCanvasSize=n,s=function(t,e,i,o,n,s){t.save(),"undefined"==typeof FlashCanvas&&t.translate(-.5,-.5),t.fillStyle=s,t.fillRect(e,i,o,n),t.restore()},e.clearRect=s,r=function(t,e){var i=document.createElement("canvas");return t.append(i),"undefined"!=typeof FlashCanvas&&FlashCanvas.initElement(i),n(i,e),i},e.addCanvasTo=r,a=function(t,e,i,o){this.x=t,this.y=e,this.w=i,this.h=o},e.Rect=a,l=function(t,e){this.w=t,this.h=e},e.Size=l,l.prototype.equals=function(t){return this.w===t.w&&this.h===t.h},h=function(t,e){this.x=t,this.y=e},e.Point=h,c=function(t,e){t.css("position","absolute"),t.css("left",e.x+"px"),t.css("top",e.y+"px"),t.width(e.w),t.height(e.h)},e.setAbsoluteRect=c,d=function(t,e){t.css("position","absolute"),t.css("left",e.x+"px"),t.css("top",e.y+"px")},e.setAbsolutePos=d,p=function(t,e){var i=t.offset();e.localX=e.pageX-i.left,e.localY=e.pageY-i.top},e.addLocalCoordsToMouseEvent=p,u=function(t,e,i,o,n){o&&(n||p(e,t),o.call(i,t,e))},e.processEvent=u,_=2,f=function(t,e,i,o){var n,s,r,a,l,h,c,d,p,f,m,g,v,y,b,w,S=i;o&&(i=!1),n=function(o){t.off("mousemove.chartgui");var n=function(o){TradingView.mousePressed&&!Modernizr.touch||(u(o,t,e,e.mouseMoveEvent),i&&o.preventDefault())};t.on("mousemove.chartgui",n),Modernizr.touch&&n(o),u(o,t,e,e.mouseEnterEvent),i&&o.preventDefault()},t.mouseenter(n),s=0,r=null,a=500,l=function(){window.clearTimeout(r),s=0,r=null},h={x:0,y:0},c=null,d=500,p={x:0,y:0},f=function(f){var m,g;if(void 0===f.button&&(f.button=0),(Modernizr.touch||f.originalEvent.touches)&&(f.pageX=f.originalEvent.touches[0].pageX,f.pageY=f.originalEvent.touches[0].pageY,f.localX=f.originalEvent.touches[0].pageX,f.localY=f.originalEvent.touches[0].pageY,p.x=f.originalEvent.touches[0].pageX,p.y=f.originalEvent.touches[0].pageY,n(f)),m=function(n){void 0===n.button&&(n.button=0);var s=!1;(Modernizr.touch||n.originalEvent.touches)&&(n.pageX=n.originalEvent.touches[0].pageX,n.pageY=n.originalEvent.touches[0].pageY,n.localX=n.originalEvent.touches[0].pageX,n.localY=n.originalEvent.touches[0].pageY,n.clientX=n.originalEvent.touches[0].pageX,n.clientY=n.originalEvent.touches[0].pageY,h.x=n.pageX,h.y=n.pageY,o&&(Math.abs(.5*(p.x-h.x))<=Math.abs(p.y-h.y)?(s=!0,i=!1):Math.abs(.5*(p.x-h.x))>Math.abs(p.y-h.y)&&(i=S)),p.x=n.originalEvent.touches[0].pageX,p.y=n.originalEvent.touches[0].pageY,clearTimeout(c)),n.button===_||s||u(n,t,e,e.pressedMouseMoveEvent),i&&n.preventDefault()},g=function(o){void 0===o.button&&(o.button=0),(Modernizr.touch||o.originalEvent.touches)&&(o.pageX=h.x,o.pageY=h.y,o.localX=h.x,o.localY=h.y,clearTimeout(c)),TradingView.mousePressed=!1,$(document.body).off("mousemove.chartgui"),$(document.body).off("mouseup.chartgui"),Modernizr.touch||o.originalEvent.touches?($(document.body).off("touchmove.chartgui"),$(document.body).off("touchend.chartgui"),b(o)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui")),o.button!==_&&(u(o,t,e,e.mouseUpEvent),++s,r&&s>1?(u(o,t,e,e.mouseDoubleClickEvent),l()):u(o,t,e,e.mouseClickEvent)),i&&o.preventDefault(),Modernizr.touch&&b(o)},Modernizr.touch?($(document.body).off("touchmove.chartgui"),$(document.body).off("touchend.chartgui"),$(document.body).on("touchmove.chartgui",m),$(document.body).on("touchend.chartgui",g),c=setTimeout(function(){w(f)},d)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui"),$(document.body).on("mousemove.chartgui touchmove.chartgui",m),$(document.body).on("mouseup.chartgui touchend.chartgui",g)),TradingView.mousePressed=!0,f.button!==_&&(u(f,t,e,e.mouseDownEvent),r||(s=0,r=window.setTimeout(l,a))),i){f.preventDefault();try{window.focus()}catch(t){}}},t.on("touchcancel",function(){clearTimeout(c)}),Modernizr.touch?(t.on("touchstart.chartgui",f),t.on("touchstartoutside mousedownoutside",function(i){u(i,t,e,e.mouseDownOutsideEvent,!0)}),t.on("gesturestart",function(i){u(i,t,e,e.gestureStartEvent),clearTimeout(c)}),t.on("gesturechange",function(i){i.scale=i.originalEvent.scale,u(i,t,e,e.gestureChangeEvent)}),t.on("gestureend",function(i){u(i,t,e,e.gestureEndEvent)})):(t.on("mousedown.chartgui touchstart.chartgui",f),t.on("touchstartoutside mousedownoutside",function(i){u(i,t,e,e.mouseDownOutsideEvent,!0)}),navigator.msPointerEnabled&&window.MSGesture&&(m=new MSGesture,g=!1,v=1,y=t.get(0),m.target=y,y.gesture=m,y.gesture.pointerType=null,y.pointers=[],m.pointerType=null,t.on("pointerdown",function(t){if(t.target===this)if(null===this.gesture.pointerType)this.gesture.target=y,this.gesture.addPointer(t.originalEvent.pointerId),this.gesture.pointerType=t.originalEvent.pointerType;else if(t.originalEvent.pointerType===this.gesture.pointerType)this.gesture.addPointer(t.originalEvent.pointerId);else{var e=new MSGesture;e.target=t.originalEvent.target,t.originalEvent.target.gesture=e,t.originalEvent.target.gesture.pointerType=t.originalEvent.pointerType,t.originalEvent.target.gesture.addPointer(t.originalEvent.pointerId)}}),t.on("MSGestureChange",function(i){var o=1*(i.originalEvent.scale-1)+1;i.scale=v*=o,g||1===i.originalEvent.scale||(g=!0,u(i,t,e,e.gestureStartEvent)),g&&u(i,t,e,e.gestureChangeEvent)}),t.on("MSGestureEnd",function(i){g=!1,v=1,u(i,t,e,e.gestureEndEvent)}))),b=function(o){t.off("mousemove.chartgui touchmove.chartgui"),u(o,t,e,e.mouseLeaveEvent),i&&o.preventDefault()},t.mouseleave(b),w=function(o){u(o,t,e,e.contextMenuEvent),i&&o.preventDefault()},t.contextMenu&&t.contextMenu(w)},e.setMouseEventHandler=f,m=function(t){var e=t.offset(),i=t.width(),o=t.height();return new a(e.left,e.top,i,o)},e.clientRect=m,g=function(t){var e=0,i=0;do{e+=t.offsetLeft,i+=t.offsetTop,t=t.offsetParent}while(t);return{left:e,top:i}},e.offsetPosition=g,v=function(t){var e,i=$("<span class='tvcolorpicker-container'>").appendTo(t);return $("<div class='tvcolorpicker-transparency'>").appendTo(i),e=$("<input>").appendTo(i).tvcolorpicker(),e.on("change",function(){$(this).css("border-color",B.generateLowBrightnessColor($(this).val()||B.defaultColorPickersBorder))}),TVSettings&&(e.tvcolorpicker.setCustomColors=TVSettings.setJSON("pickerCustomColors",[]),e.bind("customcolorchange",function(t,e){TVSettings.setJSON("pickerCustomColors",e)})),i},e.addColorPicker=v,y=function(){return new(0,i(184).Combobox)([{value:CanvasEx.LINESTYLE_SOLID,html:'<div class="linestyle solidline"/>'},{value:CanvasEx.LINESTYLE_DOTTED,html:'<div class="linestyle dottedline"/>'},{value:CanvasEx.LINESTYLE_DASHED,html:'<div class="linestyle dashedline"/>'}])},e.createLineStyleEditor=y,b=function(){return $('<select><option value="'+CanvasEx.MARKLOC_ABOVEBAR+'">'+$.t("Above Bar")+'</option><option value="'+CanvasEx.MARKLOC_BELOWBAR+'">'+$.t("Below Bar")+'</option><option value="'+CanvasEx.MARKLOC_TOP+'">'+$.t("Top")+'</option><option value="'+CanvasEx.MARKLOC_BOTTOM+'">'+$.t("Bottom")+'</option><option value="'+CanvasEx.MARKLOC_ABSOLUTE+'">'+$.t("Absolute")+"</option></select>")},e.createShapeLocationEditor=b,w=function(){var t,e,o,n=i(175).StudyPlotShapes,s="<select>",r=Object.keys(n.Data);for(t=0;t<r.length;++t)e=r[t],o=n.Data[e],s+='<option value="'+o.id+'">'+o.guiName+"</option>";return s+="</select>",$(s)},e.createShapeStyleEditor=w,S=function(){return $('<div class="linewidth-slider">').slider({min:1,max:4,step:1})},e.createLineWidthEditor=S,T=function(){return $("<input type='checkbox' class='visibility-switch'/>")},e.createVisibilityEditor=T,C=function(){var t=$("<input/>");return t.attr("type","text"),t},e.createTextEditor=C,x=function(){return new(0,i(184).Combobox)([{value:CanvasEx.TEXTPOS_TOPLEFT,html:$.t("Top Left")},{value:CanvasEx.TEXTPOS_TOPCENTER,html:$.t("Top Center")},{value:CanvasEx.TEXTPOS_TOPRIGHT,html:$.t("Top Right")},{value:CanvasEx.TEXTPOS_MIDDLELEFT,html:$.t("Middle Left")},{value:CanvasEx.TEXTPOS_MIDDLECENTER,html:$.t("Middle Center")},{value:CanvasEx.TEXTPOS_MIDDLERIGHT,html:$.t("Middle Right")},{value:CanvasEx.TEXTPOS_BOTTOMLEFT,html:$.t("Bottom Left")},{value:CanvasEx.TEXTPOS_BOTTOMCENTER,html:$.t("Bottom Center")},{value:CanvasEx.TEXTPOS_BOTTOMRIGHT,html:$.t("Bottom Right")}])},e.createTextPosEditor=x,P=function(){var t=$("<select />");return $("<option value='"+CanvasEx.HHISTDIR_LEFTTORIGHT+"'>"+$.t("Left")+"</option>").appendTo(t),$("<option value='"+CanvasEx.HHISTDIR_RIGHTTOLEFT+"'>"+$.t("Right")+"</option>").appendTo(t),t},e.createHHistDirectionEditor=P,L=function(t){var e=$('<div class="transparency-slider"><div class="gradient"></div></div>').slider({min:0,max:100,step:1}),i=["-moz-linear-gradient(left, %COLOR 0%, transparent 100%)","-webkit-gradient(linear, left top, right top, color-stop(0%,%COLOR), color-stop(100%,transparent))","-webkit-linear-gradient(left, %COLOR 0%,transparent 100%)","-o-linear-gradient(left, %COLOR 0%,transparent 100%)","linear-gradient(to right, %COLOR 0%,transparent 100%)"];return e.updateColor=function(t){var o=e.find(".gradient");$.browser.msie?o.css("filter","progid:DXImageTransform.Microsoft.gradient(startColorstr='"+t+"', EndColor=0, GradientType=1)"):i.forEach(function(e){o.css("background-image",e.replace(/%COLOR/,t))})},t?(e.updateColor(t.val()||"black"),t.on("change",function(t){e.updateColor(t.target.value)})):e.updateColor("black"),e},e.createTransparencyEditor=L,k=function(){var t=$("<select />"),e=i(175).StudyConsts;return $("<option value='"+e.PLOT_LINE+"'>"+$.t("Line")+"</option>").appendTo(t),$("<option value='"+e.PLOT_LINE_WITH_BREAKS+"'>"+$.t("Line With Breaks")+"</option>").appendTo(t),$("<option value='"+e.PLOT_HISTOGRAM+"'>"+$.t("Histogram")+"</option>").appendTo(t),$("<option value='"+e.PLOT_CROSS+"'>"+$.t("Cross",{context:"chart_type"})+"</option>").appendTo(t),$("<option value='"+e.PLOT_AREA+"'>"+$.t("Area")+"</option>").appendTo(t),$("<option value='"+e.PLOT_AREA_WITH_BREAKS+"'>"+$.t("Area With Breaks")+"</option>").appendTo(t),$("<option value='"+e.PLOT_COLUMNS+"'>"+$.t("Columns")+"</option>").appendTo(t),$("<option value='"+e.PLOT_CIRCLES+"'>"+$.t("Circles")+"</option>").appendTo(t),t},e.createPlotEditor=k,I=function(){var t=$("<select>");return $("<option value='open'>"+$.t("Open")+"</option>").appendTo(t),$("<option value='high'>"+$.t("High")+"</option>").appendTo(t),$("<option value='low'>"+$.t("Low")+"</option>").appendTo(t),$("<option value='close'>"+$.t("Close")+"</option>").appendTo(t),$("<option value='hl2'>"+$.t("(H + L)/2")+"</option>").appendTo(t),$("<option value='hlc3'>"+$.t("(H + L + C)/3")+"</option>").appendTo(t),$("<option value='ohlc4'>"+$.t("(O + H + L + C)/4")+"</option>").appendTo(t),t},e.createPriceSourceEditor=I,E=function(t){$("<img>").attr("src",t)},e.cacheUrl=E,A=function(t,e,i,o,n){var s=o||250,r=$.easing[n]||$.easing.easeOutCubic,a=0,l=Date.now(),h=function(o){var n=o?o<1e12?Date.now():o:Date.now(),c=n-l,d=Math.min(t,r(null,c,0,t,s)),p=d-a;a=d,e(p),c>=s?"function"==typeof i&&i():requestAnimationFrame(h)};requestAnimationFrame(h)},e.animate=A,V=function(e,i,o){return this._options=o=o||{},this._name=e,this._container=$('<div class="favored-list-container" />'),o.addClass&&this._container.addClass(o.addClass),this._quick_container=$('<div class="quick" />').appendTo(this._container),this._submenu=$('<span class="submenu">'+(this._options.submenuHtml||"")+"<i></i></span>").appendTo(this._container),o.tooltip&&(this._submenu.attr("title",o.tooltip),o.addTooltipClass&&this._submenu.addClass(o.addTooltipClass)),this._activeButton=null,this._onChange=new t,this._onSelect=new t,this._onResize=new t,this._onOpen=new t,this._load(i),M(this._container,null,{direction:"down",svg:null==o.svg||o.svg,reverse:!0,addClass:"narrow favored-list"+(o.popupAddClass?" "+o.popupAddClass:""),event:"popup-menu",popupSpacing:o.popupSpacing}),this._submenu.on("click",this._openMenu.bind(this)),$.browser.msie||TVXWindowEvents.on(e+"-change",$.proxy(this,"_onChangeInAnotherTab")),this},e.FavoredList=V,V.prototype._openMenu=function(){this._submenu.parent().hasClass("active")||this._onOpen.fire(),this._submenu.trigger("popup-menu",[this._data])},V.prototype._onChangeInAnotherTab=function(){this.reload(this._data)},V.prototype.reload=function(t){this._quick_container.empty(),this._load(t)},V.prototype._convertQuicksToData=function(t){return this._quicks.forEach(function(e){var i=!1;t.forEach(function(t){if(t.id===e)return i=!0,!1}),i||t.push({id:e,title:e,favoriteButton:{icon:{},title:e,addClass:"apply-common-tooltip"}})}),t},V.prototype._load=function(t){var e=this;this._options.showJustDefaultQuicks?this._quicks=this._options.defaultFavorites||[]:this._options.notShowQuicks?this._quicks=[]:this._quicks=TVSettings.getJSON(this._name+".quicks",this._options.defaultFavorites||[],!0),this._list=[],o.enabled("charting_library_base")||(t=this._convertQuicksToData(t)),$.grep(t,function(t,e){return!t.separator}).forEach(function(t,o){var n,s,r={index:o,data:t,svg:t.svg&&$(t.svg).clone(),toQuickButton:$('<span class="to-quick" title=""></span>').append($(i(187)).attr({width:16,height:16})),toggleFavorite:function(t,i){var o=void 0!==t?t:!this.isFavorite();o?this.markFavorite():this.unmarkFavorite(),e._toggleFavorite(r,o,i)},markFavorite:function(){this.toQuickButton&&this.toQuickButton.attr("title",$.t("Remove from favorites")).addClass("quicked")},unmarkFavorite:function(){this.toQuickButton&&this.toQuickButton.attr("title",$.t("Add to favorites")).removeClass("quicked")},isFavorite:function(){return e._quicks.indexOf(t.id)>-1},active:function(){return this.data.active()},drop:function(){return this.data.drop()}};e._options.notShowQuicks&&$.extend(r,{toQuickButton:null}),r.data.toQuickButtonStyle&&r.toQuickButton&&r.toQuickButton.css(r.data.toQuickButtonStyle),e._list.push(r),n={action:function(){e._change(r)},buttons:[],active:e._options.notShowActive?function(){return!1}:function(){return e._active&&r===e._active}},e._options.notShowQuicks||n.buttons.push({el:r.toQuickButton,handler:function(t){r.toggleFavorite(),t.preventDefault(),t.stopPropagation()}}),"function"==typeof r.data.drop&&(s=e._options.notShowQuicks?' style="right: 7px;"':"",n.buttons.push({el:$('<span class="delete" title="'+$.t("Delete")+'"'+s+"></span>"),handler:function(t){r.drop(),t.stopPropagation()}})),$.extend(t,n),r.toggleFavorite(r.isFavorite(),!0)}),this._data=t,this._options.notShowActive||this._addActive(this._list[0]),this._onResize.fire()},V.prototype._toggleFavorite=function(t,e,i){if(!this._options.notShowQuicks||this._options.showJustDefaultQuicks){if(e){t.favorite_button=this._createButton(t,this._quick_container);var o=this._lastFavoriteButton(t);o?t.favorite_button.insertAfter(o.favorite_button):t.favorite_button.prependTo(this._quick_container)}else i||this._removeButton(t);i||(e?this._quicks.indexOf(t.data.id)===-1&&this._quicks.push(t.data.id):this._quicks.indexOf(t.data.id)>-1&&this._quicks.splice(this._quicks.indexOf(t.data.id),1),this._saveFavorite(),this._markActive(),this._onResize.fire())}},V.prototype._lastFavoriteButton=function(t){for(var e=t.index-1;e>=0;e--)if(this._list[e]&&this._list[e].favorite_button)return this._list[e]},V.prototype._saveFavorite=function(){this._options.notShowQuicks||(TVSettings.setJSON(this._name+".quicks",this._quicks),TVXWindowEvents.emit(this._name+"-change"))},V.prototype._createButton=function(t){var e=this,i=t.data.favoriteButton,o=$("<span></span>").data("item",t);return i.addClass&&o.addClass(i.addClass),i.text&&o.text(t.text),i.title&&o.prop("title",TradingView.clean(i.title,!0)),t.svg&&$(t.svg).clone().appendTo(o),o.on("click",function(i){e._change(t),0===e._quicks.length&&e._openMenu(),i.preventDefault()}),o},V.prototype._removeButton=function(t){t.favorite_button&&(t.favorite_button.remove(),t.favorite_button=null)},V.prototype._markActive=function(t){var e,i,o;this._options.notShowActive||(e=this,this._active&&(t=this._active,t.isFavorite()?(o=e._quick_container.find(".just_active"),this._btnToggleActiveView(o,!1)):(i=this._addActive(t),0!==this._quicks.length&&this._btnToggleActiveView(i,!0))),$.map(this._list,function(i){t!==i||0===e._quicks.length?e._btnToggleActiveView(i.favorite_button,!1):i.favorite_button&&e._btnToggleActiveView(t.favorite_button,!0)}),i&&i.hasClass("selected")?this._container.addClass("not-favored-active"):this._container.removeClass("not-favored-active"))},V.prototype._btnToggleActiveView=function(t,e){t&&(e?t.addClass("selected"):t.removeClass("selected"))},V.prototype._addActive=function(t){return this._quick_container.find(".just_active").remove(),this._createButton(t).appendTo(this._quick_container).addClass("just_active")},V.prototype._clearActive=function(){this._quick_container.find(".just_active").remove()},V.prototype._clearActive=function(){},V.prototype._setActive=function(t){return this._active!==t&&(this._active=t,this._markActive(),!0)},V.prototype._change=function(t){if(this._onSelect.fire(t.data.id),!this._setActive(t))return!1;this._onChange.fire(t.data.id)},V.prototype.element=function(){return this._container},V.prototype._getItemByValue=function(t){for(var e in this._list)if(this._list[e].data.id===t)return this._list[e];throw Error("undefined value "+t+" in FavoredList")},V.prototype.onChange=function(){return this._onChange},V.prototype.onSelect=function(){return this._onSelect},V.prototype.onResize=function(){return this._onResize},V.prototype.onOpen=function(){return this._onOpen},V.prototype.setValue=function(t){var e=this._getItemByValue(t);this._setActive(e)},V.prototype.value=function(t){return this._active?this._active.data.value:void 0},V.prototype.removeById=function(t,e){var i=$.grep(this._data,function(e){return e.id!==t});this._list.forEach(function(e){e.data.id===t&&this._toggleFavorite(e,!1)},this),this.reload(i),"function"==typeof e&&e()},M=function(t,e,i){var o,n,s,r,a,l;t=$(t),i=i||{},i.activeClass=i.activeClass||"",o=(i.event||"click")+".popup-menu",i.hideEvent&&(n=i.hideEvent+".popup-menu"),s=function(){},r=s,a={},l=function(o,n,l){function h(e){var i=$(e.target).parents().andSelf();i.is(u)||i.is(t)||i.is(".charts-popup-tab-headers, .charts-popup-itemheader")||r()}function c(t){var e=$(t.target).parents().andSelf();e.is(".charts-popup-tab-headers, .charts-popup-itemheader")||i.notCloseOnButtons&&e.is(".icon-save, .icon-delete")||r()}function d(e,o,n){var s,r,a,l,h,c,p,_,f,m,g,v,y,b,w,S,T;if(e instanceof M.TabGroup){if(!e.tabs||!e.tabs.length)return;return 1!==e.tabs.length||e.tabs[0].title?(s=$('<div class="charts-popup-tab-group"></div>').appendTo(n),r=$('<div class="charts-popup-tab-headers"></div>').appendTo(s),a=null,void $.each(e.tabs||[],function(t,i){var o,n;i.items&&i.items.length&&(o=$('<div class="charts-popup-tab"></div>').hide().appendTo(s),$.each(i.items,function(){d(this,void 0,o)}),n=$('<span class="charts-popup-tab-header">').append($('<a href="javascript://" class="charts-popup-tab-header-label">').text(i.name)).appendTo(r),n.on("click",function(t){n.is(".active")||(r.find(".charts-popup-tab-header.active").removeClass("active"),n.addClass("active"),s.find(".charts-popup-tab").hide(),o.show(),t&&t.preventDefault(),"function"==typeof e.onChange&&e.onChange.call(e,i.name))}),a&&!i.active||(a=n,r.find(".charts-popup-tab-header.active").removeClass("active"),n.addClass("active"),s.find(".charts-popup-tab").hide(),o.show()))})):void $.each(e.tabs[0].items,function(){d(this,void 0,n)})}return e instanceof M.Group?(l=$('<div class="charts-popup-group"></div>').appendTo(n),e.title&&(h=$('<div class="charts-popup-itemheader"></div>').text(e.title).prepend($('<span class="charts-popup-itemheader-icon"></span>')),e.collapsible&&(l.addClass("charts-popup-group-collapsible"),l.toggleClass("collapsed",e.collapsed),h.on("click",function(){l.toggleClass("collapsed"),"function"==typeof e.onChange&&e.onChange(l.hasClass("collapsed")),u.height()===parseInt(u.css("max-height"))?u.addClass("popup-menu-scroll-y"):u.height()<parseInt(u.css("max-height"))&&u.removeClass("popup-menu-scroll-y")})),l.append(h)),void $.each(e.items,function(t){d(this,1,l)})):e instanceof M.Header?void n.append($('<div class="charts-popup-itemheader"></div>').text(e.title)):e.separator?(c=$('<span class="separator"></span>'),void n.append(c)):(c=$('<a class="item" href="#">'),"function"==typeof e.deleteAction&&"function"==typeof e.saveAction&&c.addClass("item-twobuttons"),e.url&&c.attr("href",e.url),e.target&&c.attr("target",e.target),o||c.addClass("first"),"function"==typeof e.active?e.active(e)&&c.addClass("active"):e.active&&c.addClass("active"),e.addClass&&c.addClass(e.addClass),e.addData&&c.data(e.addData),e.disabled&&c.addClass("disabled"),"function"==typeof e.action&&(p=e.action,_=function(t){var i=$(t.target).parents().andSelf();i.is(b)||i.is(S)||(p.apply(c,arguments),!e.url&&t&&"function"==typeof t.preventDefault&&t.preventDefault())},i.upAction?c.bind("mouseup",_):c.bind("click",_)),e.date?(f=$('<span class="title"></span>').appendTo(c),$('<span class="date"></span>').text(e.date||"").appendTo(c)):e.icon&&!i.svg?(m=$('<span class="icon"></span>').appendTo(c),m.css("background-image",e.icon.image||""),e.icon.offset&&m.css("background-position","string"==typeof e.icon.offset?e.icon.offset:e.icon.offset.x+"px "+e.icon.offset.y+"px"),f=$('<span class="title"></span>').appendTo(c)):i.svg===!0&&e.svg?(i.wrapIcon?c.append($('<span class="icon-wrap">').append(e.svg)):c.append(e.svg),f=$('<span class="title"></span>').appendTo(c)):e.iconClass?(c.append($('<span class="icon"></span>').addClass(e.iconClass)),f=$('<span class="title"></span>').appendTo(c)):f=$('<span class="title-expanded"></span>').appendTo(c),e.html?f.html(e.html):f.text(TradingView.clean(e.title,!0)||""),g=$('<span class="shortcut"></span>').appendTo(c),e.shortcut&&g.text(e.shortcut.keys),"function"==typeof e.deleteAction&&(v=e.deleteAction,y=e.deleteAction.title||$.t("Delete"),b=$('<span class="icon-delete">'),b.attr("title",y),b.on("click",function(t){v.apply(c,arguments),t.preventDefault()}),c.append(b)),"function"==typeof e.saveAction&&(w=e.saveAction,y=e.saveAction.title||$.t("Save"),S=$('<span class="icon-save">'),S.attr("title",y),S.on("click",function(t){w.apply(c,arguments),t.preventDefault()}),c.append(S)),e.buttons instanceof Array&&e.buttons.length&&e.buttons.forEach(function(t){t.el instanceof $||(t.el=$(t.el)),t.el.appendTo(c),t.handler&&t.el.on("click",function(e){t.handler.apply(c,arguments)})}),void 0!==e.counter&&(T=e.counterBlue?"blue":"",$('<span class="counter"></span>').text(e.counter+"").addClass(T).appendTo(c)),n.append(c),void t.data("popup-menu",n))}var p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,D,O,B,R,N,F=n||e;if("function"==typeof F&&(F=F()),$(this).hasClass("open")||$(this).hasClass("active"))return o.preventDefault(),r(),void(p=a.scrollTop);switch(r=function(){a.scrollTop=u.scrollTop(),u.remove(),t.removeClass("active open "+i.activeClass),t.data("popup-menu",null),$(document).off("click",c),$(document).off("mousedown",h),Modernizr.touch&&$(document).off("touchstart.chartgui",h),$(document).off("selectstart.popup-menu"),r=s,i.onRemove&&i.onRemove()},t.addClass("active open "+i.activeClass),u=$('<div class="charts-popup-list">'),i.addClass&&u.addClass(i.addClass),i.zIndex&&u.css("z-index",i.zIndex),_=u,i.listInner&&(_=$('<div class="list-inner">').appendTo(_)),i.listTable&&(_=$('<div class="list-table">').appendTo(_)),$.each(F,function(t){d(this,t,_)}),setTimeout(function(){$(document).on("click",c),$(document).on("mousedown",h),Modernizr.touch&&$(document).on("touchstart.chartgui",h)},0),i.upAction&&$(document).on("selectstart.popup-menu",function(){return!1}),u.appendTo(document.body),f=$(window).width(),m=Math.min($(window).height(),$("body").height()),g=t.outerWidth(),v=t.outerHeight(),y=t.offset(),p=$(window).scrollTop()||0,y.top-=p,y.top=Math.round(y.top),y.left=Math.round(y.left),b=u.outerWidth(),w=u.outerHeight(),S=void 0!==i.viewportSpacing?i.viewportSpacing:10,T=i.popupSpacing?~~i.popupSpacing:1,C=i.popupDrift?~~i.popupDrift:0,x=w-u.height(),P="down",i.direction&&(P="function"==typeof i.direction?i.direction():i.direction),L=!!i.reverse,"down"===P?(k=m-y.top-v-T-S-x,I=y.top-T-S-x,k<Math.max(w||0,100)&&I>k&&(P="up")):"right"===P&&(E=f-y.left-g-T-S-x,A=y.left-T-S-x,E<Math.max(b||0,100)&&A>E&&(P="left")),P){case"down":case"up":"down"===P?u.css("top",y.top+v+T+"px"):u.css("bottom",m-y.top+T+"px").css("top","auto"),L?u.css("left",Math.max(y.left+C+g-b,S)+"px").css("right","auto"):u.css("left",y.left+C+"px").css("right","auto");break;case"right":case"left":T=Math.max(T,4),"right"===P?u.css("left",Math.floor(y.left+g+T)+"px").css("right","auto"):u.css("left",Math.floor(Math.max(y.left-b-T,S))+"px").css("right","auto"),L?u.css("top",Math.floor(Math.max(y.top+C+v-w,S))+"px"):u.css("top",Math.floor(y.top+C)+"px")}for(u.show(),V=y.top,"up"===P||{left:1,right:1}[P]&&L?"up"!==P?V+=v:V-=v+T+x+S:V=m-V-v-2*T-x,u.height()>V&&u.addClass("popup-menu-scroll-y"),u.css("max-height",V+"px"),i.careRightBorder&&(D=f+$(window).scrollLeft(),parseInt(u.css("left"))+u.width()+S>D&&u.css("left",D-u.width()-S+"px").css("right","auto")),i.careBottomBorder&&parseInt(u.css("top"))+u.height()+S>m+p&&u.css("top",m-u.height()-S+p+"px"),B=t.parents().andSelf(),R=B.size();R--;)if("fixed"===B.eq(R).css("position")){O=B.eq(R);break}O&&(N=u.offset(),u.css({position:"fixed",left:N.left-$(document).scrollLeft(),right:"auto"})),u[0].scrollHeight>u.height()&&u.addClass("popup-with-scroll"),o&&o.preventDefault()},o&&t.bind(o,l),n&&t.bind(n,function(){r()}),i.runOpened&&l()},M.TabGroup=function t(e){if(!(this instanceof t))return new t(e);e=e||{},this.tabs=[],"function"==typeof e.onChange&&(this.onChange=e.onChange)},M.TabGroup.prototype.appendTab=function(t,e,i){if(null==t?t="":t+="",e||(e=[]),i||(i={}),!Array.isArray(e))throw new TypeError("items must be an array");return this.tabs.push({name:t,items:e,active:!!i.active}),e},M.Header=function t(e){if(!(this instanceof t))return new t(e);this.title=e},M.Group=function t(e){if(!(this instanceof t))return new t(e);e=e||{},this.items=[],this.title=null==e.title?"":e.title+"",this.collapsible=!!e.collapsible,this.collapsed=!!e.collapsed,"function"==typeof e.onChange&&(this.onChange=e.onChange)},M.Group.prototype.push=function(){this.items.push.apply(this.items,arguments)},e.bindPopupMenu=M,D=function(t){t=$(t),t.unbind(".popup-menu"),t.removeData("popup-menu")},e.unbindPopupMenu=D,O=function(t,e,i,o,n,s){var r,a,l,h,c,d=e.title?e.title:$.t("Save New Chart Layout"),p=TVDialogs.createDialog(d),u=function(){var i,n,s=p.find('input[name="name"]'),r=s.val(),a=[];if(o)for(i=0;i<o.length;i++)"bool"===o[i].type&&(n=p.find('input[name="'+o[i].name+'"]'),a.push(n[0].checked));return r?(t(r,a),TVDialogs.destroy(d)):(TVDialogs.showError(e.error||$.t("Please enter chart name"),TVDialogs.get(d)),s.focus()),!1};if(i=i||"",s=s||{},s.inputValue=s.inputValue?s.inputValue:"",p.css("width","400px"),p.find("._tv-dialog-content").html('<div class="main"><form><p>'+(e.label?$.t(e.label):$.t("Chart name"))+':</p><p class="_tv-dialogs-name"><input type="text" name="name" maxlength="'+i+'"/></p><p class="_tv-dialog-right"></p></form></div>').find("input").val(s.inputValue),s.inputSelectEnable&&"boolean"==typeof s.inputSelectEnable&&p.find('input[name="name"]').select(),o)for(r=p.find("._tv-dialog-right"),a=0;a<o.length;a++)"bool"===o[a].type&&(l=$('<p class="_tv-dialogs-name"></p>'),h=o[a].hint?$('<div class="_tv-dialogs-label-hint apply-common-tooltip"></div>'):$(),c=$('<label><input type="checkbox" style="vertical-align:top;margin-top:2px" name="'+o[a].name+'"/> '+$.t(o[a].title)+"</label>"),h.attr("title",o[a].hint),l.append(c,h).insertBefore(r));p.find("form").submit(u),$('<a class="_tv-button wide ok">'+$.t("OK")+"</a>").click(u).css({"margin-right":"5px"}).appendTo(p.find("._tv-dialog-right")),$('<a class="_tv-button wide cancel">'+$.t("Cancel")+"</a>").click(function(){TVDialogs.destroy(d)}).appendTo(p.find("._tv-dialog-right")),"function"==typeof n&&n(p),TVDialogs.positionDialog(p,{left:$(window).width()/2-p.width()/2,top:$(window).height()/2-p.height()/2}),TVDialogs.applyHandlers(p),p.find('input[name="name"]').focus()},e.showChartNameDialog=O}).call(e,i(34),i(1))},function(t,e,i){"use strict";function o(t){return this.jqObj=null,this.data=t,this.init(),this._prepareValue(),this._prepareCallback(),this._prepareChildren(),this._applyAttributes(),this.jqObj}function n(t,e){this.value=t,this.html=e||"",this.jqItem=this._render()}function s(t){this._value=null,this.items=[],this.width=0,this.jqWrapper=null,this.jqSwitcher=null,this.jqTitle=null,this.jqIcon=null,this.jqItems=null,this.callback=null,this._init(),this.addItems(t),this.joinParts()}var r=i(185);o.selectOptions={type:"option",value:null,html:null},o.optionsData={radiogroup:{type:"radio",name:null,value:null,label:null},select:o.selectOptions,"select-one":o.selectOptions,"select-multiple":o.selectOptions},o.customTypes=["radiogroup","fontpicker","colorpicker","combobox"],o.prototype._tagIsInput=function(t){return jQuery.inArray(this.data.type,["text","radio","checkbox","hidden","reset","image","file"])!==-1},o.prototype.init=function(){this._tagIsInput()?this.jqObj=r.create("input",{name:this.data.name,type:this.data.type}):this.jqObj=r.create(this.data.type,{name:this.data.name})},o.prototype._eventIsKeyUp=function(){return jQuery.inArray(this.data.type,["text","textarea"])!==-1},o.prototype._eventIsClick=function(){return jQuery.inArray(this.data.type,["checkbox","radio","option"])!==-1},o.prototype._eventIsChange=function(){return jQuery.inArray(this.data.type,["select","select-one","select-multiple","radiogroup"])!==-1},o.prototype._prepareCallback=function(){this.data.callback&&(this._eventIsKeyUp()?this.jqObj.keyup(this.data.callback):this._eventIsClick()?this.jqObj.click(this.data.callback):this._eventIsChange()&&this.jqObj.bind("change",this.data.callback),delete this.data.callback)},o.prototype._childTag=function(){return{select:"option","select-one":"option","select-multiple":"option",radiogroup:"radio"}[this.data.type]},o.prototype._inheritedProperties=function(){var t={type:this._childTag()};return"radiogroup"===this.data.type&&(t.name=this.data.name),t},o.prototype._extendChildProps=function(t){var e=jQuery.extend(this._inheritedProperties(),t);return this.data.value===t.value&&(e.selected=!0),e},o.prototype._prepareChildren=function(){if(this.data.options){var t=this;jQuery.each(this.data.options,function(e,i){t.jqObj.append(new o(t._extendChildProps(i)))})}},o.prototype.isCustom=function(){return jQuery.inArray(this.data.type,this.customTypes)!==-1},o.prototype._isStoringValue=function(){return jQuery.inArray(this.data.type,["text","textarea","option","radio","checkbox"])!==-1},o.prototype._htmlAsValue=function(){return"textarea"===this.data.type},o.prototype._valAsValue=function(){return jQuery.inArray(this.data.type,["text","checkbox","radio","option","select","select-one","select-multiple"])},o.prototype._getControlValue=function(){return{checkbox:1}[this.data.type]||this.data.value},o.prototype._setControlValue=function(){this._valAsValue()?this.jqObj.val(this._getControlValue()):this._htmlAsValue()&&this.jqObj.html(this.data.value)},o.prototype._getCheckedAttr=function(){return{option:"selected",radio:"checked",checkbox:"checked"}[this.data.type]},o.prototype._setChecked=function(){this.data.selected&&this.jqObj.attr(this._getCheckedAttr(),!0)},o.prototype._setValue=function(){this._setControlValue(),o.isCheckable(this.data.type)&&this._setChecked()},o.prototype._prepareValue=function(){this._isStoringValue()&&this._setValue()},o.prototype._applyAttributes=function(){this.jqObj.attr(r.cleanAttributes(this.data))},o.value=function(t){return o.controlCheckable(t)?t.checked:t.value},o.isCheckable=function(t){return jQuery.inArray(t,["checkbox","radio","option"])!==-1},o.controlType=function(t){var e,i;return"string"==typeof t?t:(e=jQuery(t),i=null,e.attr("type")&&(i=e.attr("type"),jQuery.inArray(i,["textarea","text","select","select-one","select-multiple","submit"]))?i:e.attr("tagName"))},o.controlCheckable=function(t){return o.isCheckable(o.controlType(t))},o.controlToggleChecked=function(t,e){return i(186).setAttr(t,"checked",e)},o.controlSetValue=function(t,e){return o.controlCheckable(t)?o.controlToggleChecked(t,e):i(186).setAttr(t,"value",e)},o.currentOption=function(t){return t.options[t.selectedIndex]},o.currentOptionInnerHTML=function(t){return o.currentOption(t).innerHTML},n.prototype.eq=function(t){return this.value===t},n.prototype.width=function(t){return this.jqItem.width()},n.prototype._render=function(t){var e=$("<span/>").append($(this.html).clone());return $('<div class="item"></div>').append(e)},n.prototype.render=function(t){return this.jqItem},n.prototype.select=function(t){t?this.jqItem.addClass("selected"):this.jqItem.removeClass("selected")},n.prototype.selectAndReturnIfValueMatch=function(t){return this.eq(t)?(this.select(!0),this):(this.select(!1),null)},s.prototype._init=function(){this._initWrapper(),this._initSwitcher(),this._initOptions()},s.prototype._initTitle=function(){this.jqTitle=$('<span class="title" />')},s.prototype._initIcon=function(){this.jqIcon=$('<span class="icon" />')},s.prototype._initOptions=function(){var t=i(186);this.jqItems=t.createPopup({class:"items"})},s.prototype._initWrapper=function(){this.jqWrapper=$('<div class="custom-select" />'),this.jqWrapper.data({disable:this.disable.bind(this),enable:this.enable.bind(this)})},s.prototype._initSwitcher=function(){var t=this;this._initTitle(),this._initIcon(),this.jqSwitcher=$('<div class="switcher" />'),this.jqSwitcher.append(this.jqTitle),this.jqSwitcher.append($(this.jqIcon).clone()),this.opened=!1,this.jqSwitcher.click(function(e){t.toggleItems()}),t=this,$(document).click(function(e){$(e.target).closest(t.jqSwitcher).length||(!t.jqSwitcher.is(e.target)&&0===t.jqSwitcher.has(e.target).length||!t.jqItems.is(e.target)&&0===!t.jqItems.has(e.target).length)&&t.opened&&(t.jqItems.hide(),t.opened=!1,t.jqSwitcher.removeClass("open"),e.stopPropagation())})},s.prototype.toggleItems=function(){this.disabled()||(this.opened?(this.jqItems.hide(),this.jqSwitcher.removeClass("open"),this.opened=!1):(this.jqItems.show(),this.jqSwitcher.addClass("open"),this.opened=!0))},s.prototype.setWidth=function(){this.jqWrapper.width(this.width)},s.prototype.joinParts=function(){this.jqWrapper.append(this.jqSwitcher),this.jqWrapper.append(this.jqItems),this.jqWrapper.selectable(!1)},s.prototype.render=function(){return this.jqWrapper},s.prototype.selectItemByValue=function(t){var e=null;return $(this.items).each(function(i,o){var n=o.selectAndReturnIfValueMatch(t);n&&(e=n)}),e},s.prototype.setValue=function(t){if(this._value!==t){var e=this.selectItemByValue(t);this._value=t,this.jqTitle.html(e.html),this.change()}},s.prototype.change=function(t){if(t)return void(this.callback=t);this.callback&&this.callback.call(this)},s.prototype.value=function(){return this._value},s.prototype.val=function(t){return void 0!==t?void this.setValue(t):this.value()},s.prototype.addItems=function(t){var e=this;$(t).each(function(t,i){e.addItem(i.value,i.html)})},s.prototype.addItem=function(t,e){var i,o=this,s=new n(t,e);this.items.push(s),i=s.render(),i.click(function(){o.setValue(t),o.toggleItems()}),this.jqItems.append(i),null===this.value()&&this.setValue(t)},s.prototype.disable=function(){this._disabled=!0},s.prototype.enable=function(){this._disabled=!1},s.prototype.disabled=function(){return this._disabled},e.Input=o,e.Combobox=s},function(t,e){"use strict";var i={};i.renderAttributes=function(t){var e,i="";for(e in t)t[e]&&(i+=" "+e+'="'+t[e]+'"');return i},i.create=function(t,e){var i=$(document.createElement(t));return e&&(e.html&&(i.html(e.html),delete e.html),i.attr(e)),i},i.validAttributes=["abbr","accept-charset","accept","accesskey","action","align","alink","alt","archive","axis","background","bgcolor","border","cellpadding","cellspacing","char","charoff","charset","checked","cite","class","classid","clear","code","codebase","codetype","color","cols","colspan","compact","content","coords","data","datetime","declare","defer","dir","disabled","enctype","face","for","frame","frameborder","headers","height","href","hreflang","hspace","http-equiv","id","ismap","label","lang","language","link","longdesc","marginheight","marginwidth","maxlength","media","method","multiple","name","nohref","noresize","noshade","nowrap","object","onblur","onchange","onclick","ondblclick","onfocus","onkeydown","onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onreset","onselect","onsubmit","onunload","profile","prompt","readonly","rel","rev","rows","rowspan","rules","scheme","scope","scrolling","selected","shape","size","span","src","standby","start","style","summary","tabindex","target","text","title","type","usemap","valign","value","valuetype","version","vlink","vspace","width"],i.validAttribute=function(t){return jQuery.inArray(t,i.validAttributes)!==-1},i.cleanAttributes=function(t){return jQuery.each(t,function(e,o){i.validAttribute(e)||delete t[e]}),t},t.exports=i},function(t,e,i){"use strict";var o=i(185),n=i(183).setMouseEventHandler,s={};s.createLabel=function(t,e,i){return o.create("label",$.extend(i,{html:e,for:t}))},s.unbindContextMenu=function(t){t.contextMenu(function(t){return!1})},s.offsetX=function(t,e){return t.width()+e.pageX},s.offsetY=function(t,e){return t.height()+e.pageY},s.isElementInViewport=function(t){"function"==typeof jQuery&&t instanceof jQuery&&(t=t[0]);var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)},s.checkObjIsOutOfWindowX=function(t,e){var i,o=$(window).width()-s.offsetX(t,e);return o<0?(i=e.pageX+o,i>0?i:0):e.pageX},s.checkObjIsOutOfWindowY=function(t,e){var i,o=$(window).height()-s.offsetY(t,e);return o<0?(i=e.pageY+o,i>0?i:0):e.pageY},s.checkObjIsOutOfWindow=function(t,e){return{left:s.checkObjIsOutOfWindowX(t,e),top:s.checkObjIsOutOfWindowY(t,e)}},s.setAttr=function(t,e,i){return t.attr?t.attr(e,i):t[e]=i,t},s.removeAttr=function(t,e){return t.removeAttr?t.removeAttr(e):t.removeAttribute(e),t},s.notNull=function(t){return $.inArray(t,[null,void 0,"false","null","undefined",0])===-1},s.hideControl=function(t){return t.css({position:"absolute",top:-1e3,left:-1e3})},s.createPopup=function(t,e,i){return new s.Popup(t,e,i).render()},s.Popup=function(t,e,i){if(void 0!==t.selector?this.jqDiv=t:t.nodeType?this.jqDiv=$(t):this.jqDiv=o.create("div",t),i){var s=this;$.each(i,function(t,e){s[t]=e})}n(this.jqDiv,this),this._callback=e},s.Popup.prototype.render=function(){return this.jqDiv},s.Popup.prototype.show=function(){this.jqDiv.show()},s.Popup.prototype.hide=function(){this.jqDiv.hide()},s.Popup.prototype.setVisible=function(t){t?this.show():this.hide()},s.Popup.prototype.isVisible=function(){return this.jqDiv.is(":visible")},s.Popup.prototype.contextMenuEvent=function(t){return!1},s.Popup.prototype.mouseDownOutsideEvent=function(t){if(this.isVisible()){if(this._callback&&!this._callback())return;this.hide()}},t.exports=s},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.5 13.8"><path d="M7.3 0l2.2 4.5 5 .7-3.6 3.6.8 5-4.4-2.4-4.5 2.4.8-5L0 5.2l5-.7z"/></svg>'},function(t,e,i){"use strict";function o(t,e,i){var o=this._mtpStudyId()+"@mtp-mtpredictor",n=i||p.findStudyMetaInfo(t.studiesMetaData(),o),r=e||l(n,null,null,t.studyVersioning()),a=TradingView.Study.lineToolNameForPointsBasedStudy(o);s.call(this,t,this.createPaneViews(t),r,a),this._doNotNeedLine=!0,this._turnaroundCounter=0,this._nextTurnaround(),this._metaInfo=n,this._graphics=new c(n),this._formatter=new d}var n=i(165),s=n.StudyLineDataSource,r=n.StudyLineDataSourcePaneView,a=i(171),l=a.prepareStudyProperties,h=i(82).LineDataSource,c=i(167),d=i(94).VolumeFormatter,p=i(139);inherit(o,s),o.prototype.series=function(){return TradingView.isInherited(this._ownerSource.constructor,TradingView.Series)?this._ownerSource:this._ownerSource.series()},o.prototype.calcIsActualSymbol=function(){return h.prototype.calcIsActualSymbol.call(this)},o.prototype._nextTurnaround=function(){this._turnaround=this._mtpStudyId()+"_"+ ++this._turnaroundCounter},o.prototype.createPaneViews=function(t){return[new r(this,t),new TradingView.Study.StudyPaneView_textmarks(this,t),new TradingView.Study.StudyPaneView_polygons(this,t),new TradingView.Study.StudyPaneView_lines(this,t)]},o.prototype.onData=function(t){var e=this;if("data_update"===t.method&&t.params.customId==="pointset_"+this._currentPointsetId)h.prototype.onData.call(this,t),this._points.length===this.pointsCount()&&this._requestStudy();else if("data_update"===t.method&&t.params.customId===this._studyId){if(!this._checkTurnaround(t.params.turnaround))return;TradingView.Study.prototype._makeJSONForNSData.call(this,t).then(function(i){t.params.nonseries.d=i,""!==t.params.nonseries.d&&e._graphics.process(t.params.nonseries),t.params.nonseries.indexes.length>0&&(e._indexes=t.params.nonseries.indexes),e.updateAllViews(),e._model.updateSource(e)})}},o.prototype._requestStudy=function(){var t=this,e=function(e){t.onData(e)},i=this._studyInputs();i&&(this._studyId?(this._nextTurnaround(),this._model.chartApi().modifyStudy(this._studyId,this._turnaround,i,e)):(this._studyId=TradingView.Study.makeNextStudyId(),this._model.chartApi().createStudy(this._studyId,this._turnaround,this._model.mainSeries()._seriesId,this._metaInfo.id+"-1!",i,e)))},t.exports=o},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._invalidated=!0}function n(t,e){this._constructor="LineToolBarsPattern";var i=e||new f("linetoolbarspattern");a.call(this,t,new o(this,t),i),i.mirrored.listeners().subscribe(this,n.prototype.mirror),i.flipped.listeners().subscribe(this,n.prototype.flip),i.addExclusion("mirrored"),i.addExclusion("flipped"),this._scaleCoeff=1,this.version=n.version,this._pattern=[],this._properties.mode.listeners().subscribe(this,n.prototype.onModeChanged)}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(166).VertLineRenderer,h=i(150).RectangleRenderer,c=i(152).TrendLineRenderer,d=i(100).Action,p=i(113),u=i(114).PaneRendererLine,_=i(117),f=i(91).DefaultProperty,m=i(119);inherit(o,r),o.prototype.renderer=function(){var t,e,i,o,r,d,f,g,v,y,b,w,S,T,C,x,P,L,k;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._pattern&&2===this._source.points().length){if(t=this._source.points()[0].index,e=this._source.points()[1].index,!(i=t<e?this._points[0]:this._points[1]))return new _;if(o=parseInt(this._source.properties().mode.value(),10),r=Math.abs((this._points[0].x-this._points[1].x)/(this._pattern.length-1)),o===n.BARS_MODE||o===n.OPENCLOSE_MODE){for(d=new _,f=o===n.BARS_MODE?["high","low"]:["open","close"],g=f[0],v=f[1],y=0;y<this._pattern.length;y++)b=Math.round(i.x+y*r+.5),w=i.y+Math.round(this._pattern[y][g]),S=i.y+Math.round(this._pattern[y][v]),T={},T.points=[new s.Point(b-1,w),new s.Point(b+1,S)],T.color=this._source.properties().color.value(),T.linewidth=1,T.backcolor=this._source.properties().color.value(),T.fillBackground=!0,T.transparency=10,d.append(new h(T));return this.isAnchorsRequired()&&d.append(this.createLineAnchor({points:this._points})),d}return d=new _,T={},T.barSpacing=r,T.items=this._pattern,T.histogramBase=0,T.lineIndex=0,T.lineColor=m.generateColor(this._source.properties().color.value(),10),T.lineStyle=CanvasEx.LINESTYLE_SOLID,T.lineWidth=2,T.hittest=new p(p.MOVEPOINT),d.append(new u(T)),this.isAnchorsRequired()&&d.append(this.createLineAnchor({points:this._points})),d}return d=new _,this._points.length<2?d:(C=this._points[0],x=this._points[1],P={},P.points=[C],P.color="#808080",P.linewidth=1,P.linestyle=CanvasEx.LINESTYLE_SOLID,d.append(new l(P)),L={},L.points=[x],L.color="#808080",L.linewidth=1,L.linestyle=CanvasEx.LINESTYLE_SOLID,d.append(new l(L)),k={points:[C,x],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},d.append(new c(k)),d)},o.prototype.update=function(){r.prototype.update.call(this),this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,r,a,l,h,c,d,p,u,_,f,m;!this._source.priceScale()||this._source.priceScale().isEmpty()||this._points.length<2||(this._source._pattern&&this._source._pattern.length>0&&2===this._source.points().length?(t=this._source.priceScale(),e=this._source.firstPatternPrice(),i=this._source.pressCoeff(),t=this._source.priceScale(),o=this._source.ownerSource().firstValue(),n=t.priceRange(),t.isPercent()?(a=n.convertToPercent(e,o),r=t.priceToCoordinate(a)):r=t.priceToCoordinate(e),l=function(s){var a=(s-e)*i+e;return t.isPercent()&&(a=n.convertToPercent(a,o)),t.priceToCoordinate(a)-r},h=parseInt(this._source.properties().mode.value()),c=this._source.points()[0].index,d=this._source.points()[1].index,p=c>d?1:0,u=this._points[p],_=u.x,f=Math.abs((this._points[0].x-this._points[1].x)/(this._source._pattern.length-1)),m={0:function(t){return{high:l(t[TradingView.HIGH_PLOT]),low:l(t[TradingView.LOW_PLOT])}},1:function(t,e){return new s.Point(_+e*f,l(t[TradingView.CLOSE_PLOT])+u.y)},2:function(t){return{open:l(t[TradingView.OPEN_PLOT]),close:l(t[TradingView.CLOSE_PLOT])}},3:function(t,e){return new s.Point(_+e*f,l(t[TradingView.OPEN_PLOT])+u.y)},4:function(t,e){return new s.Point(_+e*f,l(t[TradingView.HIGH_PLOT])+u.y)},5:function(t,e){return new s.Point(_+e*f,l(t[TradingView.LOW_PLOT])+u.y)},6:function(t,e){return new s.Point(_+e*f,l((t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT])/2)+u.y)}},this._pattern=this._source._pattern.map(m[h])):delete this._pattern)},inherit(n,a),n.version=2,n.BARS_MODE=0,n.LINE_MODE=1,n.OPENCLOSE_MODE=2,n.LINEOPEN_MODE=3,n.LINEHIGH_MODE=4,n.LINELOW_MODE=5,n.LINEHL2_MODE=6,n.prototype.onModeChanged=function(){var t=this.patternPriceDiff();t*=this._pressCoeff,this._points[1].price=this._timePoint[1].price=this._points[0].price+t},n.prototype.additionalActions=function(t){var e,i,o=new d({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),n=new d({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});return o.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().mirrored,!o.properties().mirrored.value(),"Bats Pattern Mirroring"),o.updateAllViews(),o._model.updateSource(o)}),n.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().flipped,!o.properties().flipped.value(),"Bats Pattern Flipping"),o.updateAllViews(),o._model.updateSource(o)}),e=new d({checkable:!0,text:$.t("Restore Size")}),i=this,e.callbacks().subscribe(null,function(e){var o=i.points()[0],n=i.patternPriceDiff(),s=o.price+n,r=o.index+i._pattern.length-1;t.startChangingLinetool(i,{price:s,index:r},1,{}),t.changeLinePoint({price:s,index:r},{}),t.endChangingLinetool()}),[o,n,e]},n.prototype.pointsCount=function(){return 2},n.prototype.state=function(t){var e=a.prototype.state.call(this,t);return e.pattern=this._pattern,e},n.prototype.restoreData=function(t){t.pattern&&(this._pattern=t.pattern)},n.prototype.title=function(){return"Bars Pattern"},n.prototype.cloneData=function(t){this._pattern=TradingView.clone(t._pattern)},n.prototype.mirror=function(){var t,e,i,o,n,s=this._pattern,r=s[0][TradingView.HIGH_PLOT],a=Math.min(s[0][TradingView.LOW_PLOT],s[0][TradingView.HIGH_PLOT]),l=Math.max(s[0][TradingView.LOW_PLOT],s[0][TradingView.HIGH_PLOT]);for(t=1;t<s.length;t++)a=Math.min(a,s[t][TradingView.LOW_PLOT]),l=Math.max(l,s[t][TradingView.HIGH_PLOT]);if(a<l)for(e=(a+l)/2,i=function(t){return e-(t-e)},t=0;t<s.length;t++)s[t][TradingView.HIGH_PLOT]=i(s[t][TradingView.HIGH_PLOT]),s[t][TradingView.LOW_PLOT]=i(s[t][TradingView.LOW_PLOT]),s[t][TradingView.OPEN_PLOT]=i(s[t][TradingView.OPEN_PLOT]),s[t][TradingView.CLOSE_PLOT]=i(s[t][TradingView.CLOSE_PLOT]);o=s[0][TradingView.HIGH_PLOT]-r,n=s[s.length-1][TradingView.LOW_PLOT]-s[0][TradingView.HIGH_PLOT],this._points[0].price+=o,this._points[1].price=this._points[0].price+n,this.updateAllViews()},n.prototype.flip=function(){var t,e,i;for(this._points[0].price=this._points[1].price,t=0;t<this._pattern.length/2;t++)e=this._pattern[t],this._pattern[t]=this._pattern[this._pattern.length-t-1],this._pattern[this._pattern.length-t-1]=e;i=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT],this._points[1].price=this._points[0].price+i,this.updateAllViews()},n.prototype.firstPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10);return i===n.LINEHL2_MODE?(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2:(t={0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[0][e])},n.prototype.lastPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10);return i===n.LINEHL2_MODE?(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2:(t={0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[this._pattern.length-1][e])},n.prototype.patternPriceDiff=function(){return this.lastPatternPrice()-this.firstPatternPrice()},n.prototype.pressCoeff=function(){var t=this.patternPriceDiff(),e=this.points()[0].price,i=this.points()[1].price,o=i-e,n=o/t;return this._pressCoeff=n,n},n.prototype.addPoint=function(t,e){var i,o,s,r,l,h,c,d,p,u,_=this._model.mainSeries(),f=_.nearestIndex(t.index,TradingView.SEARCH_NEAREST_RIGHT);if(this.properties().mode.value()===n.BARS_MODE?t.price=_.bars().valueAt(f)[TradingView.HIGH_PLOT]:t.price=_.bars().valueAt(f)[TradingView.CLOSE_PLOT],i=this.priceScale().priceRange().length(),t.price+=.05*i,o=_.priceScale(),o.isPercent()&&(s=_.firstValue(),t.price=o.priceRange().convertToPercent(t.price,s)),r=a.prototype.addPoint.call(this,t,e,!0)){for(l=Math.min(this.points()[0].index,this.points()[1].index),h=Math.max(this.points()[0].index,this.points()[1].index),f=this._model.mainSeries().nearestIndex(l,TradingView.SEARCH_NEAREST_RIGHT),c=this._model.mainSeries().nearestIndex(h,TradingView.SEARCH_NEAREST_LEFT),this.points()[0].index>this.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[],d=f;d<=c;d++)p=this._model.mainSeries().data().valueAt(d),this._pattern.push(TradingView.clone(p));this._pattern.length>0&&(u=this.patternPriceDiff(),this._points[1].price=this._points[0].price+u,this._points[1].index=this._points[0].index+(c-f),this.normalizePoints(),this.createServerPoints())}return r},n.prototype.setPoint=function(t,e,i){var o=this._points[0].price-this._points[1].price;1===t&&e.index<=this._points[0].index&&(e.index=this._points[0].index+1),0===t&&e.index>=this._points[1].index&&(e.index=this._points[1].index-1),a.prototype.setPoint.call(this,t,e,i),1===t?this._points[0].price=this._points[1].price+o:this._points[1].price=this._points[0].price-o},n.prototype.migrateVersion=function(t,e,i){if(1===t&&this._pattern.length>0){var o=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+o),2===this._points.length&&(this._points[1].price=this._points[0].price+o)}},t.exports=n},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolTrendBasedFibTime";var i=e||new this.createPropertiesObject("linetooltrendbasedfibtime");l.call(this,t,new o(this,t),i),this.version=n.version}var s=i(30),r=i(166).VertLineRenderer,a=i(123),l=i(82).LineDataSource,h=i(148),c=i(124).TextRenderer,d=i(150).RectangleTransparencyRenderer,p=i(152).TrendLineRenderer,u=i(113),_=i(117);inherit(o,a),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,r,l,h,c,d,p,u,_,f;if(a.prototype.update.call(this),!(this._source.points().length<3)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(t=this._source.points()[0],e=this._source.points()[1],i=this._source.points()[2],this._levels=[],e.index!==t.index&&(o=e.index-t.index,n=this._source.properties(),s=i.index,r=this._model.timeScale().visibleBars(),!r.isEmpty())))for(l=1;l<=11;l++)h="level"+l,c=n[h],c.visible.value()&&(d=c.coeff.value(),p=c.color.value(),u=Math.round(s+d*o),_=this._model.timeScale().indexToCoordinate(u),f={x:_,coeff:d,color:p,linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),index:l},n.showCoeffs.value()&&(f.text=d,f.y=this._source.priceScale().height()),this._levels.push(f))},o.prototype.renderer=function(){var t,e,i,o,n,a,h,f,m,g,v,y,b,w,S,T,C,x;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,this._points.length<2)return t;if(e=this._points[0],i=this._points[1],o=this._source.properties(),o.trendline.visible.value()&&(n={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(n))),this._points.length<3)return this.addAnchors(t),t;for(a=this._points[2],o.trendline.visible.value()&&(n={points:[i,a],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(n))),h=o.fillBackground.value(),f=o.transparency.value(),m=0;m<this._levels.length;m++){if(m>0&&h&&(g=this._levels[m-1],e=new s.Point(g.x,0),i=new s.Point(this._levels[m].x,this._source.priceScale().height()),v={},v.points=[e,i],v.color=this._levels[m].color,v.linewidth=0,v.backcolor=this._levels[m].color,v.fillBackground=!0,v.transparency=f,t.append(new d(v))),void 0!==this._levels[m].text){switch(S=o.horzLabelsAlign.value(),S="left"===S?"right":"right"===S?"left":"center"){case"left":b=3;break;case"center":b=0;break;case"right":b=-3}switch(o.vertLabelsAlign.value()){case"top":y=new s.Point(this._levels[m].x,0),w=5;break;case"middle":y=new s.Point(this._levels[m].x,.5*this._levels[m].y),w=0;break;case"bottom":y=new s.Point(this._levels[m].x,this._levels[m].y),w=-10}T={points:[y],text:""+this._levels[m].text,color:this._levels[m].color,vertAlign:"middle",horzAlign:S,font:o.font.value(),offsetX:b,offsetY:w,fontsize:12},t.append(new c(T,this._rendererCache))}C={},C.points=[new s.Point(this._levels[m].x,0)],C.color=this._levels[m].color,C.linewidth=this._levels[m].linewidth,C.linestyle=this._levels[m].linestyle,x=new u(u.MOVEPOINT,null,this._levels[m].index),t.append(new r(C,x))}return this.addAnchors(t),t},inherit(n,l),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Trend-Based Fib Time"},n.prototype.migrateVersion=function(t,e,i){},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new h(t,e,i,{range:[1,11]})},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._levels=[],this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolFibTimeZone";var i=e||this.createPropertiesObject("linetoolfibtimezone");a.call(this,t,new o(this,t),i),this.version=n.version}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(166).VertLineRenderer,h=i(148),c=i(124).TextRenderer,d=i(150).RectangleTransparencyRenderer,p=i(152).TrendLineRenderer,u=i(113),_=i(117);inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,a,l,h,c,d;if(r.prototype.update.call(this),!(this._source.points().length<1)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(t=this._source.points()[0],2===this._source.points().length&&(e=this._source.points()[1]),i=this._source.properties(),o=this._source.points()[0].index,n=this._model.timeScale().visibleBars(),!n.isEmpty()))for(this._levels=[],s=e?e.index-t.index:1,a=1;a<=11;a++)l=i["level"+a],l.visible.value()&&(h=Math.round(o+l.coeff.value()*s),c=this._model.timeScale().indexToCoordinate(h),d={index:a,x:c,color:l.color.value(),width:l.linewidth.value(),style:l.linestyle.value()},i.showLabels.value()&&(d.text=l.coeff.value(),d.y=this._source.priceScale().height()),this._levels.push(d))},o.prototype.renderer=function(){var t,e,i,o,n,r,h,f,m,g,v,y,b,w,S;for(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,e=this._source.properties(),i=0;i<this._levels.length;i++)if(o={},o.points=[new s.Point(this._levels[i].x,0)],o.color=this._levels[i].color,o.linewidth=this._levels[i].width,o.linestyle=this._levels[i].style,n=new u(u.MOVEPOINT,null,this._levels[i].index),t.append(new l(o,n)),i>0&&e.fillBackground.value()&&(r=this._levels[i-1],h=new s.Point(this._levels[i].x,0),f=new s.Point(r.x,this._source.priceScale().height()),m={},m.points=[h,f],m.color=this._levels[i].color,m.linewidth=0,m.backcolor=this._levels[i].color,m.fillBackground=!0,m.transparency=e.transparency.value(),t.append(new d(m))),void 0!==this._levels[i].text){switch(b=e.horzLabelsAlign.value(),b="left"===b?"right":"right"===b?"left":"center"){case"left":v=3;break;case"center":v=0;break;case"right":v=-3}switch(e.vertLabelsAlign.value()){case"top":g=new s.Point(this._levels[i].x,0),y=5;break;case"middle":g=new s.Point(this._levels[i].x,.5*this._levels[i].y),y=0;break;case"bottom":g=new s.Point(this._levels[i].x,this._levels[i].y),y=-10}w={points:[g],text:""+this._levels[i].text,color:o.color,vertAlign:"middle",horzAlign:b,font:e.font.value(),offsetX:v,offsetY:y,fontsize:12},t.append(new c(w,this._rendererCache))}return 2===this._points.length&&(S={points:[this._points[0],this._points[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:e.trendline.color.value(),linewidth:e.trendline.linewidth.value(),linestyle:e.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},t.append(new p(S))),this.isAnchorsRequired()&&(2===this._source.points().length?t.append(this.createLineAnchor({points:this._points})):this._points.length>0&&t.append(this.createLineAnchor({points:[new s.Point(this._points[0].x,this._source.priceScale().height()/2)],hittestResult:u.MOVEPOINT}))),t},inherit(n,a),n.version=2,n.prototype.migrateVersion=function(t,e,i){var o;if(1===t){for(i.properties.level1.color.setValue(i.properties.baselinecolor.value()),o=2;o<=11;o++)i.properties["level"+o].color.setValue(i.properties.linecolor.value());for(o=1;o<=11;o++)i.properties["level"+o].linewidth.setValue(i.properties.linewidth.value()),i.properties["level"+o].linestyle.setValue(i.properties.linestyle.value())}},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Time Zone"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new h(t,e,i,{range:[1,11]})},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._lines=[],this._invalidated=!0}function n(t,e){this._constructor="LineToolCircleLines";var i=e||new p("linetoolcirclelines");a.call(this,t,new o(this,t),i)}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(166).VertLineRenderer,h=i(152).TrendLineRenderer,c=i(113),d=i(117),p=i(91).DefaultProperty;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,a;if(r.prototype.update.call(this),!(this._source.points().length<2)&&(t=this._model.timeScale(),this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!t.isEmpty()&&(e=this._source.points()[0],i=this._source.points()[1],o=i?i.index-e.index:1,this._lines=[],0!==o)))if(n=t.visibleBars(),o>0)for(s=e.index,a=s;a<=n.lastBar();a+=o)this._lines.push({x:t.indexToCoordinate(a)});else for(s=e.index,a=s;a>=n.firstBar();a+=o)this._lines.push({x:t.indexToCoordinate(a)})},o.prototype.renderer=function(){var t,e,i,o,n,r,p,u;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,this._points.length<2)return t;for(e=this._points[0],i=this._points[1],o=this._source.properties(),n={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},t.append(new h(n)),o=this._source.properties(),r=0;r<this._lines.length;r++)p={points:[new s.Point(this._lines[r].x,0)],color:o.linecolor.value(),linewidth:o.linewidth.value(),linestyle:o.linestyle.value()},t.append(new l(p));return this.isAnchorsRequired()&&(2===this._source.points().length?(u=[].concat(this._points),t.append(this.createLineAnchor({points:u}))):t.append(this.createLineAnchor({points:[new s.Point(this._points[0].x,this._source.priceScale().height()/2)],hittestResult:c.MOVEPOINT}))),t},inherit(n,a),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Cyclic Lines"},t.exports=n},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolDateRange";var i=e||new p("linetooldaterange");r.call(this,t,new o(this,t),i)}var s=i(30),r=i(82).LineDataSource,a=i(123),l=i(124).TextRenderer,h=i(150).RectangleRenderer,c=i(152).TrendLineRenderer,d=i(117),p=i(91).DefaultProperty,u=i(94).TimeSpanFormatter;inherit(o,a),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){a.prototype.update.call(this),this._invalidated=!1},o.prototype.renderer=function(){var t,e,i,o,n,a,p,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A;return this._invalidated&&this.updateImpl(),t=new d,this._points.length<2||this._source.points().length<2?t:(e=this._source.properties(),e.fillBackground&&e.fillBackground.value()&&(i={},i.points=this._points,i.color="white",i.linewidth=0,i.backcolor=e.backgroundColor.value(),i.fillBackground=!0,i.transparency=e.backgroundTransparency.value(),t.append(new h(i))),o=this,n=function(e,i){var n={};n.points=[e,i],n.width=o._model.timeScale().width(),n.height=o._source.priceScale().height(),n.color=o._source.properties().linecolor.value(),n.linewidth=o._source.properties().linewidth.value(),n.linestyle=CanvasEx.LINESTYLE_SOLID,n.extendleft=!1,n.extendright=!1,n.leftend=r.LINEEND_NORMAL,n.rightend=r.LINEEND_NORMAL,t.append(new c(n))},a=this._points[0],p=this._points[1],n(a,new s.Point(a.x,p.y)),n(new s.Point(p.x,a.y),p),_=(a.y+p.y)/2,f=new s.Point(a.x,_),m=new s.Point(p.x,_),i={},i.points=[f,m],i.width=o._model.timeScale().width(),i.height=o._source.priceScale().height(),i.color=o._source.properties().linecolor.value(),i.linewidth=o._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=r.LINEEND_NORMAL,i.rightend=r.LINEEND_ARROW,t.append(new c(i)),g=this._source.points()[0].index,v=this._source.points()[1].index,y=v-g,b=this._model.timeScale().indexToUserTime(g),w=this._model.timeScale().indexToUserTime(v),S="",b&&w&&(T=(w.valueOf()-b.valueOf())/1e3,S=", "+(new u).format(T)),C=$.t("{0} bars").format(y)+S,i={},x={x:0,y:10},i.text=C,i.color=e.textcolor.value(),i.height=o._source.priceScale().height(),i.font=e.font.value(),i.offsetX=x.x,i.offsetY=x.y,i.vertAlign="middle",i.horzAlign="center",i.fontsize=e.fontsize.value(),i.backgroundRoundRect=4,i.backgroundHorzInflate=.4*e.fontsize.value(),i.backgroundVertInflate=.2*e.fontsize.value(),e.fillLabelBackground&&e.fillLabelBackground.value()&&(i.backgroundColor=e.labelBackgroundColor.value(),i.backgroundTransparency=1-e.labelBackgroundTransparency.value()/100||0),e.drawBorder&&e.drawBorder.value()&&(i.borderColor=e.borderColor.value()),P=.5*(a.x+p.x),L=p.y,k=new s.Point(P,L),I=new l(i,this._rendererCache),E=I.measure(),A={x:P+i.backgroundHorzInflate+E.textBgPadding-E.width/E.textBgPadding,y:a.y>p.y?k.y-E.height-2*E.textBgPadding-x.y>0?L-E.height-x.y-2*E.textBgPadding:x.y-2*E.textBgPadding:k.y+E.height+E.textBgPadding+x.y>i.height?i.height-E.height-x.y:L+E.textBgPadding},I.setPoints([new s.Point(P,A.y)]),t.append(I),this.addAnchors(t),t)},inherit(n,r),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date Range"},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._rendererCache={},this._invalidated=!0,this._percentageFormatter=new u}function n(t,e){this._constructor="LineToolPriceRange";var i=e||new p("linetoolpricerange");a.call(this,t,new o(this,t),i)}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(124).TextRenderer,h=i(150).RectangleRenderer,c=i(152).TrendLineRenderer,d=i(117),p=i(91).DefaultProperty,u=i(94).PercentageFormatter;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){r.prototype.update.call(this)},o.prototype.renderer=function(){var t,e,i,o,n,r,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,this._points.length<2||this._source.points().length<2?t:(e=this._source.properties(),e.fillBackground&&e.fillBackground.value()&&(n={},n.points=this._points,n.color="white",n.linewidth=0,n.backcolor=e.backgroundColor.value(),n.fillBackground=!0,n.transparency=e.backgroundTransparency.value(),t.append(new h(n))),r=this,p=function(e,i){var o={};o.points=[e,i],o.width=r._model.timeScale().width(),o.height=r._source.priceScale().height(),o.color=r._source.properties().linecolor.value(),o.linewidth=r._source.properties().linewidth.value(),o.linestyle=CanvasEx.LINESTYLE_SOLID,o.extendleft=!1,o.extendright=!1,o.leftend=a.LINEEND_NORMAL,o.rightend=a.LINEEND_NORMAL,t.append(new c(o))},i=this._points[0],o=this._points[1],o=new s.Point(o.x,i.y),p(i,o),i=this._points[0],o=this._points[1],i=new s.Point(i.x,o.y),p(i,o),i=this._points[0],o=this._points[1],u=(i.x+o.x)/2,_=new s.Point(u,i.y),f=new s.Point(u,o.y),n={},n.points=[_,f],n.width=r._model.timeScale().width(),n.height=r._source.priceScale().height(),n.color=r._source.properties().linecolor.value(),n.linewidth=r._source.properties().linewidth.value(),n.linestyle=CanvasEx.LINESTYLE_DASHED,n.extendleft=!1,n.extendright=!1,n.leftend=a.LINEEND_NORMAL,n.rightend=a.LINEEND_ARROW,t.append(new c(n)),m=this._source.points()[0].price,g=this._source.points()[1].price,v=g-m,y=100*v/m,b=this._source.priceScale().formatter().format(v)+" ("+this._percentageFormatter.format(y)+")",n={},g>m?(w=o.clone(),w.y-=2*e.fontsize.value(),w.x=.5*(i.x+o.x),n.points=[w]):(w=o.clone(),w.x=.5*(i.x+o.x),w.y+=.7*e.fontsize.value(),n.points=[w]),S={x:0,y:10},n.text=b,n.color=e.textcolor.value(),n.height=r._source.priceScale().height(),n.font=e.font.value(),n.offsetX=S.x,n.offsetY=S.y,n.vertAlign="middle",n.horzAlign="center",n.fontsize=e.fontsize.value(),n.backgroundRoundRect=4,n.backgroundHorzInflate=.4*e.fontsize.value(),n.backgroundVertInflate=.2*e.fontsize.value(),e.fillLabelBackground&&e.fillLabelBackground.value()&&(n.backgroundColor=e.labelBackgroundColor.value(),n.backgroundTransparency=1-e.labelBackgroundTransparency.value()/100||0),e.drawBorder&&e.drawBorder.value()&&(n.borderColor=e.borderColor.value()),T=.5*(i.x+o.x),C=o.y,x=new s.Point(T,C),P=new l(n,this._rendererCache),L=P.measure(),k={x:T+n.backgroundHorzInflate+L.textBgPadding-L.width/L.textBgPadding,y:i.y>o.y?x.y-L.height-2*L.textBgPadding-S.y>0?C-L.height-S.y-2*L.textBgPadding:S.y-2*L.textBgPadding:x.y+L.height+L.textBgPadding+S.y>n.height?n.height-L.height-S.y:C+L.textBgPadding},P.setPoints([new s.Point(T,k.y)]),t.append(P),this.addAnchors(t),t)},inherit(n,a),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Price Range"},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._rendererCache={},this._percentageFormatter=new _,this._invalidated=!0}function n(t,e){this._constructor="LineToolDateAndPriceRange";var i=e||new p("linetooldateandpricerange");a.call(this,t,new o(this,t),i)}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(124).TextRenderer,h=i(150).RectangleRenderer,c=i(152).TrendLineRenderer,d=i(117),p=i(91).DefaultProperty,u=i(94),_=u.PercentageFormatter,f=u.TimeSpanFormatter;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){r.prototype.update.call(this),this._invalidated=!1},o.prototype.renderer=function(){var t,e,i,o,n,r,p,u,_,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,M,D,O,B,R;return this._invalidated&&this.updateImpl(),t=new d,this._points.length<2||this._source.points().length<2?t:(e=this._source.properties(),e.fillBackground&&e.fillBackground.value()&&(i={},i.points=this._points,i.color="white",i.linewidth=0,i.backcolor=e.backgroundColor.value(),i.fillBackground=!0,i.transparency=e.backgroundTransparency.value(),t.append(new h(i))),o=this,n=function(e,i){var n={};n.points=[e,i],n.width=o._model.timeScale().width(),n.height=o._source.priceScale().height(),n.color=o._source.properties().linecolor.value(),n.linewidth=o._source.properties().linewidth.value(),n.linestyle=CanvasEx.LINESTYLE_SOLID,n.extendleft=!1,n.extendright=!1,n.leftend=a.LINEEND_NORMAL,n.rightend=a.LINEEND_NORMAL,t.append(new c(n))},r=this._points[0],p=this._points[1],n(r,new s.Point(p.x,r.y)),n(new s.Point(r.x,p.y),p),n(r,new s.Point(r.x,p.y)),n(new s.Point(p.x,r.y),p),u=(r.y+p.y)/2,_=new s.Point(r.x,u),m=new s.Point(p.x,u),i={},i.points=[_,m],i.width=o._model.timeScale().width(),i.height=o._source.priceScale().height(),i.color=o._source.properties().linecolor.value(),i.linewidth=o._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=a.LINEEND_NORMAL,i.rightend=a.LINEEND_ARROW,t.append(new c(i)),r=this._points[0],p=this._points[1],g=(r.x+p.x)/2,_=new s.Point(g,r.y),m=new s.Point(g,p.y),i={},i.points=[_,m],i.width=o._model.timeScale().width(),i.height=o._source.priceScale().height(),i.color=o._source.properties().linecolor.value(),i.linewidth=o._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=a.LINEEND_NORMAL,i.rightend=a.LINEEND_ARROW,t.append(new c(i)),v=this._source.points()[0].price,y=this._source.points()[1].price,b=y-v,w=100*b/v,S=this._source.points()[0].index,T=this._source.points()[1].index,C=T-S,x=this._model.timeScale().indexToUserTime(S),P=this._model.timeScale().indexToUserTime(T),L="",x&&P&&(k=(P.valueOf()-x.valueOf())/1e3,L=", "+(new f).format(k)),I=this._source.priceScale().formatter().format(b)+" ("+this._percentageFormatter.format(Math.round(100*w)/100)+")\n"+$.t("{0} bars").format(C)+L,i={},y>v?(E=p.clone(),E.y-=2*e.fontsize.value(),E.x=.5*(r.x+p.x),i.points=[E]):(E=p.clone(),E.x=.5*(r.x+p.x),E.y+=.7*e.fontsize.value(),i.points=[E]),A={x:0,y:10},i.text=I,i.color=e.textcolor.value(),i.height=o._source.priceScale().height(),i.font=e.font.value(),i.offsetX=A.x,i.offsetY=A.y,i.padding=5,i.vertAlign="middle",i.horzAlign="center",i.fontsize=e.fontsize.value(),i.backgroundRoundRect=4,i.backgroundHorzInflate=.4*e.fontsize.value(),i.backgroundVertInflate=.2*e.fontsize.value(),e.fillLabelBackground&&e.fillLabelBackground.value()&&(i.backgroundColor=e.labelBackgroundColor.value(),i.backgroundTransparency=1-e.labelBackgroundTransparency.value()/100||0),e.drawBorder&&e.drawBorder.value()&&(i.borderColor=e.borderColor.value()),V=.5*(r.x+p.x),M=p.y,D=new s.Point(V,M),O=new l(i,this._rendererCache),B=O.measure(),R={x:V+i.backgroundHorzInflate+B.textBgPadding-B.width/B.textBgPadding,y:r.y>p.y?D.y-B.height-2*B.textBgPadding-A.y>0?M-B.height-A.y+B.textBgPadding:A.y-2*B.textBgPadding:D.y+B.height+B.textBgPadding+A.y>i.height?i.height-B.height-A.y:M+B.textBgPadding},window.t1=o._source.priceScale().height(),window.t2=D.y+B.height+2*B.textBgPadding+A.y,O.setPoints([new s.Point(V,R.y)]),t.append(O),this.addAnchors(t),t)},inherit(n,a),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date and Price Range"},t.exports=n},function(t,e,i){(function(e){"use strict";function o(t){this._data=t}function n(t,e){a.call(this,t,e),this._label=null,this._rendererCache={},this._invalidated=!0}function s(t,e){this._constructor="LineToolTrendAngleLine";var i=e||new f("linetooltrendangle");l.call(this,t,new n(this,t),i),this._properties.addProperty("angle"),this._properties.angle=new s.AngleProperty(this)}var r=i(30),a=i(123),l=i(82).LineDataSource,h=i(152),c=h.TrendLineStatsRenderer,d=h.LineToolTrendLine,p=i(124).TextRenderer,u=i(152).TrendLineRenderer,_=i(117),f=i(91).DefaultProperty,m=i(94),g=m.PercentageFormatter;o.prototype.hitTest=function(){return null},o.prototype.draw=function(t){var e,i;t.save(),t.translate(this._data.point.x,this._data.point.y),t.strokeStyle=this._data.color,e=[1,2],"function"==typeof t.setLineDash?t.setLineDash(e):void 0!==t.mozDash?t.mozDash=e:void 0!==t.webkitLineDash&&(t.webkitLineDash=e),i=this._data.size,t.beginPath(),t.moveTo(0,0),t.lineTo(i,0),t.arc(0,0,i,0,-this._data.angle,this._data.angle>0),t.stroke(),t.restore()},inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,s,l,h,c,d,p,u,_,f;a.prototype.update.call(this),this._points.length>0&&void 0!==this._source._angle&&(t=this._points[0],e=Math.cos(this._source._angle),i=-Math.sin(this._source._angle),o=new r.Point(e,i),this._secondPoint=t.addScaled(o,this._source._distance),this._secondPoint.data=1),this._label=null,this._source.points().length<2||(t=this._source.points()[0],n=this._source.points()[1],s=[],this._source.properties().showPriceRange.value()&&this._source.priceScale()&&(c=n.price-t.price,d=c/t.price,l=this._source.priceScale().formatter().format(c)+" ("+(new g).format(100*d)+")",p=this._model.mainSeries().base(),p&&(u=Math.round(c*p),l+=", "+u),s.push("priceRange")),_=this._source.properties().showBarsRange.value(),_&&(h="",f=n.index-t.index,h+=$.t("{0} bars").format(f),s.push("barsRange")),this._label=[l,h].filter(function(t){return t}).join("\n")||null,this._icons=s)},n.prototype.renderer=function(){var t,e,i,n,s,r,a,h,f,m;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,e={},i=this.isAnchorsRequired(),n=i||this._source.properties().alwaysShowStats.value(),this._secondPoint&&this._points.length>0&&(e.points=[this._points[0],this._secondPoint],e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.color=this._source.properties().linecolor.value(),e.linewidth=this._source.properties().linewidth.value(),e.linestyle=this._source.properties().linestyle.value(),e.extendleft=this._source.properties().extendLeft.value(),e.extendright=this._source.properties().extendRight.value(),e.leftend=l.LINEEND_NORMAL,e.rightend=l.LINEEND_NORMAL,t.append(new u(e)),n&&this._label&&2===this._points.length&&(s={points:[this._secondPoint],text:this._label,color:this._source.properties().textcolor.value(),font:d.LABEL_FONT,fontsize:d.LABEL_FONTSIZE,lineSpacing:d.LABEL_LINESPACING,backgroundColor:d.LABEL_BGCOLOR,borderColor:d.LABEL_BORDERCOLOR,borderWidth:1,padding:d.LABEL_PADDING,paddingLeft:30,doNotAlignText:!0,icons:this._icons},r=d.LABEL_OFFSET,this._points[1].y<this._points[0].y?(s.vertAlign="bottom",s.offsetY=-r):s.offsetY=r,this._points[1].x<this._points[0].x?(s.horzAlign="right",s.offsetX=-r):s.offsetX=r,t.append(new c(s,this._rendererCache))),a={},a.point=this._points[0],a.angle=this._source._angle,a.color=this._source.properties().linecolor.value(),a.size=50,t.append(new o(a)),h=Math.round(180*a.angle/Math.PI)+"º",f=this._points[0].clone(),f.x=f.x+50,m={points:[f],text:h,color:this._source.properties().textcolor.value(),horzAlign:"left",font:this._source.properties().font.value(),offsetX:5,offsetY:0,bold:this._source.properties().bold.value(),italic:this._source.properties().italic.value(),fontsize:this._source.properties().fontsize.value(),vertAlign:"middle"},t.append(new p(m,this._rendererCache))),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&e&&e.points&&e.points.length>=2&&this._source.getAlertIsActive(function(i){t.append(new TradingView.PaneRendererClockIcon({point1:e.points[0],point2:e.points[1],color:i?e.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),this._secondPoint&&this._points.length>0&&i&&t.append(this.createLineAnchor({points:[this._points[0],this._secondPoint]})),t},inherit(s,l),s.AngleProperty=function(t){e.call(this),this._lineSource=t},inherit(s.AngleProperty,e),s.AngleProperty.prototype.value=function(){var t=this._lineSource._angle,e=180*t/Math.PI;return Math.round(e)},s.AngleProperty.prototype.setValue=function(t){var e,i,o,n,s,a,l=t*Math.PI/180;this._lineSource._angle=l,e=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],i=Math.cos(this._lineSource._angle),o=-Math.sin(this._lineSource._angle),n=new r.Point(i,o),s=e.addScaled(n,this._lineSource._distance),a=this._lineSource.screenPointToPoint(s),this._lineSource._points[1]=a,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)},s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Trend Angle"},s.prototype._calculateAngle=function(){var t,e=this.pointToScreenPoint(this.points()[0])[0],i=this.pointToScreenPoint(this.points()[1])[0],o=i.substract(e);o.length()>0?(o=o.normalized(),this._angle=Math.acos(o.x),o.y>0&&(this._angle=-this._angle),this._distance=i.substract(e).length()):delete this._angle,t=this.properties(),t.hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)},s.prototype.addPoint=function(t,e){var i=l.prototype.addPoint.call(this,t,e);return i&&this._calculateAngle(),i},s.prototype.setLastPoint=function(t,e){l.prototype.setLastPoint.call(this,t,e),this.points().length>1&&this._calculateAngle()},s.prototype.axisPoints=function(){var t,e,i,o,n,s;return this.points().length<2?[]:(t=[this.points()[0]],e=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,o=-Math.sin(this._angle)*this._distance,n=e.add(new r.Point(i,o)),s=this.screenPointToPoint(n),t.push(s),t)},s.prototype.setPoint=function(t,e,i){l.prototype.setPoint.call(this,t,e,i),this.points().length>1&&1===t&&this._calculateAngle()},s.prototype.restoreData=function(t){this._angle=t.angle,this._distance=t.distance},s.prototype.state=function(t){var e=l.prototype.state.call(this,t);return e.angle=this._angle,e.distance=this._distance,e},s.prototype.cloneData=function(t){this._angle=t._angle,this._distance=t._distance},s.prototype.canHasAlert=function(){return!0},s.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},t.exports=s}).call(e,i(83))},function(t,e,i){"use strict";function o(t,e){var i=e||new p("linetoolarrowmark");h.call(this,t,new d(this,t,this.image,this.width,this.height,this.offsetX,this.offsetY),i)}function n(t,e){this._constructor="LineToolArrowMarkLeft",o.call(this,t,e),this._textPaneView=new c(this,t,22,-3,"middle","left"),this._textPaneView._noSelection=!0}function s(t,e){this._constructor="LineToolArrowMarkUp",o.call(this,t,e),this._textPaneView=new c(this,t,0,18,"top","center"),this._textPaneView._noSelection=!0}function r(t,e){this._constructor="LineToolArrowMarkRight",o.call(this,t,e),this._textPaneView=new c(this,t,-22,-3,"middle","right"),this._textPaneView._noSelection=!0}function a(t,e){this._constructor="LineToolArrowMarkDown",o.call(this,t,e),this._textPaneView=new c(this,t,0,-23,"bottom","center"),this._textPaneView._noSelection=!0}var l=i(30),h=i(82).LineDataSource,c=i(124).TextPaneView,d=i(198),p=i(91).DefaultProperty;inherit(o,h),o.prototype.width=21,o.prototype.height=21,o.prototype.offsetX=0,o.prototype.offsetY=0,o.prototype.paneViews=function(t){var e=h.prototype.paneViews.call(this,t);return null!==e&&this._textPaneView&&e.push(this._textPaneView),e},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Arrow Mark"},inherit(n,o),n.prototype.image=new Image,n.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB50lEQVR4AWMgETAKKAgIAGkQ5mCgAmCWdtTWV4yxvgFkWwKxOKUGssr5Gccrx9t+Vk6w+w/kxwKxIrmGMTKIivIohFvONKsI+e/cl/ofamgGECuTYyCTqJ2mqlK01Vnr+uj/HjNy/1v1J8AMzSTHUBYZP6MgpTjb97bNsf9dpmf9N++J/W/UEQEztAiIbUEGo2EpIObE8C4oVuVDzLuBmv869aT8t5+c+t+0K/q/YXs4GGsWeIAMRscwy/yhBiO8K2ijJKcYZXXYuj7qv/u0nP/W/Yn/jTsjQYYRwliDhUXKy8BVKdbmuW1T7H+3Gdn/LXrjQN4FaSDLUBa5MItyoOAvp67k/45T0pC9S56hSrHWhY4tif9D5pUDXZjz36w7Blkx+S5VDLNoBUWMY3fKfwdExMAw+WEq7Wvkoxhn+waUhFwRSYhcQxGxL26jpqQYbX3CBpjY3aeDYj+BothHpFNxcW75cIvJpmXB/516Uv/bT0r5b9IVRUY6xQSssr6GkcAc9dGuNe6/y7RMMnMUJmCWcNTSBgbHZeuG6P+eM/P+W/VRlPcRwSGoJMgvH265yKIq/L9LfzqKoZSXp0Em6cDy9BvU0Dhyy1PM4PAwMFWKs7kFZFsBsQQDlQAjr4a0MJAWxFdHAQAcI3sGHsO1dgAAAABJRU5ErkJggg==",n.prototype.offsetX=1,n.prototype.offsetY=-10,n.prototype.title=function(){return"Arrow Mark Left"},inherit(s,o),s.prototype.image=new Image,s.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACBklEQVR4AWMgErAoxVoXgmgGKgEWxTCLVseWxP9yYRbl1DCYSdrXyEc5we5vyLzy/0D6l5SXgStInFwDGcVt1JQU42zfOHan/HebkfPfqSv5v1KszXNBGyU5kDzpRoqLcytGW5+wbY797zA59b9Zd8x/xylp/22bYv8rRlkdBqrgINVIVvlwi8k29dH/Xadn/Tftiv5v2B4Opt1mZP+3ro/6Lx9i3k1K+DLL+hpGmpYF/3efnvPfvCcWZCAcW/TG/XeflvMfFM4yfkZBxIQvo4SjlrZSnO1Hp57U/9b9Cf+NOiKQDQXxgeKJ/516Uv4D1b0XtdNUxRu+gkqC/MBwvGzXGvffflLKf+POSISBCAwWtweGMyi8laKtzjKIivLgCUfLRdYN0f9dpmX+N+mKghiCieHh6wIMb2tguCuEW84E6ccIR7kgk3SLqvD/njPzYOFICIPVeczI/W9WEfJfzs84HmQOIhw9DEyV422/ufSn/7fqg4cjIQxWZwUMd+e+1P9A/Z+lHbX1weHLqyEtrBRncwsYm/+RsWaBBz4DwfLoehRjrG8IKAgIgOMHiK2AOA6IM6G4CKgIr6EgeZA6qPoMII4FYksgFmCA5gwJIFYEYmUotiXSUFuYHqh+cXw5TZlIQ5WxaR4mhuLBZBkqBcT+oJjFg/3B6kgAnFANyniwFEQdJgAAOuN7Bp7MBuYAAAAASUVORK5CYII=",s.prototype.offsetX=-9,s.prototype.offsetY=0,s.prototype.title=function(){return"Arrow Mark Up"},inherit(r,o),r.prototype.image=new Image,r.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB60lEQVR4AWPAAziAWJBXQ1oYSDMyUAlIALGVUpzNLQkPA1Mgm5kahioCcZxygt1/5Xjbb3JBJulAPiulhioDcSbIUJf+9P8WVeH/5cMtFwkqCfKDgoNiQ636Ev57zsz7b90Q/V8x2vqyhKOWNqHg4ARiKZAhaNgWiItAhhp1RPw374n97zIt879da9x/pTjbj7K+hpE4gwNqoD9IMzasWeDx37A9HIxNuqL+209K+e/Uk/rftCwYGBwWkxnExbkRwYHpTZBGgti4M/K/dX/Cf/fpOf9t6sHBcULcRk0JaAYT6YYiMDw4XKdn/bdtjv2vGGf7RtrXyAdoDguZhiKwaVf0f4fJqf8du1NAQfVXMcyiFWQwmYYisFl3zH+3GTn/Q+aV/3dsSfyvFGtdSLFLHaek/XfqSga59JdcmEU5yKVkh6lFbxzQhdn/bZtiga6zeS7lZeAKMpCC2E/87z4t5791fdR/xSirw4I2SnKg2CcxnSK8aw+MGKceSMTIh5h3Q0szRvJzFCQJgXLUexk/oyCQd8nP+8DE7jEjF+jd6P9K0VZnRe00VWHeJcfQDJChzn2p/80qQv4rhFvOZBAV5QF5l5LyNBZann6W8zOOp0Z5Kg7Eloox1jekHbX1qVLyQ2NVQEBBQIBU7wIAOFZ7BmG7RzYAAAAASUVORK5CYII=",r.prototype.offsetX=-19,r.prototype.offsetY=-10,r.prototype.title=function(){return"Arrow Mark Right"},inherit(a,o),a.prototype.image=new Image,a.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB/UlEQVR4AWPAATj3Wij8J4RB6hhIAFIgTS9a8nBhmKFSpBiqDNJ0P80PF4YZqkyyobfD7HDh4WJolaKY+G5zhXvoMXva2xifoWB5dD07zeTvFKvxioDMFY6RFUgEGvzzQVk8OGafVib9v5fkhc9QkDxIHVj9vaKY/7vM5b+HS/JFA80TAhnKA8TGZSoiS057GYFiFqzhTpQTPkNB8iB1YPUnPQz+5ykKzQGaYwjE3CBDmUCuBWKHabqSZ0656oI0EY1B6idoSx4F6reDupIJFrTMQCwtxsYcvNZY5uU5T0OiDDwLdOFKI9knvMzM/kD9kmBz0AAbEKs6iHAX7zSX/3nF3xyvgZd8Tf9vM5P/ZiXAmQdNBazYEgIjEHOBwiVHXmjWcSctnAbeDLH5f8xR83+SjNBEoHo9sD4owGWwIBDb9mtJHMIVviDxDg3x3UB11kDMD9ZHADCDwkeAmdlvhZHMI2C4oRh4xl3//1IDmbvszAxeQHXiUPWEATR8lE0EubJB4QYMP7CBF31M/m82k/usy8uRCpRXAKsjEXCCwiteVqD/qIPG/+tBVv/3WCj8C5Pi7wCKawMxBwMZgBEaXlbtGuI7T7ro/G9QFdsI5JsDMR/+cCQcvuLsLAzubRoSa4FsJyAWBSdwsgEifKVBXoYmcBYGagCoQZzEGggAoyq6zKXuV5gAAAAASUVORK5CYII=",a.prototype.offsetX=-9,a.prototype.offsetY=-18,a.prototype.title=function(){return"Arrow Mark Down"},r.prototype.version=n.prototype.version=a.prototype.version=s.prototype.version=2,a.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,21)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=-4)},s.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=18)},r.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=10)},n.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,0)),this._textPaneView._offsetX=21,this._textPaneView._offsetY=10)},e.LineToolArrowMark=o,e.LineToolArrowMarkLeft=n,e.LineToolArrowMarkRight=r,e.LineToolArrowMarkUp=s,e.LineToolArrowMarkDown=a},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e,i,o,n,s,a){r.call(this,t,e),this._image=i,this._offsetX=s||0,this._offsetY=a||0,this._width=o,this._height=n,this._invalidated=!0}var s=i(30),r=i(123),a=i(113),l=i(112).SelectionRenderer,h=i(117);o.prototype.draw=function(t){var e,i;0!==this._data.points.length&&(e=this._data.points[0].x+this._data.offsetX,i=this._data.points[0].y+this._data.offsetY,t.translate(-.5,-.5),t.drawImage(this._data.image,e,i,this._data.width,this._data.height))},o.prototype.hitTest=function(t){if(0===this._data.points.length)return null;var e=this._data.points[0].clone();return this._data.offsetX&&(e.x+=this._data.offsetX),this._data.offsetY&&(e.y+=this._data.offsetY),s.pointInRect(t,e,e.add(new s.Point(this._data.width,this._data.height)))?new a(a.MOVEPOINT):null},inherit(n,r),n.prototype.setAnchors=function(t){this._anchorsOffset=t},n.prototype.renderer=function(){var t,e,i,n;if(this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().color.value(),t.image=this._image,t.offsetX=this._offsetX,t.offsetY=this._offsetY,t.width=this._width,t.height=this._height,this.isAnchorsRequired()&&1===t.points.length){if(e=new h,e.append(new o(t)),this._anchorsOffset){for(i=[],n=0;n<t.points.length;n++)i.push(t.points[n].clone().add(this._anchorsOffset));e.append(new l({points:i}))}else e.append(new l({points:t.points}));return e}return new o(t)},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){r.prototype.update.call(this),this._invalidated=!1},t.exports=n},function(t,e,i){(function(t){"use strict";function o(t,e){this._pane=t,this._timeScale=e}function n(t){this._line=t}function s(t,e){this._data=t,this._adapter=e}function r(t,e){h.call(this,t,e),this._invalidated=!0}function a(t,e){this._adapter=new n(this),this._constructor="LineToolExecution";var i=e||new _("linetoolexecution");this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0},c.call(this,t,new r(this,t),i)}var l=i(30),h=i(123),c=i(82).LineDataSource,d=i(200),p=i(113),u=i(183).Rect,_=i(91).DefaultProperty;o.prototype._cachedByBarIndexOrderedExecutions={},o.recreateOrderedByBarsSourcesCache=function(t){var e,i,n,s,r;for(o.clearOrderedByBarsSourcesCache(),e=o.prototype,i=t.orderedSources(),n=0;n<i.length;++n)s=i[n],s._adapter&&void 0!==s._adapter._index&&(r=e._cachedByBarIndexOrderedExecutions[s._adapter._index],e._cachedByBarIndexOrderedExecutions[s._adapter._index]=r||[],e._cachedByBarIndexOrderedExecutions[s._adapter._index].push(s))},o.clearOrderedByBarsSourcesCache=function(){o.prototype._cachedByBarIndexOrderedExecutions={}},o.prototype.getXYCoordinate=function(t,e,i){var o,n,s,r,l,h,c,d,p,u,_=0,f=t.getDirection(),m="buy"===f,g=this._pane.model().mainSeries();if(g.bars&&(o=m?10:-10,(n=g.bars().search(i,TradingView.SEARCH_NEAREST_LEFT))&&(i=n.index,s=m?n.value[TradingView.LOW_PLOT]:n.value[TradingView.HIGH_PLOT],r=g.priceScale(),r.isPercent()&&(l=g.firstValue(),s=r.priceRange().convertToPercent(s,l)),_=r.priceToCoordinate(s)+o)),t._index=i,h=e.visibleBars(),!isFinite(i)||!h||i>h.lastBar()||i<h.firstBar())return{x:-1,y:-1};for(c=this._cachedByBarIndexOrderedExecutions[i]||this._pane.orderedSources(),d=c.length-1;d>=0;--d)if((p=c[d])instanceof a&&p._adapter._index===i&&p._adapter.getDirection()===f){if(p===t._line)break;u=p._adapter._height(),_=m?_+u:_-u}return{x:e.indexToCoordinate(i),y:_}},n.prototype._height=function(){var t,e=this.getArrowHeight(),i=this.getArrowSpacing();return this.getText()&&d.fontHeight(this.getFont()),t=10,e+i+0+t},n.prototype.getIndex=function(){return this._line._model.timeScale().m_points.lastTimePointIndex()-this._line.points()[0].index},n.prototype.setIndex=function(t){var e,i=this._line._model.timeScale(),o=i.m_points.lastTimePointIndex(),n=o-Math.abs(t);return this._line.startMoving(this._line.points()[0]),e=TradingView.merge({},this._line.points()[0]),e.index=n,this._line.move(e),this._line.endMoving(),this},n.prototype.getTime=function(){return this._unixtime},n.prototype.setTime=function(t){var e=this._line._model.mainSeries();return this._unixtime=ChartApiInstance.alignTimePoint?ChartApiInstance.alignTimePoint(t,e.interval(),e.symbolInfo()):t,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),this._line.createServerPoints(),this},n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(t){return this._line.points().length>0&&(this._line.points()[0].price=t),this._line._timePoint.length>0&&(this._line._timePoint[0].price=t),this},n.prototype.getText=function(){return this._line.properties().text.value()},n.prototype.setText=function(t){return this._line.properties().text.setValue(t||""),this._line.updateAllViewsAndRedraw(),this},n.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()},n.prototype.setArrowHeight=function(t){return this._line.properties().arrowHeight.setValue(t||5),this},n.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()},n.prototype.setArrowSpacing=function(t){return this._line.properties().arrowSpacing.setValue(t||1),this},n.prototype.getDirection=function(){return this._line.properties().direction.value()},n.prototype.setDirection=function(t){return this._line.properties().direction.setValue(t||"buy"),this},n.prototype.getArrowColor=function(){return d.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)},n.prototype.setArrowColor=function(t){return d.setColorToProperties(t,this._line.properties().arrowColor,this._line.properties().arrowTransparency),this},n.prototype.getTextColor=function(){return d.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)},n.prototype.setTextColor=function(t){return d.setColorToProperties(t,this._line.properties().textColor,this._line.properties().textTransparency),this},n.prototype.getFont=function(){return d.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)},n.prototype.setFont=function(t){return d.setFontToProperties(t,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic),this},n.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},s.prototype._textWidth=function(t){var e,i;return 0===this._adapter.getText().length?0:(t.save(),t.font=this._adapter.getFont(),e=5,i=t.measureText(this._adapter.getText()).width,t.restore(),e+i)},s.prototype._drawArrow=function(t,e,i){var o,n;t.save(),t.strokeStyle=this._adapter.getArrowColor(),t.fillStyle=this._adapter.getArrowColor(),o=this._adapter.getArrowHeight(),n=this._adapter.getDirection(),t.translate(e,i),"buy"!==n&&t.rotate(Math.PI),CanvasEx.drawArrow(t,0,0,0,o),t.restore()},s.prototype._drawText=function(t,e,i){var o,n,s=this._adapter.getText();s&&(t.save(),t.textAlign="center",t.textBaseline="middle",t.font=this._adapter.getFont(),t.fillStyle=this._adapter.getTextColor(),o=e+this._textWidth(t)/2,n=i+d.fontHeight(this._adapter.getFont())/2,t.fillText(s,o,n-1),t.restore())},s.prototype.draw=function(t){var e,i,o,n,s,r,l,h;!this._data.points||this._data.points.length<a.POINTS_COUNT||(e=Math.round(this._data.points[0].x+.5),i=Math.round(this._data.points[0].y),this._drawArrow(t,e,i),0!==(o=this._textWidth(t))&&(n=this._adapter.getArrowHeight(),s=this._adapter.getArrowSpacing(),r=d.fontHeight(this._adapter.getFont()),l=this._adapter.getDirection(),h="buy"===l?i+n+s:i-n-s-r,this._drawText(t,Math.round(e-o/2),h)))},s.prototype.hitTest=function(t){var e,i,o,n,s,r;if(this._data.points&&!(this._data.points.length<a.POINTS_COUNT))return e=Math.round(this._data.points[0].x),i=Math.round(this._data.points[0].y),o=this._adapter.getArrowHeight(),"buy"===this._adapter.getDirection()?(n=i,s=i+o):(n=i-o,s=i),t.x>=e-2&&t.x<=e+2&&t.y>=n&&t.y<=s?(r=this._adapter.getTooltip(),new p(p.CUSTOM,{mouseDownHandler:function(){TradingView.TradingWidget&&TradingView.TradingWidget.journalDialog()},tooltip:""!==r?{text:r,rect:new u(e,n,2,s-n)}:null})):void 0},inherit(r,h),r.prototype._renderer=null,r.prototype._rendererCached=!1,r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){h.prototype.update.call(this),this._renderer=null,this._rendererCached=!1,this._invalidated=!1},r.prototype.renderer=function(t){var e,i,o,n,r,a,h,c;return this._invalidated&&this.updateImpl(),this._rendererCached?this._renderer:(this._rendererCached=!0,e=this._source,i=e.points(),0===i.length?null:(o=e._adapter,n=e._model.timeScale(),r=this._source._model.paneForSource(this._source).executionsPositionController(),a=r.getXYCoordinate(o,n,i[0].index),!isFinite(a.y)||a.y<0||a.y>t||a.x<0?(this._renderer=null,null):(h=[new l.Point(a.x,a.y)],c={points:h},this._renderer=new s(c,o),this._renderer)))},inherit(a,c),a.POINTS_COUNT=1,a.skipMagnetting=!0,a.prototype.pointsCount=function(){return a.POINTS_COUNT},a.prototype.title=function(){return"Execution"},a.prototype.hasContextMenu=function(){return!1},a.prototype.state=function(){return null},a.prototype.updateAllViews=function(){return this._model.properties().tradingProperties.showExecutions.value()?c.prototype.updateAllViews.call(this):null},a.prototype.priceAxisViews=function(t,e){return this._model.properties().tradingProperties.showExecutions.value()?c.prototype.priceAxisViews.call(this,t,e):null},a.prototype.paneViews=function(e){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showExecutions.value()?c.prototype.paneViews.call(this,e):null},a.prototype.userEditEnabled=function(){return!1},a.prototype.showInObjectTree=function(){return!1},e.ExecutionsPositionController=o,e.LineToolExecution=a}).call(e,i(1))},function(t,e,i){"use strict";var o=i(99),n={_fontHeightCache:{},_parsedColorCache:{}};n._parseColor=function(t){var e,i,o;return this._parsedColorCache[t]?this._parsedColorCache[t]:(e=document.createElement("div"),e.style.color=t,i=e.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||e.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d*\.?\d+)\s*\)$/i),o={r:i[1],g:i[2],b:i[3],a:i[4]||"1"},this._parsedColorCache[t]=o,o)},n.getColorFromProperties=function(t,e){var i=1-e.value()/100,o=this._parseColor(t.value());return"rgba("+o.r+","+o.g+","+o.b+","+i+")"},n.setColorToProperties=function(t,e,i){var o,n=this._parseColor(t);e.setValue("rgb("+n.r+","+n.g+","+n.b+")"),o=100*(1-n.a),i.setValue(Math.max(0,Math.min(o,100)))},n._parseFont=function(t){var e,i,o=document.createElement("div");return o.style.font=t,e=o.style.fontSize.match(/(\d+)pt/),i=e&&e[0]===o.style.fontSize,{family:o.style.fontFamily,size:i?e[1]:"",bold:"bold"===o.style.fontWeight,italic:"italic"===o.style.fontStyle}},n.getFontFromProperties=function(t,e,i,o){return[i.value()?"bold":"",o.value()?"italic":"",e.value()+"pt",t.value()].join(" ")},n.setFontToProperties=function(t,e,i,o,n){var s=this._parseFont(t);s.family.length>0&&e.setValue(s.family),s.size.length>0&&i.setValue(s.size),o.setValue(s.bold),n.setValue(s.italic)},n.fontHeight=function(t){var e,i;return this._fontHeightCache[t]||(e=document.createElement("span"),e.appendChild(document.createTextNode("height")),document.body.appendChild(e),e.style.cssText="font: "+t+"; white-space: nowrap; display: inline;",i=e.offsetHeight,document.body.removeChild(e),this._fontHeightCache[t]=Math.ceil(i)),this._fontHeightCache[t]},n.drawPolyHoverOrPress=function(t,e,i,o){o?(t.save(),t.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(t,e,!0),t.restore()):i&&(t.save(),t.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(t,e,!0),t.restore())},n.repaint=function(t){var e=new o(o.LIGHT_UPDATE);e.force=!0,t.invalidate(e)},n.roundToMinTick=function(t,e){var i=t.mainSource().base(),o=1/i;return o*Math.round(e/o)},t.exports=n},function(t,e,i){"use strict";function o(t,e){s.call(this,t,e),this._invalidated=!0}function n(t,e){this._constructor="LineToolPitchfan";var i=e||this.createPropertiesObject("linetoolpitchfan");r.call(this,t,new o(this,t),i)}var s=i(123),r=i(82).LineDataSource,a=i(148),l=i(202).ChannelRenderer,h=i(152).TrendLineRenderer,c=i(113),d=i(117);inherit(o,s),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){s.prototype.update.call(this),0!==this._floatPoints.length&&(3===this._floatPoints.length?(this._medianPoint=this._floatPoints[1].add(this._floatPoints[2]).scaled(.5),this._medianPoint.data=3):2===this._floatPoints.length?(this._medianPoint=this._floatPoints[1],this._medianPoint.data=3):(this._medianPoint=this._floatPoints[0],this._medianPoint.data=3))},o.prototype.renderer=function(){var t,e,i,o,n,s,a,p,u,_,f,m,g,v,y,b;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,this._floatPoints.length<2)return t;if(!this._medianPoint)return t;if(e={points:[this._floatPoints[0],this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},t.append(new h(e)),this._floatPoints.length<3)return this.addAnchors(t),t;for(i={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},t.append(new h(i)),o=0,n=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),s=this._source.properties().fillBackground.value(),a=this._source.properties().transparency.value(),p=0;p<=8;p++)u="level"+p,_=this._source.properties()[u],_.visible.value()&&(f=this._medianPoint.addScaled(n,_.coeff.value()),m=this._medianPoint.addScaled(n,-_.coeff.value()),s&&(g={},g.width=this._model.timeScale().width(),g.p1=this._floatPoints[0],g.p2=f,g.p3=this._floatPoints[0],g.p4=this._medianPoint.addScaled(n,o),g.color=_.color.value(),g.transparency=a,g.hittestOnBackground=!0,t.append(new l(g)),g={},g.width=this._model.timeScale().width(),g.p1=this._floatPoints[0],g.p2=m,g.p3=this._floatPoints[0],g.p4=this._medianPoint.addScaled(n,-o),g.color=_.color.value(),g.transparency=a,g.hittestOnBackground=!0,t.append(new l(g))),o=_.coeff.value(),v={points:[this._floatPoints[0],f],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},y=new c(c.MOVEPOINT,null,p),t.append(new h(v,y)),b={points:[this._floatPoints[0],m],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},y=new c(c.MOVEPOINT,null,p),t.append(new h(b,y)));return this.addAnchors(t),t},inherit(n,r),n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Pitchfan"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new a(t,e,i,{range:[0,8]})},t.exports=n},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){c.call(this,t,e),this._invalidated=!0}function s(t,e){n.call(this,t,e),this._invalidated=!0}function r(t,e){s.call(this,t,e),this._invalidated=!0}function a(t,e){n.call(this,t,e),this._invalidated=!0}function l(t,e){this._constructor="LineToolPitchfork";var i=e||this.createPropertiesObject("linetoolpitchfork");d.call(this,t,new n(this,t),i),this._properties.style.listeners().subscribe(this,l.prototype._recreatePaneView),this._recreatePaneView()}var h=i(30),c=i(123),d=i(82).LineDataSource,p=i(148),u=i(152).TrendLineRenderer,_=i(100).Action,f=i(113),m=i(117),g=i(119);o.prototype.extendPoints=function(t,e,i){var o=new h.Point(0,-5e3),n=new h.Point(i,5e3),s=e.substract(t),r=h.intersectRayWithRect(e,e.add(s),o,n);return r&&(e=r),!h.pointInRect(t,o,n)&&h.pointInRect(e,o,n)&&(r=h.intersectRayWithRect(e,t,o,n))&&(t=r),!h.pointInRect(e,o,n)&&h.pointInRect(t,o,n)&&(r=h.intersectRayWithRect(t,e,o,n))&&(e=r),[t,e]},o.prototype.draw=function(t){var e=t.canvas.width,i=this.extendPoints(this._data.p1,this._data.p2,e),o=this.extendPoints(this._data.p3,this._data.p4,e);t.beginPath(),t.moveTo(i[0].x,i[0].y),t.lineTo(i[1].x,i[1].y),i[1].x<o[1].x&&t.lineTo(o[1].x,i[1].y),t.lineTo(o[1].x,o[1].y),t.lineTo(o[0].x,o[0].y),t.lineTo(i[0].x,i[0].y),t.fillStyle=g.generateColor(this._data.color,this._data.transparency,!0),t.fill()},o.prototype.hitTest=function(t){var e,i,o,n;return this._data.hittestOnBackground?(e=this._data.width,i=this.extendPoints(this._data.p1,this._data.p2,e),o=this.extendPoints(this._data.p3,this._data.p4,e),n=[new h.Point(i[0].x,i[0].y),new h.Point(i[1].x,i[1].y)],i[1].x<o[1].x&&n.push(new h.Point(o[1].x,i[1].y)),n.push(new h.Point(o[1].x,o[1].y)),n.push(new h.Point(o[0].x,o[0].y)),n.push(new h.Point(i[0].x,i[0].y)),h.isInPolygon(n,t)?new f(f.MOVEPOINT_BACKGROUND):null):null},inherit(n,c),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){c.prototype.update.call(this),0!==this._floatPoints.length&&(3===this._floatPoints.length?(this._medianPoint=this._floatPoints[1].add(this._floatPoints[2]).scaled(.5),this._medianPoint.data=3):2===this._floatPoints.length?(this._medianPoint=this._floatPoints[1],this._medianPoint.data=3):(this._medianPoint=this._floatPoints[0],this._medianPoint.data=3))},n.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h,c,p,_,g,v,y,b,w,S,T;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new m,this._floatPoints.length<2)return t;if(!this._medianPoint)return t;if(e={points:[this._floatPoints[0],this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(e)),this._floatPoints.length<3)return this.addAnchors(t),t;for(i={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(i)),n=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),s=this._medianPoint.substract(this._floatPoints[0]),r=0,a=this._source.properties().fillBackground.value(),l=this._source.properties().transparency.value(),h=0;h<=8;h++)c="level"+h,p=this._source.properties()[c],p.visible.value()&&(_=this._medianPoint.addScaled(n,p.coeff.value()),g=_.add(s),v=this._medianPoint.addScaled(n,-p.coeff.value()),y=v.add(s),a&&(b={},b.width=this._model.timeScale().width(),b.p1=_,b.p2=g,b.p3=this._medianPoint.addScaled(n,r),b.p4=b.p3.add(s),b.color=p.color.value(),b.width=this._model.timeScale().width(),b.transparency=l,b.hittestOnBackground=!0,t.append(new o(b)),b={},b.width=this._model.timeScale().width(),b.p1=v,b.p2=y,b.p3=this._medianPoint.addScaled(n,-r),b.p4=b.p3.add(s),b.color=p.color.value(),b.width=this._model.timeScale().width(),b.transparency=l,b.hittestOnBackground=!0,t.append(new o(b))),r=p.coeff.value(),w={points:[_,g],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,h),t.append(new u(w,S)),T={points:[v,y],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,h),t.append(new u(T,S)));return this.addAnchors(t),t},inherit(s,n),s.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h,c,p,_,g,v,y,b,w,S,T;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new m,this._floatPoints.length<2)return t;if(e={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(e)),!this._medianPoint||!this._modifiedBase)return this.addAnchors(t),t;if(i={points:[this._modifiedBase,this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(i)),this._floatPoints.length<3)return this.addAnchors(t),t;for(n={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(n)),s=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),r=this._medianPoint.substract(this._modifiedBase),a=0,l=this._source.properties().fillBackground.value(),h=this._source.properties().transparency.value(),c=0;c<=8;c++)p="level"+c,_=this._source.properties()[p],_.visible.value()&&(g=this._medianPoint.addScaled(s,_.coeff.value()),v=g.add(r),y=this._medianPoint.addScaled(s,-_.coeff.value()),b=y.add(r),l&&(e={},e.p1=g,e.p2=v,e.p3=this._medianPoint.addScaled(s,a),e.p4=e.p3.add(r),e.color=_.color.value(),e.width=this._model.timeScale().width(),e.transparency=h,e.hittestOnBackground=!0,t.append(new o(e)),e={},e.p1=y,e.p2=b,e.p3=this._medianPoint.addScaled(s,-a),e.p4=e.p3.add(r),e.color=_.color.value(),e.width=this._model.timeScale().width(),e.transparency=h,e.hittestOnBackground=!0,t.append(new o(e))),a=_.coeff.value(),w={points:[g,v],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,c),t.append(new u(w,S)),T={points:[y,b],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,c),t.append(new u(T,S)));return this.addAnchors(t),t},s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){n.prototype.updateImpl.call(this),this._floatPoints.length>1&&(this._modifiedBase=this._floatPoints[0].add(this._floatPoints[1]).scaled(.5))},inherit(r,s),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){var t,e,i;n.prototype.updateImpl.call(this),this._floatPoints.length>2&&(t=this._floatPoints[0].x,e=.5*(this._floatPoints[0].y+this._floatPoints[1].y),i=new h.Point(t,e),this._modifiedBase=i)},inherit(a,n),a.prototype.update=function(){this._invalidated=!0},a.prototype.updateImpl=function(){n.prototype.updateImpl.call(this),this._floatPoints.length>1&&(this._modifiedBase=this._floatPoints[0].add(this._floatPoints[1]).scaled(.5))},a.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h,c,p,_,g,v,y,b,w,S,T,C;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new m,this._floatPoints.length<2)return t;if(!this._medianPoint||!this._modifiedBase)return this.addAnchors(t),t;if(3===this._floatPoints.length&&(e={points:[this._modifiedBase,this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(e))),i={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(i)),this._floatPoints.length<3)return this.addAnchors(t),t;for(n={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(n)),s=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),r=this._floatPoints[2].substract(this._modifiedBase),a=0,l=this._source.properties().fillBackground.value(),h=this._source.properties().transparency.value(),c={points:[this._medianPoint,this._medianPoint.add(r)],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(c)),p=0;p<=8;p++)_="level"+p,g=this._source.properties()[_],g.visible.value()&&(v=this._medianPoint.addScaled(s,g.coeff.value()),y=v.add(r),b=this._medianPoint.addScaled(s,-g.coeff.value()),w=b.add(r),l&&(i={},i.p1=v,i.p2=y,i.p3=this._medianPoint.addScaled(s,a),i.p4=i.p3.add(r),i.color=g.color.value(),i.width=this._model.timeScale().width(),i.transparency=h,i.hittestOnBackground=!0,t.append(new o(i)),i={},i.p1=b,i.p2=w,i.p3=this._medianPoint.addScaled(s,-a),i.p4=i.p3.add(r),i.color=g.color.value(),i.width=this._model.timeScale().width(),i.transparency=h,i.hittestOnBackground=!0,t.append(new o(i))),a=g.coeff.value(),S={points:[v,y],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},T=new f(f.MOVEPOINT,null,p),t.append(new u(S,T)),C={points:[b,w],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},T=new f(f.MOVEPOINT,null,p),t.append(new u(C,T)));return this.addAnchors(t),t},inherit(l,d),l.STYLE_ORIGINAL=0,l.STYLE_SCHIFF=1,l.STYLE_INSIDE=2,l.STYLE_SCHIFF2=3,l.prototype.additionalActions=function(){var t,e,i=[],o=["Original","Modified Schiff","Inside","Schiff"];for(t=0;t<4;t++)e=new _({checked:this.properties().style.value()===t,checkable:!0,text:$.t(o[t]),callbackContext:{target:this,value:t}}),e.callbacks().subscribe(null,function(t){var e=t.callbackContext(),i=e.target,o=e.value;i.properties().style.setValue(o),i.updateAllViews(),i._model.updateSource(i)}),i.push(e);return[i[0],i[3],i[1],i[2]]},l.prototype._recreatePaneView=function(){this._properties.style.value()===l.STYLE_ORIGINAL?this._paneViews=[new n(this,this._model)]:this._properties.style.value()===l.STYLE_SCHIFF?this._paneViews=[new s(this,this._model)]:this._properties.style.value()===l.STYLE_SCHIFF2?this._paneViews=[new r(this,this._model)]:this._properties.style.value()===l.STYLE_INSIDE&&(this._paneViews=[new a(this,this._model)])},l.prototype.pointsCount=function(){return 3},l.prototype.title=function(){return $.t("Pitchfork")},l.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},l.prototype.createPropertiesObject=function(t,e,i){return new p(t,e,i,{range:[0,8]})},e.ChannelRenderer=o,e.LineToolPitchfork=l},function(t,e,i){"use strict";function o(t,e){l.call(this,t,e),this._rendererCache={},this._numericFormatter=new f,this._invalidated=!0}function n(t,e){this._constructor="LineToolGannSquare";var i=e||this.createPropertiesObject("linetoolgannsquare");h.call(this,t,new o(this,t),i),this._adjustScaleAction=this._makeAdjustScaleAction()}var s,r,a=i(30),l=i(123),h=i(82).LineDataSource,c=i(148),d=i(124).TextRenderer,p=i(150).RectangleTransparencyRenderer,u=i(152).TrendLineRenderer,_=i(117),f=i(94).NumericFormatter;inherit(o,l),o.prototype.renderer=function(){function t(t,e,i){var o,d,p,_,f,m,g,v,y,b=new a.Point(n,s),w=new a.Point(r,s),S=new a.Point(n,l),T=new a.Point(r,l),C={width:k._model.timeScale().width(),height:k._source.priceScale().height(),color:c.fans.color.value(),linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LINEEND_NORMAL,rightend:h.LINEEND_NORMAL};for(o=0;o<e.length;++o)d=i?l:e[o],p=i?s:e[o],_=i?e[o]:n,f=i?e[o]:r,m=new a.Point(f,d),g=new a.Point(_,d),v=new a.Point(f,p),y=new a.Point(_,p),t.append(new u($.extend({},C,{points:[S,v]}))),t.append(new u($.extend({},C,{points:[T,y]}))),t.append(new u($.extend({},C,{points:[b,m]}))),t.append(new u($.extend({},C,{points:[w,g]})))}var e,i,o,n,s,r,l,c,f,m,g,v,y,b,w,S,T,C,x,P,L,k;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new _,this._points.length<2)return this.addAnchors(e),e;for(i=this._points[0],o=this._points[1],n=Math.min(i.x,o.x),s=Math.min(i.y,o.y),r=Math.max(i.x,o.x),l=Math.max(i.y,o.y),c=this._source.properties(),f=this._source.properties().fillHorzBackground.value(),m=this._source.properties().horzTransparency.value(),g=this._source.properties().fillVertBackground.value(),v=this._source.properties().vertTransparency.value(),y=0;y<this._hlevels.length;y++)y>0&&f&&(b=this._hlevels[y-1],i=new a.Point(n,this._hlevels[y].y),o=new a.Point(r,b.y),w={},w.points=[i,o],w.color=this._hlevels[y].color,w.linewidth=0,w.backcolor=this._hlevels[y].color,w.fillBackground=!0,w.transparency=m,e.append(new p(w))),i=new a.Point(n,this._hlevels[y].y),o=new a.Point(r,this._hlevels[y].y),S={points:[i,o],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._hlevels[y].color,linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LINEEND_NORMAL,rightend:h.LINEEND_NORMAL},e.append(new u(S)),c.showLeftLabels.value()&&(T={points:[i],text:this._numericFormatter.format(this._hlevels[y].coeff),color:this._hlevels[y].color,vertAlign:"middle",horzAlign:"right",font:c.font.value(),offsetX:-5,offsetY:0,fontsize:12},e.append(new d(T,this._rendererCache))),c.showRightLabels.value()&&(C={points:[o],text:this._numericFormatter.format(this._hlevels[y].coeff),color:this._hlevels[y].color,vertAlign:"middle",horzAlign:"left",font:c.font.value(),offsetX:5,offsetY:0,fontsize:12},e.append(new d(C,this._rendererCache)));for(y=0;y<this._vlevels.length;y++)i=new a.Point(this._vlevels[y].x,s),o=new a.Point(this._vlevels[y].x,l),y>0&&g&&(b=this._vlevels[y-1],x=new a.Point(b.x,s),w={},w.points=[x,o],w.color=this._vlevels[y].color,w.linewidth=0,w.backcolor=this._vlevels[y].color,w.fillBackground=!0,w.transparency=v,e.append(new p(w))),S={points:[i,o],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._vlevels[y].color,linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LINEEND_NORMAL,rightend:h.LINEEND_NORMAL},e.append(new u(S)),c.showTopLabels.value()&&(P={points:[i],text:this._numericFormatter.format(this._vlevels[y].coeff),color:this._vlevels[y].color,vertAlign:"bottom",horzAlign:"center",font:c.font.value(),offsetX:0,offsetY:-5,fontsize:12},e.append(new d(P,this._rendererCache))),c.showBottomLabels.value()&&(L={points:[o],text:this._numericFormatter.format(this._vlevels[y].coeff),color:this._vlevels[y].color,vertAlign:"top",horzAlign:"center",font:c.font.value(),offsetX:0,offsetY:5,fontsize:12},e.append(new d(L,this._rendererCache)));return k=this,t(e,this._hfans,!0),t(e,this._vfans,!1),this.addAnchors(e),e},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,r,a,h,c,d,p,u,_,f,m,g,v;if(l.prototype.update.call(this),!(this._source.points().length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()){for(t=this._source.points()[0],e=this._source.points()[1],i=this._source.properties(),o=i.reverse&&i.reverse.value(),this._hlevels=[],n=o?t.price-e.price:e.price-t.price,s=o?e.price:t.price,this._source.priceScale().isPercent()&&(r=this._source.ownerSource().firstValue()),a=1;a<=7;a++)h="hlevel"+a,c=i[h],c.visible.value()&&(d=c.coeff.value(),p=c.color.value(),u=s+d*n,this._source.priceScale().isPercent()&&(u=this._source.priceScale().priceRange().convertToPercent(u,r)),_=this._source.priceScale().priceToCoordinate(u),this._hlevels.push({coeff:d,color:p,y:_}));for(this._vlevels=[],f=o?t.index-e.index:e.index-t.index,m=o?e.index:t.index,a=1;a<=7;a++)h="vlevel"+a,c=i[h],c.visible.value()&&(d=c.coeff.value(),p=c.color.value(),g=Math.round(m+d*f),v=this._model.timeScale().indexToCoordinate(g),this._vlevels.push({coeff:d,color:p,x:v}));if(this._hfans=[],this._vfans=[],i.fans.visible.value())for(a=1;a<=7;a++)g=Math.round(m+i["hlevel"+a].coeff.value()*f),u=s+i["vlevel"+a].coeff.value()*n,this._source.priceScale().isPercent()&&(u=this._source.priceScale().priceRange().convertToPercent(u,r)),this._hfans.push(this._model.timeScale().indexToCoordinate(g)),this._vfans.push(this._source.priceScale().priceToCoordinate(u))}},inherit(n,h),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Gann Box"},s=[4.5,9,11.25,18,22.5,36,45],r=function(){for(var t=[],e=1e10,i=s.length-1,o=1,n=0,r=0;r<e;)r=s[n]*o,t.push(Math.round(r)),t.push(Math.ceil(-r)),n===i-1&&(o*=10),n=(n+1)%i;return t.sort(function(t,e){return t<e?-1:t>e?1:0}),t}(),n.prototype._alignPriceOnPattern=function(t,e){var i,o,n,r,a,l,h=Math.round(1e6*(t.price-e.price))/1e6;if(0===h)return e.price;for(i=s[0],o=s[s.length-1],n=1,r=Math.abs(h);r<i*n||o*n<r;)r<i*n?n*=.1:o*n<r&&(n*=10);for(a=o*n,l=s.length-2;l>=0&&!(s[l]*n<r);--l)a=s[l]*n;return t.price=e.price+(h>=0?a:-a),t},n.prototype._alignTimeOnPattern=function(t,e){var i,o=t.index-e.index;if(0===o)return 0;for(i=r.length-2;i>=0&&!(r[i]<o);--i);return i+=o>0?1:0,t.index=e.index+r[i],t},n.prototype._alignPointsFixedIncrement=function(t,e){return this._alignTimeOnPattern(t,e),this._alignPriceOnPattern(t,e),t},n.prototype._preparePoint=function(t,e){return e&&e.shift&&0!==this._points.length&&this._alignPointsFixedIncrement(t,this._points[0]),h.prototype._preparePoint.call(this,t,e)},n.prototype.setPoint=function(t,e,i){if(i&&i.shift){var o=0===t?this._points[1]:this._points[0];this._alignPointsFixedIncrement(e,o)}h.prototype.setPoint.call(this,t,e,i)},n.prototype.createPropertiesObject=function(t,e,i){return new c(t,e,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},n.prototype.contextMenuActions=function(){return[this._adjustScaleAction]},n.prototype.updateContextMenuActions=function(){this._adjustScaleAction.setEnabled(!this.priceScale().isPercent())},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._rendererCache={},this._numericFormatter=new _,this._invalidated=!0}function n(t,e){this._constructor="LineToolFibSpeedResistanceFan";var i=e||this.createPropertiesObject("linetoolfibspeedresistancefan");a.call(this,t,new o(this,t),i)}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(148),h=i(202).ChannelRenderer,c=i(124).TextRenderer,d=i(152).TrendLineRenderer,p=i(113),u=i(117),_=i(94).NumericFormatter;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_;if(r.prototype.update.call(this),!(this._source.points().length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()){for(t=this._source.points()[0],e=this._source.points()[1],this._hlevels=[],i=e.price-t.price,this._source.priceScale().isPercent()&&(o=this._source.ownerSource().firstValue()),n=1;n<=7;n++)s="hlevel"+n,a=this._source.properties()[s],a.visible.value()&&(l=a.coeff.value(),h=a.color.value(),c=t.price+l*i,this._source.priceScale().isPercent()&&(c=this._source.priceScale().priceRange().convertToPercent(c,o)),d=this._source.priceScale().priceToCoordinate(c,!0),this._hlevels.push({coeff:l,color:h,y:d,index:n}));for(this._vlevels=[],p=e.index-t.index,n=1;n<=7;n++)s="vlevel"+n,a=this._source.properties()[s],a.visible.value()&&(l=a.coeff.value(),h=a.color.value(),u=Math.round(t.index+l*p),_=this._model.timeScale().indexToCoordinate(u,!0),this._vlevels.push({coeff:l,color:h,x:_,index:n}))}},o.prototype.renderer=function(){var t,e,i,o,n,r,l,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new u,this._floatPoints.length<2)return t;for(e=this._floatPoints[0],i=this._floatPoints[1],o=Math.min(e.x,i.x),n=Math.min(e.y,i.y),r=Math.max(e.x,i.x),l=Math.max(e.y,i.y),_=this._source.properties(),f=_.grid.color.value(),m=_.grid.linewidth.value(),g=_.grid.linestyle.value(),v=0;v<this._hlevels.length;v++)e=new s.Point(o,this._hlevels[v].y),i=new s.Point(r,this._hlevels[v].y),_.grid.visible.value()&&(y={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:f,linewidth:m,linestyle:g,extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},t.append(new d(y))),_.showLeftLabels.value()&&(b={points:[e],text:this._numericFormatter.format(this._hlevels[v].coeff),color:this._hlevels[v].color,vertAlign:"middle",horzAlign:"right",font:_.font.value(),offsetX:-5,offsetY:0,fontsize:12},t.append(new c(b,this._rendererCache))),_.showRightLabels.value()&&(w={points:[i],text:this._numericFormatter.format(this._hlevels[v].coeff),color:this._hlevels[v].color,vertAlign:"middle",horzAlign:"left",font:_.font.value(),offsetX:5,offsetY:0,fontsize:12},t.append(new c(w,this._rendererCache)));for(v=0;v<this._vlevels.length;v++)e=new s.Point(this._vlevels[v].x,n),i=new s.Point(this._vlevels[v].x,l),_.grid.visible.value()&&(y={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:f,linewidth:m,linestyle:g,extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},t.append(new d(y))),_.showTopLabels.value()&&(S={points:[e],text:this._numericFormatter.format(this._vlevels[v].coeff),color:this._vlevels[v].color,vertAlign:"bottom",horzAlign:"center",font:_.font.value(),offsetX:0,offsetY:-5,fontsize:12},t.append(new c(S,this._rendererCache))),_.showBottomLabels.value()&&(T={points:[i],text:this._numericFormatter.format(this._vlevels[v].coeff),color:this._vlevels[v].color,vertAlign:"top",horzAlign:"center",font:_.font.value(),offsetX:0,offsetY:5,fontsize:12},t.append(new c(T,this._rendererCache)));for(C=_.fillBackground.value(),x=_.transparency.value(),e=this._floatPoints[0],i=this._floatPoints[1],v=0;v<this._hlevels.length;v++)P=new s.Point(i.x,this._hlevels[v].y),v>0&&C&&(L=new s.Point(i.x,this._hlevels[v-1].y),k={},k.width=this._model.timeScale().width(),k.p1=e,k.p2=P,k.p3=e,k.p4=L,k.color=this._hlevels[v].color,k.transparency=x,k.hittestOnBackground=!0,t.append(new h(k))),y={points:[e,P],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._hlevels[v].color,linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},I=new p(p.MOVEPOINT,null,{type:"h",index:this._hlevels[v].index}),t.append(new d(y,I));for(v=0;v<this._vlevels.length;v++)E=new s.Point(this._vlevels[v].x,i.y),v>0&&C&&(L=new s.Point(this._vlevels[v-1].x,i.y),k={},k.width=this._model.timeScale().width(),k.p1=e,k.p2=E,k.p3=e,k.p4=L,k.color=this._vlevels[v].color,k.transparency=x,k.hittestOnBackground=!0,t.append(new h(k))),y={points:[e,E],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._vlevels[v].color,linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},I=new p(p.MOVEPOINT,null,{type:"v",index:this._vlevels[v].index}),t.append(new d(y,I));return this.addAnchors(t),t},inherit(n,a),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Speed Resistance Fan"},n.prototype.processErase=function(t,e){var i="h"===e.type?"hlevel"+e.index:"vlevel"+e.index,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new l(t,e,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},t.exports=n},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){h.call(this,t,e),this._rendererCache={},this._invalidated=!0}function s(t,e){this._constructor="LineToolGannComplex";var i=e||this.createPropertiesObject("linetoolganncomplex");l.call(this,t,new n(this,t),i),this._adjustScaleAction=this._makeAdjustScaleAction(function(){var t=this.points();return 3===t.length?[t[0],t[2]]:[]}.bind(this))}function r(t,e,i){c.call(this,t,e,i,{names:["width","color","visible"]})}var a=i(30),l=i(82).LineDataSource,h=i(123),c=i(148),d=i(152).TrendLineRenderer,p=i(28).isSameType,u=i(113),_=i(117),f=i(119);o.prototype.draw=function(t){var e,i,o,n,s,r;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.translate(this._data.center.x,this._data.center.y),e=this._data.edge.substract(this._data.center),i=e.y/e.x,o=this._data.point.substract(this._data.center),o.y/=i,n=o.length(),s=this._data.prevPoint.substract(this._data.center),s.y/=i,r=s.length(),t.scale(1,i),this._data.fillBack&&(this._data.point.x<this._data.center.x&&(n=-n,r=-r),t.beginPath(),t.moveTo(r,0),t.lineTo(n,0),t.arcTo(n,n,0,n,Math.abs(n)),t.lineTo(0,r),t.arcTo(r,r,r,0,Math.abs(r)),t.fillStyle=f.generateColor(this._data.color,this._data.transparency,!0),t.fill()),t.beginPath(),this._data.point.x>this._data.center.x?t.arc(0,0,Math.abs(n),0,Math.PI/2,!1):t.arc(0,0,Math.abs(n),-Math.PI/2,-Math.PI,!0),t.scale(1,1/i),t.stroke()},o.prototype.hitTest=function(t){var e,i,o,n,s,r=t.substract(this._data.center),a=this._data.edge.substract(this._data.center),l=a.y/a.x;return r.y/=l,e=this._data.point.substract(this._data.center),e.y/=l,i=e.length(),o=r.length(),n=this._data.prevPoint.substract(this._data.center),n.y/=l,s=n.length(),Math.abs(o-i)<5&&a.x*r.x>=0&&a.y*r.y>=0?new u(u.MOVEPOINT):this._data.fillBack&&o>=s&&o<=i&&a.x*r.x>=0&&a.y*r.y>=0?new u(u.MOVEPOINT_BACKGROUND):null},inherit(n,h),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){h.prototype.update.call(this),this._source._cornerPoint&&this._points.push(this._source.pointToScreenPoint(this._source._cornerPoint)[0])},n.prototype.renderer=function(){var t,e,i,n,s,r,h,c,p,u,f,m,g,v,y,b,w,S,T,C,x,P,L;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=this._source.properties(),e=new _,this._points.length<2)return this.addAnchors(e),e;for(i=this._points[0],n=3===this._points.length?this._points[2]:this._points[1],s=this._points[1],r=t.reverse&&t.reverse.value(),h=r?i.x-n.x:n.x-i.x,c=r?i.y-n.y:n.y-i.y,p=r?s:i,u=r?new a.Point(s.x-(n.x-i.x),s.y-(n.y-i.y)):n,g=0;g<6;g++)v=t.levels[g],v.visible.value()&&(y=g/5,f=p.x+y*h,b={points:[new a.Point(f,p.y),new a.Point(f,u.y)],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:v.color.value(),linewidth:v.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},e.append(new d(b)),m=p.y+y*c,b={points:[new a.Point(p.x,m),new a.Point(u.x,m)],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:v.color.value(),linewidth:v.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},e.append(new d(b)));for(g in t.fanlines._childs)w=t.fanlines[g],w.visible.value()&&(S=w.x.value(),T=w.y.value(),S>T?(f=u.x,y=T/S,m=p.y+y*c):(m=u.y,y=S/T,f=p.x+y*h),b={points:[r?s:i,new a.Point(f,m)],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:w.color.value(),linewidth:w.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},e.append(new d(b)));C=r?s:i;for(g in t.arcs._childs)x=t.arcs[g],x.visible.value()&&(S=x.x.value()/5,T=x.y.value()/5,f=p.x+S*h,m=p.y+T*c,P={center:p,point:new a.Point(f,m),edge:u,color:x.color.value(),linewidth:x.width.value(),fillBack:t.arcsBackground.fillBackground.value(),transparency:t.arcsBackground.transparency.value(),prevPoint:C},e.append(new o(P)),C=P.point);return this.isAnchorsRequired()&&(L=[i,s],this._model.lineBeingCreated()===this._source&&L.pop(),e.append(this.createLineAnchor({points:L}))),e},inherit(s,l),s.prototype._recalcSecondPoint=function(){var t,e,i,o,n,s=this._model.mainSeries().properties().style.value(),r=this._model.mainSeries().interval();s===this._currentStyle&&r===this._currentInterval||(t=this.pointToScreenPoint(this.points()[0])[0],e=this.pointToScreenPoint(this.points()[2])[0],i=e.substract(t),o=t.add(i.scaled(.2/Math.sqrt(2))),n=this.screenPointToPoint(o),this._points[1]=n)},s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Gann Square"},s.prototype.axisPoints=function(){var t,e,i,o=l.prototype.axisPoints.call(this).slice();return this.properties().reverse.value()&&3===o.length&&(t=o[0],e=o[1],i=o[2],o[2]={index:e.index-(i.index-t.index),price:e.price-(i.price-t.price)}),o},s.prototype._fixThirdPoint=function(t){var e,i,o,n,s,r,l,h;this.points().length<2||(e=this.pointToScreenPoint(this.points()[0])[0],i=this.pointToScreenPoint(this.points()[1])[0],o=i.substract(e),t?(n=e.add(o.scaled(5*Math.sqrt(2))),this._cornerPoint=this.screenPointToPoint(n)):(s=o.x<0?-1:1,r=o.y<0?-1:1,l=i.substract(e).length(),n=e.add(new a.Point(5*l*s,5*l*r)),h=this.screenPointToPoint(n),this._cornerPoint=h))},s.prototype.setPoint=function(t,e,i){var o,n,s=l.prototype.setPoint.call(this,t,e,i),r=i&&i.shift;return this._fixThirdPoint(r),this._points[2]=this._cornerPoint,delete this._cornerPoint,o=this._model.mainSeries().properties().style.value(),n=this._model.mainSeries().interval(),this._currentStyle=o,this._currentInterval=n,s},s.prototype.setLastPoint=function(t,e){var i=l.prototype.setLastPoint.call(this,t,e),o=e&&e.shift;return this._fixThirdPoint(o),i},s.prototype.addPoint=function(t,e){var i,o,n,s,r=$.extend({},t),a=this._model.mainSeries().properties().style.value(),l=this._model.mainSeries().interval();return this._currentStyle=a,this._currentInterval=l,i=this.priceScale(),i.isPercent()&&(o=this.ownerSource().firstValue(),r.price=i.priceRange().convertFromPercent(r.price,o)),n=e&&e.shift,this._points.push(r),this._lastPoint=null,s=this._points.length===this.pointsCount(),s?(this._fixThirdPoint(n),this._points.push(this._cornerPoint),delete this._cornerPoint,this.normalizePoints(),this.createServerPoints()):this._lastPoint=r,s},s.prototype.onData=function(t){l.prototype.onData.call(this,t),this._recalcSecondPoint()},s.prototype.contextMenuActions=function(){return[this._adjustScaleAction]},s.prototype.updateContextMenuActions=function(){this._adjustScaleAction.setEnabled(!this.priceScale().isPercent())},inherit(r,c),r.prototype._iterateLevels=function(t,e){var i,o,n;for(i in t.levels)if(t.levels[i]&&p(t.levels[i],e.typecheck())){o=e.tpl();for(n in this._map.names)o=e.fill(n,this._map.names[n],t.levels[i],o);t.levels[i]=o}return t},s.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i)},t.exports=s},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolGannFan";var i=e||this.createPropertiesObject("linetoolgannfan");r.call(this,t,new o(this,t),i)}var s=i(30),r=i(82).LineDataSource,a=i(123),l=i(148),h=i(202).ChannelRenderer,c=i(124).TextRenderer,d=i(152).TrendLineRenderer,p=i(113),u=i(117);inherit(o,a),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,r,l,h,c,d,p,u,_;if(a.prototype.update.call(this),!(this._source.points().length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty())for(t=this._floatPoints[0],e=this._floatPoints[1],this._fans=[],i=e.x-t.x,o=e.y-t.y,r=1;r<=9;r++)l="level"+r,h=this._source.properties()[l],h.visible.value()&&(c=h.coeff1.value(),d=h.coeff2.value(),p=c/d,u=h.color.value(),_=c+"/"+d,c>d?(n=e.x,s=t.y+o/p):(n=t.x+i*p,s=e.y),this._fans.push({label:_,color:u,x:n,y:s,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),index:r}))},o.prototype.renderer=function(){var t,e,i,o,n,a,l,_,f,m,g,v;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new u,this._floatPoints.length<2)return t;for(e=this._floatPoints[0],i=this._source.properties(),o=this._source.properties().fillBackground.value(),n=this._source.properties().transparency.value(),a=0;a<this._fans.length;a++)l=new s.Point(this._fans[a].x,this._fans[a].y),o&&(this._fans[a].index<4?(_=new s.Point(this._fans[a+1].x,this._fans[a+1].y),f={},f.width=this._model.timeScale().width(),f.p1=e,f.p2=l,f.p3=e,f.p4=_,f.color=this._fans[a].color,f.transparency=n,f.hittestOnBackground=!0,t.append(new h(f))):this._fans[a].index>4&&a>0&&(_=new s.Point(this._fans[a-1].x,this._fans[a-1].y),f={},f.width=this._model.timeScale().width(),f.p1=e,f.p2=l,f.p3=e,f.p4=_,f.color=this._fans[a].color,f.transparency=n,f.hittestOnBackground=!0,t.append(new h(f)))),m={points:[e,l],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._fans[a].color,linewidth:this._fans[a].linewidth,linestyle:this._fans[a].linestyle,extendleft:!1,extendright:!0,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},g=new p(p.MOVEPOINT,null,this._fans[a].index),t.append(new d(m,g)),i.showLabels.value()&&(v={points:[l],text:this._fans[a].label,color:this._fans[a].color,vertAlign:"middle",horzAlign:"left",font:i.font.value(),offsetX:0,offsetY:-5,fontsize:12},t.append(new c(v,this._rendererCache)));return this.addAnchors(t),t},inherit(n,r),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Gann Fan"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new l(t,e,i,{range:[1,9]})},t.exports=n},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._label=null,this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolDisjointAngle";var i=e||new p("linetooldisjointangle");l.call(this,t,new o(this,t),i),this.version=n.version}var s=i(152).TrendLineRenderer,r=i(202).ChannelRenderer,a=i(123),l=i(82).LineDataSource,h=i(124).TextRenderer,c=i(181),d=i(117),p=i(91).DefaultProperty;inherit(o,a),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o;a.prototype.update.call(this),this._label=null,this._source.points().length<2||this._source.priceScale()&&(t=this._source.points()[0],e=this._source.points()[1],this._price1=this._source.priceScale().formatter().format(t.price),this._price2=this._source.priceScale().formatter().format(e.price),3===this._source.points().length&&(i=this._source.points()[2],this._price3=this._source.priceScale().formatter().format(i.price),o=e.price-t.price,this._price4=this._source.priceScale().formatter().format(i.price+o)))},o.prototype.renderer=function(){var t,e,i,o,n,a,l,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,this._points.length<2?t:(e=this._points[0],i=this._points[1],a=this._source.properties(),l=this._model,p=this._source,a=p.properties(),this._points.length>=3&&(o=this._points[2],o.x=i.x,u=i.y-e.y,n=e.clone(),n.y=o.y+u,n.data=3,a.fillBackground.value()&&(_={},f=l.timeScale().width(),m=a.extendLeft.value(),g=a.extendRight.value(),m||g?!m&&g?(v={},v.width=f,v.p1=e,v.p2=i,v.p3=n,v.p4=o,v.color=a.backgroundColor.value(),v.transparency=a.transparency.value(),v.hittestOnBackground=TradingView.isMobile.any(),t.append(new r(v))):m&&!g?(v={},v.width=f,v.p1=i,v.p2=e,v.p3=o,v.p4=n,v.color=a.backgroundColor.value(),v.transparency=a.transparency.value(),v.hittestOnBackground=TradingView.isMobile.any(),t.append(new r(v))):(y=e.add(i).scaled(.5),b=n.add(o).scaled(.5),w={},w.width=f,w.p1=y,w.p2=i,w.p3=b,w.p4=o,w.color=a.backgroundColor.value(),w.transparency=a.transparency.value(),w.hittestOnBackground=TradingView.isMobile.any(),t.append(new r(w)),S={},S.width=f,S.p1=y,S.p2=e,S.p3=b,S.p4=n,S.color=a.backgroundColor.value(),S.transparency=a.transparency.value(),S.hittestOnBackground=TradingView.isMobile.any(),t.append(new r(S))):(_.points=[e,i,o,n],_.color="rgba(0,0,0,0)",_.linewidth=0,_.linestyle=CanvasEx.LINESTYLE_SOLID,_.filled=!0,_.backcolor=a.backgroundColor.value(),_.fillBackground=!0,_.transparency=a.transparency.value(),t.append(new c(_))))),T=function(t,e){return{points:[t,e],width:l.timeScale().width(),height:p.priceScale().height(),color:a.linecolor.value(),linewidth:a.linewidth.value(),linestyle:a.linestyle.value(),extendleft:a.extendLeft.value(),extendright:a.extendRight.value(),leftend:a.leftEnd.value(),rightend:a.rightEnd.value()}},t.append(new s(T(e,i))),C=this,x=function(e,i,o,n){var s;C._source.properties().showPrices.value()&&(s={points:[e],text:o,color:C._source.properties().textcolor.value(),horzAlign:e.x>i.x?"left":"right",vertAlign:"middle",font:C._source.properties().font.value(),offsetX:e.x>i.x?-5:5,offsetY:-5,bold:C._source.properties().bold.value(),italic:C._source.properties().italic.value(),fontsize:C._source.properties().fontsize.value()},t.append(new h(s,C._rendererCache)),s={points:[i],text:n,color:C._source.properties().textcolor.value(),horzAlign:e.x<i.x?"left":"right",vertAlign:"middle",font:C._source.properties().font.value(),offsetX:e.x>i.x?-5:5,offsetY:-5,bold:C._source.properties().bold.value(),italic:C._source.properties().italic.value(),fontsize:C._source.properties().fontsize.value()},t.append(new h(s,C._rendererCache)))},t.append(new s(T(e,i))),x(e,i,this._price1,this._price2),2===this._points.length?(this.addAnchors(t),t):(t.append(new s(T(n,o))),x(o,n,this._price3,this._price4),this.isAnchorsRequired()&&(P=[e,i,o,n],this._model.lineBeingCreated()===this._source&&P.pop(),t.append(this.createLineAnchor({points:P}))),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&e&&i&&this._source.getAlertIsActive(function(o){t.append(new TradingView.PaneRendererClockIcon({point1:e,point2:i,color:o?a.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),t))},inherit(n,l),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Disjoint Angle"},n.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),l.prototype.addPoint.call(this,t)},n.prototype.setLastPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),l.prototype.setLastPoint.call(this,t)},n.prototype.setPoint=function(t,e,i){var o,n,s,r,a,h=.5*(this._points[1].price+this._points[2].price);i&&i.shift&&1===t&&(o=0,this._snapPoint45Degree(e,this.points()[o])),t<3&&l.prototype.setPoint.call(this,t,e),0!==t&&2!==t&&(1===t?(n=this._points[1].price-h,this._points[2].price=this._points[1].price-2*n):3===t&&(s=this.priceScale(),r=e.price,s.isPercent()&&(a=this.ownerSource().firstValue(),r=s.priceRange().convertFromPercent(r,a)),n=r-this._points[2].price,this._points[0].price=this._points[1].price-n,this._points[0].index=e.index))},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var t,e,i,o,n,s,r,a,l,h=this._points[0],c=this._points[1],d=[];return h.index<=c.index?(d.push(h),d.push(c)):(d.push(c),d.push(h)),t=this._points[2],t.time=c.time,t.index=c.index,e={price:t.price+(c.price-h.price),time:h.time,index:h.index},i=[],t.index<=e.index?(i.push(t),i.push(e)):(i.push(e),i.push(t)),d[0].price>i[0].price?(o=d,n=i):i[0].price>d[0].price?(o=i,n=d):i[1].price>d[1].price?(o=i,n=d):(o=d,n=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),h.index<=c.index?(s=a,r=l):(s=l,r=a),[this._linePointsToAlertPlot(o,"Upper",s,r),this._linePointsToAlertPlot(n,"Lower",s,r)]},t.exports=n},function(t,e,i){"use strict";function o(t,e){s.call(this,t,e),this._label1=null,this._label2=null,this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolFlatBottom";var i=e||new p("linetoolflatbottom");r.call(this,t,new o(this,t),i),this.version=n.version}var s=i(123),r=i(82).LineDataSource,a=i(202).ChannelRenderer,l=i(152).TrendLineRenderer,h=i(124).TextRenderer,c=i(181),d=i(117),p=i(91).DefaultProperty;inherit(o,s),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i;s.prototype.update.call(this),this._label1=null,this._label2=null,this._source.points().length<2||this._source.priceScale()&&(t=this._source.points()[0],e=this._source.points()[1],this._price1=this._source.priceScale().formatter().format(t.price),this._price2=this._source.priceScale().formatter().format(e.price),3===this._source.points().length&&(i=this._source.points()[2],this._price3=this._source.priceScale().formatter().format(i.price)))},o.prototype.renderer=function(){var t,e,i,o,n,s,r,p,u,_,f,m,g,v,y,b,w,S,T,C,x;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,this._points.length<2?t:(e=this._points[0],i=this._points[1],s=this._source.properties(),r=this._model,p=this._source,3===this._points.length&&(o=this._points[2],o.x=i.x,n=e.clone(),n.y=o.y,n.data=3,s.fillBackground.value()&&(u={},_=r.timeScale().width(),f=s.extendLeft.value(),m=s.extendRight.value(),f||m?!f&&m?(g={},g.width=_,g.p1=e,g.p2=i,g.p3=n,g.p4=o,g.color=s.backgroundColor.value(),g.transparency=s.transparency.value(),g.hittestOnBackground=TradingView.isMobile.any(),t.append(new a(g))):f&&!m?(g={},g.width=_,g.p1=i,g.p2=e,g.p3=o,g.p4=n,g.color=s.backgroundColor.value(),g.transparency=s.transparency.value(),g.hittestOnBackground=TradingView.isMobile.any(),t.append(new a(g))):(v=e.add(i).scaled(.5),y=n.add(o).scaled(.5),b={},b.width=_,b.p1=v,b.p2=i,b.p3=y,b.p4=o,b.color=s.backgroundColor.value(),b.transparency=s.transparency.value(),b.hittestOnBackground=TradingView.isMobile.any(),t.append(new a(b)),w={},w.width=_,w.p1=v,w.p2=e,w.p3=y,w.p4=n,w.color=s.backgroundColor.value(),w.transparency=s.transparency.value(),w.hittestOnBackground=TradingView.isMobile.any(),t.append(new a(w))):(u.points=[e,i,o,n],u.color="rgba(0,0,0,0)",u.linewidth=0,u.linestyle=CanvasEx.LINESTYLE_SOLID,u.filled=!0,u.backcolor=s.backgroundColor.value(),u.fillBackground=!0,u.transparency=s.transparency.value(),t.append(new c(u))))),S=function(t,e){return{points:[t,e],width:r.timeScale().width(),height:p.priceScale().height(),color:s.linecolor.value(),linewidth:s.linewidth.value(),linestyle:s.linestyle.value(),extendleft:s.extendLeft.value(),extendright:s.extendRight.value(),leftend:s.leftEnd.value(),rightend:s.rightEnd.value()}},t.append(new l(S(e,i))),2===this._points.length?(this.addAnchors(t),t):(T=this,C=function(e,i,o,n){var s;T._source.properties().showPrices.value()&&(s={points:[e],text:o,color:T._source.properties().textcolor.value(),horzAlign:e.x>i.x?"left":"right",vertAlign:"middle",font:T._source.properties().font.value(),offsetX:e.x>i.x?-5:5,offsetY:-5,bold:T._source.properties().bold.value(),italic:T._source.properties().italic.value(),fontsize:T._source.properties().fontsize.value()},t.append(new h(s,T._rendererCache)),s={points:[i],text:n,color:T._source.properties().textcolor.value(),horzAlign:e.x<i.x?"left":"right",vertAlign:"middle",font:T._source.properties().font.value(),offsetX:e.x>i.x?-5:5,offsetY:-5,bold:T._source.properties().bold.value(),italic:T._source.properties().italic.value(),fontsize:T._source.properties().fontsize.value()},t.append(new h(s,T._rendererCache)))},t.append(new l(S(e,i))),C(e,i,this._price1,this._price2),2===this._points.length?t:(t.append(new l(S(n,o))),C(o,n,this._price3,this._price3),this.isAnchorsRequired()&&(x=[e,i,o,n],this._model.lineBeingCreated()===this._source&&x.pop(),t.append(this.createLineAnchor({points:x}))),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&e&&i&&this._source.getAlertIsActive(function(o){t.append(new TradingView.PaneRendererClockIcon({point1:e,point2:i,color:o?s.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),t)))},inherit(n,r),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Flat Bottom"},n.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),r.prototype.addPoint.call(this,t)},n.prototype.setLastPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),r.prototype.setLastPoint.call(this,t)},n.prototype.setPoint=function(t,e,i){if(i&&i.shift&&1===t){this._snapPoint45Degree(e,this.points()[0])}t<3?r.prototype.setPoint.call(this,t,e):this._points[0].index=e.index},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var t,e,i,o,n,s,r,a,l,h=this._points[0],c=this._points[1],d=[];return h.index<=c.index?(d.push(h),d.push(c)):(d.push(c),d.push(h)),t=this._points[2],t.time=c.time,t.index=c.index,e={price:t.price,time:h.time,index:h.index},i=[],t.index<=e.index?(i.push(t),i.push(e)):(i.push(e),i.push(t)),d[0].price>i[0].price?(o=d,n=i):i[0].price>d[0].price?(o=i,n=d):i[1].price>d[1].price?(o=i,n=d):(o=d,n=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),h.index<=c.index?(s=a,r=l):(s=l,r=a),[this._linePointsToAlertPlot(o,"Upper",s,r),this._linePointsToAlertPlot(n,"Lower",a,r)]},t.exports=n},function(t,e,i){"use strict";function o(t,e){this._data=t,this._cache=e}function n(t,e){a.call(this,t,e),this._cache={},this._invalidated=!0}function s(t,e){this._constructor="LineToolIcon";var i=e||new p("linetoolicon");i.addExclusion("angle"),i.addExclusion("scale"),l.call(this,t,new n(this,t),i),this.version=s.version}var r=i(30),a=i(123),l=i(82).LineDataSource,h=i(152).TrendLineRenderer,c=i(113),d=i(117),p=i(91).DefaultProperty;o.prototype.draw=function(t){var e,i,o,n=String.fromCharCode(this._data.icon);t.font=this._data.size+"px FontAwesome",e=t.measureText(n).width,t.textBaseline="middle",i=this._data.point,t.translate(i.x,i.y),t.rotate(this._data.angle-Math.PI/2),t.scale(this._data.scale,1),o=65536*this._data.icon+this._data.size,this._cache[o]=e,this._data.selected&&(t.fillStyle="rgba(80, 80, 80, 0.2)",t.fillRect(-this._cache[o]/2,-this._data.size/2,this._cache[o],this._data.size)),t.fillStyle=this._data.color,t.fillText(n,-this._cache[o]/2,0)},o.prototype.hitTest=function(t){var e=65536*this._data.icon+this._data.size,i=this._cache[e]*this._data.scale,o=r.Matrix.rotate(-this._data.angle),n=t.substract(this._data.point);return n=o.mult(n),Math.abs(n.y)<=i/2&&Math.abs(n.x)<=this._data.size/2?new c(c.MOVEPOINT):null},inherit(n,a),n.anchorLimit=80,n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){a.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,s,a,c,p,u,_,f,m,g,v,y,b,w,S,T;return this._invalidated&&this.updateImpl(),t=new d,this._points.length<1?t:(e=this._source.properties(),i={point:this._points[0],color:e.color.value(),size:e.size.value(),icon:e.icon.value(),angle:e.angle.value(),scale:e.scale.value(),selected:this.isAnchorsRequired()},s=this._model,a=this._source,t.append(new o(i,this._cache)),this.isAnchorsRequired()&&(c=65536*i.icon+i.size,p=this._cache[c],u=i.size,_=this._points[0],f=e.scale.value(),m=new r.Point(Math.max(n.anchorLimit,u)/2,0),g=new r.Point(0,Math.max(n.anchorLimit,f*p)/2),v=r.Matrix.rotate(e.angle.value()),m=v.mult(m),g=v.mult(g),y=_.add(m),y.data=0,b=_.substract(m),b.data=1,w=_.add(g),w.data=2,w.square=!0,S=_.substract(g),S.data=3,S.square=!0,i={points:[y,b],width:s.timeScale().width(),height:a.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},T=new h(i),T._hittest=null,t.append(T),t.append(this.createLineAnchor({points:[y,b,w,S]}))),t)},s._getAvailIcons=function(){var t,e,i=[];for(i=i.concat([61536,61537,61538,61539]),i=i.concat([61725,61726]),i=i.concat([61575,61576,61796,61797]),i=i.concat([61779,61780,61781,61782,61783,61784,61785,61786]),t=i.slice(0),e=61440;e<=61846;e++)$.inArray(e,i)===-1&&(e%16==15&&61487!==e||e>=61620&&e<=61630||61718!==e&&61719!==e&&61472!==e&&61619!==e&&t.push(e));return t},s.availIcons=s._getAvailIcons(),inherit(s,l),s.version=1,s.prototype.pointsCount=function(){return 1},s.prototype.title=function(){return"Icon"},s.prototype.startChanging=function(t,e){var i,o;l.prototype.startChanging.call(this,t,e),i=this.properties(),o=65536*i.icon.value()+i.size.value(),this._startChangeWidth=this._paneViews[0]._cache[o],i.size.value()<n.anchorLimit?this._sizeScale=i.size.value()/n.anchorLimit:this._sizeScale=1,this._origScale=i.scale.value(),this._startChangeWidth*this._origScale<n.anchorLimit?this._resizeRatio=this._startChangeWidth/n.anchorLimit:this._resizeRatio=1},s.prototype.endChanging=function(){l.prototype.endChanging.call(this),delete this._startChangeWidth,delete this._sizeScale,delete this._resizeRatio},s.prototype.setPoint=function(t,e,i){var o,s,r,a,l,h,c,d,p,u,_=$.extend({},e),f=this.priceScale();f.isPercent()&&(o=this.ownerSource().firstValue(),_.price=f.priceRange().convertFromPercent(_.price,o)),i&&i.shift&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(_,this.points()[0]),s=this.pointToScreenPoint(this.points()[0])[1],r=this.pointToScreenPoint(_)[1],0===t||1===t?(a=r.substract(s).normalized(),l=2*r.substract(s).length(),l*=this._sizeScale,this._properties.size.setValue(l),h=-a.x,c=Math.acos(h),Math.asin(a.y)>0&&(c=2*Math.PI-c),0===t&&(c+=Math.PI),this._properties.angle.setValue(c)):(d=this._startChangeWidth,p=r.substract(s).length(),this._origScale*d<n.anchorLimit?(u=n.anchorLimit/2,this._properties.scale.setValue(this._origScale*p/u)):(u=d/2,this._properties.scale.setValue(p/u)))},t.exports=s},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._invalidated=!0}function n(t,e){this._constructor="LineToolRotatedRectangle";var i=e||new d("linetoolrotatedrectangle");r.call(this,t,new o(this,t),i)}var s=i(30),r=i(82).LineDataSource,a=i(123),l=i(152).TrendLineRenderer,h=i(181),c=i(117),d=i(91).DefaultProperty;inherit(o,a),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){a.prototype.update.call(this),this._distance=0,3===this._points.length&&(this._distance=s.distanceToLine(this._points[0],this._points[1],this._points[2]).distance)},o.prototype.renderer=function(){var t,e,i,o,n,a,d,p,u,_,f,m,g;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new c,e=this._source.properties(),i=this._points[0],o=this._points[1],2===this._points.length?(u={},u.points=this._points,u.floatPoints=this._floatPoints,u.width=this._model.timeScale().width(),u.height=this._source.priceScale().height(),u.color=e.color.value(),u.linewidth=1,u.linestyle=CanvasEx.LINESTYLE_SOLID,u.extendleft=!1,u.extendright=!1,u.leftend=r.LINEEND_NORMAL,u.rightend=r.LINEEND_NORMAL,t.append(new l(u))):3===this._points.length&&(_=o.substract(i),f=new s.Point(_.y,-_.x).normalized().scaled(this._distance),m=f.scaled(-1),n=i.add(f),a=o.add(f),d=i.add(m),p=o.add(m),u={},u.points=[n,a,p,d],u.color=e.color.value(),u.linewidth=this._source.properties().linewidth.value(),u.linestyle=CanvasEx.LINESTYLE_SOLID,u.filled=!0,u.backcolor=e.backgroundColor.value(),u.fillBackground=e.fillBackground.value(),u.transparency=e.transparency.value(),t.append(new h(u))),this.isAnchorsRequired()&&(g=[],g.push(i),this._points.length>=2&&g.push(o),3===this._points.length&&(n.data=2,d.data=2,a.data=2,p.data=2,g.push(n),g.push(d),g.push(a),g.push(p)),t.append(this.createLineAnchor({points:g}))),t},inherit(n,r),n.prototype.startChanging=function(t,e){var i,o,n,a;r.prototype.startChanging.call(this,t,e),0!==t&&1!==t||(i=this._paneViews[0],o=i._points[0],n=i._points[1],a=i._points[2],this._distance=s.distanceToLine(o,n,a).distance)},n.prototype.setPoint=function(t,e,i){var o,n,a,l,h,c,d;r.prototype.setPoint.call(this,t,e,i),0!==t&&1!==t||(o=this._paneViews[0],o.update(),n=o._points[0],a=o._points[1],l=a.substract(n),h=new s.Point(l.y,-l.x).normalized().scaled(this._distance),c=n.add(h),d=this.screenPointToPoint(c),this._points[2]=d)},n.prototype.endChanging=function(){delete this._distance},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Rotated Rectangle"},t.exports=n},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){a.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolFibSpiral";var i=e||new d("linetoolfibspiral");r.call(this,t,new n(this,t),i)}var r=i(82).LineDataSource,a=i(123),l=i(152).TrendLineRenderer,h=i(113),c=i(117),d=i(91).DefaultProperty;o.prototype._fibNumbers=function(){return[0,1,2,3,5,8,13,21,34,55,89]},o.prototype._continiusFib=function(t){var e,i,o=this._fibNumbers(),n=Math.floor(t),s=Math.ceil(t);return s>=o.length?null:(e=t-n,e=Math.pow(e,1.15),i=o[s]-o[n],o[n]+i*e)},o.prototype.hitTest=function(t){var e,i,o,n,s=this._data.points[0],r=this._data.points[1],a=r.substract(s),l=t.substract(s),c=a.normalized(),d=c.transponed(),p=l.normalized(),u=Math.acos(c.dotProduct(p)),_=Math.asin(d.dotProduct(p));for(_<0&&(u=2*Math.PI-u),e=l.length(),i=0;i<4;i++)if(o=u/(.5*Math.PI),n=this._continiusFib(o+4*i),null!==(n=n*a.length()/5)&&Math.abs(n-e)<5)return new h(h.MOVEPOINT);return null},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d,p;for(t.lineCap="round",t.strokeStyle=this._data.color,e=this._data.points[0],i=this._data.points[1],t.translate(e.x,e.y),o=i.substract(e),n=o.length(),o=o.normalized(),s=Math.acos(o.x),Math.asin(o.y)<0&&(s=2*Math.PI-s),t.rotate(s),t.scale(n/5,n/5),t.lineWidth=this._data.linewidth,CanvasEx.setLineStyle(t,this._data.linestyle),r=50,a=Math.PI/(2*r),t.moveTo(0,0),l=0;l<(this._fibNumbers().length-1)*r;l++)h=l*a,c=this._continiusFib(l/r),d=Math.cos(h)*c,p=Math.sin(h)*c,t.lineTo(d,p);t.scale(5/n,5/n),t.rotate(-s),t.stroke()},inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){a.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e;return this._invalidated&&this.updateImpl(),t=new c,this._floatPoints.length<2?t:(e={},e.points=this._floatPoints,e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.color=this._source.properties().linecolor.value(),e.linewidth=this._source.properties().linewidth.value(),e.linestyle=this._source.properties().linestyle.value(),e.extendleft=!1,e.extendright=!0,e.leftend=r.LINEEND_NORMAL,e.rightend=r.LINEEND_NORMAL,t.append(new l(e)),e={},e.points=this._floatPoints,e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.color=this._source.properties().linecolor.value(),e.linewidth=this._source.properties().linewidth.value(),e.linestyle=this._source.properties().linestyle.value(),t.append(new o(e)),this.isAnchorsRequired()&&this.addAnchors(t),t)},inherit(s,r),s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Fib Spiral"},t.exports=s},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolHeadAndShoulders";var i=e||new p("linetoolheadandshoulders");a.call(this,t,new o(this,t),i)}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(152).TrendLineRenderer,h=i(213).TriangleRenderer,c=i(124).TextRenderer,d=i(117),p=i(91).DefaultProperty,u=i(119);inherit(o,r),o.prototype.renderer=function(){var t,e,i,o,n,s,r,p,_,f,m,g,v,y,b;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points.length<2)return null;for(t=this._source.properties(),e=new d,i=this,o=function(e,o){return{points:[e],text:$.t(o),color:t.textcolor.value(),horzAlign:"center",font:t.font.value(),offsetX:0,offsetY:0,bold:t.bold&&t.bold.value(),italic:t.italic&&t.italic.value(),fontsize:t.fontsize.value(),backgroundColor:i._source.properties().color.value(),backgroundRoundRect:4}},n=function(e,o,n,s){return{points:[e,o],width:i._model.timeScale().width(),height:i._source.priceScale().height(),color:u.generateColor(i._source.properties().color.value(),n),linewidth:s||t.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL}},s=function(e,i,o){var n=[e,i,o],s={};return s.points=n,s.color=t.color.value(),s.linewidth=0,s.backcolor=t.backgroundColor.value(),s.fillBackground=t.fillBackground.value(),s.transparency=t.transparency.value(),s},r=1;r<this._points.length;r++)p=n(this._points[r-1],this._points[r],0),e.append(new l(p));return this._points.length>=5&&(m=!1,g=!1,this._intersect1?_=this._intersect1:(_=this._points[2],m=!0),this._intersect2?f=this._intersect2:(f=this._points[4],g=!0),p=n(_,f,0),p.extendleft=m,p.extendright=g,e.append(new l(p)),v=s(this._points[2],this._points[3],this._points[4]),e.append(new h(v))),this._intersect1&&(v=s(this._intersect1,this._points[1],this._points[2]),e.append(new h(v))),this._intersect2&&(v=s(this._points[4],this._points[5],this._intersect2),e.append(new h(v))),this._points.length>=2&&(y=this._points[1],b=o(y,"Left Shoulder"),this._points[1].y<this._points[0].y?(b.vertAlign="bottom",b.offsetY=-10):(b.vertAlign="top",b.offsetY=5),e.append(new c(b,this._rendererCache))),this._points.length>=4&&(y=this._points[3],b=o(y,"Head"),this._points[3].y<this._points[2].y?(b.vertAlign="bottom",b.offsetY=-10):(b.vertAlign="top",b.offsetY=5),e.append(new c(b,this._rendererCache))),this._points.length>=6&&(y=this._points[5],b=o(y,"Right Shoulder"),this._points[5].y<this._points[4].y?(b.vertAlign="bottom",b.offsetY=-10):(b.vertAlign="top",b.offsetY=5),e.append(new c(b,this._rendererCache))),this.addAnchors(e),e},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,a,l,h;r.prototype.update.call(this),delete this._intersect1,delete this._intersect2,this._points.length>=5&&(t=this._points[0],e=this._points[1],i=this._points[2],o=this._points[4],n=s.intersectSegments(i,o,t,e),null!==n&&(a=o.substract(i),this._intersect1=i.add(a.scaled(n))),7===this._points.length&&(l=this._points[5],h=this._points[6],null!==(n=s.intersectSegments(i,o,l,h))&&(a=o.substract(i),this._intersect2=i.add(a.scaled(n)))))},inherit(n,a),n.prototype.pointsCount=function(){return 7},n.prototype.title=function(){return"Head & Shoulders"},t.exports=n},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){l.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolTriangle";var i=e||new d("linetooltriangle");a.call(this,t,new n(this,t),i)}var r=i(30),a=i(82).LineDataSource,l=i(123),h=i(113),c=i(117),d=i(91).DefaultProperty,p=i(119);o.prototype.draw=function(t){var e,i,o;this._data.points.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.points[0],i=this._data.points[1],o=2===this._data.points.length?i:this._data.points[2],t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.lineTo(o.x,o.y),t.lineTo(e.x,e.y),this._data.fillBackground&&(t.fillStyle=p.generateColor(this._data.backcolor,this._data.transparency),t.fill()),t.stroke())},o.prototype.hitTest=function(t){var e,i,o,n,s;return this._data.points.length<2?null:(e=3,i=this._data.points[0],o=this._data.points[1],n=r.distanceToSegment(i,o,t),n.distance<=e?new h(h.MOVEPOINT):this._data.points.length<3?null:(s=this._data.points[2],n=r.distanceToSegment(o,s,t),n.distance<=e?new h(h.MOVEPOINT):(n=r.distanceToSegment(s,i,t),n.distance<=e?new h(h.MOVEPOINT):this._data.fillBackground&&r.pointInTriangle(i,o,s,t)?new h(h.MOVEPOINT_BACKGROUND):null)))},inherit(n,l),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){l.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e;return this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().color.value(),t.linewidth=this._source.properties().linewidth.value(),t.backcolor=this._source.properties().backgroundColor.value(),t.fillBackground=this._source.properties().fillBackground.value(),t.transparency=this._source.properties().transparency.value(),this.isAnchorsRequired()?(e=new c,e.append(new o(t)),this.addAnchors(e),e):new o(t)},inherit(s,a),s.prototype.pointsCount=function(){return 3},s.prototype.title=function(){return"Triangle"},e.TriangleRenderer=o,e.LineToolTriangle=s},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolTrianglePattern";var i=e||new u("linetooltrianglepattern");a.call(this,t,new o(this,t),i)}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(213).TriangleRenderer,h=i(152).TrendLineRenderer,c=i(124).TextRenderer,d=i(181),p=i(117),u=i(91).DefaultProperty;inherit(o,r),o.prototype.renderer=function(){var t,e,i,o,n,s,r,u,_;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points.length<2?null:(t=this._source.properties(),e=new p,i=this,o=function(e,o){return{points:[e],text:o,color:t.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:t.font.value(),offsetX:0,offsetY:0,bold:t.bold&&t.bold.value(),italic:t.italic&&t.italic.value(),fontsize:t.fontsize.value(),backgroundColor:i._source.properties().color.value(),backgroundRoundRect:4}},n=function(e,o){return{points:[e,o],width:i._model.timeScale().width(),height:i._source.priceScale().height(),color:i._source.properties().color.value(),linewidth:t.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL}},s=n(this._points[0],this._points[1]),e.append(new h(s)),this._points.length>=3&&(s=n(this._points[1],this._points[2]),e.append(new h(s))),4===this._points.length&&(s=n(this._points[2],this._points[3]),e.append(new h(s)),this._intersectPoint?(r=[this._startPoint1,this._startPoint2,this._intersectPoint],u={},u.points=r,u.color=t.color.value(),u.linewidth=t.linewidth.value(),u.backcolor=t.backgroundColor.value(),u.fillBackground=t.fillBackground.value(),u.transparency=t.transparency.value(),e.append(new l(u))):this._intersectPoint1&&this._intersectPoint2&&(r=[this._startPoint1,this._startPoint2,this._intersectPoint2,this._intersectPoint1],u={},u.filled=!0,u.fillBackground=!0,u.points=r,u.color=t.color.value(),u.linewidth=t.linewidth.value(),u.backcolor=t.backgroundColor.value(),u.transparency=t.transparency.value(),e.append(new d(u)))),_=o(this._points[0],"A"),this._points[1].y>this._points[0].y?(_.vertAlign="bottom",_.offsetY=-10):(_.vertAlign="top",_.offsetY=5),e.append(new c(_,this._rendererCache)),_=o(this._points[1],"B"),this._points[1].y<this._points[0].y?(_.vertAlign="bottom",_.offsetY=-10):(_.vertAlign="top",_.offsetY=5),e.append(new c(_,this._rendererCache)),this._points.length>2&&(_=o(this._points[2],"C"),this._points[2].y<this._points[1].y?(_.vertAlign="bottom",_.offsetY=-10):(_.vertAlign="top",_.offsetY=5),e.append(new c(_,this._rendererCache))),this._points.length>3&&(_=o(this._points[3],"D"),this._points[3].y<this._points[2].y?(_.vertAlign="bottom",_.offsetY=-10):(_.vertAlign="top",_.offsetY=5),e.append(new c(_,this._rendererCache))),this.addAnchors(e),e)},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,a,l,h,c,d,p,u;if(r.prototype.update.call(this),this._valid=!1,delete this._intersectPoint,delete this._intersectPoint1,delete this._intersectPoint2,4===this._points.length){if(t=this._points[0],e=this._points[1],i=this._points[2],o=this._points[3],Math.abs(i.x-t.x)<1||Math.abs(o.x-e.x)<1)return;if(n=Math.min(t.x,e.x),n=Math.min(n,i.x),n=Math.min(n,o.x),a=(i.y-t.y)/(i.x-t.x),l=t.y+(n-t.x)*a,h=(o.y-e.y)/(o.x-e.x),c=e.y+(n-e.x)*h,Math.abs(a-h)<1e-6)return;this._startPoint1=new s.Point(n,l),this._startPoint2=new s.Point(n,c),d=(e.y-t.y+(t.x*a-e.x*h))/(a-h),this._valid=!0,d<n&&(p=Math.max(t.x,e.x),p=Math.max(p,i.x),p=Math.max(p,o.x),l=t.y+(p-t.x)*a,c=e.y+(p-e.x)*h,this._startPoint1=new s.Point(p,l),this._startPoint2=new s.Point(p,c)),u=t.y+(d-t.x)*a,this._intersectPoint=new s.Point(d,u)}},inherit(n,a),n.prototype.pointsCount=function(){return 4},n.prototype.title=function(){return"Triangle Pattern"},t.exports=n},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._rendererCache={},this._numericFormatter=new m,this._invalidated=!0}function n(t,e){this._constructor="LineTool5PointsPattern";var i=e||new u("linetool5pointspattern");l.call(this,t,new o(this,t),i)}function s(t,e){this._constructor="LineToolCypherPattern";var i=e||new u("linetoolcypherpattern");l.call(this,t,new r(this,t),i)}function r(t,e){a.call(this,t,e),this._rendererCache={},this._numericFormatter=new m,this._invalidated=!0}var a=i(123),l=i(82).LineDataSource,h=i(152).TrendLineRenderer,c=i(213).TriangleRenderer,d=i(124).TextRenderer,p=i(117),u=i(91).DefaultProperty,_=i(94),f=_.DateTimeFormatter,m=_.NumericFormatter;inherit(o,a),o.prototype.renderer=function(){var t,e,i,o,n,s,r,a,u,_;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points.length<2?null:(t=this._source.properties(),e=new p,i=[this._points[0],this._points[1],this._points.length<3?this._points[1]:this._points[2]],o=this,n=function(e,i){return{points:[e],text:i,color:t.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:t.font.value(),offsetX:0,offsetY:0,bold:t.bold&&t.bold.value(),italic:t.italic&&t.italic.value(),fontsize:t.fontsize.value(),backgroundColor:o._source.properties().color.value(),backgroundRoundRect:4}},s=function(t,e){return{points:[t,e],width:o._model.timeScale().width(),height:o._source.priceScale().height(),color:o._source.properties().color.value(),linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL}},r={},r.points=i,r.color=t.color.value(),r.linewidth=t.linewidth.value(),r.backcolor=t.backgroundColor.value(),r.fillBackground=t.fillBackground.value(),r.transparency=t.transparency.value(),e.append(new c(r)),this._points.length>3&&(i=[this._points[2],this._points[3],5===this._points.length?this._points[4]:this._points[3]],r={},r.points=i,r.color=t.color.value(),r.linewidth=t.linewidth.value(),r.backcolor=t.backgroundColor.value(),r.fillBackground=t.fillBackground.value(),r.transparency=t.transparency.value(),e.append(new c(r))),this._points.length>=3&&(a=this._points[0].add(this._points[2]).scaled(.5),u=n(a,this._numericFormatter.format(this._ABRetracement)),e.append(new d(u,this._rendererCache))),this._points.length>=4&&(a=this._points[1].add(this._points[3]).scaled(.5),_=s(this._points[1],this._points[3]),e.append(new h(_)),u=n(a,this._numericFormatter.format(this._BCRetracement)),e.append(new d(u,this._rendererCache))),this._points.length>=5&&(a=this._points[2].add(this._points[4]).scaled(.5),u=n(a,this._numericFormatter.format(this._CDRetracement)),e.append(new d(u,this._rendererCache)),_=s(this._points[0],this._points[4]),e.append(new h(_)),a=this._points[0].add(this._points[4]).scaled(.5),u=n(a,this._numericFormatter.format(this._XDRetracement)),e.append(new d(u,this._rendererCache))),u=n(this._points[0],"X"),this._points[1].y>this._points[0].y?(u.vertAlign="bottom",u.offsetY=-10):(u.vertAlign="top",u.offsetY=5),e.append(new d(u,this._rendererCache)),u=n(this._points[1],"A"),this._points[1].y<this._points[0].y?(u.vertAlign="bottom",u.offsetY=-10):(u.vertAlign="top",u.offsetY=5),e.append(new d(u,this._rendererCache)),this._points.length>2&&(u=n(this._points[2],"B"),this._points[2].y<this._points[1].y?(u.vertAlign="bottom",u.offsetY=-10):(u.vertAlign="top",u.offsetY=5),e.append(new d(u,this._rendererCache))),this._points.length>3&&(u=n(this._points[3],"C"),this._points[3].y<this._points[2].y?(u.vertAlign="bottom",u.offsetY=-10):(u.vertAlign="top",u.offsetY=5),e.append(new d(u,this._rendererCache))),this._points.length>4&&(u=n(this._points[4],"D"),this._points[4].y<this._points[3].y?(u.vertAlign="bottom",u.offsetY=-10):(u.vertAlign="top",u.offsetY=5),e.append(new d(u,this._rendererCache))),this.addAnchors(e),e)},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n;a.prototype.update.call(this),this._source.points().length>=3&&(t=this._source.points()[0],e=this._source.points()[1],i=this._source.points()[2],this._ABRetracement=Math.round(1e3*Math.abs((i.price-e.price)/(e.price-t.price)))/1e3),this._source.points().length>=4&&(o=this._source.points()[3],this._BCRetracement=Math.round(1e3*Math.abs((o.price-i.price)/(i.price-e.price)))/1e3),this._source.points().length>=5&&(n=this._source.points()[4],this._CDRetracement=Math.round(1e3*Math.abs((n.price-o.price)/(o.price-i.price)))/1e3,this._XDRetracement=Math.round(1e3*Math.abs((n.price-e.price)/(e.price-t.price)))/1e3)},inherit(n,l),n.prototype.pointsCount=function(){return 5},n.prototype.title=function(){return"XABCD Pattern"},n.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null},time4:{title:"Date 5",value:null},price4:{title:"Price 5",value:null}},n.prototype._updateTooltip=function(){var t,e,i,o,n,s=this._tooltipFieldsHash,r=this.points().m_values;r[0]&&(e=this._model.timeScale().indexToUserTime(r[0].index),s.time0.value=e?new f(this._model.mainSeries().isDWM()).format(e):0,s.price0.value=this._model.mainSeries()._formatter.format(r[0].price)),r[1]&&(t=this._model.timeScale().indexToUserTime(r[1].index),s.time1.value=t?new f(this._model.mainSeries().isDWM()).format(t):0,s.price1.value=this._model.mainSeries()._formatter.format(r[1].price)),r[2]&&(i=this._model.timeScale().indexToUserTime(r[2].index),s.time2.value=i?new f(this._model.mainSeries().isDWM()).format(i):0,s.price2.value=this._model.mainSeries()._formatter.format(r[2].price)),r[3]&&(o=this._model.timeScale().indexToUserTime(r[3].index),s.time3.value=o?new f(this._model.mainSeries().isDWM()).format(o):0,s.price3.value=this._model.mainSeries()._formatter.format(r[3].price)),r[4]&&(n=this._model.timeScale().indexToUserTime(r[4].index),s.time4.value=t?new f(this._model.mainSeries().isDWM()).format(n):0,s.price4.value=this._model.mainSeries()._formatter.format(r[4].price))},n.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},inherit(s,n),inherit(r,o),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){var t,e,i,o,n;a.prototype.update.call(this),this._source.points().length>=3&&(t=this._source.points()[0],e=this._source.points()[1],i=this._source.points()[2],this._ABRetracement=Math.round(1e3*Math.abs((i.price-e.price)/(e.price-t.price)))/1e3),this._source.points().length>=4&&(o=this._source.points()[3],this._BCRetracement=Math.round(1e3*Math.abs((o.price-t.price)/(e.price-t.price)))/1e3),this._source.points().length>=5&&(n=this._source.points()[4],this._CDRetracement=Math.round(1e3*Math.abs((n.price-o.price)/(o.price-i.price)))/1e3,this._XDRetracement=Math.round(1e3*Math.abs((n.price-o.price)/(t.price-o.price)))/1e3)},e.LineTool5PointsPattern=n,e.LineToolCypherPattern=s},function(t,e,i){"use strict";function o(t,e){s.call(this,t,e),this._rendererCache={},this._numericFormatter=new d,this._invalidated=!0}function n(t,e){this._constructor="LineToolThreeDrivers";var i=e||new c("linetoolthreedrivers");r.call(this,t,new o(this,t),i)}var s=i(123),r=i(82).LineDataSource,a=i(152).TrendLineRenderer,l=i(124).TextRenderer,h=i(117),c=i(91).DefaultProperty,d=i(94).NumericFormatter,p=i(119);inherit(o,s),o.prototype.renderer=function(){var t,e,i,o,n,s,c,d,u;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points.length<2)return null;for(t=this._source.properties(),e=new h,i=this,o=function(e,o){return{points:[e],text:o,color:t.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:t.font.value(),offsetX:0,offsetY:0,bold:t.bold&&t.bold.value(),italic:t.italic&&t.italic.value(),fontsize:t.fontsize.value(),backgroundColor:i._source.properties().color.value(),backgroundRoundRect:4}},n=function(e,o,n,s){return{points:[e,o],width:i._model.timeScale().width(),height:i._source.priceScale().height(),color:p.generateColor(i._source.properties().color.value(),n),linewidth:s||t.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL}},s=1;s<this._points.length;s++)c=n(this._points[s-1],this._points[s],0),e.append(new a(c));return this._retrace1&&(c=n(this._points[1],this._points[3],70,1),e.append(new a(c)),d=this._points[1].add(this._points[3]).scaled(.5),u=o(d,this._numericFormatter.format(this._retrace1)),e.append(new l(u,this._rendererCache))),this._retrace2&&(c=n(this._points[3],this._points[5],70,1),e.append(new a(c)),d=this._points[5].add(this._points[3]).scaled(.5),u=o(d,this._numericFormatter.format(this._retrace2)),e.append(new l(u,this._rendererCache))),this.addAnchors(e),e},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n;s.prototype.update.call(this),delete this._retrace1,delete this._retrace2,this._source.points().length>=4&&(t=this._source.points()[1],e=this._source.points()[2],i=this._source.points()[3],this._retrace1=Math.round(100*Math.abs((i.price-e.price)/(e.price-t.price)))/100),this._source.points().length>=6&&(i=this._source.points()[3],o=this._source.points()[4],n=this._source.points()[5],this._retrace2=Math.round(100*Math.abs((n.price-o.price)/(o.price-i.price)))/100)},inherit(n,r),n.prototype.pointsCount=function(){return 7},n.prototype.title=function(){return"Three Drives Pattern"},t.exports=n},function(t,e,i){"use strict";function o(t,e){s.call(this,t,e),this._rendererCache={},this._numericFormatter=new u,this._invalidated=!0}function n(t,e){this._constructor="LineToolABCD";var i=e||new c("linetoolabcd");r.call(this,t,new o(this,t),i)}var s=i(123),r=i(82).LineDataSource,a=i(152).TrendLineRenderer,l=i(124).TextRenderer,h=i(117),c=i(91).DefaultProperty,d=i(94),p=d.DateTimeFormatter,u=d.NumericFormatter,_=i(119);inherit(o,s),o.prototype.renderer=function(){var t,e,i,o,n,s,c,d,p;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points.length<2?null:(t=this._source.properties(),e=new h,i=this._points,o=this,n=function(e,i){return{points:[e],text:i,color:t.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:t.font.value(),offsetX:0,offsetY:0,bold:t.bold&&t.bold.value(),italic:t.italic&&t.italic.value(),fontsize:t.fontsize.value(),backgroundColor:o._source.properties().color.value(),backgroundRoundRect:4}},s=function(e,i,n,s){return{points:[e,i],width:o._model.timeScale().width(),height:o._source.priceScale().height(),color:_.generateColor(o._source.properties().color.value(),n),linewidth:s||t.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL}},c=s(i[0],i[1],0),e.append(new a(c)),i.length>=3&&(c=s(i[1],i[2],0),e.append(new a(c))),4===i.length&&(c=s(i[2],i[3],0),e.append(new a(c))),d=n(this._points[0],"A"),this._points[1].y>this._points[0].y?(d.vertAlign="bottom",d.offsetY=-10):(d.vertAlign="top",d.offsetY=5),e.append(new l(d,this._rendererCache)),d=n(this._points[1],"B"),this._points[1].y<this._points[0].y?(d.vertAlign="bottom",d.offsetY=-10):(d.vertAlign="top",d.offsetY=5),e.append(new l(d,this._rendererCache)),this._points.length>2&&(d=n(this._points[2],"C"),this._points[2].y<this._points[1].y?(d.vertAlign="bottom",d.offsetY=-10):(d.vertAlign="top",d.offsetY=5),e.append(new l(d,this._rendererCache))),this._points.length>3&&(d=n(this._points[3],"D"),this._points[3].y<this._points[2].y?(d.vertAlign="bottom",d.offsetY=-10):(d.vertAlign="top",d.offsetY=5),e.append(new l(d,this._rendererCache))),this._points.length>=3&&(p=this._points[0].add(this._points[2]).scaled(.5),c=s(this._points[0],this._points[2],70,1),e.append(new a(c)),d=n(p,this._numericFormatter.format(this._ABRetracement)),e.append(new l(d,this._rendererCache))),this._points.length>=4&&(p=this._points[1].add(this._points[3]).scaled(.5),c=s(this._points[1],this._points[3],70,1),e.append(new a(c)),d=n(p,this._numericFormatter.format(this._CDRetracement)),e.append(new l(d,this._rendererCache))),this.addAnchors(e),e)},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o;s.prototype.update.call(this),this._source.points().length>=3&&(t=this._source.points()[0],e=this._source.points()[1],i=this._source.points()[2],this._ABRetracement=Math.round(1e3*Math.abs((i.price-e.price)/(e.price-t.price)))/1e3),4===this._source.points().length&&(o=this._source.points()[3],this._CDRetracement=Math.round(1e3*Math.abs((o.price-i.price)/(i.price-e.price)))/1e3)},inherit(n,r),n.prototype.pointsCount=function(){return 4},n.prototype.title=function(){return"ABCD Pattern"},n.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null}},n.prototype._updateTooltip=function(){var t,e,i,o,n=this._tooltipFieldsHash,s=this.points().m_values;s[0]&&(t=this._model.timeScale().indexToUserTime(s[0].index),n.time0.value=t?new p(this._model.mainSeries().isDWM()).format(t):0,n.price0.value=this._model.mainSeries()._formatter.format(s[0].price)),s[1]&&(e=this._model.timeScale().indexToUserTime(s[1].index),n.time1.value=e?new p(this._model.mainSeries().isDWM()).format(e):0,n.price1.value=this._model.mainSeries()._formatter.format(s[1].price)),s[2]&&(i=this._model.timeScale().indexToUserTime(s[2].index),n.time2.value=i?new p(this._model.mainSeries().isDWM()).format(i):0,n.price2.value=this._model.mainSeries()._formatter.format(s[2].price)),s[3]&&(o=this._model.timeScale().indexToUserTime(s[3].index),n.time3.value=o?new p(this._model.mainSeries().isDWM()).format(o):0,n.price3.value=this._model.mainSeries()._formatter.format(s[3].price))},n.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},t.exports=n},function(t,e,i){(function(t){"use strict";function o(t,e){h.call(this,t,e),this._rendererCache={},this._invalidated=!0,this._percentageFormatter=new w,this._numericFormatter=new S}function n(t,e,i,o){this._source=t,this._model=e,this._text="",this._invalidated=!0,this._coordinate=0,this._background="black",this._pricePropName=i,this._colorPropName=o}function s(e,i){var r,a,l,h,d,p,u,_,f,m,g=i||new y("linetoolriskreward");this._entryPriceAxisView=new n(this,e,"entryPrice","linecolor"),this._stopPriceAxisView=new n(this,e,"stopPrice","stopBackground"),this._profitPriceAxisView=new n(this,e,"targetPrice","profitBackground"),c.call(this,e,new o(this,e),g),this._properties.addExclusion&&(this._properties.addExclusion("stopLevel"),this._properties.addExclusion("profitLevel")),i.stopLevel||i.profitLevel||(r=e.timeScale().visibleBars(),a=r.firstBar(),l=r.lastBar(),h=e.mainSeries().priceRange(a,l),d=e.mainSeries().priceScale(),d.isLog()&&(p=d.logicalToPrice(h.minValue()),u=d.logicalToPrice(h.maxValue()),h=new t(p,u)),d.isPercent()&&(_=e.mainSeries().firstValue(),p=d.priceRange().convertFromPercent(h.minValue(),_),u=d.priceRange().convertFromPercent(h.maxValue(),_),h=new t(p,u)),h&&!h.isEmpty()&&(f=Math.round(.2*h.length()*e.mainSeries().base()),g.merge({stopLevel:f,profitLevel:f}))),m=this,g.stopLevel.listeners().subscribe(this,s.prototype.recalculate),g.stopLevel.listeners().subscribe(null,function(){m.properties().stopPrice._listeners.fire(m.properties().stopPrice)}),g.profitLevel.listeners().subscribe(this,s.prototype.recalculate),g.profitLevel.listeners().subscribe(null,function(){m.properties().targetPrice._listeners.fire(m.properties().targetPrice)}),g.addProperty("entryPrice"),g.entryPrice=new s.PriceProperty(this,0),g.addProperty("stopPrice"),g.stopPrice=new s.StopPriceProperty(this),g.addProperty("targetPrice"),g.targetPrice=new s.TargetPriceProperty(this),this.version=s.version}function r(t,e){this._constructor="LineToolRiskRewardShort";var i=e||new y("linetoolriskrewardshort");s.call(this,t,i)}function a(t,e){this._constructor="LineToolRiskRewardLong";var i=e||new y("linetoolriskrewardlong");s.call(this,t,i)}var l=i(30),h=i(123),c=i(82).LineDataSource,d=i(152).TrendLineRenderer,p=i(84),u=i(86),_=i(124).TextRenderer,f=i(150).RectangleRenderer,m=i(92),g=i(113),v=i(117),y=i(91).DefaultProperty,b=i(94),w=b.PercentageFormatter,S=b.NumericFormatter,T=i(119);inherit(o,h),o.prototype.i18nCache={pnl:$.t("{0} P&L: {1}"),open:$.t("Open",{context:"line_tool_position"}),closed:$.t("Closed",{context:"line_tool_position"}),ratio:$.t("Risk/Reward Ratio: {0}"),stop:$.t("Stop: {0} ({1})"),target:$.t("Target: {0} ({1})")},o.prototype._formatInTicks=function(t){var e=this._model.mainSeries().base();return Math.round(t*e)},o.INDEX_ENTRY=0,o.INDEX_CLOSE=1,o.INDEX_ACTUALENTRY=2,o.INDEX_ACTUALCLOSE=3,o.prototype.isLabelVisible=function(){return this.isHoveredSource()||this.isSelectedSource()},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,n,s,r,a,l,c;if(h.prototype.update.call(this),this._stopLevel=null,this._profitLevel=null,t=this._model.timeScale(),(e=this._source.priceScale())&&!e.isEmpty()&&!t.isEmpty()&&0!==this._source.points().length&&0!==this._points.length&&this._model.mainSeries().bars().last()&&!(this._source.points().length<2)&&0!==this._model.mainSeries().bars().length){if(this._isClosed=4===this._source.points().length,this._isClosed){if(i=this._source.points()[o.INDEX_ACTUALCLOSE].price,this._source.points()[o.INDEX_ACTUALCLOSE].index<parseInt(this._source._model.mainSeries().bars().first()))return;n=Math.min(parseInt(this._source._model.mainSeries().bars().last()),this._source.points()[o.INDEX_ACTUALCLOSE].index),this._closeBar=this._source._model.timeScale().indexToCoordinate(n)}else{if(this._source.points()[o.INDEX_CLOSE].index<parseInt(this._source._model.mainSeries().bars().first()))return;n=Math.min(parseInt(this._source._model.mainSeries().bars().last()),this._source.points()[o.INDEX_CLOSE].index),s=this._model.mainSeries().bars().valueAt(n),i=s[TradingView.CLOSE_PLOT],this._closeBar=this._source._model.timeScale().indexToCoordinate(n)}r=this._source.priceScale(),a=this._source.stopPrice(),l=this._source.profitPrice(),this._pl=this._source.points().length>1?this._source.calculatePL(i):0,r.isPercent()&&(c=this._source.ownerSource().firstValue(),a=r.priceRange().convertToPercent(a,c),l=r.priceRange().convertToPercent(l,c),i=r.priceRange().convertToPercent(i,c)),this._entryLevel=this._points[o.INDEX_ENTRY].y,this._stopLevel=e.priceToCoordinate(a),this._profitLevel=e.priceToCoordinate(l),this._closeLevel=e.priceToCoordinate(i),this._closeBar=this._source._model.timeScale().indexToCoordinate(n)}},o.prototype.renderer=function(){var t,e,i,n,s,r,a,h,p,u,m,y,b,w,S,C,x,P,L,k,I,E,A,V,M,$,D,O,B,R,N,F,W;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new v,this._points.length<2||this._source.points().length<2?t:(e=this,i=this._source.properties(),n=this._points[o.INDEX_ENTRY].x,s=this._points[o.INDEX_ACTUALENTRY]?this._points[o.INDEX_ACTUALENTRY].x:this._points[o.INDEX_CLOSE].x,r=this._points[o.INDEX_ACTUALCLOSE]?this._points[o.INDEX_ACTUALCLOSE].x:this._points[o.INDEX_CLOSE].x,a=this._points[o.INDEX_CLOSE].x,h=new l.Point(n,this._entryLevel),p=new l.Point(a,this._stopLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.stopBackground.value(),u.fillBackground=!0,u.transparency=i.stopBackgroundTransparency.value(),t.append(new f(u,new g(g.MOVEPOINT),new g(g.MOVEPOINT))),this._pl<0&&(h=new l.Point(s,this._entryLevel),p=new l.Point(r,this._closeLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.stopBackground.value(),u.fillBackground=!0,m=.01*i.stopBackgroundTransparency.value(),y=100*(1-m*m*m),b=100-y,u.transparency=b,t.append(new f(u,new g(g.MOVEPOINT),new g(g.MOVEPOINT)))),h=new l.Point(n,this._entryLevel),p=new l.Point(a,this._profitLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.profitBackground.value(),u.fillBackground=!0,u.transparency=i.profitBackgroundTransparency.value(),t.append(new f(u,new g(g.MOVEPOINT),new g(g.MOVEPOINT))),this._pl>0&&(h=new l.Point(s,this._entryLevel),p=new l.Point(r,this._closeLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.profitBackground.value(),u.fillBackground=!0,m=.01*i.profitBackgroundTransparency.value(),w=100*(1-m*m*m),S=100-w,u.transparency=S,t.append(new f(u,new g(g.MOVEPOINT),new g(g.MOVEPOINT)))),C=function(i,o,n){var s={};s.points=[i,o],s.width=e._model.timeScale().width(),s.height=e._source.priceScale().height(),s.color=n||e._source.properties().linecolor.value(),s.linewidth=e._source.properties().linewidth.value(),s.linestyle=CanvasEx.LINESTYLE_SOLID,s.extendleft=!1,s.extendright=!1,s.leftend=c.LINEEND_NORMAL,s.rightend=c.LINEEND_NORMAL,t.append(new d(s))},this._points[o.INDEX_ACTUALENTRY]&&(h=this._points[o.INDEX_ACTUALENTRY],p=this._isClosed?this._points[o.INDEX_ACTUALCLOSE]:new l.Point(this._closeBar,this._closeLevel),u={},u.points=[h,p],u.width=e._model.timeScale().width(),u.height=e._source.priceScale().height(),u.color=e._source.properties().linecolor.value(),u.linewidth=1,u.linestyle=CanvasEx.LINESTYLE_DASHED,u.extendleft=!1,u.extendright=!1,u.leftend=c.LINEEND_NORMAL,u.rightend=c.LINEEND_ARROW,t.append(new d(u))),e=this,x=function(o,n,s,r,a,l){if(e.isLabelVisible()||TradingView.printing){var h={};h.points=[o],h.text=n,h.color=i.textcolor.value(),h.font=i.font.value(),h.offsetX=3,h.offsetY=a,h.vertAlign=r,h.horzAlign="center",h.backgroundRoundRect=4,h.backgroundColor=T.resetTransparency(s),h.fontsize=i.fontsize.value(),h.backgroundHorzInflate=4,h.backgroundVertInflate=2,l&&(h.borderColor=l),t.append(new _(h,e._rendererCache))}},P=this._source.entryPrice(),L=this._source.stopPrice(),k=this._source.profitPrice(),I=Math.abs(L-P),E=Math.round(1e4*I/P)/100,A=Math.abs(k-P),V=Math.round(1e4*A/P)/100,M=Math.abs(P-k)/Math.abs(P-L),h=new l.Point(n,this._points[o.INDEX_ENTRY].y),p=new l.Point(a,this._points[o.INDEX_ENTRY].y),C(h,p),$=new l.Point((n+a)/2,Math.round(this._points[0].y)+.5),D="",this._points[1]&&void 0!==this._pl&&(O=this._isClosed?this.i18nCache.closed:this.i18nCache.open,D=this.i18nCache.pnl.format(O,this._source.priceScale().formatter().format(this._pl))+"\n"),D+=this.i18nCache.ratio.format(this._numericFormatter.format(Math.round(100*M)/100))+" ",B=i.linecolor.value(),this._pl<0?B=i.stopBackground.value():this._pl>0&&(B=i.profitBackground.value()),x($,D,B,"middle",0,"white"),h=new l.Point(n,this._stopLevel),p=new l.Point(a,this._stopLevel),C(h,p,i.stopBackground.value()),$=new l.Point((n+a)/2,this._stopLevel),D=this.i18nCache.stop.format(this._source.priceScale().formatter().format(I),this._percentageFormatter.format(E)),x($,D,i.stopBackground.value(),P<L?"bottom":"top",P<L?-12:-1),h=new l.Point(n,this._profitLevel),p=new l.Point(a,this._profitLevel),C(h,p,i.profitBackground.value()),$=new l.Point((n+a)/2,this._profitLevel),D=this.i18nCache.target.format(this._source.priceScale().formatter().format(A),this._percentageFormatter.format(V)),x($,D,i.profitBackground.value(),P<L?"top":"bottom",P<L?-1:-12),this.isAnchorsRequired()&&(R=this._points[0].clone(),R.data=0,N=new l.Point(n,this._stopLevel),N.data=1,F=new l.Point(n,this._profitLevel),F.data=2,W=new l.Point(a,R.y),W.data=3,t.append(this.createLineAnchor({points:[R,N,F,W]}))),t)},inherit(n,p),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){if(0!==this._source.points().length&&this._source.priceScale()&&!this._source.priceScale().isEmpty()){var t=this._source.properties()[this._pricePropName].value();this._background=this._source.properties()[this._colorPropName].value(),this._coordinate=this._source.priceScale().priceToCoordinate(t),this._text=this._source.priceScale()?this._source.priceScale().formatter().format(t):""}},n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),new u({text:this._text,coordinate:this._coordinate,color:this.color(),background:T.resetTransparency(this._background),visible:!0})},inherit(s,c),s.version=2,s.prototype.i18nCache={title:$.t("Risk/Reward")},s.prototype.migrateVersion=function(t,e,i){var o,n,s,r;1===t&&this._points.length>=1&&(o=[],o.push(this._points[0]),n=this._points[0],n={price:n.price,index:n.index+50},o.push(n),this._points[1]&&o.push(this._points[1]),this._points[2]&&o.push(this._points[2]),this._points=o,this._timePoint.length>=1&&(s=[],n=this._timePoint[0],s.push(n),r={price:n.price,time_t:n.time_t,offset:n.offset+50},s.push(r),this._timePoint[1]&&o.push(this._points[1]),this._timePoint[2]&&o.push(this._points[2]),this._timePoint=s))},s.prototype.checkAlert=function(){this.recalculate()},s.prototype.priceAxisViews=function(t,e){return this._isActualSymbol?e!==this.priceScale()||this._model.paneForSource(this)!==t?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]:null},s.prototype.updateAllViews=function(){this._isActualSymbol&&this._properties.visible.value()&&(m.hideAllDrawings().value()&&this.userEditEnabled()||(c.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update()))},s.prototype.setPoint=function(t,e){var i,o=this.priceScale();switch(o.isPercent()&&(i=this.ownerSource().firstValue(),e.price=o.priceRange().convertFromPercent(e.price,i)),t){case 0:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),c.prototype.setPoint.call(this,t,e),this.recalculate();break;case 1:this.properties().stopPrice.setValue(this.preparseStopPrice(e.price));break;case 2:this.properties().targetPrice.setValue(this.preparseProfitPrice(e.price));break;case 3:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),c.prototype.setPoint.call(this,1,e),this.recalculate()}},s.PriceProperty=function(t,e){c.PointPriceProperty.call(this,t,e)},inherit(s.PriceProperty,c.PointPriceProperty),s.PriceProperty.prototype.setValue=function(t){var e=this._lineSource.points()[this._pointIndex];e.price=parseFloat(t),this._lineSource.setPoint(this._pointIndex,e),this._lineSource.recalculate(),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging()},s.StopPriceProperty=function(t){s.PriceProperty.call(this,t,1)},inherit(s.StopPriceProperty,s.PriceProperty),s.StopPriceProperty.prototype.value=function(){var t=this._lineSource.stopPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},s.StopPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().stopLevel.setValue(e),this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)},s.TargetPriceProperty=function(t){s.PriceProperty.call(this,t,2)},inherit(s.TargetPriceProperty,s.PriceProperty),s.TargetPriceProperty.prototype.value=function(){var t=this._lineSource.profitPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},s.TargetPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().profitLevel.setValue(e),this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel)},s.prototype.pointsCount=function(){return 1},s.prototype.title=function(){return this.i18nCache.title},s.prototype.addPoint=function(t){var e,i,o,n=$.extend({},t),s=this.priceScale();return s.isPercent()&&(e=this.ownerSource().firstValue(),n.price=s.priceRange().convertFromPercent(n.price,e)),n.price=this._roundPrice(n.price),this._points.push(n),i={price:n.price,index:n.index+50},this._points.push(i),o=this.calculateActualEntry(n,i),o&&(this._points.push(o),(i=this.findClosePoint(o,i))&&this._points.push(i)),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},s.prototype._roundPrice=function(t){var e=this._model.mainSeries().base();return Math.round(t*e)/e},s.prototype.recalculate=function(){var t,e,i,o,n;this.properties().interval.value()===this._model.mainSeries().interval()&&0!==this.points().length&&(t=this.properties().targetPrice.value(),e=this.properties().stopPrice.value(),i=[this._points[0],this._points[1]],o=this.calculateActualEntry(this.points()[0],this.points()[1]),o&&(i.push(o),(n=this.findClosePoint(o,this.points()[1]))&&i.push(n)),this._points=i,t!==this.properties().targetPrice.value()&&this.properties().targetPrice._listeners.fire(this.properties().targetPrice),e!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice))},s.prototype.startMoving=function(t){t.price=this._roundPrice(t.price),c.prototype.startMoving.call(this,t)},s.prototype.move=function(t){t.price=this._roundPrice(t.price),c.prototype.move.call(this,t),this.recalculate(),this._entryPriceAxisView.update()},s.prototype.correctPoints=function(t){c.prototype.correctPoints.call(this,[t[0],t[1]])},s.prototype.entryPrice=function(){return this.points()[0].price},s.prototype.findClosePoint=function(t,e){var i,o,n,s=this._model.mainSeries().bars(),r=parseInt(s.first(),10),a=Math.max(t.index,r),l=parseInt(s.last(),10);for(i=a;i<=Math.min(l,e.index);i++)if(o=s.valueAt(i),null!=(n=this.checkStopPrice(o)))return{index:i,price:n};return null},s.prototype.calculateActualEntry=function(t,e){var i,o,n=this._model.mainSeries().bars(),s=parseInt(n.first(),10),r=Math.max(t.index,s),a=t.price,l=parseInt(n.last(),10);for(i=r;i<=Math.min(l,e.index);i++)if(o=n.valueAt(i),o[TradingView.HIGH_PLOT]>=a&&o[TradingView.LOW_PLOT]<=a)return{index:i,price:a};return null},inherit(r,s),r.prototype.i18nCache={title:$.t("Risk/Reward short")},r.prototype.title=function(){return this.i18nCache.title},r.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this._model.mainSeries().base()},r.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this._model.mainSeries().base()},r.prototype.calculatePL=function(t){return this.entryPrice()-t},r.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},r.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},r.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.HIGH_PLOT]>=e?this.stopPrice():t[TradingView.LOW_PLOT]<=i?this.profitPrice():null},a.prototype.i18nCache={title:$.t("Risk/Reward long")},inherit(a,s),a.prototype.stopPrice=function(){return this.entryPrice()-this.properties().stopLevel.value()/this._model.mainSeries().base()},a.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this._model.mainSeries().base()},a.prototype.calculatePL=function(t){return t-this.entryPrice()},a.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},a.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},a.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.LOW_PLOT]<=e?this.stopPrice():t[TradingView.HIGH_PLOT]>=i?this.profitPrice():null},a.prototype.title=function(){return this.i18nCache.title},e.LineToolRiskReward=s,e.LineToolRiskRewardLong=a,e.LineToolRiskRewardShort=r}).call(e,i(103))},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._invalidated=!0}function n(t,e){this._constructor="LineToolPolyline";var i;e?i=e:(i=new c("linetoolpolyline"),i.filled.setValue(!1)),a.call(this,t,new o(this,t),i),i.addExclusion("filled")}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(181),h=i(117),c=i(91).DefaultProperty;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){r.prototype.update.call(this),this._invalidated=!1},o.prototype.renderer=function(){var t,e;return this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().linecolor.value(),t.linewidth=this._source.properties().linewidth.value(),t.linestyle=this._source.properties().linestyle.value(),t.filled=this._source.properties().filled.value(),t.backcolor=this._source.properties().backgroundColor.value(),t.fillBackground=this._source.properties().fillBackground.value(),t.transparency=this._source.properties().transparency.value(),this.isAnchorsRequired()?(e=new h,e.append(new l(t)),this.addAnchors(e),e):new l(t)},inherit(n,a),n.prototype.pointsCount=function(){return-1},n.prototype.title=function(){return"Polyline"},n.prototype.addPoint=function(t){var e,i,o,n,r,l,h,c,d,p,u=this._model.timeScale().indexToCoordinate(t.index),_=t.price,f=null;if(this.priceScale().isPercent()&&(f=this.ownerSource().firstValue()),e=this.priceScale().priceToCoordinate(_),i=5,this._points.length>0){if(o=this._points[this._points.length-1],n=this._model.timeScale().indexToCoordinate(o.index),r=o.price,this.priceScale().isPercent()&&(r=this.priceScale().priceRange().convertToPercent(r,f)),l=this.priceScale().priceToCoordinate(r),new s.Point(u,e).substract(new s.Point(n,l)).length()<i)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;if(h=this._points[0],c=this._model.timeScale().indexToCoordinate(h.index),d=h.price,this.priceScale().isPercent()&&(d=this.priceScale().priceRange().convertToPercent(d,f)),p=this.priceScale().priceToCoordinate(d),new s.Point(u,e).substract(new s.Point(c,p)).length()<i)return this._properties.filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return a.prototype.addPoint.call(this,t)},n.prototype.setPoint=function(t,e){var i,o,n,r,l,h;a.prototype.setPoint.call(this,t,e),this._model.timeScale().isEmpty()||this.priceScale().isEmpty()||t!==this._points.length-1&&0!==t||(i=5,o=this._model.timeScale().indexToCoordinate(e.index),n=this.priceScale().priceToCoordinate(e.price),r=t===this._points.length-1?this._points[0]:this._points[this._points.length-1],l=this._model.timeScale().indexToCoordinate(r.index),h=this.priceScale().priceToCoordinate(r.price),new s.Point(o,n).substract(new s.Point(l,h)).length()<i&&this._properties.filled.setValue(!0))},t.exports=n},function(t,e,i){"use strict";function o(t){this._data=t,this._targetFontSize1=11,this._targetFontSize2=11,this._targetFontSize3=14,this._font="Arial",this._sourceFontSize1=12,this._sourceFontSize2=10}function n(t,e){r.call(this,t,e),this._clockWhite=d("prediction-clock-white",TradingView.wrapUrl("images/prediction-clock-white.png")),this._clockBlack=d("prediction-clock-black",TradingView.wrapUrl("images/prediction-clock-black.png")),this._successIcon=d("prediction-success-white",TradingView.wrapUrl("images/prediction-success-white.png")),this._failureIcon=d("prediction-failure-white",TradingView.wrapUrl("images/prediction-failure-white.png")),this._percentageFormatter=new m,this._invalidated=!0}function s(t,e){this._constructor="LineToolPrediction";var i=e||new _("linetoolprediction");i.merge({status:s.ALERT_STATUS_WAITING}),a.call(this,t,new n(this,t),i)}var r=i(123),a=i(82).LineDataSource,l=i(93),h=i(113),c=i(117),d=i(221),p=i(30),u=i(85).RGBColor,_=i(91).DefaultProperty,f=i(94),m=f.PercentageFormatter,g=f.DateFormatter,v=f.TimeFormatter,y=f.TimeSpanFormatter,b=i(119);o.prototype.drawBalloon=function(t,e,i,o,n,s){var r,a,l=6,h=5,c=5,d=s||20,u=3;return t.beginPath(),"down"===n?(r=new p.Point(e.x-d,e.y-l-c-o),t.moveTo(r.x+u,r.y),t.lineTo(r.x+i-u,r.y),t.arcTo(r.x+i,r.y,r.x+i,r.y+u,u),t.lineTo(r.x+i,r.y+o-u),t.arcTo(r.x+i,r.y+o,r.x+i-u,r.y+o,u),t.lineTo(r.x+d+h,r.y+o),t.lineTo(r.x+d,r.y+o+c),t.lineTo(r.x+d-h,r.y+o),t.lineTo(r.x+u,r.y+o),t.arcTo(r.x,r.y+o,r.x,r.y+o-u,u),t.lineTo(r.x,r.y+u),t.arcTo(r.x,r.y,r.x+u,r.y,u),r):(a=new p.Point(e.x-d,e.y+l+c+o),t.moveTo(a.x+u,a.y),t.lineTo(a.x+i-u,a.y),t.arcTo(a.x+i,a.y,a.x+i,a.y-u,u),t.lineTo(a.x+i,a.y-o+u),t.arcTo(a.x+i,a.y-o,a.x+i-u,a.y-o,u),t.lineTo(a.x+d+h,a.y-o),t.lineTo(a.x+d,a.y-o-c),t.lineTo(a.x+d-h,a.y-o),t.lineTo(a.x+u,a.y-o),t.arcTo(a.x,a.y-o,a.x,a.y-o+u,u),t.lineTo(a.x,a.y-u),t.arcTo(a.x,a.y,a.x+u,a.y,u),new p.Point(a.x,a.y-o))},o.prototype.drawTargetLabel=function(t){var e,i,o,n,r,a,l,h,c,d,p,u,_,f,m,g,v,y,w,S,T,C,x=this._data.points[1];if(t.save(),t.translate(.5,.5),t.font="normal "+this._targetFontSize3+"px "+this._font,e=1.5*this._targetFontSize1+1.5*this._targetFontSize2+3,i=t.measureText(this._data.targetLine1).width,o=t.measureText(this._data.targetLine2).width,t.font="normal "+this._targetFontSize2+"px "+this._font,n=t.measureText(this._data.targetLine3).width,r=t.measureText(this._data.targetLine4).width,a=Math.max(i+o,n+r+10)+20,l="up"===this._data.direction?"down":"up",h=x.x+a-t.canvas.width+5,h=Math.max(20,Math.min(a-15,h)),c=this.drawBalloon(t,x,a,e,l,h),t.save(),t.fillStyle=b.generateColor(this._data.targetBackColor,this._data.transparency),t.fill(),t.restore(),t.save(),t.lineWidth=2,t.strokeStyle=b.generateColor(this._data.targetStrokeColor,this._data.transparency),t.stroke(),t.restore(),d=3,t.beginPath(),t.arc(x.x,x.y,d,0,2*Math.PI,!1),t.fillStyle=this._data.centersColor,t.fill(),t.textAlign="left",p=6,u=4,t.fillStyle=this._data.targetTextColor,t.font="normal "+this._targetFontSize3+"px "+this._font,t.fillText(this._data.targetLine1,c.x+p,c.y+this._targetFontSize1+u),_=13,f=5,t.fillText(this._data.targetLine2,c.x+p+i+f,c.y+this._targetFontSize1+u),t.font="normal "+this._targetFontSize2+"px "+this._font,m=c.y+this._targetFontSize1+2*u+this._targetFontSize2,t.fillText(this._data.targetLine3,c.x+p,m),t.drawImage(this._data.clockWhite,c.x+p+n+6,m-this._targetFontSize2+3),t.fillText(this._data.targetLine4,c.x+p+n+_+5,m),!this._data.status)return void t.restore();switch(g=this._targetFontSize1+4,t.font="bold "+this._targetFontSize1+"px "+this._font,this._data.status){case s.ALERT_STATUS_SUCCESS:v=$.t("SUCCESS"),y=b.generateColor(this._data.successBackground,this._data.transparency),w=this._data.successTextColor,S=this._data.successIcon;break;case s.ALERT_STATUS_FAILURE:v=$.t("FAILURE"),y=b.generateColor(this._data.failureBackground,this._data.transparency),w=this._data.failureTextColor,S=this._data.failureIcon}T=t.measureText(v).width,C=Math.round((a-T)/2),t.fillStyle=y,"up"===this._data.direction?(t.roundRect(c.x-1,c.y-g-2,a+2,g,5),t.fill(),t.fillStyle=w,t.fillText(v,c.x+C,c.y-5),t.drawImage(S,c.x+C-13,c.y-14)):(t.roundRect(c.x-1,c.y+e+3,a+2,g,5),t.fill(),t.fillStyle=w,t.fillText(v,c.x+C,c.y+e+g-1),t.drawImage(S,c.x+C-13,c.y+e+5)),t.restore()},o.prototype.drawStartLabel=function(t){var e,i,o,n,s,r,a,l,h;t.save(),t.translate(.5,.5),t.font="normal "+this._sourceFontSize1+"px "+this._font,e=1.5*this._sourceFontSize1+1.5*this._sourceFontSize2,i=t.measureText(this._data.sourceLine1).width,t.font="normal "+this._fontsize2+"px "+this._font,o=t.measureText(this._data.sourceLine2).width,n=Math.max(i,o)-5,s=this._data.points[0],r=this.drawBalloon(t,s,n,e,this._data.direction),t.fillStyle=b.generateColor(this._data.sourceBackColor,this._data.transparency),t.fill(),t.lineWidth=2,t.strokeStyle=b.generateColor(this._data.sourceStrokeColor,this._data.transparency),t.stroke(),a=3,t.beginPath(),t.arc(s.x,s.y,a,0,2*Math.PI,!1),t.fillStyle=this._data.centersColor,t.fill(),t.textAlign="left",l=3,h=2,t.fillStyle=this._data.sourceTextColor,t.font="normal "+this._sourceFontSize1+"px "+this._font,t.fillText(this._data.sourceLine1,r.x+l,r.y+this._sourceFontSize1+h),t.font="normal "+this._sourceFontSize2+"px "+this._font,t.fillText(this._data.sourceLine2,r.x+l,r.y+this._sourceFontSize1+2*h+this._sourceFontSize2),t.restore()},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,u,_;if(!(this._data.points.length<2)){if(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.points[0],i=this._data.points[1],o=i.substract(e),Math.abs(o.x)<1||Math.abs(o.y)<1?(t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.stroke()):(t.save(),t.beginPath(),t.translate(e.x,e.y),t.scale(1,o.y/o.x),t.moveTo(0,0),t.arcTo(o.x,0,o.x,o.x,Math.abs(o.x)),t.lineTo(o.x,o.x),t.restore(),t.stroke()),this.drawTargetLabel(t),this.drawStartLabel(t),n=Math.max(8,4*this._data.linewidth),t.fillStyle=this._data.color,s=o.y<0?1:-1,Math.abs(o.x)<1||Math.abs(o.y)<1)r=Math.atan(o.x/o.y);else{if(a=Math.abs(o.x),l=Math.abs(o.y),h=0,c=Math.PI/2,d=(h+c)/2,o.length()>n)for(;;){if(p=a*Math.sin(d),u=l*(1-Math.cos(d)),_=Math.sqrt((p-a)*(p-a)+(u-l)*(u-l)),Math.abs(_-n)<1)break;_>n?h=d:c=d,d=(h+c)/2}r=Math.atan((a-p)/(l-u)),o.x*o.y<0&&(r=-r)}t.save(),t.beginPath(),t.translate(i.x,i.y),t.rotate(-r),t.moveTo(0,0),t.lineTo(-n/2,s*n),t.lineTo(n/2,s*n),t.lineTo(0,0),t.restore(),t.fill()}},o.prototype.targetLabelHitTest=function(t){var e,i,o,n,s,r,a,l,c,d=this._data.points[1],p=1.5*this._targetFontSize1+1.5*this._targetFontSize2,u=this._targetFontSize1*this._data.targetLine1.length,_=this._targetFontSize1*this._data.targetLine2.length,f=this._targetFontSize2*this._data.targetLine3.length,m=this._targetFontSize2*this._data.targetLine4.length;return this._data.status&&(p+=1.5*this._targetFontSize1),e=Math.max(u+_,f+m)-20,i=20,o=5,n="up"===this._data.direction?-1:1,s=d.x-i,r=d.y+o*n,a=d.y+(o+p)*n,l=Math.min(r,a),c=Math.max(r,a),t.x>=s&&t.x<=s+e&&t.y>=l&&t.y<=c?new h(h.MOVEPOINT):null},o.prototype.sourceLabelHitTest=function(t){var e=1.5*this._sourceFontSize1+1.5*this._sourceFontSize2,i=this._sourceFontSize1*this._data.sourceLine1.length,o=this._sourceFontSize2*this._data.sourceLine2.length,n=Math.max(i,o),s=this._data.points[0],r=20,a=5,l="up"===this._data.direction?1:-1,c=s.x-r,d=s.y+a*l,p=s.y+(a+e)*l,u=Math.min(d,p),_=Math.max(d,p);return t.x>=c&&t.x<=c+n&&t.y>=u&&t.y<=_?new h(h.MOVEPOINT):null},o.prototype.hitTest=function(t){var e,i,o,n,s,r,a,l,c;return this._data.points.length<2?null:(e=this._data.points[0],i=this._data.points[1],o=i.substract(e),o=i.substract(e),n=t.substract(e),s=Math.abs(o.x),r=Math.abs(o.y),a=p.sign(o.y)*(r-r*Math.sqrt(1-n.x*n.x/(s*s))),l=3,Math.abs(a-n.y)<l?new h(h.MOVEPOINT):(c=this.targetLabelHitTest(t),c?c:this.sourceLabelHitTest(t)))},inherit(n,r),n.prototype.renderer=function(){var t,e;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t={},t.points=this._points,t.color=this._source.properties().linecolor.value(),t.linewidth=this._source.properties().linewidth.value(),t.targetLine1=this._targetLine1,t.targetLine2=this._targetLine2,t.targetLine3=this._targetLine3,t.targetLine4=this._targetLine4,t.status=this._source.properties().status.value(),t.transparency=this._source.properties().transparency.value(),t.targetBackColor=this._source.properties().targetBackColor.value(),t.targetStrokeColor=this._source.properties().targetStrokeColor.value(),t.targetTextColor=this._source.properties().targetTextColor.value(),t.sourceBackColor=this._source.properties().sourceBackColor.value(),t.sourceStrokeColor=this._source.properties().sourceStrokeColor.value(),t.sourceTextColor=this._source.properties().sourceTextColor.value(),t.successBackground=this._source.properties().successBackground.value(),t.successTextColor=this._source.properties().successTextColor.value(),t.failureBackground=this._source.properties().failureBackground.value(),t.failureTextColor=this._source.properties().failureTextColor.value(),t.intermediateBackColor=this._source.properties().intermediateBackColor.value(),t.intermediateTextColor=this._source.properties().intermediateTextColor.value(),t.sourceLine1=this._sourceLine1,t.sourceLine2=this._sourceLine2,t.direction=this._direction,t.clockWhite=this._clockWhite,t.clockBlack=this._clockBlack,t.successIcon=this._successIcon,t.failureIcon=this._failureIcon,t.finished=this._finished,t.centersColor=new u(this._model._properties.paneProperties.background._value).blackWhiteContrast(),this.isAnchorsRequired()?(e=new c,e.append(new o(t)),this.addAnchors(e),e):new o(t)},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,a,h,c,d,p,u,_;r.prototype.update.call(this),this._targetLine1="",this._targetLine2="",this._targetLine3="",this._targetLine4="",this._source.points().length<2||this._source.priceScale()&&(t=this._source.points()[1],e=this._source.points()[0],this._targetLine3=this._source.priceScale().formatter().format(t.price),i=t.price-e.price,o=i<0?"-":"+",this._targetLine1=this._source.priceScale().formatter().format(Math.abs(i)),n=Math.abs(Math.round(i/e.price*1e4)/100),this._targetLine1=o+this._targetLine1+" ("+o+this._percentageFormatter.format(n)+")",a=this._model.timeScale().indexToUserTime(e.index),h=this._model.timeScale().indexToUserTime(t.index),c=e.time&&t.time,c&&(a=TradingView.isString(e.time)?new Date(Date.parse(e.time)):e.time,h=TradingView.isString(t.time)?new Date(Date.parse(t.time)):t.time),d=this._model.mainSeries().isDWM(),p=l.kind(this._model.mainSeries().interval())===l.SECONDS,h&&a&&(this._targetLine4=(new g).format(h),d||(this._targetLine4=this._targetLine4+" "+new v(p?"%h:%m:%s":"%h:%m").format(h)),u=(h.valueOf()-a.valueOf())/1e3,this._targetLine2=$.t("in",{context:"dates"})+" "+(new y).format(u)),this._sourceLine1=this._source.priceScale().formatter().format(e.price),this._sourceLine2="",_=this._model.timeScale().indexToUserTime(e.index),_&&(this._sourceLine2=(new g).format(_),d||(this._sourceLine2=this._sourceLine2+" "+new v(p?"%h:%m:%s":"%h:%m").format(_))),this._direction=this._source.direction()===s.DIRECTION_UP?"up":"down",this._finished=this._model.lineBeingCreated()!==this._source&&this._model.lineBeingEdited()!==this._source&&this._model.sourceBeingMoved()!==this._source)},s.ALERT_STATUS_WAITING=0,s.ALERT_STATUS_SUCCESS=1,s.ALERT_STATUS_FAILURE=2,s.DIRECTION_UP=1,s.DIRECTION_DOWN=2,inherit(s,a),s.prototype.status=function(){return this._properties.status.value()},s.prototype.setStatus=function(t){return this._properties.status.setValue(t)},s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Forecast"},s.prototype.restorePoints=function(t,e,i){a.prototype.restorePoints.call(this,t,e,i),this.checkAlert()},s.prototype.checkAlert=function(){var t,e,i,o,n;if(!(this._points.length<2||this._model.mainSeries().bars().isEmpty())){if(t=this._points[1],this.status())return void(t.index>this._model.timeScale().points().lastTimePointIndex()&&this.setStatus(s.ALERT_STATUS_WAITING));e=this._model.timeScale().indexToTimePoint(t.index),e&&(i=this._model.mainSeries().bars().valueAt(t.index),o=this.direction(),o===s.DIRECTION_UP&&i[TradingView.HIGH_PLOT]>=t.price?this.setStatus(s.ALERT_STATUS_SUCCESS):o===s.DIRECTION_DOWN&&i[TradingView.LOW_PLOT]<=t.price?this.setStatus(s.ALERT_STATUS_SUCCESS):(n=this._model.mainSeries().bars().last().value,i[TradingView.TIME_PLOT]!==n[TradingView.TIME_PLOT]&&this.setStatus(s.ALERT_STATUS_FAILURE)))}},s.prototype.addPoint=function(t){var e=a.prototype.addPoint.call(this,t);return e&&this.checkAlert(),e},s.prototype.endChanging=function(){a.prototype.endChanging.call(this),this.setStatus(s.ALERT_STATUS_WAITING),this.checkAlert()},s.prototype.onData=function(t){a.prototype.onData.call(this,t),this.checkAlert()},s.prototype.endMoving=function(){a.prototype.endMoving.call(this),this.setStatus(s.ALERT_STATUS_WAITING),this.checkAlert()},s.prototype.direction=function(){var t,e;return this.points().length<2?s.DIRECTION_UP:(t=this.points()[0],e=this.points()[1],e.price>t.price?s.DIRECTION_UP:s.DIRECTION_DOWN)},t.exports=s},function(t,e){"use strict";t.exports=function(t,e){var i=document.body,o=i[t];return o||(o=document.createElement("img"),o.src=e,i[t]=o),o}},function(t,e,i){"use strict";function o(t,e,i){this._data=t,this._measureCache=e,this._chartModel=i,this._points=t.points}function n(t,e,i){r.call(this,t,e),this._image=d("price_label",TradingView.wrapUrl("images/price_label.png")),this._rendererCache={},this._invalidated=!0}function s(t,e){this._constructor="LineToolPriceLabel";var i=e||new u("linetoolpricelabel");a.call(this,t,new n(this,t),i)}var r=i(123),a=i(82).LineDataSource,l=i(112).SelectionRenderer,h=i(113),c=i(117),d=i(221),p=i(30),u=i(91).DefaultProperty,_=i(119);o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h;0!==this._points.length&&(t.font=[this._data.fontWeight,this._data.fontSize+"px",this._data.fontFamily].join(" "),e=t.measureText(this._data.label),e.height=this._data.fontSize,i=3,o=15,n=-9,s={left:10,top:5},r=e.width+2*s.left,a=e.height+2*s.top,l=this._points[0].x-n,h=this._points[0].y-(a+o),this._measureCache&&$.extend(this._measureCache,{innerWidth:r,innerHeight:a,tailLeft:n,tailHeight:o}),t.translate(.5+l,.5+h),t.beginPath(),t.moveTo(12,a),t.lineTo(n,a+o),t.lineTo(n-1,a+o-1),t.lineTo(5,a),t.lineTo(i,a),t.arcTo(0,a,0,0,i),t.lineTo(0,i),t.arcTo(0,0,r,0,i),t.lineTo(r-i,0),t.arcTo(r,0,r,a,i),t.lineTo(r,a-i),t.arcTo(r,a,0,a,i),t.lineTo(12,a),t.fillStyle=_.generateColor(this._data.backgroundColor,this._data.transparency),t.fill(),t.strokeStyle=this._data.borderColor,t.lineWidth=2,t.stroke(),t.closePath(),t.textBaseline="top",t.fillStyle=this._data.color,t.fillText(this._data.label,s.left,s.top-1),t.translate(-.5,-.5),t.beginPath(),t.arc(n,a+o,2.5,0,2*Math.PI,!1),t.fillStyle=_.generateColor(this._data.borderColor,this._data.transparency),t.fill(),t.strokeStyle=this._chartModel.backgroundColor(),t.lineWidth=1,t.stroke(),t.closePath())},o.prototype.hitTest=function(t){var e,i;return 0===this._points.length?null:(e=this._points[0].x-this._measureCache.tailLeft,i=this._points[0].y-(this._measureCache.innerHeight+this._measureCache.tailHeight),p.pointInRect(t,new p.Point(e,i),new p.Point(e+this._measureCache.innerWidth,i+this._measureCache.innerHeight))?new h(h.MOVEPOINT):null)},inherit(n,r),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i;if(r.prototype.update.call(this),this._source.points().length>0){if(t=this._source.points()[0].price,!(e=this._source.priceScale())||e.isEmpty())return;e.isPercent()&&(i=this._source.ownerSource().firstValue(),t=e.priceRange().convertToPercent(t,i)),this._priceLabel=e.formatter().format(t)}},n.prototype.renderer=function(){var t,e;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t={},t.points=this._points,t.borderColor=this._source.properties().borderColor.value(),t.backgroundColor=this._source.properties().backgroundColor.value(),t.color=this._source.properties().color.value(),t.fontWeight=this._source.properties().fontWeight.value(),t.fontSize=this._source.properties().fontsize.value(),t.fontFamily=this._source.properties().font.value(),t.transparency=this._source.properties().transparency.value(),t.label=this._priceLabel,t.image=this._image,this.isAnchorsRequired()&&1===t.points.length?(e=new c,e.append(new o(t,this._rendererCache,this._model)),e.append(new l({points:t.points})),e):new o(t,this._rendererCache,this._model)},inherit(s,a),s.prototype.pointsCount=function(){return 1},s.prototype.title=function(){return"Price Label"},t.exports=s},function(t,e,i){"use strict";function o(){}function n(t,e){this._source=t,this._data=e}function s(t,e){h.call(this,t,e),this._rendererSource=new o,this._invalidated=!0}function r(t,e){this._constructor="LineToolNote";var i=e||new f("linetoolnote");c.call(this,t,new s(this,t),i),this.version=r.version}function a(t,e){var i=e||new f("linetoolnoteabsolute");i.locked.value()||i.locked.setValue(!0),r.call(this,t,i)}var l=i(30),h=i(123),c=i(82).LineDataSource,d=i(124).TextRenderer,p=i(112).SelectionRenderer,u=i(113),_=i(117),f=i(91).DefaultProperty,m=i(119);o.prototype.update=function(t){this._data&&(!this._data||t.markerColor===this._data.markerColor&&t.width===this._data.width&&t.height===this._data.height)||this._createSource(t.width,t.height,t.markerColor),this._data=t},o.prototype._createSource=function(t,e,i){var o,n;this._sourceCanvas=document.createElement("canvas"),this._sourceCanvas.width=t,this._sourceCanvas.height=e,this._translate=new l.Point(-t/2,.5-e),this._translate.x%1==0&&(this._translate.x+=.5),o=this._sourceCanvas.getContext("2d"),n=.6*t,o.fillStyle=i,o.beginPath(),o.moveTo(t/2,e),o.quadraticCurveTo(t,t/1.15,t,t/2),o.arc(t/2,t/2,t/2,0,Math.PI,!0),o.quadraticCurveTo(0,t/1.15,t/2,e),o.fill(),o.globalCompositeOperation="destination-out",o.beginPath(),o.moveTo((t-n)/2,t/2),o.arc(t/2,t/2,n/2,0,2*Math.PI),o.fill()},o.prototype.drawOn=function(t){var e=new l.Point(Math.round(this._data.point.x),Math.round(this._data.point.y)).add(this._translate);t.drawImage(this._sourceCanvas,e.x,e.y)},o.prototype.hasPoint=function(t){var e=this._data.point.add(this._translate),i=new l.Point(this._data.point.x-this._translate.x,this._data.point.y);return l.pointInRect(t,e,i)},n.prototype.draw=function(t){this._source.drawOn(t),this._data.tooltipVisible&&this.drawTooltipOn(t)},n.prototype.drawTooltipOn=function(t){var e,i,o,n,s,a,l,h,c,p,u,_,f,g,v;for(t.save(),e=(this._data.text+"").replace(/^\s+|\s+$/g,"").replace(/[\r\n]+/g,"\n"),t.font=(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font,i=r.TOOLTIP_WIDTH-2*r.TOOLTIP_PADDING,o=d.prototype.wordWrap(e,i,t.font),n=this._data.point,s=r.TOOLTIP_LINESPACING,a=r.TOOLTIP_WIDTH,l=o.length*this._data.fontSize+2*r.TOOLTIP_PADDING,o.length>1&&(l+=(o.length-1)*s),h=Math.round(n.x-a/2),c=Math.round(n.y-this._data.height-l-8),p=n.x<20||n.x+20>this._data.vpWidth,u=p?null:"top",_=p?null:Math.round(n.x),c<10?c=n.y+13:u="bottom",h<10?h+=Math.abs(h-10):h+a+10>this._data.vpWidth&&(h-=h+a+10-this._data.vpWidth),t.fillStyle=m.generateColor(this._data.backgroundColor,this._data.backgroundTransparency),t.strokeStyle=this._data.markerColor,t.lineWidth=1,t.beginPath(),t.moveTo(h,c),p||"top"!==u||(t.lineTo(_-7,c),t.lineTo(_,c-7),t.lineTo(_+7,c)),t.lineTo(h+a,c),t.lineTo(h+a,c+l),p||"bottom"!==u||(t.lineTo(_+7,c+l),t.lineTo(_,c+l+7),t.lineTo(_-7,c+l)),t.lineTo(h,c+l),t.closePath(),t.fill(),t.stroke(),t.textBaseline="middle",t.fillStyle=this._data.textColor,f=h+r.TOOLTIP_PADDING,g=c+r.TOOLTIP_PADDING+this._data.fontSize/2,v=0;v<o.length;v++)t.fillText(o[v].replace(/^\s+/,""),f,g),g+=this._data.fontSize+s;t.restore()},n.prototype.hitTest=function(t){if(this._source.hasPoint(t))return new u(u.MOVEPOINT)},inherit(s,h),s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){h.prototype.update.call(this),this._invalidated=!1},s.prototype.isLabelVisible=function(){return this.isHoveredSource()||this.isSelectedSource()},s.prototype.renderer=function(){var t,e,i,o,s,r,a;return this._invalidated&&this.updateImpl(),t=new _,e=this._source.properties(),i=e.locked&&e.locked.value(),o=i?this._source.fixedPoints():this._points,o.length<1?t:(s=this.isLabelVisible(),r=s,a=$.extend(e.state(),{point:o[0],width:24,height:32,tooltipVisible:r,vpWidth:this._model.m_timeScale.m_width,vpHeight:this._source.m_priceScale.m_height}),this._rendererSource.update(a),t.append(new n(this._rendererSource,a)),s&&t.append(new p({points:o})),t)},inherit(r,c),r.TOOLTIP_WIDTH=300,r.TOOLTIP_PADDING=10,r.TOOLTIP_LINESPACING=5,r.version=1,r.prototype.pointsCount=function(){return 1},r.prototype.title=function(){return $.t("Note")},r.prototype.restoreTemplate=function(t){delete t.locked,delete t.text,c.prototype.restoreTemplate.call(this,t)},inherit(a,r),a.prototype.title=function(){return $.t("Anchored Note")},r.prototype.state=function(t){var e=c.prototype.state.call(this,t);return t&&(e.state.fixedSize=!1),e},e.LineToolNote=r,e.LineToolNoteAbsolute=a},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._invalidated=!0,this._model=e,this._source=t}function n(t,e){this._constructor="LineToolBrush";var i=e||new d("linetoolbrush");a.call(this,t,new o(this,t),i),this._finished=!1}var s=i(30),r=i(123),a=i(82).LineDataSource,l=i(181),h=i(112).SelectionRenderer,c=i(117),d=i(91).DefaultProperty;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype._smoothArray=function(t,e){var i,o,n,r,a,l=Array(t.length);for(i=0;i<t.length;i++){for(o=new s.Point(0,0),n=0;n<e;n++)r=Math.max(i-n,0),a=Math.min(i+n,t.length-1),o=o.add(t[r]),o=o.add(t[a]);l[i]=o.scaled(.5/e)}return l.push(t[t.length-1]),l},o.prototype._updateInternal=function(){var t,e,i,o,n,s,a,l,h;if(r.prototype.update.call(this),t=Math.max(1,this._source.properties().smooth.value()),e=this._points,0!==e.length){for(i=[e[0]],o=1;o<e.length;o++){for(n=e[o].substract(e[o-1]),s=n.length(),a=Math.min(5,Math.floor(s/t)),l=n.normalized().scaled(s/a),h=0;h<a-1;h++)i.push(e[o-1].add(l.scaled(h)));i.push(e[o])}this._points=this._smoothArray(i,t)}},o.prototype.renderer=function(){var t,e,i,o;return this._invalidated&&(this._updateInternal(),this._invalidated=!1),t={},e=this._source.properties(),t.points=this._points,t.color=e.linecolor.value(),t.linewidth=e.linewidth.value(),t.linestyle=e.linestyle.value(),t.skipClosePath=!0,t.leftend=this._source.properties().leftEnd.value(),t.rightend=this._source.properties().rightEnd.value(),e.fillBackground.value()&&this._model.lineBeingCreated()!==this._source&&(t.filled=!0,t.fillBackground=!0,t.backcolor=e.backgroundColor.value(),t.transparency=e.transparency.value()),this.isAnchorsRequired()&&this._source.finished()?(i=new c,i.append(new l(t)),t.points.length>0&&(o=[t.points[0],t.points[t.points.length-1]],i.append(new h({points:o}))),i):new l(t)},inherit(n,a),n.prototype.pointsCount=function(){return-1},n.prototype.finished=function(){return this._finished},n.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},n.prototype.title=function(){return"Brush"},n.prototype.percentDistance=function(t,e){return Math.abs((e-t)/t)},n.prototype.addPoint=function(t){var e,i,o;return!!this._finished||(this._lastPoint=null,this._points.length>0&&(e=this._points[this._points.length-1],i=this.pointToScreenPoint(e)[1],o=this.pointToScreenPoint(t)[1],o.substract(i).length()<2)?this._finished:(a.prototype.addPoint.call(this,t),this._finished))},n.prototype.restorePoints=function(t,e,i){a.prototype.restorePoints.call(this,t,e,i),this._finished=!0},t.exports=n},function(t,e,i){"use strict";function o(t){this._data=t,this._data.angleFrom=0,this._data.angleTo=Math.PI,this._data.clockwise=!1}function n(t,e){a.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolArc";var i=e||new d("linetoolarc");l.call(this,t,new n(this,t),i),this.version=s.version}var r=i(30),a=i(123),l=i(82).LineDataSource,h=i(113),c=i(117),d=i(91).DefaultProperty,p=i(119);o.prototype.draw=function(t){var e,i,o,n,s,a,l,h,c,d,u,_,f,m;if(!(this._data.points.length<2)){if(e=this._data.points[0],i=this._data.points[1],this._data.points.length<3)return t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),void t.stroke();if(o=this._data.points[2],(n=r.distanceToLine(e,i,o).distance)<1)return t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),void t.stroke();s=i.substract(e),a=e.add(i).scaled(.5),l=new r.Point(-s.y,s.x),l=l.normalized(),o=a.add(l.scaled(n)),t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,h=s.length(),c=s.x/h,d=s.y/h,u=Math.acos(c),d<0&&(u=-u),_=this._data.points[2],f=r.Matrix.translate(-a.x,-a.y),_=f.mult(_),f=r.Matrix.rotate(-u),_=f.mult(_),f=r.Matrix.scale(1,h/(2*n)),_=f.mult(_),_.y<0?this._data.clockwise=!0:this._data.clockwise=!1,t.save(),t.beginPath(),t.translate(e.x,e.y),t.rotate(u),m=1-Math.sqrt(3)/2,t.scale(1,n/(h*m)),this._data.clockwise?t.arc(.5*h,h*Math.sqrt(3)/2,h,-2*Math.PI/3,-Math.PI/3,!1):t.arc(.5*h,-h*Math.sqrt(3)/2,h,Math.PI/3,2*Math.PI/3,!1),t.restore(),t.stroke(),this._data.fillBackground&&(t.fillStyle=p.generateColor(this._data.backcolor,this._data.transparency),t.fill())}},o.prototype.hitTest=function(t){var e,i,o,n,s,a,l,c,d,p,u,_,f,m,g,v,y;return this._data.points.length<3?null:(e=5,i=this._data.points[0],o=this._data.points[1],n=this._data.points[2],(s=r.distanceToLine(i,o,n).distance)<1?(s=r.distanceToLine(i,o,t).distance,s<e?new h(h.MOVEPOINT):null):(a=o.substract(i),l=a.length(),c=i.add(o).scaled(.5),d=n.substract(c),d=d.normalized(),n=c.add(d.scaled(s)),p=a.x/l,u=a.y/l,_=Math.acos(p),u<0&&(_=-_),f=r.Matrix.translate(-i.x,-i.y),t=f.mult(t),f=r.Matrix.rotate(-_),t=f.mult(t),d=f.mult(d),m=1-Math.sqrt(3)/2,f=r.Matrix.scale(1,l*m/s),t=f.mult(t),d=f.mult(d),t.y*d.y<0?null:(g=t.y<0?new r.Point(.5*l,l*Math.sqrt(3)/2):new r.Point(.5*l,-l*Math.sqrt(3)/2),v=t.substract(g),y=v.length(),Math.abs(y-l)<=e?new h(h.MOVEPOINT):null)))},inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){a.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,n,s,a,l,h,d,p,u,_,f,m,g,v,y,b,w,S;return this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().color.value(),t.linewidth=this._source.properties().linewidth.value(),t.backcolor=this._source.properties().backgroundColor.value(),t.fillBackground=this._source.properties().fillBackground.value(),t.transparency=this._source.properties().transparency.value(),this.isAnchorsRequired()?(e=new c,e.append(new o(t)),i=[],n=t.points[0],s=new r.Point(n.x,n.y),s.data=0,i.push(s),1===t.points.length?e:(a=t.points[1],l=new r.Point(a.x,a.y),l.data=1,2===t.points.length?(this.addAnchors(e),e):(i.push(l),h=t.points[2],d=r.distanceToLine(n,a,h).distance,p=a.substract(n),u=n.add(a).scaled(.5),_=new r.Point(-p.y,p.x),_=_.normalized(),h=u.add(_.scaled(d)),f=u.add(_.scaled(-d)),m=p.length(),g=p.x/m,v=p.y/m,y=Math.acos(g),v<0&&(y=-y),b=t.points[2],w=r.Matrix.translate(-u.x,-u.y),b=w.mult(b),w=r.Matrix.rotate(-y),b=w.mult(b),w=r.Matrix.scale(1,m/(2*d)),b=w.mult(b),S=b.y>=0?new r.Point(h.x,h.y):new r.Point(f.x,f.y),S.data=2,i.push(S),e.append(this.createLineAnchor({points:i})),e))):new o(t)},inherit(s,l),s.prototype.startChanging=function(t,e){var i,o,n,s,a,h,c;l.prototype.startChanging.call(this,t,e),0!==t&&1!==t||(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],this._dist=r.distanceToLine(i,o,n).distance,s=o.substract(i),a=new r.Point(-s.y,s.x),h=i.add(o).scaled(.5),c=n.substract(h),c.dotProduct(a)<0&&(this._dist=-this._dist))},s.prototype.pointsCount=function(){return 3},s.prototype.title=function(){return"Arc"},s.prototype.setPoint=function(t,e){var i,o,n,s,a,l,h,c,d,p,u,_,f,m=$.extend({},e),g=this.pointToScreenPoint(this._points[0])[0],v=this.pointToScreenPoint(this._points[1])[0],y=this.pointToScreenPoint(this._points[2])[0],b=this.priceScale();switch(b.isPercent()&&(i=this.ownerSource().firstValue(),m.price=b.priceRange().convertFromPercent(m.price,i)),t){case 0:g=this.pointToScreenPoint(m)[0],o=v.substract(g),n=g.add(v).scaled(.5),s=new r.Point(-o.y,o.x),s=s.normalized(),y=n.add(s.scaled(this._dist)),y=this.screenPointToPoint(y),this._points[0]=m,this._points[2]=y;break;case 1:a=r.distanceToLine(g,v,y).distance,v=this.pointToScreenPoint(m)[0],o=v.substract(g),n=g.add(v).scaled(.5),s=new r.Point(-o.y,o.x),s=s.normalized(),y=n.add(s.scaled(this._dist)),y=this.screenPointToPoint(y),this._points[1]=m,this._points[2]=y;break;case 2:m=this.pointToScreenPoint(m)[0],a=r.distanceToLine(g,v,m).distance,o=v.substract(g),n=g.add(v).scaled(.5),s=new r.Point(-o.y,o.x),s=s.normalized(),y=n.add(s.scaled(a)),l=n.add(s.scaled(-a)),h=o.length(),c=o.x/h,d=o.y/h,p=Math.acos(c),d<0&&(p=-p),u=r.Matrix.translate(-n.x,-n.y),m=u.mult(m),_=u.mult(y),u=r.Matrix.rotate(-p),m=u.mult(m),_=u.mult(_),u=r.Matrix.scale(1,h/(2*a)),m=u.mult(m),_=u.mult(_),f=m.y*_.y>=0?new r.Point(y.x,y.y):new r.Point(l.x,l.y),f=this.screenPointToPoint(f),this._points[2]=f}this.normalizePoints()},s.version=2,s.prototype.migrateVersion=function(t,e,i){var o,n;1===t&&2===this._points.length&&(o=(2*this._points[0].price+3*this._points[1].price)/5,this._points.append({price:o,index:this._points[1].index})),1===t&&2===this._timePoint.length&&(o=(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,n={price:o,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t},this._timePoint.append(n))},t.exports=s},function(t,e,i){"use strict";function o(t,e){this._data=t,t.lines=this.wordWrap(t.text,t.wordWrapWidth),this._textSizeCache=e}function n(t,e){a.call(this,t,e),this._textSizeCache={},this._invalidated=!0}function s(t,e){this._constructor="LineToolCallout";var i=e||new p("linetoolcallout");l.call(this,t,new n(this,t),i),this._barOffset=0,this._timeScale=t.timeScale()}var r=i(30),a=i(123),l=i(82).LineDataSource,h=i(89).DataSource,c=i(113),d=i(117),p=i(91).DefaultProperty,u=i(119);o.ROUND_RADIUS=8,o.TEXT_MARGINS=2,function(){function t(){var t=document.createElement("canvas");t.width=0,t.height=0,e=t.getContext("2d"),t=null}var e;o.prototype.wordWrap=function(i,o){var n,s,r,a,l,h,c,d,p;if(e||t(),o=+o,i+="",n=i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/),n[n.length-1]||n.pop(),!isFinite(o)||o<=0)return n;for(e.font=this.fontStyle(),s=[],r=0;r<n.length;r++)if(a=n[r],(l=e.measureText(a).width)<=o)s.push(a);else for(h=a.split(/([-\)\]\},.!?:;])|(\s+)/);h.length;){if((c=~~(o/l*(h.length+2)/3))<=0||e.measureText(h.slice(0,3*c-1).join("")).width<=o)for(;e.measureText(h.slice(0,3*(c+1)-1).join("")).width<=o;)c++;else for(;c>0&&e.measureText(h.slice(0,3*--c-1).join("")).width>o;);if(c>0)s.push(h.slice(0,3*c-1).join("")),h.splice(0,3*c);else{if(d=h[0]+(h[1]||""),p=1===p?1:~~(o/e.measureText(d)*d.length),e.measureText(d.substr(0,p)).width<=o)for(;e.measureText(d.substr(0,p+1)).width<=o;)p++;else for(;p>1&&e.measureText(d.substr(0,--p)).width>o;);p<1&&(p=1),s.push(d.substr(0,p)),h[0]=d.substr(p),h[1]=""}if((l=e.measureText(h.join("")).width)<=o){s.push(h.join(""));break}}return s}}(),o.prototype.hitTest=function(t){var e,i,o,n,s;return this._data.points.length<2?null:(e=this._data.points[0],i=this._data.points[1],o=3,e.substract(t).length()<o?new c(c.CHANGEPOINT,0):(n=i.x-this._textSizeCache.totalWidth/2,s=i.y-this._textSizeCache.totalHeight/2,t.x>=n&&t.x<=n+this._textSizeCache.totalWidth&&t.y>=s&&t.y<=s+this._textSizeCache.totalHeight?new c(c.MOVEPOINT):null))},o.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},o.prototype.draw=function(t){var e,i,n,s,r,a,l,h,c,d,p,_,f,m;if(!(this._data.points.length<2)){for(e=this._data.points[0].clone(),i=this._data.points[1].clone(),t.lineCap="butt",t.strokeStyle=this._data.bordercolor,t.lineWidth=this._data.linewidth,t.textBaseline="bottom",t.font=this.fontStyle(),n=this._data.fontSize*this._data.lines.length,s=this._data.wordWrapWidth||this._data.lines.reduce(function(e,i){return Math.max(e,t.measureText(i).width)},0),this._textSizeCache.textHeight=n,this._textSizeCache.textHeight=s,r=o.ROUND_RADIUS,a=o.TEXT_MARGINS,l=s+2*a+2*r,h=n+2*a+2*r,this._textSizeCache.totalWidth=l,this._textSizeCache.totalHeight=h,c=i.x-l/2,d=i.y-h/2,p=0,_=s+2*a>2*r,f=n+2*a>2*r,e.x>c+l?p=20:e.x>c&&(p=10),e.y>d+h?p+=2:e.y>d&&(p+=1),t.save(),t.translate(c,d),e.x-=c,e.y-=d,i.x-=c,i.y-=d,t.beginPath(),t.moveTo(r,0),10===p?_?(t.lineTo(i.x-r,0),t.lineTo(e.x,e.y),t.lineTo(i.x+r,0),t.lineTo(l-r,0)):(t.lineTo(e.x,e.y),t.lineTo(l-r,0)):t.lineTo(l-r,0),20===p?(t.lineTo(e.x,e.y),t.lineTo(l,r)):t.arcTo(l,0,l,r,r),21===p?f?(t.lineTo(l,i.y-r),t.lineTo(e.x,e.y),t.lineTo(l,i.y+r),t.lineTo(l,h-r)):(t.lineTo(e.x,e.y),t.lineTo(l,h-r)):t.lineTo(l,h-r),22===p?(t.lineTo(e.x,e.y),t.lineTo(l-r,h)):t.arcTo(l,h,l-r,h,r),12===p?_?(t.lineTo(i.x+r,h),t.lineTo(e.x,e.y),t.lineTo(i.x-r,h),t.lineTo(r,h)):(t.lineTo(e.x,e.y),t.lineTo(r,h)):t.lineTo(r,h),2===p?(t.lineTo(e.x,e.y),t.lineTo(0,h-r)):t.arcTo(0,h,0,h-r,r),1===p?f?(t.lineTo(0,i.y+r),t.lineTo(e.x,e.y),t.lineTo(0,i.y-r),t.lineTo(0,r)):(t.lineTo(e.x,e.y),t.lineTo(0,r)):t.lineTo(0,r),0===p?(t.lineTo(e.x,e.y),t.lineTo(r,0)):t.arcTo(0,0,r,0,r),t.stroke(),t.fillStyle=u.generateColor(this._data.backcolor,this._data.transparency),t.fill(),t.fillStyle=this._data.color,d=r+a+this._data.fontSize,c=r+a,m=0;m<this._data.lines.length;m++)t.fillText(this._data.lines[m],c,d),d+=this._data.fontSize;t.restore()}},inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){a.prototype.update.call(this),this._source._calculatePoint2()},n.prototype.renderer=function(){var t,e,i,n,s,a,l,h;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points[0]?this._points.length<2?void 0:(t=this._source.properties(),e={},e.points=[],e.points.push(this._points[0]),i=this._points[1].clone(),i.x=this._points[0].x+this._source._barOffset*this._model.timeScale().barSpacing(),e.points.push(i),e.color=t.color.value(),e.linewidth=t.linewidth.value(),e.backcolor=t.backgroundColor.value(),e.transparency=t.transparency.value(),e.text=t.text.value(),e.font=t.font.value(),e.fontSize=t.fontsize.value(),e.bordercolor=t.bordercolor.value(),t.wordWrap&&t.wordWrap.value()&&(e.wordWrapWidth=t.wordWrapWidth.value()),e.bold=t.bold&&t.bold.value(),e.italic=t.italic&&t.italic.value(),n=new o(e,this._textSizeCache),this.isAnchorsRequired()?(s=new d,s.append(n),a=e.points[1],l=[].concat(e.points),l.splice(l.length-1,1),s.append(this.createLineAnchor({points:l})),e.wordWrapWidth&&(h=new r.Point(a.x+(e.wordWrapWidth>>1)+o.ROUND_RADIUS+o.TEXT_MARGINS,a.y),h.data=1,s.append(this.createLineAnchor({points:[h]}))),s):n):new d},inherit(s,l),s.MIN_WIDTH=100,s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Callout"},s.prototype.correctPoints=function(t){var e=this._currentMovingPoint.index-this._startMovingPoint.index,i=this._currentMovingPoint.price-this._startMovingPoint.price,o=t[1];o.index+=e,o.price+=i,t[1]=o},s.prototype.addPoint=function(t){var e=l.prototype.addPoint.call(this,t);return e&&this._calculateBarOffset(),e},s.prototype._calculateBarOffset=function(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)},s.prototype.setLastPoint=function(t){l.prototype.setLastPoint.call(this,t),2===this.points().length&&this._calculateBarOffset()},s.prototype.setPoint=function(t,e){var i,n,r,a,h;switch(t){case 0:l.prototype.setPoint.call(this,t,e),this._calculateBarOffset();break;case 1:if(i=this.properties(),!i.wordWrapWidth)return;if(n=this._points,r=this._dragStartLeftEdgeIndex,a=Math.round((e.index-r)/2),isFinite(r)&&isFinite(a)){if(n[1]={index:r+a,price:n[1].price},this._calculateBarOffset(),this.normalizePoints(),h=this._timeScale.indexToCoordinate(r+2*a)-this._timeScale.indexToCoordinate(r)-o.ROUND_RADIUS-o.TEXT_MARGINS,!isFinite(h))return;i.wordWrapWidth.setValue(Math.max(s.MIN_WIDTH,h));break}n[1]=e,this._calculateBarOffset(),this.normalizePoints()}},s.prototype.startDragPoint=function(t,e){var i=this.properties();1===t&&i.wordWrap&&i.wordWrap.value()&&(this._dragStartLeftEdgeIndex=2*this.points()[1].index-e.index)},s.prototype.move=function(t){l.prototype.move.call(this,t),this._calculateBarOffset()},s.prototype.state=function(t){var e=l.prototype.state.call(this,t);return e.barOffset=this._barOffset,e},s.prototype.restoreData=function(t){t.barOffset?this._barOffset=t.barOffset:this._calculateBarOffset(),this._calculatePoint2()},s.prototype.setPriceScale=function(t){h.prototype.setPriceScale.call(this,t),t&&t.priceRange()&&this._calculatePoint2()},s.prototype._calculatePoint2=function(){var t,e;this._model.lineBeingEdited()!==this&&this._model.sourceBeingMoved()!==this&&(this._points.length<2||(t=this.points()[0],e=this.points()[1],this._points[1]={price:e.price,index:t.index+this._barOffset}))},t.exports=s},function(t,e,i){"use strict";function o(t,e){this._measureCache=e,this._data=t}function n(t,e){a.call(this,t,e),this._rendererCache={},this._invalidated=!0}function s(t,e){this._constructor="LineToolBalloon";var i=e||new p("linetoolballoon");l.call(this,t,new n(this,t),i)}var r=i(30),a=i(123),l=i(82).LineDataSource,h=i(112).SelectionRenderer,c=i(113),d=i(117),p=i(91).DefaultProperty,u=i(119);o.prototype.draw=function(t){var e,i,o,n,s,r,a;0!==this._data.points.length&&(t.font=[this._data.fontWeight,this._data.fontSize+"px",this._data.fontFamily].join(" "),e=t.measureText(this._data.label),e.height=this._data.fontSize,i=15,o={left:i,top:(2*i-e.height)/2},n=e.width+2*o.left,s=2*i,r=this._data.points[0].x-(o.left+20),a=this._data.points[0].y-(s+9),this._measureCache&&$.extend(this._measureCache,{innerWidth:n,innerHeight:s,padding:o}),t.translate(.5+r,.5+a),t.beginPath(),t.moveTo(i+9,s),t.lineTo(i,s),t.arcTo(-1e3,0,1e3,0,i),t.lineTo(n-i,0),t.arcTo(1e3,s,-1e3,s,i),t.lineTo(i+18,s),t.quadraticCurveTo(i+18,s+4,i+20,s+9),t.quadraticCurveTo(i+12,s+6,i+9,s),t.fillStyle=u.generateColor(this._data.backgroundColor,this._data.transparency),t.fill(),t.strokeStyle=this._data.borderColor,t.lineWidth=2,t.stroke(),t.closePath(),t.textBaseline="top",t.fillStyle=this._data.color,t.fillText(this._data.label,o.left,o.top-1))},o.prototype.hitTest=function(t){var e,i;return 0!==this._data.points.length&&this._measureCache.padding?(e=this._data.points[0].x-(this._measureCache.padding.left+20),i=this._data.points[0].y-(this._measureCache.innerHeight+9),r.pointInRect(t,new r.Point(e,i),new r.Point(e+this._measureCache.innerWidth,i+this._measureCache.innerHeight))?new c(c.MOVEPOINT):null):null},inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){a.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e;return this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().color.value(),t.borderColor=this._source.properties().borderColor.value(),t.backgroundColor=this._source.properties().backgroundColor.value(),t.transparency=this._source.properties().transparency.value(),t.fontWeight=this._source.properties().fontWeight.value(),t.fontSize=this._source.properties().fontsize.value(),t.fontFamily=this._source.properties().font.value(),t.label=this._source.properties().text.value(),this.isAnchorsRequired()&&1===t.points.length?(e=new d,e.append(new o(t,this._rendererCache)),e.append(new h({points:t.points})),e):new o(t,this._rendererCache)},inherit(s,l),s.prototype.pointsCount=function(){return 1},s.prototype.title=function(){return"Balloon"},t.exports=s},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){l.call(this,t,e),this._rendererCache={},this._invalidated=!0}function s(t,e){this._source=t,this._model=e,this._text="",this._coordinate=0,this._background="black"}function r(t,e){this._constructor="LineToolHorzRay";var i=e||new _("linetoolhorzray");this._priceAxisView=new s(this,t),a.call(this,t,new n(this,t),i)}var a=i(82).LineDataSource,l=i(123),h=i(84),c=i(124).TextRenderer,d=i(86),p=i(113),u=i(117),_=i(91).DefaultProperty;o.prototype.draw=function(t){var e,i,o,n;if(0===this._data.points.length)return null;e=t.canvas.width,i=this._data.points[0].y,o=Math.max(0,this._data.points[0].x),n=Math.max(e,this._data.points[0].x),t.lineCap="square",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,CanvasEx.drawLine(t,o,i,n,i)},o.prototype.hitTest=function(t){return 0===this._data.points.length?null:t.x<this._data.points[0].x?null:Math.abs(t.y-this._data.points[0].y)<=3?new p(this._data.hitTestResult):null},inherit(n,l),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){l.prototype.update.call(this)},n.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new u,e={},e.points=this._points,e.color=this._source.properties().linecolor.value(),e.linewidth=this._source.properties().linewidth.value(),e.linestyle=this._source.properties().linestyle.value(),e.hitTestResult=p.MOVEPOINT,i=this._source.properties(),t.append(new o(e)),this._source.properties().showLabel.value()&&1===this._points.length&&(n=i.vertLabelsAlign.value(),s=i.horzLabelsAlign.value(),r=this._points[0].clone(),a=0,l=0,"right"===s?(r.x=this._model.timeScale().width(),l=-5):"center"===s&&(r.x=(r.x+this._model.timeScale().width())/2),"middle"===n?a=-this._source.properties().fontsize.value()/6:"bottom"===n&&(a=-4),h={points:[r],text:i.text.value(),color:i.textcolor.value(),vertAlign:n,horzAlign:s,font:i.font.value(),offsetX:l,offsetY:a,bold:this._source.properties().bold.value(),italic:this._source.properties().italic.value(),fontsize:this._source.properties().fontsize.value()},t.append(new c(h,this._rendererCache))),this.addAnchors(t),TradingView.printing||!this._source.hasAlert.value()||this._model.readOnly()||1!==this._points.length||this._source.getAlertIsActive(function(i){t.append(new TradingView.PaneRendererClockIcon({point1:e.points[0],color:i?e.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),t},inherit(s,h),s.prototype.update=function(){this._invaildated=!0},s.prototype.updateImpl=function(){0!==this._source.points().length&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&(this._background=this._source.properties().linecolor.value(),this._coordinate=this._source.priceScale().priceToCoordinate(this._source.points()[0].price),this._text=this._source.priceScale().formatter().format(this._source.points()[0].price))},s.prototype.renderer=function(){return this._invaildated&&(this.updateImpl(),this._invaildated=!1),new d({text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,visible:!0})},inherit(r,a),r.prototype.pointsCount=function(){return 1},r.prototype.title=function(){return"Horizontal Ray"},r.prototype.priceAxisViews=function(t,e){return this.isActualSymbol()&&e===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===t?[this._priceAxisView]:null},r.prototype.updateAllViews=function(){a.prototype.updateAllViews.call(this),this._priceAxisView.update()},r.prototype.canHasAlert=function(){return!0},r.prototype._getAlertPlots=function(){var t=this._points[0],e={index:t.index+1,price:t.price};return[this._linePointsToAlertPlot([t,e],null,!1,!0)]},t.exports=r},function(t,e,i){"use strict";function o(t){this._data=t,this._data.angleFrom=0,this._data.angleTo=2*Math.PI,this._data.clockwise=!1}function n(t,e){l.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolEllipse";var i=e||new d("linetoolellipse");a.call(this,t,new n(this,t),i),this.version=s.version}var r=i(30),a=i(82).LineDataSource,l=i(123),h=i(113),c=i(117),d=i(91).DefaultProperty,p=i(119);o.prototype.draw=function(t){var e,i,o,n,s,a,l,h,c,d,u,_,f;if(!(this._data.points.length<2)){if(e=this._data.points[0],i=this._data.points[1],this._data.points.length<3)return t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),void t.stroke();if(o=this._data.points[2],(n=r.distanceToLine(e,i,o).distance)<1)return t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),void t.stroke();s=i.substract(e),a=e.add(i).scaled(.5),l=new r.Point(-s.y,s.x),l=l.normalized(),o=a.add(l.scaled(n)),t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,h=s.length(),c=s.x/h,d=s.y/h,u=Math.acos(c),d<0&&(u=-u),_=this._data.points[2],f=r.Matrix.translate(-a.x,-a.y),_=f.mult(_),f=r.Matrix.rotate(-u),_=f.mult(_),f=r.Matrix.scale(1,h/(2*n)),_=f.mult(_),_.y<0?this._data.clockwise=!0:this._data.clockwise=!1,t.save(),t.beginPath(),t.translate(a.x,a.y),t.rotate(u),t.scale(1,2*n/h),t.arc(0,0,.5*h,this._data.angleFrom,this._data.angleTo,this._data.clockwise),t.restore(),t.stroke(),this._data.fillBackground&&(t.fillStyle=p.generateColor(this._data.backcolor,this._data.transparency),t.fill())}},o.prototype._additionalPointTest=function(t,e){return!0},o.prototype.hitTest=function(t){var e,i,o,n,s,a,l,c,d,p,u,_,f,m,g;return this._data.points.length<3?null:(e=this._data.points[0],i=this._data.points[1],o=this._data.points[2],n=r.distanceToLine(e,i,o).distance,s=i.substract(e),a=e.add(i).scaled(.5),l=new r.Point(-s.y,s.x),l=l.normalized(),o=a.add(l.scaled(n)),c=s.length(),d=s.x/c,p=s.y/c,u=Math.acos(d),p<0&&(u=-u),_=r.Matrix.translate(-a.x,-a.y),t=_.mult(t),f=_.mult(this._data.points[2]),_=r.Matrix.rotate(-u),t=_.mult(t),f=_.mult(f),_=r.Matrix.scale(1,c/(2*n)),t=_.mult(t),f=_.mult(f),m=t.length(),g=3,this._additionalPointTest(t,f)?Math.abs(m-.5*c)<=g?new h(h.MOVEPOINT):this._data.fillBackground&&!this._data.noHitTestOnBackground&&m<=.5*c?new h(h.MOVEPOINT_BACKGROUND):null:null)},inherit(n,l),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){l.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,n,s,a,l,h,d,p,u,_,f,m;return this._invalidated&&this.updateImpl(),t=new c,this._points.length<2?t:(e={},e.points=this._points,e.color=this._source.properties().color.value(),e.linewidth=this._source.properties().linewidth.value(),e.backcolor=this._source.properties().backgroundColor.value(),e.fillBackground=this._source.properties().fillBackground.value(),e.transparency=this._source.properties().transparency.value(),t.append(new o(e)),this.isAnchorsRequired()?(i=e.points[0],n=e.points[1],2===this._points.length?(this.addAnchors(t),t):(s=e.points[2],a=r.distanceToLine(i,n,s).distance,l=n.substract(i),h=i.add(n).scaled(.5),d=new r.Point(-l.y,l.x),d=d.normalized(),s=h.add(d.scaled(a)),p=h.add(d.scaled(-a)),u=new r.Point(i.x,i.y),u.data=0,_=new r.Point(n.x,n.y),_.data=1,f=new r.Point(s.x,s.y),f.data=2,m=new r.Point(p.x,p.y),m.data=3,t.append(this.createLineAnchor({points:[u,_,f,m]})),t)):t)},inherit(s,a),s.prototype.startChanging=function(t,e){var i,o,n;a.prototype.startChanging.call(this,t,e),0!==t&&1!==t||(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],this._dist=r.distanceToLine(i,o,n).distance||0)},s.prototype._preparePoint=function(t,e){var i=this._preparePointInternal(t,e,!1);return e&&e.shift&&this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],i),i},s.prototype._preparePointInternal=function(t,e,i){var o,n,s,l,h,c,d,p,u,_,f;if(this._convertPriceFromPercentIfNeeded(t),o=$.extend({},t),e&&e.shift){if(n=this.points().length,!this._fakePointAdded&&3===n&&!i)return o;(this._fakePointAdded||2===n||i)&&(this._snapPoint45Degree(t,this._points[0]),this._fakePointAdded?this._points[1]=t:i||(this._fakePointAdded=!0,a.prototype._addPointIntenal.call(this,t)),s=this.pointToScreenPoint(this._points[0])[0],l=this.pointToScreenPoint(this._points[1])[0],h=l.x-s.x,c=l.y-s.y,d=Math.sqrt(h*h+c*c)/2,p=l.substract(s),u=s.add(l).scaled(.5),_=new r.Point(-p.y,p.x),_=_.normalized(),f=u.add(_.scaled(d)),o=this.screenPointToPoint(f),(TradingView.isNaN(o.price)||TradingView.isNaN(o.index))&&(o=this.screenPointToPoint(u)))}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return o},s.prototype._fixVerticalDiameterPoints=function(t,e,i){var o=this.pointToScreenPoint(t)[0],n=this.pointToScreenPoint(e)[0],s=this._model.timeScale(),r=s.indexToCoordinate(t.index),a=s.indexToCoordinate(i.index),l=2*Math.abs(r-a);l*=e.price>t.price?1:-1,t.price=this.screenPointToPoint({x:o.x,y:n.y+l}).price},s.prototype.addPoint=function(t,e,i){var o=a.prototype.addPoint.call(this,t,e,i);return o&&(this._fakePointAdded=!1),o},s.prototype.setPoint=function(t,e,i){var o,n,s,a,l=$.extend({},e),h=this.pointToScreenPoint(this._points[0])[0],c=this.pointToScreenPoint(this._points[1])[0],d=this.pointToScreenPoint(this._points[2])[0];switch(this._convertPriceFromPercentIfNeeded(l),t){case 0:if(i&&i.shift){this._snapPoint45Degree(l,this._points[1]),this._points[0]=l,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[0],this._points[1],this._points[2]);break}h=this.pointToScreenPoint(l)[0],o=c.substract(h),n=h.add(c).scaled(.5),s=new r.Point(-o.y,o.x),s=s.normalized(),d=n.add(s.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[0]=l,this._points[2]=d;break;case 1:if(i&&i.shift){this._snapPoint45Degree(l,this._points[0]),this._points[1]=l,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],this._points[2]);break}c=this.pointToScreenPoint(l)[0],o=c.substract(h),n=h.add(c).scaled(.5),s=new r.Point(-o.y,o.x),s=s.normalized(),d=n.add(s.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[1]=l,this._points[2]=d;break;case 2:l=this.pointToScreenPoint(l)[0],a=r.distanceToLine(h,c,l).distance,o=c.substract(h),n=h.add(c).scaled(.5),s=new r.Point(-o.y,o.x),s=s.normalized(),d=n.add(s.scaled(a)),d=this.screenPointToPoint(d),this._points[2]=d;break;case 3:l=this.pointToScreenPoint(l)[0],a=r.distanceToLine(h,c,l).distance,o=c.substract(h),n=h.add(c).scaled(.5),s=new r.Point(-o.y,o.x),s=s.normalized(),d=n.add(s.scaled(a)),d=this.screenPointToPoint(d),this._points[2]=d}this.normalizePoints()},s.prototype.pointsCount=function(){return 3},s.prototype.title=function(){return"Ellipse"},s.version=2,s.prototype.migrateVersion=function(t,e,i){var o,n,s;1===t&&2===this._points.length&&(o=this._points[0].price,n=.5*(this._points[0].price+this._points[1].price),this._points[0]={price:n,index:this._points[0].index},this._points[1]={price:n,index:this._points[1].index},this._points.push({price:o,index:this._points[0].index})),1===t&&2===this._timePoint.length&&(o=this._timePoint[0].price,n=.5*(this._timePoint[0].price+this._timePoint[1].price),this._timePoint[0].price=n,this._timePoint[1].price=n,s={price:o,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t},this._timePoint.push(s))},t.exports=s},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){l.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolTimeCycles";var i;i=e?e:new d("linetooltimecycles"),a.call(this,t,new n(this,t),i)}var r=i(30),a=i(82).LineDataSource,l=i(123),h=i(113),c=i(117),d=i(91).DefaultProperty,p=i(119);o.prototype.draw=function(t){t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,CanvasEx.setLineStyle(t,this._data.linestyle),t.save(),t.translate(this._data.point.x+1,this._data.point.y),t.scale(this._data.width,this._data.height),t.beginPath(),t.arc(.5,0,.5,Math.PI,0,!1),t.restore(),t.stroke(),this._data.fillBackground&&(t.fillStyle=p.generateColor(this._data.backcolor,this._data.transparency),t.fill())},o.prototype.hitTest=function(t){var e,i,o,n,s;return t.y>this._data.point.y?null:t.x<this._data.point.x||t.x>this._data.point.x+this._data.width?null:(e=new r.Point(this._data.point.x+this._data.width/2,this._data.point.y),i=t.substract(e),o=this._data.height/this._data.width,i.y/=o,n=i.length(),s=3,Math.abs(n-this._data.width/2)<s?new h(h.MOVEPOINT):null)},inherit(n,l),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){l.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,n,s,a,l,h,d,p,u,_,f,m,g,v,y,b,w;if(this._invalidated&&this.updateImpl(),this._points.length<2)return null;if(t=this._source.points(),e=t[0],i=t[1],n=Math.min(e.index,i.index),s=Math.max(e.index,i.index),a=s-n,l=this._points[0],h=this._points[1],d=Math.abs(l.x-h.x),p=new c,u=this._source.properties(),_=this._model.timeScale(),0===a)return null;for(f=Math.min(l.x,h.x),m=[],g=n;f>-d;g-=a)f=_.indexToCoordinate(g),m.push(f);for(f=Math.max(l.x,h.x),g=s;f<_.width();g+=a)f=_.indexToCoordinate(g),m.push(f);for(v=0;v<m.length;v++)y=new r.Point(m[v],l.y),b={point:y,width:d,height:d,color:u.linecolor.value(),linewidth:u.linewidth.value(),linestyle:u.linestyle.value(),fillBackground:u.fillBackground.value(),backcolor:u.backgroundColor.value(),transparency:u.transparency.value()},w=new o(b),p.append(w);return this.addAnchors(p),p},inherit(s,a),s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Time Cycles"},s.prototype.setPoint=function(t,e,i){var o,n=$.extend({},e),s=this._points[0],r=this._points[1],a=this.priceScale();a.isPercent()&&(o=this.ownerSource().firstValue(),n.price=a.priceRange().convertFromPercent(n.price,o)),s.price=n.price,r.price=n.price,this._points[t]=n,this.normalizePoints()},s.prototype.addPoint=function(t,e,i){var o,n,s=a.prototype.addPoint.call(this,t,e,!0);return s&&(o=this._points[0],n=this._points[1],n.price=o.price,i||(this.normalizePoints(),this.createServerPoints())),s},t.exports=s},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){l.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolSineLine";var i;i=e?e:new d("linetoolsineline"),a.call(this,t,new n(this,t),i)}var r=i(30),a=i(82).LineDataSource,l=i(123),h=i(113),c=i(117),d=i(91).DefaultProperty;o.prototype.draw=function(t){var e,i,o;for(t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,CanvasEx.setLineStyle(t,this._data.linestyle),t.beginPath(),t.moveTo(this._data.point.x,this._data.point.y),e=1;e<=2*this._data.width;e++)i=e*Math.PI/this._data.width,o=Math.sin(i-Math.PI/2)*this._data.height/2,t.lineTo(this._data.point.x+e,this._data.point.y+o+this._data.height/2);t.stroke()},o.prototype.hitTest=function(t){var e,i,o,n;return t.x<this._data.point.x||t.x>this._data.point.x+2*this._data.width?null:(e=t.x-this._data.point.x,i=e*Math.PI/this._data.width,o=Math.sin(i-Math.PI/2)*this._data.height/2,o=this._data.point.y+o+this._data.height/2,n=3,Math.abs(o-t.y)<=n?new h(h.MOVEPOINT):null)},inherit(n,l),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){l.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,n,s,a,l,h,d,p,u,_,f,m,g,v,y,b,w,S;if(this._invalidated&&this.updateImpl(),this._points.length<2)return null;if(t=this._source.points(),e=t[0],i=t[1],n=Math.min(e.index,i.index),s=Math.max(e.index,i.index),a=2*(s-n),l=this._points[0],h=this._points[1],d=Math.abs(l.x-h.x),p=h.y-l.y,u=new c,_=this._source.properties(),f=this._model.timeScale(),0===a)return null;for(m=f.indexToCoordinate(n),g=[],v=n;m>-d;v-=a)m=f.indexToCoordinate(v),g.push(m);for(m=m=f.indexToCoordinate(n+a),v=n+a;m<f.width();v+=a)m=f.indexToCoordinate(v),g.push(m);for(y=0;y<g.length;y++)b=new r.Point(g[y],l.y),w={point:b,width:d,height:p,color:_.linecolor.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value()},S=new o(w),u.append(S);return this.addAnchors(u),u},inherit(s,a),s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Sine Line"},t.exports=s},function(t,e,i){"use strict";function o(t,e){h.call(this,t,e),this._invalidated=!0}function n(t,e,i){this._source=t,this._index=e,this._bars=i||[]}function s(t,e,i){this._source=t,_.call(this,"linetoolghostfeed",e,i)}function r(t,e,i){var n,a;this._constructor="LineToolGhostFeed",e?(n=e,n._source=this):n=new s(this),i||(a=Math.round(t.mainSeries().data().calculateATR()),n.averageHL.setValue(a)),l.call(this,t,new o(this,t),n),this._segments=[],n.averageHL.listeners().subscribe(this,r.prototype.regenerate),n.variance.listeners().subscribe(this,r.prototype.regenerate),n.points||n.addProperty("points"),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._currentInterval=t.mainSeries().interval()}var a=i(30),l=i(82).LineDataSource,h=i(123),c=i(152).TrendLineRenderer,d=i(113),p=i(114).PaneRendererCandles,u=i(117),_=i(91).DefaultProperty;inherit(o,h),o.prototype.update=function(){h.prototype.update.call(this),this._invalidated=!0},o.prototype.udpateImpl=function(){var t=this;this._segments=[],t._points.length<2||(this._segments=this._source.segments().map(function(e,i){var o,n,s,r,l,h,c,d,p,u,_,f=t._source.points();return i>=t._points.length-1?null:(o=t._points[i].x,n=f[i].price,s=f[i+1].price,r=f[i+1].index-f[i].index,l=t._model.timeScale().barSpacing()*a.sign(r),h=(s-n)/(e.bars().length-1),c=t._source.properties(),d=c.candleStyle.upColor.value(),p=c.candleStyle.downColor.value(),u=c.candleStyle.borderUpColor.value(),_=c.candleStyle.borderDownColor.value(),{bars:e.bars().map(function(e,i){var s=e.c>=e.o;return{time:o+i*l,open:t.priceToCoordinate(e.o+n+i*h),high:t.priceToCoordinate(e.h+n+i*h),low:t.priceToCoordinate(e.l+n+i*h),close:t.priceToCoordinate(e.c+n+i*h),color:s?d:p,borderColor:s?u:_,hollow:!1}})})}).filter(function(t){return!!t}))},o.prototype.renderer=function(){var t,e,i,o,n,s,r,a,h,_,f,m,g;for(this._invalidated&&(this.udpateImpl(),this._invalidated=!1),t=new u,e=1;e<this._points.length;e++)i=this._points[e-1],o=this._points[e],n={points:[i,o],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},s=new d(d.MOVEPOINT,null),t.append(new c(n,s));for(r=this._source.properties(),a=r.candleStyle.drawWick.value(),h=r.candleStyle.drawBorder.value(),_=r.candleStyle.borderColor.value(),f=r.candleStyle.wickColor.value(),m=new u,m.setGlobalAlpha(1-r.transparency.value()/100),e=0;e<this._segments.length;e++)g={bars:this._segments[e].bars,barSpacing:this._model.timeScale().barSpacing(),drawWick:a,drawBorder:h,borderColor:_,wickColor:f,hittest:new d(d.MOVEPOINT,null)},m.append(new p(g));return t.append(m),this.addAnchors(t),t},n.prototype.setBars=function(t){this._bars=t||[]},n.prototype.clone=function(t){return new n(t,this._index,TradingView.clone(this._bars))},n.prototype.createBar=function(){var t,e,i,o,n,s=this._source.properties().averageHL.value(),r=this._source.properties().variance.value()/100,a=this._source._model.mainSeries().base(),l=Math.random(),h=s*(1-2*l)*r;return l=Math.random(),t=s*(1+(.5-l)*r),e=h-t/2,i=e+t,o=e+Math.random()*t,n=e+Math.random()*t,{o:o/a,h:i/a,l:e/a,c:n/a}},n.prototype.generate=function(){var t,e,i,o,n,s;if(this._bars=[],t=this._source.points(),e=t[this._index],i=t[this._index+1],e&&i&&e.index!==i.index)for(this._avgHL=this._source.properties().averageHL.value(),this._variance=this._source.properties().variance.value()/100,o=this._index?e.index+1:e.index,n=a.sign(i.index-e.index),s=o;s!==i.index;s+=n)this._bars.push(this.createBar())},n.prototype.bars=function(){return this._bars},n.prototype.setSize=function(t){if(t<this._bars.length)this._bars.splice(t,this._bars.length-t);else for(;this._bars.length<t;)this._bars.push(this.createBar())},inherit(s,_),s.prototype.restoreFactoryDefaults=function(){var t,e;_.prototype.restoreFactoryDefaults.call(this),t=this._source._model,e=Math.round(t.mainSeries().data().calculateATR()),this.averageHL.setValue(e)},inherit(r,l),r.prototype.createPropertiesObject=function(t,e,i){return new s(null,e,i)},r.prototype.regenerate=function(){this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._segments.forEach(function(t){t.generate()}),this.updateAllViews(),this._model.updateSource(this)},r.prototype.propertiesChanged=function(){l.prototype.propertiesChanged.call(this),this._currentAverageHL===this._properties.averageHL.value()&&this._currentVariance===this._properties.variance.value()||this.regenerate()},r.prototype.pointsCount=function(){return-1},r.prototype.title=function(){return"Ghost Feed"},r.prototype.segmentBars=function(t){return this._segments[t].bars()},r.prototype.segments=function(){return this._segments},r.prototype.generateBars=function(t){this._segments.length<=t&&this._segments.push(new n(this,t)),this._segments[t].generate()},r.prototype.addPoint=function(t){var e,i,o;if(this._points.length>0&&(e=this._points[this._points.length-1],e.index===t.index)){for(this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),i=0;i<this._points.length;i++)this._createPointProperty(i);return!0}return o=l.prototype.addPoint.call(this,t),this._finished&&(this._lastPoint=null),this._points.length>1&&this.generateBars(this._points.length-2),o||this._finished},r.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},r.prototype.setPoint=function(t,e,i){var o,n,s;l.prototype.setPoint.call(this,t,e,i),t>0&&(o=this.points()[t-1],n=e.index-o.index,this._segments[t-1].setSize(Math.abs(n))),t<this.points().length-1&&(s=this.points()[t+1],n=s.index-e.index,this._segments[t].setSize(Math.abs(n)))},r.prototype.state=function(t){var e=l.prototype.state.call(this,t);return e.segments=this._segments.map(function(t){return{bars:t.bars()}}),e},r.prototype.restoreData=function(t){var e=this;t.segments&&(this._segments=t.segments.map(function(t,i){return new n(e,i,[].concat(t.bars))})),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value()},r.prototype.onData=function(t){if(l.prototype.onData.call(this,t),0===this.properties().points._childs.length)for(var e=0;e<this._points.length;e++)this._createPointProperty(e);this._currentInterval!==this._model.mainSeries().interval()&&(this.regenerate(),this._currentInterval=this._model.mainSeries().interval())},r.prototype.cloneData=function(t){var e=this;this._segments=t._segments.map(function(t){return t.clone(e)})},t.exports=r},function(t,e,i){"use strict";function o(t,e,i,o){var n,s,r,a,l,h=i.substract(t).length()+i.substract(e).length(),c=3/h;for(n=0;n<=1;n+=c)if(s=t.scaled((1-n)*(1-n)),r=i.scaled(2*n*(1-n)),a=e.scaled(n*n),l=s.add(r).add(a),l.substract(o).length()<5)return!0;return null}function n(t,e,i,o,n){var s,r,a,l,h,c,d=i.substract(t).length()+o.substract(i).length()+e.substract(o).length(),p=3/d;for(s=0;s<=1;s+=p)if(r=t.scaled((1-s)*(1-s)*(1-s)),a=i.scaled(3*(1-s)*(1-s)*s),l=o.scaled(3*(1-s)*s*s),h=e.scaled(s*s*s),c=r.add(a).add(l).add(h),c.substract(n).length()<5)return!0}function s(t,e,i,o,n){var s,r,a,l,h,c,d,p,u,_=i.substract(t).length()+i.substract(e).length();if(!_)return[];for(s=3/_,r=500,a=[],l=1;l<=r*s;l+=s)h=t.scaled((1-l)*(1-l)),c=i.scaled(2*l*(1-l)),d=e.scaled(l*l),p=h.add(c).add(d),a.length>0&&(u=a[a.length-1],u.substract(p).length()<2&&(s*=2)),a.push(p);return a}function r(t){this._data=t}function a(t,e){_.call(this,t,e),this._invalidated=!0}function l(t,e){this._constructor="LineToolBezierQuadro";var i;i=e?e:new v("linetoolbezierquadro"),u.call(this,t,new a(this,t),i)}function h(t){this._data=t}function c(t,e){_.call(this,t,e),this._invalidated=!0}function d(t,e){this._constructor="LineToolBezierCubic";var i;i=e?e:new v("linetoolbeziercubic"),u.call(this,t,new c(this,t),i)}var p=i(30),u=i(82).LineDataSource,_=i(123),f=i(152).TrendLineRenderer,m=i(113),g=i(117),v=i(91).DefaultProperty,y=i(119);r.prototype.draw=function(t){var e,i,o,n,s,r,a,l=this._data.points[0],h=this._data.points[1];if(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,CanvasEx.setLineStyle(t,this._data.linestyle),2===this._data.points.length)t.beginPath(),t.moveTo(l.x,l.y),t.lineTo(h.x,h.y),t.stroke();else{if(e=this._data.points[2],i=h.substract(l),o=e.substract(i.scaled(.25)),n=e.add(i.scaled(.25)),this._data.fillBack&&this._data.points.length>2&&(t.fillStyle=y.generateColor(this._data.backcolor,this._data.transparency),t.beginPath(),t.moveTo(l.x,l.y),t.quadraticCurveTo(o.x,o.y,e.x,e.y),t.quadraticCurveTo(n.x,n.y,h.x,h.y),t.fill()),t.beginPath(),t.moveTo(l.x,l.y),this._data.extendLeftPoints.length>0)for(s=this._data.extendLeftPoints[this._data.extendLeftPoints.length-1],t.moveTo(s.x,s.y),r=this._data.extendLeftPoints.length-2;r>=0;r--)a=this._data.extendLeftPoints[r],t.lineTo(a.x,a.y);for(t.quadraticCurveTo(o.x,o.y,e.x,e.y),t.quadraticCurveTo(n.x,n.y,h.x,h.y),r=0;r<this._data.extendRightPoints.length;r++)a=this._data.extendRightPoints[r],t.lineTo(a.x,a.y);t.stroke(),this._data.leftend===u.LINEEND_ARROW&&f.prototype.drawArrow(o,l,t,t.lineWidth),this._data.rightend===u.LINEEND_ARROW&&f.prototype.drawArrow(n,h,t,t.lineWidth)}},r.prototype.hitTest=function(t){var e,i,n,s,r,a,l,h;if(3===this._data.points.length){if(e=this._data.points[0],i=this._data.points[1],n=this._data.points[2],s=i.substract(e),r=n.substract(s.scaled(.25)),a=n.add(s.scaled(.25)),o(n,e,r,t)||o(n,i,a,t))return new m(m.MOVEPOINT);for(l=3,h=1;h<this._data.extendLeftPoints.length;h++)if(e=this._data.extendLeftPoints[h-1],i=this._data.extendLeftPoints[h],p.distanceToSegment(e,i,t).distance<l)return new m(m.MOVEPOINT);for(h=1;h<this._data.extendRightPoints.length;h++)if(e=this._data.extendRightPoints[h-1],i=this._data.extendRightPoints[h],p.distanceToSegment(e,i,t).distance<l)return new m(m.MOVEPOINT)}return null},inherit(a,_),a.prototype.update=function(){_.prototype.update.call(this),this._invalidated=!0},a.prototype.updateImpl=function(){var t,e,i,o,n,r,a,l;this._extendLeftPoints=[],this._extendRightPoints=[],this._source.points().length<3||(t=this._source.pointToScreenPoint(this._source.points()[0])[1],e=this._source.pointToScreenPoint(this._source.points()[1])[1],i=this._source.pointToScreenPoint(this._source.points()[2])[1],o=e.substract(t),n=i.substract(o.scaled(.25)),r=i.add(o.scaled(.25)),a=this._model.timeScale().width(),l=this._source.priceScale().height(),this._source.properties().extendLeft.value()&&(this._extendLeftPoints=s(i,t,n,a,l)),this._source.properties().extendRight.value()&&(this._extendRightPoints=s(i,e,r,a,l)))},a.prototype.renderer=function(){var t,e,i,o;return this._points.length<2?new g:(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=[].concat(this._points),this._source._controlPoint&&t.push(this._source.pointToScreenPoint(this._source._controlPoint)[0]),e={},i=this._source.properties(),e.points=t,e.color=i.linecolor.value(),e.linewidth=i.linewidth.value(),e.linestyle=i.linestyle.value(),e.leftend=i.leftEnd.value(),e.rightend=i.rightEnd.value(),e.fillBack=i.fillBackground.value(),e.backcolor=i.backgroundColor.value(),e.transparency=i.transparency.value(),e.extendLeftPoints=this._extendLeftPoints,e.extendRightPoints=this._extendRightPoints,o=new g,o.append(new r(e)),this.addAnchors(o),o)},inherit(l,u),l.prototype.pointsCount=function(){return 2},l.prototype.title=function(){return"Curve"},l.prototype.controlPoint=function(){var t=this.pointToScreenPoint(this.points()[0])[0],e=this.pointToScreenPoint(this.points()[1])[0],i=e.substract(t).scaled(.5),o=i.transponed().scaled(.3),n=t.add(e).scaled(.5),s=n.add(o);return this.screenPointToPoint(s)},l.prototype.setLastPoint=function(t,e){u.prototype.setLastPoint.call(this,t,e),this._controlPoint=this.controlPoint()},l.prototype.addPoint=function(t,e,i){var o,n=u.prototype.addPoint.call(this,t,e,!0);return n&&(o=this.controlPoint(),this._points.push(o),delete this._controlPoint,i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2)),n},l.prototype.restorePoints=function(t,e,i){u.prototype.restorePoints.call(this,t,e,i),this._createPointProperty(2)},h.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,_;if(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,CanvasEx.setLineStyle(t,this._data.linestyle),e=this._data.points[0],i=this._data.points[1],2===this._data.points.length)t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.stroke(),this._data.leftend===u.LINEEND_ARROW&&f.prototype.drawArrow(i,e,t,t.lineWidth),this._data.rightend===u.LINEEND_ARROW&&f.prototype.drawArrow(e,i,t,t.lineWidth);else{if(o=this._data.points[2],n=this._data.points[3],s=n.substract(e),r=o.substract(s.scaled(.25)),a=o.add(s.scaled(.25)),l=i.substract(o),h=n.substract(l.scaled(.25)),c=n.add(l.scaled(.25)),this._data.fillBack&&this._data.points.length>2&&(t.fillStyle=y.generateColor(this._data.backcolor,this._data.transparency),t.beginPath(),t.moveTo(e.x,e.y),t.quadraticCurveTo(r.x,r.y,o.x,o.y),t.bezierCurveTo(a.x,a.y,h.x,h.y,n.x,n.y),t.quadraticCurveTo(c.x,c.y,i.x,i.y),t.fill()),t.beginPath(),this._data.extendLeftPoints.length>0)for(d=this._data.extendLeftPoints[this._data.extendLeftPoints.length-1],t.moveTo(d.x,d.y),p=this._data.extendLeftPoints.length-2;p>=0;p--)_=this._data.extendLeftPoints[p],t.lineTo(_.x,_.y);for(t.moveTo(e.x,e.y),t.quadraticCurveTo(r.x,r.y,o.x,o.y),t.bezierCurveTo(a.x,a.y,h.x,h.y,n.x,n.y),t.quadraticCurveTo(c.x,c.y,i.x,i.y),p=0;p<this._data.extendRightPoints.length;p++)_=this._data.extendRightPoints[p],t.lineTo(_.x,_.y);t.stroke(),this._data.leftend===u.LINEEND_ARROW&&f.prototype.drawArrow(r,e,t,t.lineWidth),this._data.rightend===u.LINEEND_ARROW&&f.prototype.drawArrow(c,i,t,t.lineWidth)}},h.prototype.hitTest=function(t){var e,i,s,r,a,l,h,c,d,u,_,f;if(4===this._data.points.length){if(e=this._data.points[0],i=this._data.points[1],s=this._data.points[2],r=this._data.points[3],a=r.substract(e),l=s.substract(a.scaled(.25)),h=s.add(a.scaled(.25)),c=i.substract(s),d=r.substract(c.scaled(.25)),u=r.add(c.scaled(.25)),o(s,e,l,t)||n(s,r,h,d,t)||o(r,i,u,t))return new m(m.MOVEPOINT);for(_=3,f=1;f<this._data.extendLeftPoints.length;f++)if(e=this._data.extendLeftPoints[f-1],i=this._data.extendLeftPoints[f],p.distanceToSegment(e,i,t).distance<_)return new m(m.MOVEPOINT);for(f=1;f<this._data.extendRightPoints.length;f++)if(e=this._data.extendRightPoints[f-1],i=this._data.extendRightPoints[f],p.distanceToSegment(e,i,t).distance<_)return new m(m.MOVEPOINT)}return null},inherit(c,_),c.prototype.update=function(){_.prototype.update.call(this),this._invalidated=!0},c.prototype.updateImpl=function(){var t,e,i,o,n,r,a,l,h,c;this._extendLeftPoints=[],this._extendRightPoints=[],this._source.points().length<4||(t=this._source.pointToScreenPoint(this._source.points()[0])[1],e=this._source.pointToScreenPoint(this._source.points()[1])[1],i=this._source.pointToScreenPoint(this._source.points()[2])[1],o=this._source.pointToScreenPoint(this._source.points()[3])[1],n=o.substract(t),r=i.substract(n.scaled(.25)),a=e.substract(i),l=o.add(a.scaled(.25)),h=this._model.timeScale().width(),c=this._source.priceScale().height(),this._source.properties().extendLeft.value()&&(this._extendLeftPoints=s(i,t,r,h,c)),this._source.properties().extendRight.value()&&(this._extendRightPoints=s(o,e,l,h,c)))},c.prototype.renderer=function(){var t,e,i,o;return this._points.length<2?new g:(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=[].concat(this._points),this._source._controlPoints&&(t.push(this._source.pointToScreenPoint(this._source._controlPoints[0])[0]),t.push(this._source.pointToScreenPoint(this._source._controlPoints[1])[0])),e={},i=this._source.properties(),e.points=t,e.color=i.linecolor.value(),e.linewidth=i.linewidth.value(),e.linestyle=i.linestyle.value(),e.leftend=i.leftEnd.value(),e.rightend=i.rightEnd.value(),e.fillBack=i.fillBackground.value(),e.backcolor=i.backgroundColor.value(),e.transparency=i.transparency.value(),e.extendLeftPoints=this._extendLeftPoints,e.extendRightPoints=this._extendRightPoints,o=new g,o.append(new h(e)),this.addAnchors(o),o)},inherit(d,u),d.prototype.pointsCount=function(){return 2},d.prototype.title=function(){return"Double Curve"},d.prototype.controlPoints=function(){var t=this.pointToScreenPoint(this.points()[0])[0],e=this.pointToScreenPoint(this.points()[1])[0],i=e.substract(t).scaled(.5),o=i.transponed().scaled(.3),n=t.add(e).scaled(.33),s=t.add(e).scaled(.67),r=n.add(o),a=s.substract(o);return[this.screenPointToPoint(r),this.screenPointToPoint(a)]},d.prototype.setLastPoint=function(t,e){u.prototype.setLastPoint.call(this,t,e),this._controlPoints=this.controlPoints()},d.prototype.addPoint=function(t,e,i){var o,n=u.prototype.addPoint.call(this,t,e,!0);return n&&(o=this.controlPoints(),delete this._controlPoints,this._points.push(o[0]),this._points.push(o[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)),n},d.prototype.restorePoints=function(t,e,i){u.prototype.restorePoints.call(this,t,e,i),this._createPointProperty(2),this._createPointProperty(3)},e.LineToolBezierQuadro=l,e.LineToolBezierCubic=d},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolArrow";var i=e||new s("linetoolarrow");n.call(this,t,i)}var n=i(152).LineToolTrendLine,s=i(91).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Arrow"},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolRay";var i=e||new s("linetoolray");n.call(this,t,i)}var n=i(152).LineToolTrendLine,s=i(91).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Ray"},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolExtended";var i=e||new s("linetoolextended");n.call(this,t,i)}var n=i(152).LineToolTrendLine,s=i(91).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Extended Line"},t.exports=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork");s.call(this,t,i),this._constructor="LineToolSchiffPitchfork"}var n=i(148),s=i(202).LineToolPitchfork;inherit(o,s),o.prototype.title=function(){return $.t("Modified Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},t.exports=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork2");s.call(this,t,i),this._constructor="LineToolSchiffPitchfork2"}var n=i(148),s=i(202).LineToolPitchfork;inherit(o,s),o.prototype.title=function(){return $.t("Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},t.exports=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolinsidepitchfork");s.call(this,t,i),this._constructor="LineToolInsidePitchfork"}var n=i(148),s=i(202).LineToolPitchfork;inherit(o,s),o.prototype.title=function(){return $.t("Inside Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFlagMark";var i=e||new a("linetoolflagmark");s.call(this,t,new r(this,t,this.image,25,25,-8,-21),i),this._paneViews[0].setAnchors(new n.Point(0,0))}var n=i(30),s=i(82).LineDataSource,r=i(198),a=i(91).DefaultProperty;inherit(o,s),o.prototype.image=new Image,o.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=",o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Flag Mark"},o.prototype.version=2,o.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new n.Point(9,21)))},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t){this._line=t,this._data={bodyText:"position",quantityText:"0"}}function n(t,e){c.call(this,t,e)}function s(t,e){h.call(this,t,e),this._rendererCache={}}function r(t,e){this._adapter=new o(this),this._constructor="LineToolPosition";var i=e||new _("linetoolposition");a.call(this,t,new s(this,t),i)}var a=i(163),l=i(82).LineDataSource,h=i(123),c=i(82).LineToolPriceAxisView,d=i(200),p=i(113),u=i(183).Rect,_=i(91).DefaultProperty;o.prototype.getPrice=function(){return this._line.points()[0].price},o.prototype.setPrice=function(t){var e=this._line.points()[0];return e.price=t,this._line._points[0]=e,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw(),this},o.prototype.getText=function(){return this._data.bodyText},o.prototype.setText=function(t){return this._data.bodyText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},o.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},o.prototype.getQuantity=function(){return this._data.quantityText},o.prototype.setQuantity=function(t){return this._data.quantityText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.getExtendLeft=function(){var t=this._line.properties().extendLeft.value();return"inherit"===t?this._line._model.properties().tradingProperties.extendLeft.value():t},o.prototype.setExtendLeft=function(t){return this._line.properties().extendLeft.setValue(t),this},o.prototype.getLineLength=function(){var t=this._line.properties().lineLength.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineLength.value():t},o.prototype.setLineLength=function(t){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(t,100))),this},o.prototype.getLineColor=function(){return d.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},o.prototype.setLineColor=function(t){return d.setColorToProperties(t,this._line.properties().lineColor,this._line.properties().lineTransparency),this},o.prototype.getLineStyle=function(){var t=this._line.properties().lineStyle.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineStyle.value():t},o.prototype.setLineStyle=function(t){return this._line.properties().lineStyle.setValue(t),this},o.prototype.getLineWidth=function(){var t=this._line.properties().lineWidth.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineWidth.value():t},o.prototype.setLineWidth=function(t){return this._line.properties().lineWidth.setValue(t),this},o.prototype.getBodyBorderColor=function(){return d.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},o.prototype.setBodyBorderColor=function(t){return d.setColorToProperties(t,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},o.prototype.getBodyBackgroundColor=function(){return d.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},o.prototype.setBodyBackgroundColor=function(t){return d.setColorToProperties(t,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},o.prototype.getBodyTextColor=function(){return d.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},o.prototype.setBodyTextColor=function(t){return d.setColorToProperties(t,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},o.prototype.getBodyFont=function(){return d.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},o.prototype.setBodyFont=function(t){return d.setFontToProperties(t,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},o.prototype.getQuantityBorderColor=function(){return d.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},o.prototype.setQuantityBorderColor=function(t){return d.setColorToProperties(t,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},o.prototype.getQuantityBackgroundColor=function(){return d.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},o.prototype.setQuantityBackgroundColor=function(t){return d.setColorToProperties(t,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},o.prototype.getQuantityTextColor=function(){return d.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},o.prototype.setQuantityTextColor=function(t){return d.setColorToProperties(t,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},o.prototype.getQuantityFont=function(){return d.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},o.prototype.setQuantityFont=function(t){return d.setFontToProperties(t,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},o.prototype.getReverseButtonBorderColor=function(){return d.getColorFromProperties(this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency)},o.prototype.setReverseButtonBorderColor=function(t){return d.setColorToProperties(t,this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency),this},o.prototype.getReverseButtonBackgroundColor=function(){return d.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)},o.prototype.setReverseButtonBackgroundColor=function(t){return d.setColorToProperties(t,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency),this},o.prototype.getReverseButtonIconColor=function(){return d.getColorFromProperties(this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency)},o.prototype.setReverseButtonIconColor=function(t){return d.setColorToProperties(t,this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency),this},o.prototype.getCloseButtonBorderColor=function(){return d.getColorFromProperties(this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency)},o.prototype.setCloseButtonBorderColor=function(t){return d.setColorToProperties(t,this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency),this},o.prototype.getCloseButtonBackgroundColor=function(){return d.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)},o.prototype.setCloseButtonBackgroundColor=function(t){return d.setColorToProperties(t,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency),this},o.prototype.getCloseButtonIconColor=function(){return d.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)},o.prototype.setCloseButtonIconColor=function(t){return d.setColorToProperties(t,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency),this},o.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},o.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},o.prototype.isFunction=function(t){return"function"==typeof t},o.prototype.onReverse=function(t,e){return e?this.isFunction(e)&&(this._onReverseData=t,this._onReverseCallback=e):this.isFunction(t)&&(this._onReverseCallback=t),this},o.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)},o.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)},o.prototype.onClose=function(t,e){return e?this.isFunction(e)&&(this._onCloseData=t,this._onCloseCallback=e):this.isFunction(t)&&(this._onCloseCallback=t),this},o.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._onCloseCallback.call(this,this._onCloseData)},o.prototype.isOnCloseCallbackPresent=function(){return this.isFunction(this._onCloseCallback)},o.prototype.onModify=function(t,e){return e?this.isFunction(e)&&(this._onModifyData=t,this._onModifyCallback=e):this.isFunction(t)&&(this._onModifyCallback=t),this},o.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},o.prototype.onContextMenu=function(t,e){return e?this.isFunction(e)&&(this._onContextMenuData=t,this._onContextMenuCallback=e):this.isFunction(t)&&(this._onContextMenuCallback=t),this},o.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},o.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},TradingView.PositionRenderer=function(t,e,i){this._data=t,this._cache=e,this._adapter=i},TradingView.PositionRenderer.prototype._height=function(){return Math.max(20,1+Math.max(d.fontHeight(this._adapter.getBodyFont()),d.fontHeight(this._adapter.getQuantityFont())))},TradingView.PositionRenderer.prototype._bodyWidth=function(t){var e,i;return 0===this._adapter.getText().length?0:(t.save(),t.font=this._adapter.getBodyFont(),e=10,i=t.measureText(this._adapter.getText()).width,t.restore(),Math.round(e+i))},TradingView.PositionRenderer.prototype._quantityWidth=function(t){var e,i;return 0===this._adapter.getQuantity().length?0:(t.save(),t.font=this._adapter.getQuantityFont(),e=10,i=t.measureText(this._adapter.getQuantity()).width,t.restore(),Math.round(Math.max(this._height(),e+i)))},TradingView.PositionRenderer.prototype._reverseButtonWidth=function(){return this._adapter.isOnReverseCallbackPresent()?this._height():0},TradingView.PositionRenderer.prototype._closeButtonWidth=function(){return this._adapter.isOnCloseCallbackPresent()?this._height():0},TradingView.PositionRenderer.prototype._drawLines=function(t,e,i,o,n){t.save(),t.strokeStyle=this._adapter.getLineColor(),t.lineStyle=this._adapter.getLineStyle(),t.lineWidth=this._adapter.getLineWidth(),CanvasEx.drawLine(t,i,o,n,o),this._adapter.getExtendLeft()&&CanvasEx.drawLine(t,0,o,e,o),t.restore()},TradingView.PositionRenderer.prototype._drawBody=function(t,e,i){var o,n;t.strokeStyle=this._adapter.getBodyBorderColor(),t.fillStyle=this._adapter.getBodyBackgroundColor(),o=this._bodyWidth(t),n=this._height(),t.fillRect(e+.5,i+.5,o-1,n-1),t.strokeRect(e,i,o,n)},TradingView.PositionRenderer.prototype._drawBodyText=function(t,e,i){var o,n;t.save(),t.textAlign="center",t.textBaseline="middle",t.font=this._adapter.getBodyFont(),t.fillStyle=this._adapter.getBodyTextColor(),o=e+this._bodyWidth(t)/2,n=i+this._height()/2,t.fillText(this._adapter.getText(),o,n),t.restore()},TradingView.PositionRenderer.prototype._drawQuantity=function(t,e,i){var o,n;t.strokeStyle=this._adapter.getQuantityBorderColor(),t.fillStyle=this._adapter.getQuantityBackgroundColor(),o=this._quantityWidth(t),n=this._height(),t.fillRect(e+.5,i+.5,o-1,n-1),t.strokeRect(e,i,o,n)},TradingView.PositionRenderer.prototype._drawQuantityText=function(t,e,i){var o,n;t.save(),t.textAlign="center",t.textBaseline="middle",t.font=this._adapter.getQuantityFont(),t.fillStyle=this._adapter.getQuantityTextColor(),o=e+this._quantityWidth(t)/2,n=i+this._height()/2,t.fillText(this._adapter.getQuantity(),o,n),t.restore()},TradingView.PositionRenderer.prototype._drawReverseButton=function(t,e,i){var o,n,s,r,a,l,h;t.save(),t.strokeStyle=this._adapter.getReverseButtonBorderColor(),t.fillStyle=this._adapter.getReverseButtonBackgroundColor(),o=this._reverseButtonWidth(),n=this._height(),t.fillRect(e+.5,i+.5,o-1,n-1),t.strokeRect(e,i,o,n),t.strokeStyle=this._adapter.getReverseButtonIconColor(),s=function(t,e){CanvasEx.drawLine(t,0,0,0,e),CanvasEx.drawLine(t,-1,1,1,1),CanvasEx.drawLine(t,-2,2,2,2)},r=6,a=10,l=e+Math.round((this._reverseButtonWidth()-r)/2),h=i+5,t.save(),t.translate(l,h),s(t,a),t.translate(r,a),t.rotate(Math.PI),s(t,a),t.restore(),this._adapter._blocked&&(t.fillStyle="rgba(140, 140, 140, 0.75)",t.fillRect(e+.5,i+.5,o-1,n-1)),t.restore()},TradingView.PositionRenderer.prototype._drawCloseButton=function(t,e,i){var o,n,s,r,a,l,h;t.save(),t.strokeStyle=this._adapter.getCloseButtonBorderColor(),t.fillStyle=this._adapter.getCloseButtonBackgroundColor(),o=this._closeButtonWidth(),n=this._height(),t.fillRect(e+.5,i+.5,o-1,n-1),t.strokeRect(e,i,o,n),s=e+o,r=i+n,t.strokeStyle=this._adapter.getCloseButtonIconColor(),a=8,l=(this._closeButtonWidth()-a)/2,h=(this._height()-a)/2,CanvasEx.drawPoly(t,[{x:e+l,y:i+h},{x:s-l,y:r-h}],!0),CanvasEx.drawPoly(t,[{x:s-l,y:i+h},{x:e+l,y:r-h}],!0),this._adapter._blocked&&(t.fillStyle="rgba(140, 140, 140, 0.75)",t.fillRect(e+.5,i+.5,o-1,n-1)),t.restore()},TradingView.PositionRenderer.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d;!this._data.points||this._data.points.length<1||(e=this._data.width,i=this._bodyWidth(t),o=this._quantityWidth(t),n=this._reverseButtonWidth(t),s=i+o+n+this._closeButtonWidth(),r=e-s,a=Math.max(this._adapter.getLineLength()/100*e,1),l=Math.round(e-Math.min(r,a)),h=l-s,c=Math.round(this._data.points[0].y),d=Math.round(c-(this._height()+1)/2),this._cache.bodyRight=h+i,this._cache.quantityRight=this._cache.bodyRight+o,this._cache.reverseButtonRight=this._cache.quantityRight+n,this._cache.top=d,this._cache.bottom=d+this._height(),this._cache.left=h,this._cache.right=l,this._drawLines(t,h,l,c,e),0!==i&&(this._drawBody(t,h,d),this._drawBodyText(t,h,d)),0!==o&&(this._drawQuantity(t,this._cache.bodyRight,d),this._drawQuantityText(t,this._cache.bodyRight,d)),0!==n&&this._drawReverseButton(t,this._cache.quantityRight,d),0!==this._closeButtonWidth()&&this._drawCloseButton(t,this._cache.reverseButtonRight,d))},TradingView.PositionRenderer.prototype.hitTest=function(t){return 0===this._data.points.length?null:t.y<this._cache.top||t.y>this._cache.bottom||t.x<this._cache.left||this._cache.right<t.x?null:this._adapter._blocked?new p(p.CUSTOM,{}):t.x>=this._cache.bodyRight&&t.x<this._cache.quantityRight&&this._adapter._onModifyCallback?new p(p.CUSTOM,{mouseDownHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:$.t("Edit Position"),rect:new u(this._cache.bodyRight,this._cache.top,this._cache.quantityRight-this._cache.bodyRight,this._cache.bottom-this._cache.top)}}):t.x>=this._cache.quantityRight&&t.x<this._cache.reverseButtonRight?new p(p.CUSTOM,{mouseDownHandler:this._adapter.callOnReverse.bind(this._adapter),tooltip:{text:$.t("Reverse Position"),rect:new u(this._cache.quantityRight,this._cache.top,this._cache.reverseButtonRight-this._cache.quantityRight,this._cache.bottom-this._cache.top)}}):t.x>=this._cache.reverseButtonRight&&t.x<this._cache.right?new p(p.CUSTOM,{mouseDownHandler:this._adapter.callOnClose.bind(this._adapter),tooltip:{text:$.t("Close Position"),rect:new u(this._cache.reverseButtonRight,this._cache.top,this._cache.right-this._cache.reverseButtonRight,this._cache.bottom-this._cache.top)}}):new p(p.REGULAR,{mouseDownHandler:function(){}})},inherit(n,c),n.prototype._updateImpl=function(){c.prototype._updateImpl.call(this),this._background=this._linetool.properties().lineColor.value()},inherit(s,h),s.prototype.renderer=function(){var t={points:this._points,width:this._model.timeScale().width()};return new TradingView.PositionRenderer(t,this._rendererCache,this._source._adapter)},inherit(r,a),r.prototype.setPoint=function(t,e,i){this._points[t]=e,this.normalizePoints()},r.prototype.addPoint=function(t,e){return this._points.push(t),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},r.skipMagnetting=!0,r.prototype.title=function(){return"Position"},r.prototype.createPriceAxisView=function(t){return this._priceAxisView=new n(this,t),this._priceAxisView},r.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?l.prototype.paneViews.call(this,t):null},r.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?l.prototype.priceAxisViews.call(this,t,i):null},r.prototype.hasContextMenu=function(){return!0},r.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},t.exports=r}).call(e,i(1))},function(t,e,i){(function(e){"use strict";function o(t){this._line=t,this._data={bodyText:"order",quantityText:"0"},this._editable=!0}function n(t,e,i){this._data=t,this._cache=e,this._adapter=i}function s(t,e){h.call(this,t,e)}function r(t,e){p.call(this,t,e),this._rendererCache={}}function a(t,e){this._adapter=new o(this),this._constructor="LineToolOrder";var i=e||new f("linetoolorder");l.call(this,t,new r(this,t),i)}var l=i(163),h=i(82).LineToolPriceAxisView,c=i(200),d=i(82).LineDataSource,p=i(123),u=i(113),_=i(183).Rect,f=i(91).DefaultProperty;o.prototype.setEditable=function(t){return this._editable=t,this},o.prototype.getPrice=function(){return this._line.points()[0].price},o.prototype.setPrice=function(t){var e=this._line.points()[0];return e.price=t,this._line._points[0]=e,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw(),this},o.prototype.getText=function(){return this._data.bodyText},o.prototype.setText=function(t){return this._data.bodyText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},o.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},o.prototype.getQuantity=function(){return this._data.quantityText},o.prototype.setQuantity=function(t){return this._data.quantityText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.getExtendLeft=function(){var t=this._line.properties().extendLeft.value();return"inherit"===t?this._line._model.properties().tradingProperties.extendLeft.value():t},o.prototype.setExtendLeft=function(t){return this._line.properties().extendLeft.setValue(t),this},o.prototype.getLineLength=function(){var t=this._line.properties().lineLength.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineLength.value():t},o.prototype.setLineLength=function(t){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(t,100))),this},o.prototype.getLineColor=function(){return c.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},o.prototype.setLineColor=function(t){return c.setColorToProperties(t,this._line.properties().lineColor,this._line.properties().lineTransparency),this},o.prototype.getLineStyle=function(){var t=this._line.properties().lineStyle.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineStyle.value():t},o.prototype.setLineStyle=function(t){return this._line.properties().lineStyle.setValue(t),this},o.prototype.getLineWidth=function(){var t=this._line.properties().lineWidth.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineWidth.value():t},o.prototype.setLineWidth=function(t){return this._line.properties().lineWidth.setValue(t),this},o.prototype.getBodyBorderColor=function(){return c.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},o.prototype.setBodyBorderColor=function(t){return c.setColorToProperties(t,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},o.prototype.getBodyBackgroundColor=function(){return c.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},o.prototype.setBodyBackgroundColor=function(t){return c.setColorToProperties(t,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},o.prototype.getBodyTextColor=function(){return c.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},o.prototype.setBodyTextColor=function(t){return c.setColorToProperties(t,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},o.prototype.getBodyFont=function(){return c.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},o.prototype.setBodyFont=function(t){return c.setFontToProperties(t,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},o.prototype.getQuantityBorderColor=function(){return c.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},o.prototype.setQuantityBorderColor=function(t){return c.setColorToProperties(t,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},o.prototype.getQuantityBackgroundColor=function(){return c.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},o.prototype.setQuantityBackgroundColor=function(t){return c.setColorToProperties(t,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},o.prototype.getQuantityTextColor=function(){return c.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},o.prototype.setQuantityTextColor=function(t){return c.setColorToProperties(t,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},o.prototype.getQuantityFont=function(){return c.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},o.prototype.setQuantityFont=function(t){return c.setFontToProperties(t,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},o.prototype.getCancelButtonBorderColor=function(){return c.getColorFromProperties(this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency)},o.prototype.setCancelButtonBorderColor=function(t){return c.setColorToProperties(t,this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency),this},o.prototype.getCancelButtonBackgroundColor=function(){return c.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)},o.prototype.setCancelButtonBackgroundColor=function(t){return c.setColorToProperties(t,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency),this},o.prototype.getCancelButtonIconColor=function(){return c.getColorFromProperties(this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency)},o.prototype.setCancelButtonIconColor=function(t){return c.setColorToProperties(t,this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency),this},o.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},o.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},o.prototype.isFunction=function(t){return"function"==typeof t},o.prototype.onCancel=function(t,e){return e?this.isFunction(e)&&(this._onCancelData=t,this._onCancelCallback=e):this.isFunction(t)&&(this._onCancelCallback=t),this},o.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)},o.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)},o.prototype.onModify=function(t,e){return e?this.isFunction(e)&&(this._onModifyData=t,this._onModifyCallback=e):this.isFunction(t)&&(this._onModifyCallback=t),this},o.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},o.prototype.onMove=function(t,e){return e?this.isFunction(e)&&(this._onMoveData=t,this._onMoveCallback=e):this.isFunction(t)&&(this._onMoveCallback=t),this},o.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)},o.prototype.onContextMenu=function(t,e){return e?this.isFunction(e)&&(this._onContextMenuData=t,this._onContextMenuCallback=e):this.isFunction(t)&&(this._onContextMenuCallback=t),this},o.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},o.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},n.prototype._height=function(){return Math.max(20,1+Math.max(c.fontHeight(this._adapter.getBodyFont()),c.fontHeight(this._adapter.getQuantityFont())))},n.prototype._bodyWidth=function(t){var e,i,o;return 0===this._adapter.getText().length?0:(t.save(),t.font=this._adapter.getBodyFont(),e=10,i=10,o=t.measureText(this._adapter.getText()).width,t.restore(),Math.round(e+i+o))},n.prototype._quantityWidth=function(t){var e,i;return 0===this._adapter.getQuantity().length?0:(t.save(),t.font=this._adapter.getQuantityFont(),e=10,i=t.measureText(this._adapter.getQuantity()).width,t.restore(),Math.round(Math.max(this._height(),e+i)))},n.prototype._cancelButtonWidth=function(){return this._adapter.isOnCancelCallbackPresent()?this._height():0},n.prototype._drawLines=function(t,e,i,o,n){t.save(),t.strokeStyle=this._adapter.getLineColor(),t.lineStyle=this._adapter.getLineStyle(),t.lineWidth=this._adapter.getLineWidth(),CanvasEx.drawLine(t,i,o,n,o),this._adapter.getExtendLeft()&&CanvasEx.drawLine(t,0,o,e,o),t.restore()},n.prototype._drawMovePoints=function(t,e,i){var o,n,s,r,a,l,h,c;for(t.save(),t.strokeStyle=this._adapter.getBodyBorderColor(),t.fillStyle=this._adapter.getBodyBorderColor(),o=2,n=4,s=5,r=e+n,a=r+o,l=Math.floor((this._height()-2*s)/2)+1,h=0;h<l;++h)c=i+s+2*h,CanvasEx.drawLine(t,r,c,a,c);t.restore()},n.prototype._drawBody=function(t,e,i){var o,n;t.strokeStyle=this._adapter.getBodyBorderColor(),t.fillStyle=this._adapter.getBodyBackgroundColor(),o=this._bodyWidth(t),n=this._height(),t.fillRect(e+.5,i+.5,o-1,n-1),t.strokeRect(e,i,o,n)},n.prototype._drawBodyText=function(t,e,i){var o,n,s;t.textAlign="center",t.textBaseline="middle",t.font=this._adapter.getBodyFont(),t.fillStyle=this._adapter.getBodyTextColor(),o=5,n=e+this._bodyWidth(t)/2,s=i+this._height()/2,t.fillText(this._adapter.getText(),o+n-2,s)},n.prototype._drawQuantity=function(t,e,i,o){var n,s;t.save(),t.strokeStyle=this._adapter.getQuantityBorderColor(),t.fillStyle=this._adapter.getQuantityBackgroundColor(),n=this._quantityWidth(t),s=this._height(),t.fillRect(e+.5,i+.5,n-1,s-1),o&&t.clip&&(t.beginPath(),t.rect(e+.5,i-.5,n+1,s+1),t.clip()),t.strokeRect(e,i,n,s),t.restore()},n.prototype._drawQuantityText=function(t,e,i){var o,n;t.save(),t.textAlign="center",t.textBaseline="middle",t.font=this._adapter.getQuantityFont(),t.fillStyle=this._adapter.getQuantityTextColor(),o=e+this._quantityWidth(t)/2,n=i+this._height()/2,t.fillText(this._adapter.getQuantity(),o,n),t.restore()},n.prototype._drawCancelButton=function(t,e,i,o){var n,s,r,a,l,h,c;t.strokeStyle=this._adapter.getCancelButtonBorderColor(),t.fillStyle=this._adapter.getCancelButtonBackgroundColor(),n=this._cancelButtonWidth(),s=this._height(),t.fillRect(e+.5,i+.5,n-1,s-1),this._adapter._blocked&&(t.fillStyle="rgba(140, 140, 140, 0.75)",t.fillRect(e+.5,i+.5,n-1,s-1)),t.save(),o&&t.clip&&(t.beginPath(),t.rect(e+.5,i-.5,n+1,s+1),t.clip()),t.strokeRect(e,i,n,s),t.restore(),r=e+n,a=i+s,t.strokeStyle=this._adapter.getCancelButtonIconColor(),l=8,h=(this._cancelButtonWidth()-l)/2,c=(this._height()-l)/2,CanvasEx.drawPoly(t,[{x:e+h,y:i+c},{x:r-h,y:a-c}],!0),CanvasEx.drawPoly(t,[{x:r-h,y:i+c},{x:e+h,y:a-c}],!0)},n.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d;!this._data.points||this._data.points.length<1||(e=this._data.width,i=this._bodyWidth(t),o=this._quantityWidth(t),n=i+o+this._cancelButtonWidth(),s=e-n,r=Math.max(this._adapter.getLineLength()/100*e,1),a=Math.round(e-Math.min(s,r)),l=a-n,h=Math.round(this._data.points[0].y),c=Math.round(h-(this._height()+1)/2),this._cache.bodyRight=l+i,this._cache.quantityRight=l+i+o,this._cache.top=c,this._cache.bottom=c+this._height(),this._cache.left=l,this._cache.right=a,this._drawLines(t,l,a,h,e),d=!1,0!==i&&(this._drawBody(t,l,c),this._drawMovePoints(t,l,c),this._drawBodyText(t,l,c),d=!0),0!==o&&(this._drawQuantity(t,l+i,c,d),this._drawQuantityText(t,l+i,c),d=!0),0!==this._cancelButtonWidth()&&this._drawCancelButton(t,l+i+o,c,d))},n.prototype.hitTest=function(t){return 0===this._data.points.length?null:t.y<this._cache.top||t.y>this._cache.bottom?null:this._adapter._blocked&&t.x>=this._cache.left&&t.x<this._cache.right?new u(u.CUSTOM,{}):this._adapter._editable&&t.x>=this._cache.left&&t.x<this._cache.bodyRight?0===this._adapter.getTooltip().length?new u(u.MOVEPOINT):new u(u.MOVEPOINT,{tooltip:{text:this._adapter.getTooltip(),rect:new _(this._cache.left,this._cache.top,this._cache.bodyRight-this._cache.left,this._cache.bottom-this._cache.top)}}):this._adapter._editable&&t.x>=this._cache.bodyRight&&t.x<this._cache.quantityRight?new u(u.CUSTOM,{mouseDownHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:$.t("Edit Order"),rect:new _(this._cache.bodyRight,this._cache.top,this._cache.quantityRight-this._cache.bodyRight,this._cache.bottom-this._cache.top)}}):this._adapter._editable&&t.x>=this._cache.quantityRight&&t.x<this._cache.right?new u(u.CUSTOM,{mouseDownHandler:this._adapter.callOnCancel.bind(this._adapter),tooltip:{text:$.t("Cancel Order"),rect:new _(this._cache.quantityRight,this._cache.top,this._cache.right-this._cache.quantityRight,this._cache.bottom-this._cache.top)}}):null},inherit(s,h),s.prototype._updateImpl=function(){h.prototype._updateImpl.call(this),this._background=this._linetool.properties().lineColor.value()},inherit(r,p),r.prototype.renderer=function(){return new n({points:this._points,width:this._model.timeScale().width()},this._rendererCache,this._source._adapter)},inherit(a,l),a.skipMagnetting=!0,a.prototype.setPoint=function(t,e,i){this._points[t]=e,this.normalizePoints()},a.prototype.addPoint=function(t,e){return this._points.push(t),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},a.prototype.title=function(){return"Order"},a.prototype.endMoving=function(t){var e=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.price!==this._currentMovingPoint.price;l.prototype.endMoving.call(this),!t&&e&&this._adapter.callOnMove()},a.prototype.createPriceAxisView=function(t){return this._priceAxisView=new s(this,t),this._priceAxisView},a.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?d.prototype.paneViews.call(this,t):null},a.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?d.prototype.priceAxisViews.call(this,t,i):null},a.prototype.hasContextMenu=function(){return!0},a.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},a.prototype.onlyYMoving=function(){return!0},t.exports=a}).call(e,i(1))},function(t,e,i){"use strict";for(var o={StudyStrategy:i(244),StatusView:i(179),StudyLineDataSource:i(165).StudyLineDataSource,StudyLineDataSourcePaneView:i(165).StudyLineDataSourcePaneView,StudyVersioning:i(168),StudyMigration:i(169),study_Overlay:i(246).study_Overlay,study_Compare:i(247),study_ScriptWithDataOffset:i(248),StudyPaneView:i(174).StudyPaneView,StudyBackgroundPaneView:i(174).StudyBackgroundPaneView,StudyPlotShapesPaneView:i(174).StudyPlotShapesPaneView,StudyPlotCharsPaneView:i(174).StudyPlotCharsPaneView,StudyPlotArrowsPaneView:i(174).StudyPlotArrowsPaneView,StudyPlotCandlesPaneView:i(174).StudyPlotCandlesPaneView,StudyStrategyOrdersPaneView:i(245),StudyPriceAxisView:i(173),StudyDataWindowView:i(178).StudyDataWindowView,DataVendorStudyDataWindowView:i(178).DataVendorStudyDataWindowView,LineStudyMtpAnalysis:i(249),LineStudyMtpDecisionPoint:i(250),LineStudyMtpRiskReward:i(251),LineStudyMtpElliotWaveMain:i(252).LineStudyMtpElliotWaveMain,LineStudyMtpElliotWaveMajor:i(252).LineStudyMtpElliotWaveMajor,LineStudyMtpElliotWaveMinor:i(252).LineStudyMtpElliotWaveMinor,LineStudyMtpDownWave1OrA:i(253).LineStudyMtpDownWave1OrA,LineStudyMtpDownWave2OrB:i(253).LineStudyMtpDownWave2OrB,LineStudyMtpDownWave3:i(253).LineStudyMtpDownWave3,LineStudyMtpDownWave4:i(253).LineStudyMtpDownWave4,LineStudyMtpDownWave5:i(253).LineStudyMtpDownWave5,LineStudyMtpDownWaveC:i(253).LineStudyMtpDownWaveC,LineStudyMtpUpWave1OrA:i(253).LineStudyMtpUpWave1OrA,LineStudyMtpUpWave2OrB:i(253).LineStudyMtpUpWave2OrB,LineStudyMtpUpWave3:i(253).LineStudyMtpUpWave3,LineStudyMtpUpWave4:i(253).LineStudyMtpUpWave4,LineStudyMtpUpWave5:i(253).LineStudyMtpUpWave5,LineStudyMtpUpWaveC:i(253).LineStudyMtpUpWaveC},n=Object.keys(o),s=n.length;s--;)TradingView[n[s]]=o[n[s]];t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,i,o,s){n.call(this,t,i,o,s),this._barsIndexes=[],this._reportDataBuffer=null,this._reportData=null,this.watchedData=new e,this.model().addStrategySource(this)}var n=i(171).Study,s=i(245);inherit(o,n),o.prototype.stop=function(){if(n.prototype.stop.call(this),this._avoidRemoveStrategySource)return void delete this._avoidRemoveStrategySource;this.model().removeStrategySource(this)},o.prototype.start=function(){this.model().addStrategySource(this),n.prototype.start.call(this)},o.prototype.processHibernate=function(){this._studyId&&!this.isVisible()&&(this._avoidRemoveStrategySource=!0),n.prototype.processHibernate.call(this)},o.prototype.onData=function(t){var e=this;n.prototype.onData.call(this,t).then(function(){var i,o,n,s;t.method&&"data_update"===t.method&&(i=t.params&&t.params.nonseries&&t.params.nonseries.d,o=i&&i.data&&i.data.report,o?(i.isUpdate&&e._reportDataBuffer&&(o=$.extend(e._reportDataBuffer,o)),e._reportDataBuffer=e._reportData=$.extend(e._reportDataBuffer||{},o)):(n=$.extend({},t),$.extend(!0,n,{params:{nonseries:{d:{data:{report:e._reportDataBuffer}}}}}),t=n),"nochange"!==(s=t.params&&t.params.nonseries&&t.params.nonseries.indexes)&&s instanceof Array&&s.length&&e._collateBarsIndexes(s)),e.watchedData.setValue(t)})},o.prototype._collateBarsIndexes=function(t){var e,i;if(Array.isArray(t)&&(e=this._reportData&&this._reportData.filledOrders)&&e.length)for(this._barsIndexes.length=0,i=0;i<e.length;i++)this._barsIndexes[i]=t[e[i].tm]},o.prototype.reportData=function(){return this._reportData},o.prototype.ordersData=function(){return this._reportData&&this._reportData.filledOrders},o.prototype.barsIndexes=function(){return this._barsIndexes},o.prototype.clearData=function(){n.prototype.clearData.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.clearItems()},o.prototype.restoreData=function(t){n.prototype.restoreData.apply(this,arguments),this.model().addStrategySource(this),t.reportData&&t.barsIndexes&&(this._reportData=t.reportData,this._barsIndexes=t.barsIndexes,this.watchedData.setValue({method:"data_update",params:{nonseries:{d:{data:{report:this._reportData}}}}})),t.activeState&&(this._activeState=!0)},o.prototype.activeState=function(){return this._activeState},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.update()},o.prototype.createViews=function(){n.prototype.createViews.call(this),this._strategyOrdersPaneView=new s(this,this._series,this._model)},o.prototype.state=function(t){var e=n.prototype.state.apply(this,arguments);return t&&this._reportData&&this._barsIndexes&&(e.data||(e.data={}),e.data.reportData=this._reportData,e.data.barsIndexes=this._barsIndexes,e.data.activeState=this.model().activeStrategySource().value()===this),e},t.exports=o}).call(e,i(90))},function(t,e,i){"use strict";function o(t,e,i){this._study=t,this._series=e,this._model=i,this._invalidated=!0,this._orderArrow={vMargin:o.DEFAULT_ORDER_ARROW_VMARGIN,width:o.DEFAULT_ORDER_ARROW_WIDTH,height:o.DEFAULT_ORDER_ARROW_HEIGHT},this._exitLineWidth=o.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH,this._priceArrow={width:o.DEFAULT_PRICE_ARROW_WIDTH,height:o.DEFAULT_PRICE_ARROW_HEIGHT},this._text={vMargin:o.DEFAULT_TEXT_VMARGIN,font:o.DEFAULT_FONT,fontSize:o.DEFAULT_FONT_SIZE},this._checkHideTextIfBarSpacingLT=o.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT,this._textIsVisible=!0,this._colors={entryBuy:o.DEFAULT_ENTRY_BUY_COLOR,entrySell:o.DEFAULT_ENTRY_SELL_COLOR,exit:o.DEFAULT_EXIT_COLOR},this._items={entryBuy:[],entrySell:[],exit:[]},this._textWidths={},this._study.properties().strategy.orders.subscribe(this,this.update)}var n=i(30),s=i(114).PaneRendererStudyStrategyOrders,r=i(117);o.DEFAULT_ORDER_ARROW_VMARGIN=7,o.DEFAULT_ORDER_ARROW_WIDTH=9,o.DEFAULT_ORDER_ARROW_HEIGHT=11,o.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH=2,o.DEFAULT_PRICE_ARROW_WIDTH=5,o.DEFAULT_PRICE_ARROW_HEIGHT=9,o.DEFAULT_TEXT_VMARGIN=2,o.DEFAULT_FONT="Arial",o.DEFAULT_FONT_SIZE=10,o.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT=10,o.DEFAULT_ENTRY_BUY_COLOR="#008fff",o.DEFAULT_ENTRY_SELL_COLOR="#f00",o.DEFAULT_EXIT_COLOR="#cc47ed",o.prototype._updateImpl=function(){var t,e,i,o,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P;if(this.clearItems(),(t=this._study.ordersData())&&t.length&&(e=this._model.timeScale(),i=this._series.priceScale(),!(!e||!i||e&&e.isEmpty()||i&&i.isEmpty()||(o=e.visibleBars().clone(),o.isEmpty())))){for(s=this._study.barsIndexes(),r=this._series.nearestIndex(o.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),a=this._series.nearestIndex(o.lastBar(),TradingView.SEARCH_NEAREST_LEFT),l=r,h=[],c=[];l<=a;l++)for(d=-1;(d=s.indexOf(l,d+1))!==-1;)(p=t[d])&&(h.push(p),c.push(l));for(u=this._study.properties(),_=u.strategy.orders.showLabels.value(),f=u.strategy.orders.showQty.value(),m=_||f,m&&e.barSpacing()<this._checkHideTextIfBarSpacingLT&&this._orderArrow.width*h.length*2>e.width()&&(m=!1),g=m&&this._text.fontSize+this._text.vMargin||0,v=g&&g*(_+f),y=0,b={upper:[],lower:[]};y<h.length;y++)p=h[y],d=c[y],w=e.indexToCoordinate(d,!0),S=i.priceToCoordinate(this._series[p.b?"low":"high"](d),!0),T=p.b?"lower":"upper",C="number"==typeof b[T][d]&&b[T][d]||0,S+=p.b?C:-C,"number"!=typeof b[T][d]&&(b[T][d]=0),b[T][d]+=(p.e?0:this._exitLineWidth)+this._orderArrow.vMargin+this._orderArrow.height+v,x=i.priceToCoordinate(p.p,!0),P=p.e?!p.b&&p.e?"entrySell":"entryBuy":"exit",this._items[P].push({orderPoint:new n.Point(w,S),pricePoint:new n.Point(w,x),label:_&&(p.c||p.id||"Untitled")||null,qty:f&&(p.b?"+":"-")+~~p.q||null,pos:T});this._textLabelIsVisible=_,this._textQtyIsVisible=f,this._textIsVisible=m}},o.prototype.update=function(){this._invalidated=!0},o.prototype.clearItems=function(){this._items.entryBuy.length=this._items.entrySell.length=this._items.exit.length=0},o.prototype.renderer=function(){var t,e,i,o=this._study.properties();if(o.visible.value()&&o.strategy.orders.visible.value()&&(t=this._series.priceScale(),(this._invalidated||t&&t.isScaled())&&(this._updateImpl(),this._invalidated=!1),this._items.entryBuy.length||this._items.entrySell.length||this._items.exit.length)){e=new r;for(i in this._items)this._items[i].length&&e.append(new s({items:this._items[i],color:this._colors[i],orderArrow:this._orderArrow,exitLineWidth:"exit"===i&&this._exitLineWidth||0,priceArrow:this._priceArrow,text:this._textIsVisible&&this._text||null},this._textWidths));return e}},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._source=t,this._model=e,this._points=[new a.Point(0,0)]}function n(t,e){this._source=t,this._model=e,this._invalidated=!0,this._text="",this._coordinate=0,this._background="black",this._color="white"}function s(t,e){b.call(this),this._study=t,this._model=e,this._items.push(new w("Open","")),this._items.push(new w("High","")),this._items.push(new w("Low","")),this._items.push(new w("Close","")),this._invalidated=!0,this.update()}function r(t,e,i,o){this._symbolLabelView=new C(t,this,"close","symbol","showSymbolLabels"),h.call(this,t,e,i,o),this._formatter=null,this._paneView=null;var n=this;this.properties().minTick.listeners().subscribe(null,function(){n._createFormatter(),n.updateAllViews(),n._model.invalidate(new L(L.FULL_UPDATE))})}var a=i(30),l=i(102),h=i(171).Study,c=i(84),d=i(86),p=i(111),u=p.SeriesAreaPaneView,_=p.SeriesLinePaneView,f=p.SeriesHollowCandlesPaneView,m=p.SeriesCandlesPaneView,g=p.SeriesBarsPaneView,v=i(179),y=i(109),b=y.DataWindowView,w=y.DataWindowItem,S=i(121).SeriesBarColorer,T=i(122).HorzLineRenderer,C=i(126),x=i(113),P=i(131),L=i(99),k=i(94),I=k.PriceFormatter;o.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var t=this._source.lastValueData("close",!0);t.noData||(this._visible=!0,this._points=[new a.Point(0,t.coordinate)],this._color=t.color)}},o.prototype.renderer=function(){var t={};return t.points=this._points,t.color=this._color,t.linewidth=1,t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.hitTestResult=x.REGULAR,t.visible=this._visible,new T(t)},inherit(n,c),n.prototype.update=function(){this._invalidated=!0},n.prototype.coordinate=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),c.prototype.coordinate.call(this)},n.prototype._updateImpl=function(){this._visible=!1,this._text="";var t=this._source.lastValueData("close",!1);t.noData||(this._text=t.text,this._floatCoordinate=t.floatCoordinate,this._coordinate=t.coordinate,this._background=t.color,this._visible=!0)},n.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),new d({text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,visible:this._visible})},inherit(s,b),s.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,h,c,d,p;if(this._header=this._study.title(),!this._model.timeScale().isEmpty()&&0!==this._study.data().length){if(i=!1,this._study.properties().style.value()===l.STYLE_BARS?(t=this._study.properties().barStyle.upColor.value(),e=this._study.properties().barStyle.downColor.value(),i=this._study.properties().barStyle.barColorsOnPrevClose.value()):this._study.properties().style.value()===l.STYLE_CANDLES?(t=this._study.properties().candleStyle.upColor.value(),e=this._study.properties().candleStyle.downColor.value(),i=this._study.properties().candleStyle.barColorsOnPrevClose.value()):this._study.properties().style.value()===l.STYLE_HOLLOW_CANDLES?(t=this._study.properties().hollowCandleStyle.upColor.value(),e=this._study.properties().hollowCandleStyle.downColor.value(),i=!0):this._study.properties().style.value()===l.STYLE_LINE?t=e=this._study.properties().lineStyle.color.value():this._study.properties().style.value()===l.STYLE_AREA&&(t=e=this._study.properties().areaStyle.linecolor.value()),o=this._study.series(),n=this._model.crossHairSource().appliedIndex(),void 0!==(s=o.nearestIndex(n,TradingView.SEARCH_NEAREST_LEFT))){if(!((r=this._study.data().valueAt(s))&&r[TradingView.OPEN_PLOT]&&r[TradingView.HIGH_PLOT]&&r[TradingView.LOW_PLOT]&&r[TradingView.CLOSE_PLOT]))return;for(a=this._study.formatter(),this._items[0].setValue(a.format(r[TradingView.OPEN_PLOT])),this._items[1].setValue(a.format(r[TradingView.HIGH_PLOT])),this._items[2].setValue(a.format(r[TradingView.LOW_PLOT])),this._items[3].setValue(a.format(r[TradingView.CLOSE_PLOT])),i&&s>=1?(c=this._study.data().valueAt(s-1),h=c[TradingView.CLOSE_PLOT]<=r[TradingView.CLOSE_PLOT]?t:e):h=r[TradingView.OPEN_PLOT]<=r[TradingView.CLOSE_PLOT]?t:e,d=0;d<4;d++)this._items[d].setColor(h)}p=P(this._study.symbolInfo()),this._additional=p?"(Data Provided by "+p+")":void 0}},s.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},s.prototype.update=function(){this._invalidated=!0},s.prototype.additional=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._additional},inherit(r,h),r.prototype.createPlotLabels=function(t){},r.prototype.symbol=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[e]:null;return t=i?i.name:e,t.toUpperCase()},r.prototype.lastValueData=function(t,e){var i,o,n=h.prototype.lastValueData.call(this,"close",e);if(n.noData)return n;switch(i=this.properties(),o=n.item,i.style.value()){case l.STYLE_BARS:n.color=o[TradingView.OPEN_PLOT]<=o[TradingView.CLOSE_PLOT]?i.barStyle.upColor.value():i.barStyle.downColor.value();break;case l.STYLE_CANDLES:n.color=o[TradingView.OPEN_PLOT]<=o[TradingView.CLOSE_PLOT]?i.candleStyle.upColor.value():i.candleStyle.downColor.value();break;case l.STYLE_HOLLOW_CANDLES:n.color=o[TradingView.OPEN_PLOT]<=o[TradingView.CLOSE_PLOT]?i.candleStyle.upColor.value():i.candleStyle.downColor.value();break;case l.STYLE_LINE:n.color=i.lineStyle.color.value();break;case l.STYLE_AREA:n.color=i.areaStyle.color1.value()}return n},r.prototype.createViews=function(){this._priceAxisViews=[],this._priceAxisViewsBase=[new n(this,this._model)],this._paneViews=[];var t=null;switch(this._properties.style.value()){case l.STYLE_BARS:t=new g(this,this._model);break;case l.STYLE_CANDLES:t=new m(this,this._model);break;case l.STYLE_HOLLOW_CANDLES:t=new f(this,this._model);break;case l.STYLE_LINE:t=new _(this,this._properties.lineStyle.priceSource.value(),this._model);break;case l.STYLE_AREA:t=new u(this,this._properties.areaStyle.priceSource.value(),this._model)}t&&this._paneViews.push(t),this._paneViews.push(new o(this,this._model)),this._paneViews.push(this._symbolLabelView),this._dataWindowView||(this._dataWindowView=new s(this,this._model)),this._statusView||(this._statusView=new v(this)),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},r.prototype.barColorer=function(){return new S(this)},r.prototype.start=function(t){this._formatter=null,h.prototype.start.apply(this,arguments),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype._createFormatter=function(){var t,e,i,o,n,s,r;"default"===this.properties().minTick.value()?(t=this.properties().inputs.symbol.value(),e=this._resolvedSymbols[t],this._formatter=new I(e?e.pricescale:100,e?e.minmov:1,!!e&&e.fractional)):(i=this.properties().minTick.value(),o=isNumber(i)?["100","1","false"]:i.split(","),n=parseInt(o[0]),s=parseInt(o[1]),r="true"===o[2],this._formatter=new I(n,s,r)),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype.formatter=function(){return this._formatter||this._createFormatter(),this._formatter},r.prototype._changeInputs=function(){h.prototype._changeInputs.call(this,this.inputs()),this.m_formatter=null,this.priceScale().updateFormatter()},r.prototype.title=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols[e];return t=i?i.name+", "+i.exchange:e,t.toUpperCase()},r.prototype.bars=function(){return this.m_data},r.prototype.open=function(t){return this.bars().valueAt(t)[TradingView.OPEN_PLOT]},r.prototype.high=function(t){return this.bars().valueAt(t)[TradingView.HIGH_PLOT]},r.prototype.low=function(t){return this.bars().valueAt(t)[TradingView.LOW_PLOT]},r.prototype.close=function(t){return this.bars().valueAt(t)[TradingView.CLOSE_PLOT]},r.prototype.hl2=function(t){return(this.high(t)+this.low(t))/2},r.prototype.hlc3=function(t){return(this.high(t)+this.low(t)+this.close(t))/3},r.prototype.ohlc4=function(t){return(this.open(t)+this.high(t)+this.low(t)+this.close(t))/4},r.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var t=this._properties.inputs.symbol.value();return t?this._resolvedSymbols[t]:null},r.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},r.prototype.tags=function(){var t=[],e=this.symbolInfo();return e?t.push(e.name):this._properties.inputs.symbol.value()&&t.push(this._properties.inputs.symbol.value()),t},e.OverlayDataWindowView=s,e.study_Overlay=r},function(t,e,i){"use strict";function o(t,e,i,o){this._symbolLabelView=new s(t,this,"compare","symbol","showSymbolLabels"),TradingView.Study.call(this,t,e,i,o);var n=this;this._properties.minTick.listeners().subscribe(null,function(){n._createFormatter()}),this.properties().minTick.listeners().subscribe(null,function(){n._model.invalidate(new r(r.FULL_UPDATE))}),this._properties.merge({skipHistogramBaseOnAutoScale:!0})}var n=i(178).DataVendorStudyDataWindowView,s=i(126),r=i(99),a=i(94),l=a.PriceFormatter;inherit(o,TradingView.Study),o.prototype.createPlotLabels=function(t){},o.prototype.createViews=function(){this._dataWindowView||(this._dataWindowView=new n(this,this._model)),TradingView.Study.prototype.createViews.call(this),this._paneViews.push(this._symbolLabelView)},o.prototype._createFormatter=function(){var t,e,i,o,n,s=this.properties().inputs.symbol.value(),r=this._resolvedSymbols?this._resolvedSymbols[s]:null;"default"===this.properties().minTick.value()?this._formatter=new l(r?r.pricescale:100,r?r.minmov:1,!!r&&r.fractional):(t=this.properties().minTick.value(),e=isNumber(t)?["100","1","false"]:t.split(","),i=parseInt(e[0]),o=parseInt(e[1]),n="true"===e[2],this._formatter=new l(i,o,n)),this.priceScale()&&this.priceScale().updateFormatter()},o.prototype.symbol=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[e]:null;return t=i?i.name:e,t.toUpperCase()},o.prototype.title=function(t){var e,i=this.properties().inputs.symbol.value(),o=this._resolvedSymbols?this._resolvedSymbols[i]:null;return e=o?o.name+", "+o.exchange:i,e.toUpperCase()},o.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var t=this._properties.inputs.symbol.value();return t?this._resolvedSymbols[t]:null},o.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},o.prototype.tags=function(){var t=this.symbol();return t?[t]:[]},t.exports=o},function(t,e,i){"use strict";function o(t,e,i,o){n.call(this,t,e,i,o)}var n=i(171).Study,s=i(133),r=i(140).assert;inherit(o,n),o.prototype.clearData=function(){n.prototype.clearData.call(this),this._underlyingData=new s(this._plotFields)},o.prototype._mergeData=function(t){var e,i,o,n=0===this._underlyingData._length()?null:this._underlyingData._indexAt(0);for(this._underlyingData.merge(t),n!==this._underlyingData._indexAt(0)&&(this.m_data=new s(this._underlyingData.columns())),this.m_data._start=this._underlyingData._start,this.m_data._end=this._underlyingData._end,e=this.m_data._length(),i=e;i<this._underlyingData._length();++i)o=TradingView.merge({},this._underlyingData._valueAt(i)),this.m_data.add(this._underlyingData._indexAt(i),o);return this._plotsForStrategyProcessing().forEach(function(t){this._createStrategy(t.strategy,t.strategyIndex,t.targetIndex,e).rebuildData(this.m_data)},this),this.m_data},o.prototype._plotsForStrategyProcessing=function(){var t=["dataoffset"],e=[];return this._metaInfo.plots.forEach(function(i,o){var n,s;t.indexOf(i.type)>-1&&(n=null,this._metaInfo.plots.forEach(function(t,e){t.id===i.target&&(n=e)}),r(n>=0,"target plot not found for strategy plot "+i.id),s={strategy:i.type,strategyIndex:o,targetIndex:n},e.push(s))},this),e},o.prototype._createStrategy=function(t,e,i,n){return new o["Strategy_"+t](e,i,n)},o.Strategy_dataoffset=function(t,e,i){this._strategyPlotIndex=t,this._targetPlotIndex=e,this._startIndex=i},o.Strategy_dataoffset.prototype.rebuildData=function(t){var e,i,o,n,s,r,a,l=this._targetPlotIndex+1,h=this._strategyPlotIndex+1,c=null,d=null;for(e=this._startIndex;e<t._length();++e)i=t._valueAt(e),o=i[l],n=i[h]?Math.round(i[h]):null,i[l]=null,i[h]=null,!n||n>0||(s=e+n,r={pointIndex:s,value:o},d?d.pointIndex!==r.pointIndex&&(s>=0&&(t._items[s].value[l]=o),a=!1,c&&(a=c.value<=d.value&&d.value<=o||c.value>=d.value&&d.value>=o),a?d.pointIndex>=0&&(t._items[d.pointIndex].value[l]=null):c=d,d=r):d=r)},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(188);inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_tsanalysis"},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this._model.mainSeries().bars().valueAt(t);return e?[this.properties().inputs.displayZoneLabels.value(),1e3*e[TradingView.TIME_PLOT],this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value(),this.properties().inputs.minRRRatio.value(),this.properties().inputs.shouldFilterWPTZones.value(),this.properties().inputs.shouldFilterSTFTrends.value()]:null},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this._symbolIntervalChanged=!1,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.onSymbolIntervalChanged)}var n=i(188);inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_decisionpoint"},o.prototype.onSymbolIntervalChanged=function(){this._symbolIntervalChanged=!0},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this._model.mainSeries().bars().valueAt(t);return e?[this.properties().inputs.displayZoneLabels.value(),this._symbolIntervalChanged,1e3*e[TradingView.TIME_PLOT]]:null},o.prototype.onData=function(t){n.prototype.onData.call(this,t),this._symbolIntervalChanged=!1},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(188);inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_riskreward"},o.prototype.pointsCount=function(){return 3},o.getTooltipText=function(t){return t&&0!==t._points.length?1===t._points.length?"Select Stop Bar":2===t._points.length?"Select Target Point":null:"Select Entry Setup Bar"},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this.points()[1].index,i=this.points()[2].index,o=this._model.mainSeries().bars().valueAt(t),n=this._model.mainSeries().bars().valueAt(e),s=this._model.mainSeries().bars().valueAt(i);return o&&n&&s?[1e3*o[TradingView.TIME_PLOT],1e3*n[TradingView.TIME_PLOT],1e3*s[TradingView.TIME_PLOT],this.points()[2].price,this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value()]:null},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){a.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i)}function s(t,e,i){o.call(this,t,e,i)}function r(t,e,i){o.call(this,t,e,i)}var a=i(188);inherit(o,a),o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this._model.mainSeries().bars().valueAt(t);return e?[this.properties().inputs.displayZoneLabels.value(),1e3*e[TradingView.TIME_PLOT]]:null},inherit(n,o),n.prototype._mtpStudyId=function(){return"mtp_ew_main"},inherit(s,o),s.prototype._mtpStudyId=function(){return"mtp_ew_major"},inherit(r,o),r.prototype._mtpStudyId=function(){return"mtp_ew_minor"},e.LineStudyMtpElliotWaveMinor=r,e.LineStudyMtpElliotWaveMajor=s,e.LineStudyMtpElliotWaveMain=n,e.LineStudyMtpElliotWave=o},function(t,e,i){"use strict";function o(t,e,i,o,n){this._wptStudyId=o,this._pointsCount=n,m.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i,"mtp_wpt_down1ora",2)}function s(t,e,i){o.call(this,t,e,i,"mtp_wpt_down2orb",2)}function r(t,e,i){o.call(this,t,e,i,"mtp_wpt_down3",3)}function a(t,e,i){o.call(this,t,e,i,"mtp_wpt_down4",2)}function l(t,e,i){o.call(this,t,e,i,"mtp_wpt_down5",5)}function h(t,e,i){o.call(this,t,e,i,"mtp_wpt_downc",3)}function c(t,e,i){o.call(this,t,e,i,"mtp_wpt_up1ora",2)}function d(t,e,i){o.call(this,t,e,i,"mtp_wpt_up2orb",2)}function p(t,e,i){o.call(this,t,e,i,"mtp_wpt_up3",3)}function u(t,e,i){o.call(this,t,e,i,"mtp_wpt_up4",2)}function _(t,e,i){o.call(this,t,e,i,"mtp_wpt_up5",5)}function f(t,e,i){o.call(this,t,e,i,"mtp_wpt_upc",3)}var m=i(188);inherit(o,m),o.prototype._studyInputs=function(){var t,e,i,o=[this.properties().inputs.displayZoneLabels.value()];for(t=0;t<this.pointsCount();++t){if(e=this.points()[t].index,!(i=this._model.mainSeries().bars().valueAt(e)))return null;o.push(1e3*i[TradingView.TIME_PLOT])}return o},o.prototype._mtpStudyId=function(){return this._wptStudyId},o.prototype.pointsCount=function(){return this._pointsCount},inherit(n,o),n.getTooltipText=function(t){return"Down Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(s,o),s.getTooltipText=function(t){return"Down Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(r,o),r.getTooltipText=function(t){return"Down Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(a,o),a.getTooltipText=function(t){return"Down Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(l,o),l.getTooltipText=function(t){return"Down Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(h,o),h.getTooltipText=function(t){return"Down Wave C: Select Point "+((t?t._points.length:0)+1)},inherit(c,o),c.getTooltipText=function(t){return"Up Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(d,o),d.getTooltipText=function(t){return"Up Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(p,o),p.getTooltipText=function(t){return"Up Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(u,o),u.getTooltipText=function(t){return"Up Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(_,o),_.getTooltipText=function(t){return"Up Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(f,o),f.getTooltipText=function(t){return"Up Wave C: Select Point "+((t?t._points.length:0)+1)},e.LineStudyMtpDownWave1OrA=n,e.LineStudyMtpDownWave2OrB=s,e.LineStudyMtpDownWave3=r,e.LineStudyMtpDownWave4=a,e.LineStudyMtpDownWave5=l,e.LineStudyMtpDownWaveC=h,e.LineStudyMtpUpWave1OrA=c,e.LineStudyMtpUpWave2OrB=d,e.LineStudyMtpUpWave3=p,e.LineStudyMtpUpWave4=u,e.LineStudyMtpUpWave5=_,e.LineStudyMtpUpWaveC=f},function(t,e,i){(function(e){"use strict";function o(t,i){var o=this;f.call(this),this._properties=i,this._model=t,this._dataWindowView=new c(this,t),this._priceAxisView=new h(this,t),this._startMeasurePriceAxisView=new h(this,t,"measureStartY"),this._endMeasurePriceAxisView=new h(this,t,"measureEndY"),this._timeAxisView=new d(this,t),this._startMeasureTimeAxisView=new d(this,t,"measureStartX"),this._endMeasureTimeAxisView=new d(this,t,"measureEndX"),this.visible=!0,t.readOnly()?this.areLinesVisible=!0:m.cursorTool.subscribe(function(t){o.areLinesVisible="arrow"!==t},{callWithLast:!0}),this._movedDelegate=new e,this._subscribed=!1,this._model.readOnly()&&(this.visibleTrap=!0)}function n(t,e){this._source=t,this._pane=e,this._rendererCache={}}function s(t,e,i){this.source=t,this.pane=e,this._horzVisible=i}function r(t,e,i){this.source=t,this.pane=e,this._axis=i||"x"}var a=i(30),l=i(82).LineDataSource,h=i(255),c=i(256),d=i(257),p=i(152).TrendLineRenderer,u=i(124).TextRenderer,_=i(150).RectangleRenderer,f=i(89).DataSource,m=i(92),g=i(114),v=g.PaneRendererCrossHair,y=g.PaneRendererCrossHairLock,b=i(117),w=i(99),S=i(94),T=S.PercentageFormatter,C=S.TimeSpanFormatter,x=i(119);inherit(o,f),o.prototype.index=0,o.prototype.price=NaN,o.prototype.pane=null,o.prototype.color="white",o.prototype.style="",o.prototype.properties=function(){return this._properties},o.prototype.moved=function(){return this._movedDelegate},o.prototype.setPosition=function(t,e,i){if(this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,o.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.index=t,this.x=this._model.timeScale().indexToCoordinate(t),i&&!i.defaultPriceScale().isEmpty()){this.price=e;var n=i.defaultPriceScale();this.y=n.priceToCoordinate(e),this.pane=i}else this.price=NaN,this.y=NaN,this.pane=null;this.visible=!0,this.updateAllViews(),this._movedDelegate.fire({time:this._model.timeScale().points().roughTime(t),price:this.price})},o.prototype.updateIndex=function(){var t=this.index;this.index=this._model.timeScale().coordinateToIndex(this.x),this.index!==t&&this.updateAllViews()},o.prototype.setLockedPosition=function(t){delete this.lockedIndex,delete this.lockedX,t!==this._measurePane&&m.lockTimeAxis().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(m.lockTimeAxisTime.value()),this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex))},o.prototype.clearPosition=function(){this.visible=!1,this.index=parseInt(this._model.mainSeries().data().bars().last()),this.price=NaN,this.y=NaN,this.pane=null},o.prototype.measureStartY=function(){var t,e=this._startMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureStartX=function(){return this._model.timeScale().indexToCoordinate(this._startMeasurePoint.index)},o.prototype.measureEndY=function(){var t,e=this._endMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureEndX=function(){return this._model.timeScale().indexToCoordinate(this._endMeasurePoint.index)},o.prototype.paneViews=function(t){var e=[new s(this,t,t===this.pane)];return t===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new n(this,t)),this._measurePaneView.update(),e.push(this._measurePaneView)),m.lockTimeAxis().value()&&e.push(this._timeLockPaneView=this._timeLockPaneView||new r(this,t)),e},o.prototype.dataWindowView=function(){return this._dataWindowView},o.prototype.priceAxisViews=function(t,e){if(!this.visibleTrap||!this.visible||this.pane!==t||e!==t.defaultPriceScale())return null;var i=[this._priceAxisView];return this._startMeasurePoint&&i.push(this._startMeasurePriceAxisView),this._endMeasurePoint&&i.push(this._endMeasurePriceAxisView),i},o.prototype.timeAxisView=function(){if(!this.visibleTrap||!this.visible&&!m.lockTimeAxis().value())return null;var t=[this._timeAxisView];return this._startMeasurePoint&&t.push(this._startMeasureTimeAxisView),this._endMeasurePoint&&t.push(this._endMeasureTimeAxisView),t},o.prototype.updateAllViews=function(){this._priceAxisView.update(),this._startMeasurePoint&&(this._startMeasurePriceAxisView.update(),this._startMeasureTimeAxisView.update()),this._endMeasurePoint&&(this._endMeasurePriceAxisView.update(),this._endMeasureTimeAxisView.update()),this._timeAxisView.update()},o.prototype.startMeasurePoint=function(){return this._startMeasurePoint},o.prototype.startMeasuring=function(t,e){if(e.defaultPriceScale().isPercent()){var i=e.mainDataSource().firstValue();t.price=e.defaultPriceScale().priceRange().convertFromPercent(t.price,i)}this._startMeasurePoint=t,this._measurePane=e},o.prototype.finishMeasure=function(t){var e,i=this._measurePane;i.defaultPriceScale().isPercent()&&(e=i.mainDataSource().firstValue(),t.price=i.defaultPriceScale().priceRange().convertFromPercent(t.price,e)),this._endMeasurePoint=t},o.prototype.endMeasurePoint=function(){return this._endMeasurePoint},o.prototype.clearMeasure=function(t){delete this._measurePane,delete this._startMeasurePoint,delete this._endMeasurePoint,delete this._lastValidMeasurePoint,this._model.invalidate(new w(w.LIGHT_UPDATE))},o.prototype.measurePoints=function(){var t,e,i,o,n;return this.updateAllViews(),t=[this._startMeasurePoint],this._endMeasurePoint?t.push(this._endMeasurePoint):(this._measurePane===this.pane&&(this._lastValidMeasurePoint={x:this.x,y:this.y,rawPrice:this.price,price:this.price,index:this.index}),e=this._lastValidMeasurePoint.rawPrice,i=this._measurePane,o=i.defaultPriceScale(),o.isPercent()&&!o.isEmpty()&&(n=i.mainDataSource().firstValue(),this._lastValidMeasurePoint.price=o.priceRange().convertFromPercent(e,n)),t.push(this._lastValidMeasurePoint)),t},o.prototype.currentPoint=function(){return new a.Point(this.x,this.y)},o.prototype.appliedIndex=function(){return isFinite(this.lockedIndex)&&this.lockedIndex||this.index},o.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x},n.prototype.update=function(){var t,e,i,o,n,s,r,l,h,c,d,p,u,_,f,m,g,v;if(this._source._endMeasurePoint)t=this._source._endMeasurePoint.price,e=this._source._endMeasurePoint.index;else if(this._source._measurePane===this._source.pane)t=this._source.price,e=this._source.index;else{if(!this._source._lastValidMeasurePoint)return;t=this._source._lastValidMeasurePoint.rawPrice,e=this._source._lastValidMeasurePoint.index}i=t-this._source._startMeasurePoint.price,o=e-this._source._startMeasurePoint.index,n=this._source._startMeasurePoint.price,s=this._source._measurePane,s.defaultPriceScale().isPercent()&&(r=s.mainDataSource().firstValue(),this._source._endMeasurePoint&&(t=s.defaultPriceScale().priceRange().convertToPercent(t,r)),n=s.defaultPriceScale().priceRange().convertToPercent(n,r)),l=this._source._measurePane.defaultPriceScale().formatter().format(i),this._source._startMeasurePoint.price&&(h=i/this._source._startMeasurePoint.price,l+=" ("+(new T).format(100*h)+")"),this._label=l+"\n"+$.t("{0} bars").format(o),n=this._source._model._magnet.align(n,this._source._startMeasurePoint.index,this._source._measurePane),t=this._source._model._magnet.align(t,e,this._source._measurePane),c=this._source._model.timeScale().indexToCoordinate(this._source._startMeasurePoint.index),d=this._source._model.timeScale().indexToCoordinate(e),p=this._source._measurePane.defaultPriceScale().priceToCoordinate(n),u=this._source._measurePane.defaultPriceScale().priceToCoordinate(t),this._p1=new a.Point(c,p),this._p2=new a.Point(d,u),_=this._source._model.timeScale().indexToUserTime(this._source._startMeasurePoint.index),f=this._source._model.timeScale().indexToUserTime(e),m=this._source._measurePane.mainDataSource().base(),(_&&f||m)&&(g=(f.valueOf()-_.valueOf())/1e3,v=Math.round(i*m),this._label=l+" , "+v+"\n"+$.t("{0} bars").format(o)+", "+(new C).format(g))},n.prototype.renderer=function(){var t,e,i,o,n,s,r,h,c,d,f,m,g,v=new b,y={};return y.points=[this._p1,this._p2],y.width=this._source._model.timeScale().width(),y.height=this._source._measurePane.defaultPriceScale().height(),y.color="#D3E7FF",y.linewidth=0,y.fillBackground=!0,y.transparency=60,y.backcolor="#BADAFF",v.append(new _(y)),t=this._p1.add(this._p2).scaled(.5),e=new a.Point(this._p1.x,t.y),i=new a.Point(this._p2.x,t.y),o={points:[e,i],width:y.width,height:y.height,color:"#646668",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_ARROW},v.append(new p(o)),e=new a.Point(t.x,this._p1.y),i=new a.Point(t.x,this._p2.y),o={points:[e,i],width:y.width,height:y.height,color:"#646668",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_ARROW},v.append(new p(o)),n={x:0,y:10},s=function(t,e){return{points:[e],text:t,color:"#FFFFFF",horzAlign:"left",vertAlign:"middle",font:"Arial",offsetX:n.x,offsetY:n.y,bold:!1,italic:!1,fontsize:12,padding:5,highlightBorder:!1,backgroundColor:x.generateColor("#5b85bf",10),backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4}},r=.5*(this._p1.x+this._p2.x),h=this._p2.y,c=new a.Point(r,h),d=s(this._label,c),f=new u(d,this._rendererCache),m=f.measure(),g={x:r+d.backgroundHorzInflate+m.textBgPadding-m.width/m.textBgPadding,y:this._p1.y>this._p2.y?c.y-m.height-2*m.textBgPadding-n.y>0?h-m.height-n.y+m.textBgPadding:n.y-2*m.textBgPadding:c.y+m.height+m.textBgPadding+n.y>y.height?y.height-m.height-n.y:h+m.textBgPadding},f.setPoints([new a.Point(g.x,g.y)]),v.append(f),v},s.prototype.update=function(){},s.prototype.renderer=function(){var t,e,i,o,n,s={},r=this.source.visible&&this.source.areLinesVisible,a=m.lockTimeAxis().value();return s.horzLinesVisible=r&&this._horzVisible,s.vertLinesVisible=r||a,t=this.pane._model.readOnly(),e=t?defaults("chartproperties.paneProperties.crossHairProperties"):null,i=TradingView.isMobile.any()&&l.isLineTool(this.source._model.currentTool()),o=i?"#a000a0":t?e.color:this.pane._model.properties().paneProperties.crossHairProperties.color.value(),n=t?e.transparency:this.pane._model.properties().paneProperties.crossHairProperties.transparency.value(),!i&&n>0&&(o=x.generateColor(o,n)),s.color=o,s.lineWidth=t?e.width:this.pane._model.properties().paneProperties.crossHairProperties.width.value(),s.lineStyle=t?e.style:this.pane._model.properties().paneProperties.crossHairProperties.style.value(),s.drawCenter=i&&this.pane===this.source.pane,s.w=this.pane.width(),s.h=this.pane.height(),s.x=isFinite(this.source.lockedX)&&this.source.lockedX||this.source.x,s.y=this.source.y,new v(s)},r.prototype.update=function(){},r.prototype.renderer=function(){var t,e,i,o,n=this.source.visible&&this.source.areLinesVisible,s=m.lockTimeAxis().value(),r=n&&this._horzVisible,a=n||s;if(("y"!==this._axis||r)&&a)return t=9,e=11,i="y"===this._axis?this.pane.width()-t/2:this.source.lockedX+1,o="y"===this._axis?this.source.y:this.pane.height()-e/2-1,new y({x:i,y:o,width:t,height:e,bodyHeight:7})},t.exports=o}).call(e,i(34))},function(t,e,i){"use strict";function o(t,e){this._crossHair=t,this._model=e,this._rendererData={background:"#585858",color:"white",visible:!0},this._defaultFormatter=new a(100)}var n=i(86),s=i(84),r=i(94),a=r.PriceFormatter;inherit(o,s),o.prototype.update=function(){var t,e,i,o=this._rendererData,n=this._crossHair.pane;o.coordinate=this._crossHair.y,this.text="",n&&this._crossHair.visible&&(t=n.defaultPriceScale(),t.isEmpty()||(i=t.mainSource(),e=i?i.formatter():this._defaultFormatter,o.text=e.format(this._crossHair.price)))},o.prototype.renderer=function(){return this._renderer||(this._renderer=new n(this._rendererData)),this._renderer},t.exports=o},function(t,e,i){"use strict";function o(t,e){s.call(this),this._header=null,this._crossHair=t,this._model=e,this._items.push(new r("Date","")),this._items.push(new r("Time","")),this._items.push(new r("Price","")),this._defaultFormatter=new l(100)}var n=i(109),s=n.DataWindowView,r=n.DataWindowItem,a=i(94),l=a.PriceFormatter,h=a.DateFormatter,c=a.TimeFormatter;inherit(o,s),o.prototype.update=function(){var t,e,i,o,n,s,r=this._model.mainSeries().isDWM();this._items[1].setVisible(!r),this._items[0].setValue("n/a"),this._items[1].setValue("n/a"),this._items[2].setValue("n/a"),this._model.timeScale().isEmpty()||(t=this._crossHair.appliedIndex(),e=this._model.timeScale().indexToUserTime(t),null===e?(this._items[0].setValue("n/a"),r||this._items[1].setValue("n/a")):(this._items[0].setValue((new h).format(e)),r||this._items[1].setValue((new c).format(e))),(i=this._crossHair.pane)&&(o=i.defaultPriceScale(),o.isEmpty()||(n=o.mainSource(),s=n?n.formatter():this._defaultFormatter,this._items[2].setValue(s.format(this._crossHair.price)))))},t.exports=o},function(t,e,i){"use strict";function o(t,e){n.call(this),this._crosshair=t,this._model=e,this._rendererData={visible:!1,background:"#585858",color:"white",text:""}}var n=i(87),s=i(88),r=i(94).DateTimeFormatter;inherit(o,n),o.prototype.update=function(){var t,e=this._rendererData,i=this._model.timeScale();e.coordinate=this._crosshair.appliedX(),t=i.indexToUserTime(this._crosshair.appliedIndex()),t?(e.visible=!0,e.text=new r(this._model.mainSeries().isDWM()).format(t)):(e.visible=!1,e.text="")},o.prototype.renderer=function(){var t=this._rendererData;return this._renderer||(this._renderer=new s(t)),this._renderer},t.exports=o},function(t,e,i){(function(e,o){"use strict";function n(t,i,s){var r,a;this.m_timeScale=t,r=i.rightAxisProperties.state(),r.autoScale=!0,this.m_rightPriceScale=new l(new e(r),s.properties().scalesProperties),a=i.leftAxisProperties.state(),a.autoScale=!0,this.m_leftPriceScale=new l(new e(a),s.properties().scalesProperties),this.m_dataSources=[],this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=s,this._tagsChanged=new o,i.topMargin.listeners().subscribe(this,n.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,n.prototype._updateMargins),this._updateMargins(),this._stretchFactor=n.DEFAULT_STRETCH_FACTOR,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null}var s=i(199).ExecutionsPositionController,r=i(82).LineDataSource,a=i(89).PriceDataSource,l=i(259);n.DEFAULT_STRETCH_FACTOR=1e3,n.PANE_ANIMATION_DURATION=500,n.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,ChartEventsSource:1,"ESD$TV_DIVIDENDS@tv-scripting":2,"ESD$TV_SPLITS@tv-scripting":3,"ESD$TV_EARNINGS@tv-scripting":4,LineToolOrder:5,LineToolPosition:6,LineToolExecution:7},n.prototype.destroy=function(){this._properties.topMargin.listeners().unsubscribe(this,n.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,n.prototype._updateMargins)},n.prototype.setPaneSize=function(t){var e={large:1,medium:.6,small:.3,tiny:.15};if(!e[t])throw Error("Unknown size enum value: "+t);this._stretchFactor=e[t]*n.DEFAULT_STRETCH_FACTOR},n.sortSources=function(t){return t.map(function(t){var e,i,o=t._constructor;return isFunction(t.metaInfo)&&(o=t.metaInfo().id),i=n.sortSourcesPreOrdered[o]||0,e=i>0?+(1/0):i<0?-(1/0):t.zorder(),[t,i,e]}).sort(function(t,e){return t[1]-e[1]||t[2]-e[2]}).map(function(t){return t[0]})},n.prototype._updateMargins=function(){var t,e,i=.01*this._properties.topMargin.value(),o=.01*this._properties.bottomMargin.value();for(this.m_leftPriceScale.setTopMargin(i),this.m_leftPriceScale.setBottomMargin(o),this.m_rightPriceScale.setTopMargin(i),this.m_rightPriceScale.setBottomMargin(o),t=0;t<this.m_dataSources.length;t++)(e=this.m_dataSources[t])instanceof TradingView.Study&&this.isOverlay(e)&&"Volume"!==e.metaInfo().shortId&&e.priceScale()&&e.priceScale()!==this.m_leftPriceScale&&e.priceScale()===this.m_rightPriceScale&&(e.priceScale().setTopMargin(i),e.priceScale().setBottomMargin(o),this.recalculatePriceScale(e.priceScale()));this.recalculatePriceScale(this.m_leftPriceScale),this.recalculatePriceScale(this.m_rightPriceScale),this.updateAllViews()},n.prototype.model=function(){return this._model},n.prototype.width=function(){return this.m_width},n.prototype.height=function(){return this.m_height},n.prototype.setWidth=function(t){this.m_width=t,this.updateAllViews()},n.prototype.setHeight=function(t){var e,i;for(this.m_height=t,this.m_leftPriceScale.setHeight(t),this.m_rightPriceScale.setHeight(t),e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],this.isOverlay(i)&&i.priceScale()&&i.priceScale().setHeight(t);this.updateAllViews()},n.prototype.leftPriceScale=function(){return this.m_leftPriceScale},n.prototype.rightPriceScale=function(){return this.m_rightPriceScale},n.prototype.timeScale=function(){return this.m_timeScale},n.prototype.dataSources=function(){return this.m_dataSources},n.prototype.isOverlay=function(t){return t._isOverlay},n.prototype._processMainSourceChange=function(){var t,e,i,o,s,l,h;if(null===this.m_mainDataSource)for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&!this.isOverlay(i)&&(!i.properties().linkedToSeries||!i.properties().linkedToSeries.value())){this.m_mainDataSource=i,t=!0;break}if(this.m_mainDataSource&&t){for(o=[],e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],TradingView.isInherited(i.constructor,r)&&o.push(i);for(o=n.sortSources(o),e=0;e<o.length;e++)this.move(o[e],this.m_mainDataSource.priceScale(),!0)}else if(!this.m_mainDataSource||this.isOverlay(this.m_mainDataSource)&&0===this.nonOverlayPricesSourcesCount())for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&this.isOverlay(i)&&i.showInObjectTree()){for(this.m_mainDataSource=i,this.m_rightPriceScale.addDataSource(i),i.setPriceScale(this.m_rightPriceScale),s=this._model.children(i),h=0;h<s.length;h++)l=s[h],this.m_rightPriceScale.addDataSource(l),l.setPriceScale(this.m_rightPriceScale),l._isOverlay=!1;this.recalculatePriceScale(this.m_rightPriceScale),i._isOverlay=!1;break}},n.prototype._newZOrderForLineTool=function(){var t,e,i,o=null;for(t=0;t<this.m_dataSources.length;++t)(e=this.m_dataSources[t])instanceof r&&(i=e.zorder(),(null===o||i>o)&&(o=i));return null===o&&(o=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(t){t.zorder()>o&&t.setZorder(t.zorder()+1)}),o+1},n.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},n.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},n.prototype.addDataSource=function(t,e,i){var o;t instanceof r&&!i?(o=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=o)):o=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(t,e,o)},n.prototype.insertDataSource=function(t,i,o){var s,r,h;this.m_dataSources.push(t),s=!1,t===this._model.mainSeries()?(this.m_mainDataSource=t,s=!0):null===this.m_mainDataSource&&(this.m_mainDataSource=t,s=!0),t._isOverlay=!1,null!==i||this.canHaveMoreNoScaleSources()||(i=this.rightPriceScale()),null===i&&(r=this.m_rightPriceScale.topMargin(),h=this.m_rightPriceScale.bottomMargin(),t.metaInfo&&"Volume@tv-basicstudies"===t.metaInfo().id&&(r=.75,h=0),i=new l(new e(this._properties.overlayPropreties.state()),this._model.properties().scalesProperties),i.setHeight(this.m_height),i.setTopMargin(r),i.setBottomMargin(h),t._isOverlay=!0),i.addDataSource(t,this._isInInsertManyDataSourcesState),t.setPriceScale(i),t.onTagsChanged&&t.onTagsChanged().subscribe(this,n.prototype.onSourceTagsChanged),t.setZorder(o),s&&this._processMainSourceChange(),this._tagsChanged.fire(),TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},n.prototype.removeDataSource=function(t,e){var i,o=this.m_dataSources.indexOf(t);if(o===-1)return void TradingView.logDebugChart("removeDataSource: invalid data source");t._isOverlay=!1,this.m_dataSources.splice(o,1),t!==this.m_mainDataSource||e||(this.m_mainDataSource=null),i=null,this.m_leftPriceScale.dataSources().indexOf(t)!==-1?(this.m_leftPriceScale.removeDataSource(t),i=this.m_leftPriceScale):this.m_rightPriceScale.dataSources().indexOf(t)!==-1&&(this.m_rightPriceScale.removeDataSource(t),i=this.m_rightPriceScale),t.onTagsChanged&&t.onTagsChanged().unsubscribe(this,n.prototype.onSourceTagsChanged),TradingView.isInherited(t.constructor,a)&&this._processMainSourceChange(),this._tagsChanged.fire(),i&&TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},n.prototype.startScalePrice=function(t,e){t.startScale(e)},n.prototype.scalePriceTo=function(t,e){t.scaleTo(e),this.updateAllViews()},n.prototype.endScalePrice=function(t){t.endScale()},n.prototype.startScrollPrice=function(t,e){t.startScroll(e)},n.prototype.scrollPriceTo=function(t,e){t.scrollTo(e),this.updateAllViews()},n.prototype.endScrollPrice=function(t){t.endScroll()},n.prototype.setPriceAutoScale=function(t,e){if(t.setAutoScale(e),this.timeScale().isEmpty())return void t.setPriceRange(null);this.recalculatePriceScale(t)},n.prototype.restorePriceScaleState=function(t,e){t.restoreState(e),this.updateAllViews()},n.prototype.updateAllViews=function(){for(var t=0;t<this.m_dataSources.length;t++)this.m_dataSources[t].updateAllViews()},n.prototype.defaultPriceScale=function(){var t=this.m_mainDataSource?this.m_mainDataSource.priceScale():this.rightPriceScale();return void 0===t&&(t=new l(new e(this._properties.overlayPropreties.state()),this._model.properties().scalesProperties)),t},n.prototype._priceScaleIsPrice=function(t){var e=t.mainSource();return!!e&&(!!TradingView.isInherited(e.constructor,TradingView.Series)||!!TradingView.isInherited(e.constructor,TradingView.Study)&&e.metaInfo().is_price_study)},n.prototype.findSuitableScale=function(t){if(TradingView.isInherited(t.constructor,TradingView.Study)&&"Volume@tv-basicstudies"===t.metaInfo().id)return this.m_rightPriceScale.mainSource()||this.m_leftPriceScale.mainSource()?null:this.m_rightPriceScale;var e=!1;if(TradingView.isInherited(t.constructor,TradingView.Study)?e=t.metaInfo().is_price_study:TradingView.isInherited(t.constructor,TradingView.Series)&&(e=!0),e){if(this._priceScaleIsPrice(this.m_rightPriceScale))return this.m_rightPriceScale;if(this._priceScaleIsPrice(this.m_leftPriceScale))return this.m_leftPriceScale}return this.m_rightPriceScale.mainSource()?this.m_leftPriceScale.mainSource()?null:this.m_leftPriceScale:this.m_rightPriceScale},n.prototype.mainDataSource=function(){return this.m_mainDataSource},n.prototype.recalculatePriceScale=function(t){if(t){if(t.isAutoScale()&&!this.timeScale().isEmpty()){var e=this.timeScale().visibleBars();t.recalculatePriceRange(e)}t.updatePaneViews()}},n.prototype.resetPriceScale=function(t){var e=this.timeScale().visibleBars();t.mainSource()instanceof TradingView.Series&&t.mainSource().isLockScale()||t.setAutoScale(!0),t.recalculatePriceRange(e),this.updateAllViews()},n.prototype.recalculate=function(){var t,e;for(this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale),t=0;t<this.m_dataSources.length;t++)e=this.m_dataSources[t],!this.isOverlay(e)||e instanceof r||this.recalculatePriceScale(e.priceScale());this.updateAllViews(),this._model.updatePane(this)},n.prototype.isEmpty=function(){return null===this.m_mainDataSource},n.prototype.move=function(t,e,i){var o=this.m_dataSources.slice(),n=null!==e;this.removeDataSource(t,n),this.addDataSource(t,e,i),this.m_dataSources=o,this.invalidateSourcesCache()},n.prototype.dataSourceForId=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},n.prototype.priceScaleForSource=function(t){return this.rightPriceScale().dataSources().indexOf(t)!==-1?this.rightPriceScale():this.leftPriceScale().dataSources().indexOf(t)!==-1?this.leftPriceScale():null},n.prototype.sourceById=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},n.prototype.containsMainSeries=function(){return this.m_dataSources.indexOf(this._model.mainSeries())!==-1},n.prototype.priceScaleByName=function(t){return"left"===t?this.m_leftPriceScale:"right"===t?this.m_rightPriceScale:null},n.prototype.priceScaleName=function(t){return t===this.m_leftPriceScale?"left":t===this.m_rightPriceScale?"right":""},n.prototype.hitTestSources=function(){var t,e,i,o,n;if(this._cachedHitTestSources)return this._cachedHitTestSources;for(t=this.orderedSources(),e=[],i=[],o=0;o<t.length;o++)n=t[o],TradingView.isInherited(n.constructor,r)?e.push(n):i.push(n);return this._cachedHitTestSources=i.concat(e),this._cachedHitTestSources},n.prototype.orderedSources=function(){var t,e,i,o;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(t=[],e=0,i=this.m_dataSources.length;e<i;e++)o=this.m_dataSources[e],TradingView.isInherited(o.constructor,r)&&!o.isActualSymbol()||t.push(o);return t=n.sortSources(t),this._cachedOrderedSoruces=t,t},n.prototype.createDrawingsCaches=function(){s.recreateOrderedByBarsSourcesCache(this)},n.prototype.clearDrawingCaches=function(){s.clearOrderedByBarsSourcesCache()},n.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null,this._cachedHitTestSources=null,this.m_leftPriceScale.invalidateSourcesCache(),this.m_rightPriceScale.invalidateSourcesCache()},n.prototype.getZOrderMinMax=function(){var t,e,i,o,n=this.orderedSources();if(0===n.length)return{minZOrder:0,maxZOrder:0};for(t=n[0].zorder(),e=n[0].zorder(),i=1;i<n.length;i++)o=n[i],o.zorder()<t&&(t=o.zorder()),o.zorder()>e&&(e=o.zorder());return{minZOrder:t,maxZOrder:e}},n.prototype.sendToBack=function(t){var e,i=this.getZOrderMinMax().minZOrder,o=Math.abs(t.zorder()-i);for(e=0;e<o;e++)this.changeZOrder(t,-1)},n.prototype.bringToFront=function(t){var e,i=this.getZOrderMinMax().maxZOrder,o=Math.abs(t.zorder()-i);for(e=0;e<o;e++)this.changeZOrder(t,1)},n.prototype.changeZOrder=function(t,e){var i,o,n,s,r,a=this.orderedSources().filter(function(t){return t.showInObjectTree()}),l=0;for(i=0,o=a.length;i<o;i++)if(a[i]===t){l=i;break}l>0&&e<0?(n=a[l-1].zorder(),s=t.zorder(),a[l-1].setZorder(s),t.setZorder(n)):l<a.length-1&&e>0&&(r=a[l+1].zorder(),s=t.zorder(),a[l+1].setZorder(s),t.setZorder(r)),this.invalidateSourcesCache()},n.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},n.prototype.onTagsChanged=function(){return this._tagsChanged},n.prototype.dumpPriceScale=function(t){var e,i,o,n=t.dataSources(),s=[];for(e=0;e<n.length;e++)if(i=n[e].priceAxisViews(this,t))for(o=0;o<i.length;o++)s.push(i[o].dump());return s},n.prototype.dumpViews=function(){var t,e,i,o,n,s={};for(s.paneViews={},t=this.orderedSources(),e=0;e<t.length;e++)if(i=t[e],s.paneViews[e]=[],o=i.paneViews())for(n=0;n<o.size();n++)s.paneViews[e].push(o.item(e).dump());return s.leftAxis=this.dumpPriceScale(this.m_leftPriceScale),s.rightAxis=this.dumpPriceScale(this.m_rightPriceScale),s},n.prototype.clearSeries=function(){for(var t=this.m_dataSources.length-1;t>=0;t--)TradingView.isInherited(this.m_dataSources[t].constructor,TradingView.Series)&&this.m_dataSources.splice(t,1)},n.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter(function(t){return(!t.properties().linkedToSeries||!t.properties().linkedToSeries.value())&&(TradingView.isInherited(t.constructor,a)&&t.showInObjectTree()&&!t.isNoScale())}).length},n.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},n.prototype.actionNoScaleIsEnabled=function(t){return!(!this.isOverlay(t)&&TradingView.isInherited(t.constructor,a))||this.canHaveMoreNoScaleSources()},n.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new s(this,this._model.timeScale())),this._executionsPositionController},t.exports=n}).call(e,i(83),i(34))},function(t,e,i){(function(e,o){"use strict";function n(t,e){if(this.m_base=t,this.m_integralDividers=e,this.m_fractionalDividers=[],l.isBaseDecimal(this.m_base))this.m_fractionalDividers=[2,2.5,2];else for(var i=this.m_base;1!==i;){if(i%2==0)this.m_fractionalDividers.push(2),i/=2;else{if(i%5!=0)throw new RangeError("unexpected base");this.m_fractionalDividers.push(2),this.m_fractionalDividers.push(2.5),i/=5}if(this.m_fractionalDividers.length>100)throw Error("something wrong with base")}}function s(t,e,i){this.m_marks=[],this.m_base=e,this.m_priceScale=t,this._formatter=i,i&&(this._cache=new h(function(t){return i.format(t)})),this._currentFormatBase=0}function r(t){for(var e=1;t*e!==Math.round(t*e);)e*=10;return e}function a(t,i){function n(){var t,e,i=r.m_dataSources;for(t=0;t<i.length;t++)e=i[t],e.priceScaleChanged&&e.priceScaleChanged.fire(r)}this._properties=t,this._scalesProperties=i,this.m_height=0,this.m_priceRange=null,this.m_dataSources=[],this.m_topMargin=0,this.m_bottomMargin=0,this._studyTopMargin=0,this._studyBottomMargin=0,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_priceRangeSnapshot=null,this._invalidatedForRange={isValid:!0},this.onMarksChanged=new e,this.m_markBuilder=new s(this,100,new _(100)),this._properties.percentage.listeners().subscribe(this,a.prototype.updateFormatter);var r=this;this._properties.log.listeners().subscribe(null,function(t){var e,i,n;r.m_priceRange&&(e=r.m_priceRange,t.value()?r.m_priceRange=new o(r._toLog(e.minValue()),r._toLog(e.maxValue())):(i=r._fromLog(e.minValue()),n=r._fromLog(e.maxValue()),isFinite(i)&&isFinite(n)?r.m_priceRange=new o(i,n):r.properties().autoScale.setValue(!0)))}),this._properties.percentage.listeners().subscribe(null,function(){r._properties.autoScale.setValue(!0)}),this._properties.percentage.listeners().subscribe(null,function(){var t,e,i;r._properties.autoScaleDisabled.setValue(r._properties.percentage.value()),t=r.priceRange(),!r.mainSource()||r.mainSource().model().timeScale().isEmpty()||r.mainSource().data().isEmpty()||r.mainSource()instanceof p&&!r.mainSource().properties().lockScale.value()||!t||(e=r.mainSource().model().timeScale().visibleBars(),i=r.mainSource().data().search(e.firstBar(),TradingView.SEARCH_NEAREST_RIGHT).value[TradingView.CLOSE_PLOT],null!=t&&void 0!==i&&(r._properties.percentage.value()?r.setPriceRange(t.convertToPercents(i)):r.setPriceRange(t.convertFromPercents(i))))}),this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._hasSeries=!1,this._properties.percentage.listeners().subscribe(null,n),this._properties.log.listeners().subscribe(null,n),this._properties.listeners().subscribe(null,function(){r.mainSource()&&r.mainSource().model()&&r.mainSource().model().fullUpdate()})}var l=i(30),h=i(260),c=i(82).LineDataSource,d=i(89).PriceDataSource,p=i(102),u=i(94),_=u.PriceFormatter,f=u.PercentageFormatter;n.prototype.TICK_SPAN_EPSILON=1e-9,n.prototype.tickSpan=function(t,e,i){var o,n=0===this.m_base?0:1/this.m_base,s=this.TICK_SPAN_EPSILON,r=Math.pow(10,Math.max(0,Math.ceil(l.log10(t-e)))),a=0;for(a=0,o=this.m_integralDividers[0];r>n+s&&l.greaterOrEqual(r,n,s)&&l.greaterOrEqual(r,i*o,s)&&l.greaterOrEqual(r,1,s);++a,o=this.m_integralDividers[a%this.m_integralDividers.length])r/=o;if(r<=n+s&&(r=n),r=Math.max(1,r),this.m_fractionalDividers.length>0&&l.equal(r,1,s))for(a=0,o=this.m_fractionalDividers[0];r>n+s&&l.greaterOrEqual(r,i*o,s);++a,o=this.m_fractionalDividers[a%this.m_fractionalDividers.length])r/=o;return r},s.prototype.TICK_DENSITY=2.5,s.prototype.base=function(){return this.m_base},s.prototype.setBase=function(t){if(t<0)throw new RangeError("base < 0");this.m_base=t},s.prototype.fontHeight=function(){return this.m_priceScale.fontSize()},s.prototype.tickSpan=function(t,e){var i,o,s,r,a,h,c;if(t<e)throw new RangeError("high < low");return i=this.m_priceScale.height(),o=this.tickMarkHeight(),s=(t-e)*o/i,r=new n(this.m_base,[2,2.5,2]),a=new n(this.m_base,[2,2,2.5]),h=new n(this.m_base,[2.5,2,2]),c=[],c.push(r.tickSpan(t,e,s)),c.push(a.tickSpan(t,e,s)),c.push(h.tickSpan(t,e,s)),l.min(c)},s.prototype.tickMarkHeight=function(){return Math.ceil(this.fontHeight()*this.TICK_DENSITY)},s.prototype.rebuildTickMarks=function(){var t,e,i,o,n,s,a,l,c,d,p,u,f;if(null===this.m_priceScale)throw new TypeError("scale is null");if(this.m_priceScale.isEmpty())return void(this.m_marks=[]);if(t=this.m_priceScale.height(),e=this.m_priceScale.coordinateToPrice(t-1),i=this.m_priceScale.coordinateToPrice(0),o=i>=e?1:-1,n=Math.max(i,e),s=Math.min(i,e),i=n,e=s,i!==e)for(a=this.tickSpan(i,e),l=i%a,l+=l<0?a:0,this.m_marks=[],this._formatter||(c=r(a),this._cache&&this._currentFormatBase===c||(d=new _(c),this._cache=new h(function(t){return d.format(t)}))),p=null,u=i-l;u>e;u-=a)f=this.m_priceScale.priceToCoordinate(u),null!==p&&Math.abs(f-p)<this.tickMarkHeight()||(this.m_marks.push({coord:f,label:this._cache.format(u)}),p=f,this.m_priceScale.isLog()&&(a=this.tickSpan(u*o,e)))},s.prototype.marks=function(){return this.m_marks},a.prototype.isLog=function(){return this._properties.log.value()},a.prototype.isPercent=function(){return this._properties.percentage.value()},a.prototype.properties=function(){return this._properties},a.prototype.fontSize=function(){return this._scalesProperties.fontSize.value()},a.prototype.height=function(){return this.m_height},a.prototype.setHeight=function(t){var e=this.m_height;this.m_height=t,this._internalHeightCache=void 0,this._marksCache=null,e!==t&&this.mainSource()instanceof p&&this.mainSource().isLockScale()&&this.mainSource().model().timeScale().recalcLockedScale()},a.prototype.topMargin=function(){return Math.max(this.m_topMargin,this._studyTopMargin)},a.prototype.setTopMargin=function(t){if(!isNumber(t))throw new TypeError("invalid margin");if(t<0||t>30)throw new RangeError("invalid margin");this.m_topMargin=t,this._internalHeightCache=void 0,this._marksCache=null},a.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)},a.prototype.setBottomMargin=function(t){if(!isNumber(t))throw new TypeError("invalid margin");if(t<0||t>30)throw new RangeError("invalid margin");this.m_bottomMargin=t,this._internalHeightCache=void 0,this._marksCache=null},a.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var t=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=t,t},a.prototype.priceRange=function(){return this.makeSureItIsValid(),this.m_priceRange},a.prototype.setPriceRange=function(t){if(!t instanceof o)throw new TypeError("incorrect price range");this.m_priceRange&&this.m_priceRange.equals(t)||(this.m_priceRange=t,this._marksCache=null)},a.prototype.isEmpty=function(){return this.makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()},a.prototype.invertedCoordinate=function(t){return this.height()-1-t},a._logicalOffset=4,a._coordOffset=1e-4,a.prototype.log10=function(t){return Math.log(t)/Math.log(10)},a.prototype._toLog=function(t){var e,i=Math.abs(t);return i<1e-6?0:(e=this.log10(i+a._coordOffset)+a._logicalOffset,t<0?-e:e)},a.prototype.priceToLogical=function(t){return this.isLog()&&t?this._toLog(t):t},a.prototype._fromLog=function(t){var e,i=Math.abs(t);return i<1e-6?0:(e=Math.pow(10,i-a._logicalOffset)-a._coordOffset,t<0?-e:e)},a.prototype.logicalToPrice=function(t){return this.isLog()?this._fromLog(t):t},a.prototype.priceToCoordinate=function(t,e){var i,o;return this.makeSureItIsValid(),this.isEmpty()?0:(t=this.priceToLogical(t),i=this.bottomMargin()*this.height()+(this.internalHeight()-1)*(t-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue()),o=this.invertedCoordinate(i),e?o:Math.round(o))},a.prototype.pricesToCoordinates=function(t){this.pricesToCoordinatesEx(t,function(t){return t.y},function(t,e){t.y=e})},a.prototype.pricesToCoordinatesEx=function(t,e,i){var o,n,s,r,a,l,h,c,d;if(this.makeSureItIsValid(),o=this.bottomMargin()*this.height(),n=this.priceRange().minValue(),s=this.priceRange().maxValue(),r=this.internalHeight()-1,a=r/(s-n),this.isLog())for(l=0;l<t.length;l++)h=e(t[l]),i(t[l],this.priceToLogical(h));for(l=0;l<t.length;l++)h=e(t[l]),TradingView.isNaN(h)||void 0===h||null===h||(c=o+a*(h-n),d=this.m_height-1-c,i(t[l],Math.round(d)))},a.prototype.pointsArrayToCoordinates=function(t){var e,i,o,n,s,r,a,l,h;if(this.makeSureItIsValid(),e=this.bottomMargin()*this.height(),i=this.priceRange().minValue(),o=this.priceRange().maxValue(),n=this.internalHeight()-1,s=n/(o-i),this.isLog())for(r=0;r<t.length;r++)t[r].y=this.priceToLogical(t[r].y);for(r=0;r<t.length;r++)a=t[r].y,TradingView.isNaN(a)||void 0===a||null===a||(l=e+s*(a-i),h=this.m_height-1-l,t[r].y=Math.round(h))},a.prototype.pricesArrayToCoordinates=function(t){var e,i,o,n,s,r,a,l,h;if(this.makeSureItIsValid(),e=this.bottomMargin()*this.height(),i=this.priceRange().minValue(),o=this.priceRange().maxValue(),n=this.internalHeight()-1,s=n/(o-i),this.isLog())for(r=0;r<t.length;r++)t[r]=this.priceToLogical(t[r]);for(r=0;r<t.length;r++)void 0!==(a=t[r])&&null!==a&&(l=e+s*(a-i),h=this.m_height-1-l,t[r]=Math.round(h))},a.prototype.barPricesToCoordinates=function(t){var e,i,o,n,s,r,a,l,h,c,d;if(this.makeSureItIsValid(),e=t,i=this.bottomMargin()*this.height(),o=this.priceRange().minValue(),n=this.priceRange().maxValue(),s=this.internalHeight()-1,r=s/(n-o),this.isLog())for(a=0;a<e.length;a++)e[a]&&(e[a].open=this.priceToLogical(e[a].open),e[a].high=this.priceToLogical(e[a].high),e[a].low=this.priceToLogical(e[a].low),e[a].close=this.priceToLogical(e[a].close),e[a].additionalPrice&&(e[a].additionalPrice=this.priceToLogical(e[a].additionalPrice)));for(a=0;a<e.length;a++)(l=e[a])&&(h=l.open,c=i+r*(h-o),d=this.m_height-1-c,l.open=Math.round(d),h=l.high,c=i+r*(h-o),d=this.m_height-1-c,l.high=Math.round(d),h=l.low,c=i+r*(h-o),d=this.m_height-1-c,l.low=Math.round(d),h=l.close,c=i+r*(h-o),d=this.m_height-1-c,l.close=Math.round(d),l.additionalPrice&&(h=l.additionalPrice,c=i+r*(h-o),d=this.m_height-1-c,l.additionalPrice=Math.round(d)))},a.prototype.coordinateToPrice=function(t){var e,i;return this.makeSureItIsValid(),this.isEmpty()?0:(e=this.invertedCoordinate(t),i=this.priceRange().minValue()+(this.priceRange().maxValue()-this.priceRange().minValue())*((e-this.bottomMargin()*this.height())/(this.internalHeight()-1)),this.logicalToPrice(i))},a.prototype.isAutoScale=function(){return this._properties.autoScale.value()&&!(this.mainSource()instanceof p&&this.mainSource().isLockScale())},a.prototype.isPercentage=function(){return this._properties.percentage.value()},a.prototype.dataSources=function(){return this.m_dataSources},a.prototype.orderedSources=function(){var t,e,o,n;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(t=[],e=0;e<this.m_dataSources.length;e++)o=this.m_dataSources[e],null==o.zorder()&&o.setZorder(e+1),t.push(o);return n=i(258),t=n.sortSources(t),this._cachedOrderedSoruces=t,this._cachedOrderedSoruces},a.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null},a.prototype.hasSeries=function(){return this._hasSeries},a.prototype.addDataSource=function(t,e){if(e||this.m_dataSources.indexOf(t)===-1){TradingView.isInherited(t.constructor,p)&&(this._hasSeries=!0);var i=this;t.properties().visible.listeners().subscribe(null,function(){i._sourcesForAutoscale=null}),this.m_dataSources.push(t),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.initScaleProperties(),this.invalidateSourcesCache()}},a.prototype.initScaleProperties=function(){var t=this.mainSource()instanceof p&&this.mainSource().properties().lockScale.value();t&&(this.properties().percentage.setValue(!1),this.properties().log.setValue(!1),this.properties().autoScale.setValue(!1)),this.properties().percentageDisabled.setValue(t),this.properties().logDisabled.setValue(t),this.properties().autoScaleDisabled.setValue(this.properties().percentage.value()),this.properties().percentage.value()&&this.properties().log.setValue(!1)},a.prototype.removeDataSource=function(t){var e=this.m_dataSources.indexOf(t);if(e===-1)throw Error("source is not attached to scale");this.m_dataSources.splice(e,1),TradingView.isInherited(t.constructor,p)&&(this._hasSeries=!1),this.mainSource()||this.setAutoScale(!0),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.invalidateSourcesCache()},a.prototype.setAutoScale=function(t){this._properties.autoScale.setValue(t)},a.prototype.isScaled=function(){return"number"==typeof this.m_scaleStartPoint},a.prototype.startScale=function(t){this.isPercentage()||null===this.m_scaleStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scaleStartPoint=this.m_height-t,this.m_priceRangeSnapshot=this.priceRange().clone()))},a.prototype.marks=function(){return this._marksCache?this._marksCache:(this.m_markBuilder.rebuildTickMarks(),this._marksCache=this.m_markBuilder.marks(),this.onMarksChanged.fire(),this._marksCache)},a.prototype.scaleTo=function(t){var e,i;this.isPercentage()||(this._marksCache=null,null!==this.m_scaleStartPoint&&(this.setAutoScale(!1),e=this.m_priceRange.clone(),t=this.m_height-t,t<0&&(t=0),i=(this.m_scaleStartPoint+.2*(this.m_height-1))/(t+.2*(this.m_height-1)),i=Math.max(i,.1),this.m_priceRange=this.m_priceRangeSnapshot.clone(),this.m_priceRange.scaleAroundCenter(i),this.recalcLockedScale(e)))},a.prototype.recalcLockedScale=function(t){var e,i,n,s;if(this.mainSource()instanceof p&&this.mainSource().properties().lockScale.value()){if(e=this.mainSource().model().timeScale(),i=this.mainSource().data().boxSize,(void 0===i||isNaN(i))&&this.mainSource().fixBoxSize(),void 0===i||isNaN(i))return;this.properties().percentage.value()&&(n=this.mainSource().data().search(this.mainSource().getRealVisibleRange().m_firstBar).value[TradingView.CLOSE_PLOT],i=o.prototype.convertToPercent.call(null,n+i,n)-o.prototype.convertToPercent.call(null,n,n)),s=this.internalHeight()/this.priceRange().length()*i,s<.5||s>50?this.m_priceRange=t:(e.setBarSpacing(s),e._correctOffset()),this.mainSource().model().mainSeries().requestMoreData()}},a.prototype.endScale=function(){this.isPercentage()||null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this.m_priceRangeSnapshot=null)},a.prototype.startScroll=function(t){this.isAutoScale()||null===this.m_scrollStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scrollStartPoint=t,this.m_priceRangeSnapshot=this.priceRange().clone()))},a.prototype.scrollTo=function(t){var e,i,o;this._marksCache=null,this.isAutoScale()||null!==this.m_scrollStartPoint&&(e=this.priceRange().length()/(this.height()-1),i=t-this.m_scrollStartPoint,o=i*e,this.m_priceRange=this.m_priceRangeSnapshot.clone(),this.m_priceRange.shift(o))},a.prototype.endScroll=function(){this.isAutoScale()||null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this.m_priceRangeSnapshot=null)},a.prototype.state=function(){var t={};return t.m_priceRange=this.priceRange()?this.priceRange().clone():null,t.m_isAutoScale=this.isAutoScale(),t.m_isPercentage=this._properties.percentage.value(),t.m_isLog=this._properties.log.value(),t.m_height=this.m_height,t.m_topMargin=this.m_topMargin,t.m_bottomMargin=this.m_bottomMargin,t},a.prototype.restoreState=function(t){var e=t.m_priceRange;if(void 0===e)throw new TypeError("invalid state");if(void 0===t.m_isAutoScale)throw new TypeError("invalid state");void 0!==t.m_isPercentage&&this._properties.percentage.setValue(t.m_isPercentage),void 0!==t.m_isLog&&this._properties.log.setValue(t.m_isLog),this.m_priceRange=e?new o(e.m_minValue,e.m_maxValue):null,void 0!==t.m_height&&(this.m_height=t.m_height),this.setAutoScale(t.m_isAutoScale),void 0!==t.m_topMargin&&(this.m_topMargin=t.m_topMargin),void 0!==t.m_bottomMargin&&(this.m_bottomMargin=t.m_bottomMargin),this._mainSource=void 0,this._scaleSeriesOnly=!1},a.prototype.mainSource=function(){var t,e;if(void 0!==this._mainSource)return this._mainSource;for(t=void 0,e=0;e<this.m_dataSources.length;e++){if(TradingView.isInherited(this.m_dataSources[e].constructor,p)){t=this.m_dataSources[e];break}!t&&TradingView.isInherited(this.m_dataSources[e].constructor,d)&&(t=this.m_dataSources[e])}return this._mainSource=t,this._mainSource||null},a.prototype.formatter=function(){return this._formatter||this.updateFormatter(),this._formatter},a.prototype.updateFormatter=function(){var t,e;this._marksCache=null,t=this.mainSource(),e=100,t&&(e=t.base()),this._formatter=null,this.properties().percentage.value()?this._formatter=new f:this._formatter=t?t.formatter():new _(100,1),this.m_markBuilder=new s(this,e,this._formatter),this.m_markBuilder.rebuildTickMarks()},a.prototype._recalculateSourcesForAutoscale=function(){var t,e;this._mainSource&&(this._scaleSeriesOnly=this._scalesProperties.scaleSeriesOnly.value()),t=this._scaleSeriesOnly&&this._hasSeries,e=function(e){return!!(e.properties().visible.value()||e instanceof p)&&(t?TradingView.isInherited(e.constructor,p):TradingView.isInherited(e.constructor,d))},this._sourcesForAutoscale=this.m_dataSources.filter(e)},a.prototype.sourcesForAutoscale=function(){return this._mainSource&&this._scaleSeriesOnly!==this._scalesProperties.scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null),this._sourcesForAutoscale||this._recalculateSourcesForAutoscale(),this._sourcesForAutoscale},a.prototype.recalculatePriceRange=function(t){this._invalidatedForRange={visibleBars:t,isValid:!1}},a.prototype.makeSureItIsValid=function(){this._invalidatedForRange.isValid||(this._invalidatedForRange.isValid=!0,this.recalculatePriceRangeImpl())},a.prototype.recalculatePriceRangeImpl=function(){var t,e,i,n,s,r,a,l,h,c,d=this._invalidatedForRange.visibleBars;if(d){for(t=null,e=this.sourcesForAutoscale(),i=0,n=0,s=0;s<e.length;s++)r=e[s],r.properties().visible.value()&&(a=d.firstBar(),l=d.lastBar(),h=r.priceRange(a,l),null===t&&h?t=h:h&&(t=t.merge(h)),r.margins&&(c=r.margins(),i=Math.max(c[0],i),n=Math.max(c[1],n)));(Math.abs(n-this._studyBottomMargin)>.01||Math.abs(i-this._studyTopMargin)>.01)&&(this._studyBottomMargin=n,this._studyTopMargin=i,this._marksCache=null,this._internalHeightCache=null),t?(t.minValue()===t.maxValue()&&(t=new o(t.minValue()-.5,t.maxValue()+.5)),this.setPriceRange(t)):this.m_priceRange||this.setPriceRange(new o(-.5,.5)),this._invalidatedForRange.isValid=!0}},a.prototype.sourcesToUpdateViews=function(){var t,e;if(!this._sourcesToUpdateViews)for(this._sourcesToUpdateViews=[],t=0;t<this.m_dataSources.length;t++)e=this.m_dataSources[t],TradingView.isInherited(e.constructor,c)&&!e.isActualSymbol()||this._sourcesToUpdateViews.push(e);return this._sourcesToUpdateViews},a.prototype.updatePaneViews=function(){var t,e=this.sourcesToUpdateViews();for(t=0;t<e.length;t++)e[t].updateAllViews()},a.prototype.priceRangeInPrice=function(){var t,e,i,o,n,s;return this.isEmpty()?null:this.isPercent()?(t=this.mainSource().model().timeScale().visibleBars(),e=this.mainSource().data().search(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT).value[TradingView.CLOSE_PLOT],i=this.priceRange().convertFromPercents(e),{from:i.minValue(),to:i.maxValue()}):(o=this.height(),n=this.coordinateToPrice(o-1),s=this.coordinateToPrice(0),{from:n,to:s})},t.exports=a}).call(e,i(34),i(103))},function(t,e){"use strict";function i(t,e){this._formatter=t,this._maxSize=e||50,this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}i.prototype.format=function(t){var e,i;return this._cache[t]?this._cache[t].string:(this._actualSize===this._maxSize&&(e=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[e],this._oldestTick++,this._actualSize--),i=this._formatter(t),this._cache[t]={string:i,tick:this._usageTick},this._tick2Labels[this._usageTick]=t,this._actualSize++,this._usageTick++,i)},t.exports=i},function(t,e,i){(function(e){"use strict";function o(t){function i(t,e){var i=t.font;return a.hasOwnProperty(i)||(a[i]={}),a[i].hasOwnProperty(e)||(a[i][e]=t.measureText(e).width),a[i][e]}function o(){var o=r.width(),a=r.height();return{draw:function(r){var h,c,d,p,u,_,f,m=t.symbolInfo();if(m&&!e.enabled("fundamental_widget")){for(r.fillStyle=n.generateColor(l.color.value(),l.transparency.value()),h=m.name,/QUANDL/.test(m.exchange)&&(c=h.split(/\//),c.length&&(h=c[c.length-1])),d=[{text:h?h+", "+s(t.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:114,baselineOffset:87},{text:m.description||"",font:"48px Verdana, Arial, sans-serif",lineHeight:57,baselineOffset:43.5}],p=0,u=0;u<d.length;u++)_=d[u],_.text&&(r.font=_.font,f=i(r,_.text),f>o?(_.zoom=o/f,f=o):_.zoom=1,_.offsetLeft=(o-f)/2,p+=_.lineHeight*_.zoom);for(p=Math.max((a-p)/2,0),u=0;u<d.length;u++)_=d[u],_.text&&(r.save(),r.font=_.font,r.translate(_.offsetLeft,p),r.scale(_.zoom,_.zoom),r.fillText(_.text,0,_.baselineOffset),r.restore(),p+=_.lineHeight*_.zoom)}}}}var r=null,a={},l=t.model().properties().symbolWatermarkProperties,h={renderer:o,update:function(){}};this.paneViews=function(t){return t.containsMainSeries()?(r=t,[h]):[]}}var n=i(119),s=i(110).translatedIntervalString;t.exports=o}).call(e,i(1))},function(t,e){"use strict";function i(){this.visible=!0,this.horzLinesVisible=!0,this.horzLinesColor="white",this.horzLinesStyle="",this.vertLinesVisible=!0,this.vertLinesColor="white",this.vertLinesStyle=""}function o(t,e){this.source=t,this.pane=e}function n(t){this.data=t}i.prototype.paneViews=function(t){return[new o(this,t)]},o.prototype.update=function(){},o.prototype.renderer=function(){var t={};return this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty()?null:(t.horzLinesVisible=!0,t.vertLinesVisible=!0,t.horzLinesColor=this.pane._model.properties().paneProperties.horzGridProperties.color.value(),t.vertLinesColor=this.pane._model.properties().paneProperties.vertGridProperties.color.value(),t.horzLineStyle=this.pane._model.properties().paneProperties.horzGridProperties.style.value(),t.vertLineStyle=this.pane._model.properties().paneProperties.vertGridProperties.style.value(),t.priceMarks=this.pane.defaultPriceScale().marks(),t.timeMarks=this.pane.timeScale().marks(),t.w=this.pane.width(),t.h=this.pane.height(),new n(t))},n.prototype.draw=function(t){var e;if(t.lineWidth=1,this.data.vertLinesVisible){for(t.strokeStyle=this.data.vertLinesColor,CanvasEx.setLineStyle(t,this.data.vertLineStyle),t.beginPath(),e=0;e<this.data.timeMarks.length;e++)t.moveTo(this.data.timeMarks[e].coord+1,0),t.lineTo(this.data.timeMarks[e].coord+1,this.data.h);t.stroke()}if(this.data.horzLinesVisible){for(t.strokeStyle=this.data.horzLinesColor,CanvasEx.setLineStyle(t,this.data.horzLineStyle),t.beginPath(),e=0;e<this.data.priceMarks.length;e++)t.moveTo(0,this.data.priceMarks[e].coord),t.lineTo(this.data.w,this.data.priceMarks[e].coord);t.stroke()}},t.exports=i},function(t,e,i){"use strict";function o(t,e,i){this._magnetProperty=t,this._timeScale=e}var n=i(102);o.prototype.align=function(t,e,i){var o,s,r,a,l,h,c,d,p,u=50,_=i.defaultPriceScale(),f=_.priceToCoordinate(t),m=t;if(!this._magnetProperty.value())return m;for(o=_.dataSources(),s=null,r=0;r<o.length;r++)if(o[r]instanceof n){s=o[r];break}if(s&&(a=s.bars(),a.contains(e)&&(l=a.valueAt(e),h=[l[TradingView.OPEN_PLOT],l[TradingView.HIGH_PLOT],l[TradingView.LOW_PLOT],l[TradingView.CLOSE_PLOT]],_=s.priceScale(),!_.isEmpty()))){if(c=[],_.isPercent())for(d=s.firstValue(),r=0;r<h.length;r++)h[r]=_.priceRange().convertToPercent(h[r],d);for(r=0;r<h.length;r++)c.push({y:_.priceToCoordinate(h[r]),price:h[r]});c.sort(function(t,e){return Math.abs(t.y-f)-Math.abs(e.y-f)}),p=c[0],Math.abs(p.y-f)<u&&(m=p.price)}return m},t.exports=o},function(t,e,i){(function(e,o){"use strict";function n(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}function s(t){this._model=t,this._properties=t.properties().timeScale,this._scalesProperties=t.properties().scalesProperties,this.m_width=0,this._defaultRightOffset=this._properties.rightOffset.value(),this.m_rightOffset=this._properties.rightOffset.value(),this.m_points=new u,this.m_barSpacing=this._properties.barSpacing.value(),this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.m_tickmarks=new h,this._locked=!1,this._formattedBySpan={},this._onScroll=new e}var r=i(30),a=i(120),l=i(260),h=i(265),c=i(99),d=i(91).saveDefaultProperties,p=i(94).numberToStringWithLeadingZero,u=i(266);TradingView.MONTH_NAMES=null,TradingView.MINUTE_SPAN=20,TradingView.HOUR_SPAN=30,TradingView.DAY_SPAN=40,TradingView.WEEK_SPAN=50,TradingView.MONTH_SPAN=60,TradingView.YEAR_SPAN=70,TradingView.DEFAULT_BAR_SPACING=6,TradingView.MAX_BAR_SPACING=50,TradingView.MIN_BAR_SPACING=.5,TradingView.DEFAULT_RIGHT_OFFSET=5,s.prototype.tickMarks=function(){return this.m_tickmarks},s.prototype.reset=function(){this._visibleBarsCache=null,this.m_points=new u,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.m_tickmarks.reset()},s.prototype.restoreDefault=function(){this._visibleBarsCache=null,this.m_barSpacing=TradingView.DEFAULT_BAR_SPACING,this.m_rightOffset=this._properties.rightOffset.value(),this.saveDefault("barSpacing"),this._correctOffset(),this.recalcLockedScale()},s.prototype.rightOffset=function(){return this.m_rightOffset},s.prototype.scrollToRealtime=function(t){var e,i,o,n,s=this._properties.rightOffset.value();if(t)return e=this,i=this.m_rightOffset,o=this.m_width/this.m_barSpacing-10,o>0&&s>o&&(s=o),n=this._model,void $({offset:i}).animate({offset:s},{duration:1e3,easing:"easeInOutQuint",step:function(t){e._visibleBarsCache=null,e.m_rightOffset=t,n.recalculateAllPanes(),n.invalidate(new c(c.LIGHT_UPDATE)),n.recalcVisibleRangeStudy(n.dataSources())}});this._visibleBarsCache=null,this.m_rightOffset=s,this._correctOffset()},s.prototype.points=function(){return this.m_points},s.prototype.width=function(){return this.m_width},s.prototype.barSpacing=function(){return this.m_barSpacing},s.prototype.setWidth=function(t){this._visibleBarsCache=null,!isFinite(t)||t<=0||(this._locked&&this.m_width&&(this.m_barSpacing*=t/this.m_width),this.m_width=t,this._correctOffset())},s.prototype.visibleBars=function(){var t,e,i,o;if(this._visibleBarsCache)return this._visibleBarsCache;if(!this.isEmpty())return t=Math.ceil(this.m_width/this.m_barSpacing)-1,e=Math.round(this.m_rightOffset+this.m_points.lastTimePointIndex()),i=e-t,o=new a(i,e),this._visibleBarsCache=o,o},s.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()},s.prototype.indexToCoordinate=function(t,e){var i,o;return this.isEmpty()?0:TradingView.isInteger(t)?(i=this.m_points.lastTimePointIndex()+this.m_rightOffset-t,o=this.m_width-(i+.5)*this.m_barSpacing,e?o:Math.round(o)):0},s.prototype.barIndexesToCoordinates=function(t){var e,i,o,n;for(e=0;e<t.length;e++)i=t[e].time,o=this.m_points.lastTimePointIndex()+this.m_rightOffset-i,n=this.m_width-(o+.5)*this.m_barSpacing,t[e].time=Math.round(n),t[e].exactTime=n},s.prototype.indexesToCoordinates=function(t){var e,i,o,n=this.m_points.lastTimePointIndex()+this.m_rightOffset,s=this.m_width-n*this.m_barSpacing-.5*this.m_barSpacing;for(e=0;e<t.length;e++)i=t[e].x,o=s+i*this.m_barSpacing,t[e].x=Math.round(o)},s.prototype.coordinateToIndex=function(t){var e=(this.m_width+1-t)/this.m_barSpacing,i=this.m_points.lastTimePointIndex(),o=i+this.m_rightOffset-e,n=Math.round(1e6*o)/1e6;return Math.ceil(n)},s.prototype.timeToCoordinate=function(t){function e(t){return t<=0||t>=l.m_width}var i,o,n,s=this.m_points.closestIndexLeft(t),r=this.m_points.valueAt(s),a=this.indexToCoordinate(s,!0),l=this;return e(a)?null:(i=this.barSpacing(),o=function(){var t=this.m_points.lastTimePointIndex();return this.m_points.valueAt(t)-this.m_points.valueAt(t-1)}.bind(this)(),n=Math.round(a+(t-r)/o*i)+1,e(n)?null:n)},s.prototype.alignCoordinate=function(t){if(this.isEmpty())return t;var e=this.coordinateToIndex(t);return this.indexToCoordinate(e)},s.prototype.timePointToIndex=function(t){return this.m_points.indexOf(t,!0)},s.prototype.indexToTimePoint=function(t){var e=this.m_points.valueAt(t);return e?new Date(1e3*e):null},s.prototype.indexToUserTime=function(t){return this.m_tickmarks.indexToTime(t)},s.prototype.marks=function(){var t,e,i,o,n,s,r,a,l,h,c,d;if(this.isEmpty())return null;for(t=this.m_barSpacing,e=this._scalesProperties.fontSize.value()||0,i=5*(e+4),o=Math.round(i/t),n=this.visibleBars(),s=Math.max(n.firstBar(),n.firstBar()-o),r=Math.max(n.lastBar(),n.lastBar()-o),a=this.m_tickmarks.build(t,i),l=[],h=0;h<a.length;++h)c=a[h],s<=c.index&&c.index<=r&&null!==(d=this.m_tickmarks.indexToTime(c.index))&&l.push({coord:this.indexToCoordinate(c.index),label:this.formatLabel(d,c.span),span:c.span,major:c.label>=TradingView.DAY_SPAN?1:0});return l},s.prototype.state=function(t){var e={};return e.m_barSpacing=this.barSpacing(),e.m_rightOffset=this.m_rightOffset,t&&(this.m_points.size()>0&&(e.m_lastVisibleBar=this.m_points.valueAt(this.m_points.lastTimePointIndex())),e.points=this.m_points.state(),e.tickmarks=this.m_tickmarks.state(),e.width=this.m_width),e},s.prototype.restoreState=function(t,e,i){var o,n,s;return this._visibleBarsCache=null,void 0===t.m_barSpacing?void TradingView.logDebugChart("TimeScale.restoreState: invalid state"):void 0===t.m_rightOffset?void TradingView.logDebugChart("TimeScale.restoreState: invalid state"):(this.m_barSpacing=t.m_barSpacing,this.m_rightOffset=t.m_rightOffset,this.m_restoredLastTimePoint=t.m_lastVisibleBar,i&&this.m_restoredLastTimePoint&&(o=this.m_points.indexOf(this.m_restoredLastTimePoint),n=this.m_points.lastTimePointIndex(),s=n-o,this.m_rightOffset=-s+t.m_rightOffset),e&&(this.m_points.restoreState(t.points),this.m_tickmarks.restoreState(t.tickmarks),t.width&&(this._locked=!0,this.m_width>0&&(this.m_barSpacing*=this.m_width/t.width))),void this._correctOffset())},s.prototype.setOffset=function(t){if(this._visibleBarsCache=null,void 0===t)return void TradingView.logDebugChart("TimeScale.setOffset: invalid state");this.m_rightOffset=t,this._correctOffset()},s.prototype.setBarSpacing=function(t){if(this._visibleBarsCache=null,void 0===t)return void TradingView.logDebugChart("TimeScale.setBarSpacing: invalid state");this.m_barSpacing=t},s.prototype._correctOffset=function(){if(!this.isEmpty()){var t=this.m_width/this.m_barSpacing-10;t>0&&this.m_rightOffset>t&&(this.m_rightOffset=t,this._visibleBarsCache=null),t=this.m_points.size()-10,this.m_rightOffset<-t&&(this.m_rightOffset=-t,this._visibleBarsCache=null)}},s.prototype.maxOffset=function(){return this.m_width/this.m_barSpacing-10},s.prototype.startScale=function(t){this.m_scrollStartPoint&&this.endScroll(),null===this.m_scaleStartPoint&&null===this.m_stateSnapshot&&(this.isEmpty()||(this.m_scaleStartPoint=t,this.m_stateSnapshot=this.state()))},s.prototype.scaleTo=function(t){var e,i;this._visibleBarsCache=null,delete this.m_restoredLastTimePoint,null!==this.m_stateSnapshot&&(e=r.clamp(this.m_width-t,0,this.m_width),i=r.clamp(this.m_width-this.m_scaleStartPoint,0,this.m_width),0!==e&&0!==i&&(this.m_barSpacing=this.m_stateSnapshot.m_barSpacing*e/i,this.m_barSpacing<TradingView.MIN_BAR_SPACING?this.m_barSpacing=TradingView.MIN_BAR_SPACING:this.m_barSpacing>TradingView.MAX_BAR_SPACING&&(this.m_barSpacing=TradingView.MAX_BAR_SPACING),this._correctOffset(),this.recalcLockedScale()))},s.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.saveDefault("barSpacing"))},s.prototype.saveDefault=function(t){d(!0),this._properties[t].setValue(this["m_"+t]),d(!1)},s.prototype.startScroll=function(t){null===this.m_scrollStartPoint&&null===this.m_stateSnapshot&&(this.isEmpty()||(this.m_scrollStartPoint=t,this.m_stateSnapshot=this.state()))},s.prototype.scrollTo=function(t){if(this._visibleBarsCache=null,delete this.m_restoredLastTimePoint,null!==this.m_scrollStartPoint){var e=(this.m_scrollStartPoint-t)/this.barSpacing();this.m_rightOffset=this.m_stateSnapshot.m_rightOffset+e,this._correctOffset(),this._model.mainSeries().priceScale().properties().percentage.value()&&this.recalcLockedScale(),this._onScroll.fire()}},s.prototype.scrollToOffsetAnimated=function(t,e){var i,o,n,s;if(!isFinite(t))throw new RangeError("offset is required and must be finite number");if(void 0===e&&(e=400),!isFinite(e)||e<=0)throw new RangeError("animationDuration (optional) must be finite positive number");i=this,o=this.m_rightOffset,n=+new Date,s=this._model,function r(){i._visibleBarsCache=null;var a=(new Date-n)/e;if(a>=1)return i.m_rightOffset=t,i._visibleBarsCache=null,s.recalculateAllPanes(),void s.invalidate(new c(c.LIGHT_UPDATE));i.m_rightOffset=o+(t-o)*a,s.recalculateAllPanes(),setTimeout(r,20)}()},s.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this.m_stateSnapshot=null)},s.prototype._currentSavedPosition=function(){var t,e,i;this.isEmpty()||(t=this.m_points.indexOf(this.m_restoredLastTimePoint,!0),TradingView.isInteger(t)&&(e=this.m_points.lastTimePointIndex(),i=e-t,this.m_rightOffset-=i),delete this.m_restoredLastTimePoint)},s.prototype.update=function(t,e,i,o){this._visibleBarsCache=null,this.m_tickmarks.merge(o),this.m_points.merge(t,e,i),this.m_restoredLastTimePoint&&this._currentSavedPosition()},s.prototype.addTail=function(t,e,i){var o,n,s;for(this.m_tickmarks.removeTail(e),o=t.params,n=this.m_tickmarks.maxIndex+(i?0:1),s=0;s<o.marks.length;s++)o.marks[s].index=n+s;this.m_tickmarks.addTail(o.marks),this.m_points.addTail(o.changes,i),this.m_rightOffset-=o.changes.length},s.prototype.formatLabel=function(t,e){if(this._formattedBySpan[e])return this._formattedBySpan[e].format(t.valueOf());var i=this;return this._formattedBySpan[e]=new l(function(t){return i.formatLabelImpl(new Date(t),e)}),this._formattedBySpan[e].format(t)},s.prototype.formatLabelImpl=function(t,e){if(!(t&&t instanceof Date))return"incorrect time";var i=this._model.mainSeries().isDWM();return e<TradingView.MINUTE_SPAN&&!i?p(t.getUTCHours(),2)+":"+p(t.getUTCMinutes(),2)+":"+p(t.getUTCSeconds(),2):e<TradingView.DAY_SPAN&&!i?p(t.getUTCHours(),2)+":"+p(t.getUTCMinutes(),2):e<TradingView.WEEK_SPAN?t.getUTCDate():e<TradingView.MONTH_SPAN?t.getUTCDate():e<TradingView.YEAR_SPAN?(TradingView.MONTH_NAMES||(TradingView.MONTH_NAMES=n()),TradingView.MONTH_NAMES[t.getUTCMonth()]):t.getUTCFullYear()},s.prototype.normalizeBarIndex=function(t){var e=0,i=0;return t<this.m_points.firstTimePointIndex()?(e=this.m_points.valueAt(this.m_points.firstTimePointIndex()),i=t-this.m_points.firstTimePointIndex()):t>this.m_points.lastTimePointIndex()?(e=this.m_points.valueAt(this.m_points.lastTimePointIndex()),i=t-this.m_points.lastTimePointIndex()):(e=this.m_points.valueAt(t),i=0),{time_t:e,offset:i}},s.prototype.denormalizeTimePoint=function(t){var e=this.m_points.indexOf(t.time_t);if(void 0!==e)return e+t.offset},s.prototype.zoomToBarsRange=function(t,e){if(!(e<=t)){var i=this.m_points.lastTimePointIndex();i&&(this.m_rightOffset=e-i),this.m_barSpacing=this.width()/(e-t+1),this._visibleBarsCache=null}},s.prototype.recalcLockedScale=function(){var t,e,i,n,s,r,a,l;this._model.m_mainSeries.properties().lockScale.value()&&!this.isEmpty()&&(t=this._model.m_mainSeries.priceScale(),e=this._model.m_mainSeries,i=e.data().boxSize,i||(e.fixBoxSize(),i=e.data().boxSize),i&&(t.properties().percentage.value()&&(n=e.data().search(e.getRealVisibleRange().m_firstBar).value[TradingView.CLOSE_PLOT],i=o.prototype.convertToPercent.call(null,n+i,n)-o.prototype.convertToPercent.call(null,n,n)),s=t.internalHeight()/(this.barSpacing()/i),(r=e.priceScale().priceRange())&&s===r.length()||(!r||r.isEmpty()?(a=this.visibleBars(),r=e.priceRange(a.firstBar(),a.lastBar())):(l=(s-r.length())/2,r.m_minValue-=l,r.m_maxValue+=l),e.priceScale().setPriceRange(r))))},s.prototype.correctBarSpacing=function(){this.isEmpty()||this.points().size()<this.width()/this.barSpacing()&&(this.setOffset(TradingView.DEFAULT_RIGHT_OFFSET),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),TradingView.MAX_BAR_SPACING)))},s.prototype.canZoomIn=function(){return this.m_barSpacing<TradingView.MAX_BAR_SPACING},s.prototype.canZoomOut=function(){return this.m_barSpacing>TradingView.MIN_BAR_SPACING},s.prototype.onScroll=function(){return this._onScroll},t.exports=s}).call(e,i(34),i(103))},function(t,e,i){(function(e){"use strict";function i(){this._marksByIndex={},this._marksBySpan=[],this.changed=new e}i.prototype.reset=function(){this._marksByIndex={},this._marksBySpan=[],delete this.minIndex,delete this.maxIndex,delete this._cache,this.changed.fire()},i.prototype.minIndex=void 0,i.prototype.maxIndex=void 0,i.prototype.merge=function(t){var e,i,o,n,s,r=this._marksBySpan,a={};for(e=0;e<t.length;e++){if(i=t[e],o=i.index,n=i.span,s=this._marksByIndex[i.index]){if(s.index===i.index&&s.span===i.span){s.time=i.time;continue}this._removeTickmark(s)}this._marksByIndex[o]=i,this.minIndex<=o||(this.minIndex=o),this.maxIndex>=o||(this.maxIndex=o),r[n]||(r[n]=[]),r[n].push(i),a[n]=!0}for(n=r.length;n--;)r[n]&&(r[n].length||delete r[n],a[n]&&r[n].sort(this._sortByIndexAsc));delete this._cache,this.changed.fire()},i.prototype._removeTickmark=function(t){var e,i,o=t.index;this._marksByIndex[o]===t&&(delete this._marksByIndex[o],o<=this.minIndex&&this.minIndex++,o>=this.maxIndex&&this.maxIndex--,this.maxIndex<this.minIndex&&(delete this.minIndex,delete this.maxIndex),e=this._marksBySpan[t.span],(i=e.indexOf(t))!==-1&&e.splice(i,1))},i.prototype._sortByIndexAsc=function(t,e){return t.index-e.index},i.prototype.removeTail=function(t){var e,i={};this.maxIndex=0;for(e in this._marksByIndex)this._marksByIndex[e].time<t&&(i[e]=this._marksByIndex[e],this.maxIndex=Math.max(this.maxIndex,e));this._marksByIndex=i},i.prototype.addTail=function(t){for(var e=0;e<t.length;e++)t[e].index=this.maxIndex+e+1;this.merge(t)},i.prototype.indexToTime=function(t){var e=this._marksByIndex[t];return e?new Date(1e3*e.time):null},i.prototype.density=function(){var t,e=this.maxIndex-this.minIndex;if(0!==e)return t=this._marksByIndex[this.maxIndex].time-this._marksByIndex[this.minIndex].time,1e3*t/e},i.prototype.estimateLeft=function(t){var e,i=this.density();if(i)return e=1e3*this._marksByIndex[this.minIndex].time-t,e/i},i.prototype.nearestIndex=function(t){for(var e,i=this.minIndex,o=this.maxIndex;o-i>2;){if(1e3*this._marksByIndex[i].time===t)return i;if(1e3*this._marksByIndex[o].time===t)return o;e=Math.round((i+o)/2),1e3*this._marksByIndex[e].time>t?o=e:i=e}return i},i.prototype.build=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f,m=Math.ceil(e/t);if(this._maxbar===m&&this._cache)return this._cache;for(this._maxbar=m,i=[],o=this._marksBySpan.length;o--;)if(this._marksBySpan[o]){for(n=i,i=[],s=n.length,r=0,a=this._marksBySpan[o],l=a.length,h=1/0,c=-(1/0),d=0;d<l;d++){for(p=a[d],u=p.index;r<s;){if(_=n[r],!((f=_.index)<u)){h=f;break}r++,i.push(_),c=f,h=1/0}h-u>=m&&u-c>=m&&(i.push(p),c=u)}for(;r<s;r++)i.push(n[r])}return this._cache=i,this._cache},i.prototype.state=function(){var t,e=[];for(t=this._marksBySpan.length;t--;)this._marksBySpan[t]&&(e=e.concat(this._marksBySpan[t]));return e=e.map(function(t){return[t.span,t.time,t.index]}),{marks:e,version:2}},i.prototype.restoreState=function(t){if(this._marksByIndex={},this._marksBySpan=[],delete this.maxIndex,delete this.minIndex,t&&t.marks&&t.marks.length)if(2===t.version){var e=t.marks.map(function(t){return{span:t[0],time:t[1],index:t[2]}});this.merge(e)}else this.merge(t.marks)},t.exports=i}).call(e,i(34))},function(t,e){"use strict";function i(){this._zoffset=0,this._items=[],this._lastTimePointIndex=null}i.prototype.clear=function(){this._zoffset=0,this._items=[],this._lastTimePointIndex=null},i.prototype.items=function(){return this._items},i.prototype.size=function(){return this._items.length},i.prototype.firstTimePointIndex=function(){return this.offsetToIndex(0)},i.prototype.lastTimePointIndex=function(){return null!==this._lastTimePointIndex&&void 0!==this._lastTimePointIndex?this._lastTimePointIndex:(this._lastTimePointIndex=this.offsetToIndex(this.size()-1),this._lastTimePointIndex)},i.prototype.merge=function(t,e,i){var o,n,s,r,a,l,h;if(0===this._items.length)return this._items=i,this._zoffset=e,[{change:"rebuild",index:0}];if((o=t+this._zoffset)<0){for(n=Math.abs(o),this._items=Array(n).concat(this._items),this._zoffset=e,s=0;s<i.length;++s)this._items[t+s+e]=i[s];return[{change:"rebuild",index:0}]}for(r=[],s=o;s<this._items.length&&s-o<i.length;++s)this._items[s]=i[s-o],r.push({change:"update",index:s-this._zoffset,value:i[s-o]});if((a=o+i.length)>this._items.length)for(n=a-this._items.length,l=s;l<s+n;++l)h=this._items.length,this._items.push(i[l-o]),r.push({change:"append",index:h-this._zoffset,value:i[l-o]});return this._zoffset=e,this._lastTimePointIndex=null,r},i.prototype.addTail=function(t,e){for(var i=e?1:0;i<t.length;i++)this._items.push(t[i]),this._lastTimePointIndex++},i.prototype.valueAt=function(t){var e=this.indexToOffset(t);if(void 0!==e)return this._items[e]},i.prototype.indexOf=function(t,e){if(e&&t>this._items[this._items.length-1])return this.offsetToIndex(this._items.length-1);for(var i=0;i<this._items.length&&!(t<this._items[i]);++i)if(!(t>this._items[i]))return this.offsetToIndex(i);return e?this.offsetToIndex(i):void 0},i.prototype.offsetToIndex=function(t){if(0<=t&&t<this.size())return t-this._zoffset},i.prototype.indexToOffset=function(t){var e=t+this._zoffset;if(0<=e&&e<this.size())return e},i.prototype.state=function(){var t={};return t.zoffset=this._zoffset,t.items=this._items,t},i.prototype.restoreState=function(t){t&&(this._zoffset=t.zoffset,this._items=t.items,this._lastTimePointIndex=null)},i.prototype.roughTime=function(t,e){var i,o,n,s,r,a,l,h,c,d=this.valueAt(t);if(void 0===d){if(i=this._items,!i.length||i.length<2)return;if(o=this.firstTimePointIndex(),n=this.lastTimePointIndex(),s=this.valueAt(o),r=this.valueAt(n),a=(r-s)/(n-o),t<o)return l=o-t,h=l*a,d=s-h;if(c=500,t>n)return(l=t-n)<c&&e?e(r,l):(h=l*a,d=r+h)}return d},i.prototype.roughIndex=function(t,e){var i,o,n,s,r,a,l,h,c,d=this._items;if(d.length&&!(d.length<2))return i=this.firstTimePointIndex(),o=this.lastTimePointIndex(),n=this.valueAt(i),s=this.valueAt(o),t>=n&&t<=s?this.closestIndexLeft(t):(r=(s-n)/(o-i),t<n?(a=n-t,l=Math.round(a/r),i-l):(h=500,t>s?(a=t-s,l=Math.trunc(a/r),l<h&&e&&(c=e(s,t),c.success&&(l=c.result)),o+l):void 0))},i.prototype.closestIndexLeft=function(t){var e,i,o,n,s,r,a=this._items;if(a.length&&t===t){if(e=a.length-1,i=a[e],t>=i)return e-this._zoffset;if(o=0,n=a[o],!(t<n)){if(t===n)return o-this._zoffset;for(;e>o+1;)if(s=o+e>>1,(r=a[s])>t)e=s;else{if(!(r<t))return r===t?s-this._zoffset:void 0;o=s}return o-this._zoffset}}},t.exports=i},function(t,e,i){"use strict";function o(t){a.call(this,t);var e=this;l.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!l.hideMarksOnBars().value())}),this._paneView=new n(this)}function n(t,e){this.source=t,this._rendererFactory=e,this.stylesCache={},this.templatesCache={},this._createLollipops()}var s=i(30),r=i(268).ESDPaneView,a=i(269).BarsMarksContainer,l=i(92),h=i(36);inherit(o,a),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedTimescaleMarks",o.prototype._plateViewData=function(t){return{text:t.text}},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;h.emit("onTimescaleMarkClick",t)},o.prototype.clearMarks=function(){a.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getTimescaleMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=Math.max(t.minSize/2,.4*this.barWidth())*-1,e},o.prototype.hasContextMenu=function(){return!1},o.prototype.paneViews=function(t){return this._properties.visible.value()?[this._paneView]:[]},inherit(n,r),n.prototype._createLollipops=function(){var t,e,i,o;this.lollipops=[],t=this.source._model.timeScale(),e=r.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),o=this,$.each(this.source._marks,function(n,r){var a={id:r.id,basePoint:new s.Point(t.indexToCoordinate(t.timePointToIndex(r.tickmark))+1,e),hovered:i&&i.id===r.id,barY:null,label:r.label,color:r.color,tooltip:r.tooltip};o.lollipops.push(a)})},n.prototype.update=function(){this._createLollipops()},n.prototype.renderer=function(){return this.update(),r.prototype.renderer.call(this)},n.prototype._generateTemplateStyle=function(t,e,i){var o,n,s=t+e+i;return s in this.stylesCache||(o={strokeStyle:e,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:64,circleHeight:35,radius:11,lineWidth:2,fillStyle:"white",strokeStyle:"#E2745B",text:{label:i,strokeStyle:e,font:"normal 12px Verdana, Arial, sans-serif"}}},n={lollipop:{fillStyle:e,text:{strokeStyle:"white"}}},this.stylesCache[s]="default"===t?o:$.extend(!0,{},o,n)),this.stylesCache[s]},n.prototype.getTemplate=function(t,e){var i=t+e.color+e.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(t,e.color,e.label))),this.templatesCache[i]},n.prototype.getStyle=function(t,e){return this._generateTemplateStyle(t,e.color,e.label)},n.prototype.createText=function(t,e){t.tooltip.forEach(function(t){e.addTextLine(t)})},n.prototype.hasTooltip=function(t){return!!t.tooltip&&t.tooltip.length},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._model=t,this._study=e,this._metaInfo=e.metaInfo(),this.lollipops=[],this._textCache={},this.templatesCache={},this._invalidated=!0,this.templatesCache.hovered=this.createTemplate(this.hoveredStyle),this.templatesCache.default=this.createTemplate(this.defaultStyle)}function n(t){this.data=t}function s(t){this.data=t,this._hittest=new l(l.REGULAR,t)}function r(t){this._data=t,this.textRenderer=new r.TextRenderer}var a=i(30),l=i(113),h=i(117);o.prototype._setStackStudies=function(){this._stackStudies=[]},o.prototype._getY=function(){var t,e,i=0,o=this._model.panes();for(t=o.length;t--;)e=o[t],e.containsMainSeries()&&(i+=e.height());return i},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,r,a,l,h;this._setStackStudies(),this.lollipops=[],t=this,e=this._study.data(),i=this._model.timeScale(),o=i.visibleBars(),n=this._model.mainSeries().bars(),s=this._study.priceScale(),r=this._model.mainSeries(),a=r.firstBar(),s&&!s.isEmpty()&&!i.isEmpty()&&a&&e&&(l=this._getY(),h=e.range(o.firstBar(),o.lastBar()),h.each(function(e,o){var r,a=0;for(r=0;r<t._stackStudies.length;++r)t._stackStudies[r].data().contains(e)&&++a;t.addLollipop(l,n,i,s,e,o,a)}),this.afterUpdate(l,n,i,s))},o.prototype.addLollipop=function(t,e,i,o,n,s,r){var l,h,c,d,p=s[0],u=null,_=this._study.metaInfo().id+"_"+p,f=this._model.lastHittestData(),m=f&&f.id===_;m&&(l=e.valueAt(n))&&(h=l[TradingView.LOW_PLOT],o.isPercent()&&(c=this._model.mainSeries().firstValue(),h=o.priceRange().convertToPercent(h,c)),u=o.priceToCoordinate(h)),d=$.extend({id:_,basePoint:new a.Point(i.indexToCoordinate(n)+1,t),hovered:m,barY:u,stack:r},this.extraData(s)),this.lollipops.push(d)},o.prototype.afterUpdate=function(t,e,i){},o.prototype.extraData=function(t){throw Error("Not Implemented")},o.prototype.createText=function(t,e){throw Error("Not Implemented")},o.prototype.showBarLine=function(){return!0},o.prototype.getStyle=function(t,e){var i,o=t;return e.stack&&(o+="_stack:"+e.stack),"hovered"===o?this.hoveredStyle:"default"===o?this.defaultStyle:(this._stylesCache||(this._stylesCache={}),this._stylesCache[o]||(i=TradingView.clone("hovered"===t?this.hoveredStyle:this.defaultStyle),e.stack&&(i.lollipop.incHeight=24*e.stack),this._stylesCache[o]=i),this._stylesCache[o])},o.prototype.hasTooltip=function(t){return!0},o.prototype.renderer=function(){var t,e,i,o,l,c,d,p,u;for(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new h,e=0;e<this.lollipops.length;e++)i=this.lollipops[e],o=15,l=this.getStyle(i.hovered?"hovered":"default",i),i.hovered&&this.hasTooltip(i)&&(i.barY&&this.showBarLine()&&(c={style:{lineStyle:l.barLine.lineStyle,strokeStyle:l.strokeStyle,lineWidth:l.lineWidth},startPoint:new a.Point(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight),endPoint:new a.Point(i.basePoint.x,i.barY)},t.append(new n(c))),d=$.extend({tooltipPoint:new a.Point(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-o-(l.lollipop.incHeight||0)),style:l,createText:this.createText},i),t.append(new r(d))),p=this.getTemplate(i.hovered?"hovered":"default",i),u={circlePoint:new a.Point(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-(l.lollipop.incHeight||0)),style:l,template:p,basePoint:i.basePoint,id:i.id},t.append(new s(u));return t},o.prototype.getTemplate=function(t,e){var i=t;return e.stack&&(i+="_stack:"+e.stack),this.templatesCache[i]||(this.templatesCache[i]=this.createTemplate(this.getStyle(t,e))),this.templatesCache[i]},o.prototype.createTemplate=function(t){var e=document.createElement("canvas"),i=e.getContext("2d"),o=new a.Point(t.lollipop.width/2,t.lollipop.height),n=new a.Point(t.lollipop.width/2,t.lollipop.height-t.lollipop.circleHeight-(t.lollipop.incHeight||0));return this.drawStick(i,t,o,n),this.drawCircle(i,t,n),this.drawLabel(i,t,n),e},o.prototype.drawCircle=function(t,e,i){t.fillStyle=e.lollipop.fillStyle,t.lineWidth=e.lollipop.lineWidth,CanvasEx.setLineStyle(t,CanvasEx.LINESTYLE_SOLID),t.beginPath(),t.arc(i.x,i.y,e.lollipop.radius,0,2*Math.PI,!1),t.closePath(),t.stroke(),t.fill()},o.prototype.drawLabel=function(t,e,i){t.textAlign="center",t.textBaseline="middle",t.fillStyle=e.lollipop.text.strokeStyle,t.font=e.lollipop.text.font,t.fillText(e.lollipop.text.label,i.x,i.y)},o.prototype.drawStick=function(t,e,i,o){t.strokeStyle=e.strokeStyle,t.lineWidth=e.lineWidth,CanvasEx.setLineStyle(t,CanvasEx.LINESTYLE_DASHED),CanvasEx.drawLine(t,i.x,i.y,o.x,o.y)},n.prototype.draw=function(t){t.strokeStyle=this.data.style.strokeStyle,t.lineWidth=this.data.style.lineWidth,CanvasEx.setLineStyle(t,this.data.style.lineStyle),CanvasEx.drawLine(t,this.data.startPoint.x,this.data.startPoint.y,this.data.endPoint.x,this.data.endPoint.y)},n.prototype.hitTest=function(t){return null},s.prototype.hitTest=function(t){return a.isInCircle(this.data.circlePoint,this.data.style.lollipop.radius,t)?this._hittest:null},s.prototype.draw=function(t){var e=this.data.template;t.drawImage(e,this.data.basePoint.x-(.5+this.data.style.lollipop.width/2<<0)+.5,this.data.basePoint.y-this.data.style.lollipop.height+.5)},r.prototype.draw=function(t){var e=this._data.tooltipPoint;this._data.createText(this._data,this.textRenderer),this.drawFrame(t,e),this.drawTip(t,e)},r.prototype.hitTest=function(t){return null},r.prototype.drawTip=function(t,e){var i=5,o=this.calcMarginX(t,e.x,i),n=e.x+o;t.lineWidth=this._data.style.lineWidth,t.strokeStyle=this._data.style.fillStyle,t.fillStyle=this._data.style.fillStyle,t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(n-i,e.y-i),t.lineTo(n+i,e.y-i),t.fill(),t.closePath(),t.stroke(),t.strokeStyle=this._data.style.strokeStyle,t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(n-i,e.y-i),t.moveTo(e.x,e.y),t.lineTo(n+i,e.y-i),t.closePath(),t.stroke()},r.prototype.drawFrame=function(t,e){var i,o,n=200,s=5,r=7,l=12,h=this.textRenderer.measure()+l+r,c=this.calcMarginX(t,e.x,n/2);t.lineWidth=this._data.style.lineWidth,CanvasEx.setLineStyle(t,CanvasEx.LINESTYLE_SOLID),t.strokeStyle=this._data.style.strokeStyle,t.fillStyle=this._data.style.fillStyle,t.beginPath(),t.rect(e.x-n/2+c,e.y-s-h,n,h),t.closePath(),t.stroke(),t.fill(),i=e.x-n/2+16+c,o=e.y-s-h+r+this.textRenderer.fontHeight,this.textRenderer.draw(t,new a.Point(i,o))},r.prototype.calcMarginX=function(t,e,i){var o=5,n=5,s=0,r=t.canvas.clientWidth;return e-i<o?s=Math.abs(e-(i+o)):e+i>r-n&&(s=-Math.abs(r-(i+e+n))),s},r.TextRenderer=function(){this.lines=[],this.fontHeight=12,this.font=this.fontHeight+"px Arial, sans-serif",this.lineSpacing=8,this.fillStyle="black"},r.TextRenderer.prototype.draw=function(t,e){var i,o,n=e.y;for(i=0;i<this.lines.length;i++)o=this.lines[i],t.font=this.font,o.options.fontWeight&&(t.font=o.options.fontWeight+" "+this.font),t.fillStyle=this.fillStyle,o.renderer(t,o.line,{x:e.x,y:n}),n+=this.lineSpacing+this.fontHeight},r.TextRenderer.prototype.measure=function(){return this.lines.length*(this.fontHeight+this.lineSpacing)-this.lineSpacing},r.TextRenderer.prototype.basicRenderer=function(t,e,i){t.fillText(e,i.x,i.y)},r.TextRenderer.prototype.addMulticolorTextLine=function(t,e){this.addTextLine(t,e,this.multicolorRenderer)},r.TextRenderer.prototype.addTextLine=function(t,e,i){i||(i=this.basicRenderer),e||(e={}),this.lines.push({line:t,renderer:i,options:e})},r.TextRenderer.prototype.multicolorRenderer=function(t,e,i){var o,n,s=i.x;for(o=0;o<e.length;++o)n=e[o],t.fillStyle=n.color,t.fillText(n.text,s,i.y),s+=t.measureText(n.text).width},e.ESDPaneView=o},function(t,e,i){(function(t,o){"use strict";function n(e,i){var n,s=e._undoModel._chartWidget,r=s.onWidget(),a=!1;a=r?s._options&&!s._options.hideIdeas:TVSettings.getBool("BarsMarksContainer.visibile",!1),i?i.merge({visible:a,frozen:!1}):i=new t({visible:a,frozen:!1}),n=this,i.visible.listeners().subscribe(null,function(t){r||s._containsData||TVSettings.setValue("BarsMarksContainer.visibile",!!t.value()),n._tooltip&&n._tooltip.removeAll()}),d.call(this,e,null,i),this.onNeedRepaint=new o,this._requests=[],this._marks={},this._loadedRange=null,this._getDataTimeout=null,this._collectedRange=null,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks),this._model.mainSeries().onSymbolResolved().subscribe(this,this.clearMarks),this._model.mainSeries().onTickmarksRangeChanged().subscribe(this,this.getData),this._initialize(),this.pinnedTooltips={},this._tooltip=new l(this._createTooltip.bind(this),this)}function s(t,e,i){this.source=t,this.pane=e,this._rendererFactory=i}function r(t,e){this._barWidth=t.barWidth,this._plates=t.plates,this._tooltip=t.tooltip,this._model=e}function a(){this._layout=[],this._currentId=void 0,this.tooltipHovered=!1}function l(t,e){this.tooltips={},this.tooltipFactory=t,this.source=e}function h(t,e){this.renderer=t,this._tooltip=e,this.visible=!1}var c=i(30),d=i(82).LineDataSource,p=i(113);inherit(n,d),n.prototype._constructor="Child class must override this member",n.prototype._initialize=function(t){throw Error("Child class must override this member")},n.prototype.onClicked=function(){throw Error("Child class must override this member")},n.prototype._getData=function(t){throw Error("Child class must override this member")},n.prototype._createTooltip=function(){throw Error("Child class must override this member")},n.prototype.updateDotData=function(t,e){return e},n.prototype.updatePlateData=function(t,e){},n.prototype._plateViewData=function(t){return{}},n.prototype.pinTooltip=function(t,e){this.pinnedTooltips[t]=e},n.prototype.timeScale=function(){return this._model.timeScale()},n.prototype.getIntervalInTicks=function(){function t(t){if((t=parseInt(t))!=t)throw new TypeError("Unexpected interval");return 60*t}var e=t(1440),i=7*e,o=31*e,n=this._model.mainSeries().properties().interval.value();switch(n){case"M":return o;case"W":return i;case"D":return e;default:return t(n)}},n.prototype._maxDate=new Date(2037,0,1),n.prototype.getVisibleTickmarksRange=function(){var t,e;return this.timeScale().isEmpty()?{start:0,end:0}:(t=this.timeScale().visibleBars(),t.lastBar()>this.timeScale().points().firstTimePointIndex()&&t.firstBar()<this.timeScale().points().lastTimePointIndex()?(e=t.lastBar()<this.timeScale().points().lastTimePointIndex()?this.timeScale().indexToTimePoint(t.lastBar()):this._maxDate,t={start:this.timeScale().indexToTimePoint(Math.max(t.firstBar(),this.timeScale().points().firstTimePointIndex())),end:e},{start:t.start?t.start.getTime()/1e3:void 0,end:t.end?t.end.getTime()/1e3:void 0}):{start:0,end:0})},n.prototype.getVisibleRangePlates=function(){var t=[],e=this.getVisibleTickmarksRange(),i=this.getIntervalInTicks();return $.each(this._marks,function(o,n){var s=n.tickmark;s>=e.start&&s<=e.end+i&&t.push(n)}),t},n.prototype.getPublishedPlates=function(){var t={},e=this;return is_authenticated?($.each(this.getVisibleRangePlates(),function(i,o){o.is_public&&(e.pinnedTooltips[o.id]||o.user__id===user.id)&&(t[o.id]=o)}),t):t},n.prototype._maxPlatesPerBar=10,n.prototype.filterDisplayedPlates=function(t){return t=t.reduce(function(t,e){var i=this._getIndex(e.tickmark);return t[i]=t[i]||[],t[i].push(e),t}.bind(this),{}),t=Object.keys(t).reduce(function(e,i){var o=t[i];return o=o.sort(function(t,e){return e.views_count-t.views_count}),o=o.slice(0,this._maxPlatesPerBar),e.concat(o)}.bind(this),[])},n.prototype._layout=function(t){switch(t){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}},n.prototype._theme=function(t){switch(t){default:case 0:return"neutral";case 1:return"green";case 2:return"red";case 3:return"yellow";case 4:return"blue";case 5:return"green";case 6:return"red"}},n.prototype._offset=function(t,e){var i;switch(t){default:case"up":i=e[TradingView.HIGH_PLOT];break;case"down":i=e[TradingView.LOW_PLOT]}return this.priceScale().isPercent()&&(i=this.priceScale().priceRange().convertToPercent(i,this.ownerSource().firstValue())),this.priceScale().priceToCoordinate(i)},n.prototype._getIndex=function(t){return this.timeScale().timePointToIndex(t)},n.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}},n.prototype.barWidth=function(){return this.timeScale().barSpacing()},n.prototype.getPlatesViewData=function(){var t,e,i,o,n,s;if(this._model.mainSeries().data().isEmpty())return[];t=this.filterDisplayedPlates(this.getVisibleRangePlates()),e=this,i={},o=this._model.lastHittestData(),t=t.map(function(t){var n,s,r,a,l,h,c=this._getIndex(t.tickmark),d=this._getBar(c);return!!d&&(n=this._layout(t.direction),s=this._theme(t.direction),r=o&&o.id===t.id,a=this.timeScale().indexToCoordinate(c),l=this._offset(n,d),h=0,c in i||(i[c]={up:0,down:0}),h=i[c][n]++,TradingView.merge({id:t.id,x:a,y:l,order:h,direction:n,theme:s,hovered:r,pinned:e.pinnedTooltips[t.id]===!0,user__id:t.user__id,label:t.label,labelFontColor:t.labelFontColor||"#444",minSize:t.minSize||0},this._plateViewData(t)))}.bind(this)),t=t.filter(function(t){return!!t}),n=t.filter(function(t){return t.hovered===!0});for(s=0;s<t.length;s++)null!=n[0]&&t[s].user__id===n[0].user__id&&(t[s].highlightByAuthor=!0);return t.sort(function(t,e){return t.hovered&&!e.hovered?1:0}),t},n.prototype._getBar=function(t){return this._model.mainSeries().data().valueAt(t)},n.prototype.paneViews=function(t){var e=this;return this._properties.visible.value()?[new s(this,t,function(t){return new r(t.getViewData(),e)})]:[]},n.prototype.dataWindowView=function(){return null},n.prototype.priceAxisViews=function(){return null},n.prototype.statusView=function(){return null},n.prototype.updateAllViews=function(){},n.prototype.pointsCount=function(){return 0},n.prototype.properties=function(){return this._properties},n.prototype._rangeDifference=function(t){return t=$.extend({},t),this._loadedRange&&(t.start<this._loadedRange.start?t.end=this._loadedRange.start:t.end>this._loadedRange.end&&(t.start=this._loadedRange.end)),t},n.prototype._rangeUnion=function(t,e){return t=$.extend({},t),e&&(t.start=Math.min(e.start,t.start),t.end=Math.max(e.end,t.end)),t},n.prototype._pushGetDataStack=function(t){if(!t.end||!t.start)throw new TypeError("Wrong tickmark range");this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._collectedRange=this._rangeUnion(t,this._collectedRange),this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange),this._getDataTimeout=this._collectedRange=null}.bind(this),300)},n.prototype.roundRange=function(t){return{start:Math.round(t.start),end:Math.round(t.end)}},n.prototype.refreshData=function(){this.getData(this._lastRange)},n.prototype.getData=function(t){if(!t.start||!t.end)throw new TypeError("Wrong range");this._lastRange=t;var t=$.extend({},t);t.end=this._maxDate/1e3,this._pushGetDataStack(t)},n.prototype._abortAllRequests=function(){this._requests.forEach(function(t){t.abort()}),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null},n.prototype.clearMarks=function(){this._abortAllRequests(),this._marks={},this._loadedRange=null},s.prototype.update=function(){},s.prototype.renderer=function(){return this._rendererFactory(this.source)},r.prototype.draw=function(t){t.save();for(var e=0;e<this._plates.length;e++)if(this._plates[e].highlightByAuthor){this._highlightByAuthor=!0;break}this._plates.forEach(this._drawItem.bind(this,t)),this._tooltip.draw(this._plates.map(function(t){return this._plateTransform(t)}.bind(this)),t),this._tooltip.endDraw(),t.restore()},r.prototype._drawItem=function(t,e){t.save(),this._highlightByAuthor&&!e.highlightByAuthor&&(t.globalAlpha=.4);var i=this._dotTransform(e);i.mine?this._drawTriangle(t,i):this._drawDot(t,i),t.restore()},r.prototype._commonTransform=function(t){var e=Math.max(1.4*t.minSize,this._barWidth+4),i=t.y+{up:-1,down:1}[t.direction]*(e*(t.order+.6)+.25*e),o=TradingView.clone(t.overridedTheme||this.themes[t.theme]);return o.dotBorderWidth=t.hovered||t.highlightByAuthor?4:2,{id:t.id,theme:o,themeName:t.theme,x:Math.round(t.x+1),y:Math.round(i),pinned:t.pinned,hovered:t.hovered}},r.prototype._dotTransform=function(t){var e=this._commonTransform(t);return e.radius=Math.max(t.minSize/2,.4*this._barWidth),e.label=t.label,e.labelFontColor=t.labelFontColor,e.labelFontSize=Math.ceil(Math.max(10,Math.min(e.radius,20))),this._model.updateDotData(t,e)},r.prototype._plateTransform=function(t){var e=this._commonTransform(t);return this._model.updatePlateData(t,e)},r.THEMES=["green","red","neutral","yellow","blue"],r.prototype.themes={green:{border:"#78C143",background:"#8DDD54"},red:{border:"#CC4545",background:"#ED5A5A"},neutral:{border:"#EAC300",background:"#FFD400"},yellow:{border:"#EAC300",background:"#FFD400"},blue:{border:"#047ACE",background:"#0496FF"}},r.prototype._drawTriangle=function(t,e){var i,o,n,s;t.strokeStyle=e.theme.border,t.fillStyle=e.theme.background,t.lineWidth=e.theme.dotBorderWidth,i=e,o=e.radius,n=Math.cos(Math.PI/6)*o,s=Math.sin(Math.PI/6)*o,t.translate(i.x,i.y),"up"===e.direction&&t.rotate(Math.PI),e.public||(t.lineWidth/=2),t.beginPath(),t.moveTo(0,-o),t.lineTo(n,s),t.lineTo(-n,s),t.lineTo(0,-o),t.closePath(),t.stroke(),e.public&&t.fill()},r.prototype._drawDot=function(t,e){t.strokeStyle=e.theme.border,t.fillStyle=e.theme.background,t.lineWidth=e.theme.dotBorderWidth,t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI,!0),t.closePath(),t.stroke(),t.fill(),e.label&&e.radius>6&&(t.textAlign="center",t.textBaseline="middle",t.font="bold "+e.labelFontSize+"px Arial",t.fillStyle=e.labelFontColor,t.fillText(e.label,e.x,e.y))},r.prototype.hitTest=function(t){var e,i;for(i=this._plates.length-1;i>=0;--i)if(e=this._hitTestDot(this._plates[i],t))return e;return null},r.prototype._hitTestDot=function(t,e){var i=this._dotTransform(t),o=new c.Point(i.x,i.y);return c.isInCircle(o,Math.max(i.radius,8),e)?new p(p.REGULAR,t):null},a.prototype._createLayout=function(){throw Error("Child class must override this member")},a.prototype._updatePlate=function(t){throw Error("Child class must override this member")},a.prototype._getContainer=function(t){return this._container&&this._context===t||(this._context=t,this._container=$(t.canvas).parent()),this._container},a.prototype._plateArrowSize=14,a.prototype.showPlate=function(t,e){var i,o,n,s,r,a,l;this._currentId===t.id&&this._layout&&0!==this._layout.length&&null!=this._layout[0].parentNode||(this._currentId=t.id,this._createLayout(),this._getContainer(e).append(this._layout),i=this,this._layout.hover(function(){i.tooltipHovered=!0,$(this).stop(!0).fadeTo(0,1)},function(){i.tooltipHovered=!1})),o=Math.round(t.barWidth/2),o>15&&(o=15),o<10&&(o=10),this._updatePlate(t),n=t.x-this._layout.outerWidth()<this._plateArrowSize,s=e.canvas.width-t.x+Math.round(t.barWidth/2+o),n&&(s-=this._layout.outerWidth()+2*this._plateArrowSize),r=e.canvas.height,a=20,l=10,this._layout.toggleClass("right",n),this._layout.css({top:Math.min(Math.max(t.y,a),r-this._layout.outerHeight()-l),right:s,fontSize:o+"px",display:"block"})},a.prototype._removeLayout=function(){this.tooltipHovered||(this._layout.stop(!0),this._layout.remove())},a.prototype._toggleLayout=function(t){this._layout.toggle(t)},a.prototype.hide=function(t){this.tooltipHovered?this._layout.stop(!0).fadeTo(0,1):this._layout.fadeOut(400,function(){$(this).remove(),t()})},a.prototype.setSource=function(t){this.source=t},l.prototype.findOrCreateTooltip=function(t){var e=this.tooltips[t.id];return null==e&&(t.hovered||t.pinned)&&(e=this._createTooltip(),this.tooltips[t.id]=e),e},l.prototype.showPlate=function(t,e){var i=this.findOrCreateTooltip(t);null!=i&&(i._drawPlate(t,e),i.plateData=t)},l.prototype.draw=function(t,e){this.hoveredId=null;for(var i=0;i<t.length;i++)t[i].hovered&&(this.hoveredId=t[i].id);t.forEach(function(t){this.showPlate(t,e)}.bind(this))},l.prototype.endDraw=function(){var t,e,i=this;for(t in this.tooltips)this.tooltips.hasOwnProperty(t)&&(e=this.tooltips[t],e.toggleVisibility(),i.hoveredId&&e.plateData.id!==i.hoveredId&&!e.plateData.pinned&&(e.remove(),delete this.tooltips[t]))},l.prototype.removeAll=function(){var t,e;for(t in this.tooltips)this.tooltips.hasOwnProperty(t)&&(e=this.tooltips[t],e.remove());this.tooltips={}},l.prototype.removeTooltip=function(t){delete this.tooltips[t]},l.prototype._createTooltip=function(){return new h(this,this.tooltipFactory())},h.prototype._drawPlate=function(t,e){var i=this;this.visible=!0,this._tooltip.setSource(this.renderer.source),this._tooltip.showPlate(t,e),t.hovered||t.pinned||this._tooltip.hide(function(){i.renderer.removeTooltip(t.id)})},h.prototype.remove=function(){this._tooltip._removeLayout()},h.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible),this.visible=!1},e.BarsMarksContainer=n,e.BarsMarksContainerRenderer=r,e.BarMarkTooltip=a}).call(e,i(83),i(34))},function(t,e,i){"use strict";function o(t){r.call(this,t);var e=this;l.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!l.hideMarksOnBars().value())})}function n(t){a.call(this)}var s=i(269),r=s.BarsMarksContainer,a=s.BarMarkTooltip,l=i(92);inherit(o,r),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedBarsMarks",o.prototype._plateViewData=function(t){var e={text:t.text};return"object"==typeof t.color&&(e.theme="user_defined_theme",e.overridedTheme={},e.overridedTheme.border=t.color.border,e.overridedTheme.background=t.color.background),e},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;this._marks[t].onClicked()},o.prototype.clearMarks=function(){r.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype._createTooltip=function(){return new n},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=Math.max(t.minSize/2,.4*this.barWidth())*-1,e},o.prototype.hasContextMenu=function(){return!1},inherit(n,a),n.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>'),this._layout_text=$('<div class="text"></div>').appendTo(this._layout)},n.prototype._updatePlate=function(t){this._currentId=t.id,this._layout.css("border-color",t.theme.border),this._layout.css("margin-top",t.tooltipMargin+"px"),this._layout_text.html(t.text),this._layout.append(this._layout_text)},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,i,o){s.call(this,t),this._origState=i,this._title=o;var r={visible:!0};this._properties=new e(r),this._statusView=new n(this,t.properties()),this._status=$.t("compiling..."),this._statusView.setText(this._title+" "+this._status),this._formatter=new a(Math.pow(10,2)),this._failed=!1}var n=i(179),s=i(89).PriceDataSource,r=i(94),a=r.PriceFormatter;inherit(o,s),o.prototype.properties=function(){return this._properties},o.prototype.statusView=function(){return this._statusView},o.prototype.state=function(t){return this._origState},o.prototype.setStatus=function(t){this._status=t,this._statusView.setText(this._title+" "+this._status)},o.prototype.formatter=function(){return this._formatter},o.prototype.title=function(){return this._title},o.prototype.setFailed=function(t){this._failed=t},o.prototype.start=function(t){},o.prototype.firstValue=function(t){return null},t.exports=o}).call(e,i(83))},function(t,e){t.exports={STATUS_OFFLINE:0,STATUS_RESOLVING:1,STATUS_LOADING:2,STATUS_READY:3,STATUS_INVALID_SYMBOL:4,STATUS_SNAPSHOT:5,STATUS_EOD:6,STATUS_PULSE:7,STATUS_DELAYED:8,STATUS_DELAYED_STREAMING:9,STATUS_NO_BARS:10}},function(t,e,i){"use strict";TradingView.PublishedChartsTimeline=function(){},TradingView.LinearRegressionPaneView=function(){},TradingView.study_PivotPointsStandard=function(){},TradingView.study_PivotPointsHighLow=function(){},TradingView.study_ZigZag=function(){},TradingView.study_LinearRegression=function(){},TradingView.study_ElliottWave=function(){},TradingView.ESDStudyBase=function(){},TradingView.Pro=function(){this.hasPackage=function(){return!1}},window.user={is_pro:!1,settings:{}},TradingView.Pro.prototype.getStudies=function(){return[]},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]},TradingView.LineToolRegressionTrend=function(){},TradingView.templates=i(72),TradingView.templates.dialogs={symbolSearch:'<div class="symbol-block"><div class="spread-actions"></div><div class="symbol-block-inputspacer"><input maxlength="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+'" /><div class="search-cion"></div></div></div><div class="filter"></div><div class="results"></div>'},TradingView.AlertLabel=function(){},TradingView.getDataVendorString=function(){},window.Telemetry={sendReport:function(){}},TradingView.study_VbPVisible=function(){},TradingView.study_VbPSessions=function(){},TradingView.LineToolVbPFixed=function(){},TradingView.study_ESD$TV_DIVIDENDS=function(){},TradingView.study_ESD$TV_SPLITS=function(){},TradingView.study_ESD$TV_EARNINGS=function(){},TradingView.MockupRequestedCache=function(t){t&&t([])},TradingView.MockupRequestedCache.invalidate=function(){},TradingView.StudyStrategy=function(){},TradingView.LinetoolTemplatesList=function(){},window.PublishedScript={suggest:function(){var t=$.Deferred();return t.resolve(null),t}}},function(t,e,i){"use strict";var o=i(36),n=i(28).parseJSONorNot,s=function(){var t,e,i,s,r={};return r.initialize=function(o,n,r,a){t=o,e=n,i=r,s=a},r.updateUser=function(t){e=t},r.getCharts=function(o){return $.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"GET",crossDomain:!0}).done(function(t){var e,i=n(t);"ok"!==i.status&&console.warn("Charts list request failed: "+i.message),e=i.data.map(function(t){return{id:t.id,name:t.name,image_url:t.id,modified_iso:t.timestamp,short_symbol:t.symbol,interval:t.resolution}}),o(e)})},r.removeChart=function(o,r){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"DELETE",crossDomain:!0}).done(function(t){var e=n(t);"ok"!==e.status&&console.warn("Chart delete request failed: "+e.message),r()})},r.saveChart=function(o,r,a,l,h,c,d){var p=h.id.value(),u="{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e));void 0!==p&&(u+="&chart="+encodeURIComponent(p)),$.ajax({url:u,data:{name:o,content:JSON.stringify(l),symbol:r,resolution:a},type:"POST",crossDomain:!0}).done(function(t){var e=n(t);if("ok"!==e.status)return console.warn("Chart save request failed: "+e.message),void d();c(e.id)}).fail(function(){d()})},r.loadChart=function(r){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(r.id)),type:"GET",crossDomain:!0}).done(function(t){var e,i=n(t);if("ok"!==i.status)return void console.warn("Chart load request failed: "+i.message);e=JSON.parse(i.data.content),e.uid=r.id,o.emit("chart_load_requested",e)}).fail(function(){console.warn("Error loading chart")})},r.removeStudyTemplate=function(o,r){$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"DELETE",crossDomain:!0}).done(function(t){var e=n(t);"ok"!==e.status&&console.warn("Chart delete request failed: "+e.message),r()})},r.getStudyTemplateContent=function(o,r){$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"GET",crossDomain:!0}).done(function(t){r(n(t).data)})},r.saveStudyTemplate=function(o,r){$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"POST",crossDomain:!0,data:{name:o.name,content:o.content}}).done(function(t){var e=n(t);"ok"!==e.status&&console.warn("Template save request failed: "+e.message),r({error:"ok"===e.status?"":e.status})})},r._templatesCache=null,r.getStudyTemplatesList=function(o){if(r._templatesCache)return void o(r._templatesCache);r._templatesCache=[],$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"GET",crossDomain:!0}).done(function(t){var e,i;if(null!==r._templatesCache){if(e=n(t),"ok"!==e.status)return void console.warn("Templates list request failed: "+e.message);i=e.data.map(function(t){return{is_default:!1,name:t.name}}),r._templatesCache=i,o(i)}})},r.invalidateStudyTemplatesList=function(){r._templatesCache=null},r}();t.exports=s},function(t,e,i){(function(t,o,n){"use strict";function s(e){this._chartWidgetCollection=e,this._chartAboutToBeSavedDelegate=new t,this._chartSavedDelegate=new t}function r(t,e,i,o){var s,r;o=o||{},s={wl:o.wl,images:JSON.stringify(t.images()),previews:o.previews},(o.cme||"cme"===t.activeChartWidget.value().widgetCustomer())&&(s.cme=!0),s.timezone=t.activeChartWidget.value()._properties.timezone.value(),window.urlParams&&window.urlParams.locale&&(s.language=urlParams.locale),r=n.enabled("charting_library_base")?o.snapshotUrl||"https://www.tradingview.com/snapshot/":"/snapshot/",$.post(r,s,function(t){t?e(t):i()}).fail(function(){i()})}var a=i(276);s.prototype.chartAboutToBeSaved=function(){return this._chartAboutToBeSavedDelegate},s.prototype.chartSaved=function(){return this._chartSavedDelegate},s.prototype.whenReadyToSave=function(t){var e,i,o=this._chartWidgetCollection,n=o.activeChartWidget.value(),s=n.model().mainSeries();s.symbolInfo()&&!s.hasDelayedSymbolIntervalChange()?t():(e=null,i=null,e=function(){s.onSymbolError().unsubscribe(null,i,!0),t()},i=function(){s.onSymbolResolved().unsubscribe(null,e,!0)},s.onSymbolResolved().subscribe(null,e,!0),s.onSymbolError().subscribe(null,i,!0))},s.prototype.saveToJSON=function(){return this._fillSavingInfo(!1,!0)},s.prototype._fillAsyncInfo=function(t,e,i){function o(e){t.content=JSON.stringify($.extend(!0,s,e)),n.resolve(t)}var n,s=JSON.parse(t.content),r=this._chartWidgetCollection;return e||(i=!0),n=$.Deferred(),i?r.asyncState(!!e).then(o):r.activeChartWidget.value().asyncState(!!e).then(o),n.promise()},s.prototype._fillSavingInfo=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f,m;if(t||(e=!0),o={publish_request_id:Math.random().toString(36).substring(2)},n=this._chartWidgetCollection,s=n.activeChartWidget.value(),r=n.metaInfo,a=s.model().mainSeries(),l=a.properties(),h=a.symbolInfo(),!a||!r||!h)throw new ReferenceError("Missed required data");for(r.id.value()&&(o.id=r.id.value()),o.name=r.name.value()||"",o.description=r.description.value()||"",o.resolution=a.properties().interval.value(),o.symbol_type=h.type||"",o.exchange=h.exchange||"",o.listed_exchange=h.listed_exchange||"",a.isSpread()?(c=h.legs[0],d=h.base_name[0],d=d.split(":")[1],o.symbol=c,o.short_name=d,o.expression=h.full_name):(p=h.ticker||l.symbol.value(),u=l.shortName.value(),o.symbol=p,o.short_name=u),_=[],f=0,m=h.legs.length;f<m;f++)_.push({symbol:h.legs[f],pro_symbol:h.base_name[f]});return o.legs=JSON.stringify(_),o.content=e?JSON.stringify(n.state(!!t,i)):JSON.stringify(s.state(!!t,i)),t&&(o.image=JSON.stringify(n.images({onlyActiveChart:!e}))),o.is_realtime=t?"0":"1",o},s.prototype.publishChart=function(t){},s.prototype.onPublish=function(t,e){function i(i){var n,s,r,l,h,c,d;a.publishInProgress=!1,n=i.responseText,"ok:"===n.substr(0,3)?(s=!1,e.savePrivacySetting&&(s=!t.is_public,TVSettings.setValue("publishchart.private",s)),kmRecord("Chart","{0} Published".format(void 0===t.script_type?"Chart":"Script"),{is_private:s}),r=n.substr(3),l=JSON.parse(r),a._chartWidgetCollection.metaInfo.id.value()||a._chartWidgetCollection.metaInfo.id.setValue(l.id),e.closeForm&&e.closeForm(),a._lastPublishUrl=l.publishUrl,a.hWnd&&(h=l.publishUrl,e.ideaUrl&&(h=o.render(e.ideaUrl,{idea:l.idea})),a.hWnd.location=h)):(e.showError&&(n=TradingView.strip_tags(n),(413===i.status||/^[\d\s]*request.+large/i.test(n.trim()))&&(c="support@tradingview.com",n=$.t("This chart layout has a lot of objects and can't be published! Please report to {0} for further&nbsp;details.").format('<a href="mailto:'+c+'">'+c+"</a>"),d={html:!0}),e.showError(n||$.t("Error occured while publishing"),d)),a.hWnd&&(a.hWnd.close(),a.hWnd=null))}var n,s,r,a=this;a.publishInProgress||(n=a._fillSavingInfo(!0,e&&e.publishAllLayout,!0),a._fillAsyncInfo(n,!0,e&&e.publishAllLayout).then(function(e){var o=t.scriptPublication;new Promise(function(e,i){o?ScriptLib.publishNew(o.scriptSource,o.scriptProtection).done(function(i){delete t.scriptPublication,e(i.publishedstudyscript_id)}).fail(function(){i()}):e()}).then(function(o){o&&(t.publishedstudyscript_id=o),$.ajax({url:"/publishchart/",type:"post",dataType:"text",data:$.extend({},e,t),complete:i})})}),a.publishInProgress=!0,e.onWidget&&!e.ideaUrl||""!==t.name&&""!==t.description&&t.description.length<=4e3&&t.name.length<=64&&($.cookie("publish_request_id",n.publish_request_id,{path:"/"}),s="/loading/",e.ideaUrl&&(r=urlParams.createUrlParams({ideaUrl:e.ideaUrl}),s="/loading?"+r),a.hWnd=window.open(s,"_blank")))},s._saveChart=function(t,e,i,o,n){var s=i,r=o;return s=function(t){e.id.value()||(e.id.setValue(t),e.uid.setValue(t)),"function"==typeof i&&i()},a.saveChart(t.name,t.short_name,t.resolution,t,e,s,r)},s.prototype.saveChartSilently=function(t,e,i,o){var n=this._chartWidgetCollection.metaInfo,r=this._fillSavingInfo(e);if(o=o||{},o.chartName&&(r.name=o.chartName),!r.name)return void console.warn("Saving chart with empty name is not allowed");$(window).on("beforeunload.savechart",function(){return $.t("Your chart is being saved, please wait a moment before you leave this page.")}),this._chartAboutToBeSavedDelegate.fire(),s._saveChart(r,n,function(){this._chartWidgetCollection.metaInfo.name.setValue(r.name),this._chartSavedDelegate.fire(!0),t&&t(n)}.bind(this),function(){this._chartSavedDelegate.fire(!1),i&&i.apply(null,arguments)}.bind(this),o),$(window).off("beforeunload.savechart")},e.ChartSaver=s,e.takeSnapshot=r}).call(e,i(34),i(52),i(1))},function(t,e,i){"use strict";t.exports=i(274)},function(t,e,i){(function(e){"use strict";function o(t,e){l.invalidateStudyTemplatesList(),l.removeStudyTemplate(t,e)}function n(t){this._options=t||{},this._chartWidgetCollection=this._options.chartWidgetCollection,this._SAVE_AS_TITLE=$.t("Save Study Template As..."),this._list=[],this._$wrapper=null,this._favoredList=null,this._loaded=!1,this._onFirstLoad=new e,this.onFavoriteListResize=new e,loginStateChange.subscribe(this,this.onLoginStateChange)}var s=i(183),r=s.FavoredList,a=s.showChartNameDialog,l=i(276),h=i(35).trackEvent;n.prototype.onLoginStateChange=function(){l.invalidateStudyTemplatesList(),this.refreshFavoriteDropdownMenu()},n.prototype.appendMenuButtonTo=function(t){t&&(this._$wrapper=t,this._generateFavoriteList())},n.prototype.refreshStudyTemplateList=function(t){var e=this;l.getStudyTemplatesList(function(i){e._list=i||[],"function"==typeof t&&t()})},n.prototype._generateFavoriteList=function(){var t=this;this._favoredList=new r("StudyTemplates",t._listPreparedForFavorite(),{addClass:"study-template-widget",popupAddClass:"study-template-popup",notShowActive:!0,svg:!1,popupSpacing:this._options.popupSpacing,notShowQuicks:this._options.notShowQuicks,tooltip:$.t("Study Templates"),addTooltipClass:"apply-common-tooltip"}),t.refreshFavoriteDropdownMenu(),this._favoredList.element().appendTo(this._$wrapper),this._favoredList.onSelect().subscribe(t,function(t){t!==this._SAVE_AS_TITLE&&this.applyStudyTemplate(t)}),this._favoredList.onSelect().subscribe(t,function(t){t===this._SAVE_AS_TITLE&&this.showSaveAsDiaolg()}),this._favoredList.onResize().subscribe(t._chartWidgetCollection,t._chartWidgetCollection.updateLayout),this._favoredList.onResize().subscribe(this.onFavoriteListResize,this.onFavoriteListResize.fire),this._favoredList.onOpen().subscribe(t,function(){t.refreshFavoriteDropdownMenu()})},n.prototype._listPreparedForFavorite=function(t){var e,o,n,s,r;return t=t||this._list,e=this,o=this.plainList("default"),n=this.plainList("custom"),s=[{id:e._SAVE_AS_TITLE,title:e._SAVE_AS_TITLE,addClass:"special",toQuickButtonStyle:{display:"none"}},{separator:!0}],r=function(t,o){return $.map(t,function(t){var n={id:t,title:$.t(t),svg:$(i(187)).attr({width:13,height:13}),favoriteButton:{icon:{},title:t,addClass:"apply-common-tooltip"}};return o&&(n.drop=function(){this.deleteStudyTemplate(t)}.bind(e)),n})},n.length&&(s=s.concat(r(n,!0)).concat([{separator:!0}])),s=s.concat(r(o))},n.prototype.applyStudyTemplate=function(t){function e(e){h("GUI","Load Study Template"),i.model().model().restoreStudyTemplate(JSON.parse(e.content),t),i.updateSeriesControlUI()}var i=this._chartWidgetCollection.activeChartWidget.value();TVSettings.setValue("defaultStudyTemplate",t),l.getStudyTemplateContent(t,e)},n.prototype.showSaveAsDiaolg=function(){var t=this,e=this._chartWidgetCollection.activeChartWidget.value(),i=function(i,o){var n,s,r,a,h,c,d,p;i=TradingView.clean(i),n=o[0],s=JSON.stringify(e.model().model().studyTemplate(n)),r={name:i,content:s},a=$.inArray(i,t.plainList())!==-1,h=function(){var e=function(e){e.error||(TVSettings.setValue("defaultStudyTemplate",i),l.invalidateStudyTemplatesList(),t.refreshFavoriteDropdownMenu())};l.saveStudyTemplate(r,e)},a?(c=$.t("Confirm replace"),d=$.t("Do you realy want to replace")+' "'+i+'"?<br><small>'+$.t("Note: default study templates won't be removed permanently")+"</small>",p=h,TVDialogs.showConfirm(c,d,p)):h()},o=function(e){t.refreshStudyTemplateList(function(){e.find('[name="name"]').inputselectable({list:t.plainList().sort(),closeHandle:e})})};runOrSignIn(function(){a(i,{title:$.t("Save new study template"),label:$.t("Template name"),error:$.t("Please enter template name")},255,[{title:$.t("Save Interval"),name:"save_interval",type:"bool",hint:$.t('When selecting this checkbox the study template will set "__interval__" interval on a chart',{interval:e.model().model().mainSeries().interval()})}],o)},{source:"Study templates save as",sourceMeta:"Chart"})},n.prototype.refreshFavoriteDropdownMenu=function(){var t=this,e=this._favoredList;e&&t.refreshStudyTemplateList(function(){e.reload(t._listPreparedForFavorite()),e._container.hasClass("active")&&(e._container.trigger("click"),e._openMenu.call(e))})},n.prototype.deleteStudyTemplate=function(t){var e=this,i=$.t("Do you really want to delete {0} study template?").format(t?'"'+t+'"':"");runOrSignIn(function(){TVDialogs.showConfirm($.t("Study Template"),i,function(){e._favoredList.removeById(t),o(t,function(){setTimeout(function(){e.refreshFavoriteDropdownMenu()},0)})})},{source:"Study templates delete"})},n.prototype.container=function(){return this._favoredList?this._favoredList._container:null},n.prototype.list=function(){return this._list},n.prototype.plainList=function(t){return"default"===t?$.map(jQuery.grep(this._list,function(t){return!!t.is_default}),function(t){return t.name}):"custom"===t?$.map(jQuery.grep(this._list,function(t){return!t.is_default}),function(t){return t.name}):$.map(this._list,function(t){return t.name})},t.exports=n}).call(e,i(34))},function(t,e,i){(function(e,o){"use strict";var n=(i(134),function(){function t(t,e){function i(n){function u(i){(o.enabled("same_data_requery")||w.value()!==i)&&(e?e.setSymbol(i):t.setSymbol(i))}function _(){s.setValue(w.value())}function f(t){a.setValue(t.pro_name||window.tradingController&&(t.full_name||t.name))}function m(){r.setValue(b.shortName.value());var t=y.symbolInfo();t?(f(t),t.hasOwnProperty("supported_resolutions")?c.setValue(t.supported_resolutions):c.setValue(void 0),h.setValue(!!t.has_intraday)):(h.deleteValue(),a.deleteValue())}function g(i){(o.enabled("same_data_requery")||S.value()!==i)&&(e?e.setResolution(i):t.setResolution(i))}function v(){l.setValue(S.value())}var y,b,w,S;t.modelCreated().unsubscribe(null,i),y=t.model().mainSeries(),b=y.properties(),w=b.symbol,w.subscribe(null,_),s.setValue(w.value()),s.subscribe(u),y.onSymbolResolved().subscribe(null,f),s.hook=function(t){return y.symbolSameAsCurrent(t)&&(t=y.symbol()),t},y.onSymbolResolved().subscribe(null,m),y.onSymbolError().subscribe(null,m),m(),S=b.interval,S.subscribe(null,v),l.setValue(S.value()),l.subscribe(g),t.readOnly()&&(s.writeLock=!0),d=function(){w.unsubscribe(null,_),s.unsubscribe(u),y.onSymbolResolved().unsubscribe(null,m),y.onSymbolError().unsubscribe(null,m),S.unsubscribe(null,v),l.unsubscribe(g),delete s.hook,delete s.writeLock,d=function(){},p=function(){}}}var n,u;d(),p=function(){return t},n=t.model(),n?i(n):(t.modelCreated().subscribe(null,i),d=function(){t.modelCreated().unsubscribe(null,i),d=function(){},p=function(){}},u=t.properties().mainSeriesProperties,s.setValue(u.symbol.value()),l.setValue(u.interval.value()))}function i(t){function e(t){o=!0,s.setValue(t.resolved_symbol),o=!1}function i(e){o||t.search(e)}u();var o=!1;t.onSearchBySymbol.subscribe(null,e),s.subscribe(i),u=function(){t.onSearchBySymbol.unsubscribe(null,e),s.unsubscribe(i),u=function(){}}}function n(e){d(),e.activeChartWidget.subscribe(function(i){d(),t(i,e)},{callWithLast:!0})}var s=new e,r=new e,a=new e,l=new e,h=new e,c=new e,d=function(){},p=function(){},u=function(){};return{symbol:s,proSymbol:a,seriesShortSymbol:r.readonly(),interval:l,intraday:h.readonly(),supportedResolutions:c.readonly(),bindToChartWidget:t,unbindFromChartWidget:function(){d()},getChartWidget:function(){return p()},bindToSearchCharts:i,unbindFromSearchCharts:function(){u()},bindToChartWidgetCollection:n}}());TradingView.Linking=n,t.exports=n}).call(e,i(90),i(1))},function(t,e,i){"use strict";function o(t){var e=0;t===!0&&(ChartApiInstance.disconnect(),e=500),setTimeout(ChartApiInstance.connect.bind(ChartApiInstance),e)}function n(t,e,i,n){l||(l=(0,r.createDialog)({width:n||600,closeOnOutsideClick:!1,destroyOnClose:!0,type:"modal",contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text tv-text--position-outside"></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">',title:t,content:e,actions:[{name:"reconnect",type:"primary",text:$.t("Reconnect")},{name:"report",type:"primary",text:$.t("Report a data issue")}]}).on("action:reconnect",function(t){t.close(),o(i)}).on("action:report",function(t){t.close(),runOrSignIn(function(){},{source:"Report data issue from disconnect dialog"})}).on("destroy",function(){l=null}).open())}function s(){(0,a.trackEvent)("System","Critical Error"),n($.t("Oops, something went wrong"),$.t("Please report the issue or click Reconnect."),!0,500)}var r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.showCriticalErrorMessage=s,r=i(67),a=i(35),l=null},function(t,e,i){(function(t,e){"use strict";function o(e,i){this.options=$.extend({throttleTimeout:125},i),this._connected=!1,this._symbol_data={},this._subscriptions={},this._delayed_subscriptions=[],this.onConnect=new t,this.onDisconnect=new t,this._quoteApi=new n(ChartApiInstance),this._type=e||"full",this.connect(),this._delayUpdateFastSymbols=r(this._updateFastSymbols,250),this._throttledSymbolData={},this._formatterValuesCache={},this._waitingForFormatters={},this._snapshotValuesCache={},this._waitingForSnapshot={},this.fieldsSent=new $.Deferred}var n,s=i(94).PriceFormatter,r=i(281),a=i(282),l=i(283);n=i(284),o.prototype.destroy=function(){this._quoteApi.destroy(),this._quoteApi=null,this._connected=!1,this.onDisconnect.fire()},o.prototype.type_fields={minichart:["lp","open_time","series_data","description"],simple:["ch","chp","lp","fractional","minmov","minmove2","original_name","pricescale","pro_name","update_mode","volume","symbol_status","description","exchange","short_name","current_session","type","is_tradable"],"simple-detailed":["ch","chp","lp","fractional","minmov","minmove2","original_name","pricescale","pro_name","update_mode","symbol_status","description","exchange","short_name","current_session","type","volume","open_price","high_price","low_price","market_cap_basic","prev_close_price","earnings_per_share_basic_ttm","price_earnings_ttm","beta_1_year"],full:[]},o.prototype.connect=function(t){this._quoteApi.connect(this.quoteHandler.bind(this))},o.prototype.quoteHandler=function(t){var e=t.method,i=t.params;switch(e){case"connected":this._connected||(this._connected=!0,this.onConnected());break;case"quote_list_fields":break;case"quote_symbol_data":this._connected&&this.onSymbolData(i[0]);break;case"disconnected":this._connected&&(this._connected=!1,this.onDisconnect.fire())}},o.prototype.onConnected=function(){this.setFields();var t=Object.keys(this._symbol_data);t.length&&this._quoteApi.quoteAddSymbols(t,{forcePermission:!0}),this._delayed_subscriptions.forEach(function(t){this.subscribe.apply(this,t)},this),this._delayed_subscriptions=[],this.onConnect.fire()},o.prototype.setFields=function(){var t=o.prototype.type_fields[this._type];t&&t.length&&this._quoteApi.quoteSetFields(t),this.fieldsSent.resolve()},o.prototype.onSymbolData=function(t){var e=t.symbolname,i=this._throttledSymbolData[e];i||(i=this._throttledSymbolData[e]={fnDispatch:a(this.dipatchSymbolData.bind(this),this.options.throttleTimeout)}),i.cache?$.extend(!0,i.cache,t):i.cache=t,i.fnDispatch(e)},o.prototype._parseUpdateMode=function(t){var e=t.update_mode;e&&(e=e.match(/(delayed_streaming){1}(?:_([\d]+))?/))&&e[1]&&(e[2]&&(t.update_mode_seconds=+e[2]),t.update_mode=e[1])},o.prototype.dipatchSymbolData=function(t){var e,i,o=this._symbol_data[t],n=this._throttledSymbolData[t].cache;if(delete this._throttledSymbolData[t].cache,this._symbol_data[t]){$.extend(!0,o,n),o.values&&this._parseUpdateMode(o.values);for(e in this._subscriptions)i=this._subscriptions[e],i[t]&&i[t].forEach(function(t){t(o,n)})}},o.prototype.subscribe=function(t,e,i){var o,n;if(!this._connected)return void this._delayed_subscriptions.push(arguments);this._subscriptions[t]=this._subscriptions[t]||{},o=this._subscriptions[t],e=[].concat(e),n=[],e.forEach(function(t){this._symbol_data[t]?o&&o[t]||this._symbol_data[t].subscribers_count++:(this._symbol_data[t]={subscribers_count:1},n.push(t)),o[t]=o[t]||[],o[t].push(i),o[t].fast=!0,this._symbol_data[t]&&this._symbol_data[t].values&&i(this._symbol_data[t],this._symbol_data[t])},this),n.length&&(this._quoteApi.quoteAddSymbols(n,{forcePermission:!0}),this._delayUpdateFastSymbols())},o.prototype.unsubscribe=function(t,e,i){var o,n=this._subscriptions[t];n&&(n[e]&&i?(o=n[e].indexOf(i),~o&&n[e].splice(o,1),n[e].length||delete n[e]):delete n[e]),n&&0===Object.keys(n).length&&delete this._subscriptions[t],this._symbol_data.hasOwnProperty(e)&&(n&&!n[e]&&this._symbol_data[e].subscribers_count--,this._symbol_data[e].subscribers_count||(delete this._symbol_data[e],this._quoteApi.quoteRemoveSymbols([e]),this._delayUpdateFastSymbols()))},o.prototype.setFastSymbols=function(t,e){var i,o;if(this._subscriptions[t]){i=this._subscriptions[t];for(o in i)i[o].fast=e.indexOf(o)!==-1}this._delayUpdateFastSymbols()},o.prototype._updateFastSymbols=function(){if(this._connected){var t=this._fastSymbols();0===t.length?this._quoteApi.quoteHibernateAll():this._quoteApi.quoteFastSymbols(t)}},o.prototype._delayUpdateFastSymbols=o.prototype._updateFastSymbols,o.prototype._fastSymbols=function(){var t,e,i,o=[];for(t in this._subscriptions){e=this._subscriptions[t];for(i in e)e[i].fast&&o.push(i)}return o=l(o)},o.prototype.formatter=function(t){function e(t){var e=new s(t.pricescale,t.minmov,t.fractional,t.minmove2);return"forex"===t.type&&(e.lastCharSup=!0),e}function i(t){return t&&null!=t.pricescale&&null!=t.minmov}var o,n=this;return this._waitingForFormatters[t]?this._waitingForFormatters[t]:(o=new Promise(function(o,s){if(n._formatterValuesCache[t])o(e(n._formatterValuesCache[t]));else{var r=TradingView.guid();n.subscribe(r,[t],function(a){a.error&&(n._waitingForFormatters[t]=null,s(a.error)),i(a.values)&&(n._waitingForFormatters[t]=null,n._formatterValuesCache[t]=a.values,o(e(a.values)),n.unsubscribe(r,t))})}}),this._waitingForFormatters[t]=o,o)},o.prototype.snapshot=function(t){var e,i=this;return this._waitingForSnapshot[t]?this._waitingForSnapshot[t]:(e=new Promise(function(e,o){if(i._snapshotValuesCache[t])e(i._snapshotValuesCache[t]);else{var n=TradingView.guid();i.subscribe(n,[t],function(s){s.error&&(i._waitingForSnapshot[t]=null,o(s.error));var r=s.values;r&&r.minmov&&r.pricescale&&r.description&&(i._waitingForSnapshot[t]=null,i._snapshotValuesCache[t]=r,e(r),i.unsubscribe(n,t))})}}),this._waitingForSnapshot[t]=e,e)},TradingView.QuoteSessionMultiplexer=o,void 0!==e&&e&&e.exports&&(e.exports=o)}).call(e,i(34),i(8)(t))},function(t,e){"use strict";function i(t,e){var i;return function(){clearTimeout(i),i=setTimeout(t.bind.apply(t,[this].concat(Array.prototype.slice.call(arguments))),e)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,t.exports=e.default},function(t,e){"use strict";function i(t,e,i){var o,n,s,r,a=null,l=0;return i=i||{},r=function(){l=i.leading===!1?0:Date.now(),a=null,s=t.apply(o,n),a||(o=n=null)},function(){var h,c=Date.now();return l||i.leading!==!1||(l=c),h=e-(c-l),o=this,n=arguments,h<=0||h>e?(a&&(clearTimeout(a),a=null),l=c,s=t.apply(o,n),a||(o=n=null)):a||i.trailing===!1||(a=setTimeout(r,h)),s}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,t.exports=e.default},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t.reduce(function(t,e,i){return~t.indexOf(e)||t.push(e),t},[])},t.exports=e.default},function(t,e,i){(function(t){"use strict";function e(t){this._chartApi=t,this._sessionid="qs_"+o(),this._sessionstarted=!1}var o=i(27).randomHash;e.prototype.destroy=function(){this._sessionstarted&&(this._chartApi.quoteDeleteSession(this._sessionid),this._sessionid=null,this._sessionstarted=!1)},e.prototype.connected=function(){return this._chartApi.connected()},e.prototype.connect=function(t){this._globalHandler=t,this._chartApi.createSession(this._sessionid,this),this._chartApi.connect()},e.prototype.disconnect=function(){this._chartApi.disconnect()},e.prototype.quoteAddSymbols=function(t,e){t=[].concat(t),e&&e.forcePermission&&(t=t.concat({flags:["force_permission"]})),this._chartApi.quoteAddSymbols(this._sessionid,t)},e.prototype.quoteRemoveSymbols=function(t){this._chartApi.quoteRemoveSymbols(this._sessionid,t)},e.prototype.quoteFastSymbols=function(t){this._chartApi.quoteFastSymbols(this._sessionid,t)},e.prototype.quoteSetFields=function(t){this._chartApi.quoteSetFields(this._sessionid,t)},e.prototype.onMessage=function(t){switch(t.method){case"connected":this._sessionstarted||(this._chartApi.quoteCreateSession(this._sessionid),this._sessionstarted=!0);break;case"disconnected":this._sessionstarted=!1;break;case"critical_error":}this._globalHandler(t)},e.prototype.quoteHibernateAll=function(t){this._chartApi.quoteHibernateAll(this._sessionid)},TradingView.QuoteSession=e,void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(8)(t))},function(t,e){"use strict";window.onload=function(){function t(){function t(t){function e(t){return t.height>10&&t.width>10}function i(t){function e(t,e){return t>=0&&t<=e}var i=t[0].getBoundingClientRect(),o=t.position(),n=[o.top,o.left,o.top+i.height,o.left+i.width],s=$(window);return e(n[0],s.height())&&e(n[1],s.width())&&e(n[2],s.height())&&e(n[3],s.width())}return 1!==t.length?1:t.is(":visible")?"visible"!==t.css("visibility")?3:"none"===t.css("display")?4:1!==t.css("opacity")?5:t.css("z-index")<0?6:e(t[0].getBoundingClientRect())?i(t)?0:8:7:2}function e(t){var e,i=t.find("a");return 1===i.length&&(e=i.attr("href"),e.indexOf("tradingview.com")>=0)}function i(i){var o=i.find(".tv-link");return 0===t(o)&&e(o)}function o(e){var i=e.find(".text");return 0===t(i)&&i.text().indexOf("TradingView")>=0}var n,s=$(".onchart-tv-logo"),r=t(s);if(1===r)s=$(".onchart-custom-logo"),0!==(r=t(s))||i(s)||(r=9);else if(0===r){if(n=s.find("img.solid"),1!==n.length)return 1;r=t(n),0!==r||e(s)?0!==r||o(s)||(r="B"):r="A"}return r}function e(){try{return/^(192|172|10)\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]/.test(location.hostname)||/^.*((?:\.local)|localhost)$/.test(location.hostname)}catch(t){return!1}}location.hostname.indexOf(".")>=0&&!e()&&setTimeout(function(){try{var e=t();window.ga&&0!==e&&ga("send","event","s",e)}catch(t){}},3e4)}},function(t,e,i){(function(e,o){"use strict";function n(t){function i(t,e){var i,o,n=[],r=s[wt].count;for(i=0;i<r;i++)n.push(ft[i].chartWidget.state(t,e));return o={layout:wt,charts:n},Ct.value()&&(o.symbolLock=1),xt.value()&&(o.intervalLock=1),Pt.value()&&(o.trackTimeLock=1),l.hideAllDrawings().value()&&(o.hideAllDrawings=!0),o}function n(t){var e,i=$.Deferred(),o=[],n=s[wt].count;for(e=0;e<n;e++)o.push(ft[e].chartWidget.asyncState(t));return $.when.apply($,o).then(function(){var t,e={charts:[]};for(t=0;t<arguments.length;t++)e.charts.push(arguments[t]);i.resolve(e)}),i}function _(){var t,e,i,o,n,s;if(ot&&ot(it),t=yt||{},yt={width:it.width(),height:it.height()},e=it[0],window.self!==window.top&&e.offsetWidth<e.clientWidth&&e.getBoundingClientRect().width<100&&(i=Math.round(100*e.getBoundingClientRect().width),o=Math.round(100*e.getBoundingClientRect().height),yt={width:i,height:o}),n=!1,t.height===yt.height&&t.width===yt.width&&bt||(n=!0),n)if(Z)f(vt);else for(s=0;s<bt.count;s++)f(s);it.trigger("chart-rect-update",it[0].getBoundingClientRect())}function f(t){var e,i=ft[t];i&&(e=Z?s.s.sizer(0,yt,dt,pt):bt.sizer(t,yt,dt,pt),ft[t].wrap.css({width:Math.max(e.width||0,0),height:Math.max(e.height||0,0),top:Math.max(e.top||0,0),left:Math.max(e.left||0,0)}),i.metrics&&i.metrics.width===e.width&&i.metrics.height===e.height||(i.metrics=e,i.chartWidget&&i.chartWidget.resize()))}function m(){for(var t=0;t<ft.length;t++)ft[t].chartWidget.resizeSeriesControlUI()}function g(){for(var t=0;t<ft.length;t++)ft[t].chartWidget.tickSeriesControlClock()}function v(t){var e,i,o,n;return t=$.extend({chartWidgetCollection:ct,isActive:0===ft.length},t||{}),i=$(document.createElement("div")).addClass("chart-container").appendTo(it).css({position:"absolute",overflow:"hidden"}),i.on("mousedown touchstart",function(){ut.setValue(e)}),o=ft.length,n={wrap:i},ft.push(n),f(o),t.jqParent=i,n.chartWidget=e=new r.ChartWidget(t),ct.firstWidgetInitialized||e.chartWidgetInitialized.subscribe(null,function(){try{c.sendEvent("chart_widget_initialized")}catch(t){}ct.firstWidgetInitialized=!0,m()},!0),ct.createLogo&&(e.createLogo=ct.createLogo,u.enabled("move_logo_to_main_pane")||e.withModel(e,function(){e.createLogo(null,e._jqMainDiv),e.adaptOnChartLogo()})),t.containsData?e.finishInitWithoutConnect():e.connect(),b(),w(),st.fire(e),e}function y(t,e){var i,o,n,r;d.emit("layout_about_to_be_changed",t),wt=t,Z=e,J.setValue(Z),t in s||(t="s"),bt=s[t],i=bt.count,yt={width:it.width(),height:it.height()};for(o=0;o<i||o<ft.length;o++)n=e?vt===o:o<i,n?(ft[o]?(it.append(ft[o].wrap),ft[o].chartWidget.isDetached=!1,(r=St.shift())&&(Tt=!0,ft[o].chartWidget.loadContent(r.content),Tt=!1)):v($.extend({},Q,St.shift()||(ut.value()?{content:ut.value().state()}:null)||{},0===o||Ct.value()?{}:{defSymbol:null})),ft[o].wrap.toggleClass("multiple",i>1),f(o)):ft[o]&&(ft[o].chartWidget.isDetached=!0,ft[o].wrap.detach());b(),d.emit("layout_changed")}function b(){var t,e=Math.min(bt.count,ft.length)-1;if(e<0)return void ut.deleteValue();t=vt,t<0&&(t=0),t>e&&(t=e),ut.setValue(ft[t].chartWidget)}function w(){var t,e;for(t=ft.length;t--;)e=t===vt,ft[t].wrap.toggleClass("active",e).toggleClass("inactive",!e)}function S(){return $.grep(ft,function(t){return!t.chartWidget.isDetached}).sort(function(t,e){var i=t.metrics.top,o=e.metrics.top,n=t.metrics.left,s=e.metrics.left;return i===o?n<s?-1:n>s?1:0:i<o?-1:1})}function T(){var t,e,i,o=ct.layout.value();"s"!==o&&(t=s[o].count,J.value()||(mt=S()),e=gt+1,i=mt[e],!i||e>t?(i=mt[0],gt=0):gt=e,ut.setValue(i.chartWidget),J.value()&&y(o,!0))}function C(t){var e,i,o,n;lt!==t&&(lt&&(lt.modelCreated().unsubscribe(null,x),(e=lt.model())&&(i=e.mainSeries().properties(),i.style.unsubscribe(null,P),o=e.model(),o.onSelectedSourceChanged().unsubscribe(null,L),lt=null)),t&&(n=t.model(),n?x(n):t.modelCreated().subscribe(null,x),lt=t))}function x(t){var e,i=t.mainSeries().properties();i.style.subscribe(null,P),P(i.style),e=t.model(),e.onSelectedSourceChanged().subscribe(null,L),L(t.selectedSource())}function P(t){rt.setValue(t.value())}function L(t){at.setValue(t)}function k(t){var e,i,o,n;if(t!==Ct.value()){if(a.UndoHistory.beginUndoMacro("Symbol Lock"),t)for(e=ut.value(),i=e.getSymbol(),o=0;o<ft.length;o++)(n=ft[o].chartWidget)!==e&&n.getSymbol()!==i&&n.setSymbol(i);a.UndoHistory.setWatchedValue(Ct,t,"Symbol Lock"),a.UndoHistory.endUndoMacro()}}function I(t){var e,i,o,n;if(t!==xt.value()){if(a.UndoHistory.beginUndoMacro("Interval Lock"),t)for(e=ut.value(),i=e.getResolution(),o=0;o<ft.length;o++)(n=ft[o].chartWidget)!==e&&n.getResolution()!==i&&n.setResolution(i);a.UndoHistory.setWatchedValue(xt,t,"Resolution Lock"),a.UndoHistory.endUndoMacro()}}function E(t){Pt.value()!==t&&a.UndoHistory.setWatchedValue(Pt,t,"Track Time")}function A(t){Ct.value()?V(t):ut.value().setSymbol(t)}function V(t){var e,i,o=!1;for(e=0;e<ft.length;e++)i=ft[e].chartWidget,(i.model().mainSeries().properties().symbol.value()!==t||u.enabled("same_data_requery"))&&(o||(a.UndoHistory.beginUndoMacro("Change Symbol"),o=!0),i.setSymbol(t));o&&a.UndoHistory.endUndoMacro()}function M(t){var e,i,o;if(!Tt)if(xt.value()){for(e=!1,i=0;i<ft.length;i++)o=ft[i].chartWidget,o.model().mainSeries().properties().interval.value()!==t&&(e||(a.UndoHistory.beginUndoMacro("Change Resolution"),e=!0),o.setResolution(t));e&&a.UndoHistory.endUndoMacro()}else ut.value().setResolution(t)}function D(t){var e,i,o;if(t&&t.onlyActiveChart||Z)return{layout:"s",hidpiRatio:window.hidpiCanvasRatio||1,charts:[ut.value().images()]};for(e=[],i=bt.count,o=0;o<ft.length&&o<i;o++)e.push(ft[o].chartWidget.images());return{layout:wt,hidpiRatio:window.hidpiCanvasRatio||1,charts:e}}function O(){var t,e=[];for(t=0;t<ft.length&&t<bt.count;t++)e=e.concat(ft[t].chartWidget.tags());return e=$.unique(e),e=$.map(e,function(t){return t.toLowerCase().replace(/\W+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")})}function B(t,e,i,o){var n,s,r,a;if(i||It&&!Z)for(n=bt.count,s=0;s<ft.length&&s<n;s++)(r=ft[s].chartWidget)!==e&&(a=r.model())&&a.model().setExternalPosition(t,o)}function R(t,e){var i,o,n,s;if(Pt.value()){for(i=bt.count,a.UndoHistory.beginUndoMacro("Sync Time"),o=0;o<ft.length&&o<i;o++)if(n=ft[o].chartWidget,s=n.model()){if(s.model()===e)continue;s.gotoTime(t,{centerIfVisible:!1,model:e})}a.UndoHistory.endUndoMacro()}}function N(){return nt.resolve(),ft.forEach(function(t){t.chartWidget.destroy()})}function F(){return nt.promise()}function W(){return st}function z(){et.id.setValue(void 0),et.uid.setValue(void 0),et.name.setValue(void 0)}function H(){var e={snapshotUrl:t.snapshotUrl};(u.enabled("show_dialog_on_snapshot_ready")?p.getImageOfChart:p.getImageOfChartSilently)(this,e,function(t){d.emit("onScreenshotReady",t)})}function U(){for(var t=s[wt].count;t<ft.length;t++)ft[t].chartWidget.destroy();ft.splice(s[wt].count)}function j(t){for(var e=0;e<ft.length;e++)ft[e].chartWidget.applyOverrides(t)}function q(){return it}function Y(t){return u.enabled("charting_library_base")?t:"s"===t||u.enabled(productFeatures.MULTIPLE_CHARTS)&&u.getConfig(productFeatures.MULTIPLE_CHARTS).layout.indexOf(t)>=0||Q.containsData||_t?t:"s"}function G(t){if(St=[],t){t.charts||(t={layout:"s",charts:[t]}),wt=Y(t.layout||"s");for(var e=0;e<t.charts.length;e++)St.push({content:t.charts[e]});t.symbolLock&&Ct.setValue(!0),t.intervalLock&&xt.setValue(!0),t.trackTimeLock&&Pt.setValue(!0),t.hideAllDrawings&&Lt.setValue(!0)}X.setValue(wt),y(wt,Z),l.hideAllDrawings().setValue(Lt.value()),St.splice(0,St.length)}function K(){0===--ht&&d.emitOnce("onChartReady")}var X,Z,J,Q,tt,et,it,ot,nt,st,rt,at,lt,ht,ct=this,dt=2,pt=0,ut=new e,_t=!1,ft=[],mt=[],gt=0,vt=0,yt=null,bt=null,wt="s",St=[],Tt=!1,Ct=new e(!1),xt=new e(!1),Pt=new e(!1),Lt=new e(!1),kt=new e(TVSettings.getBool("chart.syncCrosshair",!0)),It=kt.value();kt.subscribe(function(t){t=!!t,It=t,TVSettings.setValue("chart.syncCrosshair",t)}),X=new e(wt),Z=!1,J=new e(Z),t=t||{},"padding"in t&&(dt=t.padding),"edge"in t&&(pt=t.edge),Q=t.widgetOptions||{},Q.readOnly&&(_t=!0),tt=t.metaInfo||{},et={id:new e(tt.id),name:new e(tt.name),description:new e(tt.description),username:new e(tt.username),uid:new e(tt.uid)},it=$(t.jqParent).eq(0),ot=t.onResize,nt=$.Deferred(),st=new o,this.updateLayout=_,rt=new e,at=new e,rt.subscribe(function(t){var e,i,o=ut.value();o&&(e=o.model())&&(i=e.mainSeries().properties().style,i.value()!==t&&e.setChartStyleProperty(i,t,"Change Series Style"))}),lt=null,ut.subscribe(function(t){var e,i;if(t){for(i=ft.length;i--;)if(ft[i].chartWidget===t){e=i;break}if(!isFinite(e))throw Error("Cannot make detached ChartWidget active");if(vt!==e){for(vt=e,w(),mt.length&&(gt=mt.indexOf(ft[vt])),i=ft.length;i--;)ft[i].chartWidget.setActive(!1);t.setActive(!0)}C(t)}},{callWithLast:!0}),$.extend(this,{createChartWidget:v,getAll:function(){return ft.map(function(t){return t.chartWidget})},destroy:N,layout:X,maximizeCurrentChart:J,activeChartWidget:ut,activeChartStyle:rt,selectedSource:at.readonly(),metaInfo:et,state:i,asyncState:n,readOnly:function(){return _t},lock:{symbol:Ct,setSymbolLockWithUndo:k,interval:xt,setIntervalLockWithUndo:I,crosshair:kt,trackTime:Pt,setTrackTimeWithUndo:E},setSymbol:A,setResolution:M,updateLayout:_,resizeWidgetsUI:m,images:D,tags:O,syncCrosshair:B,syncScroll:R,setSymbolAll:V,clearChartMetaInfo:z,onfeatures:t.onfeatures,takeScreenshot:H,loadContent:G,purgeUnusedWidgets:U,applyOverrides:j,switchChart:T,createLogo:null,destroyPromise:F,chartWidgetCreated:W,getContainer:q}),G(t.onfeatures?void 0:t.content),X.subscribe(function(t){w(),y(t,!1),mt=S(),gt=mt.indexOf(ft[vt])}),X.hook=function(t){return t===this.value()?t:Y(t)},_t&&(X.writeLock=!0),J.subscribe(function(t){t!==Z&&(mt=S(),y(wt,t))}),setInterval(g,1e3),$(window).on("resize",_),$(document).on("onUpdate",_),u.enabled("datasource_copypaste")&&(h.init(),t.globalEvents&&($(window).on("appclip:paste",function(t){ut.value().onAppClipboardPaste(),t.preventDefault()}),$(window).on("appclip:copy",function(t){ut.value().onAppClipboardCopy(),t.preventDefault()}),$(window).on("appclip:cut",function(t){ut.value().onAppClipboardCut(),t.preventDefault()}))),ht=0,ft.forEach(function(t){if(t){ht++;var e=t.chartWidget;e.withModel(null,function(){if(e.model().mainSeries().bars().size()>0)K();else{var t=function(){K(),e.model().mainSeries().onBarReceived().unsubscribe(null,t)};e.model().mainSeries().onBarReceived().subscribe(null,t)}})}})}var s=i(287),r=i(288),a=i(291),l=i(92),h=i(293),c=i(536),d=i(36),p=i(537),u=i(1);t.exports=n}).call(e,i(90),i(34))},function(t,e){"use strict";t.exports={s:{title:"1 chart",count:1,sizer:function(t,e,i,o){return{width:e.width-o-o,height:e.height-o-o,top:o,left:o}}}}},function(t,e,i){(function(e){"use strict";function o(t){var i,o,n,s,r,a,l,h,c,d,p,u,f,g,v,b,w,S,x,P,L,k=this;this._startSpinner(t.jqParent),T.init(),i=this,T.tool.subscribe(function(t){var e,o,n,s;i._model&&(e=t,i._model.model().setCurrentTool(e),TradingView.isMobile.any()&&(o=i._paneWidgets[0],y.isLineTool(e)&&"LineToolBrush"!==e?(n=.5*i._model.model().timeScale().width(),s=.5*o._state.defaultPriceScale().height(),i._model.model().setCurrentPosition(n,s,o._state),o._updateTooltip(n,s)):o._hideTooltip()),i._model&&TradingView.isMobile.any()&&i._model.model().crossHairSource().updateAllViews())}),o=function(t,e,i){var o,n=e.mainSeries().syncModel(),s=t.mainSeries().syncModel(),r=i;return n&&s&&(o=t._createSyncPoint(n,s),r=o.sourceTimeToTargetTime(i)),t.timeScale().points().roughIndex(r,s&&s.distance.bind(s))},n=function(t,e,i){var o,n=e.mainSeries().syncModel(),s=i.mainSeries().syncModel(),r=n&&s&&i._createSyncPoint(n,s);return r?(o=e.timeScale(),t.map(function(t){var e=$.extend({},t),a=o.timePointToIndex(e.time_t),l=t.timeStamp||o.points().roughTime(a+e.offset,n.projectTime.bind(n));return e.time_t=r.sourceTimeToTargetTime(l),e.index=i.timeScale().points().roughIndex(e.time_t,s&&s.distance.bind(s)),e.offset=0,e})):t},T.createdLineTool.subscribe(null,function(t){var e,i,n=k._model.model();t.model!==n&&k._model.model().mainSeries().symbol()===t.symbol&&(e=n.paneForSource(k._model.model().mainSeries()),i={index:o(n,t.model,t.point.timeStamp),price:t.point.price},k._model.createLineTool(e,i,t.linetool,t.properties,t.linkKey))}),T.continuedLineTool.subscribe(null,function(t){var e,i,s,r=k._model.model();t.model!==r&&(e={index:o(r,t.model,t.point.timeStamp),price:t.point.price},(i=k._model.lineBeingCreated())&&k._model.model().coninueCreatingLine(e,t.envState,!!t.finalState)&&t.finalState&&(s=$.extend({},t.finalState),s.points=n(t.finalState.points,t.model,r),i.restoreExternalPoints(s)))}),T.cancelledLineTool.subscribe(null,function(t){var e=k._model.model();t.model!==e&&k._model.model().cancelCreatingLine()}),T.startedMovingLineTool.subscribe(null,function(t){var e,i,n=k._model.model();t.model!==n&&k._model.model().mainSeries().symbol()===t.symbol&&(e=n.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&e.isActualSymbol()&&(i={index:o(n,t.model,t.point.timeStamp),price:t.point.price},k._model.model().startMovingSource(e,i))}),T.movedLineTool.subscribe(null,function(t){var e,i=k._model.model();t.model!==i&&i.sourceBeingMoved()&&i.sourceBeingMoved().linkKey===t.linkKey&&(e={index:o(i,t.model,t.point.timeStamp),price:t.point.price},k._model.model().moveSource(e))}),T.finishedMovingLineTool.subscribe(null,function(t){var e,i,o=k._model.model();t.model!==o&&(e=o.sourceBeingMoved())&&(k._model.model().endMovingSource(!!t.finalState),t.finalState&&(i=$.extend({},t.finalState),i.points=n(t.finalState.points,t.model,o),e.restoreExternalPoints(i)))}),T.startedChangingLineTool.subscribe(null,function(t){var e,i,n=k._model.model();t.model!==n&&k._model.model().mainSeries().symbol()===t.symbol&&(e=n.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&e.isActualSymbol()&&(i={index:o(n,t.model,t.point.timeStamp),price:t.point.price},k._model.model().startChangingLinetool(e,i,t.pointIndex,t.envState))}),T.changedLineTool.subscribe(null,function(t){var e,i=k._model.model();t.model!==i&&i.lineBeingEdited()&&i.lineBeingEdited().linkKey===t.linkKey&&(e={index:o(i,t.model,t.point.timeStamp),price:t.point.price},k._model.model().changeLinePoint(e,t.envState))}),T.finishedChangingLineTool.subscribe(null,function(t){var e,i,o=k._model.model();t.model!==o&&(e=o.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0],o.lineBeingEdited()&&k._model.model().endChangingLinetool(!!t.finalState),e&&e.isActualSymbol()&&t.finalState&&(i=$.extend({},t.finalState),i.points=n(t.finalState.points,t.model,o),e.restoreExternalPoints(i)))}),T.removedLineTool.subscribe(null,function(t){var e,i=k._model.model();t.model!==i&&(e=i.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&k._model.model().removeSource(e)}),T.finishedLineTool.subscribe(null,function(t){var e=k._model.model();t.model!==e&&e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0]&&k._model.model().finishLineTool()}),T.changedLineStyle.subscribe(null,function(t){var e,i=k._model.model();t.model!==i&&(e=i.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(e.properties().merge(t.state),e.propertiesChanged())}),T.restoredLineToolState.subscribe(null,function(t){var e,i,o=k._model.model();t.model!==o&&(e=o.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(i=$.extend({},t.state),i.points=n(t.state.points,t.model,o),i.indexes=i.points.map(function(t){return{index:t.index,price:t.price}}),o.restoreLineToolState(e,i))}),T.restoredLineTool.subscribe(null,function(t){var e=k._model.model();t.model!==e&&e.restoreSource(t.state.restorePane,t.state.paneIndex,t.state.paneState,t.state.sourceState,t.state.priceScaleName)}),T.copiedLineTool.subscribe(null,function(t){var e,i,o,s,r,a=k._model.model();if(t.model!==a&&k._model.model().mainSeries().symbol()===t.symbol){if(t.model.mainSeries().syncModel(),a.mainSeries().syncModel(),e=a.paneForSource(k._model.model().mainSeries()),i=n(t.points,t.model,a),o=i[0],s=a.createLineTool(e,o,t.linetool,null,t.linkKey),a.lineBeingCreated())for(r=1;r<i.length;r++)r!==i.length-1||"LineToolBrush"!==t.linetool&&"LineToolGhostFeed"!==t.linetool||a.finishLineTool(!0),a.coninueCreatingLine(i[r],{},r<i.length-1,!0);s.properties().interval.setValue(t.state.interval),s.properties().merge(t.state),s.restoreData&&s.restoreData(t),s.propertiesChanged()}}),this._options=t=t||{},s=t.jqParent,r=t.sizeFunc,a=t.content,l=t.readOnly,h=t.containsData,c=t.onWidget,d=t.onCmeWidget,d&&TradingView.logWarn("[ChartWidget] 'onCmeWidget' option is depricated"),p=t.widgetCustomer,u=t.timezone,f=t.withDateRanges,g=t.hideSymbolSearch,v=t.defSymbol,b=t.defInterval,w=t.defExtendedHours,S=t.defTimeframe,x=$.inArray(t.defStyle,$.map($.grep(Object.keys(_),function(t){return/^STYLE_\w+/.test(t)}),function(t){return _[t]}))!==-1,P=x?t.defStyle:void 0,this._chartWidgetCollection=t.chartWidgetCollection||null,this._withDateRanges=(void 0===f?!l:!!f)&&m.enabled("timeframes_toolbar"),this._jqParent=void 0!==s?s:$(document.body),this._setContent(a),this._readOnly=l,this._containsData=h,this._defSymbol=v,this._defInterval=b,this._defTimeframe=S,this._defStyle=P,this._onWidget=!!c,this._onWidget&&(d?this._widgetCustomer="cme":p&&(this._widgetCustomer=p)),this.controlBarHeight=22,this._sizeFunc=r||function(){var t=k._jqParent.width(),e=k._jqParent.height(),i=k._jqParent[0];return window.self!==window.top&&i.offsetWidth<i.clientWidth&&i.getBoundingClientRect().width<100&&(t=Math.round(100*i.getBoundingClientRect().width),e=Math.round(100*i.getBoundingClientRect().height)),new q(0,0,t,e-(k._withDateRanges?k.controlBarHeight:0))},this._hideSymbolSearch=g,this._jqMainDiv=null,this._rect=this._sizeFunc(),this._jqMainTable=null,this._paneWidgets=[],this._paneSeparators=[],this._timeAxisWidget=null,this._frameTime=30,this._model=null,this._metaInfo={},L=this._contentSeriesProperties(),L&&(v=L.symbol,b=L.interval),void 0===C||C.isValid(b)||(b=void 0),this._properties=new M("chartproperties"),this._properties.mainSeriesProperties.merge(defaults("chartproperties.mainSeriesProperties")),this._properties.mainSeriesProperties.merge({visible:!0,symbol:v||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:b||"D",style:P,extendedHours:w,lineStyle:{styleType:TradingView.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),u&&B(u)&&this._properties.timezone.setValue(u),this._tagsChanged=new e,this._modelCreated=new e,this._disconnected=new e,this._reconnectBailout=new e,this._connected=new e,this._redrawPanes=new e,this._onScroll=new e,this.chartWidgetInitialized=new e,this._studiesMetaData=[],this._studiesMigrations=[],this._chartSession=new N(ChartApiInstance),this.lhsPriceAxisWidthChanged=new e,this.rhsPriceAxisWidthChanged=new e,this.createLogo=null,this._isActive=t.isActive}function n(t){return{UTC:"Etc/UTC",EST:"America/New_York",CST:"America/Chicago",PST:"America/Los_Angeles"}[t]||"exchange"}function s(t){return t.description_localized=$.t(t.description,{context:"study"}),t}var r,a=i(289),l=i(316),h=i(291),c=i(318),d=i(302),p=i(319),u=(i(168),i(269).BarsMarksContainer),_=i(102),f=i(321),m=i(1),g=i(171).Study,v=i(271),y=i(82).LineDataSource,b=i(100),w=b.Action,S=b.ActionSeparator,T=i(92),C=i(93),x=i(323),P=i(330),L=i(331),k=(i(132),i(99)),I=i(332).AddCompareDialog,E=i(278),A=i(339),V=i(334),M=(i(134),i(91).DefaultProperty),D=i(135),O=D.availableTimezones,B=D.timezoneIsAvailable,R=i(67).createDialog,N=i(130),F=(i(133),i(139)),W=i(338).unifiedSpinner,z=i(35).trackEvent,H=i(140).assert,U=i(119),j=i(183),q=(j.addCanvasTo,j.Rect),Y=j.Size,G=j.setAbsoluteRect,K=i(353);o.prototype.refreshMarks=function(){this.model().barsMarksSources().forEach(function(t){t.refreshData()})},o.prototype.clearMarks=function(){this.model().barsMarksSources().forEach(function(t){t.clearMarks()})},o._nextMetadataId=1,o.prototype._setAlertsStudiesList=function(t){this._alertsStudiesList=$.map($.grep(t,function(t){var e,i=t.plots||[];for(e=0;e<i.length;e++)if("line"===i[e].type)return!0;return!1}),function(t){return t.id})},o.prototype.canCreateAlertForDataSource=function(t){if(!m.enabled("alerts"))return!1},o._filterAuthorizedMetaInfo=function(t){var e,i,o,n,s=[];for(e=0;t&&e<t.length;++e)i=t[e],o=F.parseIdString(i.id),n=o.productId,pro.hasPackage(n)&&s.push(i);return s},o.prototype.privateMetaInfo=function(t){if(t){return new t(F.CURRENT_METAINFO_FORMAT_VERSION).generateMetaInfo()}return[]},o.prototype._onScriptSources=function(t,e){var i,o,n,s,r,a,l,h;for(TradingView.logDebugChart("ChartWidget _onScriptSources called"),i=null,o=0;o<e.length;++o)if(n=e[o],n.id.startsWith("Script@tv-scripting-")){i=F.parseIdString(n.id).version;break}if(null!=i){for(this.studyScriptingPkgVers=i,s=0,r=0,o=0;o<t.length;++o)if(a=t[o],TradingView.isFeatureEnabled("backtesting")||!a.isTVScriptStrategy){l=a&&a.scriptName,s++;try{h=F.createMetaInfoStub(a,i),e.push(h)}catch(t){TradingView.logError("Could not process script (skipped): "+l+" ("+t.message+")"),r++}}TradingView.logDebugChart("User's Pine Scripts loaded "+s+", skipped "+r)}else TradingView.logError("Could not find tv-scripting package in metadata response");for(o=0;o<e.length;o++)F.addOrReplaceStudyMetaInfo(this._studiesMetaData,e[o]);this._inited||(this._init(),this.chartWidgetInitialized.fire(),TradingView.logDebugChart("ChartWidget _onScriptSources done"))},o.prototype._init=function(){var t,e=this;this._containsData||this._content&&this._content.timeScale&&!this._content.timeScale.m_lastVisibleBar&&(this._content.timeScale.m_rightOffset=this._properties.timeScale.rightOffset.value()),this.model()&&this.model().mainSeries().clearData(),this.initColors(),this._makeDefaultGui(),this._makeDefaultModel(),this._checkObsoleteTimezone(),this._chartSession&&this._chartSession.connected()&&this._model.restart(),this._content&&(this.initColors(),this._updateGui(),this.update()),e._model.mainSeries().marketStatus.subscribe(function(t){e.indicatorImage&&e._updateDataAndMarketStatus(t,e._model.mainSeries().status())},{callWithLast:!0}),this._resizeHandler=function(t){this._rect=this._sizeFunc(),t&&(this._rect.w+=t,this._rect.h+=t),G(this._jqMainDiv,this._rect),this._adjustSize(),this._model&&this._model.mainSeries().requestMoreData(),t||(this.paint(),this.resizeSeriesControlUI(),this.checkCompactMode(),this.resizeIndicator())}.bind(this),this._resizeHandler(),this._jqMainDiv.appendTo(this._jqParent),this._spinner&&(this._spinner.stop(),delete this._spinner),t=i(79),t.isFeatureEnabled("chrome_canvas_fix")&&navigator.userAgent.match(/windows.+chrome/i)&&$(window).on("visibilitychange",function(t,i){i&&(e._resizeHandler(1),setTimeout(function(){e._resizeHandler()},0))}),$(window).keydown(function(t){27===t.which&&t.preventDefault()}),this._containsData||this._jqMainDiv.mousewheel(function(t,e,i,o){var n,s,r,a,l;if((TradingView.onWidget()||!parent||parent===window||!parent.IS_DEMO_PAGE)&&this.model()&&!this.noScroll&&!this.model().timeScale().isEmpty())return n=t.pageX-5,s=this._paneWidgets[0].lhsPriceAxisWidget.size.w,r=this._timeAxisWidget.size.w,s&&(n=Math.max(0,n-s)),n=Math.min(n,r),a=m.enabled("right_bar_stays_on_scroll")?1:2*(n/r-.5),l=Math.min(1,Math.abs(o)),o>0?this.model().zoomIn(a,l):o<0&&this.model().zoomOut(a,l),i&&this.model().scrollChart(i*-80),!1}.bind(this)),this._initBarsMarksSources(),TradingView.isFeatureEnabled("esdindicatorfeature")&&!m.enabled("fundamental_widget")&&this.initESDTimelineWidget(),this.setAutoScaleOnSymbolChange(),this.readOnly()||this._hideSymbolSearch||V.registerDialogKeypressHandler(this),this.adaptOnChartLogo(),this.model().timeScale().onScroll().subscribe(this,function(){this._onScroll.fire()}),this._inited=!0},o.prototype._checkObsoleteTimezone=function(){var t=this._properties.timezone.value();B(t)||this._properties.timezone.setValue(n(t))},o.prototype._initBarsMarksSources=function(){var t=this;this.withModel(this,function(){this.model().barsMarksSources().forEach(function(e){e.onNeedRepaint.subscribe(t,t.paint)})})},o.prototype.initESDTimelineWidget=function(){new ESDTimelineWidget(this)},o.prototype.setAutoScaleOnSymbolChange=function(){this.withModel(this,function(){this.model().mainSeries().properties().symbol.listeners().subscribe(this,function(){(!this.model().mainSeries()instanceof _||!this.model().mainSeries().properties().lockScale.value())&&this.model().mainSeries().priceScale().setAutoScale(!0)})})},o.prototype.initColors=function(){this._properties.paneProperties.background.listeners().subscribe(this,o.prototype.setBackgroundColor),this._properties.paneProperties.vertGridProperties.color.listeners().subscribe(this,o.prototype.redrawPanes),this._properties.paneProperties.horzGridProperties.color.listeners().subscribe(this,o.prototype.redrawPanes),this._properties.scalesProperties.lineColor.listeners().subscribe(this,o.prototype.setScaleLineColor),this._properties.scalesProperties.textColor.listeners().subscribe(this,o.prototype.setScaleTextColor)},o.prototype.paneWidgets=function(){return this._paneWidgets},o.prototype.paneByCanvas=function(t){for(var e=0;e<this._paneWidgets.length;e++)if(this._paneWidgets[e].canvas===t||this._paneWidgets[e].top_canvas===t)return this._paneWidgets[e];return null},o.prototype.paneByState=function(t){for(var e=0;e<this._paneWidgets.length;e++)if(this._paneWidgets[e]._state===t)return this._paneWidgets[e];return null},o.prototype.priceAxisByCanvas=function(t){var e,i,o;for(e=0;e<this._paneWidgets.length;e++)if(i=this._paneWidgets[e],o=i.priceAxisByCanvas(t))return o;return null},o.prototype.timeAxisByCanvas=function(t){return t===this._timeAxisWidget.canvas||t===this._timeAxisWidget.top_canvas?this._timeAxisWidget:null},o.prototype.properties=function(){return this._properties},o.prototype.emulateCriticalError=function(){this._chartSession.removeSeries(-1,null)},o.prototype.readOnly=function(){return this._readOnly},o.prototype.onDisconnected=function(){return this._disconnected},o.prototype.onReconnectBailout=function(){return this._reconnectBailout},o.prototype.onConnected=function(){return this._connected},o.prototype.onRedrawPanes=function(){return this._redrawPanes},o.prototype.onScroll=function(){return this._onScroll},o.prototype.modelCreated=function(){return this._modelCreated},o.prototype.setResolution=function(t){if(!this._model)return void this._properties.mainSeriesProperties.merge({interval:t});var e=this._model.mainSeries().properties().interval;this._model.setScreenChartProperty(e,t,this,$.t("Change Resolution"))},o.prototype.getResolution=function(){return this._model?this._model.mainSeries().properties().interval.value():this._properties.mainSeriesProperties.interval.value()},o.prototype.addSymbol=function(t,e){var i=this.model(),o=i.studiesMetaData(),n="study_Overlay@tv-basicstudies",s=m.enabled("use_overrides_for_overlay")&&TradingView.defaultProperties[n]&&TradingView.defaultProperties[n].style,r=s||(i.mainSeries().properties().style.value()===_.STYLE_CANDLES?_.STYLE_BARS:_.STYLE_CANDLES),a={inputs:{symbol:t},style:r},l=o.filter(function(t){return"Overlay@tv-basicstudies"===t.id})[0];i.insertStudy(l,a,e)},o.prototype.updateActions=function(){function t(){var t,e,i=studyTemplates.plainList("custom"),o=studyTemplates.plainList("default");l.applyStudyTemplate.subActions||(l.applyStudyTemplate.subActions=[]),t=l.applyStudyTemplate.subActions,t.splice(0,t.length),e=new w({text:studyTemplates._SAVE_AS_TITLE}),e.callbacks().subscribe(studyTemplates,studyTemplates.showSaveAsDiaolg),t.push(e),t.push(new S),i.length||o.length?(i.length&&($.each(i,function(e,i){function o(t){return function(){return studyTemplates.deleteStudyTemplate(t),this._parentMenu._parentMenuItem._parentMenu.destroy(),!1}}var n=new w({text:i});n.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(i)}),n.deleteButton={action:o(n.text)},t.push(n)}),o.length&&t.push(new S)),$.each(o,function(e,i){var o=new w({text:i});o.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(i)}),t.push(o)})):t.push(new w({text:$.t("No study templates saved"),enabled:!1}))}var e,i,o,n,s,r,a,l=this.actions(),h=this._model.dataSources(),c=!1,d=!1;for(e=0,i=h.length;e<i;e++)o=h[e],TradingView.isInherited(o.constructor,y)&&o.isUserDeletable()&&(c=!0),TradingView.isInherited(o.constructor,g)&&o.removeByRemoveAllStudies()&&(d=!0),TradingView.isInherited(o.constructor,v)&&(d=!0);this._readOnly||(l.paneRemoveAllStudies&&l.paneRemoveAllStudies.setEnabled(d),l.paneRemoveAllDrawingTools&&l.paneRemoveAllDrawingTools.setEnabled(c),l.paneRemoveAllStudiesDrawingTools&&l.paneRemoveAllStudiesDrawingTools.setEnabled(d||c)),window.studyTemplates&&(t(),studyTemplates.refreshStudyTemplateList(t)),n=this,s=[],r=O,a=function(t){return t.id===n.model().model().properties().timezone.value()},r.forEach(function(t){if(!t.separator){var e=new w({text:t.title,checkable:!0,checked:a(t)});e.callbacks().subscribe(this,function(){n.model().setProperty(n.model().model().properties().timezone,t.id,"Changed Time Zone")}),s.push(e)}},this),l.applyTimeZone.subActions=s,l.addToWatchlist&&(l.addToWatchlist.text=$.t("Add {0} To Watchlist").format(this.getSymbol(!0))),l.addToTextNotes&&(l.addToTextNotes.text=$.t("Add Text Note For {0}").format(this.getSymbol(!0))),this.updateActionForIntradayOnly(l.sessionBreaks)},o.prototype.actions=function(){return this._actions||this._setActions(),this._actions},o.prototype._setActions=function(){var t,e,n,s,r,a,l,c,d,p,u,_,f,g,v,y,b,C,x,P,I,M,D,O,B,R,N,F,W,H,U,j,q,Y,G,K,X,Z,J,Q,tt,et,it,ot,nt,st,rt,at,lt,ht,ct,dt,pt,ut=i(309).ActionBinder,_t=this,ft=[];if(!this._readOnly)for(ft=[new w({text:$.t("Eraser"),callbackContext:"eraser"}),new S,new w({text:$.t("Trend Line"),callbackContext:"LineToolTrendLine"}),new w({text:$.t("Horizontal Line"),callbackContext:"LineToolHorzLine"}),new w({text:$.t("Vertical Line"),callbackContext:"LineToolVertLine"}),new w({text:$.t("Arrow"),callbackContext:"LineToolArrow"}),new w({text:$.t("Ray"),callbackContext:"LineToolRay"}),new w({text:$.t("Extended"),callbackContext:"LineToolExtended"}),new w({text:$.t("Parallel Channel"),callbackContext:"LineToolParallelChannel"}),new S,new w({text:$.t("Pitchfork"),callbackContext:"LineToolPitchfork"}),new w({text:$.t("Schiff Pitchfork"),callbackContext:"LineToolSchiffPitchfork"}),new w({text:$.t("Pitchfan"),callbackContext:"LineToolPitchfan"}),new w({text:$.t("Gann Square"),callbackContext:"LineToolGannSquare"}),new w({text:$.t("Gann Fan"),callbackContext:"LineToolGannFan"}),new w({text:$.t("Fib Retracement"),callbackContext:"LineToolFibRetracement"}),new w({text:$.t("Trend-Based Fib Extension"),callbackContext:"LineToolTrendBasedFibExtension"}),new w({text:$.t("Fib Speed Resistance Fan"),callbackContext:"LineToolFibSpeedResistanceFan"}),new w({text:$.t("Fib Time Zone"),callbackContext:"LineToolFibTimeZone"}),new w({text:$.t("Circle Lines"),callbackContext:"LineToolCircleLines"}),new w({text:$.t("Fib Circles"),callbackContext:"LineToolFibCircles"}),new w({text:$.t("Fib Speed Resistance Arcs"),callbackContext:"LineToolFibSpeedResistanceArcs"}),new S,new w({text:$.t("Rectangle"),callbackContext:"LineToolRectangle"}),new w({text:$.t("Ellipse"),callbackContext:"LineToolEllipse"}),new w({text:$.t("Triangle"),callbackContext:"LineToolTriangle"}),new w({text:$.t("Polyline"),callbackContext:"LineToolPolyline"}),new w({text:$.t("Arc"),callbackContext:"LineToolArc"}),new S,new w({text:$.t("Text"),callbackContext:"LineToolText"}),new w({text:$.t("Anchored Text"),callbackContext:"LineToolTextAbsolute"}),new w({text:$.t("Balloon"),callbackContext:"LineToolBalloon"}),new w({text:$.t("Price Label"),callbackContext:"LineToolPriceLabel"}),new S,new w({text:$.t("Elliott Wave Subminuette"),callbackContext:"LineToolElliottSubminuette"}),new w({text:$.t("Elliott Wave Minor"),callbackContext:"LineToolElliottMinor"}),new w({text:$.t("Elliott Wave Circle"),callbackContext:"LineToolElliottCircle"}),new w({text:$.t("Elliott Minor Retracement"),callbackContext:"LineToolElliottMinorRetr"}),new w({text:$.t("Elliott Major Retracement"),callbackContext:"LineToolElliottMajorRetr"}),new S,new w({text:$.t("Brush"),callbackContext:"LineToolBrush"}),new S,new w({text:$.t("Forecast"),callbackContext:"LineToolPrediction"})],_t=this,t=function(t){T.tool.setValue(t.callbackContext())},e=0;e<ft.length;e++)ft[e].callbacks().subscribe(null,t);new w({text:$.t("Add Alert"),shortcut:"Alt+A"}),n=new w({text:$.t("Reset Chart"),shortcut:"Alt+R"}),n.callbacks().subscribe(this,this.GUIResetScales),s=new w({text:$.t("Undo"),shortcut:"ctrl+z"}),s.callbacks().subscribe(null,function(){z("GUI","Undo"),h.UndoHistory.undo()}),s.disable(),r=new w({text:$.t("Redo"),shortcut:"ctrl+y"}),r.callbacks().subscribe(null,function(){z("GUI","Redo"),h.UndoHistory.redo()}),r.disable(),h.UndoHistory.undoStack().onChange().subscribe(this,this.updateUndoRedo),h.UndoHistory.redoStack().onChange().subscribe(this,this.updateUndoRedo),a=new w({text:$.t("Color Theme")}),l=new w({text:$.t("TimeZone")}),c=new w({text:$.t("Change Symbol..."),shortcut:$.t("Any Symbol"),doNotBindShortcut:!0}),TVSettings.setValue("symboledit.dialog_last_entry",""),c.callbacks().subscribe(this,function(){V.showDialog({callback:this.setSymbol.bind(this)})}),d=new w({text:$.t("Change Interval..."),shortcut:$.t("Any Number"),doNotBindShortcut:!0}),d.callbacks().subscribe(this,function(){new A({callback:function(t){E.interval.setValue(t)}}).show()}),TradingView.onWidget()||(m.enabled("add_to_watchlist")&&(p=new w({text:$.t("Add To Watchlist"),shortcut:"Alt+W"}),p.callbacks().subscribe(this,function(){var t,e,i=widgetbar.setPage("base");for(e=0;e<i.widgets.length;e++)if("watchlist"===i.widgets[e].type){t=i.widgets[e].widgetObject;break}t&&t.addHighlight(this.getSymbol())})),u=new w({text:$.t("Add To Text Notes"),shortcut:"Alt+N"}),u.callbacks().subscribe(this,function(){var t=this;runOrSignIn(function(){TradingView.bottomWidgetBar.toggleWidget("text_notes",!0),TradingView.bottomWidgetBar._widgets.text_notes.addNote(null,t.getSymbol(!0),t.getSymbol())},{source:"Add text note in chart context menu"})})),_=new w({text:$.t("Insert Study Template")}),f=new w({shortcut:"ctrl+alt+q",text:$.t("Reset Scale")}),f.callbacks().subscribe(null,function(t){_t.model().resetTimeScale()}),g=new w({text:$.t("Insert Drawing Tool"),subActions:ft}),v=new w({text:$.t("Remove All Indicators")}),y=new w({text:$.t("Remove All Drawing Tools")}),b=new w({text:$.t("All Indicators And Drawing Tools")}),C=new w({text:$.t("Insert Indicator..."),shortcut:"/"}),x=new w({text:$.t("Script Editor...")}),P=new w({text:$.t("Compare or Add Symbol...")}),I=new w({text:$.t("Compare...")}),M=new w({text:$.t("Objects Tree...")}),D=new w({text:$.t("Properties..."),callback:function(t,e){_t.showChartProperties()}}),O=new w({text:$.t("Scales Properties...")}),B=new w({text:$.t("Timezone/Sessions Properties...")}),R=new w({text:$.t("Lock/Unlock")}),R.callbacks().subscribe(this,o.prototype.toggleLockSelectedObject),N=new w({text:$.t("Hide")}),N.callbacks().subscribe(this,o.prototype.hideSelectedObject),F=new w({text:$.t("Format...")}),F.callbacks().subscribe(this,o.prototype.editSelectedObject),W=new w({text:$.t("Source Code...")}),W.callbacks().subscribe(this,this.openSelectedObjectSource),H=new w({text:$.t("Left Axis"),checkable:!0}),H.binder=new ut(H,this._properties.scalesProperties.showLeftScale,this.model(),$.t("Show Left Scale")),U=new w({text:$.t("Right Axis"),checkable:!0}),U.binder=new ut(U,this._properties.scalesProperties.showRightScale,this.model(),$.t("Show Right Scale")),this._properties.scalesProperties.showLeftScale.listeners().subscribe(this,o.prototype._updateScalesActions),this._properties.scalesProperties.showRightScale.listeners().subscribe(this,o.prototype._updateScalesActions),j=new w({text:$.t("Scale Price Chart Only"),checkable:!0}),j.binder=new ut(j,this._properties.scalesProperties.scaleSeriesOnly,this.model(),$.t("Scale Price Chart Only")),q=this.model().model(),this._properties.scalesProperties.scaleSeriesOnly.listeners().subscribe(null,function(){q.recalculateAllPanes(),q.invalidate(new k(k.FULL_UPDATE))}),Y=new w({text:$.t("Drawings Toolbar"),checkable:!0}),window.sideToolbar&&(Y.binder=new ut(Y,window.sideToolbar.visible,this.model(),$.t("Drawings Toolbar"))),G=new w({text:$.t("Favorite Drawings Toolbar"),checkable:!0}),window.sideToolbar&&window.sideToolbar.favoriteDrawingToolbar&&(G.binder=new ut(G,window.sideToolbar.favoriteDrawingToolbar.visibleProperty,this.model(),$.t("Drawings Toolbar"))),K=new w({text:$.t("Magnet Mode"),checkable:!0}),K.binder=new ut(K,T.properties().magnet,this.model(),"Magnet"),X=new w({text:$.t("Stay In Drawing Mode"),checkable:!0}),X.binder=new ut(X,T.properties().stayInDrawingMode,this.model(),$.t("Stay In Drawing Mode")),Z=new w({text:$.t("Sync drawings to all charts"),checkable:!0}),Z.binder=new ut(Z,T.properties().drawOnAllCharts,this.model(),"SyncDrawings"),J=new w({text:$.t("Lock All Drawing Tools"),checkable:!0}),J.binder=new ut(J,T.lockDrawings(),this.model(),$.t("Lock drawings"),function(t){t||this.binder.setValue(!this.binder.value()),T.lockDrawings().setValue(this.binder.value())}.bind(J)),Q=new w({text:$.t("Hide All Drawing Tools"),checkable:!0}),Q.binder=new ut(Q,T.hideAllDrawings(),this.model(),$.t("Hide All Drawing Tools"),function(t){t||this.binder.setValue(!this.binder.value()),T.hideAllDrawings().setValue(this.binder.value())}.bind(Q)),tt=new w({text:$.t("Hide Marks On Bars"),checkable:!0}),tt.binder=new ut(tt,T.hideMarksOnBars(),this.model(),$.t("Hide Marks On Bars"),function(t){t||this.binder.setValue(!this.binder.value()),T.hideMarksOnBars().setValue(this.binder.value())}.bind(tt)),et=new w({text:$.t("Extended Hours"),checkable:!0}),et.binder=new ut(et,this.model().mainSeries().properties().extendedHours,this.model(),$.t("Change Extended Hours")),it=new w({text:$.t("Symbol Last Value"),checkable:!0,checked:!1}),it.binder=new ut(it,this.properties().scalesProperties.showSeriesLastValue,this.model(),$.t("Show Symbol Last Value")),ot=new w({text:$.t("Symbol Labels"),checkable:!0,checked:!1}),ot.binding=new ut(ot,this.properties().scalesProperties.showSymbolLabels,this.model(),"Undo Show Symbol Labels"),nt=new w({text:$.t("Indicator Last Value"),checkable:!0,checked:!1}),nt.binder=new ut(nt,this.properties().scalesProperties.showStudyLastValue,this.model(),$.t("Show Indicator Last Value")),st=new w({text:$.t("Indicator Labels"),checkable:!0,checked:!1}),st.binding=new ut(st,this.properties().scalesProperties.showStudyPlotLabels,this.model(),"Undo Show Indicator Labels"),rt=new w({text:$.t("Countdown"),checkable:!0,checked:!1}),rt.binder=new ut(rt,this.model().mainSeries().properties().showCountdown,this.model(),$.t("Show Countdown")),at=new w({text:$.t("Symbol Info..."),checkable:!1}),at.callbacks().subscribe(null,function(){L(_t.model().mainSeries().symbol(),{symbolInfo:_t.model().mainSeries().symbolInfo()})}),_t.onWidget()||(lt=new w({text:$.t("Snapshot"),shortcut:"Alt+s"}),lt.callbacks().subscribe(null,function(){_t._chartWidgetCollection.takeScreenshot()}),ht=new w({text:$.t("Switch to the next chart"),shortcut:"Tab"}),ht.callbacks().subscribe(null,function(){_t._chartWidgetCollection.switchChart()})),this._actions={chartProperties:D,timeScaleReset:f,chartReset:n,compareOrAdd:P,compare:I,scalesProperties:O,tmzProperties:B,paneObjectTree:M,insertIndicator:C,insertDrawingTool:g,applyColorTheme:a,applyStudyTemplate:_,symbolSearch:c,showSymbolInfoDialog:at,changeInterval:d,seriesHide:N,studyHide:N,lineToggleLock:R,lineHide:N,showLeftAxis:H,showRightAxis:U,scaleSeriesOnly:j,drawingToolbarAction:Y,favoriteDrawingToolbar:G,magnetAction:K,stayInDrawingModeAction:X,syncModeAction:Z,lockDrawingsAction:J,hideAllDrawingsAction:Q,hideAllMarks:tt,applyTimeZone:l,extendedHours:et,showCountdown:rt,showSeriesLastValue:it,showSymbolLabelsAction:ot,showStudyLastValue:nt,showStudyPlotNamesAction:st,undo:s,redo:r,viewSourceCode:W,takeScreenshot:lt},p&&(this._actions.addToWatchlist=p),!TradingView.onWidget()&&m.enabled("text_notes")&&(this._actions.addToTextNotes=u),m.enabled("charting_library_base")||(TradingView.onWidget()||(this._actions.gotoDate=gotoDateAction),this._actions.scriptEditor=x),this.createSessionBreaksActions(),this.readOnly()||(ct=new w({text:$.t("Remove"),shortcut:"Del"}),ct.callbacks().subscribe(this,function(){var t;this._chartWidgetCollection&&(t=this._chartWidgetCollection.activeChartWidget.value()),t||(t=this),t.removeSelectedSource()}),dt=new w({text:$.t("Stop syncing drawing")}),dt.callbacks().subscribe(this,function(){var t;this._chartWidgetCollection&&(t=this._chartWidgetCollection.activeChartWidget.value()),t||(t=this),t.unlinkSelectedLine()}),pt=new w({text:$.t("Sync drawing to all charts")}),pt.callbacks().subscribe(this,function(){var t;this._chartWidgetCollection&&(t=this._chartWidgetCollection.activeChartWidget.value()),t||(t=this),t.copyLineToOtherCharts()}),this._actions.insertDrawingTool=g,this._actions.paneRemoveAllStudies=v,this._actions.paneRemoveAllDrawingTools=y,this._actions.paneRemoveAllStudiesDrawingTools=b,this._actions.seriesRemove=ct,this._actions.studyRemove=ct,this._actions.lineRemove=ct,this._actions.lineUnlink=dt,this._actions.lineCopyToCharts=pt,this._actions.format=F,this._actions.lockDrawingsAction=J,this._actions.hideAllDrawingsAction=Q,this._actions.hideAllMarks=tt,this._actions.paneRemoveAllStudies.callbacks().subscribe(this,o.prototype.removeAllStudies),this._actions.paneRemoveAllDrawingTools.callbacks().subscribe(this,o.prototype.removeAllDrawingTools),this._actions.paneRemoveAllStudiesDrawingTools.callbacks().subscribe(this,o.prototype.removeAllStudiesDrawingTools)),this._actions.paneObjectTree.callbacks().subscribe(this,o.prototype.showSourceProperties),this._actions.chartProperties.callbacks().subscribe(this,o.prototype.showChartProperties),this._actions.insertIndicator.callbacks().subscribe(this,o.prototype.showIndicators),this._actions.scriptEditor&&this._actions.scriptEditor.callbacks().subscribe(this,o.prototype.showScriptEditor),this._actions.compareOrAdd.callbacks().subscribe(this,o.prototype.showCompareOrAdd),this._actions.compare.callbacks().subscribe(this,o.prototype.showCompareOrAdd),this._actions.scalesProperties.callbacks().subscribe(this,o.prototype.showScalesProperties),this._actions.tmzProperties.callbacks().subscribe(this,o.prototype.showTimezoneProperties),this._updateScalesActions()},o.prototype.executeActionByName=function(t){function e(t){var e,o;for(e in i._actions)if(o=i._actions[e],o.text.toLowerCase()===t.toLowerCase())return o;return null}var i=this,o=e(t);if(!o)return void TradingView.logWarn("Unknown action: "+t);o.callbacks().fire()},o.prototype.executeActionById=function(t){if(t in this._actions){var e=this._actions[t];e.checkable&&e.setChecked(!e.checked),this._actions[t].callbacks().fire(e)}else console.warn("Unknown action id: "+t)},o.prototype.getCheckableActionState=function(t){if(t in this._actions){var e=this._actions[t];if(e.checkable)return e.checked;console.warn("Action "+t+" has no state")}else console.warn("Unknown action id: "+t);return null},o.prototype._updateScalesActions=function(){if(this._actions){for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].updateScalesVisibility();this._timeAxisWidget.updatePriceScalesVisibility(),this._update(new k(k.FULL_UPDATE))}},o.prototype.removeAllStudies=function(){this._model.removeAllStudies()},o.prototype.removeAllDrawingTools=function(){this._model.removeAllDrawingTools()},o.prototype.removeAllStudiesDrawingTools=function(){this._model.removeAllStudies(),this._model.removeAllDrawingTools()},o.prototype.model=function(){return this._model},o.prototype.connect=function(){this._handler=function(t){this._onData(t)}.bind(this),this._chartSession.connect(this._handler)},o.prototype.finishInitWithoutConnect=function(){this._chartSession.disable(),this._init(),this.chartWidgetInitialized.fire()},o.prototype.update=function(){if(this._model){for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].update();this._timeAxisWidget.update()}},o.prototype.paint=function(t){t||(t=new k(k.FULL_UPDATE));for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].paint(t.invalidateForPane(e),!1);this._timeAxisWidget&&this._timeAxisWidget.paint(t.fullInvalidation()),this._redrawPanes.fire()},o.prototype._makeDefaultGui=function(){this._makeChartWidget(),this._makeLoadingScreen(),this._makeMasterTable(),this._makeTimeAxisWidget(),this._adjustSize(),this._updateScalesActions(),$("*",this._jqMainTable).selectable(!1),this.update(),this.paint()},o.prototype.widget=function(){return this._jqMainDiv},o._linetoolWarningDialogShown=!1,o.prototype.restoreState=function(t,e){var n,s;if(this._adjustSize(),n=this._model.restoreState(this._content,e),this._setActions(),n&&n.lines_limit_exceeded&&!this.readOnly()){if(o._linetoolWarningDialogShown)return;s=R({type:"modal",destroyOnClose:!0,width:500,title:$.t("Warning"),content:$.t("This chart layout has more than 1000 drawings, which is a lot! This may negatively affect performance, storage and publishing. We recommend to remove some drawings to avoid potential performance issues."),actions:[{name:"not-now",type:"default",text:$.t("Not Now"),method:"close"},{name:"open-manage-drawings",type:"primary",text:$.t("Open Manage Drawings"),method:"close"}]}),s.on("action:open-manage-drawings",function(){i.e(1,function(t){new(0,i(355).ObjectTreeDialog)({chartWidget:this,activeTab:1},this._model).show()}.bind(this))}.bind(this)),o._linetoolWarningDialogShown=!0,s.on("afterClose",function(){o._linetoolWarningDialogShown=!1}),s.open()}},o.prototype.redrawPanes=function(t){for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].paint();this._redrawPanes.fire()},o.prototype.adaptOnChartLogo=function(t){m.enabled("adapt_onchart_logo_background")&&(t=t||this._properties.paneProperties.background.value(),$(this._jqMainDiv).find(".onchart-custom-logo .wrapper .inner").css("background-color",U.generateColor(t,50)),$(this._jqMainDiv).find(".onchart-tv-logo .wrapper .inner").css("background-color",U.generateColor(t,20)))},o.prototype.setBackgroundColor=function(t){this.adaptOnChartLogo(t.value()),this.scaleBackgroundColor=t.value();for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].paint(),this._paneWidgets[e].setCursorForTool();this.update(),this.paint()},o.prototype.setScaleLineColor=function(t){this.scaleLineColor=t.value(),$.each(this._paneSeparators,function(){this.update()}),this.update(),this.paint()},o.prototype.setScaleTextColor=function(t){this.scaleTextColor=t.value(),this.update(),this.paint()},o.prototype._update=function(t){var e;if(this.performance&&t.start(),t&&t.fullInvalidation()!==k.FULL_UPDATE){if(t.fullInvalidation()===k.LIGHT_UPDATE){for(this._timeAxisWidget.update(),e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}else if(t.fullInvalidation()===k.UPDATE_CURSOR_ONLY){for(e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}}else{for(this._model?this._updateGui():this._adjustSize(),this._timeAxisWidget.update(),e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e]._state=this._model.panes()[e],this._paneWidgets[e].statusWidget().updateLayout();this._dataWindowWidget&&this._dataWindowWidget.fullUpdate()}this.paint(t),this.performance&&(t.end(),this.performance.newChartDraw(t))},o.prototype._createVolumeIfNeeded=function(){m.enabled("create_volume_indicator_by_default")&&this._options.addVolume&&(!this._content||!this._content.loading&&m.enabled("charting_library_base"))&&this._model.mainSeries().onSymbolResolved().subscribe(this,function(){var t=this;setTimeout(function(){var e,i,o,n,s=t._model.model().mainSeries().symbolInfo();s&&(e=!s.has_no_volume,!t.containsVolume()&&e?(i=TradingView.factoryDefaults("chartproperties.volumePaneSize"),o={paneSize:i},m.enabled("hide_volume_ma")&&(o.styles={vol_ma:{visible:!1}}),t.insertStudy("Volume@tv-basicstudies",!1,m.enabled("volume_force_overlay"),void 0,o)):!e&&t.containsVolume()&&(n=t.model().dataSources().filter(function(t){return t instanceof g&&"Volume"===t.metaInfo().shortId})[0],t._model.model().removeSource(n)))},0)},!m.enabled("charting_library_base"))},o.prototype._makeDefaultModel=function(){function t(){return c(r._chartSession,function(t){if(!(t instanceof k))throw Error("Invalid mask");r._invalidateMask?r._invalidateMask.merge(t):r._invalidateMask=t,r._draw_planned||(r._draw_planned=!0,requestAnimationFrame(e))},r._properties,r.readOnly(),n,r._studiesMetaData,r._studiesMigrations,r)}function e(){r._draw_planned=!1,r._inLoadingState||r._invalidateMask&&(r._invalidateMask=r._update(r._invalidateMask))}var i,n,s,r=this;if(this._content&&this._content.timeScale.points&&(i=this._content.timeScale.points.items[0],n={startDate:i}),!this._studiesMetaData)throw Error("Cannot create chart model: studies metainfo is absent");m.enabled("lean_chart_load")?this._model=this._model||t():this._model=t(),this._createVolumeIfNeeded(),this._content?(this.restoreState(this._content,this._containsData),m.enabled("chart_content_overrides_by_deafults")&&(this._defSymbol&&this.setSymbol(this._defSymbol),this._defInterval&&this.setResolution(this._defInterval),void 0!==this._defStyle&&this.setSeriesStyle(this._model.mainSeries(),this._defStyle))):this._setActions(),this._model.onTagsChanged().subscribe(this,o.prototype.onModelTagsChanged),this._updateGui(),this._modelCreated.fire(this._model),this._tagsChanged.fire(),r=this,s=this._model.mainSeries(),this._defTimeframe&&s.setDefaultTimeframe(this._defTimeframe),this._model.lineCancelled().subscribe(this,this.onLineCancelled),s.onSymbolNotPermitted().subscribe(null,function(t){s.properties().symbol.setValue(t)}),s.properties().style.unsubscribe(this,this._onChartStyleChanged),s.properties().style.subscribe(this,this._onChartStyleChanged),this._options.handleSessionErrors&&(s.chartTypeNotPermitted.subscribe(null,function(){s.properties().interval.setValue("D"),r._options.muteSessionErrors||isOpenedGoProDialog()||(trackGoProFeature("kagiRenko"),goProDialog({feature:"kagiRenko",goOnMarkets:!1}).open())}),s.intradaySpreadNotPermitted.subscribe(null,function(){s.properties().interval.setValue("D"),r._options.muteSessionErrors||isOpenedGoProDialog()||goProDialog({feature:"intradaySpread"}).open()}),s.customIntervalNotPermitted.subscribe(null,function(){s.properties().interval.setValue("D"),r._options.muteSessionErrors||isOpenedGoProDialog()||goProDialog({feature:"customIntervals"}).open()}),s.intradayExchangeNotPermitted.subscribe(null,function(){if(s.properties().interval.setValue("D"),!r._options.muteSessionErrors&&!isOpenedGoProDialog()){var t=s.symbolInfo().listed_exchange;goProDialog({feature:"intradayExchange",exchangesButton:window.user.is_pro&&"pro_realtime_trial"!==window.user.pro_plan,exchange:t}).open()}}),s.requestingIntradayWhenNotSupported.subscribe(null,function(){s.properties().interval.setValue("D"),r._options.muteSessionErrors||TVDialogs.showIntervalMismatchDialog()}),s.requestingResolutionWhenNotSupported.subscribe(null,function(t){s.properties().interval.setValue(t)}),r._options.muteSessionErrors||s.onExtendedHoursNotPermitted().subscribe(null,function(){isOpenedGoProDialog()||(trackGoProFeature("extendedHours"),goProDialog({feature:"extendedHours",goOnMarkets:!1}).open())}))},o.prototype._onChartStyleChanged=function(){z("Chart","Chart Style "+this._model.mainSeries().getStyleShortName().toUpperCase())},o.prototype._updateGui=function(){this._model&&(this._makePaneWidgetsAndSeparators(),this._makeTimeAxisWidget(),$("*",this._jqMainTable).selectable(!1),this._adjustSize())},o.prototype.setVisibleTimeRange=function(t,e,i){this._chartSession.setVisibleTimeRange(this._model.mainSeries(),t,e,i)},o.prototype._dateRangeResolutions=function(){return ChartApiInstance.availableTimeFrames(this._model.mainSeries().symbolInfo(),this._model.mainSeries().status())||[]},o.prototype._makeChartWidget=function(){this._jqMainDiv=$(document.createElement("div")),this._jqMainDiv.addClass("chart-widget"),G(this._jqMainDiv,this._rect),this._withDateRanges&&(!m.enabled("lean_chart_load")||!this._chartControlsBar)&&(this._chartControlsBar=$(document.createElement("div")).attr("class","chart-controls-bar").appendTo(this._jqParent),this._seriesControlWidget=new P({parent:this._chartControlsBar,chartWidget:this})),(this._options.controlBar||m.enabled("control_bar"))&&(this._controlBarNavigation=new x(this,this._jqMainDiv,!0)),this._containsData||this.createIndicatorImage()},o.prototype.navigationButtonsController=function(){return this._navigationButtonsController||(this._navigationButtonsController=new f(this)),this._navigationButtonsController},o.prototype._makeLoadingScreen=function(){if(m.enabled("lean_chart_load")){if(this.screen)return;this.screen=new o.LoadingScreen(this,this._jqParent)}else this.screen=new o.LoadingScreen(this,this._jqMainDiv)},o.prototype.setSymbol=function(t,e){if(this._model){var i=this._model.mainSeries();if(!e&&i.symbolSameAsCurrent(t)&&!m.enabled("same_data_requery"))return;this._model.setSelectedSource(null),this._model.setScreenChartProperty(i.properties().symbol,t,this,"Change Symbol",m.enabled("same_data_requery"))}else this._properties.mainSeriesProperties.merge({symbol:t})},o.prototype.getSymbol=function(t){var e;return e=this._model?this._model.mainSeries().properties():this._properties.mainSeriesProperties,e?t&&e.shortName&&e.shortName.value()?e.shortName.value():e.symbol.value():""},o.LoadingScreen=function(t,e){this._cw=t,this.$element=$('<div class="chart-loading-screen">'),this.$shield=$('<div class="chart-loading-screen-shield">').appendTo(this.$element),this.$element.appendTo(e),this._showed=!1,this._cw.withModel(this,this._connectToModel)},o.LoadingScreen.prototype._connectToModel=function(){this._cw.model().mainSeries().onDataLoaded().subscribe(this,function(t){switch(t.method){case"symbol_error":"permission denied"!==t.params[1]&&this.hide();break;case"series_error":m.enabled("hide_loading_screen_on_series_error")&&this.hide();break;case"series_completed":this.hide()}})},o.LoadingScreen.prototype.show=function(){return this._cw._inLoadingState=!0,this._showed||this._cw.isDetached||(this._showed=!0,this._show()),$.Deferred().resolve()},o.LoadingScreen.prototype._show=function(){var t=this._cw.properties().paneProperties.background.value();this.$shield.css("background",t),this.$element.addClass("fade")},o.LoadingScreen.prototype.hide=function(){delete this._cw._inLoadingState,this._showed&&this._hide()},o.LoadingScreen.prototype._hide=function(){this._showed=!1,this.$element.removeClass("fade")},o.LoadingScreen.prototype.$canvas=null,o.LoadingScreen.prototype.context=null,o.prototype._makeMasterTable=function(){this._jqMainTable=$(document.createElement("table")),this._jqMainTable.appendTo(this._jqMainDiv),this._jqMainTable.addClass("chart-markup-table"),this._jqMainTable.attr("cellpading","0"),this._jqMainTable.attr("cellspacing","0")},o.prototype.unsetActivePaneWidget=function(){this.activePaneWidget=!1},o.prototype.setActivePaneWidget=function(t){this.activePaneWidget=t},o.prototype.isMaximizedPane=function(){return!!this._maximizedPaneWidget},o.prototype.toggleMaximizePane=function(t){if(!(this._paneWidgets.length<2)){this._maximizedPaneWidget?(this._maximizedPaneWidget=null,this._paneSeparators.forEach(function(t){t.show()})):(this._maximizedPaneWidget=t,this._paneSeparators.forEach(function(t){t.hide()}));for(var e=this._paneWidgets.length;e--;)this._paneWidgets[e].updateControls();this._adjustSize(),this.updateIndicatorImagePosition()}},o.prototype._makePaneWidgetsAndSeparators=function(){var t,e,i,o,n=this._model.panes(),s=n.length,r=this._paneWidgets.length;for(t=s;t<r;t++)e=this._paneWidgets.pop(),e.jqRow.remove(),e.jqRow.find("*").remove(),e.destroy(),(i=this._paneSeparators.pop())&&i.jqRow.remove();for(t=r;t<s;t++)e=new a(this,n[t],this._onWidget,this._options.verticalTouchScroll),e.onMouseLeave=this.unsetActivePaneWidget.bind(this),e.onMouseEnter=this.setActivePaneWidget.bind(this),this._paneWidgets.push(e),t>0&&(i=new l(this,t-1,t),this._paneSeparators.push(i),this._timeAxisWidget?i.jqRow.insertBefore(this._timeAxisWidget.jqRow):i.jqRow.appendTo(this._jqMainTable)),this._timeAxisWidget?e.jqRow.insertBefore(this._timeAxisWidget.jqRow):e.jqRow.appendTo(this._jqMainTable);for(t=0;t<s;t++)o=n[t],e=this._paneWidgets[t],e.state()!==o&&e.setState(o);for(t=s;t--;)this._paneWidgets[t].updateControls()},o.prototype._makeTimeAxisWidget=function(){this._timeAxisWidget||(this._timeAxisWidget=new p(this,this._onWidget),this._timeAxisWidget.jqRow.appendTo(this._jqMainTable))},o.prototype.insertStudyOrShowDialog=function(t,e){var i,o,n,s,r,a,l,h;this.isSymbolicStudy(t)?(i=defaults("study_"+t.id).description,o=$('<input type="text" class="symbol-edit single" placeholder="'+$.t("Symbol")+'" maxlength="30" style="text-transform: none; font-weight: normal;" autocomplete="off">'),o.css({float:"none","box-sizing":"border-box",width:"100%"}),n=null,s=R({title:i||$.t("Add Symbol"),width:400,actions:[{name:"apply",text:$.t("Apply"),type:"primary"}],content:o,isClickOutFn:function(t){if(n&&(t.target===n[0]||n[0].contains(t.target)))return!1}}),r=function(i){var o={inputs:{symbol:i}};this.model().insertStudy(t,o,!1,e),s.close()},a=V.bindToInput(o,{callback:r.bind(this),onPopupOpen:function(t){t.css("z-index",s.zIndex),n=t},onPopupClose:function(){n=null}}),s.on("action:apply",function(){a.acceptTypeIn()}),s.open()):this.hasConfirmInputs(t)?(i=defaults("study_"+t.id).description,K.show(this,t,{title:i,callback:function(i){this.model().insertStudy(t,i,!1,e)}.bind(this)})):g.isPointsBasedStudy(t.id)?(l=g.lineToolNameForPointsBasedStudy(t.id),T.tool.setValue(l)):(h="Volume@tv-basicstudies"===t.id,this.insertStudy(t.id,!0,h,null,null,e))},o.prototype.hasConfirmInputs=function(t){var e,i,o=t.inputs;if(void 0===o)return!1;for(e=0;e<o.length;++e)if(i=o[e],void 0!==i.confirm&&i.confirm)return!0;return!1},o.prototype.isSymbolicStudy=function(t){switch(t.id){case"Overlay@tv-basicstudies":case"CorrelationCoefficient@tv-basicstudies":return!0;default:return!1}},o.prototype.isPointsBasedStudy=function(t){return g.isPointsBasedStudy(t.id)},o.prototype.insertStudy=function(t,e,i,o,n,s){var r,a=F.findStudyMetaInfo(this._studiesMetaData,t);a=TradingView.clone(a),H(!a.isTVScriptStubToCompile,"MetaInfo stub is unexpected here!"),r=o?{inputs:o}:{},n&&(r=$.extend(r,n)),e?this._model.insertStudy(a,r,i,s):this._model.model().insertStudy(a,r,i,s)},o.prototype.insertStudyStub=function(t){return this.model().insertStudyStub(t)},o.prototype.removeStudyStub=function(t){return this.model().removeStudyStub(t)},o.prototype._adjustSize=function(){var t,e,i,o,n,s,r,a=this,h=0,c=0,p=0;$.each(this._paneWidgets,function(){a._maximizedPaneWidget&&a._maximizedPaneWidget!==this||(h=Math.max(this.lhsPriceAxisWidget.optimalWidth(),h),c=Math.max(this.rhsPriceAxisWidget.optimalWidth(),c),p+=this.stretchFactor())}),t=this._rect,e=t.w-h-c,i=this._paneSeparators.length,o=l.HEIGHT,n=this._timeAxisWidget.optimalHeight(),s=t.h-o*i-n,r=s/p,this._jqMainTable.width(t.w),this._jqMainTable.height(t.h),$.each(this._paneWidgets,function(t){a._model&&(this._state=a._model.panes()[t]);var i=a._maximizedPaneWidget?a._maximizedPaneWidget===this?s:0:Math.max(Math.round(this.stretchFactor()*r),2);this.setPriceAxisSize(d.LHS,new Y(h,i)),this.setPriceAxisSize(d.RHS,new Y(c,i)),this.setSize(new Y(e,i)),a._model&&this.state()&&a._model.setPaneHeight(this.state(),i)}),this._timeAxisWidget.setSize(new Y(e,n),new Y(h,n),new Y(c,n)),this._model&&this._model.setWidth(e),this.maxLhsPriceAxisWidth!==h&&(this.maxLhsPriceAxisWidth=h,this.lhsPriceAxisWidthChanged.fire(h)),this.maxRhsPriceAxisWidth!==c&&(this.maxRhsPriceAxisWidth=c,this.rhsPriceAxisWidthChanged.fire(c))},o.prototype._onData=function(t){switch(t.method){case"connected":this._onConnection();break;case"disconnected":this._onDisconnect();break;case"reconnect_bailout":this._reconnectBailout.fire();break;case"connection_error":this._onConnectionError(t.params[0]);break;case"critical_error":this._disconnected.fire(!0);break;default:this._model.onData(t)}},o.prototype._nextMetadataId=1,o.prototype._onConnection=function(){this._online=!0,this.requestMetadata(),this._model&&(this._model.restart(),this._updateGui(),this.update(),this.paint(),this._connected.fire())},o.prototype._onDisconnect=function(){this._model&&this._model.disconnect(),this._online=!1,this.update(),this.paint(),this._disconnected.fire()},o.prototype.requestMetadata=function(){m.enabled("charting_library_base")&&this._chartSession.requestMetadata("metadata_"+o._nextMetadataId,function(t){var e,i=t.params[1];for(e=0;e<i.length;++e)F.addOrReplaceStudyMetaInfo(this._studiesMetaData,s(i[e]));this._inited||(this._init(),this.chartWidgetInitialized.fire())}.bind(this)),o._nextMetadataId++},o.prototype.studiesMetaData=function(){return this._model.studiesMetaData()},o.prototype._onConnectionError=function(t){this._disconnected.fire()},o.prototype.getTimeScale=function(){return this._timeAxisWidget},o.prototype.setSeriesStyle=function(t,e){this._model.setProperty(t.properties().style,e)},o.prototype.showSourceProperties=function(t){var e=this;i.e(1,function(t){new(0,i(355).ObjectTreeDialog)({chartWidget:e},e._model).show()})},o.prototype.showEditObjectDialog=function(t,e,o,n){return new Promise(function(s){!function(r){var a=i(365),l=new a(t,e,n);l.show(o),s(l)}()},"editobjectdialog")},o.prototype.showChartProperties=function(t){if(!m.enabled("show_chart_property_page"))return Promise.resolve();t&&t.text===$.t("Properties...")&&TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Style"));var e=this;return new Promise(function(t){e.showEditObjectDialog(e._model.mainSeries(),e._model).then(function(e){t(e._dialog)})})},o.prototype.showScriptEditor=function(){TradingView.ScriptEditorWidget.open()},o.prototype.showCompareOrAdd=function(){new I(this._chartWidgetCollection).show()},o.prototype.showIndicators=function(t){if(window.studyMarket)return window.studyMarket.isVisible()?void window.studyMarket.hide():(window.studyMarket.show(t),window.studyMarket)},o.prototype.showScalesProperties=function(t){this.showEditObjectDialog(this._model.mainSeries(),this._model,{selectScales:!0})},o.prototype.showTimezoneProperties=function(){this.showEditObjectDialog(this._model.mainSeries(),this._model,{selectTmz:!0})},o.prototype.removeSelectedSource=function(){var t=this,e=t._model.selectedSource();!e||e===t._model.mainSeries()||e===t._model.lineBeingCreated()||e instanceof u||(e.hasAlert.value()&&e.isUserDeletable()?TVDialogs.showConfirm($.t("Drawing Alert"),$.t("This drawing is used in alert. If you remove the drawing, the alert will be also removed. Do you want to remove the drawing anyway?"),t._model.removeSelectedSource.bind(t._model)):e instanceof g&&e.hasChildren()?showDeleteStudyTreeConfirm(t._model.removeSelectedSource.bind(t._model)).open():t._model.removeSelectedSource())},o.prototype.unlinkSelectedLine=function(){var t=this._model.selectedSource();t instanceof y&&this._model.unlinkLine(t)},o.prototype.copyLineToOtherCharts=function(){var t=this._model.selectedSource();t instanceof y&&this._model.copyToOtherCharts(t)},o.prototype.hideSelectedObject=function(){var t=this._model.selectedSource();t&&this._model.setProperty(t.properties().visible,!1,"Hide "+t.title())},o.prototype.toggleLockSelectedObject=function(){var t,e=this._model.selectedSource();e&&(t=e.properties().frozen.value(),this._model.setProperty(e.properties().frozen,!t,(t?$.t("Unlock"):$.t("Lock"))+" "+e.title()))},o.prototype.editSelectedObject=function(t){var e=this._model.selectedSource();e&&this.showEditObjectDialog(e,this._model)},o.prototype.openSelectedObjectSource=function(t){var e,i=this._model.selectedSource();i&&i.metaInfo&&(e=i.metaInfo())&&e.scriptIdPart&&e.pine&&TradingView.ScriptEditorWidget},o.prototype.resetPriceAxisOptimalWidth=function(t){$.each(this._paneWidgets,function(){this.resetPriceAxisOptimalWidth(t)}),this._redrawPanes.fire()},o.prototype.adjustPriceAxisWidth=function(t){this.resetPriceAxisOptimalWidth(t),this._adjustSize()},o.prototype.setPriceAxisVisible=function(t,e){$.each(this._paneWidgets,function(){this.setPriceAxisVisible(t,e)}),this._timeAxisWidget.setStubVisible(t,e),this._adjustSize(),this._redrawPanes.fire()},o.prototype.setTimeAxisVisible=function(t){this._timeAxisWidget.setVisible(t),this._adjustSize()},o.prototype.isTextTool=function(t){switch(t){case"LineToolBalloon":case"LineToolText":case"LineToolTextAbsolute":case"LineToolCallout":case"LineToolNote":case"LineToolNoteAbsolute":return!0}return!1},o.prototype.tags=function(){return this._model?this._model.calculateDefaultTags():[]},o.prototype.state=function(t,e){return this._model.state(t,e)},o.prototype.asyncState=function(t){return this._model.asyncState(t)},o.prototype.metaInfo=function(){var t=this._metaInfo;return this._model&&(t.systemTags=this._model.calculateDefaultTags()),t},o.prototype.image=function(){var t,e,i,o,n,s,r,a,l=document.createElement("canvas"),h=l.getContext("2d"),c=0,d=this._timeAxisWidget.size.h,p=this.properties().scalesProperties.lineColor.value();for(e=0;e<this._paneWidgets.length;e++)(t=this._paneWidgets[e])&&t.state()&&(t.state().recalculate(!0),0===e&&(c=t.lhsPriceAxisWidget.size.w+t.size.w+t.rhsPriceAxisWidget.size.w),d+=t.size.h);for(d+=this._paneWidgets.length-1,this._update(),i=25,o=5,l.width=c+2*o,l.height=d+i+2*o,h.fillStyle="#F2F5F8",h.fillRect(0,0,l.width,l.height),n=i+o,s=o,r=this.mainSeriesQuotesAndMetainfo(),r.ohlc&&(a="{0} O:{1} H:{2} L:{3} C:{4}".format(r.meta.symbol,r.ohlc[0],r.ohlc[1],r.ohlc[2],r.ohlc[3]),h.fillStyle="#000",h.font="12px Verdana, Arial",h.fillText(a,s,o+15)),e=0;e<this._paneWidgets.length;e++)t=this._paneWidgets[e],h.drawImage(t.lhsPriceAxisWidget.canvas,s,n),h.drawImage(t.canvas,s+t.lhsPriceAxisWidget.size.w,n),t.statusWidget().renderTo(h,s+5,n+5),h.drawImage(t.rhsPriceAxisWidget.canvas,s+t.lhsPriceAxisWidget.size.w+t.size.w,n),n+=t.size.h,e<this._paneWidgets.length-1&&(h.fillStyle=p,h.fillRect(s,n,c,1),n++);return h.drawImage(this._timeAxisWidget.lhsCanvas,s,n),h.drawImage(this._timeAxisWidget.canvas,s+t.lhsPriceAxisWidget.size.w,n),h.drawImage(this._timeAxisWidget.rhsCanvas,s+t.lhsPriceAxisWidget.size.w+t.size.w,n),h.lineWidth=1,h.strokeStyle="#000",h.strokeRect(o+.5,i+o+.5,c-1,d-1),l},o.prototype.images=function(){function t(t){var e,o,n,s,r;for(t.paint(k.LIGHT_UPDATE,i._onWidget),e=t.image(i._onWidget),e.containsMainSeries=t.containsMainSeries(),e.studies=[],o=t.state().dataSources(),n=0;n<o.length;n++)s=o[n],r=i.properties().paneProperties.legendProperties,s instanceof g?s.properties().visible.value()&&s.statusView()&&r.showStudyTitles.value()&&r.showLegend.value()&&e.studies.push(s.statusView().text()):s instanceof _&&r.showLegend.value()&&r.showSeriesTitle.value()&&(e.mainSeriesText=s.statusView().text());return e}var e,i,o,n,s,r,a;if(TradingView.printing=!0,e=this._model.selectedSource(),this._model.setSelectedSource(null),i=this,o=[],this.isMaximizedPane())o.push(t(this._maximizedPaneWidget));else for(n=0;n<this._paneWidgets.length;n++)s=this._paneWidgets[n],o.push(t(s)),n<this._paneWidgets.length-1&&o.push(this._paneSeparators[n].image());return this._timeAxisWidget.paint(k.LIGHT_UPDATE),r=this._timeAxisWidget.image(),TradingView.printing=!1,this._model.setSelectedSource(e),this._model.invalidate(new k(k.LIGHT_UPDATE)),a=this.mainSeriesQuotesAndMetainfo(),{panes:o,timeAxis:r,colors:{text:this.properties().scalesProperties.textColor.value(),bg:this.properties().paneProperties.background.value(),scales:this.properties().scalesProperties.lineColor.value()},meta:a.meta,ohlc:a.ohlc,quotes:a.quotes}},o.prototype.mainSeriesQuotesAndMetainfo=function(){var t,e,i,o,n,s,r,a=this._model.mainSeries();return a&&(o=function(t){return null==t?"":a.formatter().format(t)+""},n=function(t){return null==t?"":t+""},t={resolution:a.interval(),symbol:a.symbol()},s=a.symbolInfo(),s&&(t.symbol=s.full_name,t.description=s.description,t.exchange=s.exchange),r=a.bars().last(),r&&(e=r.value.slice(1,5).map(o)),a.quoteData&&(i={change:o(a.quoteData.change),changePercent:n(a.quoteData.change_percent),last:o(a.quoteData.last_price)})),{meta:t,ohlc:e,quotes:i}},o.prototype.onTagsChanged=function(){return this._tagsChanged},o.prototype.onModelTagsChanged=function(){this._tagsChanged.fire()},o.prototype.destroy=function(){$(window).unbind("resize",this._resizeHandler),this._model.model().destroy(),this.performance&&this.performance.destroy(),this._chartSession.destroy()},o.prototype.title=function(){return $.t("Chart Properties")},o.prototype.symbolProperty=function(){return this._model.mainSeries().properties().shortName?this._model.mainSeries().properties().shortName:this._model.mainSeries().properties().symbol},o.prototype.loadContent=function(t,e){var i,o,n,s,a,l;for(this.screen.show(),i=this,this.isMaximizedPane()&&this.toggleMaximizePane(),o=i._model.model().dataSources(),n=0;n<o.length;n++)(s=o[n])!==i._model.mainSeries()&&i._model.model().removeSource(s,!0);for(i._jqMainDiv&&(i._jqMainDiv.remove(),i._jqMainDiv=null),i._timeAxisWidget=null,i._paneWidgets=[],i.activePaneWidget=!1,i._model.mainSeries().purgeSymbolInfo(),void 0!==r&&r.unregisterChartWidget(this),t.loading=!0,i._setContent(t),n=0;n<t.panes.length;++n)for(l=0;l<t.panes[n].sources.length;++l)if(t.panes[n].sources[l].state.symbol){a=t.panes[n].sources[l].state;break}if(!a)throw Error("An error occured while determining main series ion the chart");i._properties.mainSeriesProperties.merge({visible:!0,symbol:a.symbol,timeframe:"",onWidget:i._onWidget,interval:a.interval||"D",style:a.style}),i._init(),E.interval.setValue(a.interval),h.UndoHistory.clearStack(),i.updateSeriesControlUI(),i.createLogo&&!m.enabled("move_logo_to_main_pane")&&i.createLogo(void 0,this._jqMainDiv)},o.prototype._setContent=function(t){t&&t.panes.forEach(function(t){t.sources=t.sources.filter(function(t){return!!t&&("MainSeries"===t.type||(!t.points||!t.points.some(function(t){return null===t.time_t||!isFinite(t.time_t)})||(TradingView.logNormalChart("Dropped invalid "+t.type+". Reason: non-numeric point time"),!1)))});var e=function(e){return t.sources&&t.sources.some(function(t){return t.id===e})};t.leftAxisSources&&(t.leftAxisSources=t.leftAxisSources.filter(e)),t.rightAxisSources&&(t.rightAxisSources=t.rightAxisSources.filter(e))}),this._content=t},o.prototype._contentSeriesProperties=function(){var t,e,i;if(this._content)for(t=this._content.panes.length;t-- >0;)for(e=this._content.panes[t].sources,i=e.length;i-- >0;)if("MainSeries"===e[i].type)return e[i].state},o.prototype.updateSeriesControlUI=function(){this._seriesControlWidget&&this._seriesControlWidget.updateUI()},o.prototype.tickSeriesControlClock=function(){this._seriesControlWidget&&this._seriesControlWidget.tickClock()},o.prototype.resizeSeriesControlUI=function(){this._seriesControlWidget&&this._seriesControlWidget.resizeUI()},o.prototype.updateUndoRedo=function(){h.UndoHistory.undoStack().isEmpty()?this.actions().undo.setEnabled(!1):this.actions().undo.setEnabled(!0),h.UndoHistory.redoStack().isEmpty()?this.actions().redo.setEnabled(!1):this.actions().redo.setEnabled(!0)},o.prototype.createSessionBreaksActions=function(t){var e,o=i(309).ActionBinder,n=this,s=function(){e=new w({text:$.t("Session Breaks"),checkable:!0}),e.binder=new o(e,n.model().mainSeries().sessionsStudy().properties().graphics.vertlines.sessBreaks.visible,n.model(),"Session Breaks"),n._actions.sessionBreaks=e};n.model().mainSeries().sessionsStudy()?s():n.model().mainSeries().onSessionsStudyCreated().subscribe(n,function(){s()})},o.prototype.updateActionForIntradayOnly=function(t){!t||!t instanceof w||t.setEnabled(!!this.model().mainSeries().isIntradayInterval())},o.prototype.withModel=function(t,e){this.model()?e.call(t):this.modelCreated().subscribe(t,e,!0)},o.prototype.containsVolume=function(){return this.model().dataSources().some(function(t){return t instanceof g&&"Volume"===t.metaInfo().shortId})},o.prototype.containsStudyByPredicate=function(t){return!!this._model&&this._model.dataSources().some(function(e){return e instanceof g&&t(e.metaInfo())})},o.prototype.containsStudy=function(t){return this.containsStudyByPredicate(function(e){return e.id===t||e.fullId===t})},o.prototype.containsSessions=function(){return this.model().dataSources().some(function(t){return t instanceof g&&"Sessions"===t.metaInfo().shortId})},o.prototype.isSmall=function(t){return this.constructor.isSmall(this._jqParent)},o.isSmall=function(t){return t.width()<550||t.height()<300},o.prototype.onWidget=function(){return this._onWidget},o.prototype.onCmeWidget=function(){return"cme"===this.widgetCustomer()},o.prototype.widgetCustomer=function(){return this._widgetCustomer},o.prototype.resize=function(){this._resizeHandler&&this._jqMainDiv&&this._resizeHandler()},o.prototype.chartSession=function(){return this._chartSession},o.prototype.maxLhsPriceAxisWidth=0,o.prototype.maxRhsPriceAxisWidth=0,o.prototype.GUIResetScales=function(){z("GUI","Reset Scales"),this.model()&&(this._containsData&&this.model().chartModel().restoreAxisState(this._content),this.model().resetScales())},o.prototype.onLineCancelled=function(){T.resetToCursor()},o.prototype.createIndicatorImage=function(){var t=this;this.indicatorImage=$('<span class="chart-status-picture"></span>').appendTo(this._jqMainDiv),m.enabled("display_market_status")&&(this.indicatorText=$('<span class="series-status-text"><span class="dot apply-common-tooltip"></span><span class="text"></span><span class="market-status"></span></span>').appendTo(this.indicatorImage),this.indicatorDot=this.indicatorText.find(".dot")),t.withModel(null,function(){var e=t._model.mainSeries();e.onStatusChanged().subscribe(null,t.updateIndicatorImage.bind(t)),e.marketStatus.subscribe(t.updateIndicatorImage.bind(t)),t.updateIndicatorImage(),t.checkCompactMode(),t._model.onRearrangePanes().subscribe(null,function(){t.resetIndicatorSize(),t.resizeIndicator()})}),t.rhsPriceAxisWidthChanged.subscribe(t,t.updateIndicatorImagePosition),t.updateIndicatorImagePosition()},o.prototype.updateIndicatorImage=function(){function t(t,e){return s.hasOwnProperty(t)?s[t]:e}var e,i,o,n,s,r=this.indicatorImage;this.indicatorImage&&(e=this._model)&&(i=e.mainSeries(),o=i.status(),n=this._statusDetails(),s=null,s=n.hasOwnProperty(o)?n[o]:n.defaults,r.attr("title",t("title","")),this._updateDataAndMarketStatus(i.marketStatus.value(),o))},o.prototype.checkCompactMode=function(){this._jqMainDiv&&this._jqMainDiv.toggleClass("i-compact",this._jqMainDiv.width()<=400),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.outerWidth())},o.prototype._statusDetails=function(){return this.__statusDetails||(this.__statusDetails={},this.__statusDetails[_.STATUS_SNAPSHOT]={className:"snapshot",text:"",showBatsWarn:!1,priority:1},this.__statusDetails[_.STATUS_LOADING]=this.__statusDetails[_.STATUS_RESOLVING]={className:"loading",text:$.t("loading data"),priority:1},this.__statusDetails[_.STATUS_INVALID_SYMBOL]={className:"invalid",text:$.t("invalid symbol"),showBatsWarn:!1,priority:1},this.__statusDetails[_.STATUS_NO_BARS]={className:"invalid",text:$.t("instrument is not allowed"),showBatsWarn:!1,priority:1},this.__statusDetails[_.STATUS_OFFLINE]={className:"connecting",text:$.t("retrying"),priority:1},this.__statusDetails[_.STATUS_EOD]=this.__statusDetails[_.STATUS_PULSE]={className:"eod",text:$.t("eod data"),priority:1},this.__statusDetails[_.STATUS_DELAYED]={className:"delayed",title:$.t("Quotes are delayed by 10 min and updated every 30 seconds"),text:$.t("eod delayed"),priority:1},this.__statusDetails[_.STATUS_DELAYED_STREAMING]={className:"delayed-streaming",text:$.t("delayed"),priority:1},this.__statusDetails[_.STATUS_READY]=this.__statusDetails.defaults={className:"realtime",text:$.t("realtime"),priority:-1},this.__statusDetails.pre_market={text:$.t("pre-market"),className:"pre-market",priority:0},this.__statusDetails.post_market={text:$.t("post-market"),className:"post-market",priority:0},this.__statusDetails.out_of_session={text:$.t("closed"),className:"out-of-session",priority:0},this.__statusDetails.market=this.__statusDetails.defaults),this.__statusDetails},o.prototype._updateDataAndMarketStatus=function(t,e){if(void 0!==this.indicatorText){var i=this._resultingStatusRecord(t,e);this.indicatorText.removeClass().addClass("series-status-text "+i.className).find(".text").html(i.text),this.indicatorDot.attr("title",i.text),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.outerWidth()),this.resizeIndicator()}},o.prototype.resetIndicatorSize=function(){if(this._paneWidgets[0]&&this._paneWidgets[0].legendWidget)for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].legendWidget.firstTitle().css("padding-right","")},o.prototype.resizeIndicator=function(){this._paneWidgets[0]&&this._paneWidgets[0].legendWidget&&this._indicatorWidth&&this._paneWidgets[0].legendWidget.firstTitle().css("padding-right",this._indicatorWidth+10)},o.prototype._resultingStatusRecord=function(t,e){var i,o;return t?(i=this._statusDetails()[t],o=this._statusDetails()[e],o||(o=this._statusDetails().defaults),o.priority>i.priority?o:i):this._statusDetails()[e]},o.prototype.updateIndicatorImagePosition=function(){var t=this.indicatorImage;this.indicatorImage&&t.css("marginRight",this.maxRhsPriceAxisWidth)},o.prototype._startSpinner=function(t){if(!this._spinner){var e=$(t).get(0);e&&(this._spinner=W("",{zIndex:"auto"}).spin(e))}},o.prototype.isJustClonedChart=function(){return!!(this._options||{}).justCloned},o.prototype.getLastPaneLeftBottom=function(){var t=this._paneWidgets[this._paneWidgets.length-1].jqPane,e=t.offset();return{left:e.left,bottom:$(document.body).height()-e.top-t.height()}},o.prototype.setDataWindowWidget=function(t){this._dataWindowWidget=t},o.prototype.removeDataWindowWidget=function(){this._dataWindowWidget=null},m.enabled("datasource_copypaste")&&(o.prototype.onAppClipboardPaste=function(t,e){TradingView.logDebugChart("[[paste]]"),this._model&&this._model.pasteSourceFromClip(t,e)},o.prototype.onAppClipboardCopy=function(t){if(t||(t=this._model.selectedSource()),t instanceof g&&t.isChildStudy())return void TradingView.logDebugChart("Can not copy child study");TradingView.logDebugChart("[[copy]]"),this._model&&this._model.copySourceToClip(t)},o.prototype.onAppClipboardCut=function(t){TradingView.logDebugChart("[[cut]]"),this._model&&this._model.cutSourceToClip(t||this._model.selectedSource())}),o.prototype.applyOverrides=function(t){applyPropertiesOverrides(this.properties(),null,!1,t),this._model&&(applyPropertiesOverrides(this._model.model().properties(),null,!1,t),applyPropertiesOverrides(this._model.mainSeries().properties(),null,!1,t,"mainSeriesProperties"))},o.prototype.setActive=function(t){var e,i=this.actions();for(e in i)i.hasOwnProperty(e)&&this.actions()[e].setActive(t);this._isActive=t,this._paneWidgets.forEach(function(t){t.update()})},o.prototype.isActive=function(){return this._isActive},o.prototype.trackTime=function(){return this._chartWidgetCollection.lock.trackTime},t.exports.ChartWidget=o}).call(e,i(34))},function(t,e,i){(function(e){"use strict";function o(t,i,o,n){this._chart=t,this.dialog=t.dialog,this._state=i,this.verticalTouchScroll=n,this._disableContextMenu=!!o,this.lhsPriceAxisWidget=new l(this,l.LHS),this.rhsPriceAxisWidget=new l(this,l.RHS),this.jqPane=$(document.createElement("td")),this.jqPane.addClass("chart-markup-table"),this.jqPane.addClass("pane"),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqPane),this.canvas=I(this._dv,new E(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=I(this._dv,new E(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._zoomSelector=$("<div>"),this._zoomSelector.addClass("zoom-selector"),this._zoomSelector.css("display","none"),this._zoomSelector.appendTo(this._dv),this._tooltipSelector=$("<div>"),this._tooltipSelector.addClass("tooltip tooltip-selector tooltip-selector-hidden"),this._tooltipSelector.appendTo(this._dv),this.legendWidget=new a(this,this._chart.model(),this._chart._jqMainDiv),this.jqRow=$(document.createElement("tr")),this.lhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.jqPane.appendTo(this.jqRow),this.legendWidget.$el.appendTo(this._dv),this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.setCursorForTool(),A($(this.top_canvas),this,!0,n),i&&!this._chart.readOnly()&&(this.paneControls=new T(this,this._chart.model(),this._dv)),this.updateScalesVisibility(),this.actions=[],this.readonlyActions=[],this._onKeyUpListener=this._onKeyUpListener.bind(this),this._lineCancelledCallback=this._lineCancelledCallback.bind(this),$(window).on("keyup.panewidget",this._onKeyUpListener),this._chart.withModel(this,this._lineCancelledCallback),this._overlays={},this._contextMenuX=0,this._contextMenuY=0,this._lockDrawingsProperty=w.lockDrawings(),this._chart.withModel(this,function(){var t=this._chart.model();t.onSimpleZoomIn().subscribe(this,this._updateCrosshairOnZoom),t.onSimpleZoomOut().subscribe(this,this._updateCrosshairOnZoom)}),i&&e.enabled("move_logo_to_main_pane")&&i._isMainPane&&t.createLogo&&t.createLogo(null,this._dv,!0)}var n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,M;i(290),n=i(30),s=i(291),r=i(171).Study,a=i(295),l=i(302),h=i(242),c=i(241),d=i(82).LineDataSource,p=i(224),u=i(269).BarsMarksContainer,_=i(35).trackEvent,f=i(89).PriceDataSource,m=i(100),g=m.Action,v=m.ActionPlaceholder,y=m.ActionSeparator,b=i(304),w=i(92),S=i(113),T=i(310),C=i(99),x=i(36),P=i(183),L=P.setCanvasSize,k=P.clearRect,I=P.addCanvasTo,E=P.Size,A=P.setMouseEventHandler,V=i(293),M=i(63),o.prototype.destroy=function(){$(window).off("keyup.panewidget",this._onKeyUpListener),this.legendWidget&&(this.legendWidget.$el.remove(),delete this.legendWidget),this.paneControls&&(this.paneControls.jqDiv.remove(),delete this.paneControls),this._chart.withModel({chart:this._chart,instance:this,callback:this._hideTooltip},function(){this.chart.model().lineCancelled().unsubscribe(this.instance,this.callback)});for(var t in this)delete this[t]},o.prototype.cancelZoom=function(){this._zoomSelector.css("display","none"),delete this._firstZoomPoint},o.prototype._onKeyUpListener=function(t){if(27===t.keyCode){this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine(),this._firstZoomPoint&&this.cancelZoom();this._chart.model().model().crossHairSource().clearMeasure(),this.setCursorForTool(),this._hideTooltip()}},o.prototype._lineCancelledCallback=function(){try{this._chart.model().lineCancelled().subscribe(this,this._hideTooltip)}catch(t){}},o.prototype.backgroundColor=function(){return this._chart.properties().paneProperties.background.value()},o.prototype.priceAxisByCanvas=function(t){return t===this.lhsPriceAxisWidget.canvas||t===this.lhsPriceAxisWidget.top_canvas?this.lhsPriceAxisWidget:t===this.rhsPriceAxisWidget.canvas?this.rhsPriceAxisWidget:null},o.prototype.updateScalesVisibility=function(){this.lhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showLeftScale.value()),this.rhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showRightScale.value())},o.prototype.chart=function(){return this._chart},o.prototype.state=function(){return this._state},o.prototype.setState=function(t){this._state=t},o.prototype.stretchFactor=function(){return this._state?this._state._stretchFactor:Pane.DEFAULT_STRETCH_FACTOR},o.prototype.setStretchFactor=function(t){this._state&&(this._state._stretchFactor=t)},o.prototype.mouseEnterEvent=function(t){var e=this._chart.model();e&&(e.crossHairSource().visible=!0,"function"==typeof this.onMouseEnter&&this.onMouseEnter(this))},o.prototype.isLineTool=function(t){var e=TradingView[t];return"function"==typeof e&&e.prototype instanceof d},o.prototype.hideInplaceEditor=function(){return!!this._inplaceEditor&&(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0)},o.prototype._processMouseMoveWhileZoom=function(t){var e=Math.floor(this._chart.model().timeScale().coordinateToIndex(t.localX)),i=this._chart.model().timeScale().indexToCoordinate(e)-.5*this._chart.model().timeScale().barSpacing(),o=t.localY,n=Math.abs(i-this._firstZoomPoint.x),s=Math.abs(o-this._firstZoomPoint.y);i<this._firstZoomPoint.x?this._zoomSelector.css("left",i):this._zoomSelector.css("left",this._firstZoomPoint.x),t.localY<this._firstZoomPoint.y?this._zoomSelector.css("top",t.localY):this._zoomSelector.css("top",this._firstZoomPoint.y),this._zoomSelector.width(n),this._zoomSelector.height(s)},o.prototype._finishZoom=function(t){var e=this._state.defaultPriceScale(),i=e.coordinateToPrice(t.localY),o=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX));o!==this._firstZoomPoint.index&&this._chart.model().zoomToViewport(this._firstZoomPoint.index,o,this._firstZoomPoint.price,i,this.state()),this._zoomSelector.css("display","none"),this._firstZoomPoint=null,w.resetToCursor()},o.EvironmentState=function(t){t.shiftKey&&(this.shift=!0),t.ctrlKey&&(this.control=!0)},o.prototype.checkMovepoint=function(t){return t===S.MOVEPOINT||t===S.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any()},o.prototype.mouseDownEvent=function(t){var i,s,a,l,h,c,p,u,_,m,g,v,y,b;if(document.activeElement!==document.body&&document.activeElement!==document.documentElement?document.activeElement&&document.activeElement.blur?document.activeElement.blur():document.body.focus():document.getSelection?document.getSelection().removeAllRanges():document.selection&&document.selection.clear(),x.emit("mouse_down",{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY}),this._updateCommonTooltip(null),i=this._chart.model(),s=new o.EvironmentState(t),i.mainSeries().setGotoDateResult(),this.hideInplaceEditor(),TradingView.supportTouch()&&(this._skipFirstMove=!0),a=this._state.defaultPriceScale(),!a.isEmpty()&&!i.timeScale().isEmpty()){if(l=i.crossHairSource(),TradingView.supportTouch()&&"LineToolBrush"!==w.tool.value()||i.setCurrentPosition(t.localX,t.localY,this._state),h=l.price,c=l.index,l.startMeasurePoint()&&l.endMeasurePoint()&&l.clearMeasure(),s.shift&&w.toolIsCursor(w.tool.value())&&w.tool.setValue("measure"),"measure"===w.tool.value()&&!l.startMeasurePoint())return void l.startMeasuring({price:h,index:c,x:t.localX,y:t.localY},this._state);if(l.startMeasurePoint()&&!l.endMeasurePoint())return l.finishMeasure({price:h,index:c,x:t.localX,y:t.localY}),void w.resetToCursor();if(this._firstZoomPoint)return void this._finishZoom(t);if("zoom"===w.tool.value())return p=i.timeScale().indexToCoordinate(c)-.5*i.timeScale().barSpacing(),this._firstZoomPoint={price:h,index:c,x:p,y:t.localY},this._zoomSelector.css("display","block"),this._zoomSelector.css("left",p),this._zoomSelector.css("top",t.localY),this._zoomSelector.width(0),void this._zoomSelector.height(0);if(this.isLineTool(w.tool.value())||i.lineBeingCreated())return void((!e.enabled("charting_library_base")||c>=0)&&this._mouseDownEventForLineTool(t,s,c,h));if(u=this.dataSourceAtPoint(t.localX,t.localY),_=u&&u.source&&u.source.customization?u.source.customization:{},u.hittest&&u.hittest.result()===S.CUSTOM&&(m=u.hittest.data().mouseDownHandler)&&m(t),!this._chart.readOnly()){if(u&&!_.disableSelection&&(g=u.hittest&&u.hittest.result()>S.MOVEPOINT_BACKGROUND,g=g||u.hittest&&u.hittest.result()===S.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any(),g?i.setSelectedSource(u.source,u.hittest&&u.hittest.data()):i.setSelectedSource(null)),u.source&&"eraser"===w.tool.value()&&!_.disableErasing&&(TradingView.isInherited(u.source.constructor,d)||TradingView.isInherited(u.source.constructor,r)))return v=u.hittest.eraseMarker(),void(t.ctrlKey&&void 0!==v&&u.source.processErase?u.source.processErase(i,v):i.removeSource(u.source));if(y=u.source&&TradingView.isInherited(u.source.constructor,d)&&u.source.isLocked(),!(this._lockDrawingsProperty.value()||y)){if(u.source&&u.source.userEditEnabled&&!u.source.userEditEnabled())return;if(u.hittest&&u.hittest.result()===S.CHANGEPOINT)return a=u.source.priceScale(),h=a.coordinateToPrice(t.localY),i.startChangingLinetool(u.source,{index:c,price:h},u.hittest.data(),s),void this._updateTooltip(t.localX,t.localY);if(u.hittest&&this.checkMovepoint(u.hittest.result()))return b=u.source.properties(),s.control&&b.clonable&&b.clonable.value()?void(this._clonningAtMoveLineTool=u.source):void(u.source.isFixed&&u.source.isFixed()?i.startMovingSource(u.source,new n.Point(t.localX,t.localY),u.hittest.data()):(a=u.source.priceScale(),h=a.coordinateToPrice(t.localY),i.startMovingSource(u.source,{index:c,price:h},u.hittest.data())))}if(u.source&&TradingView.isInherited(u.source.constructor,f)&&u.source.isDraggable())return void(this._chart.draggingSource=u.source)}u.hittest&&u.hittest.result()===S.REGULAR||(this._processing=!0)}},o.prototype.drawRightThere=function(t){var e,i;this.isLineTool(t)&&(e=this._chart.model(),i=e.crossHairSource(),e.createLineTool(this._state,{index:i.index,price:i.price},t))},o.prototype._finishTool=function(t){var e,i=this._chart.model(),o=w.tool.value();w.resetToCursor(),this._hideTooltip(),i.setSelectedSource(t),this._chart.isTextTool(o)&&(e=i.createUndoCheckpoint(),this._chart.showEditObjectDialog(t,i,null,e).then(function(t){t.focusOnText()}))},o.prototype._mouseDownEventForLineTool=function(t,e,i,o){var s,r,a,l,h,c,d,u,_,f,m=this._chart.model(),g=!1,v=null,y=t.localX,b=t.localY,S=this._chart.model().model().crossHairSource(),T=w.tool.value();if(w.hideAllDrawings().setValue(!1),w.lockDrawings().setValue(!1),TradingView.supportTouch()&&this.isLineTool(T)&&"LineToolBrush"!==T&&!m.lineBeingCreated()&&(this._startTouchPoint=new n.Point(y,b),this._initCrossHairPosition=S.currentPoint(),this._skipFirstMove=!0),!m.lineBeingCreated()||m.lineBeingCreated()instanceof p)TradingView.supportTouch()&&"LineToolBrush"!==T||(f={index:i,price:o},v=m.createLineTool(this._state,f,T),m.lineBeingCreated()||(g=!0));else if(TradingView.supportTouch()){if(this._skipFirstMove=!0,!this._startTouchPoint)return this._startTouchPoint=new n.Point(y,b),s=m.lineBeingCreated().points(),r=s[s.length-1],a=m.timeScale().indexToCoordinate(r.index),o=r.price,l=m.lineBeingCreated().priceScale(),l.isPercent()&&(h=m.lineBeingCreated().ownerSource().firstValue(),o=l.priceRange().convertToPercent(o,h)),c=l.priceToCoordinate(o),void(this._lastDrawingPoint=new n.Point(a,c))}else v=m.lineBeingCreated(),d=m.paneForSource(v),d!==this._state?(u=this._dv.offset(),y=t.localX+u.left,b=t.localY+u.top,_=this._chart.paneByState(d),u=_._dv.offset(),y-=u.left,b-=u.top,o=v.priceScale().coordinateToPrice(b),i=Math.round(m.timeScale().coordinateToIndex(y)),g=m.coninueCreatingLine({index:i,price:o},e)):g=m.coninueCreatingLine({index:i,price:o},e);m.setSelectedSource(v),g?this._finishTool(v):TradingView.supportTouch()&&"LineToolBrush"!==T||this._updateTooltip(t.localX,t.localY)},o.prototype._equalsCursorCache=function(t,e){return w.toolIsCursor(t.tool)?t.tool===e.tool&&t.theme===e.theme&&t.crosshair===e.crosshair:t.tool===e.tool&&t.theme===e.theme},o.prototype._setCursorClassName=function(t){var e="";t&&(e="pane--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqPane.removeClass(this._currentCursorClassName),e&&this.jqPane.addClass(e),this._currentCursorClassName=e)},o.prototype.setCursorForTool=function(t,e){var i,o=w.tool.value();if(w.toolIsCursor(o)){if(this._chart.draggingSource||this._isScrolling||this._chart.model()&&this._chart.model().sourceBeingMoved())return void this._setCursorClassName("grabbing");if(t)return void this._setCursorClassName("pointer")}return"eraser"===o?void this._setCursorClassName("eraser"):"zoom"===o?void this._setCursorClassName("zoom-in"):"dot"===(i=w.cursorTool.value())?void this._setCursorClassName("dot"):"arrow"===i?void this._setCursorClassName("default"):void this._setCursorClassName("")},o.prototype.setDragToAnotherPaneCursor=function(){this._setCursorClassName("grabbing-outside")},o.prototype.gestureStartEvent=function(t){this._prev_pinch_scale=1,this._pinching=!0},o.prototype.gestureChangeEvent=function(t){var e,i,o=(t.originalEvent.pageX||t.originalEvent.offsetX)-5,n=this._chart.paneWidgets()[0].lhsPriceAxisWidget.size.w,s=this._chart.model().timeScale().width();n&&(o=Math.max(0,o-n)),o=Math.min(o,s),e=2*(o/s-.5),i=5*(t.scale-this._prev_pinch_scale),i>0?this._chart.model().zoomIn(e,i):this._chart.model().zoomOut(e,-i),this._prev_pinch_scale=t.scale},o.prototype.gestureEndEvent=function(t){this._pinching=!1},o.prototype._updateCommonTooltip=function(t){var e,i,o,n=this._lastCommonTooltipData,s=null;if(t&&t.hittest&&t.hittest.result()===S.CUSTOM&&(e=t.hittest.data())&&(s=e.tooltip||null),null!=n||null!=s)return null==s?(this._lastCommonTooltipData=null,void M.hide()):void(n&&s.text===n.text&&s.rect.x===n.rect.x&&s.rect.y===n.rect.y&&s.rect.w===n.rect.w&&s.rect.h===n.rect.h||(this._lastCommonTooltipData=s,i=TradingView.clone(s),o=this.jqPane.offset(),i.rect.x+=o.left,i.rect.y+=o.top,M.show(i)))},o.prototype.mouseMoveEvent=function(t){var e,i,n,s,r,a,l,h,c,d,p,u,_,f=this._chart.model();if(f){if(e=t.localX,i=t.localY,n=new o.EvironmentState(t),this._firstZoomPoint)return void this._processMouseMoveWhileZoom(t);if(this._chart.readOnly()||this._editDialog&&this._editDialog.isVisible()||(s=w.tool.value(),r=null,a=null,l=null,this._processing||!w.toolIsCursor(s)&&"eraser"!==s||(r=this.dataSourceAtPoint(t.localX,t.localY),h=r&&r.source,c=this._chart.model().crossHairSource(),h&&("LineToolOrder"===h.toolname||"LineToolPosition"===h.toolname||"AlertLabel"===h.toolname)?c.visibleTrap=!1:c.visibleTrap=!0,r.hittest&&r.hittest.result()>S.MOVEPOINT_BACKGROUND?(a=r.source,l=r.hittest.result(),!r.source||"eraser"===s&&r.source.constructor===TradingView.Series?f.setHoveredSource(null):f.setHoveredSource(r.source,r.hittest.data())):f.setHoveredSource(null)),this.setCursorForTool(a,l),this._updateCommonTooltip(r)),this._chart.readOnly()&&(r=this.dataSourceAtPoint(t.localX,t.localY),null!==r.source?f.setHoveredSource(r.source,r.hittest.data()):f.setHoveredSource(null,null)),this._chart.model().lineBeingCreated()&&(d=this._chart.model().lineBeingCreated(),(p=this._chart.model().paneForSource(d))!==this._state))return u=this._dv.offset(),e+=u.left,i+=u.top,_=this._chart.paneByState(p),u=_._dv.offset(),e-=u.left,i-=u.top,void f.setCurrentPosition(e,i,p);s=w.tool.value(),TradingView.supportTouch()&&this.isLineTool(s)||(f.setCurrentPosition(e,i,this._state,n),this._updateTooltip(e,i))}},o.prototype.pressedMouseMoveEvent=function(t){var i,s,r,a,l,h,c,u,_,f,m,g,v,y,b,S,T,C,x,P,L,k,I,E,A,V,M;if(!this._pinching){if(this._skipFirstMove?(delete this._skipFirstMove,delete this._touchMove):this._touchMove=!0,i=new o.EvironmentState(t),s=this._chart.model(),r=t.localX,a=t.localY,this._firstZoomPoint)return this._processMouseMoveWhileZoom(t),void(this._firstZoomPoint.draggingMode=!0);if(l=w.tool.value(),TradingView.supportTouch()&&this._startTouchPoint&&this.isLineTool(l)&&"LineToolBrush"!==l&&!s.lineBeingCreated())return h=this._initCrossHairPosition,c=new n.Point(r,a),u=c.substract(this._startTouchPoint),_=h.add(u),this._chart.model().setCurrentPosition(_.x,_.y,this._state),void this._updateTooltip(_.x,_.y);if(TradingView.supportTouch()&&s.lineBeingCreated()&&!(s.lineBeingCreated()instanceof p))return void(this._startTouchPoint&&(f=s.lineBeingCreated(),m=t.localX-this._startTouchPoint.x,g=t.localY-this._startTouchPoint.y,v=this._lastDrawingPoint.x+m,y=this._lastDrawingPoint.y+g,b=this._chart.model().paneForSource(f),s.setCurrentPosition(v,y,b),this._updateTooltip(v,y)));if(s.setCurrentPosition(r,a,this._state,i),this._updateTooltip(r,a),S=w.tool.value(),(!this.isLineTool(S)||"LineToolBrush"===l)&&(0===t.button||Modernizr.touch)){if("LineToolBrush"===S){if(T=this._state.defaultPriceScale(),T.isEmpty())return;if(!this._chart.model().lineBeingCreated())return;return C=T.coordinateToPrice(t.localY),x=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX)),void((!e.enabled("charting_library_base")||x>=0)&&this._chart.model().coninueCreatingLine({index:x,price:C}))}if(this._chart.draggingSource&&(P=t.target,L=this._chart.paneByCanvas(P),L&&(L!==this?L.setDragToAnotherPaneCursor():L.setCursorForTool()),k=this._chart.priceAxisByCanvas(P),k&&k.setCursor("grabbing"),(I=this._chart.timeAxisByCanvas(P))&&(I.setCursor("grabbing-outside"),I.jqCell.focus())),s.timeScale().isEmpty())return;if(s.lineBeingEdited())return x=Math.round(this._chart.model().timeScale().coordinateToIndex(r)),(!e.enabled("charting_library_base")||x>=0)&&s.changeLinePoint({x:r,y:a},i),this._updateTooltip(r,a),void this.setCursorForTool();if(s.sourceBeingMoved()){if(T=s.sourceBeingMoved().priceScale(),T.isEmpty())return;if(x=this._chart.model().timeScale().coordinateToIndex(t.localX),C=T.coordinateToPrice(t.localY),E=s.sourceBeingMoved(),this.setCursorForTool(),e.enabled("charting_library_base")&&!s.sourceBeingMoved().onlyYMoving()&&(A=E.points(),0!==A.length&&A.reduce(function(t,e){return e.index<t.index?e:t}).index-((E._currentMovingPoint||E._startMovingPoint).index-x)<0))return;return TradingView.isInherited(E.constructor,d)&&E.isFixed()?void s.moveSource(new n.Point(r,a)):void s.moveSource({index:x,price:C},i)}if(i.control&&this._clonningAtMoveLineTool)return f=this._clonningAtMoveLineTool,V=this.cloneLineTool(f,!0),M=this._chart.model().model().dataSourceForId(V),this._chart.model().setSelectedSource(M),s.startMovingSource(M,{index:this._chart.model().timeScale().coordinateToIndex(t.localX),price:f.priceScale().coordinateToPrice(t.localY)}),void(this._clonningAtMoveLineTool=null);T=this._state.defaultPriceScale(),this._startScrollingPos||(this._startScrollingPos={x:t.clientX,y:t.clientY}),this._startScrollingPos&&(this._startScrollingPos.x===t.clientX&&this._startScrollingPos.y===t.clientY||this._isScrolling||(s.beginUndoMacro("scroll"),T.isEmpty()||s.startScrollPrice(this._state,T,t.localY),s.startScrollTime(t.localX),this._isScrolling=!0,this.setCursorForTool())),this._isScrolling&&(T.isEmpty()||s.scrollPriceTo(this._state,T,t.localY),s.scrollTimeTo(t.localX))}}},o.prototype._processMouseUpForCustomHandler=function(t){var e,i=this.dataSourceAtPoint(t.localX,t.localY);i.hittest&&i.hittest.result()===S.CUSTOM&&(e=i.hittest.data().mouseUpHandler)&&e(t)},o.prototype.mouseUpEvent=function(t){var e,i,o,n,r,a,l,h,c,d,u,_,f,m,g,v,y,b,S,T,P,L,k,I,E,A,V,M,$,D,O;if(this._processMouseUpForCustomHandler(t),this._clonningAtMoveLineTool=null,e=this,x.emit("mouse_up",{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY}),i=this._chart.model(),o=this._touchMove,delete this._touchMove,n=w.tool.value(),TradingView.supportTouch()&&!o&&"LineToolBrush"!==n&&this.isLineTool(n)&&!i.lineBeingCreated())return r=i.crossHairSource().currentPoint(),a=this._state.defaultPriceScale(),l=a.coordinateToPrice(r.y),h=Math.round(i.timeScale().coordinateToIndex(r.x)),c={index:h,price:l},d=i.createLineTool(this._state,c,n),i.setSelectedSource(d),i.lineBeingCreated()||this._finishTool(d),this._updateTooltip(r.x,r.y),void delete this._startTouchPoint;if(i.lineBeingCreated()&&!(i.lineBeingCreated()instanceof p)&&this._startTouchPoint)return u=!1,delete this._startTouchPoint,o||(d=i.lineBeingCreated(),_=d.points()[d.points().length-1],l=_.price,f=d.priceScale(),f.isPercent()&&(m=i.lineBeingCreated().ownerSource().firstValue(),l=f.priceRange().convertToPercent(l,m)),u=i.coninueCreatingLine({index:_.index,price:l},{}),delete this._lastDrawingPoint),void(u&&this._finishTool(d));if(this._firstZoomPoint&&this._firstZoomPoint.draggingMode)return void this._finishZoom(t);if(0===t.button||TradingView.supportTouch()){if(this._processing=!1,i=this._chart.model(),i.lineBeingEdited())return i.endChangingLinetool(),void this._hideTooltip();if("LineToolBrush"===n){if(i.finishLineTool(),a=this._state.defaultPriceScale(),a.isEmpty())return;if(!this._chart.model().lineBeingCreated())return;return l=a.coordinateToPrice(t.localY),h=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX)),void this._chart.model().coninueCreatingLine({index:h,price:l})}if(g=i.sourceBeingMoved())return i.endMovingSource(),this._hideTooltip(),this.setCursorForTool(g),void i.invalidate(new C(C.UPDATE_CURSOR_ONLY));this._chart.readOnly()||(v=this.dataSourceAtPoint(t.localX,t.localY),y=this._chart.model().crossHairSource(),b=t.localX>=0&&t.localX<this.size.w,v&&v.source===y||!b||(S=e._chart.model().timeScale().coordinateToIndex(t.localX),e._chart.model().model().onSyncScrollNeeded(S))),T=this._isScrolling&&s.UndoHistory.undoStack().head()instanceof s.UndoMacroCommand,this._isScrolling&&(a=this._state.defaultPriceScale(),i.endScrollPrice(this._state,a),e=this,P=function(){i.endScrollTime(),i.endUndoMacro(),e._startScrollingPos=void 0,e._isScrolling=!1,e.setCursorForTool()},TradingView.supportTouch()?(L=i.timeScale().m_scrollStartPoint,k=.05*(t.localX-L),I=null,E=function(e){var o,n;null===I&&(I=e),o=.01*Math.min(100,3*(e-I)),o=Math.sqrt(o),n=t.localX+k*o,i.scrollTimeTo(n),o>=1?P():requestAnimationFrame(E)},requestAnimationFrame(E)):P()),this._chart.draggingSource&&(A=t.target,V=this._chart.paneByCanvas(A),V&&V!==this&&(M=V._state.findSuitableScale(this._chart.draggingSource),T&&(T=!1,s.UndoHistory.undo()),this._chart.model().move(this._chart.draggingSource,V._state,M)),$=this._chart.priceAxisByCanvas(A),$&&(V=$.pane,a=$._isLeft?V._state.leftPriceScale():V._state.rightPriceScale(),T&&(T=!1,s.UndoHistory.undo()),this._chart.model().move(this._chart.draggingSource,V._state,a)),D=this._chart.timeAxisByCanvas(A),D&&(T&&(T=!1,s.UndoHistory.undo()),this._chart.model().move(this._chart.draggingSource,null,null)),O=this._chart.getTimeScale(),O&&O.restoreDefaultCursor(),this._chart.draggingSource=null,v=this.dataSourceAtPoint(t.localX,t.localY),this.setCursorForTool(v.source,v.hittest||null))}delete this._touchMove},o.prototype.mouseLeaveEvent=function(t){var e=this._chart.model();e&&(TradingView.isMobile.any()||e.model().clearCurrentPosition(),e.setHoveredSource(null),this._updateCommonTooltip(null),"function"==typeof this.onMouseLeave&&this.onMouseLeave(this))},o.prototype.mouseClickEvent=function(t){this._chart.model().hoveredSource()instanceof u&&this._chart.model().hoveredSource().onClicked()},o.prototype.showEditDialogForSource=function(t){if(!(this.chart().onWidget()||t.userEditEnabled&&!t.userEditEnabled())){var e=this;this._chart.showEditObjectDialog(t,this._chart.model()).then(function(t){e._editDialog=t})}},o.prototype.mouseDoubleClickEvent=function(t){var e,i=!this._chart.readOnly()&&!this.isLineTool(w.tool.value())&&this.dataSourceAtPoint(t.localX,t.localY),o=i&&i.hittest&&i.source;o&&i.hittest.result()<=S.MOVEPOINT_BACKGROUND&&!TradingView.isMobile.any()&&(o=null),o&&o.customization&&o.customization.disableSelection&&(o=null),o&&o._metaInfo&&"Sessions@tv-basicstudies"===o._metaInfo.id&&(o=this._chart.model().mainSeries()),o?(e=!1,e?TradingView.alertsDispatcher.openEditDialog(i.source.alert()):this.showEditDialogForSource(o)):this._chart.readOnly()||this.isLineTool(w.tool.value())||this._chart.model().lineBeingCreated()||this._chart.model().selectedSource()||this._chart.toggleMaximizePane(this)},o.prototype.showContextMenuForSource=function(t,e){t.hasContextMenu()&&(this._chart.model().setSelectedSource(t),t.constructor===TradingView.Series?this._seriesContextMenu(t).show(e):TradingView.isInherited(t.constructor,r)?this._studyContextMenu(t).show(e):TradingView.isInherited(t.constructor,h)||TradingView.isInherited(t.constructor,c)?this._tradingDrawingsContextMenu(t).show(e):TradingView.isInherited(t.constructor,d)&&this._lineContextMenu(t).then(function(t){t.show(e)}))},o.prototype.contextMenuEvent=function(t,i){var o,n,s,r;if(e.enabled("pane_context_menu")){if(this._chart.model().crossHairSource().startMeasurePoint())return void this._chart.model().crossHairSource().clearMeasure();if(!this._pinching&&(this._firstZoomPoint&&this.cancelZoom(),!this.hideInplaceEditor())){if(!w.toolIsCursor(w.tool.value())){if(TradingView.isMobile.any())return;return w.resetToCursor(!0),this.setCursorForTool(),this._hideTooltip(),void(this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine())}this.chart().readOnly()||this._disableContextMenu||(this._chart.model().mainSeries().createSessStudy(),this._chart.updateActions(),this._contextMenuX=t.localX,this._contextMenuY=t.localY,o=this.dataSourceAtPoint(t.localX,t.localY),n=o?o.source:null,s=o&&o.hittest?o.hittest.result():0,r=s>=S.REGULAR||s>=S.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any(),null!==n&&r?this.showContextMenuForSource(n,t):(this._contextMenu(t).then(function(e){return e.show(t)}),this._chart.model().setSelectedSource(null)),this.paint())}}},o.prototype._contextMenu=function(t){function e(t){return null===t.text}var i=this;return Promise.all(this._initActions(t)).then(function(t){var o,n,s=i._customActions();for(t=t.filter(function(t){return null!==t}),s.remove.forEach(function(e){for(var i=0;i<t.length;i++)if(t[i].text===e){t.splice(i,1);break}}),o=s.top.concat(t).concat(s.bottom),n=o.length-1;n>0;n--)e(o[n])&&e(o[n-1])&&o.splice(n,1);return o.length&&e(o[0])&&o.splice(0,1),o.length&&e(o[o.length-1])&&o.splice(o.length-1,1),b.createMenu(o)})},o.prototype.createRemoveMenu=function(){var t,e=this._chart.actions(),i=new g({text:$.t("Remove")});return i.subActions||(i.subActions=[]),t=i.subActions,t.push(e.paneRemoveAllStudies),t.push(e.paneRemoveAllDrawingTools),t.push(e.paneRemoveAllStudiesDrawingTools),i},o.prototype.createDrawingMenu=function(){var t,i=this._chart.actions(),o=new g({text:$.t("Drawing Tools")});return o.subActions||(o.subActions=[]),t=o.subActions,t.push(i.drawingToolbarAction),e.enabled("charting_library_base")||t.push(i.favoriteDrawingToolbar),t.push(new y),t.push(i.magnetAction),t.push(i.stayInDrawingModeAction),e.enabled("support_multicharts")&&t.push(i.syncModeAction),t.push(new y),t.push(i.lockDrawingsAction),t.push(i.hideAllDrawingsAction),t.push(i.paneRemoveAllDrawingTools),o},o.prototype._initActions=function(t){var i,o,n,s,r,a=this,l=this._chart.actions(),h=[];return e.enabled("datasource_copypaste")&&(!(i=V.get())||"study"!==i.type&&"drawing"!==i.type||(o=new g({text:$.t("Paste %s",$.t(i.title||i.type)),shortcut:"Ctrl-V"}),o.callbacks().subscribe(null,function(){a._chart.onAppClipboardPaste(a.state())}),h.push(o))),l.gotoDate&&h.push(l.gotoDate),h.length&&h.push(new y),h.push(l.chartReset),h.push(l.symbolSearch),h.push(l.changeInterval),n=window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist),n&&l.addToWatchlist&&h.push(l.addToWatchlist),e.enabled("text_notes")&&h.push(l.addToTextNotes),e.enabled("symbol_info")&&h.push(l.showSymbolInfoDialog),h.push(new y),h.push(this._createLockTimeAxisAction(t)),h.push(new y),h.push(l.paneObjectTree),h.push(l.insertIndicator),e.enabled("charting_library_base")||h.push(l.applyStudyTemplate),e.enabled("compare_symbol")&&h.push(l.compareOrAdd),h.push(this.createDrawingMenu()),e.enabled("charting_library_base")&&h.push(l.hideAllMarks),h.push(this.createRemoveMenu()),h.push(new y),s=this._priceAxisMenu(),s&&h.push(s),r=this._timeAxisMenu(),r&&h.push(r),e.enabled("charting_library_base")||h.push(l.applyColorTheme),e.enabled("show_chart_property_page")&&h.push(l.chartProperties),pro.hasPackage("mtp-mtpredictor")&&this.state().containsMainSeries()&&(h.push(new y),h.push(this._createMTPredictorActions())),h},o.prototype._customActions=function(){var t,i={top:[],bottom:[],remove:[]},o=this._chart.model(),n=o.timeScale(),s=this._state.defaultPriceScale();return e.enabled("custom_items_in_context_menu")?(t=n.isEmpty()?void 0:n.indexToUserTime(n.coordinateToIndex(this._contextMenuX)),x.emit("onContextMenu",{unixtime:t?t/1e3:void 0,price:s.isEmpty()?void 0:s.coordinateToPrice(this._contextMenuY),callback:function(t){[].concat(t).forEach(function(t){if(t.text)if(t.text.length>1&&"-"===t.text[0])i.remove.push(t.text.slice(1));else{var e;"-"===t.text?e=new y:(e=new g({text:t.text}),e.callbacks().subscribe(null,t.click)),t.position&&"top"===t.position?i.top.push(e):i.bottom.push(e)}})}}),i):i},o.prototype._timeAxisMenu=function(){if(this._chart.model().timeScale().isEmpty())return null;var t=this._chart.getTimeScale();return new g({text:$.t("Time Scale"),subActions:t.getContextMenuActions()})},o.prototype.getDefaultPriceAxisWidget=function(){var t=this._state.defaultPriceScale();return t.isEmpty()?null:t===this._state.leftPriceScale?this.leftPriceAxisWidget():this.rightPriceAxisWidget()},o.prototype._priceAxisMenu=function(){var t=this.getDefaultPriceAxisWidget();return t?new g({text:$.t("Price Scale"),subActions:t.getContextMenuActions()}):null},o.prototype._seriesContextMenu=function(t){var i,o,n,s,r,a=this._chart.actions(),l=t.properties().visible.value(),h=null;if(this._chart.readOnly())i=[l?a.seriesHide:this.createActionShow(t),new y,this.createActionShowCountdown(t),new y,this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t)],e.enabled("countdown")||i.splice(3,1),h=b.createMenu(i);else{if(o=this._mergeContentMenuItems(t),n=[a.showSymbolInfoDialog,a.compare,l?a.seriesHide:this.createActionShow(t),this.createVisualOrderAction(t),new y,this.createActionShowCountdown(t),new y],e.enabled("countdown")||n.splice(5,2),e.enabled("compare_symbol")||n.splice(1,1),e.enabled("symbol_info")||n.splice(0,1),!this.chart().onWidget()&&e.enabled("show_chart_property_page")&&n.unshift(a.format),s=this.createActionLockScale(t),s&&(n.push(s),n.push(new y)),o.length>0){for(r=0;r<o.length;r++)n.push(o[r]);n.push(new y)}n.push(this.createActionScaleLeft(t)),n.push(this.createActionScaleRight(t)),n.push(this.createActionNoScale(t)),pro.hasPackage("mtp-mtpredictor")&&(n.push(new y),n.push(this._createMTPredictorActions())),h=b.createMenu(n)}return h},o.prototype.toggleLockTimeAxis=function(t,e){var i,o,n;"boolean"!=typeof e&&(e=!w.lockTimeAxis().value()),e&&(i=this._chart.model().timeScale(),o=i.coordinateToIndex(t),n=i.points().roughTime(o),w.lockTimeAxisTime.setValue(n)),w.lockTimeAxis().setValue(e)},o.prototype._createLockTimeAxisAction=function(t){var e=new g({text:$.t("Lock Cursor In Time"),checkable:!0}),i=w.lockTimeAxis().value();return e.setChecked(i),e.callbacks().subscribe(null,this.toggleLockTimeAxis.bind(this,t.localX,!i)),e},o.prototype._createHVLineAction=function(t,e){e="vertical"===e&&"vertical"||"horizontal";var i=new g({text:"vertical"===e?$.t("Create Vertical Line"):$.t("Create Horizontal Line")});return i.callbacks().subscribe(this,function(){var i=this._chart.model().timeScale().coordinateToIndex(t.localX),o=this._state.defaultPriceScale().coordinateToPrice(t.localY),n=this._chart.model().createLineTool(this._state,{index:i,price:o},"vertical"===e&&"LineToolVertLine"||"LineToolHorzLine");this._finishTool(n)}),i},o.prototype._createMTPredictorActions=function(){var t=this,e=function(e,i,o){var n=new g({text:e});return n.callbacks().subscribe(t,function(){var t,e,n=this._chart.model(),s=n.timeScale(),r=this._state.defaultPriceScale();s.isEmpty()||r.isEmpty()||(o?(t=r.coordinateToPrice(this._contextMenuY),e=Math.round(s.coordinateToIndex(this._contextMenuX)),n.createLineTool(this._state,{index:e,price:t},i)):w.tool.setValue(i))}),n};return new g({text:$.t("MTPredictor"),subActions:[e($.t("Apply Manual Risk/Reward"),"LineStudyMtpRiskReward",!1),e($.t("Apply Manual Decision Point"),"LineStudyMtpDecisionPoint",!0),e($.t("Analyze Trade Setup"),"LineStudyMtpAnalysis",!0),new g({text:$.t("Apply Elliot Wave"),subActions:[e($.t("Apply Elliot Wave Intermediate"),"LineStudyMtpElliotWaveMain",!0),e($.t("Apply Elliot Wave Major"),"LineStudyMtpElliotWaveMajor",!0),e($.t("Apply Elliot Wave Minor"),"LineStudyMtpElliotWaveMinor",!0)]}),new g({text:$.t("Apply WPT Up Wave"),subActions:[e($.t("Up Wave 1 or A"),"LineStudyMtpUpWave1OrA",!1),e($.t("Up Wave 2 or B"),"LineStudyMtpUpWave2OrB",!1),e($.t("Up Wave C"),"LineStudyMtpUpWaveC",!1),e($.t("Up Wave 3"),"LineStudyMtpUpWave3",!1),e($.t("Up Wave 4"),"LineStudyMtpUpWave4",!1),e($.t("Up Wave 5"),"LineStudyMtpUpWave5",!1)]}),new g({text:$.t("Apply WPT Down Wave"),subActions:[e($.t("Down Wave 1 or A"),"LineStudyMtpDownWave1OrA",!1),e($.t("Down Wave 2 or B"),"LineStudyMtpDownWave2OrB",!1),e($.t("Down Wave C"),"LineStudyMtpDownWaveC",!1),e($.t("Down Wave 3"),"LineStudyMtpDownWave3",!1),e($.t("Down Wave 4"),"LineStudyMtpDownWave4",!1),e($.t("Down Wave 5"),"LineStudyMtpDownWave5",!1)]})]})},o.prototype.createEarningsShow=function(t){var e=this._chart.model().mainSeries().properties().esdShowEarnings,i=new g({checkable:!0,text:$.t("Show Earnings"),enabled:!0,checked:e.value()});return i.callbacks().subscribe(this,function(t){this._chart.model().setProperty(e,t.checked,"Show Earnings")}),i},o.prototype.createDividendsShow=function(t){var e=this._chart.model().mainSeries().properties().esdShowDividends,i=new g({checkable:!0,text:$.t("Show Dividends"),enabled:!0,checked:e.value()});return i.callbacks().subscribe(this,function(t){this._chart.model().setProperty(e,t.checked,"Show Dividends")}),i},o.prototype.createSplitsShow=function(t){var e=this._chart.model().mainSeries().properties().esdShowSplits,i=new g({checkable:!0,text:$.t("Show Splits"),enabled:!0,checked:e.value()});return i.callbacks().subscribe(this,function(t){this._chart.model().setProperty(e,t.checked,"Show Splits")}),i},o.prototype._studyEsdContextMenu=function(t){var e=[];return this._chart.readOnly()||(e.push(this.createDividendsShow(t)),e.push(this.createSplitsShow(t)),e.push(this.createEarningsShow(t))),b.createMenu(e)},o.prototype._studyContextMenu=function(t){var i,o,n,s,r,a=this._chart.actions(),l=t.properties().visible.value(),h=[];return t.userEditEnabled()?(i=this._chart,this._chart.readOnly()?h=[l?a.studyHide:this.createActionShow(t),new y,this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t)]:(o=[],n=t.metaInfo(),n.pine&&(o=[a.viewSourceCode],a.viewSourceCode.setEnabled(!0),ScriptLib.isAuthToGetPineSourceCode(n.scriptIdPart,n.pine.version).done(function(t){t||a.viewSourceCode.setEnabled(!1)}).fail(function(t){TradingView.logError("Failed isAuthToGetPineSourceCode, reason: "+t)})),h=[],TradingView.isFeatureEnabled("study_on_study")&&e.enabled("study_on_study")&&t.canHaveChildren()&&h.push(this.createActionAddChildStudy(t)),h=h.concat([a.format]),h=h.concat(o),h=h.concat([l?a.studyHide:this.createActionShow(t),this.createVisualOrderAction(t),new y]),s=this._mergeContentMenuItems(t),!s.length||t.properties().linkedToSeries&&t.properties().linkedToSeries.value()||(s.push(new y),h=h.concat(s)),h.push(this.createActionScaleLeft(t)),h.push(this.createActionScaleRight(t)),h.push(this.createActionNoScale(t)),h.push(new y),e.enabled("datasource_copypaste")&&!t.isChildStudy()&&(r=new g({text:$.t("Copy"),shortcut:"Ctrl-C"}),r.callbacks().subscribe(null,function(){i.onAppClipboardCopy(t)}),h.push(r)),h.push(a.studyRemove)),b.createMenu(h)):b.createMenu(h)},o.prototype.createLineToolTemplateAction=function(t){var e,i,o,n,s,r=t.properties(),a=window.lineToolPropertiesToolbar.templatesList(),l=new g({text:$.t("Templates")});return l.subActions||(l.subActions=[]),e=l.subActions,i=new g({text:$.t("Save As...")}),i.callbacks().subscribe(this,function(){a.showSaveDialog(t)}),e.push(i),o=new g({text:$.t("Apply Default")}),o.callbacks().subscribe(this,function(){r.restoreFactoryDefaults(),window.lineToolPropertiesToolbar.onSourceChanged(t)}),e.push(o),n=$.Deferred(),a.templatesLoaded().then(function(){var t=a.getData(),e=[];0!==t.length&&e.push(new y),$.each(t,function(t,i){function o(t){return function(){var e=this.getTopLevelMenu();return e&&e.hide(),a.deleteAction(t),!0}}var n=new g({text:i});n.callbacks().subscribe(this,function(){a.loadTemplate(i)}),n.deleteButton={action:o(n.text)},e.push(n)}),n.resolve(e)}),s=new v(n),e.push(s),l},o.prototype._lineContextMenu=function(t){var e=[],n=this._chart,s=n.actions(),r=this;return new Promise(function(a){!function(l){(function(l){var h,c,d,p,u,_=i(315).hasStylesPropertyPage;if(n.readOnly())e.push(s.lineHide);else if(t.userEditEnabled()&&(l.enabled("alerts")&&!r.chart().onWidget()&&t.hasAlert.value()&&e.push(r._createEditAlertDrawingAction(t)),t.updateContextMenuActions(),e=e.concat(t.contextMenuActions()),_(t,n.model())&&e.push(s.format),e.push(s.paneObjectTree),l.enabled("charting_library_base")||e.push(r.createLineToolTemplateAction(t)),e.push(r.createVisualOrderAction(t)),e.push(new y),e.push(s.lineHide),e.push(s.lineToggleLock),t.properties().clonable&&t.properties().clonable.value()&&(h=new g({text:$.t("Clone"),callbackContext:{target:t},shortcut:"Ctrl+Drag",doNotBindShortcut:!0}),h.callbacks().subscribe(r,o.prototype.cloneLineTool.bind(r,t,!1)),e.push(h)),l.enabled("datasource_copypaste")&&!t.properties().blockCopying&&(c=new g({text:$.t("Copy"),shortcut:"Ctrl-C"}),c.callbacks().subscribe(null,function(){n.onAppClipboardCopy(t)}),e.push(c)),l.enabled("support_multicharts")&&(t.linkKey?e.push(s.lineUnlink):e.push(s.lineCopyToCharts)),e.push(s.lineRemove),t.additionalActions))for(e.push(new y),d=t.additionalActions(n.model()),p=0;p<d.length;p++)e.push(d[p]);u=b.createMenu(e),a(u)}).call(this,i(1))}()})},o.prototype._tradingDrawingsContextMenu=function(t){return b.createMenu(t.contextMenuItems())},o.prototype._chartEventsContextMenu=function(t){var e,i=[],o=this._chart,n=new g({text:$.t("Format..."),enabled:!0});return n.callbacks().subscribe(this,function(t){TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Events & Alerts")),o.showChartProperties()}),i.push(n),e=new g({text:$.t("Hide Events on Chart"),enabled:!0}),e.callbacks().subscribe(this,function(e){t.properties().visible.setValue(!1)}),i.push(e),b.createMenu(i)},o.prototype._createAlertToggleHorzLineLabelAction=function(t){var e=t.properties().line.visible,i=new g({checkable:!0,text:$.t("Extend Alert Line"),enabled:!0,checked:e.value()});return i.callbacks().subscribe(this,function(t){var i=t.checked,o=i?$.t("Show alert label line"):$.t("Hide alert label line");this._chart.model().setProperty(e,i,o)}),i.setEnabled(t.globalProperties().line.visible.value()),i},o.prototype._createShowGlobalAlertPropertiesLabelAction=function(t){var e=this.chart(),i=new g({text:$.t("Visual settings...")});return i.callbacks().subscribe(this,function(t){e.showChartProperties({selectAlertEvent:!0})}),i},o.prototype._createEditAlertDrawingAction=function(t){if(t.hasAlert.value()){var e=new g({text:$.t("Edit {0} Alert...").format(t.title())});return e.callbacks().subscribe(null,function(){runOrSignIn(function(){t.editAlert()},{source:"Alert edit from pane context menu"})}),e}},o.prototype.cloneLineTool=function(t,e){return this._chart.model().cloneLineTool(t,e)},o.prototype.setPriceAxisSize=function(t,e){this._priceAxisWidget(t).setSize(e)},o.prototype.setPriceAxisVisible=function(t,e){this._priceAxisWidget(t).setVisible(e),this._cachedStatus=null},o.prototype.resetPriceAxisOptimalWidth=function(t){this._priceAxisWidget(t).resetOptimalWidth(),this._cachedStatus=null},o.prototype.setSize=function(t){this.size&&this.size.equals(t)||(this.size=t,L(this.canvas,t),L(this.top_canvas,t),this.ctx=this.canvas.getContext("2d"),this.jqPane.width(t.w),this.jqPane.height(t.h),this._cachedStatus=null,this.jqRow.toggleClass("js-hidden",0===t.h))},o.prototype.dataSourceAtPoint=function(t,e){var i,o,s,r,a,l,h,c,d,p,u,_,f,m,g=null,v=null;if(!this._state)return null;for(i=this._state.hitTestSources(),o=i.length;0<o--;)if(s=i[o],r=s.paneViews(this._state))for(a=r.length;0<a--;)(l=r[a].renderer(e))&&l.hitTest&&(h=l.hitTest(new n.Point(t,e)))&&(c=v?v.result():0,h.result()>c&&(v=h,g=s));if(this.containsMainSeries()){for(d=this._chart.model().barsMarksSources(),o=0;o<d.length;++o)for(s=d[o],r=s.paneViews(),a=0;a<r.length;a++)if(l=r[a].renderer(e),p=l.hitTest(new n.Point(t,e))){v=p,g=s;break}u=this._chart.model().activeStrategySource().value(),_=u&&u._strategyOrdersPaneView,_&&(f=_.renderer())&&(m=f.hitTest(new n.Point(t,e)))&&(v=m,g=u)}return null===g&&(g=this.legendWidget.dataSourceAtPoint(t,e)),{source:g,hittest:v}},o.prototype.update=function(){this.lhsPriceAxisWidget.update(),this.rhsPriceAxisWidget.update(),this.legendWidget.update(),this.paneControls&&this.paneControls.update()},o.prototype.updateControls=function(){this.paneControls&&this.paneControls.update()},o.prototype.drawBackground=function(t,e){k(t,0,0,this.size.w,this.size.h,e)},o.prototype.drawGrid=function(t){var e,i,o=this._chart.model().gridSource(),n=o.paneViews(this._state);for(e=0;e<n.length;e++)t.save(),i=n[e].renderer(t.canvas.height),i&&i.draw(t),t.restore()},o.prototype.drawWatermark=function(t){var e,i,o=this._chart.model().watermarkSource(),n=o.paneViews(this._state);for(e=0;e<n.length;e++)t.save(),i=n[e].renderer(t.canvas.height),i&&i.draw(t),t.restore()},o.prototype.drawCrossHair=function(t){var e=this._chart.model().crossHairSource();e.visibleTrap&&(!e.visible&&w.lockTimeAxis().value()&&(e.setLockedPosition(this._state),e.updateAllViews()),this._drawSource(e,t))},o.prototype._drawSource=function(t,e){var i,o,n=t.paneViews(this._state);if(n)for(i=0;i<n.length;i++)(o=n[i].renderer(e.canvas.height))&&(e.save(),o.draw(e),e.restore())},o.prototype._drawSourceStrategyOrders=function(t,e){var i,o=t._strategyOrdersPaneView;o&&(i=o.renderer())&&(e.save(),i.draw(e),e.restore())},o.prototype._drawSourceBackground=function(t,e){var i,o,n=t.paneViews(this._state);if(n)for(i=0;i<n.length;i++)(o=n[i].renderer(e.canvas.height))&&o.drawBackground&&(e.save(),o.drawBackground(e),e.restore())},o.prototype.drawActiveLineTool=function(t){var e,i,o=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];for(e=0;e<o.length;e++)(i=o[e])&&this._chart.model().paneForSource(i)===this._state&&this._drawSource(i,t)},o.prototype.disableDrawOnTop=function(t){return t&&t.hasOwnProperty("_metaInfo")&&"Volume@tv-basicstudies"===t._metaInfo.id},o.prototype.drawSources=function(t){var e,i,o,n,s=this._state.orderedSources(),r=this._state.model(),a=this._chart.model().selectedSource(),l=this._chart.model().hoveredSource(),h=r.crossHairSource(),c=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];for(this.disableDrawOnTop(a)&&(a=void 0),this.disableDrawOnTop(l)&&(l=void 0),e=this._chart.model().model().panes(),i=e.length-1;i>=0;i--)e[i].createDrawingsCaches();for(i=0;i<s.length;i++)this._drawSourceBackground(s[i],t);for(i=0;i<s.length;i++)(o=s[i])!==h&&o!==a&&o!==l&&c.indexOf(o)===-1&&this._drawSource(o,t);for(a&&c.indexOf(a)===-1&&s.indexOf(a)!==-1&&this._drawSource(a,t),l&&c.indexOf(l)===-1&&s.indexOf(l)!==-1&&this._drawSource(l,t),n=this._chart.model().activeStrategySource().value(),n&&this.containsMainSeries()&&this._drawSourceStrategyOrders(n,t),i=e.length-1;i>=0;i--)e[i].clearDrawingCaches()},o.prototype.recalculatePriceScale=function(){var t,e,i,o=this._state;for(o.recalculatePriceScale(o.m_rightPriceScale),o.recalculatePriceScale(o.m_leftPriceScale),t=o.dataSources(),e=0;e<t.length;++e)i=t[e],o.isOverlay(i)&&(i instanceof d||o.recalculatePriceScale(i.priceScale()),i.updateAllViews())},o.prototype.containsMainSeries=function(){return this._state.containsMainSeries()},o.prototype.drawBarsMarks=function(t,e){var i,o;this.containsMainSeries()&&!e&&(i=this._chart.model().barsMarksSources(),o=this,i.forEach(function(e){o._drawSource(e,t)}))},o.prototype._syncOverlays=function(){var t,e,i=this._state.orderedSources(),o={},n=this;$.each(i,function(){var t,e,i=this.paneViews(n._state);if(i)for(t=0;t<i.length;t++)e=i[t],e.uid&&(o[e.uid()]=e)});for(t in this._overlays)o[t]||(this._dv.remove(this._overlays[t]),this._overlays[t]=void 0);for(t in o)this._overlays[t]||(e=o[t].overlay(),this._dv.append(e),this._overlays[t]=e)},o.prototype.paint=function(t,e){if(t&&this._chart.model())if(this.lhsPriceAxisWidget.paint(t),this.rhsPriceAxisWidget.paint(t),t===C.FULL_UPDATE&&(this._cachedStatus=null),t===C.UPDATE_CURSOR_ONLY)this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx);else{var i=this.ctx;this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawBackground(i,this.backgroundColor()),this._state&&(this.recalculatePriceScale(),this.drawGrid(i),this.drawWatermark(i),this.drawSources(i),this.drawBarsMarks(i,e),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx))}},o.prototype.leftPriceAxisWidget=function(){return this.lhsPriceAxisWidget},o.prototype.rightPriceAxisWidget=function(){return this.rhsPriceAxisWidget},o.prototype._priceAxisWidget=function(t){return l.isLeft(t)?this.lhsPriceAxisWidget:this.rhsPriceAxisWidget},o.prototype.statusWidget=function(){return this.legendWidget},o.prototype.onScaleLeft=function(t){var e=t.callbackContext();this._state.leftPriceScale().dataSources().indexOf(e)===-1&&this.chart().model().move(e,this._state,this._state.leftPriceScale())},o.prototype.onScaleRight=function(t){var e=t.callbackContext();this._state.rightPriceScale().dataSources().indexOf(e)===-1&&this.chart().model().move(e,this._state,this._state.rightPriceScale())},o.prototype.onNoScale=function(t){var e=t.callbackContext();this._state.isOverlay(e)||this.chart().model().move(e,this._state,null)},o.prototype.onRiskReward=function(t){},o.prototype.createActionRiskReward=function(t){var e=new g({checkable:!1,text:$.t("Risk/Reward"),enabled:!0});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onRiskReward),e},o.prototype.createActionScaleLeft=function(t){var e=new g({checkable:!0,text:$.t("Scale Left"),enabled:!0});return e.setCallbackContext(t),e.setChecked(this._state.leftPriceScale().dataSources().indexOf(t)!==-1),e.callbacks().subscribe(this,o.prototype.onScaleLeft),e},o.prototype.createActionScaleRight=function(t){var e=new g({checkable:!0,text:$.t("Scale Right"),enabled:!0});return e.setCallbackContext(t),e.setChecked(this._state.rightPriceScale().dataSources().indexOf(t)!==-1),e.callbacks().subscribe(this,o.prototype.onScaleRight),e},o.prototype.createActionNoScale=function(t){var e=this._chart.model().paneForSource(t),i=e.actionNoScaleIsEnabled(t),n=new g({checkable:!0,text:$.t("Screen (No Scale)"),enabled:i});return n.setCallbackContext(t),n.setChecked(this._state.isOverlay(t)),n.callbacks().subscribe(this,o.prototype.onNoScale),n},o.prototype.createActionShowCountdown=function(t){var e=i(309).ActionBinder,o=new g({checkable:!0,text:$.t("Show Countdown"),enabled:!0}),n=this._chart.model().mainSeries().properties();return o._binding=new e(o,n.showCountdown,this._chart.model(),o.text),o._binding.setValue(n.showCountdown.value()),o},o.prototype.createActionLockScale=function(t){var e,o,n=i(309).ActionBinder;return t instanceof TradingView.Series?(e=new g({checkable:t.properties().lockScale.value(),text:$.t("Lock Scale"),enabled:!0}),o=function(e){this._undoModel.setLockScaleProperty(this._property,e.checked,t,this._undoText)},e._binding=new n(e,t.properties().lockScale,this._chart.model(),e.text,o),e):null},o.prototype.createActionMergeUp=function(t){var e;return this._chart.model().paneForSource(t)===this._chart.model().panes()[0]?null:(e=new g({checkable:!1,text:$.t("Merge Up"),enabled:!0}),e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onMergeUp),e)},o.prototype.onMergeUp=function(t){var e=t.callbackContext(),i=this._chart.model().paneForSource(e),o=this._chart.model().panes().indexOf(i),n=this._chart.model().panes()[o-1],s=n.findSuitableScale(e);this._chart.model().move(e,n,s)},o.prototype.createActionUnmergeUp=function(t){var e;return this._chart.model().paneForSource(t).dataSources().filter(function(t){return TradingView.isInherited(t.constructor,f)&&t.showInObjectTree()}).length>1?(e=new g({checkable:!1,text:$.t("Unmerge Up"),enabled:!0}),e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onUnmergeUp),e):null},o.prototype.onUnmergeUp=function(t){var e=t.callbackContext(),i=this._chart.model().paneForSource(e),o=this._chart.model().panes().indexOf(i),n=this._chart.model().createPane(o),s=n.findSuitableScale(e);this._chart.model().move(e,n,s)},o.prototype.createActionMergeDown=function(t){var e,i=this._chart.model().paneForSource(t),n=this._chart.model().panes();return i===n[n.length-1]?null:(e=new g({checkable:!1,text:$.t("Merge Down"),enabled:!0}),e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onMergeDown),e)},o.prototype.onMergeDown=function(t){var e=t.callbackContext(),i=this._chart.model().paneForSource(e),o=this._chart.model().panes().indexOf(i),n=this._chart.model().panes()[o+1],s=n.findSuitableScale(e);this._chart.model().move(e,n,s)},o.prototype.createActionUnmergeDown=function(t){var e;return this._chart.model().paneForSource(t).dataSources().filter(function(t){return TradingView.isInherited(t.constructor,f)&&t.showInObjectTree()}).length>1?(e=new g({checkable:!1,text:$.t("Unmerge Down"),enabled:!0}),e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onUnmergeDown),e):null},o.prototype.onUnmergeDown=function(t){var e=t.callbackContext(),i=this._chart.model().paneForSource(e),o=this._chart.model().panes().indexOf(i),n=this._chart.model().createPane(o+1),s=n.findSuitableScale(e);this._chart.model().move(e,n,s)},o.prototype._mergeContentMenuItems=function(t){var e=[],i=this.createActionMergeUp(t);return i&&e.push(i),i=this.createActionUnmergeUp(t),i&&e.push(i),i=this.createActionMergeDown(t),i&&e.push(i),i=this.createActionUnmergeDown(t),i&&e.push(i),e},o.prototype.createActionShow=function(t){var e=i(309).ActionBinder,o=new g({checkable:!0,text:$.t("Show"),enabled:!0});return o._binding=new e(o,t.properties().visible,this._chart.model(),o.text),o._binding.setValue(t.properties().visible.value()),o},o.prototype.createActionAddChildStudy=function(t){var e=new g({text:$.t("Apply Indicator on {0} ...").format(t.title(!0)),enabled:!0});return e.callbacks().subscribe(this,function(){var e,i,o=this._chart.showIndicators(t);o&&(e=function(){_("SOS","Apply SOS","Apply by RC menu")},i=this._chart.model().model().studyInserted(),i.subscribe(this,e),o.visibilityChanged.subscribe(this,function(t){t||i.unsubscribe(this,e)},!0))}),e},o.prototype.bringObjectForward=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().changeZOrder(e,1)},o.prototype.sendObjectToBack=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().sendToBack(e)},o.prototype.bringObjectToFront=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().bringToFront(e)},o.prototype.sendObjectBackward=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().changeZOrder(e,-1)},o.prototype.createVisualOrderAction=function(t){var e,i,n,s,r,a,l=new g({text:$.t("Visual Order")});return l.subActions||(l.subActions=[]),e=new g({text:$.t("Bring to Front")}),e.callbacks().subscribe(this,o.prototype.bringObjectToFront),l.subActions.push(e),i=new g({text:$.t("Send to Back")}),i.callbacks().subscribe(this,o.prototype.sendObjectToBack),l.subActions.push(i),n=new g({text:$.t("Bring Forward")}),n.callbacks().subscribe(this,o.prototype.bringObjectForward),l.subActions.push(n),s=new g({text:$.t("Send Backward")}),s.callbacks().subscribe(this,o.prototype.sendObjectBackward),l.subActions.push(s),r=this._chart.model().paneForSource(t),a=r.getZOrderMinMax(),i.setEnabled(!0),n.setEnabled(!0),s.setEnabled(!0),e.setEnabled(!0),t.zorder()===a.minZOrder&&(i.setEnabled(!1),s.setEnabled(!1)),t.zorder()===a.maxZOrder&&(n.setEnabled(!1),e.setEnabled(!1)),l},o.prototype.image=function(){var t={};return t.leftAxis=this.leftPriceAxisWidget().image(),t.rightAxis=this.rightPriceAxisWidget().image(),t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t},o.prototype._updateTooltip=function(t,e){if(!this._rafSet){var i=this;requestAnimationFrame(function(){i._updateTooltipImpl(t,e),i._rafSet=!1}),this._rafSet=!0}},o.prototype._updateTooltipImpl=function(t,e){function i(i){function n(){return TradingView.isMobile.any()?{left:t-o._tooltipSelector.outerWidth()-16,top:e-o._tooltipSelector.outerHeight()-16}:{left:t+16,top:e+16}}TradingView[s].getTooltipText&&(i=TradingView[s].getTooltipText(l)||i),o._tooltipSelector.html(i).removeClass("tooltip-selector-hidden").css(n())}var o,n,s,a,l,h;if(this._chart){for(o=this,n=this._chart.paneWidgets(),s=w.tool.value(),a=this._state.model(),l=a.lineBeingCreated(),h=n.length-1;h>=0;h--)n[h]._hideTooltip();r.isStudyLineTool(s)&&!TradingView.isMobile.any()?i($.t("Click to set a point")):TradingView.isMobile.any()&&"LineToolBrush"!==s&&o.isLineTool(s)&&!o._chart.model().lineBeingCreated()?i($.t("1. Slide your finger to select location for first anchor<br>2. Tap anywhere to place the first anchor")):TradingView.isMobile.any()&&"LineToolBrush"!==s&&o.isLineTool(s)&&i($.t("1. Slide your finger to select location for next anchor<br>2. Tap anywhere to place the next anchor"))}},o.prototype._hideTooltip=function(){this._tooltipSelector.addClass("tooltip-selector-hidden")},o.prototype._updateCrosshairOnZoom=function(){var t,e;w.lockTimeAxis().value()&&(t=this._chart.model(),e=t.crossHairSource(),e.setPosition(e.index,e.price,this._state))},t.exports=o}).call(e,i(1))},function(t,e){},function(t,e,i){(function(t){"use strict";function o(t,e){var i="Change Chart Layout to "+Y[e].title;s.call(this,i),this._chartWidgetCollection=t,this._newLayoutId=e,this._oldLayoutId=t.layout.value()}function n(e,i,o,n,s,a,l,h){this._chartWidget=h,this.m_model=new X(e,i,o,n,s,a,l,this,!!h._containsData),this.m_undoStack=new r,this.m_redoStack=new r,this.m_zoomStack=new r,this._onRearrangePanes=new t,this._onSimpleZoomIn=new t,this._onSimpleZoomOut=new t}function s(t){this._text=t}function r(){this.m_commands=[],this._onChange=new t}function a(t){s.call(this,t),this._subcommands=[]}function l(t,e,i,o){s.call(this,i),this._targetObj=t,this._newValue=e,this._model=o}function h(t,e,i,o,n){s.call(this,o),this._property=t,this._priceScale=i,this._newValue=e,this._model=n}function c(t,e,i,o,n){s.call(this,o),this._percentage=t,this._priceScale=i,this._newValue=e,this._model=n}function d(t,e,i,o,n){s.call(this,o),this._log=t,this._priceScale=i,this._newValue=e,this._model=n}function p(t,e,i,o,n,r){s.call(this,o),this._style=t,this._mainSeries=i,this._priceAxisProperties=i.properties().priceAxisProperties,this._newValue=e,this._model=n,this._chartWidget=r}function u(t,e,i,o,n){s.call(this,o),this._property=t,this._mainSeries=i,this._priceAxisProperties=i.properties().priceAxisProperties,this._newValue=e,this._model=n}function _(t,e,i,o){this.m_model=t,this.m_pane=e,this.m_priceScale=i,this.m_state=o,this.m_newPriceScaleState=null}function f(t,e,i){s.call(this,i),this.m_model=t,this.m_state=e,this.m_newTimeScaleState=null}function m(t,e,i,o){this._model=t,this._series=e,this._oldSymbol=e.symbol(),this._oldInterval=e.interval(),this._symbol=i,this._interval=o}function g(t,e,i,o,n){s.call(this,"Insert "+e.id),this._model=t,this._studyMetaInfo=e,this._props=i,this._isOverlay=o,this._parentSource=n}function v(t,e){this._model=t,this._sourceId=e.id()}function y(t,e){this._model=t,this._linetools=e,this._statesByPaneIndexes={}}function b(t,e,i,o){this._model=t,this._sourceId=e.id(),this._oldPane=this._model.paneForSource(e),this._oldPaneIndex=t.panes().indexOf(this._oldPane),this._oldScaleName=this._oldPane.priceScaleName(e.priceScale()),this._pane=i,this._paneIndex=t.panes().indexOf(i),this._pane?this._scaleName=this._pane.priceScaleName(o):this._paneIndex=t.panes().length}function w(t,e,i){s.call(this,"Create line "+i),this._model=t,this._paneIndex=t.panes().indexOf(e),this._lineTool=i}function S(t,e,i,o){this._model=t,this._prevState=e.state(!0),this._nextState=this._prevState}function T(t,e,i,o){this._model=t,this._sourceId=e.id(),i instanceof q.Point?this._origPoint=i.clone():this._origPoint=TradingView.clone(i),this._pointIndex=o}function C(t,e,i){s.call(this,"Change "+e.title()+" Z order"),this._model=t,this._sourceId=e.id(),this._shift=i}function x(t,e){s.call(this,"Change "+e.title()+" Z order"),this._model=t,this._sourceId=e.id()}function P(t,e){s.call(this,"Change "+e.title()+" Z order"),this._model=t,this._sourceId=e.id()}function L(t,e,i){s.call(this,"Remove pane"),this._model=t,this._index=e,this._pane=this._model.panes()[e],this._chart=i}function k(t,e,i,o){s.call(this,"Rearrange panes"),this._model=t,this._index=e,this._direction=i,this._chart=o}function I(t,e,i,o,n,s){this._model=t,this._startBar=e,this._endBar=i,this._startPrice=o,this._endPrice=n,this._pane=s}function E(t,e,i){this._baseCmd=t,this._zoomStack=e,this._inOut=i}function A(t,e,i,o,n){this._model=t,this._paneA=e,this._paneB=i,this._prevStretchA=o,this._currStretchA=n}function V(t,e){s.call(this,"Restore Defaults"),this._model=t,this._defaultProperty=e,this._state=e.state(e._exclusions),this._chartWidget=t._undoModel._chartWidget}function M(t,e){s.call(this,"Apply Chart Theme"),this._model=t,this._newChartProps=TradingView.factoryDefaults("chartproperties"),["candleStyle","hollowCandleStyle","haStyle"].forEach(function(t){e.mainSourceProperties[t].wickUpColor=e.mainSourceProperties[t].wickUpColor||e.mainSourceProperties[t].wickColor,e.mainSourceProperties[t].wickDownColor=e.mainSourceProperties[t].wickDownColor||e.mainSourceProperties[t].wickColor}),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||e.chartProperties.paneProperties.gridProperties,e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||e.chartProperties.paneProperties.gridProperties,e.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=$.extend(!0,{},this._newChartProps,e.chartProperties),delete this._newChartProps.scalesProperties.showLeftScale,delete this._newChartProps.scalesProperties.showRightScale,delete this._newChartProps.scalesProperties.scaleSeriesOnly,delete this._newChartProps.scalesProperties.showSeriesLastValue,delete this._newChartProps.scalesProperties.showStudyLastValue,delete this._newChartProps.scalesProperties.showSymbolLabels,delete this._newChartProps.scalesProperties.showStudyPlotLabels,this._newSeriesProps=e.mainSourceProperties,this._newChartProps.symbolWatermarkProperties||(this._newChartProps.symbolWatermarkProperties=defaults("chartproperties.symbolWatermarkProperties"),this._newChartProps.symbolWatermarkProperties.color=this._newChartProps.scalesProperties.textColor),this._oldChartProps=t.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=t.properties().state().mainSeriesProperties}function D(t,e){s.call(this,"Apply Drawing Template"),this._source=t,this._oldProps=t.properties().state(),this._newProps=e}function O(t,e,i,o){var n;o=" "+o||"",n=o+" Study template",s.call(this,n),this._model=t,this._oldProps=e,this._newProps=i}function B(t,e,i,o,n){this._model=t,this._pane=e,this._priceScale=i,this._topMargin=o,this._bottomMargin=n,this._oldTopMargin=i.topMargin(),this._oldBottomMargin=i.bottomMargin()}function R(t,e){this._model=t,this._range=e}function N(t,e,i,o,n){s.call(this,t),this._property=e,this._value=i,this._forceSetProperty=n,this._prevValue=e.value(),this._cw=o}function F(t,e){var i,o,n,s,r,a=e.priceScale(),l=[];for(a.isPercent()&&(i=e.firstValue()),o=0;o<t.length;o++)n={offset:t[o].offset,time_t:t[o].time_t},s=t[o].price,a.isPercent()&&(s=a.priceRange().convertToPercent(s,i)),r=a.priceToCoordinate(s),r-=40,s=a.coordinateToPrice(r),a.isPercent()&&(s=a.priceRange().convertFromPercent(s,i)),n.price=s,l.push(n);return l}function W(t,e,i){s.call(this,"clone "+e.title()),this._model=t,this._originalSource=e,this._withoutShift=i}function z(t,e,i){s.call(this,i),this._wv=t,this._newValue=e,this._oldValue=t.value()}function H(t,e){this._model=t,this._sourceId=e.id(),this._linkKey=e.linkKey}function U(t,e,i){s.call(this,"Paste"),this._model=t,this._clipboardData=e,this._paneIndex=this._model.panes().indexOf(i||this._model.paneForSource(this._model.mainSeries()))}function j(t,e){s.call(this,"Paste"),this._model=t,this._clipboardData=e}var q=i(30),Y=i(287),G=i(145),K=i(82).LineDataSource,X=(i(1),i(143)),Z=i(92),J=i(99),Q=i(183).animate,tt=i(292),et=i(91),it=et.saveDefaultProperties,ot=i(293),nt=i(102),st=i(171),rt=st.Study,at=i(271),lt=i(294).createTooManyStudiesNotice,ht=function(){function t(t){h&&e(),h=new a(t)}function e(){if(h){var t=h;h=null,t.isEmpty()||n(t)}}function i(){if(c.isEmpty())return!1;var t=c.pop();return t.undo(),d.push(t),!0}function o(){if(d.isEmpty())return!1;var t=d.pop();return t.redo(),c.push(t),!0}function n(t){if(h)return void h.addCommand(t);d.clear(),c.push(t)}function s(){return{lastActualCommand:c.isEmpty()?null:c.head()}}function l(t){for(;!c.isEmpty()&&t.lastActualCommand!==c.head();)c.pop().undo();d.clear()}var h=null,c=new r,d=new r;return{beginUndoMacro:t,endUndoMacro:e,undo:i,redo:o,pushUndoCommand:n,createUndoCheckpoint:s,undoToCheckpoint:l,undoStack:function(){return c},redoStack:function(){return d},clearStack:function(){c.clear(),d.clear()}}}();ht.setChartLayout=function(t,e){if(t.layout.value()===e)return!1;var i=new o(t,e);i.redo(),this.pushUndoCommand(i)},inherit(o,s),o.prototype.redo=function(){this._chartWidgetCollection.layout.setValue(this._newLayoutId)},o.prototype.undo=function(){this._chartWidgetCollection.layout.setValue(this._oldLayoutId)},inherit(n,tt),n.prototype.version=function(){return this.m_model._version},n.prototype.onData=function(t){switch(t.method){case"timescale_update":var e=t.params;this.m_model.updateTimeScale(e.index,e.zoffset,e.changes,e.marks,e.clear)}},n.prototype.paneForSource=function(t){return this.m_model.paneForSource(t)},n.prototype.createPane=function(t){return this.m_model.createPane(t)},n.prototype.dumpViews=function(){return this.m_model.dumpViews()},n.prototype.readOnly=function(){return this.m_model.readOnly()},n.prototype.restart=function(){this.m_model.restart()},n.prototype.disconnect=function(){this.m_model.disconnect()},n.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},n.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},n.prototype.chartModel=function(){return this.m_model},n.prototype.undoStack=ht.undoStack,n.prototype.redoStack=ht.redoStack,n.prototype.undo=ht.undo,n.prototype.redo=ht.redo,n.prototype.pushUndoCommand=ht.pushUndoCommand,n.prototype.startScalePrice=function(t,e,i){this.pushUndoCommand(new _(this.m_model,t,e,e.state())),this.chartModel().startScalePrice(t,e,i)},n.prototype.scalePriceTo=function(t,e,i){this.chartModel().scalePriceTo(t,e,i)},n.prototype.endScalePrice=function(t,e){this.chartModel().endScalePrice(t,e)},n.prototype.startScrollPrice=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollState=e.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(t,e,i))},n.prototype.scrollPriceTo=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new _(this.m_model,t,e,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(t,e,i))},n.prototype.endScrollPrice=function(t,e){e.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(t,e))},n.prototype.setPriceAutoScale=function(t,e,i){this.pushUndoCommand(new _(this.m_model,t,e,e.state())),this.chartModel().setPriceAutoScale(t,e,i)},n.prototype.resetPriceScale=function(t,e){this.pushUndoCommand(new _(this.m_model,t,e,e.state())),this.chartModel().resetPriceScale(t,e)},n.prototype.startScaleTime=function(t){this.pushUndoCommand(new f(this.m_model,this.m_model.timeScale().state(),"scale time")),this.chartModel().startScaleTime(t)},n.prototype.scaleTimeTo=function(t){this.chartModel().scaleTimeTo(t)},n.prototype.endScaleTime=function(){this.chartModel().endScaleTime()},n.prototype.startScrollTime=function(t){this._initialTimeScrollState=this.m_model.timeScale().state(),this._initialTimeScrollPos=t,this.chartModel().startScrollTime(t)},n.prototype.scrollTimeTo=function(t){this._initialTimeScrollPos&&Math.abs(t-this._initialTimeScrollPos)>20&&(this.pushUndoCommand(new f(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState),this.chartModel().scrollTimeTo(t)},n.prototype.gotoTime=function(t,e){var i,o,n=this.timeScale().visibleBars();if(!n)return $.Deferred().reject().promise();i=n.firstBar(),o=this.m_model.timeScale().state(),this.chartModel().gotoTime(t,e),i!==this.timeScale().visibleBars().firstBar()&&this.pushUndoCommand(new f(this.m_model,o,"scroll time"))},n.prototype.endScrollTime=function(){this.chartModel().endScrollTime(),delete this._initialTimeScrollPos,delete this._initialTimeScrollState},n.prototype.resetTimeScale=function(){this.pushUndoCommand(new f(this.m_model,this.m_model.timeScale().state())),this.chartModel().resetTimeScale()},n.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()},n.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()},n.prototype.setWidth=function(t){this.m_model.setWidth(t)},n.prototype.setPaneHeight=function(t,e){this.m_model.setPaneHeight(t,e)},n.prototype.gridSource=function(){return this.m_model.gridSource()},n.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},n.prototype.addAlertsSource=function(t){return this.m_model.addAlertsSource(t)},n.prototype.alertsSources=function(){return this.m_model.alertsSources()},n.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},n.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},n.prototype.model=function(){return this.m_model},n.prototype.mainSeries=function(){return this.m_model.m_mainSeries},n.prototype.panes=function(){return this.m_model.m_panes},n.prototype.timeScale=function(){return this.m_model.timeScale()},n.prototype.setSelectedSource=function(t,e){this.m_model.setSelectedSource(t,e)},n.prototype.setHoveredSource=function(t,e){this.m_model.setHoveredSource(t,e)},n.prototype.selectedSource=function(){return this.m_model.selectedSource()},n.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},n.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},n.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},n.prototype.invalidate=function(t){this.m_model.invalidate(t)},n.prototype.setCurrentPosition=function(t,e,i,o){this.m_model.setCurrentPosition(t,e,i,o)},n.prototype.modifySeries=function(t,e,i){var o=new m(this.m_model,t,e,i);this.pushUndoCommand(o),o.redo()},n.prototype.canCreateStudy=function(t){return this.model().chartApi().chartApi().isCanCreateStudy(t)},n.prototype.insertStudy=function(t,e,i,o){var n,s=this.canCreateStudy(),r=o&&o instanceof rt;return!this.readOnly()&&r&&(s=this.canCreateStudy(!0)),s?TradingView.isFeatureEnabled("backtesting")||!t.isTVScriptStrategy?(n=new g(this.m_model,t,e,i,o),this.pushUndoCommand(n),n.redo()):void 0:void(r?goProDialog({feature:"studyOnStudy"}).open():lt().open())},n.prototype.setProperty=function(t,e,i){if(t&&t.value()!==e){var o=new l(t,e,i,this.m_model);this.pushUndoCommand(o),o.redo(),this.emitEvent("setProperty")}},n.prototype.setPercentProperty=function(t,e,i,o){if(t.value()!==e){var n=new c(t,e,i,o,this.m_model);this.pushUndoCommand(n),n.redo()}},n.prototype.setLogProperty=function(t,e,i,o){if(t.value()!==e){var n=new d(t,e,i,o,this.m_model);this.pushUndoCommand(n),n.redo()}},n.prototype.setAutoScaleProperty=function(t,e,i,o){if(t.value()!==e){var n=new h(t,e,i,o,this.m_model);this.pushUndoCommand(n),n.redo()}},n.prototype.setChartStyleProperty=function(t,e,i){if(t.value()!==e){var o=new p(t,e,this.mainSeries(),i,this.m_model,this._chartWidget);this.pushUndoCommand(o),o.redo(),this.emitEvent("setChartStyleProperty")}},n.prototype.setLockScaleProperty=function(t,e,i,o){if(t.value()!==e){var n=new u(t,e,i,o,this.m_model);this.pushUndoCommand(n),n.redo()}},n.prototype.setScreenChartProperty=function(t,e,i,o,n){if(n||t.value()!==e){var s=new N(o,t,e,i,n);this.pushUndoCommand(s),s.redo()}},n.prototype.beginUndoMacro=ht.beginUndoMacro,n.prototype.endUndoMacro=ht.endUndoMacro,n.prototype.createUndoCheckpoint=ht.createUndoCheckpoint,n.prototype.undoToCheckpoint=ht.undoToCheckpoint,n.prototype._getSourcesTree=function(t){var e,i=[],o=this.m_model.children(t);for(e=0;e<o.length;e++)i=i.concat(this._getSourcesTree(o[e]));return i.push(t),i},n.prototype.removeSource=function(t,e){var i,o,n;if(t.isUserDeletable()){for(i=this._getSourcesTree(t),this.beginUndoMacro("Remove source"),o=0;o<i.length;++o)n=new v(this.m_model,i[o]),this.pushUndoCommand(n),n.redo();this.endUndoMacro(),e||(1===i.length?this.emitEvent("removeSource",[i[0]]):this.emitEvent("removeSources",[i]))}},n.prototype.removeSelectedSource=function(){var t,e=this.m_model.selectedSource();e&&e.isUserDeletable()&&(this.setSelectedSource(null),t=new v(this.m_model,e),this.pushUndoCommand(t),t.redo(),this.emitEvent("removeSource",[e]))},n.prototype.removeLineTools=function(t){var e=new y(this.m_model,t);this.pushUndoCommand(e),e.redo(),this.emitEvent("removeSources",[t])},n.prototype.move=function(t,e,i){var o=new b(this.m_model,t,e,i);this.pushUndoCommand(o),o.redo(),this.emitEvent("moveSource",[t])},n.prototype.createLineTool=function(t,e,i,o,n){var s,r;return"LineToolRegressionTrend"!==i||this.canCreateStudy()?(this._createLineCommand=new w(this.m_model,t,i),s=this._createLineCommand.startCreatingLine(e,o,n),r=this._createLineCommand.line(),s&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),r):void lt().open()},n.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()},n.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()},n.prototype.coninueCreatingLine=function(t,e,i){var o=this._createLineCommand.continueCreatingLine(t,e,i);return o&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),o},n.prototype.finishLineTool=function(t){this.m_model.finishLineTool(t)},n.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()},n.prototype.lineCancelled=function(){return this.m_model.lineCancelled()},n.prototype.startChangingLinetool=function(t,e,i,o){this._currentLineChangeCommand=new S(this.m_model,t,i,o),this.m_model.startChangingLinetool(t,e,i,o)},n.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()},n.prototype.changeLinePoint=function(t,e){this._currentLineChangeCommand.setPoint(t,e),this.m_model.changeLinePoint(t,e)},n.prototype.endChangingLinetool=function(t){this.m_model.endChangingLinetool(t),this._currentLineChangeCommand.endChanging(),this.pushUndoCommand(this._currentLineChangeCommand),this._currentLineChangeCommand=null},n.prototype.startMovingSource=function(t,e,i){this._currentLineMoveCommand=new T(this.m_model,t,e,i),this.m_model.startMovingSource(t,e,i)},n.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()},n.prototype.moveSource=function(t){this._currentLineMoveCommand.setPoint(t),this.m_model.moveSource(t)},n.prototype.endMovingSource=function(t){this.m_model.endMovingSource(t),this._currentLineMoveCommand._point&&(this.pushUndoCommand(this._currentLineMoveCommand),this._currentLineChangeCommand=null)},n.prototype.dataSources=function(){return this.m_model.dataSources()},n.prototype.dataSourceForId=function(t){return this.m_model.dataSourceForId(t)},n.prototype.state=function(t,e){return this.m_model.state(t,e)},n.prototype.asyncState=function(t){return this.m_model.asyncState(t)},n.prototype.restoreState=function(t,e){return this.m_model.restoreState(t,e)},n.prototype.calculateDefaultTags=function(){return this.m_model.calculateDefaultTags()},n.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()},n.prototype.changeZOrder=function(t,e){var i=new C(this.m_model,t,e);this.pushUndoCommand(i),i.redo(),this.emitEvent("changeZOrder",[t,e])},n.prototype.sendToBack=function(t){var e=new x(this.m_model,t);this.pushUndoCommand(e),e.redo(),this.emitEvent("changeZOrder",[t])},n.prototype.bringToFront=function(t){var e=new P(this.m_model,t);this.pushUndoCommand(e),e.redo(),this.emitEvent("changeZOrder",[t])},n.prototype.removeAllStudies=function(){var t,e,i;for(this.beginUndoMacro("remove all studies"),t=this.m_model.dataSources(),e=0;e<t.length;e++)i=t[e],(TradingView.isInherited(i.constructor,rt)&&!i.isChildStudy()&&i.removeByRemoveAllStudies()||TradingView.isInherited(i.constructor,at))&&this.removeSource(i);this.endUndoMacro()},n.prototype.removeAllDrawingTools=function(t){var e,i,o;for(this.beginUndoMacro("remove all drawing tools"),e=this.m_model.dataSources(),i=0;i<e.length;i++)o=e[i],TradingView.isInherited(o.constructor,K)&&o.isActualSymbol()&&o.isUserDeletable()&&(t&&t!==o._constructor||this.removeSource(o));this.endUndoMacro()},n.prototype.unlinkLine=function(t){var e=new H(this.m_model,t);this.pushUndoCommand(e),e.redo()},n.prototype.copyToOtherCharts=function(t){this.m_model.copyToOtherCharts(t)},n.prototype.moveDown=function(){var t,e,i,o,n;try{this.beginUndoMacro("Move Down")}catch(t){return}t=this,e=this.m_model.mainSeries(),i=this.m_model.paneForSource(e),o=i.priceScaleForSource(e),o.setAutoScale(!1),n=o.height(),Q(n/5,function(e){t.startScrollPrice(i,o,0),t.scrollPriceTo(i,o,e),t.endScrollPrice(i,o)},function(){t.endUndoMacro()})},n.prototype.moveUp=function(){var t,e,i,o,n;try{this.beginUndoMacro("Move Up")}catch(t){return}t=this,e=this.m_model.mainSeries(),i=this.m_model.paneForSource(e),o=i.priceScaleForSource(e),o.setAutoScale(!1),n=o.height(),Q(n/5,function(e){t.startScrollPrice(i,o,e),t.scrollPriceTo(i,o,0),t.endScrollPrice(i,o)},function(){t.endUndoMacro()})},n.prototype.moveLeft=function(){var t,e;try{this.beginUndoMacro("Move Left")}catch(t){return}t=this.m_model.timeScale().width(),e=this,Q(t/5,function(t){e.startScrollTime(t),e.scrollTimeTo(0),e.endScrollTime()},function(){e.endUndoMacro()})},n.prototype.moveRight=function(){var t,e;try{this.beginUndoMacro("Move Right")}catch(t){return}t=this.m_model.timeScale().width(),e=this,Q(t/5,function(t){e.startScrollTime(0),e.scrollTimeTo(t),e.endScrollTime()},function(){e.endUndoMacro()})},n.prototype.scrollChart=function(t){this.startScrollTime(0),this.scrollTimeTo(t),this.endScrollTime()},n.prototype.scrollChartByBar=function(t){var e=t*this.m_model.timeScale().barSpacing();this.startScrollTime(0),this.scrollTimeTo(e),this.endScrollTime()},n.prototype.zoomIn=function(t,e){var i,o,n=this.m_model.timeScale().width(),s=this;if(e=e||1,this.canZoomIn())if(t)i=e*n/10,o=i*((t+1)/2),this.startScaleTime(i),this.scaleTimeTo(0),this.endScaleTime(),this.startScrollTime(0),this.scrollTimeTo(i-o),this.endScrollTime(),this._onSimpleZoomIn.fire();else{try{this.beginUndoMacro("Zoom In")}catch(t){return}Q(n/5,function(t){s.startScaleTime(t),s.scaleTimeTo(0),s.endScaleTime()},function(){s.endUndoMacro(),s._onSimpleZoomIn.fire()})}},n.prototype.zoomOut=function(t,e){var i=this.m_model.timeScale().width(),o=this;if(e=e||1,this.canZoomOut())if(t)this.startScaleTime(0),this.scaleTimeTo(e*i/10),this.endScaleTime(),this.startScrollTime(e*(i/20-i/20*t)),this.scrollTimeTo(0),this.endScrollTime(),this._onSimpleZoomOut.fire();else{try{this.beginUndoMacro("Zoom Out")}catch(t){return}Q(i/5,function(t){o.startScaleTime(0),o.scaleTimeTo(t),o.endScaleTime()},function(){o.endUndoMacro(),o._onSimpleZoomOut.fire()})}},n.prototype.resetScales=function(){var t,e;for(this.beginUndoMacro("Reset scales"),this.resetTimeScale(),t=0;t<this.panes().length;t++)e=this.panes()[t],this.resetPriceScale(e,e.leftPriceScale()),this.resetPriceScale(e,e.rightPriceScale());this.endUndoMacro(),this.m_model.recalculateAllPanes()},n.prototype.zoomToViewport=function(t,e,i,o,n){var s=new I(this.m_model,t,e,i,o,n),r=new E(s,this.m_zoomStack,!0);r.redo(),this.pushUndoCommand(r)},n.prototype.zoomFromViewport=function(){var t=new E(this.m_zoomStack.head(),this.m_zoomStack,!1);t.redo(),this.pushUndoCommand(t)},n.prototype.zoomStack=function(){return this.m_zoomStack},n.prototype.addPaneStretchFactorUndoCommand=function(t,e,i,o){var n=new A(this.m_model,t,e,i,o);this.pushUndoCommand(n)},n.prototype.restoreFactoryDefaults=function(t){var e=new V(this.m_model,t);e.redo(),this.pushUndoCommand(e)},n.prototype.chartLoadTheme=function(t,e){var i=new M(t,e);i.redo(),this.pushUndoCommand(i)},n.prototype.drawingLoadTemplate=function(t,e){var i=new D(t,e);i.redo(),this.pushUndoCommand(i)},n.prototype.studyLoadTemplate=function(t,e,i,o){var n=new O(t,e,i,o);n.redo(),this.pushUndoCommand(n)},n.prototype.onRearrangePanes=function(){return this._onRearrangePanes},n.prototype.onSimpleZoomIn=function(){return this._onSimpleZoomIn},n.prototype.onSimpleZoomOut=function(){return this._onSimpleZoomOut},n.prototype.loadRange=function(t){t.res!==this.m_model.mainSeries().properties().interval.value()?(this.m_model.mainSeries().setDefaultTimeframe(t.val),this.setProperty(this.m_model.mainSeries().properties().interval,t.res,"Change date range")):this.m_model.mainSeries().loadDataTo(t.val)},n.prototype.cloneLineTool=function(t,e){var i=new W(this.m_model,t,e);return i.redo(),this.pushUndoCommand(i),this.emitEvent("cloneLineTool"),i.clonedLineToolId()},n.prototype._preparePriceAxisProperties=function(t,e){var i=t.lockScale.value(),o=t.style.value()===nt.STYLE_PNF;(o||i)&&(e.log.setValue(!1),e.percentage.setValue(!1)),e.logDisabled.setValue(!(!o&&!i)),e.percentageDisabled.setValue(!(!o&&!i))},n.prototype.alertsList=function(){return this.m_model.alertsList()},n.prototype.alertsListChanged=function(){return this.m_model.alertsListChanged()},n.prototype.insertStudyStub=function(t){return this.m_model.insertStudyStub(t)},n.prototype.removeStudyStub=function(t){return this.m_model.removeStudyStub(t)},n.prototype.isJustClonedChart=function(){return this._chartWidget.isJustClonedChart()},n.prototype.copySourceToClip=function(t){if(t&&!t.properties().blockCopying){var e={};if(t instanceof K)e.type="drawing",e.geometry=t.geometry();else{if(!(t instanceof rt))return!1;e.type="study"}return e.source=t.state&&t.state(),(delete e.source.alertId,delete e.source.linkKey,e.source)?(e.title=t.title&&t.title(),e.modelId=this.m_model._id,ot.set(e),!0):!1}},n.prototype.cutSourceToClip=function(t){if(!this.copySourceToClip(t))return!1;this.removeSource(t)},n.prototype.pasteLineTool=function(t,e){var i=new U(this.m_model,e,t);this.pushUndoCommand(i),i.redo()},n.prototype.pasteStudy=function(t){var e=new j(this.m_model,t);this.pushUndoCommand(e),e.redo()},n.prototype.pasteSourceFromClip=function(t,e){var i=ot.get();if(!i)return!1;"drawing"===i.type&&this.pasteLineTool(t,i),"study"===i.type&&this.pasteStudy(i)},n.prototype.trackTime=function(){return this._chartWidget.trackTime()},s.prototype.text=function(){return this._text},s.prototype.undo=function(){throw Error("pure virtual call ;)")},s.prototype.redo=function(){throw Error("pure virtual call ;)")},r.prototype.onChange=function(){return this._onChange},r.prototype.isEmpty=function(){return 0===this.m_commands.length},r.prototype.clear=function(){this.m_commands.length=0,this._onChange.fire()},r.prototype.push=function(t){if(!(t instanceof s))throw new TypeError("argument must be an instance of UndoCommand");this.m_commands.push(t),this._onChange.fire()},r.prototype.pop=function(){if(this.isEmpty())return void TradingView.logDebugChart("UndoStack.pop: undo stack is empty");var t=this.m_commands.pop();return this._onChange.fire(),t},r.prototype.head=function(){return this.isEmpty()?void TradingView.logDebugChart("UndoStack.head: undo stack is empty"):this.m_commands[this.m_commands.length-1]},inherit(a,s),a.prototype.addCommand=function(t){this._subcommands.push(t)},a.prototype.isEmpty=function(){return 0===this._subcommands.length},a.prototype.redo=function(){for(var t=0;t<this._subcommands.length;t++)this._subcommands[t].redo()},a.prototype.undo=function(){for(var t=this._subcommands.length-1;t>=0;t--)this._subcommands[t].undo()},inherit(l,s),l.prototype.redo=function(){this._oldValue=this._targetObj.value(),it(!0),this._targetObj.setValue(this._newValue),it(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},l.prototype.undo=function(){it(!0),this._targetObj.setValue(this._oldValue),it(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},inherit(h,s),h.prototype.redo=function(){this._oldValue=this._property.value(),this._oldLockScaleValue=this._priceScale.mainSource()instanceof nt?this._priceScale.mainSource().properties().lockScale.value():void 0,it(!0),this._property.setValue(this._newValue),this._oldLockScaleValue&&this._newValue&&this._priceScale.mainSource().properties().lockScale.setValue(!1),it(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},h.prototype.undo=function(){it(!0),this._property.setValue(this._oldValue),this._oldLockScaleValue&&this._newValue&&this._priceScale.mainSource().properties().lockScale.setValue(this._oldLockScaleValue),it(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},inherit(c,s),c.prototype.redo=function(){this._oldValue=this._percentage.value(),this._oldAutoScaleValue=this._priceScale.properties().autoScale.value(),this._oldLogValue=this._priceScale.properties().log.value(),this._oldLogDisabled=this._priceScale.properties().logDisabled.value(),it(!0),this._percentage.setValue(this._newValue),this._priceScale.properties().autoScaleDisabled.setValue(this._newValue),this._priceScale.properties().log.setValue(!1),it(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},c.prototype.undo=function(){if(it(!0),this._percentage.setValue(this._oldValue),this._priceScale.properties().autoScale.setValue(this._oldAutoScaleValue),this._priceScale.properties().autoScaleDisabled.setValue(this._oldValue),this._priceScale.properties().log.setValue(this._oldLogValue),!(this._oldAutoScaleValue||this._priceScale.mainSource()instanceof nt&&this._priceScale.mainSource().isLockScale())){var t=this._model.timeScale().visibleBars();this._priceScale.setPriceRange(this._priceScale.priceRange().convertFromPercents(this._priceScale.mainSource().close(t.firstBar())))}it(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},inherit(d,s),d.prototype.redo=function(){this._oldValue=this._log.value(),this._oldPercValue=this._priceScale.properties().percentage.value(),this._oldPercDisabled=this._priceScale.properties().percentageDisabled.value(),it(!0),this._log.setValue(this._newValue),this._priceScale.properties().percentage.setValue(!1),this._priceScale.properties().autoScaleDisabled.setValue(this._priceScale.properties().percentage.value()),it(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},d.prototype.undo=function(){it(!0),this._log.setValue(this._oldValue),this._priceScale.properties().percentage.setValue(this._oldPercValue),it(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},inherit(p,s),p.prototype.redo=function(){var t=$.Deferred().resolve();this._mainSeries._properties.style===this._style&&this._model.mainSeries().isNeedRestart(this._newValue)&&(t=this._chartWidget.screen.show()),t.done(function(){this._oldValue=this._style.value(),this._oldAutoScale=this._priceAxisProperties.autoScale.value(),this._oldLogValue=this._priceAxisProperties.log.value(),this._oldLogDisabled=this._priceAxisProperties.logDisabled.value(),this._oldPercentageValue=this._priceAxisProperties.percentage.value(),this._oldPercentageDisabled=this._priceAxisProperties.percentageDisabled.value(),it(!0),this._style.setValue(this._newValue),this._chartWidget.model()._preparePriceAxisProperties(this._mainSeries.properties(),this._priceAxisProperties),it(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))}.bind(this))},p.prototype.undo=function(){var t=$.Deferred().resolve();this._mainSeries._properties.style===this._style&&this._model.mainSeries().isNeedRestart(this._newValue)&&(t=this._chartWidget.screen.show()),t.done(function(){it(!0),this._style.setValue(this._oldValue),this._priceAxisProperties.log.setValue(this._oldLogValue),this._priceAxisProperties.logDisabled.setValue(this._oldLogDisabled),this._priceAxisProperties.percentage.setValue(this._oldPercentageValue),this._priceAxisProperties.percentageDisabled.setValue(this._oldPercentageDisabled),this._priceAxisProperties.autoScale.setValue(this._oldAutoScale),it(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))}.bind(this))},inherit(u,s),u.prototype.redo=function(){this._oldValue=this._property.value(),this._oldAutoScale=this._priceAxisProperties.autoScale.value(),this._oldPercentage=this._priceAxisProperties.percentage.value(),this._oldLog=this._priceAxisProperties.log.value(),it(!0),this._newValue&&(this._priceAxisProperties.percentage.setValue(!1),this._priceAxisProperties.log.setValue(!1),this._priceAxisProperties.autoScale.setValue(!1));var t=this._mainSeries.properties().style.value();t!==nt.STYLE_RENKO&&t!==nt.STYLE_KAGI&&t!==nt.STYLE_PNF&&t!==nt.STYLE_PB&&this._mainSeries.fixBoxSize(),this._property.setValue(this._newValue),it(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},u.prototype.undo=function(){it(!0),this._priceAxisProperties.percentage.setValue(this._oldPercentage),this._priceAxisProperties.log.setValue(this._oldLog),this._priceAxisProperties.autoScale.setValue(this._oldAutoScale),this._property.setValue(this._oldValue),it(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE)))},inherit(_,s),_.prototype.undo=function(){if(null!==this.m_newPriceScaleState)return void TradingView.logDebugChart("PriceScaleChangeUndoCommand.undo: Command is already undone");this.m_newPriceScaleState=this.m_priceScale.state(),this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_state),this.m_priceScale.recalcLockedScale(null)},_.prototype.redo=function(){if(null===this.m_newPriceScaleState)return void TradingView.logDebugChart("PriceScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_newPriceScaleState),this.m_newPriceScaleState=null},inherit(f,s),f.prototype.undo=function(){if(null!==this.m_newTimeScaleState)return void TradingView.logDebugChart("TimeScaleChangeUndoCommand.undo: Command is already undone");this.m_newTimeScaleState=this.m_model.timeScale().state(),this.m_model.restoreTimeScaleState(this.m_state),this.m_model.timeScale().recalcLockedScale()},f.prototype.redo=function(){if(null===this.m_newTimeScaleState)return void TradingView.logDebugChart("TimeScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restoreTimeScaleState(this.m_newTimeScaleState),this.m_newTimeScaleState=null},inherit(m,s),m.prototype.redo=function(){this._model.modifySeries(this._series,this._symbol,this._interval)},m.prototype.undo=function(){this._model.modifySeries(this._series,this._oldSymbol,this._oldInterval)},inherit(g,s),g.prototype.redo=function(){var t=null;return this._studyState?(t=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._studyState,this._priceScaleName),this._studyId!==t.id()&&TradingView.logError("Study was restored improperly - study ids does not match"),delete this._studyState):(t=this._model.insertStudy(this._studyMetaInfo,this._props,this._isOverlay,this._parentSource),this._studyId=t.id()),t},g.prototype.undo=function(){var t,e=this._model.dataSourceForId(this._studyId);this._studyState=e.state(),t=this._model.paneForSource(e),this._paneIndex=this._model.panes().indexOf(t),this._priceScaleName=t.priceScaleName(e.priceScale()),this._paneState=t.state(),this._restorePane=this._model.removeSource(e)},inherit(v,s),v.prototype.redo=function(){var t,e=this._model.dataSourceForId(this._sourceId);this._sourceState=e.state(),t=this._model.paneForSource(e),this._paneIndex=this._model.panes().indexOf(t),this._priceScaleName=t.priceScaleName(e.priceScale()),this._paneState=t.state(),this._restorePane=this._model.removeSource(e)},v.prototype.undo=function(){var t=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._sourceState,this._priceScaleName);this._sourceId!==t.id()&&TradingView.logError("Source was restored improperly - source ids does not match")},inherit(y,s),y.prototype.redo=function(){var t,e,i;for(t=0;t<this._linetools.length;t++)e=this._model.paneForSource(this._linetools[t]),i=this._model.panes().indexOf(e),this._statesByPaneIndexes[i]=this._statesByPaneIndexes[i]||[],this._statesByPaneIndexes[i].push({state:this._linetools[t].state(),owner:this._linetools[t].ownerSource().id()}),e.removeDataSource(this._linetools[t]);delete this._linetools},y.prototype.undo=function(){var t,e,i,o,n,s,r;this._linetools=[];for(t in this._statesByPaneIndexes)for(e=this._model.panes()[t],i=this._statesByPaneIndexes[t],o=0;o<i.length;o++)n=i[o],s=this._model.dataSourceForId(n.owner),r=e._restoreLineTool(n.state),r.setOwnerSource(s),r.updateAllViews(),this._linetools.push(r);this._model.invalidate(new J(J.LIGHT_UPDATE))},inherit(b,s),b.prototype.redo=function(){this._model.panes().indexOf(this._pane)===-1&&(this._pane=this._model.createPane(this._paneIndex)),this._model.move(this._model.dataSourceForId(this._sourceId),this._pane,this._pane.priceScaleByName(this._scaleName))},b.prototype.undo=function(){this._model.panes().indexOf(this._oldPane)===-1&&(this._oldPane=this._model.createPane(this._oldPaneIndex)),this._model.move(this._model.dataSourceForId(this._sourceId),this._oldPane,this._oldPane.priceScaleByName(this._oldScaleName))},inherit(w,s),w.prototype.startCreatingLine=function(t,e,i){var o,n;return this._points=[{point:t}],o=this._model.panes()[this._paneIndex],n=this._model.createLineTool(o,t,this._lineTool,e,i),this._lineId=n.id(),!this._model.lineBeingCreated()},w.prototype.continueCreatingLine=function(t,e,i){return this._points||TradingView.logError("continueCreatingLine is called before startCreatingLine"),this._points.push({point:t,envState:e}),this._model.coninueCreatingLine(t,e,i)},w.prototype.line=function(){return this._lineId?this._model.dataSourceForId(this._lineId):null},w.prototype.undo=function(){var t=this.line();t&&(this._lineState=t.state(),this._model.removeSource(t),delete this._lineId)},w.prototype.redo=function(){this._lineState||TradingView.logError("This command was never undone - nothing to redo");var t=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);this._lineId=t.id(),delete this._lineState};inherit(S,s),S.prototype.setPoint=function(t){var e=this._model.dataSourceForId(this._nextState.id);this._nextState=e.state(!0)},S.prototype.endChanging=function(){var t=this._model.dataSourceForId(this._nextState.id);this._nextState=t.state(!0)},S.prototype.undo=function(){var t=this._model.dataSourceForId(this._prevState.id),e=this._prevState;this._model.restoreLineToolState(t,e)},S.prototype.redo=function(){var t=this._model.dataSourceForId(this._nextState.id),e=this._nextState;this._model.restoreLineToolState(t,e)},inherit(T,s),T.prototype.setPoint=function(t){t instanceof q.Point?this._point=t.clone():this._point=TradingView.clone(t)},T.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(t,this._point,this._pointIndex),this._model.moveSource(this._origPoint),this._model.endMovingSource()},T.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(t,this._origPoint,this._pointIndex),this._model.moveSource(this._point),this._model.endMovingSource()},inherit(C,s),C.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(t,-this._shift)},C.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(t,this._shift)},inherit(x,s),x.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(t)},x.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(t)},inherit(P,s),P.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(t)},P.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(t)},n.prototype.removePane=function(t,e){var i=new L(this,e,t);this.pushUndoCommand(i),i.redo()},inherit(L,s),L.prototype.redo=function(){this._model.panes().splice(this._index,1),this._chart._updateGui()},L.prototype.undo=function(){this._model.panes().splice(this._index,0,this._pane),this._chart._updateGui()},n.prototype.rearrangePanes=function(t,e,i){var o=new k(this,e,i,t);this.pushUndoCommand(o),o.redo(),this._onRearrangePanes.fire()},inherit(k,s),k.prototype.redo=function(){var t=this._model.panes()[this._index];"up"===this._direction&&this._index>0&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index-1,0,t)),"down"===this._direction&&this._index<this._model.panes().length-1&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index+1,0,t)),this._model.invalidate(new J(J.FULL_UPDATE))},k.prototype.undo=function(){var t;"up"===this._direction&&(t=this._model.panes()[this._index-1],this._model.panes().splice(this._index-1,1),this._model.panes().splice(this._index,0,t)),"down"===this._direction&&(t=this._model.panes()[this._index+1],this._model.panes().splice(this._index+1,1),this._model.panes().splice(this._index,0,t)),this._model.invalidate(new J(J.FULL_UPDATE))},inherit(I,s),I.prototype.redo=function(){this._timeScaleState=this._model.timeScale().state(),this._priceScaleState=this._pane.defaultPriceScale().state(),this._model.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)},I.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.invalidate(new J(J.LIGHT_UPDATE))},inherit(E,s),E.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void TradingView.logDebugChart("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},E.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void TradingView.logDebugChart("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(A,s),A.prototype.redo=function(){var t=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA,this._paneB._stretchFactor=t-this._currStretchA,this._model.invalidate(new J(J.FULL_UPDATE))},A.prototype.undo=function(){var t=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA,this._paneB._stretchFactor=t-this._prevStretchA,this._model.invalidate(new J(J.FULL_UPDATE))},inherit(V,s),V.prototype.redo=function(){this._model.restoreFactoryDefaults(this._defaultProperty),this._chartWidget.adaptOnChartLogo()},V.prototype.undo=function(){this._defaultProperty.merge(this._state),this._defaultProperty.listeners().fire(this._defaultProperty),this._model.mainSeries().onChartStyleChanged(),this._chartWidget.adaptOnChartLogo()},inherit(M,s),M.prototype._merge=function(t,e){var i=this._model;it(!0),t&&(i.properties().paneProperties.merge(t.paneProperties),i.properties().scalesProperties.merge(t.scalesProperties),i.properties().symbolWatermarkProperties.merge(t.symbolWatermarkProperties)),i.mainSeries().properties().merge(e),i.mainSeries().properties().saveDefaults(),i.mainSeries().createPaneView(),i.mainSeries().invalidateBarStylesCache(),i._version=e.version,i.recalculateAllPanes(),i.invalidate(new J(J.FULL_UPDATE)),i.properties().saveDefaults(),i.properties().listeners().fire(this._properties),i.properties().scalesProperties.textColor.listeners().fire(i.properties().scalesProperties.textColor),it(!1)},M.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales()},M.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales()},inherit(D,s),D.prototype._merge=function(t){var e=this._source;e.properties().merge(t),e.properties().saveDefaults(),e.propertiesChanged(),e.calcIsActualSymbol(),e.updateAllViews(),e._model.invalidate(new J(J.LIGHT_UPDATE))},D.prototype.undo=function(){this._merge(this._oldProps)},D.prototype.redo=function(){this._merge(this._newProps)},inherit(O,s),O.prototype._merge=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,u=this._model.model(),_=u.mainSeries();for(_.properties().lockScale.setValue(!1),t.interval&&_.properties().interval.setValue(t.interval),e=[],i=u.panes(),o=i.length;o--;)for(n=i[o],s=n.containsMainSeries(),r=n.dataSources(),a=r.length;a--;)l=r[a],(!s||l instanceof rt)&&(l.isRemovedByStudyTemplates()||e.push(l),u.removeSource(l));for(h=t.panes,function(t,e){return t.dataSources().some(function(t){return t.alert&&t.alert().id===e.alert.id})},o=0;o<h.length;o++){for(c=!1,d=h[o],a=0;a<d.sources.length;a++)l=d.sources[a],"MainSeries"===l.type&&(delete l.state,c=!0);if(n=null,n=c?i[o]:u.createPane(o),n.restoreState(h[o],!1,t.version),c)for(p=0;p<e.length;p++)e[p].restore&&e[p].restore()}_.priceScale().setAutoScale(!0),u._version=t.version,u.startNotStartedStudies(),u.recalculateAllPanes(),u.invalidate(new J(J.FULL_UPDATE))},O.prototype.undo=function(){this._merge(this._oldProps),this._model.model().mainSeries().onChartStyleChanged()},O.prototype.redo=function(){var t,e,i;this._merge(this._newProps),t=this._model.model(),t.mainSeries().onChartStyleChanged(),e=this._model.model().mainSeries().properties(),i=this._model.model().mainSeries().properties().priceAxisProperties,this._model._preparePriceAxisProperties(e,i),t._recalcVisibleRangeStudy(t.dataSources(),!0)},inherit(B,s),B.prototype.redo=function(){this._priceScale.setTopMargin(this._topMargin),this._priceScale.setBottomMargin(this._bottomMargin),this._model.recalculatePane(this._pane,!1)},B.prototype.undo=function(){this._priceScale.setTopMargin(this._oldTopMargin),this._priceScale.setBottomMargin(this._oldBottomMargin),this._model.recalculatePane(this._pane,!1)},inherit(R,s),R.prototype.redo=function(){this._model.mainSeries().loadDataTo(this._range)},inherit(N,s),N.prototype.redo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._value,this._forceSetProperty)}.bind(this))},N.prototype.undo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._prevValue,this._forceSetProperty)}.bind(this))},inherit(W,s),W.prototype.redo=function(){var t,e,i,o,n,s,r,a,l,h,c;if(this._lineState)s=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);else{for(t=this._originalSource,e=t.priceScale(),i=this._model.paneForSource(t),o=TradingView.className(t.constructor),n=t.properties().clone(),s=G.create(o,this._model,n,null,t.ownerSource()),s.setOwnerSource(t.ownerSource()),s.properties().visible._value=!0,s._fixedPoints=s._fixedPoints.concat(t._fixedPoints),r=0;r<s._fixedPoints.length;r++)s._fixedPoints[r]=s._fixedPoints[r].add(new q.Point(20,20));a=t._timePoint,l=this._withoutShift?TradingView.clone(a):F(a,t.ownerSource()),h=t._points,c=h,s.restorePoints(l,c),s.cloneData&&s.cloneData(t),i.addDataSource(s,e),this._model.updateSource(s),s.checkAlert&&s.checkAlert(),this._paneIndex=this._model.panes().indexOf(i),Z.drawOnAllCharts().value()&&this._model.copyToOtherCharts(s),this._lineState=s.state()}},W.prototype.undo=function(){this._lineState||TradingView.logError("This command was never executed - nothing to undo");var t=this._model.dataSourceForId(this._lineState.id);this._model.removeSource(t)},W.prototype.clonedLineToolId=function(){return this._lineState.id},ht.setWatchedValue=function(t,e,i){if(t.value()!==e){var o=new z(t,e,i);this.pushUndoCommand(o),o.redo()}},inherit(z,s),z.prototype.redo=function(){this._wv.setValue(this._newValue)},z.prototype.undo=function(){this._wv.setValue(this._oldValue)},inherit(H,s),H.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},H.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},inherit(U,s),U.prototype.redo=function(){var t,e,i,o,n,s,r,a,l,h=this._model.panes()[this._paneIndex],c=h.dataSourceForId(this._clipboardData.source.ownerSource)||h.mainDataSource();this._sourceState||(t=!0,e=this._clipboardData.source.state.symbol,i=h.mainDataSource(),o=i.symbol?i.symbol():"",n=e===o,n&&(c instanceof nt&&(t=!1),c instanceof rt&&(t=!c.metaInfo().is_price_study)),s=TradingView.clone(this._clipboardData.source),delete s.state.symbol,t?(r=this._model,a=function(t){var e=t.x*r.timeScale().width(),i=t.y*c.priceScale().height();return new q.Point(e,i)},s.points=this._clipboardData.geometry.map(function(t){var e,i=a(t),o=r.timeScale().coordinateToIndex(i.x),n=r.timeScale().normalizeBarIndex(o);return n.price=c.priceScale().coordinateToPrice(i.y),c.priceScale().isPercent()&&(e=c.firstValue(),n.price=c.priceScale().priceRange().convertFromPercent(n.price,e)),n})):this._model._id===this._clipboardData.modelId&&c.id()===this._clipboardData.source.ownerSource&&(s.points=F(this._clipboardData.source.points,c)),s.id=TradingView.guid(),this._sourceState=s),l=h._restoreLineTool(this._sourceState,null,!1),l.calcIsActualSymbol(),l.setOwnerSource(c),l.setPriceScale(c.priceScale()),c.priceScale().addDataSource(l),l.createServerPoints(),this._model.invalidate(new J(J.LIGHT_UPDATE,!0))},U.prototype.undo=function(){var t,e;this._sourceState||TradingView.logError("This command was never executed - nothing to undo"),t=this._model.panes()[this._paneIndex],e=t.dataSourceForId(this._sourceState.id),this._model.removeSource(e)},inherit(j,s),j.prototype.redo=function(){var t,e,i,o;this._sourceState||(t=TradingView.clone(this._clipboardData.source),t.id=TradingView.guid(),this._sourceState=t),e=null,i=null,this._sourceState.metaInfo.is_price_study?(e=this._model.paneForSource(this._model.mainSeries()),i=this._model.mainSeries().priceScale()):(e=this._model.createPane(),i=e.defaultPriceScale()),o=e._restoreStudy(this._sourceState),o.start(),o.setPriceScale(i),e.move(o,i)},j.prototype.undo=function(){this._sourceState||TradingView.logError("This command was never executed - nothing to undo");var t=this._model.dataSourceForId(this._sourceState.id);this._model.removeSource(t)},e.UndoHistory=ht,e.ChartUndoModel=n,e.UndoMacroCommand=a}).call(e,i(34))},function(t,e,i){var o;(function(){"use strict";function e(){}function n(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function s(t){return function(){return this[t].apply(this,arguments)}}var r=e.prototype,a=this,l=a.EventEmitter;r.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},r.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},r.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},r.addListener=function(t,e){var i,o=this.getListenersAsObject(t),s="object"==typeof e;for(i in o)o.hasOwnProperty(i)&&n(o[i],e)===-1&&o[i].push(s?e:{listener:e,once:!1});return this},r.on=s("addListener"),r.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},r.once=s("addOnceListener"),r.defineEvent=function(t){return this.getListeners(t),this},r.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},r.removeListener=function(t,e){var i,o,s=this.getListenersAsObject(t);for(o in s)s.hasOwnProperty(o)&&(i=n(s[o],e))!==-1&&s[o].splice(i,1);return this},r.off=s("removeListener"),r.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},r.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},r.manipulateListeners=function(t,e,i){var o,n,s=t?this.removeListener:this.addListener,r=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)s.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?s.call(this,o,n):r.call(this,o,n));return this},r.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},r.removeAllListeners=s("removeEvent"),r.emitEvent=function(t,e){var i,o,n,s,r=this.getListenersAsObject(t);for(s in r)if(r.hasOwnProperty(s))for(i=r[s].slice(0),n=i.length;n--;)o=i[n],o.once===!0&&this.removeListener(t,o.listener),o.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,o.listener);return this},r.trigger=s("emitEvent"),r.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},r.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},r._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},r._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return a.EventEmitter=l,e},void 0!==(o=function(){return e}.call(a,i,a,t))&&(t.exports=o)}).call(this)},function(t,e){"use strict";var i=function(){function t(t){switch(t){case"c67":case"m67":case"c45":return"copy";case"c86":case"m86":case"s45":return"paste";case"c88":case"m88":case"s46":return"cut"}}function e(t){var e=[];return t.shiftKey&&e.push("s"),t.ctrlKey&&e.push("c"),t.metaKey&&e.push("m"),t.altKey&&e.push("a"),e.push(t.keyCode),e.join("")}function i(t){var e=$.Event(d+":"+t);return $(window).trigger(e,{AppClipboard:_}),e}function o(o){var n,s,r;if((document.activeElement===document.body||document.activeElement===document.documentElement)&&(n=e(o),s=t(n))){if("keydown"===o.type)p[n]=!0;else if(p[n])return;if(document.getSelection){if(!document.getSelection().isCollapsed)return}else if(document.selection&&"None"!==document.selection.type)return;o.isDefaultPrevented()||(r=i(s),r.isDefaultPrevented()&&o.preventDefault())}}function n(t){t=t.originalEvent||t,t.key===c&&i("change")}function s(){u||($(document).on("keypress keydown",o),$(window).on("storage",n),u=!0)}function r(){$(document).off("keypress keydown",o),$(window).off("storage",n),$(window).off(d+":copy"),$(window).off(d+":paste"),$(window).off(d+":cut"),$(window).off(d+":change"),u=!1}function a(){try{return JSON.parse(TVLocalStorage.getItem(c))}catch(t){return null}}function l(t){if(null==t)return h();var e=JSON.stringify(t);e!==TVLocalStorage.getItem(c)&&(TVLocalStorage.setItem(c,e),i("change"))}function h(){TVLocalStorage.getItem(c)&&(TVLocalStorage.removeItem(c),i("change"))}var c="application-clipboard",d="appclip",p={},u=!1,_={init:s,set:l,get:a,clear:h,destroy:r};return _}();t.exports=i},function(t,e,i){"use strict";function o(t){return"number"!=typeof t&&(t=TradingView.STUDY_COUNT_LIMIT),(0,n.createNoticeDialog)({title:$.t("Warning"),content:$.t("Studies limit exceeded: {0} studies per layout.<br>\nPlease, remove some studies.").format(t)})}Object.defineProperty(e,"__esModule",{value:!0}),e.createTooManyStudiesNotice=o;var n=i(66)},function(t,e,i){(function(e){"use strict";function o(t,e,i){this._model=e,this._paneWidget=t,this._chart=t._chart,this._mainDiv=i,this.$el=$(document.createElement("div")).addClass("pane-legend"),this._itemsBinding=[],this._chart.properties().paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesTitle.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showStudyValues.listeners().subscribe(this,this.updateLayout);var o=this._chart.properties().scalesProperties.textColor;o.listeners().subscribe(this,function(t){this.$el.css("color",t)}),this.$el.css("color",o.value()),this.updateLayout()}var n=i(171).Study,s=i(35).trackEvent,r=i(183).setMouseEventHandler;o.prototype.contextMenuEvent=function(t,i){if(!this._model.chartModel().readOnly()&&e.enabled("legend_context_menu")){var o=i.source;this._paneWidget.showContextMenuForSource(o,t)}},o.prototype.updateLayout=function(){var t,o,n,s,a,l,h,c,d,p,u;if(this._itemsBinding.length=0,this.$el.find(".apply-common-tooltip").trigger("mouseleave"),this.$el.empty(),(t=this._paneWidget.state())&&this._model){for(o={showStudyTitles:this._model.model().properties().paneProperties.legendProperties.showStudyTitles.value(),showSeriesTitle:this._chart.properties().paneProperties.legendProperties.showSeriesTitle.value(),showSeriesOHLC:this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.value(),showStudyValues:this._chart.properties().paneProperties.legendProperties.showStudyValues.value(),showLegend:this._model.model().properties().paneProperties.legendProperties.showLegend.value()},n=this._model.mainSeries(),s=t.orderedSources().slice(),a=s.indexOf(n),a>-1&&(s.splice(a,1),s.push(n)),l=s.length-1;l>=0;l--)h=s[l],(c=h.statusView())&&(!(d=h===n)||o.showSeriesTitle||o.showSeriesOHLC||o.showStudyTitles||o.showStudyValues)&&(d&&e.enabled("fundamental_widget")||(o.showLegend||!d?(d||o.showStudyTitles||o.showStudyValues)&&o.showLegend&&(p=$("<div>").addClass("pane-legend-line pane-legend-wrap").appendTo(this.$el),p.source=h,d?(u=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Hide")+'"></a>').append($(i(297)).attr({class:"expand"})),p.addClass("main").append(u.on("click touchend",this.toggleTitles.bind(this)))):p.addClass("study"),h.properties().visible.value()||p.addClass("disabled"),this._generateItemsForRow(p,c,o),r(p,this,!0)):this.$el.find(".expand-line").length||(p=$("<div>").addClass("pane-legend-line pane-legend-wrap main expand-line").appendTo(this.$el),u=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Show")+'"></a>').append($(i(296)).attr({class:"expand closed"})),p.append(u.on("click touchend",this.toggleTitles.bind(this))),p.source=h,o={showStudyTitles:!1,showSeriesTitle:!1,showSeriesOHLC:o.showSeriesOHLC,showStudyValues:!1},this._generateItemsForRow(p,c,o),r(p,this,!0),this.update())));this.update()}},o.prototype._generateItemsForRow=function(t,o,s){var r,a,l,h,c,d,p,u,_,f,m,g,v,y,b=t.source,w=this,S=b===this._model.mainSeries();if((S&&s.showSeriesTitle||!S&&s.showStudyTitles)&&(r=$("<span>"),r.addClass("pane-legend-line apply-overflow-tooltip"),e.enabled("legend_context_menu")&&!this._chart.readOnly()||r.addClass("no-context-menu"),S&&r.addClass("main"),b.properties().visible.value()||r.addClass("disabled"),r.css({"font-weight":o.bold()?"bold":"normal","font-size":o.size()}),r.click(function(e){w.contextMenuEvent(e,t)}),r.appendTo(t),this._itemsBinding.push({value:o,cell:r,source:t.source}),!this._chart.readOnly()&&b.userEditEnabled()&&e.enabled("edit_buttons_in_legend")&&(a=$('<span class="pane-legend-icon-container">').appendTo(t),e.enabled("show_hide_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip icon-hide" title="'+$.t("Show/Hide")+'">').append($(i(298)).attr({width:14,height:14})).appendTo(a).on("click touchend",this._generateItemsForRow._onShowhideClick.bind(this,b)),S&&!e.enabled("show_chart_property_page")||!e.enabled("format_button_in_legend")||$('<a class="pane-legend-icon apply-common-tooltip format" title="'+$.t("Format")+'">').append($(i(299)).attr({width:14,height:14})).appendTo(a).on("click touchend",this._generateItemsForRow._onFormatClick.bind(this,b)),b instanceof n&&!this._chart.onWidget()&&e.enabled("study_buttons_in_legend")&&(l=b.metaInfo(),TradingView.isExistent(l.pine)&&!TradingView.isMobileView&&(h=$('<a class="pane-legend-icon apply-common-tooltip source" title="'+$.t("Show Source Code")+'">').append($(i(300)).attr({width:14,height:14})).appendTo(a).on("click touchend",this._generateItemsForRow._onViewSorceClick.bind(this,b)),TradingView.ScriptEditorWidget&&(c=TradingView.ScriptEditorWidget.loadedScriptIdPart())&&l.scriptIdPart===c&&h.addClass("active"),ScriptLib.isAuthToGetPineSourceCode(l.scriptIdPart,l.pine.version).done(function(t){t||h.addClass("js-hidden")}).fail(function(t){TradingView.logError("Failed isAuthToGetPineSourceCode, reason: "+t)}))),!S&&e.enabled("delete_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip delete" title="'+$.t("Delete")+'">').append($(i(301)).attr({width:14,height:14})).appendTo(a).on("click touchend",this._generateItemsForRow._onDeleteClick.bind(this,b)))),d=b.dataWindowView(),d=b.dataWindowView(),this.isDataWindowValuesVisible(d)&&(S&&s.showSeriesOHLC||!S&&s.showStudyValues)){for(p=[],u=[],_=$('<div class="pane-legend-item-value-container">'),e.enabled("legend_context_menu")||_.addClass("no-context-menu"),f=0;f<d.items().length;f++)m=$("<span class='pane-legend-item-value-wrap'>").appendTo(_),g=S?$("<span class='pane-legend-item-value-title pane-legend-line'>").appendTo(m):null,v=$("<span class='pane-legend-item-value pane-legend-line'>").appendTo(m),S&&v.addClass("main"),b.properties().visible.value()||(v.addClass("disabled"),g&&g.addClass("disabled")),p.push(v),g&&u.push(g);y=$("<span class='pane-legend-item-additional pane-legend-line'>").appendTo(_.appendTo(t)),this._itemsBinding.push({value:d,cell:p,titleCells:u.length?u:null,source:b,additional:y})}},o.prototype.isDataWindowValuesVisible=function(t){return this._chart.onWidget()?!!t&&!this._chart.isSmall():!!t},o.prototype._generateItemsForRow._onShowhideClick=function(t){this._model.setProperty(t.properties().visible,!t.properties().visible.value(),"Show/Hide "+t.title())},o.prototype._generateItemsForRow._onFormatClick=function(t,e){t.userEditEnabled()&&(TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Style")),this._chart.showEditObjectDialog(t,this._model))},o.prototype._generateItemsForRow._onDeleteClick=function(t){t.isUserDeletable()&&(t.hasChildren()?showDeleteStudyTreeConfirm(this._model.removeSource.bind(this._model,t)).open():this._model.removeSource(t))},o.prototype._generateItemsForRow._onAddChildSourceClick=function(t){var e,i,o=this._chart.showIndicators(t);o&&(e=function(){s("SOS","Apply SOS","Apply by Plus SOS")},i=this._model.model().studyInserted(),i.subscribe(this,e),o.visibilityChanged.subscribe(this,function(t){t||i.unsubscribe(this,e)},!0))},o.prototype._generateItemsForRow._onViewSorceClick=function(t){var e=t.metaInfo();this._getPineSourceCode(e).done(function(t){TradingView.ScriptEditorWidget&&TradingView.ScriptEditorWidget.open(t)})},o.prototype._getPineSourceCode=function(t){return $.Deferred()},o.prototype.setItemEnabled=function(t,e){var i=!t.hasClass("disabled"),o=t.closest(".pane-legend-wrap");e&&!i?(t.removeClass("disabled"),o.removeClass("disabled")):!e&&i&&(t.addClass("disabled"),o.addClass("disabled"))},o.prototype.valueChanged=function(t,e,i){return t[e]!==i&&(t[e]=i,!0)},o.prototype.firstTitle=function(){return this.$el.find(".pane-legend-line.pane-legend-wrap:first-child")},o.prototype.updateTitle=function(){var t,i,o,n,s,r,a,l;for(o=this._itemsBinding.length;o--;)i=this._itemsBinding[o],Array.isArray(i.cell)||(i.last||(i.last={}),n=i.last,s=i.source,t=s.properties().visible.value(),this.valueChanged(n,"sourceVisible",t)&&this.setItemEnabled(i.cell,t),r=i.value.color(),a=s!==this._model.mainSeries()&&s===this._model.selectedSource()?"bold":"normal",l=i.value.text(),e.enabled("fundamental_widget")&&(l=this._model.mainSeries().symbolInfo().name+" "+l),(this.valueChanged(n,"color",r)||this.valueChanged(n,"fontWeight",a)||this.valueChanged(n,"text",l))&&i.cell.text(TradingView.clean(l,!0)).css({color:r,"border-color":r,"font-weight":a}));this._chart.resizeIndicator()},o.prototype.update=function(t){var e,i,o,n,s,r,a,l,h,c;for(this.updateTitle(),l=this._itemsBinding.length;l--;)if(n=this._itemsBinding[l],e=n.cell,i=n.titleCells,o=n.source.properties().visible.value(),Array.isArray(e)){for(n.last||(n.last={},n.last.dwView||(n.last.dwView={})),h=n.last,s=n.value.items(),c=this.valueChanged(h,"sourceVisible",o),r=0;r<e.length;r++)a=s[r],h[r]||(h[r]={}),c&&this.setItemEnabled(e[r],o),this.valueChanged(h[r],"text",a.text())&&(e[r][0].textContent=a.text()),a.color()&&this.valueChanged(h[r],"color",a.color())&&e[r].css("color",a.color()),i&&(this.valueChanged(h,"sourceVisible",o)&&this.setItemEnabled(i[r],o),this.valueChanged(h[r],"title",a.title())&&(i[r][0].textContent=a.title()));n.additional&&n.value.additional&&this.valueChanged(h,"additional",n.value.additional())&&n.additional.text(n.value.additional()||"")}this._chart.resizeIndicator()},o.prototype.dataSourceAtPoint=function(t,e){return null},o.prototype.renderTo=function(t,e,i){var o,n,s,r,a,l,h;for(t.save(),t.fillStyle=this._chart.properties().scalesProperties.textColor.value(),t.textBaseline="middle",o=0,n=0;n<this._itemsBinding.length;++n)s=this._itemsBinding[n],r=s.value,a=s.source===this._model.mainSeries(),l=a?12:8,h=a?25:17,Array.isArray(s.cell)||(t.font=r.size()+" Verdana, Arial",t.fillText(r.text(),e,i+o+l),o+=h);t.restore()},o.prototype.toggleTitles=function(t){this._model.model().properties().paneProperties.legendProperties.showLegend.setValue(!this._chart.properties().paneProperties.legendProperties.showLegend.value());for(var e=this._chart._paneWidgets.length-1;e>=0;e--)this._chart._paneWidgets[e].legendWidget.updateLayout()},t.exports=o}).call(e,i(1))},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M1 0v1h11V0H1zm11 1v11h1V1h-1zm0 11H1v1h11v-1zM1 12V1H0v11h1zM6 2v4H2v1h4v4h1V7h4V6H7V2H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M1 0v1h11V0H1zm11 1v11h1V1h-1zm0 11H1v1h11v-1zM1 12V1H0v11h1zm1-6v1h9V6H2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 2.69c3.018 0 5.172 3.232 5.172 4.31 0 1.077-2.154 4.31-5.172 4.31S1.828 8.08 1.828 7c0-1.077 2.154-4.31 5.172-4.31zm0 1.508C5.49 4.198 4.198 5.49 4.198 7S5.49 9.802 7 9.802 9.802 8.51 9.802 7 8.51 4.198 7 4.198zm0 1.68c.646 0 1.12.476 1.12 1.122 0 .646-.473 1.12-1.12 1.12-.646 0-1.12-.473-1.12-1.12 0-.646.473-1.12 1.12-1.12z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 14 14" width="14" height="14" enable-background="new -2.4 120.9 600 600"><path d="M-2.4 120.9v14h14v-14zm6.086 1.803H5.52v1.332c.416.1.805.258 1.166.48l.944-.935 1.297 1.297-.943.943c.215.35.38.748.48 1.164H9.8v1.837H8.463c-.1.417-.257.806-.48 1.167l.935.944-1.296 1.298-.944-.943c-.35.215-.747.38-1.164.48v1.332H3.677v-1.33c-.415-.102-.804-.258-1.165-.482l-.943.936-1.298-1.296.94-.945c-.216-.35-.38-.748-.482-1.165H-.597v-1.835H.737c.1-.416.257-.805.48-1.166l-.935-.944 1.296-1.297.944.943c.35-.215.747-.38 1.164-.48zm.912 3.053c-1.188 0-2.143.963-2.143 2.143 0 1.187.963 2.143 2.143 2.143 1.18 0 2.14-.963 2.145-2.145 0-1.188-.966-2.144-2.145-2.144z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 14 14" width="14" height="14" enable-background="new -2.4 120.9 600 600"><path d="M-2.4 120.9v14h14v-14zm4.833 2.042h1.084v1.083H2.433c-.143 0-.18.027-.24.09-.063.062-.135.19-.187.365-.103.353-.114-.147-.114.17 0 .84.01 1.425-.157 2-.127.44-.4.836-.76 1.25.36.413.633.81.76 1.248.167.575.157 1.16.157 2.002 0 .317.01-.185.114.168.052.176.124.305.186.368s.098.09.24.09h1.085v1.082H2.433c-.398 0-.768-.166-1.01-.41-.244-.245-.372-.54-.456-.826-.167-.57-.16-.155-.16-.472 0-.84-.01-1.34-.113-1.7-.09-.31-.328-.612-.7-1.008h-.81v-1.084h.81c.372-.397.61-.7.7-1.01.104-.358.114-.857.114-1.698 0-.317-.008.1.16-.472.083-.286.21-.583.454-.828.242-.244.613-.408 1.01-.408zm3.25 0h1.084c.398 0 .768.164 1.01.408.244.245.374.542.458.828.168.57.157.155.157.472 0 .84.01 1.34.114 1.7.09.31.328.61.7 1.008h.81v1.084h-.81c-.372.397-.61.7-.7 1.01-.104.358-.114.857-.114 1.698 0 .317.01-.1-.157.472-.084.286-.214.58-.457.826-.243.244-.613.41-1.01.41H5.682v-1.083h1.084c.143 0 .18-.026.24-.09.063-.062.138-.19.19-.367.103-.353.11.15.11-.168 0-.84-.01-1.427.158-2.002.127-.44.4-.835.76-1.248-.36-.414-.633-.81-.76-1.25-.167-.575-.157-1.16-.157-2 0-.317-.008.183-.112-.17-.05-.176-.126-.303-.188-.366s-.098-.09-.24-.09H5.682v-1.082z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 14 14" width="14" height="14" enable-background="new -2.4 120.9 600 600"><path d="M-2.4 120.9v14h14v-14zm3.34 2.123l3.66 3.66 3.66-3.66 1.217 1.22-3.66 3.658 3.66 3.66-1.22 1.22-3.658-3.66-3.66 3.66-1.22-1.22 3.66-3.66-3.66-3.66z"/></svg>'},function(t,e,i){(function(e){"use strict";function o(t,e,i){this.pane=t,this._isLeft=o.isLeft(e),this._properties=t.chart().properties().scalesProperties,this._disableContextMenu=!!i,this.jqCell=$(document.createElement("td")),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("price-axis"),this.jqCell.width(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=f(this._dv,new m(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=f(this._dv,new m(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._textWidthCache=new s,this.restoreDefaultCursor(),this.update(),g(this.jqCell,this,!0),this.dialog=this.pane.chart().dialog,this.contextMenu=null,this.actions={},this._isVisible=!0,this.priceScale().onMarksChanged.subscribe(this,this.onMarksChanged)}var n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y;i(303),n=i(82).LineDataSource,s=i(127),r=i(100),a=r.Action,l=r.ActionSeparator,h=i(304),c=i(308),d=i(99),p=i(183),u=p.setCanvasSize,_=p.clearRect,f=p.addCanvasTo,m=p.Size,g=p.setMouseEventHandler,v=i(35).trackEvent,y=i(128).makeFont,o.prototype._BORDER_SIZE=1,o.prototype._OFFSET_SIZE=1,o.prototype._TICK_LENGTH=3,o.LHS=1,o.RHS=2,o.isLeft=function(t){return t===o.LHS||t!==o.RHS&&(TradingView.logDebugChart("PriceAxisWidget.isLeft: wrong side"),!1)},o.prototype.backgroundColor=function(){return this.pane.chart().properties().paneProperties.background.value()},o.prototype.lineColor=function(){return this._properties.lineColor.value()},o.prototype.textColor=function(){return this._properties.textColor.value()},o.prototype.fontSize=function(){return this._properties.fontSize.value()},o.prototype.baseFont=function(){return y(this.fontSize(),"Arial","")},o.prototype.rendererOptions=function(){var t,e,i;return this._rendererOptions||(this._rendererOptions={isLeft:this._isLeft,width:0,height:0,borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new s,_tickmarksCache:new c(11,"Arial","","#000"),color:""}),t=this._rendererOptions,e=!1,t.color!==this.textColor()&&(t.color=this.textColor(),e=!0),t.fontSize!==this.fontSize()&&(i=this.fontSize(),t.fontSize=i,t.font=this.baseFont(),t.paddingTop=Math.floor(i/4.5),t.paddingBottom=Math.ceil(i/4.5),t.paddingInner=Math.max(Math.ceil(i/3-t.tickLength/2),0),t.paddingOuter=Math.ceil(i/3),t.baselineOffset=Math.round(i/10),t.widthCache.reset(),e=!0),e&&t._tickmarksCache.reset(t.fontSize,"Arial","",t.color),this.size&&(t.width=this.size.w,t.height=this.size.h),this._rendererOptions},o.prototype.mouseDownEvent=function(t){var e,i;this.priceScale().isEmpty()||(e=this.pane.chart().model(),i=this.pane.state(),this._mousedown=!0,this.setCursor("ns-resize"),e.startScalePrice(i,this.priceScale(),t.localY))},o.prototype.pressedMouseMoveEvent=function(t){var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();e.scalePriceTo(i,o,t.localY)},o.prototype.mouseDownOutsideEvent=function(t){var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();this._mousedown&&(this._mousedown=!1,e.endScalePrice(i,o),this.restoreDefaultCursor())},o.prototype.mouseUpEvent=function(t){var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();this._mousedown=!1,e.endScalePrice(i,o),this.restoreDefaultCursor()},o.prototype._initActions=function(t){var e,n,s,r,l;this.pane.state()&&(e=i(309).ActionBinder,n=this,this.actions.reset=new a({text:$.t("Reset Scale")}),this.actions.reset.callbacks().subscribe(this,o.prototype.reset),s=function(t){this._undoModel.setLockScaleProperty(this._property,t.checked,n.priceScale().mainSource(),this._undoText)},delete this.actions.setLockScale,this.priceScale().mainSource()instanceof TradingView.Series&&(this.actions.setLockScale=new a({text:$.t("Lock Scale"),checkable:!0,checked:this.priceScale().mainSource().properties().lockScale.value()}),this._lockScaleBinding=new e(this.actions.setLockScale,this.priceScale().mainSource().properties().lockScale,this.pane.chart().model(),"Undo LockScale",s),this._lockScaleBinding.setValue(this.priceScale().mainSource().properties().lockScale.value())),r=function(){this._undoModel.setAutoScaleProperty(this._property,this.value(),n.priceScale(),this._undoText)},this.actions.setAutoScale=new a({text:$.t("Auto Scale"),checkable:!0,checked:!0}),this._autoScaleBinding=new e(this.actions.setAutoScale,this.priceScale().properties().autoScale,this.pane.chart().model(),"Undo AutoScale",r),this._autoScaleBinding.setValue(this._autoScaleBinding.property().value()),this.actions.setPercentage=new a({text:$.t("Percentage",{context:"scale_menu"}),checkable:!0,checked:!1}),l=function(){this._undoModel.setPercentProperty(this._property,this.value(),n.priceScale(),this._undoText)},this.actions.setPercentage.binding=new e(this.actions.setPercentage,this.priceScale().properties().percentage,this.pane.chart().model(),"Undo Percentage",l),this.actions.setLog=new a({text:$.t("Log Scale",{context:"scale_menu"}),checkable:!0,checked:!1}),this.actions.setLog.binding=new e(this.actions.setLog,this.priceScale().properties().log,this.pane.chart().model(),"Undo Log Scale"),this.actions.alignLabels=new a({text:$.t("Precise Labels",{context:"scale_menu"}),checkable:!0,checked:!1}),this.actions.alignLabels.binding=new e(this.actions.alignLabels,this.priceScale().properties().alignLabels,this.pane.chart().model(),"Precise Labels"),this._updateScalesActions())},o.prototype._updateScalesActions=function(){var t=this.priceScale(),e=t.mainSource()instanceof TradingView.Series,i=t.mainSource().properties();this.actions.setPercentage.setEnabled(!(t.isLog()||e&&i.lockScale.value()||e&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setLog.setEnabled(!(t.isPercent()||e&&i.lockScale.value()||e&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setAutoScale.setChecked(t._properties.autoScale.value()),this.actions.setAutoScale.setEnabled(!t.properties().autoScaleDisabled.value())},o.prototype.mouseClickEvent=function(t){},o.prototype.mouseDoubleClickEvent=function(t){this.reset(),v("GUI","Double click price scale")},o.prototype.contextMenuEvent=function(t,i){!this._disableContextMenu&&e.enabled("scales_context_menu")&&this._createContextMenu().show(t)},o.prototype._createContextMenu=function(){return h.createMenu(this.getContextMenuActions())},o.prototype.getContextMenuActions=function(){var t,i;return this._initActions(),t=this.pane.chart().actions(),i=[this.actions.reset,new l,t.showLeftAxis,t.showRightAxis,new l,this.actions.setAutoScale,t.scaleSeriesOnly,new l,this.actions.setPercentage,this.actions.setLog,new l,t.showSymbolLabelsAction,t.showSeriesLastValue,t.showStudyPlotNamesAction,t.showStudyLastValue],e.enabled("countdown")&&i.push(t.showCountdown),i.push(this.actions.alignLabels),!TradingView.onWidget()&&e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_scales")&&(i.push(new l),i.push(t.scalesProperties)),this.actions.setLockScale&&i.splice(6,0,this.actions.setLockScale),i},o.prototype.backLabels=function(t){var e,i,o,n,s,r=[],a=this.priceScale().orderedSources().slice(),l=this.pane,h=l.chart().model(),c=l.state(),d=[],p=h.sourceBeingMoved()||h.lineBeingEdited()||h.lineBeingCreated();if(p&&d.push(p),h.selectedSource()&&d.push(h.selectedSource()),h.hoveredSource()&&d.push(h.hoveredSource()),this.priceScale()===c.defaultPriceScale())for(e=this.pane.state().dataSources(),i=0;i<e.length;i++)c.isOverlay(e[i])&&a.push(e[i]);for(i=0;i<a.length;++i)if(o=a[i],(t||d.indexOf(o)===-1)&&(n=o.priceAxisViews(c,o.priceScale())))for(s=0;s<n.length;s++)r.push(n[s]);return r},o.prototype.optimalWidth=function(){var t,e,i,o,n,s,r;if(!this.isVisible())return 0;if(t=0,e=this.rendererOptions(),this.pane.state())for(i=this.ctx,o=this.priceScale().marks(),i.setFont(this.baseFont()),o.length>0&&(t=Math.max(e.widthCache.measureText(i,o[0].label),e.widthCache.measureText(i,o[o.length-1].label))),n=this.backLabels(!0),s=n.length;s--;)(r=e.widthCache.measureText(i,n[s].text()))>t&&(t=r);return Math.ceil(e.offsetSize+e.borderSize+e.tickLength+e.paddingInner+e.paddingOuter+t)},o.prototype.setSize=function(t){this.size&&this.size.equals(t)||(this.size=t,u(this.canvas,t),u(this.top_canvas,t),this.jqCell.css({width:t.w,"min-width":t.w,height:t.h}))},o.prototype.update=function(){},o.prototype._hightlightBackground=function(t,e,i){var o,n,s,r,a,l,h=e[0].price,c=e[0].price;for(o=1;o<e.length;o++)h=Math.min(h,e[o].price),c=Math.max(c,e[o].price);n=this.priceScale(),n.isPercent()&&i&&(s=i.firstValue(),h=n.priceRange().convertToPercent(h,s),c=n.priceRange().convertToPercent(c,s)),r=this.priceScale().priceToCoordinate(h),a=this.priceScale().priceToCoordinate(c),l="rgba(109, 158, 235, 0.3)",_(t,1,r,this.size.w-1,a-r,l)},o.prototype.drawBackground=function(t){var e,i,o,s;if(_(t,0,0,this.size.w,this.size.h,this.backgroundColor()),e=this.pane.chart().model(),(i=e.model().selectedSource())&&i.priceScale()===this.priceScale()&&i instanceof n){if(o=i.axisPoints(),0===o.length)return;this._hightlightBackground(t,o,i.ownerSource())}s=e.model().crossHairSource(),s.startMeasurePoint()&&this._hightlightBackground(t,s.measurePoints(),this.pane.state().mainDataSource())},o.prototype.drawBorder=function(t){var e,i,o;t.save(),t.fillStyle=this.lineColor(),e=this.size.h,this._isLeft?(t.translate(-.5,-.5),i=this.size.w-this._BORDER_SIZE-1,o=this.size.w-1):(t.translate(.5,-.5),i=0,o=i+this._BORDER_SIZE),t.fillRect(i,0,o-i,e),t.restore()},o.prototype.drawTickMarks=function(t){var e,i,o,n,s,r;if(t.save(),t.strokeStyle=this.lineColor(),e=this.priceScale().marks(),t.fillStyle=this.textColor(),t.setFont(this.baseFont()),i=this,t.translate(-.5,-.5),o=this.rendererOptions(),i._isLeft){for(t.fillStyle=i.lineColor(),t.beginPath(),n=this.size.w-i._OFFSET_SIZE-i._BORDER_SIZE-i._TICK_LENGTH,s=e.length;s--;)t.rect(n,e[s].coord,i._TICK_LENGTH,1);for(t.fill(),s=e.length;s--;)o._tickmarksCache.paintTo(t,e[s].label,n-o.paddingInner,e[s].coord,"right")}else{for(t.fillStyle=i.lineColor(),t.beginPath(),r=i._BORDER_SIZE+i._OFFSET_SIZE,s=e.length;s--;)t.rect(r,e[s].coord,i._TICK_LENGTH,1);for(t.fill(),s=e.length;s--;)o._tickmarksCache.paintTo(t,e[s].label,r+i._TICK_LENGTH+o.paddingInner,e[s].coord,"left")}t.restore()},o.prototype._alignLabels=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u=this.size.h/2,_=[],f=this.priceScale().orderedSources().slice(),m=this.pane,g=m.state(),v=this.rendererOptions();if(this.priceScale()===g.defaultPriceScale())for(t=this.pane.state().dataSources(),e=0;e<t.length;e++)g.isOverlay(t[e])&&f.push(t[e]);for(i=this.priceScale().mainSource(),e=0;e<f.length;++e)if(o=f[e],n=o.priceAxisViews(g,o.priceScale())){for(s=0;s<n.length;s++)_.push(n[s]);i===o&&n.length>0&&(u=n[0].floatCoordinate())}if(r=_.filter(function(t){return t.floatCoordinate()<=u}),a=_.filter(function(t){return t.floatCoordinate()>u}),r.sort(function(t,e){return e.floatCoordinate()-t.floatCoordinate()}),r.length&&a.length&&a.push(r[0]),a.sort(function(t,e){return t.floatCoordinate()-e.floatCoordinate()}),_.forEach(function(t){t._fixedCoordinate=t.coordinate()}),l=this.priceScale().properties(),l.alignLabels&&l.alignLabels.value()){for(e=1;e<r.length;e++)h=r[e],c=r[e-1],d=c.renderer().height(v,!1),(h.coordinate()||c._fixedCoordinate)&&h.coordinate()>c._fixedCoordinate-d&&(p=c._fixedCoordinate-d,h._fixedCoordinate=p);for(s=1;s<a.length;s++)h=a[s],c=a[s-1],d=c.renderer().height(v,!0),(h.coordinate()||c._fixedCoordinate)&&h.coordinate()<c._fixedCoordinate+d&&(p=c._fixedCoordinate+d,h._fixedCoordinate=p)}},o.prototype.drawBackLabels=function(t){var e,i,o,n,s;for(t.save(),e=this.backLabels(),i=this.rendererOptions(),o=0;o<e.length;o++)n=e[o],s=n.renderer(),n._fixedCoordinate&&(s._data.coordinate=n._fixedCoordinate),s.draw(t,i);t.restore()},o.prototype.drawCrossHairLabel=function(t){var e,i,o,n,s,r,a,l=this.pane.chart().model().model(),h=[],c=l.sourceBeingMoved()||l.lineBeingEdited()||l.lineBeingCreated();for(c&&h.push({source:c,scale:c.priceScale()}),l.selectedSource()&&h.push({source:l.selectedSource(),scale:l.selectedSource().priceScale()}),l.hoveredSource()&&h.push({source:l.hoveredSource(),scale:l.hoveredSource().priceScale()}),h.push({source:l.crossHairSource(),scale:this.priceScale()}),e=this.pane.state(),i=0;i<h.length;i++)if(o=h[i],n=o.source.priceAxisViews(e,o.scale))for(s=0;s<n.length;s++)r=n[s],t.save(),a=r.renderer(),r._fixedCoordinate&&(a._data.coordinate=r._fixedCoordinate),a.draw(t,this.rendererOptions()),t.restore()},o.prototype.priceScale=function(){var t=this.pane.state(),e=[];return e=this._isLeft?[t.leftPriceScale(),t.rightPriceScale()]:[t.rightPriceScale(),t.leftPriceScale()],null===e[0].mainSource()?null===e[1].mainSource()?e[0]:e[1]:e[0]},o.prototype.isVisible=function(){return this._isVisible},o.prototype.setVisible=function(t){(t=!!t)!==this._isVisible&&(t?this.jqCell.css("display","table-cell"):this.jqCell.css("display","none"),this._isVisible=t)},o.prototype.setAutoScale=function(t){var e=this.pane.state,i=this.priceScale();this.pane.chart().model().setPriceAutoScale(e,i,t)},o.prototype.reset=function(){var t=this.pane.state(),e=this.priceScale();this.pane.chart().model().resetPriceScale(t,e)},o.prototype.paint=function(t){this._isVisible&&t&&(t===d.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx)):(this._alignLabels(),this.drawBackground(this.ctx),this.drawBorder(this.ctx),this.pane.state()&&(this.drawTickMarks(this.ctx),this.drawBackLabels(this.ctx),this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx))))},o.prototype.restoreDefaultCursor=function(){this.setCursor("")},o.prototype.setCursor=function(t){var e="";"grabbing"!==t&&"ns-resize"!==t||(e="price-axis--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),e&&this.jqCell.addClass(e),this._currentCursorClassName=e)},o.prototype.image=function(){var t={};return t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t},o.prototype.onMarksChanged=function(){var t,e=this.optimalWidth();this._prevOptimalWidth<e&&(t=this,this.updateTimeout||(this.updateTimeout=setTimeout(function(){t.pane&&t.pane.chart&&t.pane.chart()&&t.pane.chart().model().model().fullUpdate(),t.updateTimeout=null},100))),this._prevOptimalWidth=e},t.exports=o}).call(e,i(1))},function(t,e){},function(t,e,i){"use strict";var o=i(305),n={instances:[],createMenu:function(t,e,i){var n=new o(t,e,i);return this.instances.push(n),n},hideAll:function(){for(var t in this.instances)this.instances[t].hide()}};t.exports=n},function(t,e,i){"use strict";function o(t){var e,i=[],n=t.m_items;for(e=0;e<n.length;e++)n[e]._menu&&(i.push(n[e]._menu),i=i.concat(o(n[e]._menu)));return i}function n(t,e,i){var o,n;this.options={},this._parentMenuItem=i,$.extend(this.options,e),this.options.class&&(this.options.attributes.class=this.options.class),this.jqMenu=null,this.m_wrapper=null,this.m_items=[];for(o in t)n=t[o],this.addItem(n)}var s=i(306),r=i(100).ActionPlaceholder,a=i(307),l=a.Item,h=a.ItemPlaceholder,c=i(186),d=i(185);n.prototype.addItem=function(t){var e;return e=t instanceof r?new h(t,this):new l(t,this),this.m_items.push(e),e},n.renderItem=function(t,e){t.append(e.render(t))},n.prototype.closeOtherSubmenus=function(t){for(var e=0;e<this.m_items.length;++e)this.m_items[e].highlight(!1),this.m_items[e]._menu&&(this.m_items[e]._menu.destroy(),this.m_items[e]._menu=null)},n.prototype.isShown=function(){return null!==this.jqMenu},n.prototype.render=function(){var t,e,i,o=this.getAttributes();if(this._parentMenuItem){t=$("<table>"),this.jqMenu=t,t.attr("cellspacing","0"),t.attr("cellpadding","0"),t.addClass("context-menu"),t.addClass("submenu");for(e in this.m_items)i=this.m_items[e],n.renderItem(t,i)}else{t=d.create(s.MENU_TAG,o),this.jqMenu=t;for(e in this.m_items)i=this.m_items[e],n.renderItem(t,i)}return this.jqMenu},n.prototype.getAttributes=function(){var t={},e=["context-menu"];return this.options.attributes&&this.options.attributes.class&&e.push(this.options.attributes.class),t.cellspacing=0,t.cellpadding=0,t.class=e.join(),t},n.prototype.deploy=function(t,e){var i=this.wrapper();return this.jqMenu=i.append(this.render()),e?($(e).data("submenu",this.jqMenu),$(document.body).append(this.jqMenu),this.jqMenu.data("parent-menu",e),this.jqMenu.data("parent-item",t.currentTarget)):$(document.body).append(this.jqMenu),c.unbindContextMenu(this.jqMenu),this._setCoords(t),this.jqMenu},n.prototype.show=function(t,e){this.deploy(t,e).show()},n.prototype.hide=function(){this.isShown()&&this.destroy()},n.prototype.destroy=function(){$.each(this.m_items,function(t,e){e._menu&&e._menu.destroy()}),this.jqMenu&&(this.jqMenu.remove(),this.jqMenu=null),this.m_wrapper.empty()},n.prototype._setCoords=function(t){var e,i,o,n,s,r=5,a=this.jqMenu,l=$(this.jqMenu.data("parent-item")),h={width:$(window).width(),height:Math.min($(window).height(),$("body").height())},c={top:$(document).scrollTop(),left:$(document).scrollLeft()};for(this.jqMenu.css({maxWidth:h.width-2*r,maxHeight:h.height-2*r}),e={width:a.outerWidth(),height:a.outerHeight()},l.size()?(o=l.offset(),i={top:o.top-1,left:o.left+l.outerWidth()}):i={top:t.pageY,left:t.pageX},this.jqMenu.offset(i),n={},n.top=Math.min(i.top,h.height+c.top-e.height-r),i.left+e.width+r>h.width||this.options.reverse?n.left=i.left+c.left-e.width:n.left=i.left,s=t.target;s&&s!==document;s=s.parentNode)if("fixed"===$(s).css("position")){this.jqMenu.css("position","fixed");break}this.jqMenu.offset(n)},n.prototype._wrapper=function(){var t=this,e=s.WRAPPER_ATTRIBUTES;return this._parentMenuItem?this.m_wrapper=d.create(s.WRAPPER_TAG,e):(this.m_wrapper=c.createPopup(e,void 0,{mouseDownOutsideEvent:function(e){var i=$();$.each(o(t),function(){i=i.add(this.m_wrapper)}),$(e.target).parents().andSelf().is(i)||t.hide()}}),this.m_wrapper.addClass("topmenu")),this.m_wrapper},n.prototype.wrapper=function(t){return this.m_wrapper||this._wrapper()},t.exports=n},function(t,e){"use strict";t.exports={INSERT_AT_END:0,INSERT_AT_START:1,INSERT_AT_POS:2,WRAPPER_TAG:"div",WRAPPER_ATTRIBUTES:{class:"context-menu-wrapper"},MENU_TAG:"table",ITEM_ROW_TAG:"tr",ICON_CELL_TAG:"td",TEXT_CELL_TAG:"td",RIGHT_CELL_TAG:"td",SUBMENU_CELL_TAG:"td"}},function(t,e,i){"use strict";function o(t){return null==t._parentMenu?null:n(t._parentMenu)}function n(t){return null==t._parentMenuItem?t:o(t._parentMenuItem)}function s(t,e){this.action=t,this._parentMenu=e}function r(t,e){this.action=t,this._parentMenu=e}var a=i(306),l=i(185);s.prototype._createIconTag=function(){var t=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqIcon},s.prototype._createDeleteButton=function(){var t,e,i;if(!this.action.deleteButton)return null;t=this,e=this.action.deleteButton.action,i=l.create("span",{class:"context-menu-delete-button"}),e&&i.click(function(){return e.call(t),!1}),this.jqSubmenu.addClass("delete-spacer"),this.jqSubmenu.append(i)},s.prototype._createTextTag=function(){var t=this._textTagAttributes();return this.jqText=l.create(a.TEXT_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqText},s.prototype._createRightTag=function(){var t=this._rightTagAttributes();return this.jqRight=l.create(a.RIGHT_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqRight},s.prototype._createSubmenuTag=function(){var t=this._submenuTagAttributes();return this.jqSubmenu=l.create(a.SUBMENU_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqSubmenu},s.prototype._iconTagAttributes=function(){var t={},e=[];return this.action&&(this.action.icon?(e.push("icon"),e.push(this.action.icon.replace(/\./,"_"))):this.action.checkable?(e.push("icon"),this.action.checked?e.push("checked-icon"):e.push("unchecked-icon")):e.push("spacer")),t.class=e.join(" "),t},s.prototype._textTagAttributes=function(){return{class:"text",html:this.action?this.action.text:""}},s.prototype.highlight=function(t){t?(this.jqRow.addClass("context-menu-hover"),this.jqIcon.addClass("context-menu-hover")):(this.jqRow.removeClass("context-menu-hover"),this.jqIcon.removeClass("context-menu-hover")),this.action&&this.action.hasSubActions()&&(t?this.jqSubmenu.addClass("expanded"):this.jqSubmenu.removeClass("expanded"))},s.prototype._rightTagAttributes=function(){var t={},e=["right"];return this.action&&this.action.shortcut&&(e.push("shortcut"),t.class=e.join(" "),t.html=this.action.shortcut),t},s.prototype._submenuTagAttributes=function(){var t={};return this.action&&this.action.hasSubActions()?t.class="submenu-arrow":t.class="context-menu spacer",t},s.prototype.render=function(){this._createRow(),this.jqRow.append(this._createIconTag()),this.jqRow.append(this._createTextTag()),this.jqRow.append(this._createRightTag()),this.jqRow.append(this._createSubmenuTag()),this._createDeleteButton(),this.appendCallback();var t=this;return this.jqRow.mouseenter(function(e){t.showSubmenu(e),t.highlight(!0),t._parentMenu&&t._parentMenu._parentMenuItem&&t._parentMenu._parentMenuItem.highlight(!0)}),this.jqRow.mouseleave(function(){t.highlight(!1)}),this.jqRow},s.prototype._createRow=function(){var t,e,i=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,i),this.jqRow.addClass("context-menu"),t=this,this.action&&!this.action.hasSubActions()&&(e=function(t){t.destroy(),t._parentMenuItem&&e(t._parentMenuItem._parentMenu)},this.jqRow.click(function(i){e(t._parentMenu)}))},s.prototype.showSubmenu=function(t){if(this._parentMenu.closeOtherSubmenus(this),!this.action||this.action.hasSubActions()){if(!this._menu){var e=i(304);this._menu=e.createMenu(this.action.subActions,null,this)}t.pageX=this._parentMenu.jqMenu.width()-2,t.pageY=this.jqSubmenu.offset().top-this._parentMenu.jqMenu.offset().top-1,this._menu.show(t,this._parentMenu.jqMenu)}},s.prototype._rowTagAttributes=function(){var t=[];return this.action&&(this.action.enabled===!1&&t.push("disabled"),this.action.visible===!1&&t.push("hidden"),this.action.font&&t.push("font_"+this.action.font),this.action.hasSubActions()&&t.push("has_submenu"),this.action.htmlclass&&t.push(this.action.htmlclass)),{class:t.join(" ")}},s.prototype.appendCallback=function(){var t=this;this.jqRow.click(function(e){t.action.enabled&&t.action.executeCallback(e)})},s.prototype.getTopLevelMenu=function(){return o(this)},r.prototype.render=function(t){this._createRow();var e=this;return this.action.deferred.then(function(o){var n,s,r,a=i(305);for(n in o)s=o[n],r=e._parentMenu.addItem(s),a.renderItem(t,r)}).always(function(){e.jqRow.hide()}),this.jqRow},r.prototype._createIconTag=function(){var t=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqIcon},r.prototype._createRow=function(){var t=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,t),this.jqRow.append(this._createIconTag()),this.jqRow.addClass("context-menu")},r.prototype._rowTagAttributes=function(){var t=[];return this.action&&t.push("spinner"),{class:t.join(" ")}},r.prototype.highlight=function(t){},r.prototype._iconTagAttributes=function(){var t={},e=[];return e.push("spacer"),t.class=e.join(" "),t.colspan="10",t},e.Item=s,e.ItemPlaceholder=r},function(t,e,i){(function(e){"use strict";function o(t,e,i,o){this.reset(t,e,i,o)}var n=i(128).makeFont;o.prototype.maxCount=50,o.prototype.reset=function(t,e,i,o){for(var s=this._next;s&&s!==this;s=s._next)s.canvas.width=0,s._next=null,s._prev=null;this._next=this,this._prev=this,this._count=0,this._fontSize=t,this._color=o,this._font=n(t,e,i),this._hash={}},o.prototype.paintTo=function(t,e,i,o,n){var s=this.getLabelImage(e);"left"!==n&&(i-=s.width),o-=Math.floor(s.height/2),t.drawImage(s.canvas,i,o)},o.prototype.getLabelImage=function(t){var i,o,n,s,r;return Object.prototype.hasOwnProperty.call(this._hash,t)?i=this._hash[t]:(this._count<this.maxCount?(this._count++,i={_next:this._next,_prev:this,text:t,width:0,height:0,canvas:document.createElement("canvas")},o=i.canvas.getContext("2d"),o.font=this._font):(i=this._prev,delete this._hash[i.text],i.text=t,o=i.canvas.getContext("2d")),n=Math.ceil(this._fontSize/4),s=Math.round(this._fontSize/10),r=o.measureText(t).width,i.height=this._fontSize+2*n,i.width=Math.max(1,r),0!==r?this._hash[i.text]=i:e.enabled("charting_library_debug_mode")&&console.log('Canvas 2d context measureText return zero width for "'+t+'" text'),i.canvas.height=i.height,i.canvas.width=i.width,o=i.canvas.getContext("2d"),o.font=this._font,o.fillStyle=this._color,o.fillText(t,0,n+this._fontSize-s)),this._next!==i&&(i._next._prev=i._prev,i._prev._next=i._next,i._prev=this,i._next=this._next,this._next._prev=i,this._next=i),i},t.exports=o}).call(e,i(1))},function(t,e,i){(function(t){"use strict";function o(t,e){this._model=e,this._bindings=[],this._property=t}function n(t,e,i,o,n,s){if(!t)return void TradingView.logDebugChart("Binding: missing control");this._control=t,this._property=e,this._applyOnFly=i,this._undoModel=o,this._undoText=n,e&&(this._formatters=[],this._changed=!1,this.setValue(e.value()),e.listeners().subscribe(this,this.propertyChanged))}function s(t){return t.toUpperCase()}function r(t){return function(e){return e<t?t:e}}function a(t){return function(e){return e>t?t:e}}function l(t){return function(e){var i=parseInt(e,10);return TradingView.isNaN(i)?t:i}}function h(t){var e=new A;return function(i){var o=e.parse(i);return TradingView.isNaN(o)?t:o}}function c(){return function(t){for(var e=t,i=t.replace(/[^\u0000-\u007F]/,"");i.length!==e.length;)e=i,i=e.replace(/[^\u0000-\u007F]/,"");return i}}function d(t){return function(e){return 0===e.length?t:e}}function p(t,e,i,o,s,r){n.call(this,t,e,o,s,r),this._transformFunction=i,this._attachToControl(t,o)}function u(t,e,i,o,n){p.call(this,t,e,h(e.value()),i,o,n),this.addFormatter(function(t){return(new A).format(t)})}function _(t,e,i,o,s,r){this._subControlIds=e,n.call(this,t,i,o,s,r),this._forEachSubControl(function(t){this._attachToControl(t,o)})}function f(t,e,i,o,s,r,a){this._model=o,this._mainSeries=r,this._toIntTransformer=l(a),this._disabled=!1,n.call(this,t,e,i,o,s);var h=this;i&&t.change(function(){h.setValueToProperty(h.value())}),this._mainSeries.onBarReceived().subscribe(this,function(t){h.setValue(this.property().value())})}function m(t,e,i,o,s){n.call(this,t,e,i,o,s),i&&t.on("accept-symbol",function(t,e){this.setValueToProperty(e)}.bind(this))}function g(t,e,i,o,s,r,a,l){n.call(this,t,e,o,s,r),this._transformFunction=i,this._propertyChangedHook=l,this._setter=a;var h=this;o&&t.change(function(){h._setter?h._setter.call(h,h.value()):h.setValueToProperty(h.value())})}function v(t,e){n.call(this,t,e)}function y(t,e,i,o,s,r){if(!t.is(":checkbox, :radio"))return new w(t,e,i,o,s);n.call(this,t,e,i,o,s),this._setter=r;var a=this;i&&t.change(function(){a._setter?a._setter.call(a,a.value()):a.setValueToProperty(a.value())})}function b(t,e,i,o,s,r){n.call(this,t,e,i,o,s),this._inverted=r===!0}function w(t,e,i,o,s){n.call(this,t,e,i,o,s);var r=this;i&&t.click(function(){var t=$(this).toggleClass("active").hasClass("active");r.setValueToProperty(t)})}function S(t,e,i,o,s){if(!i)return void TradingView.logDebugChart("ActionBinder: Missed undo model");n.call(this,t,e,!0,i,o),s?t.callbacks().subscribe(this,s):t.callbacks().subscribe(this,S.prototype.onActionCallback)}function T(t,e,i,o,s,r){var a,l;a=t.is("input")?t:t.find("input"),n.call(this,a,e,i,o),this._transparencyProperty=r,this.applyOldTransparency(),l=this,i&&a.change(function(){l.setValueToProperty(l.value())})}function C(e,i,o,s,r,a){function l(t,e){var i=c.control().slider("option","min"),o=c.control().slider("option","max"),n=c._property.value();(i<=n&&n<=o||i<e.value&&e.value<o)&&c.setValueToProperty(e.value)}function h(t,e){c.setValueToProperty(e.value)}isNumber(i.value())||(TradingView.logWarn("Property cannot be binded to control, bad value (expect number): "+i.value()),i=new t),n.call(this,e,i,o,s,r);var c=this;o&&(a?(e.bind("slidechange",l),e.bind("slide",l)):(e.bind("slidechange",h),e.bind("slide",h))),e.bind("slidestart",function(t,e){s.beginUndoMacro(r)}),e.bind("slidestop",function(t,e){s.endUndoMacro()})}function x(t,e,i,o,n,s){y.call(this,t,e,o,n,s),this._intervalProperty=i,this._intervalProperty.listeners().subscribe(this,this.onIntervalChanged),this.onIntervalChanged()}function P(t,e,i,o){this._control=t,this._wv=e,this._transformFunction=i,this._undoText=o,this._attachToControl(this._control),this._setValueBinded=this.setValue.bind(this)}function L(t,e,i,o,n){this._not=!!n,P.apply(this,arguments)}function k(t,e,i,o,n,s,r,a){this._propFrom=e[0],this._propTo=e[1],this._control=t,this._applyOnFly=o,this._undoModel=n,this._undoText=r,this._properties=e,this._inputsText=s,this._transformers=i;var l=this;t.slider({range:!0,min:i[0],max:i[1],values:[l._propFrom.value(),l._propTo.value()]}),this.$rangeHandleFrom=$(t.find(".ui-slider-handle")[0]).addClass("from"),this.$rangeHandleTo=$(t.find(".ui-slider-handle")[1]).addClass("to"),this.setValue(this._propFrom,0),this.setValue(this._propTo,1),a&&($(a).on("change",function(t){$(this).is(":checked")?(l._control.slider("enable"),$(l._inputsText[0]).prop("disabled",!1),$(l._inputsText[1]).prop("disabled",!1)):(l._control.slider("disable"),$(l._inputsText[0]).prop("disabled",!0),$(l._inputsText[1]).prop("disabled",!0))}),$(a).is(":checked")?(l._control.slider("enable"),$(l._inputsText[0]).prop("disabled",!1),$(l._inputsText[1]).prop("disabled",!1)):(l._control.slider("disable"),$(l._inputsText[0]).prop("disabled",!0),$(l._inputsText[1]).prop("disabled",!0))),s&&($(s[0]).val(this._control.slider("values",0)),$(s[1]).val(this._control.slider("values",1)),t.slider({slide:function(t,e){$(s[0]).val(e.values[0]),$(s[1]).val(e.values[1])}}),$(s).each(function(){$(this).on("keydown",function(t){parseInt($(s[0]).val())<l._transformers[0]?$(s[0]).val(l._transformers[0]):parseInt($(s[1]).val())>l._transformers[1]&&$(s[1]).val(l._transformers[1]),$.inArray(t.keyCode,[46,8,9,27,13,110,190])!==-1||65===t.keyCode&&t.ctrlKey===!0||67===t.keyCode&&t.ctrlKey===!0||88===t.keyCode&&t.ctrlKey===!0||t.keyCode>=35&&t.keyCode<=39||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()})}),$(s[0]).on("keyup",function(t){parseInt($(this).val())<l._transformers[0]?$(this).val(l._transformers[0]):parseInt($(this).val())>l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())>parseInt($(s[1]).val())&&$(this).val(s[1].val()),l._control.slider("values",0,$(this).val()),k.prototype.setValueToProperty.call(l,l._control.slider("values"),"from")}),$(s[1]).on("keyup",function(t){parseInt($(this).val())<l._transformers[0]?$(this).val(l._transformers[0]):parseInt($(this).val())>l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())<$(s[0]).val()&&$(this).val(s[0].val()),l._control.slider("values",1,$(this).val()),k.prototype.setValueToProperty.call(l,l._control.slider("values"),"to")})),this._propFrom.listeners().subscribe(this,k.prototype.propertyChanged),this._propTo.listeners().subscribe(this,k.prototype.propertyChanged),o&&t.on("slide",function(t,e){l.setValueToProperty(l._control.slider("values"),e.handle)}),t.slider({stop:function(t,e){s&&($(s[0]).val(l._control.slider("values",0)),$(s[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)},start:function(t,e){s&&($(s[0]).val(l._control.slider("values",0)),$(s[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)}})}function I(t,e,i,o,s,r){n.call(this,t,e,i,o,s),this._separator=r||" ";var a=this;i&&t.change(function(){a.setValueToProperty(a.value())})}var E=i(291).UndoHistory,A=i(94).NumericFormatter,V=i(119);o.prototype.model=function(){return this._model},o.prototype.bindControl=function(t){return this._bindings.push(t),t},o.prototype.unbindControl=function(t){var e=this._bindings.indexOf(t);e!==-1&&this._bindings.splice(e,1)},o.prototype.loadData=function(){var t,e,i;for(t=0;t<this._bindings.length;t++)e=this._bindings[t],e.properties?(i=e.properties(),e.setValue(i[0],0),e.setValue(i[1],1)):e.property&&(e.transparencyProperty&&e.transparencyProperty()?e.applyOldTransparency():e.setValue(e.property().value()))},o.prototype.saveData=function(){var t,e;for(this._model.beginUndoMacro(),t=0;t<this._bindings.length;t++)e=this._bindings[t],e.changed()&&this._model.setProperty(e.property(),e.value());this._model.endUndoMacro()},o.prototype.createColorPicker=function(t){var e,i;return t=t||{},e=$('<input class="colorpicker-widget">').bind("customcolorchange",function(t,e){TVSettings.setJSON("pickerCustomColors",e)}).on("change",function(){$(this).css("border-color",V.generateLowBrightnessColor($(this).val()||V.defaultColorPickersBorder))}).tvcolorpicker({customColors:TVSettings.getJSON("pickerCustomColors",[]),hideTransparency:!!t.hideTransparency,direction:t.direction}),i=$('<span class="tvcolorpicker-container">'),$('<div class="tvcolorpicker-transparency">').appendTo(i),e.appendTo(i),t.addClass&&i.addClass(t.addClass),i},o.prototype.createTextEditor=function(t,e){var i={};return t&&(i.width=t),e&&(i.height=e),$(document.createElement("textarea")).css(i)},o.prototype.createCombo=function(t){var e=$(document.createElement("select")),i=t.reduce(function(t,e){return t.add($(document.createElement("option")).prop({value:e,text:e}))},$());return e.append(i)},o.prototype.createKeyCombo=function(t){var e=$(document.createElement("select"));return $.each(t||[],function(t,i){$(document.createElement("option")).prop({value:t,text:i}).appendTo(e)}),e},o.prototype.createFontEditor=function(t){var e=t||TradingView.factoryDefaults("chartproperties.editorFontsList");return this.createCombo(e)},o.prototype.createFontSizeEditor=function(t){var e=t||[10,11,12,14,16,20,24,28,32,40];return this.createCombo(e).addClass("tv-select-container-fontsize")},o.prototype.createSeriesMinTickEditor=function(){var t,e,i,o,n="<select><option value='default'>"+$.t("Default")+"</option>",s=[{priceScale:1,minMove:1,frac:!1},{priceScale:10,minMove:1,frac:!1},{priceScale:100,minMove:1,frac:!1},{priceScale:1e3,minMove:1,frac:!1},{priceScale:1e4,minMove:1,frac:!1},{priceScale:1e5,minMove:1,frac:!1},{priceScale:1e6,minMove:1,frac:!1},{priceScale:2,minMove:1,frac:!0},{priceScale:4,minMove:1,frac:!0},{priceScale:8,minMove:1,frac:!0},{priceScale:16,minMove:1,frac:!0},{priceScale:32,minMove:1,frac:!0},{priceScale:64,minMove:1,frac:!0},{priceScale:128,minMove:1,frac:!0},{priceScale:320,minMove:1,frac:!0}];for(t in s)e=s[t],i=e.priceScale+","+e.minMove+","+e.frac,o=e.minMove+"/"+e.priceScale,n+="<option value='"+i+"'>"+o+"</option>";return n+="</select>",$(n)},o.prototype.createPrecisionEditor=function(){var t,e="<select><option value='default'>"+$.t("Default")+"</option>";for(t=0;t<=6;t++)e+="<option value='"+t+"'>"+t+"</option>";return e+="</select>",$(e)},o.prototype.createLabeledCell=function(t,e,i){var o,n,s,r,a=null;return"number"==typeof t.valueOf()?(a=t,o=e,n=i):(o=t,n=e),o+="",s=this._labelToId(o),r=$("<td>"),$("<label>").html(o.length>0?$.t(o):"").attr("for",s).appendTo(r),a&&r.attr("colspan",a),n&&n.attr("id",s),r},o.prototype.createTableInTable=function(t){var e=$("<tr>").appendTo(t),i=$("<td>").appendTo(e);return $('<table cellpadding="0" cellspacing="0">').appendTo(i)},o.prototype._labelToId=function(t){return"control"+t.replace(/(^| )\w/g,function(t){return"-"+t.trim().toLowerCase()})+Math.floor(1e3*Math.random())},o.prototype.addRow=function(t){return $(document.createElement("tr")).appendTo(t)},o.prototype.addLabeledRow=function(t,e,i,o){var n,s=e&&e.length>0?$.t(e):"",r=$(document.createElement("tr")),a=$(document.createElement("td")).html(s);return o&&a.attr("colspan",2),i&&(n=this._labelToId(e),i.attr("id",n),a.html('<label for="'+n+'">'+s+"</label>")),r.append(a).appendTo(t)},o.prototype.addEditorRow=function(t,e,i,o){var n=$(document.createElement("td"));return i.row=this.addLabeledRow(t,e,i,o),i.appendTo(n.appendTo(i.row)),i},o.prototype.addColorPickerRow=function(t,e){return this.addEditorRow(t,e,this.createColorPicker())},o.prototype.addOffsetEditorRow=function(t,e){var i=$("<input/>");return i.attr("type","text"),i.css("width","100px"),i.addClass("ticker"),this.addEditorRow(t,e,i)},o.prototype.addFontEditorRow=function(t,e){return this.addEditorRow(t,e,this.createFontEditor())},o.prototype.refreshStateControls=function(t,e,i){var o,n,s;for(o=0;o<e.length;o++)n=e[o],s=t[n.id],s.toggle(this.parseRule(n.visible,e,i)),s.attr("disabled",!this.parseRule(n.visible,e,i))},o.prototype.parseRule=function(t,e,i){if(!t)return!0;var o=t.split("==");return!(o.length<2)&&i[o[0]].value()===o[1]},o.prototype.destroy=function(){for(var t=this._bindings.length;t--;)this._bindings[t].destroy();this._bindings.length=0},o.prototype.bindInteger=function(t,e,i,o,n){var s=[l(e.value())];void 0!==o&&s.push(r(1)),void 0!==n&&s.push(a(1e3)),this.bindControl(new p(t,e,s,!1,this.model(),i))},o.prototype.bindColor=function(t,e,i){this.bindControl(new T(t,e,!0,this.model(),i))},o.prototype.bindBoolean=function(t,e,i){this.bindControl(new y(t,e,!0,this.model(),i))},n.prototype.addFormatter=function(t){this._formatters.push(t),this.setValue(this._property.value())},n.prototype._formatValue=function(t){return this._formatters.reduce(function(t,e){return e(t)},t)},n.prototype._attachToControl=function(t,e){var i=this;e?t.on("keyup change input",function(t){var e=i.value();i.setValueToProperty(e),i.setValue(e)}):(t.keypress(function(t){if(this._changed=!0,13===t.which){var e=i.value();i.setValueToProperty(e),i.setValue(e)}}),t.focusout(function(t){var e=i.value();i.changed()&&(i.setValueToProperty(e),i.setValue(e))}),t.change(function(t){var e=i.value();$(t.target).is(".ticker")?(void 0!==i._changeTimerId&&clearTimeout(i._changeTimerId),i._changeTimerId=setTimeout(function(){i.setValueToProperty(e)},250)):i.setValueToProperty(e),i.setValue(e)}))},n.prototype.control=function(){return this._control},n.prototype.changed=function(){return this._changed},n.prototype.setValueToProperty=function(t){this._undoModel.setProperty(this._property,t,this._undoText),this._changed=!1},n.prototype.property=function(){return this._property},n.prototype.propertyChanged=function(t){this.setValue(t.value())},n.prototype.destroy=function(){this._property&&this._property.listeners().unsubscribe(this,this.propertyChanged)},inherit(p,n),p.prototype.value=function(){var t,e=this._control.val();if(this._transformFunction)if(Array.isArray(this._transformFunction))for(t=0;t<this._transformFunction.length;t++)e=this._transformFunction[t](e);else e=this._transformFunction(e);return e},p.prototype.setValue=function(t){var e=this._control.val(),i=this._formatValue(t);e!==i&&this._control.val(i)},inherit(u,p),inherit(_,n),_.prototype._forEachSubControl=function(t){this._subControlIds.forEach(function(e){var i="#"+e,o=this.control().find(i);t.call(this,o)},this)},_.prototype._parseSessions=function(t){var e,i,o=t.split("-",2);return 2!==o.length&&(o=["0","0"]),e=parseInt(o[0]),i=parseInt(o[1]),[Math.floor(e/100),e%100,Math.floor(i/100),i%100]},_.prototype.value=function(){var t,e,i,o=[];return this._forEachSubControl(function(t){o.push(t.val())}),t=function(t,e){return e.forEach(function(e){t=e(t)}),("0"+t).slice(-2)},e=[l(0),r(0),a(23)],i=[l(0),r(0),a(59)],t(o[0],e)+t(o[1],i)+"-"+t(o[2],e)+t(o[3],i)},_.prototype.setValue=function(t){var e=this._parseSessions(t);this._forEachSubControl(function(t){var i=t.val(),o=("0"+e[0]).slice(-2);e.shift(),i!==o&&t.val(o)})},inherit(f,n),f.prototype.value=function(){var t,e,i;return this._disabled?(this._control.attr("disabled",!0),null):(t=this._control.val(),e=this._toIntTransformer(t),e<0&&(e=0),i=this._mainSeries.bars().size(),i<=e&&(e=i-1),1e3*this._mainSeries.bars()._valueAt(this._mainSeries.bars().lastIndex()-e)[TradingView.TIME_PLOT])},f.prototype.setValue=function(t){var e,i,o;return this._disabled||null==t?void this._control.attr("disabled",!0):t<0?(this._control.val(-t),void this._property.setValue(this.value())):null===(e=this._mainSeries.data().timeToBarIndex(t/1e3,TradingView.SEARCH_FROM_RIGHT))?void(this._disabled=!0):(i=this._mainSeries.bars().lastIndex(),o=i-e,void(this._control.val()!==""+o&&this._control.val(o)))},inherit(m,n),m.prototype.value=function(){return this._control.val()},m.prototype.setValue=function(t){var e=this.value();t&&e!==t&&this._control.val(t)},inherit(g,n),g.prototype.value=function(){var t=this._control.val();return this._transformFunction&&(t=this._transformFunction(t)),t},g.prototype.setValue=function(t){var e,i;if(this._control.val(t),this._control.selectbox)try{e=this._control.find("[value='"+t+"']"),e.length>0&&(i=e[0],this._control.selectbox("change",i.value,i.text))}catch(t){}},g.prototype.propertyChanged=function(t){var e=t.value();"function"==typeof this._propertyChangedHook&&(e=this._propertyChangedHook(e)),this.setValue(e)},inherit(v,n),v.prototype.value=function(){return this._property.value()},v.prototype.setValue=function(t){return this._control.html(t)},inherit(y,n),y.prototype.value=function(){return this.control().is(":checked")},y.prototype.setValue=function(t){var e,i,o,n;return this.control().is(".visibility-checker")&&(t?(this.control().closest("tr").find(".slider-range").slider("enable"),this.control().closest("tr").find('input[type="text"]').each(function(){$(this).prop("disabled",!1)})):(this.control().closest("tr").find(".slider-range").slider("disable"),this.control().closest("tr").find('input[type="text"]').each(function(){$(this).prop("disabled",!0)}))),this.control().is(".visibility-switch")&&(e={opacity:t?1:.5},i=t?"enable":"disable",o=this.control().data("hides"),o?o.closest("td").css(e):(n=this.control(),n.parent().parent().data("visible",t).find("td").filter(function(){var t=$(this);return!t.find("label").length&&t.find(":checkbox").attr("id")!==n.attr("id")}).each(function(){var o=$(this);o.children().each(function(){var n=$(this);n.is(".ui-slider")?n.slider(i):n.is("select")?(n.selectbox(i),o.css(e)):n.is(".custom-select")?(n.data(i)(),o.css(e)):n.is(".tvcolorpicker-container")?(n.find("input").prop("disabled",!t),o.css(e)):(n.prop("disabled",!t),o.css(e))})}))),this.control().attr("checked",!!t)},inherit(b,n),b.prototype.value=function(){return this.control().is(":disabled")},b.prototype.setValue=function(t){return t=!!t,this._inverted&&(t=!t),this.control().parents("label").toggleClass("disabled",t),this.control().attr("disabled",t)},inherit(w,n),w.prototype.value=function(){return this.control().hasClass("active")},w.prototype.setValue=function(t){return this.control().toggleClass("active",!!t)},inherit(S,n),S.prototype.onActionCallback=function(t){this._undoModel.setProperty(this._property,this.value(),this._undoText)},S.prototype.value=function(){return this.control().checked},S.prototype.setValue=function(t){return this.control().checked=!!t},inherit(T,n),T.prototype.applyOldTransparency=function(){var t,e,i;this.transparencyProperty()&&(V.isHexColor(this.property().value())?(t=this.transparencyProperty().value?this.transparencyProperty().value():this.transparencyProperty(),e=V.hexRgbDecomp(this.property().value()),i=(100-t)/100,this.control().val(V.rgbaComp(e,i)),this.control().change()):(this.control().val(this.property().value()),this.control().change()))},T.prototype.transparencyProperty=function(){return this._transparencyProperty},T.prototype.value=function(){return this._control.val()},T.prototype.setValue=function(t){this._control.val(t),this._control.change(),this._control.color&&this._control.color.fromString(t)},inherit(C,n),C.prototype.value=function(){return this._control.slider("option","value")},C.prototype.setValue=function(t){this._control.slider("option","value",t)},inherit(x,y),x.prototype.onIntervalChanged=function(){+this._intervalProperty.value()<1440?this._control.attr({disabled:!1,checked:!!this._property.value()}):this._control.attr({disabled:!0,checked:!1})},x.prototype.value=function(){return this._control.is(":disabled")?this._property.value():y.prototype.value.call(this)},x.prototype.setValue=function(t){if(!this._control.is(":disabled"))return y.prototype.setValue.call(this,t)},x.prototype.destroy=function(){this._intervalProperty.listeners().unsubscribe(this,this.onIntervalChanged),delete this._intervalProperty,y.prototype.destroy.call(this,arguments)},P.prototype._attachToControl=function(t){var e=this;this._wv.subscribe(this._setValueBinded,{callWithLast:!0}),$(this._control).on("change",function(){e.setValueToProperty(e.value())})},P.prototype.control=function(){return this._control},P.prototype.value=function(){var t=$(this._control).val();return this._transformFunction&&(t=this._transformFunction(t)),t},P.prototype.setValue=function(t){$(this._control).val(t)},P.prototype.setValueToProperty=function(t){E.setWatchedValue(this._wv,t,this._undoText)},P.prototype.watchedValue=function(){return this._wv},P.prototype.destroy=function(){this._wv.unsubscribe(this._setValueBinded)},inherit(L,P),L.prototype._attachToControl=function(t){var e=this;this._wv.subscribe(this.setValue.bind(this),{callWithLast:!0}),$(this._control).on("click",function(){e.setValueToProperty(e.value())})},L.prototype.value=function(){var t=$(this._control).attr("checked");return this._not&&(t=!t),this._transformFunction&&(t=this._transformFunction(t)),t},L.prototype.setValue=function(t){this._not&&(t=!t),$(this._control).attr("checked",!!t)},k.prototype.properties=function(){return this._properties},k.prototype.value=function(t){return this._control.slider("values",t)},k.prototype.setValue=function(t,e){this._control.slider("values",e,t.value()),this._inputsText&&$(this._inputsText[e]).val(t.value())},k.prototype.propertyChanged=function(t){this.setValue(t)},k.prototype.setValueToProperty=function(t,e){($(e).hasClass("from")||"from"===e)&&(this._undoModel.beginUndoMacro(this._undoText[0]),this._undoModel.setProperty(this._propFrom,t[0],this._undoText[0]),this._propFrom.setValue(t[0],0),this._undoModel.endUndoMacro()),($(e).hasClass("to")||"to"===e)&&(this._undoModel.beginUndoMacro(this._undoText[1]),this._undoModel.setProperty(this._propTo,t[1],this._undoText[1]),this._propTo.setValue(t[1],1),this._undoModel.endUndoMacro())},k.prototype.destroy=function(){this._propFrom&&this._propTo&&(this._propFrom.listeners().unsubscribe(this,n.prototype.propertyChanged),this._propTo.listeners().unsubscribe(this,n.prototype.propertyChanged))},inherit(I,n),I.prototype.value=function(){var t=[];return this._control.each(function(){var e=$(this);e.is(":checked")&&t.push(e.attr("value"))}),t.join(this._separator)},I.prototype.setValue=function(t){var e=t.split(this._separator).filter(Boolean);this._control.each(function(){var t=$(this),i=e.indexOf(t.attr("value"))!==-1;t.attr("checked",i),t.parents("label").toggleClass("active",i)})},e.PropertyPage=o,e.UppercaseTransformer=s,e.GreateTransformer=r,e.LessTransformer=a,e.ToIntTransformer=l,e.ToFloatTransformer=h,e.ToAsciiTransformer=c,e.ReplaceEmptyTransformer=d,e.SimpleStringBinder=p,e.FloatBinder=u,e.SessionBinder=_,e.BarTimeBinder=f,e.SymbolBinder=m,e.SimpleComboBinder=g,e.StaticContentBinder=v,e.BooleanBinder=y,e.DisabledBinder=b,e.ActionBinder=S,e.ColorBinding=T,e.SliderBinder=C,e.CheckboxWVBinding=L,e.RangeBinder=k}).call(e,i(83))},function(t,e,i){"use strict";function o(t,e,i){this._model=e,this._paneWidget=t,this._chart=t._chart,this._mainDiv=i,this.jqDiv=$('<div class="pane-controls">').appendTo(i),this._chart.navigationButtonsController().addWidget({widget:this.jqDiv,acceptableOffset:0,checkingWidget:i}),this.update()}o.prototype.update=function(){var t,e,o,n,s,r,a,l;if(!this._chart.isActive())return void this.jqDiv.css("display","none");if(this.jqDiv.css("display","block"),t=this,e=t._model,o=t._paneWidget.state(),n=e.panes().indexOf(o),this.jqDiv.toggleClass("toppane",0===n||this._chart.isMaximizedPane()),s=!1,!o.containsMainSeries()&&!this._chart.isMaximizedPane()){for(r=0,a=o.dataSources(),l=a.length;l--;)if(a[l]instanceof TradingView.Study&&++r>1){s=!0;break}a=null}n>0&&!this._chart.isMaximizedPane()?(this._$upButton||(this._$upButton=$(document.createElement("a")).addClass("pane-legend-icon up").append($(i(311)).attr({width:14,height:14})).attr("title",$.t("Move Up")).on("click",function(){t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"up")})),this._$upButton.appendTo(this.jqDiv)):this._$upButton&&this._$upButton.detach(),n<this._model.panes().length-1&&!this._chart.isMaximizedPane()?(this._$downButton||(this._$downButton=$(document.createElement("a")).addClass("pane-legend-icon down").append($(i(312)).attr({width:14,height:14})).attr("title",$.t("Move Down")).on("click",function(){t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"down")})),this._$downButton.appendTo(this.jqDiv)):this._$downButton&&this._$downButton.detach(),s?(this._$closeButton||(this._$closeButton=$(document.createElement("a")).addClass("pane-legend-icon delete").append($(i(301)).attr({width:14,height:14})).attr("title",$.t("Delete")).on("click",function(){t._model.removePane(t._chart,t._model.panes().indexOf(t._paneWidget.state()))})),this._$closeButton.appendTo(this.jqDiv)):this._$closeButton&&this._$closeButton.detach(),this._model.panes().length>1&&!this._chart.isMaximizedPane()?(this._$maximizeButton||(this._$maximizeButton=$(document.createElement("a")).addClass("pane-legend-icon maximize").append($(i(313)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){t._chart.toggleMaximizePane(t._paneWidget)})),this._$maximizeButton.appendTo(this.jqDiv)):this._$maximizeButton&&this._$maximizeButton.detach(),this._model.panes().length>1&&this._chart.isMaximizedPane()?(this._$restoreButton||(this._$restoreButton=$(document.createElement("a")).addClass("pane-legend-icon restore").append($(i(314)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){t._chart.toggleMaximizePane(t._paneWidget)})),this._$restoreButton.appendTo(this.jqDiv)):this._$restoreButton&&this._$restoreButton.detach()},t.exports=o},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 2l2.8 3H8v6H6V5H4.2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M14 14V0H0v14zm-7-2L4.2 9H6V3h2v6h1.8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 1l2.8 3H8v2.5H6V4H4.2zM6 7.5h2V10h1.8L7 13l-2.8-3H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0H0zm6 1.5h2V4h1.8L7 7l2.8 3H8v2.5H6V10H4.2L7 7 4.2 4H6V1.5z"/></svg>'},function(t,e,i){(function(t){"use strict";function o(t){return t instanceof h?t instanceof Q?$t:t instanceof pt?null:t instanceof j?null:t instanceof st?null:t instanceof A?Vt:t instanceof E?null:t instanceof tt?null:t instanceof lt?null:t instanceof F?null:t instanceof nt?null:t instanceof ht?Et:t instanceof T?null:t instanceof z?null:t instanceof H?null:t instanceof S?Ot:t instanceof yt?Lt:t instanceof U?null:t instanceof w?null:t instanceof $?null:t instanceof ft?Rt:kt:t instanceof vt?t instanceof wt?Pt:Ct:null}function n(e,i){if(e instanceof l||e instanceof a.ChartWidget)return t.enabled("show_chart_property_page")?xe:null;if(e instanceof vt)return e instanceof bt?Tt:"Volume@tv-basicstudies"===e.metaInfo().id?zt:xt;if(e instanceof h){if(e instanceof V)return Wt;if(e instanceof A)return At;if(e instanceof L)return fe;if(e instanceof k)return fe;if(e instanceof I)return me;if(e instanceof ht)return It;if(e instanceof ct)return It;if(e instanceof S)return Dt;if(e instanceof W)return Ut;if(e instanceof D)return jt;if(e instanceof lt)return qt;if(e instanceof ot)return ye;if(e instanceof rt)return Ft;if(e instanceof dt||e instanceof j)return Yt;if(e instanceof pt)return Gt;if(e instanceof st)return Kt;if(e instanceof G)return Xt;if(e instanceof E)return Zt;if(e instanceof z)return we;if(e instanceof H)return Se;if(e instanceof M)return Jt;if(e instanceof it)return Qt;if(e instanceof U)return Te;if(e instanceof at)return te;if(e instanceof nt)return ee;if(e instanceof et)return ie;if(e instanceof tt)return oe;if(e instanceof O)return ne;if(e instanceof R)return se;if(e instanceof N)return re;if(e instanceof c)return d;if(e instanceof p)return u;if(e instanceof b)return ae;if(e instanceof q)return ce;if(e instanceof _)return f;if(e instanceof v)return Ce;if(e instanceof C)return le;if(e instanceof B)return he;if(e instanceof x)return de;if(e instanceof m)return g;if(e instanceof F)return pe;if(e instanceof P)return ue;if(e instanceof ut||e instanceof _t)return _e;if(e instanceof y)return St;if(e instanceof T)return Bt;if(e instanceof Q)return Mt;if(e instanceof X)return ge;if(e instanceof J)return ve;if(e instanceof K)return be;if(e instanceof Z)return ve;if(e instanceof Y)return ge;if(e instanceof yt)return xt;if(e instanceof gt||e instanceof mt)return Ht;if(e instanceof ft)return Nt}return null}function s(t){var e=i(354).StudyDisplayPropertyPage;return t instanceof vt?e:null}function r(t){var e=i(424);if(t instanceof h)return e}var a=i(288),l=i(102),h=(i(146),i(243),i(82).LineDataSource),c=i(147),d=i(366),p=i(155),u=i(369),_=i(157),f=i(370),m=i(158),g=i(371),v=i(160),y=i(161).LineToolElliott,b=i(162).LineToolFibCircles,w=i(163),S=(i(164),i(166).LineToolVertLine),T=i(189),C=i(190),x=i(191),P=i(192),L=i(193),k=i(194),I=i(195),E=i(156).LineToolParallelChannel,A=i(196),V=i(152).LineToolTrendLine,M=i(197).LineToolArrowMark,$=i(199).LineToolExecution,D=i(201),O=i(203),B=i(204),R=i(205),N=i(206),F=i(159).LineToolFibWedge,W=i(202).LineToolPitchfork,z=i(207),H=i(208),U=i(209),j=i(210),q=i(211),Y=i(212),G=i(213).LineToolTriangle,K=i(214),X=i(215).LineTool5PointsPattern,Z=i(216),J=i(217),Q=i(218).LineToolRiskReward,tt=i(219),et=i(220),it=i(222),ot=i(223).LineToolNote,nt=i(224),st=i(225),rt=i(226),at=i(227),lt=i(124).LineToolText,ht=i(122).LineToolHorzLine,ct=i(228),dt=i(150).LineToolRectangle,pt=i(229),ut=i(230),_t=i(231),ft=i(232),mt=i(233).LineToolBezierQuadro,gt=i(233).LineToolBezierCubic,vt=i(171).Study,yt=i(165).StudyLineDataSource,bt=i(246).study_Overlay,wt=i(247),St=i(372),Tt=i(373),Ct=i(354).StudyInputsPropertyPage,xt=i(354).StudyStylesPropertyPage,Pt=i(375),Lt=i(376),kt=i(377),It=i(378).LineToolHorzLineStylesPropertyPage,Et=i(378).LineToolHorzLineInputsPropertyPage,At=i(379).LineToolTrendAngleStylesPropertyPage,Vt=i(379).LineToolTrendAngleInputsPropertyPage,Mt=i(380).LineToolRiskRewardStylesPropertyPage,$t=i(380).LineToolRiskRewardInputsPropertyPage,Dt=i(381).LineToolVertLineStylesPropertyPage,Ot=i(381).LineToolVertLineInputsPropertyPage,Bt=i(382).LineToolBarsPatternStylesPropertyPage,Rt=i(383).LineToolGhostFeedInputsPropertyPage,Nt=i(383).LineToolGhostFeedStylesPropertyPage,Ft=i(384),Wt=i(385),zt=i(386),Ht=i(387),Ut=i(388),jt=i(389),qt=i(390),Yt=i(391),Gt=i(392),Kt=i(393),Xt=i(394),Zt=i(395),Jt=i(396),Qt=i(397),te=i(398),ee=i(399),ie=i(400),oe=i(401),ne=i(402),se=i(403),re=i(404),ae=i(405),le=i(406),he=i(407),ce=i(408),de=i(409),pe=i(410),ue=i(411),_e=i(412),fe=i(413),me=i(414),ge=i(415),ve=i(416),ye=i(417),be=i(418),we=i(419),Se=i(420),Te=i(421),Ce=i(422),xe=i(423);e.createInputsPropertyPage=function(t,e){var i=o(t);return i?new i(t.properties(),e,t):null},e.createStudyStrategyPropertyPage=function(t,e){var o=i(244),n=i(425);return t instanceof o?new n(t.properties(),e,t):null},e.createStylesPropertyPage=function(t,e){var i=n(t);return i?new i(t.properties(),e,t):null},e.createDisplayPropertyPage=function(t,e){var i=s(t);return i?new i(t.properties(),e,t):null},e.createVisibilitiesPropertyPage=function(t,e){var i=r(t);return i?new i(t.properties(),e,t):null},e.hasInputsPropertyPage=function(t){return!!o(t)},e.hasStylesPropertyPage=function(t){return!!n(t)},e.hasDisplayPropertyPage=function(t){return!!s(t)}}).call(e,i(1))},function(t,e,i){"use strict";function o(t,e,i){this.chart=t,this.paneA=t.paneWidgets()[e],this.paneB=t.paneWidgets()[i],this.jqRow=$(document.createElement("tr")),this.jqRow.height(o.HEIGHT),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("pane-separator"),this.jqCell.attr("colspan","3"),this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value()),this.jqCell.click(function(){}),this.handle=$('<div class="handle">').appendTo(this.jqCell),s(this.handle,this)}var n,s;i(317),n=i(30),s=i(183).setMouseEventHandler,o.HEIGHT=1,o.prototype.hide=function(){this.jqRow.addClass("js-hidden")},o.prototype.show=function(){this.jqRow.removeClass("js-hidden")},o.prototype.mouseDownEvent=function(t){(0===t.button||Modernizr.touch)&&(this.startY=t.pageY,this.deltaY=0,this.totalHeight=this.paneA.size.h+this.paneB.size.h,this.totalStretch=this.paneA.stretchFactor()+this.paneB.stretchFactor(),this.prevStretchA=this.paneA.stretchFactor(),this.minPaneHeight=30,this.maxPaneHeight=this.totalHeight-this.minPaneHeight,this.pixelStretchFactor=this.totalStretch/this.totalHeight)},o.prototype.pressedMouseMoveEvent=function(t){var e,i,o,s;(0===t.button||Modernizr.touch)&&(t.preventDefault(),this.deltaY=t.pageY-this.startY,e=this.paneA.size.h,i=n.clamp(e+this.deltaY,this.minPaneHeight,this.maxPaneHeight),o=i*this.pixelStretchFactor,s=this.totalStretch-o,this.paneA.setStretchFactor(o),this.paneB.setStretchFactor(s),this.chart._adjustSize(),this.paneA.size.h!==e&&(this.startY=t.pageY),this.chart.paint())},o.prototype.mouseUpEvent=function(t){(0===t.button||Modernizr.touch)&&(this.chart._model.addPaneStretchFactorUndoCommand(this.paneA._state,this.paneB._state,this.prevStretchA,this.paneA.stretchFactor()),this.startY=0,this.deltaY=0,this.totalHeight=0,this.totalStretch=0,this.minPaneHeight=0,this.maxPaneHeight=0,this.pixelStretchFactor=0)},o.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())},o.prototype.paint=function(){},o.prototype.image=function(){var t={},e=o.HEIGHT,i=this.paneA.lhsPriceAxisWidget.size.w,n=this.paneA.size.w,s=this.paneA.rhsPriceAxisWidget.size.w,r=$('<canvas width="'+i+'" height="'+e+'">')[0],a=r.getContext("2d");return a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,i,e),t.leftAxis={content:r.toDataURL(),contentWidth:i,contentHeight:e},r=$('<canvas width="'+n+'" height="'+e+'">')[0],a=r.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,n,e),t.content=r.toDataURL(),t.contentWidth=n,t.contentHeight=e,r=$('<canvas width="'+s+'" height="'+e+'">')[0],a=r.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,s,e),t.rightAxis={content:r.toDataURL(),contentWidth:s,contentHeight:e},t},t.exports=o},function(t,e){},function(t,e,i){"use strict";function o(t,e,o,s,r,a,l,h){var c=i(291).ChartUndoModel,d=new c(t,e,o,s,r,a,l,h);return d.model().invalidate(new n(n.FULL_UPDATE)),d}var n=i(99),s=i(139);TradingView.MAMetaInfo=function(){return new s({id:"MASimple",inputs:[{id:"length",type:"integer",defval:10},{id:"source",type:"text",defval:"close"}],plots:[{id:"MovAvg",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"true"}],palettes:{}})},TradingView.VolumeMetaInfo=function(){return new s({id:"Volume",inputs:[],plots:[{id:"Volume",type:"histogram"},{id:"Color",type:"colorer",palette:"volumePalette",target:"Volume"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{volumePalette:{colors:{0:{color:"#007F0E",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Up Volume"},1:{color:"#872323",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Down Volume"}}}}})},TradingView.DMMetaInfo=function(){return new s({id:"DM",inputs:[{id:"ADX smoothing",max:50,min:1,type:"integer",defval:14},{id:"DI Length",max:500,min:1,type:"integer",defval:14}],plots:[{id:"ADX",type:"line"},{id:"DI_P",type:"line"},{id:"DI_N",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},TradingView.RSIMetaInfo=function(){return new s({id:"RSI",inputs:[{id:"length",type:"integer",defval:14}],plots:[{id:"RelativeStrengthIndex",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,e){this.chart=t,this._properties=t.properties().scalesProperties,this.contextMenu=null,this._disableContextMenu=!!e,this.jqRow=$(document.createElement("tr")),this.jqLhsTimeAxisStub=$(document.createElement("td")),this.jqLhsTimeAxisStub.addClass("chart-markup-table"),this.jqLhsTimeAxisStub.appendTo(this.jqRow),this.jqLhsStub=$("<div>"),this.jqLhsStub.css("width","100%"),this.jqLhsStub.css("height","100%"),this.jqLhsStub.css("position","relative"),this.jqLhsStub.css("overflow","hidden"),this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub),this.lhsCanvas=_(this.jqLhsStub,new f(16,16)),$(this.lhsCanvas).css("position","absolute"),$(this.lhsCanvas).css("z-order","2"),$(this.lhsCanvas).css("left",0),$(this.lhsCanvas).css("top",0),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("time-axis"),this.jqCell.height(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=_(this._dv,new f(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=_(this._dv,new f(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this.jqRhsTimeAxisStub=$(document.createElement("td")),this.jqRhsTimeAxisStub.addClass("chart-markup-table"),this.jqRhsTimeAxisStub.appendTo(this.jqRow),this.jqRhsStub=$("<div>"),this.jqRhsStub.css("width","100%"),this.jqRhsStub.css("height","100%"),this.jqRhsStub.css("position","relative"),this.jqRhsStub.css("overflow","hidden"),this.jqRhsStub.appendTo(this.jqRhsTimeAxisStub),this.rhsCanvas=_(this.jqRhsStub,new f(16,16)),$(this.rhsCanvas).css("position","absolute"),$(this.rhsCanvas).css("z-order","2"),$(this.rhsCanvas).css("left",0),$(this.rhsCanvas).css("top",0),this.rhsCtx=this.rhsCanvas.getContext("2d"),this.restoreDefaultCursor(),this.update(),this._minVisibleSpan=TradingView.MINUTE_SPAN,m(this.jqCell,this,!0),this.updatePriceScalesVisibility()}var n,s,r,a,l,h,c,d,p,u,_,f,m,g,v;i(320),n=i(302),s=i(82).LineDataSource,r=i(127),a=i(100),l=a.ActionSeparator,h=i(304),c=i(99),d=i(183),p=d.setCanvasSize,u=d.clearRect,_=d.addCanvasTo,f=d.Size,m=d.setMouseEventHandler,g=i(35).trackEvent,v=i(128).makeFont,o.prototype._BORDER_SIZE=1,o.prototype._OFFSET_SIZE=1,o.prototype._TICK_LENGTH=3,o.prototype.backgroundColor=function(){return this.chart.properties().paneProperties.background.value()},o.prototype.lineColor=function(){return this._properties.lineColor.value()},o.prototype.textColor=function(){return this._properties.textColor.value()},o.prototype.fontSize=function(){return this._properties.fontSize.value()},o.prototype.baseFont=function(){return v(this.fontSize(),"Arial","")},o.prototype.baseBoldFont=function(){return v(this.fontSize(),"Arial","bold")},o.prototype.rendererOptions=function(){var t,e;return this._rendererOptions||(this._rendererOptions={borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new r}),t=this._rendererOptions,t.fontSize!==this.fontSize()&&(e=this.fontSize(),t.fontSize=e,t.font=this.baseFont(),t.paddingTop=Math.ceil(Math.max(e/4.5-t.tickLength/2,0)),t.paddingBottom=Math.ceil(e/4.5),t.paddingHorizontal=Math.ceil(e/3),t.baselineOffset=Math.round(this.fontSize()/10),t.widthCache.reset()),this._rendererOptions},o.prototype.updatePriceScalesVisibility=function(){var t=this.chart.properties().scalesProperties;t.showLeftScale.value()?this.jqLhsTimeAxisStub.css("display","table-cell"):this.jqLhsTimeAxisStub.css("display","none"),t.showRightScale.value()?this.jqRhsTimeAxisStub.css("display","table-cell"):this.jqRhsTimeAxisStub.css("display","none")},o.prototype.mouseDownEvent=function(t){if(this._mousedown)return!0;this._mousedown=!0;var e=this.chart.model();e.timeScale().isEmpty()||(this.setCursor("ew-resize"),e.startScaleTime(t.localX))},o.prototype.mouseDownOutsideEvent=function(t){var e=this.chart.model();!e.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,e.endScaleTime(),this.restoreDefaultCursor())},o.prototype.pressedMouseMoveEvent=function(t){var e,i,o=this.chart.model();o.timeScale().isEmpty()||(e=!1,i=(new Date).valueOf(),this._lastScrollScaleTime&&i-this._lastScrollScaleTime<100&&(e=!0),e||(o.scaleTimeTo(t.localX),this._lastScrollScaleTime=i))},o.prototype.mouseUpEvent=function(t){this._mousedown=!1;var e=this.chart.model();e.timeScale().isEmpty()||(e.endScaleTime(),this.restoreDefaultCursor())},o.prototype.contextMenuEvent=function(t,i){!this._disableContextMenu&&e.enabled("scales_context_menu")&&this._createContextMenu().show(t)},o.prototype._createContextMenu=function(){return h.createMenu(this.getContextMenuActions())},o.prototype.getContextMenuActions=function(){var t,i,o=this.chart;return o.model().mainSeries().createSessStudy(),o.updateActions(),t=o.actions(),i=e.enabled("charting_library_base")?[t.timeScaleReset,new l,t.applyTimeZone]:[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks,t.extendedHours],e.enabled("timezone_menu")||i.splice(2,1),e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_timezone_sessions")&&i.push(new l,t.tmzProperties),i},o.prototype.mouseClickEvent=function(t){},o.prototype.mouseDoubleClickEvent=function(t){g("GUI","Double click time scale"),this.chart.model().resetTimeScale()},o.prototype.optimalHeight=function(){var t=this.rendererOptions();return Math.ceil(t.offsetSize+t.borderSize+t.tickLength+t.fontSize+t.paddingTop+t.paddingBottom)},o.prototype.setSize=function(t,e,i){this.size&&this.size.equals(t)||(this.lhsStubSize=e,p(this.lhsCanvas,e),this.jqLhsTimeAxisStub.width(e.w),this.jqLhsTimeAxisStub.height(e.h),this.rhsStubSize=i,p(this.rhsCanvas,i),this.jqRhsTimeAxisStub.width(i.w),this.jqRhsTimeAxisStub.height(i.h),this.size=t,p(this.canvas,t),p(this.top_canvas,t),this.lhsCanvas.getContext("2d"),this.rhsCanvas.getContext("2d"),this.canvas.getContext("2d"),this.top_canvas.getContext("2d"),this.jqCell.width(t.w),this.jqCell.height(t.h))},o.prototype._spanIndex=function(t){for(var e=[TradingView.MINUTE_SPAN,TradingView.HOUR_SPAN,TradingView.DAY_SPAN,TradingView.MONTH_SPAN,TradingView.YEAR_SPAN],i=e.length-1;i>0;){if(e[i]<=t)return i;i--}return i},o.prototype._spanOffset=function(t,e){if(e<t)throw Error("actual span cuold not be less then base");return this._spanIndex(e)-this._spanIndex(t)},o.prototype.update=function(){var t,e;this.chart.model()&&(t=this.chart.model().timeScale().marks())&&(e=this,this._minVisibleSpan=TradingView.YEAR_SPAN,$.each(t,function(){e._minVisibleSpan=Math.min(this.span,e._minVisibleSpan)}))},o.prototype._hightlightBackground=function(t,e){var i,o,n,s,r=this.chart.model(),a=r.timeScale(),l=e[0].index,h=e[0].index;for(i=1;i<e.length;i++)l=Math.min(l,e[i].index),h=Math.max(h,e[i].index);o=a.indexToCoordinate(l),n=a.indexToCoordinate(h),s="rgba(109, 158, 235, 0.3)",u(t,o,1,n-o,this.size.h-1,s)},o.prototype.drawBackground=function(t){var e,i,o,n,r;if(u(t,0,0,this.size.w,this.size.h,this.backgroundColor()),e=this.chart.model()){if(i=e.timeScale(),(o=e.model().selectedSource())&&o instanceof s&&!i.isEmpty()){if(n=o.axisPoints(),0===n.length)return;this._hightlightBackground(t,n)}r=e.model().crossHairSource(),r.startMeasurePoint()&&this._hightlightBackground(t,r.measurePoints())}},o.prototype.drawBorder=function(t){t.save(),t.fillStyle=this.lineColor(),t.fillRect(-.5,.5,this.size.w+.5,this._BORDER_SIZE),t.restore()},o.prototype.drawStubs=function(){var t,e=this._BORDER_SIZE,i=2*this._BORDER_SIZE,o=this.lhsCtx;u(o,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor()),o.fillStyle=this.lineColor(),o.fillRect(this.lhsStubSize.w-i-.5,.5,i,e),o.fillRect(this.lhsStubSize.w-i-.5,-.5,e,e),t=this.rhsCtx,u(t,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor()),t.fillStyle=this.lineColor(),t.fillRect(-.5,.5,i,e),t.fillRect(.5,-.5,e,e)},o.prototype.drawTickMarks=function(t){var e,i,o,n,s,r,a,l,h,c,d,p=this.chart.model().timeScale().marks();if(p&&0!==p.length){for(e=p.reduce(function(t,e){return t.span>e.span?t:e}).span,e>30&&e<40&&(e=30),t.save(),t.strokeStyle=this.lineColor(),i=this.rendererOptions(),o=i.borderSize+i.tickLength+i.paddingTop+i.fontSize-i.baselineOffset,t.textAlign="center",t.translate(.5,.5),t.fillStyle=this.lineColor(),t.beginPath(),n=p.length;n--;)t.rect(p[n].coord,i.borderSize,1,i.tickLength);for(t.fill(),t.fillStyle=this.textColor(),s={},r=this.baseFont(),a=this.baseBoldFont(),n=0;n<p.length;n++)l=p[n].span>=e?a:r,h=s[l]||[],h.push(p[n]),s[l]=h;for(c in s)for(t.setFont(c),d=s[c],n=0;n<d.length;n++)t.fillText(d[n].label,d[n].coord,o);t.restore()}},o.prototype.drawBackLabels=function(t){var e,i,o,n,s,r,a,l;for(t.save(),e=this.chart.model().dataSources(),i=this.chart.model(),o=i.sourceBeingMoved()||i.lineBeingEdited()||i.lineBeingCreated(),n=this.rendererOptions(),s=0;s<e.length;s++)if((r=e[s])!==this.chart.model().crossHairSource()&&r!==o&&r.timeAxisViews&&(a=r.timeAxisViews()))for(l=0;l<a.length;l++)a[l].renderer().draw(t,n);t.restore()},o.prototype.drawCrossHairLabel=function(t){var e,i,o,n,s;if(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),e=this.chart.model(),i=e.sourceBeingMoved()||e.lineBeingEdited()||e.lineBeingCreated(),o=this.rendererOptions(),i){if(t.save(),i.timeAxisViews&&(n=i.timeAxisViews()))for(s=0;s<n.length;s++)n[s].renderer().draw(t,o);return void t.restore()}if(t.save(),n=this.chart.model().crossHairSource().timeAxisView())for(s=0;s<n.length;s++)n[s].renderer().draw(t,o);t.restore()},o.prototype.paint=function(t){if(0!==t)if(t===c.UPDATE_CURSOR_ONLY)this.drawCrossHairLabel(this.top_ctx);else{var e=this.ctx;this.drawBackground(e),this.drawBorder(e),this.drawStubs(),this.chart.model()&&(this.drawTickMarks(e),this.drawBackLabels(e),this.drawCrossHairLabel(this.top_ctx))}},o.prototype.setStubVisible=function(t,e){var i=n.isLeft(t)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;e?i.css("display","table-cell"):i.css("display","none")},o.prototype.restoreDefaultCursor=function(){this.setCursor("")},o.prototype.setCursor=function(t){var e="";"grabbing-outside"!==t&&"ew-resize"!==t||(e="time-axis--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),e&&this.jqCell.addClass(e),this._currentCursorClassName=e)},o.prototype.image=function(){var t={};return t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t.lhsStub={},t.lhsStub.content=this.lhsCanvas.toDataURL(),t.lhsStub.contentWidth=this.lhsStubSize.w,t.lhsStub.contentHeight=this.lhsStubSize.h,t.rhsStub={},t.rhsStub.content=this.rhsCanvas.toDataURL(),t.rhsStub.contentWidth=this.rhsStubSize.w,t.rhsStub.contentHeight=this.rhsStubSize.h,t},t.exports=o}).call(e,i(1))},function(t,e){},function(t,e,i){(function(e){"use strict";function o(t){var e,i;o.visibilityProperty.value()||(e="NavigationButtons.visibility",o.visibilityProperty.subscribe(null,function(){var t=o.visibilityProperty.value();t!==TVSettings.getValue(e)&&TVSettings.setValue(e,t),n.subscribeOnEvents("visibleOnMouseOver"===t)}),i=TVSettings.getValue(e,Modernizr.touch?"alwaysOn":"visibleOnMouseOver"),o.visibilityProperty.setValue(i)),this._widgets=[],this._chart=t,o.visibilityProperty.subscribe(null,this._onVisibilityPropertyChanged.bind(this))}var n=i(322);o.visibilityProperty=new e,o.visibilityPropertyAvailableValues={visibleOnMouseOver:$.t("Visible on Mouse Over"),alwaysOn:$.t("Always Visible"),alwaysOff:$.t("Always Invisible")},o.prototype.addWidget=function(t){this._widgets.push(t.widget);var e=$.extend({callback:this._onMouseMove.bind(this)},t);n.addWidget(e),this._updateOpacityState([t.widget])},o.prototype._onVisibilityPropertyChanged=function(){this._updateOpacityState(this._widgets)},o.prototype._updateWidgetVisibility=function(t){t.css("visibility",t._state?"visible":"hidden")},o.prototype._updateOpacityState=function(t,e){void 0===e&&(e="alwaysOn"===o.visibilityProperty.value());var i=this;t.forEach(function(t){if(t._state!==e){t._state=e,t.css("visibility","visible");var o=e?1:0;if(t.css("opacity")===o)return void i._updateWidgetVisibility(t);t.animate({opacity:o},i._updateWidgetVisibility.bind(i,t))}})},o.prototype._onMouseMove=function(t,e){this._chart.model().lineBeingCreated()||this._updateOpacityState([t],!e)},t.exports=o}).call(e,i(83))},function(t,e){"use strict";function i(){this._widgets=[],this._mouseMoveEventType=Modernizr.touch?"touchmove":"mousemove",this._omMouseMoveHandler=this._onMouseUnderWidget.bind(this),this._subscribed=!1,this.subscribeOnEvents(!0)}i.prototype.subscribeOnEvents=function(t){this._subscribed!==t&&(this._subscribed=t,t?document.addEventListener(this._mouseMoveEventType,this._omMouseMoveHandler,!1):document.removeEventListener(this._mouseMoveEventType,this._omMouseMoveHandler,!1))},i.prototype.addWidget=function(t){this._widgets.push(t)},i.prototype._onMouseUnderWidget=function(t){t.buttons||this._widgets.forEach(function(e){var i=e.checkingWidget||e.widget,o=i.get(0).getBoundingClientRect(),n=t.clientX-o.left,s=t.clientY-o.top,r=o.right-o.left,a=o.bottom-o.top,l=n<-e.acceptableOffset||s<-e.acceptableOffset||n>r+e.acceptableOffset||s>a+e.acceptableOffset;e.callback(e.widget,l)})},t.exports=new i},function(t,e,i){(function(e){"use strict";function o(t,e,i){this._chart=t,this._parent=e,this.zoom_active=!1,this._real=i,this._state="stop",this.init(),i&&this.initToRealChart(),this.initHandlers(),t.navigationButtonsController().addWidget({widget:this._widget,acceptableOffset:100})}var n=i(99);o.visibilityProperty=new e,o.prototype.init=function(){this._widget=$('<div class="control-bar-wrapper">').appendTo(this._parent),$('<div class="control-bar">').append($(i(324)).attr("class","move-left-button-control-bar")).append($(i(325)).attr("class","zoom-out-right-button-control-bar").css("fill","#8A8B8D")).append($(i(326)).attr("class","turn-button-control-bar")).append($(i(327)).attr("class","zoom-in-button-control-bar").css("fill","#8A8B8D")).append($(i(328)).attr("class","move-right-button-control-bar")).appendTo(this._widget),this._buttons={zoomIn:this._widget.find(".zoom-in-button-control-bar"),zoomOut:this._widget.find(".zoom-out-right-button-control-bar"),moveLeft:this._widget.find(".move-left-button-control-bar"),moveRight:this._widget.find(".move-right-button-control-bar"),turn:this._widget.find(".turn-button-control-bar")}},o.prototype.initToRealChart=function(){var t,e=this;this._back=$(i(329)).attr({class:"back-to-present js-hidden"}).appendTo(this._parent),this._backButtonVisible=!1,this._back.on("click",function(){e._chart.model().timeScale().scrollToRealtime(!0),e._chart.model().model()._invalidateHandler(new n(n.FULL_UPDATE))}),t=function(){var t=e._chart.maxRhsPriceAxisWidth+4;t&&e._back.css("marginRight",t)},this._chart.rhsPriceAxisWidthChanged.subscribe(this,t),t(),this._chart.withModel(this,function(){this._chart.model().model().setInterval(function(){e.check()},1e3)})},o.prototype.check=function(){var t=this._chart.model(),e=!!t&&t.timeScale().rightOffset()<0;e!==this._backButtonVisible&&(this._backButtonVisible=e,this._backButtonVisible?this._back.attr("class","back-to-present"):this._back.attr("class","back-to-present js-hidden"))},o.prototype._move=function(t){var e,i;"stop"===this._state&&this._chart.model().beginUndoMacro(1===t?"Move Left":"Move Right"),this._state="moving",this._moveType="animated",this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0),this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0),this._startTime=+new Date,this._movingTimeout||(e=this._startTime,i=10,this._movingTimeout=setTimeout(function o(){this._moveStep.call(this,e,0,50*t,1e3),this._movingTimeout=setTimeout(o.bind(this),i)}.bind(this),i))},o.prototype._moveStep=function(t,e,i,o){var n,s,r;if(!this._chart.model().timeScale().isEmpty())return n=+new Date,s=1-(Math.max(0,t+o-n)/o||0),s<1&&(r=jQuery.easing.easeOutCubic(null,o*s,0,1,o),this.currentDistance=(i-e)*r+e),this._chart.model().scrollChart(this.currentDistance),s},o.prototype._finishMove=function(t){var e,i;clearTimeout(this._movingTimeout),this._movingTimeout=0,this._deferredFinishTimeout=0,e=this.currentDistance,i=+new Date,this._finishingTimeout=setTimeout(function t(){this._moveStep.call(this,i,e,0,700)<1?this._finishingTimeout=setTimeout(t.bind(this),10):(this._state="stop",this._moveType="",this._movingTimeout=0,this.currentDistance=0,this._chart.model().endUndoMacro())}.bind(this),10)},o.prototype._stopMove=function(t){"moving"===this._state&&(this._state="wait_finishing",(new Date).getTime()-this._startTime<200?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-((new Date).getTime()-this._startTime)):this._finishMove())},o.prototype._moveByBar=function(t){var e,i,o,n,s=this._chart.model().timeScale();s.isEmpty()||("stop"===this._state&&this._chart.model().beginUndoMacro(1===t?"Move Left":"Move Right"),e=s.indexToCoordinate(s.visibleBars().lastBar())+s.barSpacing()/2,Math.abs(s.width()-e)>s.barSpacing()/6&&this._chart.model().scrollChart(s.width()-e),this._state="moving",this._moveType="by_bar",this._startTime=+new Date,this._movingTimeout||(i=400,o=150,n=0,this._movingTimeout=setTimeout(function e(){this._moveByBarStep(t),n++,o>100&&(o-=n/5*20),this._movingTimeout=setTimeout(e.bind(this),o)}.bind(this),i),this._moveByBarStep(t)))},o.prototype._moveByBarStep=function(t){this._chart.model().timeScale().isEmpty()||this._chart.model().scrollChartByBar(t)},o.prototype._stopMoveByBar=function(t){"moving"===this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state="stop",this._moveType="",this._movingTimeout=0,this.currentDistance=0,this._chart.model().endUndoMacro())},o.prototype.initHandlers=function(){var t,e=this._chart,i=Modernizr.touch?"touchstart":"mousedown",o=Modernizr.touch?"touchend":"mouseup mouseout";this._buttons.moveLeft.on(i,this._moveByBar.bind(this,1)),this._buttons.moveLeft.on(o,this._stopMoveByBar.bind(this,1)),this._buttons.moveRight.on(i,this._moveByBar.bind(this,-1)),this._buttons.moveRight.on(o,this._stopMoveByBar.bind(this,-1)),this._buttons.turn.on("click",function(){e.GUIResetScales()}),this._buttons.zoomOut.on("click",function(){e.model()&&e.model().zoomOut()}),this._buttons.zoomIn.on("click",function(){e.model()&&e.model().zoomIn()}),t={},$("body").on("keydown",function(e){if(!$(e.target).closest("input, textarea").length&&!(e.metaKey||e.which in t))switch(t[e.which]=!0,e.which){case 37:e.ctrlKey||e.altKey?this._move(1):this._moveByBar(1),e.preventDefault();break;case 39:e.ctrlKey||e.altKey?this._move(-1):this._moveByBar(-1),e.preventDefault()}}.bind(this)).on("keyup",function(e){if(!$(e.target).closest("input, textarea").length)switch(delete t[e.which],e.which){case 37:case 39:"by_bar"===this._moveType?this._stopMoveByBar():this._stopMove()}}.bind(this))},t.exports=o}).call(e,i(83))},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-80 -25 140 140"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 12L-.7.7-41 43.2l.1.1-.1.1L-.7 85.9l10-10.6-29.7-31.2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120"><path fill-rule="evenodd" clip-rule="evenodd" d="M28 50h65v17H28z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-58 -18 120 120"><path fill="#8A8B8D" fill-rule="evenodd" clip-rule="evenodd" d="M31 13C23.4 5.3 12.8.5 1.1.5c-23.3 0-42.3 19-42.3 42.5s18.9 42.5 42.3 42.5c13.8 0 26-6.6 33.7-16.9l-16.5-1.8C13.5 70.4 7.5 72.5 1 72.5c-16.2 0-29.3-13.2-29.3-29.4S-15.2 13.7 1 13.7c8.1 0 15.4 3.3 20.7 8.6l-10.9 11h32.5V.5L31 13z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140"><path fill-rule="evenodd" clip-rule="evenodd" d="M112 60H78V26H61v34H27v17h34v34h17V77h34z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-90 -55 140 140"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 12l-40.3-42.5-10 10.6 29.7 31.2L-41 43.4l10.7 11.3L10 12.2l-.1-.1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.8 13.4" enable-background="new 0 0 14.8 13.4"><path d="M8 6.7L1.7 0 .1 1.7l4.7 4.9-4.8 5 1.7 1.8L8 6.7zm6.8 0L8.4 0 6.8 1.7l4.7 4.9-4.8 5 1.7 1.8 6.4-6.7z"/></svg>'},function(t,e,i){(function(e){"use strict";function o(t){var i,o,r,a,h,c=this,d=this._chartWidget=t.chartWidget;this.$parent=t.parent,this._dateRangesPopupList=[],this._goToPopupBtn=[],this._iterativeHide=[],this._timeFormatter=new n,this._currentRange=window.urlParams&&window.urlParams.range||"",this._$seriesControls=$(document.createElement("div")).attr("class","chart-controls-bar-buttons chart-series-controls").appendTo(t.parent),this._$timezoneButton=$('<a class="apply-common-tooltip" title="'+$.t("Timezone")+'"><span class="chart-controls-clock"></span><span class="chart-controls-tz"></span></a>'),e.enabled("fundamental_widget")||this._$timezoneButton.appendTo(this._$seriesControls),!d.onWidget()&&e.enabled("timezone_menu")?l(c._$timezoneButton,function(){var t,e,i,o,n;if(d.updateActions(),t=[],!(e=d.actions())||!e.applyTimeZone||!e.applyTimeZone.subActions)return t;for(i=e.applyTimeZone.subActions,o=0;o<i.length;++o)n=i[o],t.push({action:n.enabled?n.executeCallback.bind(n):null,addClass:n.enabled?"":"special",disabled:!n.enabled,iconClass:n.checkable&&n.checked?"checked-icon":"unchecked-icon",title:n.text});return t},{direction:"up",addClass:"context-menu"}):this._$timezoneButton.addClass("disabled"),this._$timezoneClock=this._$timezoneButton.find(".chart-controls-clock"),this._$timezoneName=this._$timezoneButton.find(".chart-controls-tz"),d.onWidget()||e.enabled("charting_library_base")?this._$extendedHoursButton=null:(this._$extendedHoursButton=$(document.createElement("a")).text($.t("ext")).attr("title",$.t("The Extended Trading Hours feature is available only for intraday charts")).addClass("apply-common-tooltip").appendTo(this._$seriesControls),this._iterativeHide.push(this._$extendedHoursButton)),this._$percButton=$(document.createElement("a")).text("%").attr("title",$.t("Toggle Percentage")).addClass("apply-common-tooltip").appendTo(this._$seriesControls),e.enabled("fundamental_widget")&&(this._$percButton.css("display","inline-block"),urlParams.percentage&&this._$percButton.addClass("active")),this._iterativeHide.push(this._$percButton),this._$logButton=$(document.createElement("a")).text($.t("log")).attr("title",$.t("Toggle Log Scale")).addClass("apply-common-tooltip"),e.enabled("fundamental_widget")||this._$logButton.appendTo(this._$seriesControls),this._iterativeHide.push(this._$logButton),this._$autoScaleButton=$(document.createElement("a")).text($.t("auto",{context:"scale"})).attr("title",$.t("Toggle Auto Scale")).addClass("apply-common-tooltip"),e.enabled("fundamental_widget")||this._$autoScaleButton.appendTo(this._$seriesControls),this._iterativeHide.push(this._$autoScaleButton),i=null,e.enabled("main_series_scale_menu")&&!e.enabled("fundamental_widget")&&(i=$(document.createElement("a")).attr("title",$.t("Scales Properties")).addClass("apply-common-tooltip").appendTo(this._$seriesControls)),this._$fullscreenChartButton=$(document.createElement("a")).attr("title",$.t("Toggle Maximize Chart")).addClass("apply-common-tooltip").appendTo(this._$seriesControls),this._iterativeHide.push(this._$timezoneButton),o="http://www.w3.org/2000/svg",r=$(document.createElementNS(o,"svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"}),$(document.createElementNS(o,"desc")).text("SP").appendTo(r),$(document.createElementNS(o,"path")).attr({d:"M 11.896733,5.4401 C 11.201602,5.2497118 10.287185,5.3844905 9.8529668,4.6739798 9.3680407,3.9899631 9.7713075,3.1150758 10.335646,2.6255445 10.81759,2.1397596 10.086625,1.2464141 9.5348331,1.5679918 9.0096065,2.0197899 8.3586515,2.5915907 7.6081884,2.2860159 6.8487054,2.0572252 6.6657258,1.2214292 6.6611579,0.52971682 6.6904416,-0.14270317 5.5547878,-0.19920111 5.3509206,0.33932112 5.3495604,1.0614071 5.216111,1.980668 4.4411277,2.2733721 3.718985,2.58432 3.0421913,2.0835985 2.5447076,1.6132218 2.019086,1.2075468 1.1733117,2.0525503 1.6258135,2.5522279 2.1291674,3.0522349 2.6067846,3.7947509 2.23627,4.5142319 1.9382627,5.2487851 1.0997484,5.3013165 0.42629601,5.3591295 -0.18586111,5.4121559 -0.1726988,6.614951 0.4382476,6.6606553 1.1701866,6.6354301 2.0901088,6.8653212 2.3114865,7.6677973 2.5690397,8.4182506 1.9757702,9.0009969 1.5707544,9.5375753 1.260194,10.111116 2.1887088,10.863746 2.6392394,10.30714 3.1282414,9.7691412 3.9518015,9.3917137 4.6315605,9.8249999 5.3287279,10.186762 5.2619381,11.018963 5.3869987,11.672161 5.5440075,12.215504 6.7794125,12.12358 6.6535582,11.446999 6.6654072,10.746236 6.9028479,9.8947057 7.6677558,9.6885901 8.4182253,9.4312024 9.000933,10.024446 9.5375381,10.429439 10.111007,10.739871 10.863873,9.8114259 10.307197,9.360908 9.7691358,8.8719351 9.3913098,8.0483184 9.8250144,7.3685614 10.18688,6.6714752 11.018948,6.7380091 11.672226,6.6131264 12.162952,6.4957229 11.998177,5.7860369 11.896733,5.4401 z M 5.999918,8.8061 C 4.4052236,8.8574703 3.0094365,7.3092614 3.2012542,5.7303585 3.3197775,4.2414555 4.7798203,3.0282413 6.2655218,3.2004993 7.7296227,3.3187202 8.9364572,4.7279379 8.805387,6.1941362 8.7186344,7.6148699 7.4347334,8.84471 5.999918,8.8061 z"}).appendTo(r),i&&i.append(r),a=$(document.createElementNS(o,"svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"}),a.get(0).setAttribute("viewBox","0 0 24 24"),$(document.createElementNS(o,"desc")).text("FS").appendTo(a),$(document.createElementNS(o,"path")).attr({d:"M0 0v9l3.5-3.5 4.5 4.5h2v-2l-4.5-4.5 3.5-3.5h-9zm15 0l3.5 3.5-4.5 4.5v2h2l4.5-4.5 3.5 3.5v-9h-9zm-7 14l-4.5 4.5-3.5-3.5v9h9l-3.5-3.5 4.5-4.5v-2h-2zm6 0v2l4.5 4.5-3.5 3.5h9v-9l-3.5 3.5-4.5-4.5h-2z"}).appendTo(a),this._$fullscreenChartButton.append(a),this._$percButton.on("click",function(t){var e,i,o,n;t.preventDefault(),e=d.model(),i=e.mainSeries(),o=i.priceScale(),n=o.properties(),i.properties().lockScale.value()||(e.beginUndoMacro($.t("Toggle Percentage")),n.log.value()&&e.setLogProperty(n.log,!1,o,$.t("Toggle Log Scale")),e.setPercentProperty(n.percentage,!n.percentage.value(),o,$.t("Toggle Percentage")),e.endUndoMacro())}),this._$logButton.on("click",function(t){var e,i,o,n;t.preventDefault(),e=d.model(),i=e.mainSeries(),o=i.priceScale(),n=o.properties(),i.properties().lockScale.value()||(e.beginUndoMacro($.t("Toggle Log Scale")),n.percentage.value()&&e.setPercentProperty(n.percentage,!1,o,$.t("Toggle Percentage")),e.setLogProperty(n.log,!n.log.value(),o,$.t("Toggle Log Scale")),e.endUndoMacro())}),this._$autoScaleButton.on("click",function(t){var e,i,o,n;t.preventDefault(),e=d.model(),i=e.mainSeries(),o=i.priceScale(),n=o.properties(),e.beginUndoMacro($.t("Toggle Auto Scale")),n.autoScale.value()&&n.percentage.value()&&e.setPercentProperty(n.percentage,!1,o,$.t("Toggle Percentage")),e.setAutoScaleProperty(n.autoScale,!n.autoScale.value(),o,$.t("Toggle Auto Scale")),e.endUndoMacro()}),i&&l(i,function(){var t,e,i,o,n,r,a,l=d.paneWidgets();for(t=0;t<l.length;++t)if(e=l[t],e.containsMainSeries()){if(i=[],!(o=e.getDefaultPriceAxisWidget()))return i;for(n=o.getContextMenuActions(),r=0;r<n.length;++r)a=n[r],a instanceof s?i.push({separator:!0}):i.push({action:a.enabled?a.executeCallback.bind(a):null,addClass:a.enabled?"":"special",disabled:!a.enabled,iconClass:a.checkable&&a.checked?"checked-icon":"unchecked-icon",title:a.text});return i}return[]},{direction:"up",addClass:"context-menu",reverse:!0}),this._$extendedHoursButton&&this._$extendedHoursButton.on("click",function(t){var e,i;t.preventDefault(),e=d.model(),i=e.mainSeries().properties().extendedHours,e.setProperty(i,!i.value(),"Extended Hours")}),this._$dateRangesWrap=$(document.createElement("div")).addClass("chart-controls-bar-buttons date-range-wrapper").appendTo(t.parent),this._$dateRangesBtn=$(document.createElement("a")).addClass("date-range-btn").text($.t("Date Range")).appendTo(this._$dateRangesWrap),this._$dateRanges=$(document.createElement("div")).addClass("date-range-list").appendTo(this._$dateRangesWrap),d.withModel(null,function(){var t=d.model(),i=t.mainSeries(),o=i.priceScale();this.updateScaleButtons(),i.priceScaleChanged.subscribe(this,this.updateScaleButtons),o.properties().autoScale.subscribe(this,this.updateScaleButtons),this.updateDateRangeButtons(),i.onStatusChanged().subscribe(this,this.updateDateRangeButtons),e.enabled("update_timeframes_set_on_symbol_resolve")&&i.onSymbolResolved().subscribe(this,this.updateDateRangeButtons),i.properties().lockScale.subscribe(this,this.updateDateRangeButtons),this.updateExtendedHoursButton(),i.properties().extendedHours.subscribe(this,this.updateExtendedHoursButton),i.properties().interval.subscribe(this,this.updateExtendedHoursButton),t.model().mainSeries().onSymbolResolved().subscribe(null,this.updateTimezonesButton.bind(this)),t.model().properties().timezone.subscribe(null,this.updateTimezonesButton.bind(this))}.bind(this)),this.updateFullscreenChartButton(),h=this._chartWidget._chartWidgetCollection,h&&(h.layout.subscribe(this.updateFullscreenChartButton.bind(this)),h.maximizeCurrentChart.subscribe(this.updateFullscreenChartButton.bind(this)),this._$fullscreenChartButton.on("click",function(){h.activeChartWidget.setValue(d),h.maximizeCurrentChart.setValue(!h.maximizeCurrentChart.value())}),this.checkTimezonesButton(h.activeChartWidget.value()),h.activeChartWidget.subscribe(this.checkTimezonesButton.bind(this))),d.onScroll().subscribe(this,function(){this._currentRange&&(this._$dateRanges.find(".date-range-preset-btn").removeClass("active"),this._currentRange=null)})}var n=i(94).TimeFormatter,s=i(100).ActionSeparator,r=i(136).parseTzOffset,a=i(183),l=a.bindPopupMenu,h=a.unbindPopupMenu;o.prototype.updateScaleButtons=function(){var t=this._chartWidget.model().mainSeries(),e=t.priceScale().properties(),i=e.log.value(),o=e.percentage.value(),n=e.autoScale.value();this._$logButton.toggleClass("active",i),this._$percButton.toggleClass("active",o),this._$autoScaleButton.toggleClass("active",n)},o.prototype.updateDateRangeButtons=function(){var t,e,i,o,n,s,r=this._chartWidget,a=r.model().mainSeries().status();if(a!==TradingView.Series.STATUS_LOADING&&a!==TradingView.Series.STATUS_RESOLVING){if(t=r._dateRangeResolutions(),e=function(t,e){this._$dateRanges.find(".date-range-preset-btn").removeClass("active"),e.addClass("active"),this._currentRange=e.data("value"),r.model().loadRange(t)},this._dateRangesPopupList=[],t.length)for(this._$dateRanges.empty(),i=0;i<t.length;i++)o=t[i],n=$(document.createElement("a")).text(o.text).attr("title",o.description||o.text).addClass("date-range-preset-btn apply-common-tooltip").data("value",o.value),o.value===this._currentRange&&n.addClass("active"),s=e.bind(this,{val:o.value,res:o.targetResolution},n),n.appendTo(this._$dateRanges).click(s),this._dateRangesPopupList.push({title:o.description||o.text,action:s});this.updateTimeframePopupMenu()}},o.prototype.updateTimeframePopupMenu=function(){this._$dateRangesBtn.toggleClass("i-hidden",!(this._dateRangesPopupList.length||this._goToPopupBtn.length)),h(this._$dateRangesBtn),l(this._$dateRangesBtn,this._dateRangesPopupList.concat(this._goToPopupBtn),{direction:"up",addClass:"date-range-popupmenu"}),this.resizeUI()},o.prototype.updateTimezonesButton=function(){var t,e,i;null!==this._chartWidget.model().mainSeries().symbolInfo()&&(t=this._chartWidget.model().model().timezone(),"exchange"===t&&(e=this._chartWidget.model().mainSeries().symbolInfo().timezone)&&(t=e),i=r(t),this.tzOffset=i.offset,this._$timezoneName.text("("+i.string+")"),this.tickClock(),this.resizeUI())},o.prototype.checkTimezonesButton=function(t){this._$timezoneButton.toggleClass("i-invisible",t!==this._chartWidget),this.resizeUI()},o.prototype.tickClock=function(){void 0!==this.tzOffset&&this._$timezoneClock.text(this._timeFormatter.format(new Date(Date.now()+this.tzOffset+1e3*ChartApiInstance.serverTimeOffset())))},o.prototype.updateExtendedHoursButton=function(){if(this._$extendedHoursButton){this._chartWidget.model().mainSeries().properties().extendedHours.value()?this._$extendedHoursButton.addClass("active"):this._$extendedHoursButton.removeClass("active"),this.resizeUI()}},o.prototype.updateFullscreenChartButton=function(){var t=this._chartWidget._chartWidgetCollection;if(!t||"s"===t.layout.value())return void this._$fullscreenChartButton.addClass("i-hidden");this._$fullscreenChartButton.removeClass("i-hidden"),this._$fullscreenChartButton.toggleClass("active",t.maximizeCurrentChart.value()),this.resizeUI()},o.prototype.updateUI=function(){this.updateScaleButtons(),this.resizeUI()},o.prototype.resizeUI=function(){var t,e,i,o,n,s,r;if(this._$seriesControls&&this._$dateRanges){for(this.$parent.addClass("i-measure"),t=this.$parent.width(),e=this._$dateRanges.width(),i=this._$dateRangesBtn.outerWidth(),o=0,this._$seriesControls.find("a").each(function(){var t=$(this);t.hasClass("i-hidden")||(o+=t.outerWidth())}),n=o,s=0;s<this._iterativeHide.length;s++)this._iterativeHide[s].hasClass("i-hidden")||(r=this._iterativeHide[s].outerWidth(),this._iterativeHide[s].toggleClass("i-compact",t-i<n),n-=r);this._$dateRangesWrap.toggleClass("i-compact",e>t-o),this.$parent.removeClass("i-measure")}},t.exports=o}).call(e,i(1))},function(t,e,i){(function(e,o,n){"use strict";function s(t,i){function o(t,o,s){var r,a,l,h,c,d,p,u,_,f,m,g=[];if(s.openEveryDay)g=[0,1,2,3,4,5,6];else if(s.openOnDays)for(r=s.openOnDays,a=0;a<r.length;a++)g.push(parseInt(r[a])-1);else g=[1,2,3,4,5];for(l=function(t){return 60*parseInt(t[0],10)+parseInt(t[1],10)},h=l(t),c=l(o),d=h&&h>=c,d&&0!==g[0]&&g.unshift(0),p="",u=[],_=g[0]-1,f=g.length,a=0;a<f;a++)_+1<g[a]||a+1===f?(p+=n+e.weekdaysMin(g[a]),u.push(p),p=""):p||(p=e.weekdaysMin(g[a])),_=g[a];return m="{0}:{1}{2}{3}:{4}".format(t[0],t[1],n,o[0],o[1]),u.map(function(t){return t+i+m})}var n,s,r,a,l;return i=i||" ",n="-",t?"24x7"===t?o(["00","00"],["00","00"],{openEveryDay:!0}):(s=/([0-2]\d)([0-5]\d)-([0-2]\d)([0-5]\d)(?:\:(\d+))?/,(r=s.exec(t))?(a=[r[1],r[2]],l=[r[3],r[4]],o(a,l,{openOnDays:r[5]})):{}):{}}function r(t,e){var i,r,c,d,p,u,_,f,m,g,v,y,b,w,S;if(null==t&&(t=a.symbol.value()),null!=t)return t+="",i=e&&e.symbolInfo,r=$.t("Symbol Info"),c=TVDialogs.createDialog(r,{width:450}),d=c.find("._tv-dialog-content"),p=$(document.createElement("div")).addClass("main").addClass("symbol-info-dialog").appendTo(d),u=function(t){var e,i=l;for(e=0;e<i.length;e++)if(i[e].id===t)return i[e].title;return t},_=function(t){return s(t).join("<br/>")},f=[{title:$.t("Symbol Name"),propName:o.enabled("charting_library_base")?"name":"pro_name"},{title:$.t("Symbol Description"),propName:"description"},{title:$.t("Symbol Type"),propName:"type"},{title:$.t("Point Value"),propName:"pointvalue"},{title:$.t("Exchange"),propName:"exchange"},{title:$.t("Listed Exchange"),propName:"listed_exchange"},{title:$.t("Currency"),propName:"currency_code",formatter:function(t){return t||"USD"},defValue:"USD"},{title:$.t("Price Scale"),propName:"pricescale"},{title:$.t("Min Move"),propName:"minmov"},{title:$.t("Min Move 2"),propName:"minmove2"},{title:$.t("Sector"),propName:"sector"},{title:$.t("Industry"),propName:"industry"},{title:$.t("Timezone"),propName:"timezone",formatter:u,optional:!0},{title:$.t("Session"),propName:"session",formatter:_,optional:!0,setHtml:!0}],m='<table cellspacing=0>{{#fields}}<tr{{#optional}} class="js-optional"{{/optional}}><td class="symbol-info-column"><span class="js-symbol-info-title symbol-info-text">{{title}}</span></td><td class="symbol-info-value"><span class="js-symbol-info-value symbol-info-text">{{#defValue}}{{defValue}}{{/defValue}}{{^defValue}}-{{/defValue}}</span></td></tr>{{/fields}}</table>',g=$(n.render(m,{fields:f})).appendTo(p),g.find(".js-symbol-info-title").each(function(t,e){f[t].$title=$(e)}),g.find(".js-symbol-info-value").each(function(t,e){f[t].$element=$(e)}),v=function(t){return t||"-"},y=0,b=function(t){var e,i,o,n;for(e=0;e<f.length;e++)(i=f[e].propName)in t&&(o=t[i],"minmove2"===i&&t.minmove2>0&&!t.fractional&&t.pricescale?(o=new h(t.pricescale/o).format(o/t.pricescale),f[e].$title.text($.t("Pip Size"))):o=(f[e].formatter||v)(o),f[e].setHtml?f[e].$element.html(o):f[e].$element.text(o),f.splice(e,1),e--);(n=t.type&&"economic"===t.type||t.listed_exchange&&["QUANDL","BSE_EOD","NSE_EOD","LSE_EOD"].indexOf(t.listed_exchange)>=0)&&g.find(".js-optional").remove()},i&&b(i),y<f.length&&window.quoteSessionMultiplexerInstance&&(w="symbolinfodialog."+TradingView.guid(),quoteSessionMultiplexerInstance.full.subscribe(w,t,function(e,i){b(i.values),quoteSessionMultiplexerInstance.full.unsubscribe(w,t)})),S=$(document.createElement("div")).addClass("dialog-buttons").appendTo(p),$(document.createElement("a")).addClass("_tv-button").addClass("cancel").text($.t("Close",{context:"input"})).appendTo(S).click(function(){TVDialogs.destroy(c.data("title"))}),TVDialogs.positionDialog(c),TVDialogs.applyHandlers(c),c}var a=i(278),l=i(135).availableTimezones,h=i(94).PriceFormatter;t.exports=r}).call(e,i(7),i(1),i(52))},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,s,r,a,l,h;Object.defineProperty(e,"__esModule",{value:!0}),n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(333),r=i(344),a=i(348),i(352),l=null,h=function(){function t(e){o(this,t),this._chartWidgetCollection=e,this._$symbolSearchPopup=null,this._dialog=null,this._compareTab=new s.CompareTab(this._chartWidgetCollection,this),this._addSymbolTab=new r.AddSymbolTab(this._chartWidgetCollection,this)}return n(t,[{key:"show",value:function(){var t,e=this,i=[];return i.push({name:$.t("Compare"),page:this._compareTab.$tab.addClass("tv-compare-dialog__tab-page")}),i.push({name:$.t("Add Symbol"),page:this._addSymbolTab.$tab.addClass("tv-compare-dialog__tab-page")}),t=(0,a.createTabbedDialog)({tabs:i,width:400,tabStateSaveKey:"CompareAddDialog.tab",destroyOnClose:!0,withScroll:!1,addClass:"tv-compare-dialog",tabsScrollBoxAddClass:"tv-compare-dialog__scroll-box",tabAddClass:"tv-compare-dialog__tab",isClickOutFn:function(t){if(e._compareTab.isClickOnTab(t)||e._addSymbolTab.isClickOnTab(t))return!1}}),l&&l.close(),this._dialog=t.dialog,this._dialog.open(),l=this._dialog,this._dialog}},{key:"getZIndex",value:function(){return this._dialog.zIndex}}]),t}(),e.AddCompareDialog=h},function(t,e,i){(function(t,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,a,l,h,c,d,p,u;Object.defineProperty(e,"__esModule",{value:!0}),r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(334),l=n(a),h=i(35),i(340),i(341),i(342),c='\n\t<div class="tv-compare-tab">\n\t\t<input type="text" class="tv-control-input js-compare-tab-input" placeholder="'+$.t("Company Comparison")+'" autocomplete="off">\n\t</div>',d='<div class="tv-compare-tab__predefines js-compare-tab-predefines"></div>',p='\n\t<div class="tv-compare-tab__predefine-cell">\n\t\t<label for="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox">\n\t\t\t\t<input class="tv-control-checkbox__input js-predefine-checkbox" type="checkbox" id="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox__box tv-compare-tab__checkbox-box">'+i(343)+'</span>\n\t\t\t<span class="tv-control-checkbox__ripple js-ripple"></span>\n\t\t\t</span>\n\t\t\t<span class="tv-control-checkbox__label tv-compare-tab__checkbox-label">{{label}}</span>\n\t\t</label>\n\t</div>',u=function(){function e(t,i){s(this,e),this._chartWidgetCollection=t,this._dialog=i,this._$popup=null,this._predefines={},this._symbolAlias={},this.init()}return r(e,[{key:"addCompareSymbol",value:function(t,e,i){var o,n,s,r,a,l,c=this._chartWidgetCollection.activeChartWidget.value();if(c&&(o=c.model())){for(n=o.mainSeries().interval(),s=o.studiesMetaData(),r=void 0,a=0;a<s.length;a++)"Compare@tv-basicstudies"===s[a].id&&(r=s[a]);return l={exchange:i,inputs:{symbol:t,resolution:n}},(0,h.trackEvent)("GUI","Add Compare"),o.insertStudy(r,l)}}},{key:"removeCompareSymbol",value:function(t){var e,i=this,o=this._chartWidgetCollection.activeChartWidget.value();o&&(e=o.model())&&e.dataSources().forEach(function(o){if(o._metaInfo&&"Compare@tv-basicstudies"===o._metaInfo.id){var n=o.properties().inputs.symbol.value();(n===t||i._symbolAlias[n]&&i._symbolAlias[n]===t)&&e.removeSource(o)}})}},{key:"init",value:function(){var e,i,o=this,n=this._chartWidgetCollection.activeChartWidget.value();n&&(e=n.model())&&(i=e.dataSources(),this.$tab=$(c),this._initSymbolSearch(),t.enabled("charting_library_base")||function(){o._createPredefinesList();var t=o.$tab.find(".js-compare-tab-predefines");t.find(".js-predefine-checkbox").attr("checked",!1),Object.keys(o._predefines).forEach(function(e){var n=o._symbolToId(e),s=t.find("#"+n);i.forEach(function(t){if(t._metaInfo&&"Compare@tv-basicstudies"===t._metaInfo.id){var i=t.properties().inputs.symbol.value();(i===e||o._symbolAlias[i]&&o._symbolAlias[i]===e)&&s.attr("checked",!0)}})})}())}},{key:"_initSymbolSearch",value:function(){var t=this;this._$input=this.$tab.find(".js-compare-tab-input"),l.default.bindToInput(this._$input,{callback:function(e){return t.addCompareSymbol(e)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"_createPredefinesList",value:function(){function t(t){var e=this;setTimeout(function(){if($(e).is(":checked")){i.addCompareSymbol(t.data.symbol)||$(e).attr("checked",!1)}else i.removeCompareSymbol(t.data.symbol)})}var e=this,i=this,n=$(d);Object.keys(this._predefines).forEach(function(i){var s=$(o.render(p,{symbolId:e._symbolToId(i),label:e._predefines[i]}));s.find(".js-predefine-checkbox").change({symbol:i},t),s.appendTo(n)}),n.appendTo(this.$tab)}},{key:"_symbolToId",value:function(t){return t.replace(/[^a-z0-9]/gi,"_")}},{key:"focus",value:function(){Modernizr.touch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),e}(),e.CompareTab=u}).call(e,i(1),i(52))},function(t,e,i){(function(e){"use strict";var o=i(335),n=i(278),s=i(336),r=i(337),a=i(338).unifiedSpinner,l=i(63),h=i(37).regExpEscape,c=function(){function t(i){var o,n,s,r;if(!(this instanceof t))throw new TypeError("SymbolSearch is a constructor");if(i=i||{},o=!i.dontUseInputParser&&e.enabled("symbol_search_parser_mixin")&&t.canShowSpreadActions(),this._inputParserMixin=o?new SymbolSearchInputParserMixin(this):void 0,this._inputElement=$(i.input).get(0),!this._inputElement)throw new TypeError("options.input must be a DOM element, jQuery object or selector");if(this.$list=$(i.list).eq(0),0===this.$list.size()&&delete this.$list,void 0!==i.callback){if("function"!=typeof i.callback)throw new TypeError("options.callback must be function");this._callback=i.callback}if(void 0!==i.onValueChanged){if("function"!=typeof i.onValueChanged)throw new TypeError("options.onValueChanged must be function");this._onValueChanged=i.onValueChanged}if(void 0!==i.onEmptyApply){if("function"!=typeof i.onEmptyApply)throw new TypeError("options.onEmptyApply must be function");this._onEmptyApply=i.onEmptyApply}if(i.ignoreInterval&&(this._ignoreInterval=!0),t.resetStoredInterval(),i.hidePro&&(this._hidePro=!0),i.allowMultipleSymbols&&(this._allowMultipleSymbols=!0),void 0!==i.onParse){if("function"!=typeof i.onParse)throw new TypeError("options.onParse must be function");this._onParse=i.onParse}for(this._state={},this.acceptEmpty=!!i.acceptEmpty,$(this._inputElement).data("symbol-search-instance",this),n=this._boundListener=this._eventListener.bind(this),s=this.boundTimeoutListener=function(t){setTimeout(function(){n(t)},0)},r=0;r<f.length;r++)f[r].immediate?$(this._inputElement).on(f[r].name,n):$(this._inputElement).on(f[r].name,s);this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnKeyPress=this._onKeyPress.bind(this),$(this._inputElement).on("keydown",this._boundOnKeyDown).on("keypress",this._boundOnKeyPress),this._eventListener(),i.autoFocus&&t.registerAutoFocus(this)}function c(t,e){var i=ChartApiInstance.supportedSymbolsTypes(),o=TVSettings.getValue("symboledit.filter");return!i.some(function(t){return t.value===o})&&i.length>0&&(o=i[0].value),0!==i.length&&(i.forEach(function(i){var n=i.value,s=$('<a class="type-filter">').attr("href","#"+n).text($.t(i.name));n===o&&s.addClass("active"),s.on("click",function(i){i.preventDefault(),e.find(".type-filter").removeClass("active"),$(this).addClass("active"),t.typeFilter(n),TVSettings.setValue("symboledit.filter",n)}),s.appendTo(e)}),t.typeFilter(o),!0)}function d(t,i){var o,n,r,a=ChartApiInstance.supportedExchangesList();if(a=s.displayedExchangesFilter(a),a=s.sortExchangesListByFlagIfNeeded(a),o=TVSettings.getValue("symboledit.exchangefilter"),"bovespa"!==TradingView.widgetCustomer)return!a.some(function(t){return t.value===o})&&a.length>0&&(o=a[0].value),0!==a.length&&(n=$('<div id="exchange-filter" class="exchange-filter">').appendTo(i),r=$("<select>").appendTo(n),a.forEach(function(t){var e=t.value,i=t.name||e,n=t.desc||i,s=$("<option>").addClass("filter-item").attr("value",e).text($.t(i)).data("custom-option-text",$.t(n)).appendTo(r);t.value===o&&s.attr("selected",!0)}),r.change(function(){var e=$(this).val()||"";TVSettings.setValue("symboledit.exchangefilter",e),t.setExchangeFilter(e)}),r.selectbox({speed:0,useCustomPrependWithSelector:"after",customPrependSelectorClass:"exchange-with-flag",classHolder:"tv-unstyled-select-container tv-symbol-select",classOptions:e.enabled("symbol_search_three_columns_exchanges")?"sbOptions three-column-filter":"sbOptions"}),t.setExchangeFilter(o),!0)}function p(t){var e=d(t,t.$filterContainer);return t.selectExchangeFilter(),e}function u(t){var e,i,o,n,s,r,a,l,h,d,u=$('<div class="symbol-edit-popup">').appendTo(document.body),_=$('<div class="filter">').appendTo(u);return t.$filterContainer=_,c(t,_),p(t,_),e=$('<div class="table-wrapper">').appendTo(u),i=$(t._inputElement),o=i.offset(),n=0,s=Math.max(0,Math.min(o.left+n,$(window).width()-u.outerWidth())),u.css("left",s+"px"),u.css("top",o.top+i.outerHeight()+1),r=parseInt($(window).height(),10),a=_.outerHeight(),l=$(window).scrollTop(),h=i.height(),d=r-(o.top-l)-h/2,e.css("maxHeight",d-h-a+"px"),{popup:u,listWrapper:e}}function _(t){return!t.ctrlKey&&(!t.metaKey&&(!!t.charCode&&(!(!t.which||t.which<=32)&&(!/^(input|textarea)$/i.test(t.target.tagName)&&!TVDialogs.modalDialog))))}var f=[{name:"input",immediate:!0},{name:"sync",immediate:!0},{name:"keypress"},{name:"keydown"},{name:"keyup"},{name:"mousedown"},{name:"mouseup"},{name:"cut"},{name:"paste"}],m=[/^e\-m/i];return t.registerAutoFocus=function(e){if(e instanceof jQuery&&(e=e.data("symbol-search-instance")),!(e instanceof t))throw new TypeError("arg must be an SymbolSearch instance of jQuery input with bound SymbolSearch object");r.registerListener("symbolEdit",function(t){if(_(t)){t.preventDefault(),this.resetState(),this._skipAutoFocus=!0,this._inputElement.focus();var e=String.fromCharCode(t.charCode);"function"==typeof this._setInputValue?this._setInputValue(e):this._inputElement.value=e,this._eventListener()}}.bind(e))},t.prototype.serachRequestDelay=0,t.setSearchRequestDelay=function(e){t.prototype.serachRequestDelay=e},t.prototype.resetState=function(){this._state={}},t.prototype.typeFilter=function(t){if(!(arguments.length>0))return this._state.typeFilter;t!==this._state.typeFilter&&(null==t?delete this._state.typeFilter:this._state.typeFilter=t+"",delete this._state.keepListFor,this._onSelectionChanged(),this.selectExchangeFilter())},t.prototype.setExchangeFilter=function(t){t!==this._state.exchangeFilter&&(null==t?delete this._state.exchangeFilter:this._state.exchangeFilter=t+"",delete this._state.keepListFor,this._onSelectionChanged())},t.prototype.getExchangeFilter=function(){return this._state.exchangeFilter},t.prototype._moveSelection=function(t,e){var i,o,n,s,r,a,l,h;this.$list&&(i=this.$list.find("table.symbol-edit-popup"),o=i.find("tr:not(.hidden)"),n=i.find("tr.symbol-edit-popup-active"),s=-1,n.size()?(s=o.index(n),r=Math.max(0,Math.min(s+t,o.size()-1))):r=0,s!==r&&(a=o.get(r))&&(l=this._getItemByElement(a),n.length&&n.removeClass("symbol-edit-popup-active"),l?(this._selectedGroupRoot=void 0,this._highlightItem(l,!0,e)):(h=a.getAttribute("data-root"))&&(this._state.highlightedItem=null,$(a).addClass("symbol-edit-popup-active"),this._selectedGroupRoot=h,this._scrollHighlightIntoView())))},t.prototype._groupSetCollapsed=function(t,e){this._groupListHandler&&this._groupListHandler.setCollapsed(t,e)},t.prototype._onKeyDown=function(t){40!==t.keyCode&&38!==t.keyCode||(this._moveSelection(40===t.keyCode?1:-1,!0),t.preventDefault()),!this._selectedGroupRoot||37!==t.keyCode&&39!==t.keyCode||(this._groupSetCollapsed(this._selectedGroupRoot,37===t.keyCode),t.preventDefault())},t.prototype._onKeyPress=function(t){if(40===t.keyCode||38===t.keyCode){if(t.charCode)return;if(this._boundOnKeyDown)return $(this._inputElement).off("keydown",this._boundOnKeyDown),delete this._boundOnKeyDown,void t.preventDefault();this._moveSelection(40===t.keyCode?1:-1),t.preventDefault()}13===t.keyCode&&(this._selectedGroupRoot?(this._groupSetCollapsed(this._selectedGroupRoot,!1),t.preventDefault()):this.acceptTypeIn())},t.prototype._eventListener=function(t,e){var i,o,n,s=this._inputElement,r=this._getInputValue().toUpperCase(),a=!1,l=!1;this._state.value!==r&&(ChartApiInstance._symbolSearchRequest&&ChartApiInstance._symbolSearchRequest.abort(),this._state.hasOwnProperty("value")&&this._onValueChanged&&this._onValueChanged(r),this._state.value=r,a=!0,this._inputParserMixin&&this._inputParserMixin.parse()),this._fixIntervalCase(),i=this._limitInputSelectionValue("selectionStart"),this._state.selectionStart!==i&&(this._state.selectionStart=i,l=!0),o=this._limitInputSelectionValue("selectionEnd"),this._state.selectionEnd!==o&&(this._state.selectionEnd=o,l=!0),this._state.selectionDirection!==s.selectionDirection&&(this._state.selectionDirection=s.selectionDirection,l=!0),(a||l&&this._inputParserMixin)&&(this._onSelectionChanged(void 0,e),n=!1,this._getInputValue()!==this._state.value&&(this._setInputValue(this._state.value),n=!0),(n||this._state.selectionStart!==this._limitInputSelectionValue("selectionStart")||this._state.selectionEnd!==this._limitInputSelectionValue("selectionEnd"))&&s.setSelectionRange&&s.setSelectionRange(this._state.selectionStart,this._state.selectionEnd,this._state.selectionDirection))},t.prototype._fixIntervalCase=function(){if(this._selectionInsideInterval()){var e=t.detachInterval(this._inputElement.value);/[a-z]/.test(e.detached)&&(this._inputElement.value=e.rest+e.detached.toUpperCase())}},t.prototype._selectionInsideInterval=function(e){if(this._ignoreInterval)return!1;var i=t.detachInterval(this._inputElement.value);return!!i&&("string"==typeof e?this._inputElement[e]>i.rest.length:this._inputElement.selectionStart>i.rest.length&&this._inputElement.selectionEnd>i.rest.length)},t.prototype._limitInputSelectionValue=function(e){return this._selectionInsideInterval(e)?t.detachInterval(this._inputElement.value).rest.length:e in this._inputElement?this._inputElement[e]:this._inputElement.value.length},t.prototype._getInputValue=function(){if(this._ignoreInterval)return this._inputElement.value;var e=t.detachStoreInterval(this._inputElement.value);return $(this._inputElement).toggleClass("interval-error",t.intervalError()),e},t.prototype._setInputValue=function(e){this._ignoreInterval?this._inputElement.value=e:this._inputElement.value=t.recallAttachInterval(e)},t.prototype._onSelectionChanged=function(t,e){function i(t,e,i,o){n._state.contextTicker=t,n._state.contextExchange=e,n._state.contextType=i,n._state.keepListFor&&n._state.keepListFor===o||(n._getSuggestList(),delete n._state.keepListFor)}var o,n=this;!m.some(function(t){return t.test(n._state.value)})&&this._inputParserMixin&&e!==!0?this._inputParserMixin.onSelectionChanged(i):this.$list&&(o=this._state.value,i(o,this.getExchangeFilter(),this._state.typeFilter,this._state._selectedTicker||o))},t.prototype._clearSelectionState=function(){delete this._state.contextTicker,delete this._state.contextExchange,delete this._state.contextType,delete this._state.contextToken,delete this._state.keepListFor},t.prototype._clearSearchTimeout=function(){this._searchTimeout&&(clearTimeout(this._searchTimeout),this._searchTimeout=null)},t.prototype._doGetSuggestList=function(){var e,i,o,n;this._clearSearchTimeout(),e=this._state.contextTicker||"",i=this._state.contextExchange||this.getExchangeFilter()||"",o=this._state.typeFilter||"",this._showLoading(),n=this,ChartApiInstance.searchSymbols(e,i,o,"undefined"!=typeof chartWidget?chartWidget:void 0,function(s){e!==(n._state.contextTicker||"")||i!==(n._state.contextExchange||n.getExchangeFilter()||"")||o!==(n._state.typeFilter||"")||(o===t.QUANDL&&(s=n._processQuandlResponse(s)),n._renderSuggestList(s),n._onResponse(s))})},t.prototype._getSuggestList=function(){this._clearSearchTimeout(),this._searchTimeout=setTimeout(this._doGetSuggestList.bind(this),t.prototype.serachRequestDelay)},t.prototype._showLoading=function(){if(this.$list){this._clearSuggestList();var t=$('<div class="symbol-search-loading">').appendTo(this.$list);this._spinner=a("mini").spin(t.get(0))}},t.prototype._filterResponse=function(t){var e,i,o,n;if("undefined"==typeof fxcmCFDHelper)return t;for(e=[],i=0;i<t.length;i++)o=t[i],n=o.ticker||o.full_name,(window.initData&&window.initData.fxcm_cfd||!fxcmCFDHelper.isFXCMCFD(n))&&e.push(o);return e},t.prototype._renderSuggestList=function(i){var o,n,s,r,a,l,c,d,p,u,_,f,m,g,v,y,b;if(this.$list){if(o=this,n=this._state,this._clearSuggestList(),s=h(n.contextTicker).trim(),r=RegExp(s.replace(" ","|"),"i"+(s.length>1?"g":"")),delete n.highlightedItem,this._hidePro&&(i=i.filter(function(t){return!t.params||t.params.indexOf("pro")===-1})),i=this._filterResponse(i),this._renderedResponse=i,0===i.length)return void this.$list.html('<div style="text-align: center; padding: 7px 0; font-style: italic;">'+$.t("No symbols matched your criteria")+"</div>");for(a=document.createElement("table"),a.setAttribute("class","symbol-edit-popup"),l=new t.GroupListHandler(a,r),c={},d=null,p=0;p<i.length;p++){switch(u=i[p],u.ticker||(u.ticker=u.full_name),_=document.createElement("tr"),_.setAttribute("class","symbol-edit-popup"),f=document.createElement("td"),f.setAttribute("class","symbol-edit-popup-td name apply-overflow-tooltip"),f.innerHTML=u.symbol.replace(r,"<strong>$&</strong>"),m=document.createElement("td"),m.setAttribute("class","symbol-edit-popup-td desc apply-overflow-tooltip"),m.innerHTML=r.test(u.symbol)?u.description:u.description.replace(r,"<strong>$&</strong>"),g=document.createElement("td"),g.setAttribute("class","symbol-edit-popup-td type apply-overflow-tooltip"),v="",u.params&&~u.params.indexOf("eod")&&(v='<i class="eod">eod</i>&nbsp;'),u.type in c||(c[u.type]=$.t(u.type)),u.type){case"index":v+=c[u.type];break;default:v+=u.exchange?u.exchange.startsWith("CHXEUR_")?c[u.type]+" - "+u.exchange.split("_")[0]:c[u.type]+" - "+u.exchange:c[u.type]}g.innerHTML=v,y=document.createElement("td"),y.setAttribute("class","symbol-edit-popup-td flag apply-overflow-tooltip"),y.innerHTML=o._getItemFlag(u),b=y.getElementsByTagName("svg")[0],b&&b.setAttribute("class","flag"),_.appendChild(f),_.appendChild(m),_.appendChild(g),_.appendChild(y),l.append(u,_),u._trElement=_,_.setAttribute("data-item-index",p),d||u.ticker!==n.contextTicker||u.exchange!==n.contextExchange||(d=u)}e.enabled("expand_symbolsearch_items")||l.collapse(),this._groupListHandler=l,d&&this._highlightItem(u),$(a).on("click","tr",function(t){if(!t.isDefaultPrevented()){t.preventDefault();var e=o._getItemByElement(this);e&&e.full_name&&o.accept(e.full_name,e.ticker)}}).appendTo(this.$list)}},t.prototype._getItemByElement=function(t){if(!this._renderedResponse)return null;var e=t.getAttribute("data-item-index");return this._renderedResponse[e]},t.prototype._highlightItem=function(t,e,i){var o=this._state;o.highlightedItem!==t&&(o.highlightedItem&&$(o.highlightedItem._trElement).removeClass("symbol-edit-popup-active"),o.highlightedItem=t,$(t._trElement).addClass("symbol-edit-popup-active"),this._scrollHighlightIntoView(),e&&this._replaceCurrentSymbol(i))},t.prototype._scrollHighlightIntoView=function(){var t=this.$list.find("tr.symbol-edit-popup-active");t.length&&(t.offset().top<this.$list.offset().top?this.$list.scrollTop(this.$list.scrollTop()-(this.$list.offset().top-t.offset().top)):t.offset().top+t.outerHeight()>this.$list.offset().top+this.$list.outerHeight()&&this.$list.scrollTop(this.$list.scrollTop()+(t.offset().top+t.outerHeight()-(this.$list.offset().top+this.$list.outerHeight()))))},t.prototype._clearSuggestList=function(){this._renderedResponse=null,this._spinner&&(this._spinner.stop(),delete this._spinner),this.$list&&this.$list.empty()},t.prototype._showErrorNotice=function(){this.$list&&(this._clearSuggestList(),this.$list.text("Invalid expression"))},t.prototype._getItemFlag=function(t){return""},t.prototype._replaceCurrentSymbol=function(t){var e,i,o,n,s=this._state;if(s.highlightedItem){if(e=s.highlightedItem,i="",o=0,this._inputParserMixin&&t!==!0){if(n=this._inputParserMixin.replaceCurrentSymbol(e),!n.ok)return;i=n.newValue,o=n.newCaretPos,s.keepListFor=n.keepListFor}else i=t===!0&&e.full_name&&this._inputParserMixin?e.full_name:e.symbol,o=i.length,this._state._selectedTicker=s.keepListFor=e.ticker||e.symbol;this._setInputValue(i),this._inputElement.setSelectionRange?this._inputElement.setSelectionRange(o,o):this._inputElement.select(),this._eventListener(void 0,t)}},t.prototype.splitAndAcceptUserInput=function(){var t,e=this._getInputValue().split(",");for(t=0;t<e.length;t++)this.acceptSymbolIn(e[t])},t.prototype.acceptSymbolIn=function(t){var e,i;this._inputParserMixin?e=this._inputParserMixin.parseSymbol(t):(e=t,i=this._state._selectedTicker||t),this.accept(e,i)},t.prototype.acceptTypeIn=function(){this._allowMultipleSymbols?this.splitAndAcceptUserInput():this.acceptSymbolIn(this._getInputValue())},t.prototype.accept=function(e,i){if((i=i||e)||""===i&&this.acceptEmpty){delete this._state.keepListFor;var o=this._ignoreInterval?void 0:t.getInterval(!0);this._inputElement.value=e,this._eventListener(),this._callback&&this._callback(i,o),$(this._inputElement).trigger("accept-symbol",[i])}},t.prototype.bindListWrapper=function(t){if(t=$(t).eq(0),0===t.size())throw new TypeError("element must be a DOM element, jQuery object or selector");this.$list=t,this._clearSelectionState(),this._eventListener()},t.prototype.removeListWrapper=function(){delete this.$list,this._clearSuggestList(),this._clearSelectionState(),this._eventListener()},t.prototype.selectExchangeFilter=function(){this.$filterContainer.find(".exchange-filter").hide(),this._state.typeFilter===t.QUANDL?this.$filterContainer.find("#quandl-filter").show():this._state.typeFilter!==t.ECONOMIC&&this.$filterContainer.find("#exchange-filter").show()},t.prototype._onResponse=function(e){if(e.length>0){this._state.typeFilter===t.QUANDL&&this._showNotification()}},t.prototype._showNotification=function(){var t,e,i;TVSettings.getBool("symboledit.show_quandl_notification",!0)&&(t=$.t("Quandl is a huge financial database that we have connected to TradingView. Most of its data is EOD and is not updated in real-time, however the information may be extremely useful for fundamental analysis.")+' <a target="_blank" href="'+("ru"===window.language?"http://blog.tradingview.com/?p=1530&lang=ru":"http://blog.tradingview.com/?p=1530")+'">'+$.t("Read our blog for more info!")+"</a>",e=$('<div class="symbol-edit-notification">').prependTo(this.$list),e.html(t),e.find("a").click(function(t){t.preventDefault();var e=$(this).attr("href");window.open(e,"_blank")}),i=$('<a class="close">').appendTo(e),i.click(function(){TVSettings.setValue("symboledit.show_quandl_notification",!1),e.remove()}))},t.prototype._processQuandlResponse=function(t){return t.datasets.filter(function(t){return!t.premium}).map(function(t){return{description:t.name,exchange:t.database_code,full_name:"QUANDL:"+t.database_code+"/"+t.dataset_code,params:["eod"],symbol:t.dataset_code,type:"quandl"}})},t.showDialog=function(e){var o,n,s,r,a,l,h,d,u,_,f,m,g=i(72);if(e=e||{},o="Symbol Search",!TVDialogs.get(o))return n=TVDialogs.createDialog(o,{hideTitle:!0,hideCloseCross:!0,dragHandle:".filter",width:"750px",dragOptions:{cancel:".sbOptions"},content:g.dialogs.symbolSearch}),TVDialogs.positionDialog(n),s=n.find("._tv-dialog-content").addClass("symbol-search-dialog"),r=s.find(".results"),r.mousewheel(function(t,e){var i=$(this);e>0?i.scrollTop(i.scrollTop()-15):i.scrollTop(i.scrollTop()+15)}),a=s.find("input").get(0),e.initialValue&&(a.value=e.initialValue),"selectionStart"in a&&(a.selectionStart=a.selectionEnd=a.value.length),a.focus(),this.canShowSpreadActions()&&(e.ignoreInterval||(h=t.getInputValueGetter(a),d=t.getInputValueSetter(a)),l=SymbolSearchInputParserMixin.addSpreadActions(s.find(".spread-actions"),a,h,d)),u=new t({input:a,list:s.find(".results").get(0),callback:function(t,i){e.callback&&e.callback(t,i),TVDialogs.destroy(o)},onParse:l,ignoreInterval:e.ignoreInterval}),_=s.find(".filter"),u.$filterContainer=_,f=c(u,_),m=p(u,_),f||m||_.attr("style","display: none"),TVDialogs.resizeContent(n.height(),r),TVDialogs.applyHandlers(n),TVDialogs.positionDialog(n),n.on("destroy",function(){TVSettings.setValue("symboledit.dialog_last_entry",a.value)}),n},t.bindToInput=function(i,o){function s(){f&&(b.removeListWrapper(),f.off(),f.remove(),f=null,l.hide(),"function"==typeof o.onPopupClose&&o.onPopupClose())}function r(t){t.preventDefault()}function a(){var t,i,n,s;if(f||(t=u(b),f=t.popup,b.bindListWrapper(t.listWrapper),f.on("focus",r),f.on("click",r),f.on("mousedown",r),f.on("focus","*",r),f.on("click","*",r),f.on("mousedown","*",r),"function"==typeof o.onPopupOpen&&o.onPopupOpen(t.popup)),e.enabled("charting_library_base")&&(i=this._state,i.keepListFor)){if(!i.highlightedItem)return void delete this._state.keepListFor;n=i.highlightedItem,s=this._getInputValue().toUpperCase(),n.symbol!==s&&delete this._state.keepListFor}}function h(e,i){var o;return i?(RegExp("^"+t.QUANDL,"i").test(e)?(o=e.split(/\//),o.length&&(e=o[o.length-1])):e=n.seriesShortSymbol.value()||e,e):e}function c(t){var e=n.symbol.value()||"";e=h(e,t),i.val(e),b.resetState()}var d,p,_,f,m,g,v,y,b,w,S;return o=o||{},i=$(i).eq(0),d=o.callback,p=null,_=null,f=null,g=o.spreadActions&&$(o.spreadActions).eq(0),g&&g.size()&&this.canShowSpreadActions()&&(o.ignoreInterval||(v=t.getInputValueGetter(i.get(0)),y=t.getInputValueSetter(i.get(0))),m=SymbolSearchInputParserMixin.addSpreadActions(g,i.get(0),v,y)),b=new t({input:i,onValueChanged:a,callback:function(t,e){s(),"function"==typeof _&&_(t,e)||("function"==typeof d&&d(t,e),"function"==typeof p&&p(t,e)),o.clearAfterAccept&&i.val(""),o.keepFocus?i.get(0).focus():i.get(0).blur(),b.resetState()},hidePro:o.hidePro,autoFocus:o.autoFocus,onEmptyApply:o.onEmptyApply,onParse:m,acceptEmpty:o.acceptEmpty,dontUseInputParser:o.dontUseInputParser,allowMultipleSymbols:o.allowMultipleSymbols,ignoreInterval:o.ignoreInterval}),w=!1,i.on("focus",function(t,e){w=!0,b._skipAutoFocus?delete b._skipAutoFocus:setTimeout(function(){w&&i.get(0).select()},0)}),i.on("blur",function(t){var e,o,n;if(f&&(e=document.activeElement,o=f.is(e),n=f.has(e).length>0,(navigator.userAgent.indexOf("Trident")!==-1||navigator.userAgent.indexOf("MSIE")!==-1)&&(o||n)))return t.preventDefault(),t.stopImmediatePropagation(),void setTimeout(function(){i.focus()},0);w=!1,setTimeout(function(){w||s()},0)}),o.syncWithChartWidget&&(c(!0),n.seriesShortSymbol.subscribe(function(){c(!0)}),p=function(t,e){t&&n.symbol.setValue(t),e&&n.interval.setValue(e)},_=function(t,e){return!e&&(t===n.symbol.value()||(t===n.seriesShortSymbol.value()||void 0))},S=function(){i.get(0).blur(),c(!1)},i.on("keypress",function(t){27===t.keyCode&&S()}),i.on("keydown",function(t){27===t.keyCode&&S()})),b},t.GroupListHandler=function(t,e){this._container=t,this._tickerRegExp=e,this._roots={}},t.GroupListHandler.prototype.addRoot=function(t,e,i,o){var n,s,r;this._currentTbody=null,n=document.createElement("tbody"),this._container.appendChild(n),s=this,r=$(o).clone().addClass("group-title").click(function(e){e.preventDefault(),r.hasClass("collapsed")?s.expand(t):s.collapse(t)}),r.find("td.name").html("<div>"+e.replace(this._tickerRegExp,"<strong>$&</strong>")+"</div>"),r.find("td.type").html(i.type+(i.exchange&&" - "+i.exchange||"")),r.attr("data-root",t),r.appendTo(n),this._roots[t]={titleRow:r,tbody:n}},t.GroupListHandler.prototype.append=function(t,e){var i,o,n,s=null;if("futures"===t.type&&(i=ChartApiInstance.futuresRegex(),s=i.exec(t.symbol+"")),!s)return this._currentTbody||(this._currentTbody=document.createElement("tbody"),this._container.appendChild(this._currentTbody)),void this._currentTbody.appendChild(e);o=s[1],n=(t.exchange||"unknown")+"_"+o,this._roots[n]||this.addRoot(n,o,t,e),this._roots[n].tbody.appendChild(e)},t.GroupListHandler.prototype.setCollapsed=function(t,e){var i;if(t)(i=this._roots[t])&&(i.titleRow.toggleClass("collapsed",!!e),$(i.tbody).find("tr:not(.group-title)").toggleClass("hidden",!!e));else for(t in this._roots)this.setCollapsed(t,e)},t.GroupListHandler.prototype.collapse=function(t){this.setCollapsed(t,!0)},t.GroupListHandler.prototype.expand=function(t){this.setCollapsed(t,!1)},t.isIntervalInit=function(t){return/[\d,]/.test(t)&&e.enabled("show_interval_dialog_on_key_press")},t.isIntervalChar=function(t){return e.enabled("seconds_resolution")?/[\dhdwms]/i.test(t):/[\dhdwm]/i.test(t)},t.parseIntervalValue=function(t){var e=/^[,\s]*(\d*)\s*([hdwms]?)\s*$/i.exec(t)||[],i=~~e[1],o=e[2]&&e[2].toUpperCase(),n={qty:!i&&o?1:i,unit:o||null};return n.error=!i&&!o,n.intraday=!(n.error||n.unit&&"H"!==n.unit),n},t.sanitizeIntervalValue=function(e){var i=t.parseIntervalValue(e),o=i.qty,n=i.unit;return i.error?null:("H"===n&&(o*=60,n=null),o&&!n?o+"":n&&(!o||1===o&&"S"!==n)?n:o+n)},t.detachInterval=function(t){var e=/,[^,]*$/i.exec(t)||[];if(e[0])return{rest:t.substr(0,t.length-e[0].length),detached:e[0]}},t.intervalIsSupported=function(i){var s,r,a;return e.enabled("allow_supported_resolutions_set_only")?null!==(s=this.sanitizeIntervalValue(i))&&o.isAvailable(s):(r=t.parseIntervalValue(i),!r.error&&(r.intraday?n.intraday.value():!(a=n.supportedResolutions.value())||!!~a.indexOf(r.unit)))},function(){var e="",i=null;t.resetStoredInterval=function(){e="",i=null},t.detachStoreInterval=function(o){var n=t.detachInterval(o);return n?(e=n.detached,i=t.sanitizeIntervalValue(e),n.rest):(t.resetStoredInterval(),o)},t.recallAttachInterval=function(t){return t+e},t.getInterval=function(e){var o=i;return e===!0&&t.resetStoredInterval(),o},t.getInputValueGetter=function(e){return function(){return t.detachStoreInterval(e.value)}},t.getInputValueSetter=function(e){return function(i){e.value=t.recallAttachInterval(i)}},t.intervalError=function(){return!(!e||/^,\s*$/.test(e))&&!i}}(),t.registerDialogKeypressHandler=function(o){if(!o)throw new TypeError("chartWidget is required");r.pushBackListener("symbolEdit",function(o){var s,r=i(339);if(_(o))if(o.preventDefault(),s=String.fromCharCode(o.charCode),t.isIntervalInit(s))new r({callback:function(t){n.interval.setValue(t)}}).show(s);else{if(!e.enabled("symbol_search_hot_key"))return;t.showDialog({initialValue:s,callback:function(t,e){n.symbol.setValue(t),e&&n.interval.setValue(e)}})}})},t.canShowSpreadActions=function(){return"undefined"!=typeof SymbolSearchInputParserMixin&&"cme"!==TradingView.widgetCustomer&&"bovespa"!==TradingView.widgetCustomer},t.QUANDL="quandl",t.ECONOMIC="economic",t.QUANDL_API_KEY="qehT7XPzZvLj-wmBB7Gk",t}();t.exports=c}).call(e,i(1))},function(t,e,i){"use strict";function o(){}var n=i(93),s=i(278);o.isAvailable=function(t){var e,i=s.supportedResolutions.value(),o=!1;return o=void 0===i||i.indexOf(t)!==-1,e=s.intraday.value(),e?o:n.isDWM(t)&&o},t.exports=o},function(t,e,i){"use strict";var o=i(1);t.exports.displayedExchangesFilter=function(t){return o.enabled("symbol_search_limited_exchanges")&&(t=t.filter(function(t){return!("bitcoin"===t.flag||t.hideInSymbolSearch)})),t},t.exports.sortExchangesListByFlagIfNeeded=function(t){return t}},function(t,e){"use strict";function i(t){for(var e=0;e<r.length;e++)if(r[e].name===t)return e}function o(t,e){var o={name:t,func:e},n=i(o.name);n?r[n]=o:r.push(o)}function n(t){r.forEach(function(e,i){e.name===t&&r.splice(i,1)})}function s(t,e){var o={name:t,func:e},n=i(o.name);n&&r.splice(n,1),r.unshift(o)}Object.defineProperty(e,"__esModule",{value:!0}),e.registerListener=o,e.removeListener=n,e.pushBackListener=s;var r=[];$(window).on("keypress",function(t){for(var e=r.length-1;e>=0&&r[e].func(t)!==!0;e--);})},function(t,e,i){"use strict";function o(t,e){var i,o={className:"spinner",color:"#00A2E2",corners:1,direction:1,fps:20,hwaccel:!1,left:"50%",length:0,lines:17,opacity:.3,radius:20,rotate:0,shadow:!1,speed:1.5,top:"50%",trail:60,width:3,zIndex:2e9},r=t?s[t]:null;return r&&(o=$.extend(o,r)),i=$.extend({},o,e),new n(i)}var n,s;i(61),n=i(59),s={medium:{lines:14,radius:16,width:3},micro:{lines:12,radius:4,width:2},mini:{lines:14,radius:8,width:2}},e.unifiedSpinner=o},function(t,e,i){"use strict";function o(t){this._options=t||{},this._setInput(),this._caption=$('<i class="interval-caption">').html("&nbsp;"),this._helpTooltipTrigger=$('<i class="help-tooltip-trigger apply-common-tooltip common-tooltip-below">').text("?").attr("title",$.t("interval_dialog_description")),this._dialogTitle=$.t("Change Interval")}var n=i(278),s=i(334);o.prototype._setInput=function(){this._input=$('<input type="text" class="change-interval-input" autocomplete="off" maxlength="4">'),this._input.on("keypress",this._handleInput.bind(this)).on("input",function(){this._validate(),this._updateCaption()}.bind(this)).on("blur",function(){setTimeout(this._submit.bind(this),0)}.bind(this))},o.prototype._validate=function(){var t=this._input.val();this._parsed=s.parseIntervalValue(t),this._valid=!this._parsed.error,this._supported=!this._parsed.error&&s.intervalIsSupported(t),!this._supported||this._parsed.unit&&"H"!==this._parsed.unit||this._parsed.qty*("H"===this._parsed.unit?60:1)>1440&&(this._supported=!1)},o.prototype._updateCaption=function(){var t,e,i;this._valid&&this._supported?(e=this._parsed.qty||1,i=this._parsed.unit?{H:"hour",D:"day",W:"week",M:"month",S:"second"}[this._parsed.unit]:"minute",t=e+" "+$.t(i,{count:e}),this._input.add(this._caption).removeClass("error")):(t=this._parsed.error?"&nbsp;":$.t("Not applicable"),this._input.add(this._caption).addClass("error")),this._caption.html(t)},o.prototype._handleInput=function(t){if(13===t.which)return void this._submit();t.ctrlKey||t.metaKey||!t.charCode||!t.which||t.which<=32||s.isIntervalChar(String.fromCharCode(t.charCode))||t.preventDefault()},o.prototype._submit=function(){var t,e;TVDialogs.isOpen(this._dialogTitle)&&(this._valid&&this._supported&&(t=s.sanitizeIntervalValue(this._input.val()),e=n.interval.value(),t&&e!==t&&"function"==typeof this._options.callback&&this._options.callback(t)),TVDialogs.destroy(this._dialogTitle))},o.prototype._setInitialValue=function(t){var e,i;t=t||this._options.initialValue,e="",i=!1,t&&","!==t?e=s.sanitizeIntervalValue(t)||"":(t=n.interval.value(),e=t,i=!0),this._input.val(e),i&&this._input.select()},o.prototype.isValid=function(){return!!this._valid},o.prototype.show=function(t){var e=TVDialogs.createDialog(this._dialogTitle,{hideCloseCross:!0,addClass:"change-interval-dialog"}),i=e.find("._tv-dialog-content");return e.css("min-width",0),i.css("min-width",0).mousedown(function(t){this._input.is(t.target)||t.preventDefault()}.bind(this)).append(this._input.add(this._caption).add(this._helpTooltipTrigger)),TVDialogs.applyHandlers(e),TVDialogs.positionDialog(e),this._setInitialValue(t),this._validate(),this._updateCaption(),e},t.exports=o},function(t,e){},function(t,e){},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 9" width="11px" height="9px"><path fill="none" fill-rule="evenodd" stroke-width="2" d="M1 3.22l3.415 3.496L10 1"/></svg>'},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s,r,a,l,h,c;Object.defineProperty(e,"__esModule",{value:!0}),s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(334),a=o(r),l=i(345),i(340),i(347),h='\n\t<div class="tv-add-symbol-tab">\n\t\t<input type="text" class="tv-control-input js-add-symbol-tab-input" placeholder="'+$.t("Symbol")+'" autocomplete="off">\n\t\t<div class="tv-add-symbol-tab__add-symbol-overlay js-add-symbol-tab-checkbox"></div>\n\t</div>',c=function(){function t(e,i){n(this,t),this._chartWidgetCollection=e,this._dialog=i,this._$popup=null,this.init()}return s(t,[{key:"init",value:function(){var t=this;this.$tab=$(h),this._$input=this.$tab.find(".js-add-symbol-tab-input"),this._checkbox=new l.AddSymbolCheckbox({labelRight:$.t("Overlay the main chart"),labelAddClass:"tv-add-symbol-tab__checkbox-label",boxAddClass:"tv-add-symbol-tab__checkbox-box"}),this.$tab.find(".js-add-symbol-tab-checkbox").append(this._checkbox.$el),a.default.bindToInput(this._$input,{callback:function(e){var i=t._chartWidgetCollection.activeChartWidget.value();i&&i.addSymbol(e,t._checkbox.checked)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"focus",value:function(){Modernizr.touch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),t}(),e.AddSymbolTab=c},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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)}var r,a,l,h;Object.defineProperty(e,"__esModule",{value:!0}),r=function(t,e,i){for(var o,n,s,r,a,l,h=!0;h;){if(o=t,n=e,s=i,h=!1,null===o&&(o=Function.prototype),void 0!==(r=Object.getOwnPropertyDescriptor(o,n))){if("value"in r)return r.value;if(void 0===(l=r.get))return;return l.call(s)}if(null===(a=Object.getPrototypeOf(o)))return;t=a,e=n,i=s,h=!0,r=a=void 0}},a=i(346),l=o(a),h=function(t){function e(t){var i=this;n(this,e),t.checked=TVSettings.getBool("showAddSymbolDialog.checkboxState",!0),r(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this.$checkbox.change(function(){setTimeout(function(){TVSettings.setValue("showAddSymbolDialog.checkboxState",i.checked)})})}return s(e,t),e}(l.default),e.AddSymbolCheckbox=h},function(t,e,i){(function(o){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s,r,a,l,h;Object.defineProperty(e,"__esModule",{value:!0}),s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(55),i(341),a={labelWrapper:'{{#hasLabel}}<label>{{#labelLeft}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelLeft}}</span>{{/labelLeft}}{{> inputWrapper }}{{#labelRight}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelRight}}</span>{{/labelRight}}</label>{{/hasLabel}}{{^hasLabel}}{{> inputWrapper }}{{/hasLabel}}',inputWrapper:'<{{ tag }} class="{{ customClass }}{{#disabled}} i-disabled{{/disabled}}">{{^hasCheckbox}}{{> checkbox }}{{/hasCheckbox}}{{> box }}{{> ripple }}</{{ tag }}>',checkbox:'<input{{#id}} id="{{ id }}"{{/id}} class="{{> checkboxClass }}" type="checkbox"{{#name}} name="{{ name }}"{{/name}}{{#checked}} checked{{/checked}}{{#disabled}} disabled{{/disabled}}>',checkboxClass:"{{ customClass }}__input",box:'<span class="{{ customClass }}__box {{#boxAddClass}}{{boxAddClass}}{{/boxAddClass}}">'+i(343)+"</span>",ripple:'<span class="{{ customClass }}__ripple js-ripple"></span>'},l="i-inited",h=function(){function t(e){var i,o=e.customClass,s=void 0===o?"tv-control-checkbox":o,r=e.$checkbox,a=e.tag,h=e.id,c=e.name,d=e.checked,p=e.disabled,u=e.labelLeft,_=e.labelRight,f=e.labelAddClass,m=e.boxAddClass;if(n(this,t),this.$el=null,void 0===a&&(a=u||_?"span":"label"),i=r instanceof $&&!!r.length){if(!r.is("input[type=checkbox]"))return void TradingView.logError("`$checkbox` need to be input[type=checkbox]","ControlCheckboxView",!0);if(r.hasClass(l))return;this._setInputId(r,h),this._setInputClass(r,s),this._setInputName(r,c),this._setInputChecked(r,d),this._setInputDisabled(r,p),d=!!r.prop("checked"),p=!!r.attr("disabled")}this.$el=this.render({$checkbox:r,hasCheckbox:i,customClass:s,tag:a,id:h,name:c,checked:d,disabled:p,labelLeft:u,labelRight:_,hasLabel:u||_,labelAddClass:f,boxAddClass:m}),this.$checkbox=i?r:this.$el.find("input[type=checkbox]")}return s(t,[{key:"_setInputId",value:function(t,e){void 0!==e&&t.attr("id",e)}},{key:"_setInputClass",value:function(t,e){var i=o.render(a.checkboxClass,{customClass:e});t.addClass(i)}},{key:"_setInputName",value:function(t,e){void 0!==e&&t.attr("name",e)}},{key:"_setInputChecked",value:function(t,e){void 0!==e&&t.prop("checked",!!e)}},{key:"_setInputDisabled",value:function(t,e){void 0!==e&&(e?t.setAttribute("disabled","disabled"):t.removeAttr("disabled"))}},{key:"render",value:function(t){var e,i=t.$checkbox,n=$(o.render(a.labelWrapper,t,a));return t.hasCheckbox&&(n.insertBefore(i),e=n.find("."+t.customClass).andSelf().filter("."+t.customClass).eq(0),e.prepend(i.detach()),i.addClass(l)),n}},{key:"checked",set:function(t){this._setInputChecked(this.$checkbox,!!t)},get:function(){return!!this.$checkbox.prop("checked")}}]),t}(),$.fn.tvControlCheckbox=(0,r.createTvBlockWithInstance)("tv-control-checkbox",function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return new h(TradingView.mergeObj(e,{$checkbox:t}))}),e.default=h,t.exports=e.default}).call(e,i(52))},function(t,e){},function(t,e,i){(function(t){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(e){var i,o,n,s,d,p,u,_,f,m,g;if(e=$.extend({},c,e),i=$(t.render(l,{tabs:e.tabs,customControls:e.customControls,customControlsAddClass:e.customControlsContainerAddClass},{additionalHeaderContent:e.additionalHeaderContent})),o=$(h),n=o,e.contentAddClass&&o.addClass(e.contentAddClass),e.withScroll!==!1&&(o=$('<div class="js-dialog__scroll-wrap tv-dialog__scroll-wrap">').append(n.addClass("tv-dialog__scroll-wrap-inner"))),s=$('<div class="tv-tabbed-dialog">').append(i).append(o),e.customControls&&i.find(".js-custom-controls").append(e.customControls),e.doNotCreatePages!==!0)for(d=0;d<e.tabs.length;++d)n.append($('<div class="tv-tabbed-dialog__tab-page">').append(e.tabs[d].page));return p=e.tabStateSaveKey,u=e.activeTab,_=e.tabsScrollBoxAddClass,f=e.tabAddClass,delete e.tabs,delete e.activeTab,delete e.customControls,delete e.tabStateSaveKey,delete e.customControlsContainerAddClass,delete e.tabsScrollBoxAddClass,delete e.tabAddClass,e.closeButtonAddClass="tv-tabbed-dialog__close",e.contentWrapTemplate=s,m=(0,a.createDialog)(e),g=new r.default(i.find(".tv-tabs"),n,{addLeftArrowsClass:"tv-tabbed-dialog__tabs-arrow-left",addRightArrowsClass:"tv-tabbed-dialog__tabs-arrow-right",addScrollBoxClass:_,tabClass:f,saveTab:p,activeTab:u}),m.on("afterOpen",function(){g.setActivePage(g.index(),!0,!0)}),{dialog:m,tabs:g}}var s,r,a,l,h,c;Object.defineProperty(e,"__esModule",{value:!0}),e.createTabbedDialog=n,i(349),s=i(350),r=o(s),a=i(67),l='<div class="tv-dialog__section tv-dialog__section--title tv-tabbed-dialog__header js-dialog__drag js-close-button-place"><div class="tv-tabs tv-tabbed-dialog__tabs js-dialog__drag">{{#tabs}}<div class="tv-tabs__tab">{{name}}</div>{{/tabs}}</div>{{#customControls}}<div class="js-custom-controls tv-tabbed-dialog__custom-controls {{#customControlsAddClass}}{{customControlsAddClass}}{{/customControlsAddClass}}"></div>{{/customControls}}<div class="tv-tabbed-dialog__bottom-border"></div></div>{{>additionalHeaderContent}}',h='<div class="tv-tabbed-dialog__pages-container"></div>',c={tabs:[]}}).call(e,i(52))},function(t,e){},function(t,e,i){(function(e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,o,n){var s,a,l,h=this;this.$tabs=t,this.$pages=o,this.options=$.extend({},this._DEFAULT_OPTIONS,n||{}),this.tabChanged=new e,s=function(t,e,i,o){var n=!(arguments.length<=4||void 0===arguments[4])&&arguments[4];h[t]=i.find("."+e),h[t].length||(i[o](n||'<div class="'+e+'"></div>'),h[t]=i.find("."+e))},s("$scrollWrap",this.options.scrollWrapClass,this.$tabs,"wrapInner"),s("$scrollBox",this.options.scrollBoxClass,this.$scrollWrap,"wrapInner"),s("$lArrow",this.options.lArrowClass,this.$tabs,"append",'<div class="'+this.options.lArrowClass+' i-slided">'+i(324)+"</div>"),s("$rArrow",this.options.rArrowClass,this.$tabs,"append",'<div class="'+this.options.rArrowClass+' i-slided">'+i(328)+"</div>"),this.options.addLeftArrowsClass&&this.$lArrow.addClass(this.options.addLeftArrowsClass),this.options.addRightArrowsClass&&this.$rArrow.addClass(this.options.addRightArrowsClass),void 0!==this.options.addScrollBoxClass&&this.$scrollBox.addClass(this.options.addScrollBoxClass),void 0!==this.options.tabsContainerClass&&t.addClass(this.options.tabsContainerClass),void 0!==this.options.tabClass&&this.get$tabs().addClass(this.options.tabClass),this.options.noSlider||s("$slider",this.options.sliderClass,this.$scrollBox,"append"),this.options.sliderMod&&this.$slider.addClass(this.options.sliderClass+"--"+this.options.sliderMod),t.addClass(this.options.loadedClass),this.checkScrollArrows(!0),a=0,this.options.saveTab&&(a=TVSettings.getInt(this.options.saveTab,0)),l=this.index(),l!==-1&&(a=l),this.setActivePage(this.options.activeTab||a,!0,!0),t.on(Modernizr.touch?"touchend":"click","."+this.options.tabClass,function(t){h.options.onTabClick?h.options.onTabClick(t):h._onTabClick(t)}),this.$scrollWrap.on("scroll",this.checkScrollArrows.bind(this,!1)),t.on("click","."+this.options.lArrowClass,function(t){var e=h.get$tabs(),i=!1,o=!1,n=h.$scrollWrap.scrollLeft();e.each(function(t,e){var s,r;o||(s=$(e),r=s.position().left+s.outerWidth(),r>n?o=!0:i=r)}),h.$scrollWrap.velocity("scroll",{queue:!1,offset:Math.floor(i-n-h.$lArrow.width()),easing:"easeInOutCubic",duration:r.default.dur/2,container:h.$scrollWrap,axis:"x"})}),t.on("click","."+this.options.rArrowClass,function(t){var e=h.get$tabs(),i=!1,o=h.$scrollWrap.scrollLeft()+h.$scrollWrap.width();e.each(function(t,e){var n,s;i===!1&&(n=$(e),(s=n.position().left+n.outerWidth())>o&&(i=s))}),h.$scrollWrap.velocity("scroll",{queue:!1,offset:Math.ceil(i-o+h.$rArrow.width()),easing:"easeInOutCubic",duration:r.default.dur/2,container:h.$scrollWrap,axis:"x"})}),t.on("mouseenter",".js-tabs__slider-hover",function(t){if(!h.animating){var e=$(t.currentTarget);e.hasClass(h.options.activeTabClass)&&h.hoverSlider(e)}}),$(window).on("resize",function(){h.checkScrollArrows(!0)}),this.options.noSlider||$(window).on("resize",function(){h.resizeSlider()})}var s,r;i(351),s=i(46),r=o(s),n.prototype.stop=function(){this.$tabs.off("click")},n.prototype._DEFAULT_OPTIONS={saveTab:!1,onTabClick:!1,noSlider:!1,loadedClass:"i-loaded",tabsContainerClass:"tv-tabs",tabClass:"tv-tabs__tab",sliderClass:"tv-tabs__slider",scrollBoxClass:"tv-tabs__scroll-box",scrollWrapClass:"tv-tabs__scroll-wrap",lArrowClass:"tv-tabs__left-arrow",rArrowClass:"tv-tabs__right-arrow",sliderMod:!1,activeTabClass:"i-active",activePageClass:"active",inactiveTabClass:null,inactivePageClass:null,tabDisabledClass:"disabled"},n.prototype.checkScrollArrows=function(){var t,e,i,o,n=this,s=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];this.$scrollWrap.length&&(t=this.$scrollWrap.scrollLeft(),e=this.$scrollWrap.width(),i=10,o=this.$scrollWrap[0].scrollWidth-e-20,t>=i?(this.$lArrow.removeClass("i-slided"),this.$lArrow.velocity({translateX:0},{queue:!1,duration:r.default.dur/2,easing:"easeOutCubic"})):(t<=i||this.$scrollWrap[0].scrollWidth<=e)&&(s?this.$lArrow.addClass("i-slided").attr("style",""):this.$lArrow.velocity({translateX:"-100%"},{queue:!1,duration:r.default.dur/2,easing:"easeOutCubic",complete:function(){n.$lArrow.addClass("i-slided")}})),t<=o?(this.$rArrow.removeClass("i-slided"),this.$rArrow.velocity({translateX:0},{queue:!1,duration:r.default.dur/2,easing:"easeOutCubic"})):(t>=o||this.$scrollWrap[0].scrollWidth<=e)&&(s?this.$rArrow.addClass("i-slided").attr("style",""):this.$rArrow.velocity({translateX:"100%"},{queue:!1,duration:r.default.dur/2,easing:"easeOutCubic",complete:function(){n.$rArrow.addClass("i-slided")}})))},n.prototype.get$tabs=function(){return this.$scrollBox.children().not("."+this.options.sliderClass)},n.prototype.get$pages=function(){return this.$pages.children()},n.prototype.setActivePage=function(t,e,i){function o(t){return t||""}function n(e,i,o){e.removeClass([i,o].join(" ")),i&&e.eq(t).addClass(i),o&&e.not(":nth-child("+(t+1)+")").addClass(o)}if(t!==-1&&(t!==this.index()||i)){var s=this.index();n(this.get$tabs(),o(this.options.activeTabClass),o(this.options.inactiveTabClass)),this.$pages&&n(this.$pages.children(),o(this.options.activePageClass),o(this.options.inactivePageClass)),this.options.noSlider||this.updateSlider(s,t,e),this.options.saveTab&&TVSettings.setValue(this.options.saveTab,t),this.tabChanged.fire(t)}},n.prototype.isTabDisabled=function(t){return t.hasClass(this.options.tabDisabledClass)||t.is(":disabled")||t.is("[disabled]")},n.prototype._onTabClick=function(t){var e=$(t.currentTarget),i=e.index();this.isTabDisabled(e)||this.setActivePage(i),t.preventDefault()},n.prototype.updateSlider=function(t,e,i){var o,n,s,a,l,h=this;this.options.noSlider||(o=this.get$tabs().eq(e),o.is(":visible")&&(this.animating=!0,n=o[0].offsetLeft+parseInt(o.css("padding-left")),s=o.width(),a=o.find(".js-tabs__slider-pos"),a.length&&(n+=parseInt(a.css("padding-left"))+a.position().left,s-=s-a.width()),l=function(){h.animating=!1},i||t===-1||document.all&&!window.atob?(this.$slider.css({left:n,width:s}),l()):(this.$slider.velocity({left:n},{duration:r.default.dur,easing:"easeOutCubic",queue:!1}),this.$slider.velocity({width:s},{duration:r.default.dur,easing:"easeOutCubic",queue:!1,complete:l}))))},n.prototype.resizeSlider=function(){var t,e;this.options.noSlider||(t=this.$tabs[0].offsetWidth)!==this._prevWidth&&(this._prevWidth=t,e=this.index(),this.updateSlider(e,e,!0))},n.prototype.hoverSlider=function(t){var e=this,i=t.width(),o=t.position().left+parseInt(t.css("padding-left"))+parseInt(t.css("margin-left")),n={duration:r.default.dur/4,easing:"easeOutCubic",queue:!1};this.$slider.velocity({left:o},n),this.$slider.velocity({width:i},n),t.one("mouseleave",function(){e.unhoverSlider(t)})},n.prototype.unhoverSlider=function(t){var e=t.find(".js-tabs__slider-pos"),i=t.position().left+parseInt(t.css("padding-left"))+parseInt(t.css("margin-left"))+parseInt(e.css("padding-left"))+e.position().left,o=t.width();o-=o-e.width(),this.$slider.velocity({left:i},{duration:r.default.dur/2,easing:"easeInSine",queue:!1}),this.$slider.velocity({width:o},{duration:r.default.dur/2,easing:"easeInSine",queue:!1})},n.prototype.addPage=function(t,e){var i=this.count();return this.$scrollBox.append(t),this.$pages&&this.$pages.append(e),i||this.setActivePage(0),this.checkScrollArrows(!0),i},n.prototype.removePage=function(t){function e(t){return t-1>=0?t-1:0}this.get$tabs().eq(t).remove(),this.$pages&&this.$pages.children().eq(t).remove();var i=this.get$tabs().filter(".active").length?this.get$tabs().filter(".active").index():e(t);this.setActivePage(i),this.checkScrollArrows(!0)},n.prototype.count=function(){return this.get$tabs().length},n.prototype.activeTab=function(){return this._activeElement(this.get$tabs(),this.options.activeTabClass,this.options.inactiveTabClass)},n.prototype.activePage=function(){return this._activeElement(this.get$pages(),this.options.activePageClass,this.options.inactivePageClass)},n.prototype._activeElement=function(t,e,i){return e?t.filter("."+e+":eq(0)"):i?t.filter(":not(."+i+"):eq(0)"):$()},n.prototype.index=function(){return this.activeTab().index()},n.prototype.indexOfTab=function(t){return this.get$tabs().index(t)},n.prototype.indexOfPage=function(t){return this.$pages.children().index(t)},n.prototype.pageAt=function(t){return this.$pages.children().eq(t)},n.prototype.deselect=function(t){return this.activeTab().removeClass(this.options.activeTabClass),this.activePage().removeClass(this.options.activePageClass),this.$slider&&this.$slider.css({left:"",width:""}),this},t.exports=n}).call(e,i(34))},function(t,e){},function(t,e){},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){var i,o,n,s,h,u,_,f,m,g,v,y=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];for(y=$.extend({},{title:$.t("Confirm Inputs"),callback:function(t){}},y),i=null,o=(0,r.createDialog)({title:y.title,contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"></div>',width:d,closeOnClickAtOtherDialogs:!0,destroyOnClose:!0,actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">',isClickOutFn:function(t){var e=i.symbolSearchPopup();if(e)return e[0]!==t.target&&!e[0].contains(t.target)&&void 0},actions:[{name:"apply",type:"primary",text:$.t("Apply"),key:13}]}),p=o,n=(0,l.merge)({},e.defaults.inputs),s=0;s<e.inputs.length;++s)h=e.inputs[s],h.confirm||delete n[h.id];u=new c.default({inputs:n}),_={metaInfo:function(){return e}},f=o.$content,o.open(),i=new a.StudyInputsPropertyPage(u,t.model(),_,!0,o.zIndex),m=i.widget(),f.append(m),Array.prototype.forEach.call(f.find("select"),function(t){var e=$(t),i="tv-select-container dialog";e.hasClass("tv-select-container-fontsize")&&(i+=" tv-select-container-fontsize"),e.selectbox({speed:100,classHolder:i})}),$('input[type="text"]',f).addClass("tv-text-input inset dialog"),$("input.ticker",f).TVTicker(),o.on("action:apply",function(){(0,y.callback)(u.state()),o.close()}),g=o.$content.innerWidth()-o.$content.width(),v=m.width()+g,v>d&&o.$el.css("max-width",v),f.find("input,select").first().focus()}function s(){return p}var r,a,l,h,c,d,p;Object.defineProperty(e,"__esModule",{value:!0}),e.show=n,e.instance=s,r=i(67),a=i(354),l=i(28),h=i(83),c=o(h),i(70),d=450,p=null},function(t,e,i){(function(t){"use strict";function o(t,e,i,o,n){a.call(this,t,e),this._study=i,this._showOnlyConfirmInputs=o,this._symbolSearchZindex=n,this.prepareLayout(),this._$symbolSearchPopup=null}function n(t,e,i){a.call(this,t,e),this._study=i,this.prepareLayout()}function s(t,e,i){a.call(this,t,e),this._study=i,this._property=t,this.prepareLayout()}var r=i(309),a=r.PropertyPage,l=r.UppercaseTransformer,h=r.GreateTransformer,c=r.LessTransformer,d=r.ToIntTransformer,p=r.ToFloatTransformer,u=r.SimpleComboBinder,_=r.BooleanBinder,f=r.SymbolBinder,m=r.DisabledBinder,g=r.BarTimeBinder,v=r.ColorBinding,y=r.SliderBinder,b=r.SessionBinder,w=r.SimpleStringBinder,S=i(334),T=i(183),C=T.addColorPicker,x=T.createLineStyleEditor,P=T.createShapeLocationEditor,L=T.createShapeStyleEditor,k=T.createLineWidthEditor,I=T.createVisibilityEditor,E=T.createTextEditor,A=T.createHHistDirectionEditor,V=T.createPlotEditor,M=i(94).NumericFormatter,D=i(139),O=i(175).StudyConsts,B=i(171),R=B.Study;inherit(o,a),o.prototype._addSessionEditor=function(t,e,i,o){var n,s,r,a,l,h;if("session"!==i.type)return void TradingView.logError("Session editor adding FAILED: wrong input type.");n=function(t,e){var i,o=$("<td/>");o.appendTo(t),o.css("padding-left","0px"),o.css("padding-right","0px"),i=$("<input>"),i.attr("type","text"),i.addClass("ticker"),i.css("width","40px"),i.attr("id",e),i.appendTo(o)},s=function(t,e,i){var o,n=$("<td/>");n.css("padding-left",i),n.css("padding-right",i),n.appendTo(t),o=$("<div/>"),o.appendTo(n),o.append(e),o.css("font-size","150%")},r=$("<table/>"),r.appendTo(t),a=$("<tr/>"),a.appendTo(r),l=["start_hours","start_minutes","end_hours","end_minutes"],n.call(this,a,l[0]),s.call(this,a,":",0),n.call(this,a,l[1]),s.call(this,a,"-",4),n.call(this,a,l[2]),s.call(this,a,":",0),n.call(this,a,l[3]),h=!1,this.bindControl(new b(a,l,e,h,this.model(),o))},o.prototype.prepareLayoutImpl=function(e,i){function o(t){return(new M).format(t)}function n(t){return function(e){var i,o,n,s=this,r=null;if(0===e.indexOf("#")){if(i=e.slice(1,e.indexOf("$")),!((o=tt._model.dataSourceForId(i))&&o instanceof R))return void TradingView.logError("Can not get Study by id "+i);if(o.isStarted()||o.start(null,!0),!(n=o.sourceId()))return void TradingView.logError("Can not get source id for "+o.metaInfo().id);r=e.replace(/^[^\$]+/,n)}!~e.indexOf("$")&&!~e.indexOf("#")||tt._study.isStarted()||tt._study.start(null,!0),tt._study.testInputValue(t,e)?s.setValueToProperty(r||s.value()):s.setValue(tt._property.inputs[t.id].value())}}function s(t){return function(e){var i,o,n,s;if(t.hasOwnProperty(e)||0===e.indexOf("#")||!~e.indexOf("$"))return e;for(i=e.slice(0,e.indexOf("$")),o=tt._model.dataSources(),n=0;n<o.length;++n)if((s=o[n])instanceof R&&s.sourceId()===i){e=e.replace(/^[^\$]+/,"#"+s.id());break}return e}}var r,a,m,v,y,b,T,C,x,P,L,k,I,E,A,V,O,B,N,F,W,z,H,U,j,q,Y,G,K,X,Z,J,Q,tt=this;for(r=0;r<e.inputs.length;r++)if(a=e.inputs[r],"first_visible_bar_time"!==(m=a.id)&&"last_visible_bar_time"!==m&&"time"!==a.type&&!a.isHidden&&(!this._showOnlyConfirmInputs||a.confirm)&&void 0===a.groupId){if(v=a.name||m.toLowerCase().replace(/\b\w/g,function(t){return t.toUpperCase()}),y="Change "+v,b=$("<tr/>"),b.appendTo(i),T=$("<td/>"),T.appendTo(b),T.addClass("propertypage-name-label"),T.text($.t(v,{context:"input"})),C=$("<td/>"),C.appendTo(b),x=null,P=null,L=null,"resolution"===a.type)x=$('<select><option value="1">1</option><option value="3">3</option><option value="5">5</option><option value="15">15</option><option value="30">30</option><option value="45">45</option><option value="60">1'+$.t("h")+'</option><option value="120">2'+$.t("h")+'</option><option value="180">3'+$.t("h")+'</option><option value="D">1'+$.t("d")+'</option><option value="W">1'+$.t("w")+"</option></select>");else if("symbol"===a.type)x=$('<input class="symbol-edit single">'),S.bindToInput(x,{onPopupOpen:function(t){this._$symbolSearchPopup=t,this._symbolSearchZindex&&t.css("z-index",this._symbolSearchZindex)}.bind(this),onPopupClose:function(){this._$symbolSearchPopup=null}.bind(this)});else if("session"===a.type)this._addSessionEditor(C,this._property.inputs[m],a,y);else if("source"===a.type){for(k={},I=["open","high","low","close","hl2","hlc3","ohlc4"],E=0;E<I.length;++E)k[I[E]]||(k[I[E]]=I[E]);if(A=this._study&&this._study.isChildStudy()){V=this._study.source(),O=V.title(!0,null,!0),B=D.getChildSourceInputTitles(a,this._study.source().metaInfo(),O);for(N in k)B[N]&&(k[N]=1===Object.keys(B).length?O:B[N])}if(TradingView.isFeatureEnabled("study_on_study")&&t.enabled("study_on_study")&&this._study&&D.isSourceInput(a)&&(A||D.canBeChild(this._study.metaInfo()))){for(F=[this._study],F=F.concat(this._study.getAllChildren()),W=this._model.dataSources(),z=0;z<W.length;++z)if((H=W[z])instanceof R&&!~F.indexOf(H)&&H.canHaveChildren())if(U=H.title(!0,null,!0),j=H.sourceId()||"#"+H.id(),q=H.metaInfo(),Y=q.styles,G=q.plots||[],1===G.length)k[j+"$0"]=U;else for(E=0;E<G.length;++E)K=G[E],~D.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(K.type)&&(k[j+"$"+E]=U+":"+(Y&&Y[K.id]&&Y[K.id].title||K.id));P=n(a),L=s(k)}x=$(document.createElement("select"));for(X in k)$("<option>").attr("value",X).text(k[X]).appendTo(x);C.addClass("js-value-cell")}else if(a.options)for(x=$("<select/>"),z=0;z<a.options.length;z++)X=a.options[z],$("<option value='"+X+"'>"+X+"</option>").appendTo(x);else x=$("<input/>"),"bool"===a.type?x.attr("type","checkbox"):x.attr("type","text");x&&(x.appendTo(C),x.is(":checkbox")||x.css("width","100px")),a.options?this.bindControl(new u(x,this._property.inputs[m],null,!0,this.model(),y,P,L)):"bar_time"===a.type?(Z=10,this.bindControl(new g(x,this._property.inputs[m],!0,this.model(),y,this.model().mainSeries(),Z)),x.addClass("ticker")):"integer"===a.type?(J=[d(a.defval)],(0===a.min||a.min)&&J.push(h(a.min)),(0===a.max||a.max)&&J.push(c(a.max)),this.bindControl(new w(x,this._property.inputs[m],J,!1,this.model(),y)),x.addClass("ticker"),isFinite(a.step)&&a.step>0&&x.attr("data-step",a.step)):"float"===a.type?(J=[p(a.defval)],(0===a.min||a.min)&&J.push(h(a.min)),(0===a.max||a.max)&&J.push(c(a.max)),Q=new w(x,this._property.inputs[m],J,!1,this.model(),y),Q.addFormatter(o),this.bindControl(Q),x.addClass("ticker"),isFinite(a.step)&&a.step>0&&x.attr("data-step",a.step)):"text"===a.type?this.bindControl(new w(x,this._property.inputs[m],null,!1,this.model(),y)):"bool"===a.type?this.bindControl(new _(x,this._property.inputs[m],!0,this.model(),y)):"resolution"===a.type?this.bindControl(new u(x,this._property.inputs[m],l,!0,this.model(),"Change Interval")):"symbol"===a.type&&this.bindControl(new f(x,this._property.inputs[m],!0,this.model(),"Change Symbol"))}this._property.offset&&(v=this._property.offset.title?this._property.offset.title.value():$.t("Offset"),x=this.addOffsetEditorRow(i,v),J=[d(this._property.offset.val)],J.push(h(this._property.offset.min)),J.push(c(this._property.offset.max)),this.bindControl(new w(x,this._property.offset.val,J,!1,this.model(),"Undo "+v))),this._property.offsets&&$.each(e.plots,function(t,e){var o,n,s,r;this._property.offsets[e.id]&&(o=this._property.offsets[e.id],void 0!==o.isHidden&&o.isHidden.value()||(n=o.title.value(),s=this.addOffsetEditorRow(i,n),r=[d(o.val)],r.push(h(o.min)),r.push(c(o.max)),this.bindControl(new w(s,o.val,r,!1,this.model(),"Undo "+n))))}.bind(this))},o.prototype.prepareLayout=function(){this._table=$("<table/>"),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2");var t=this._study.metaInfo();this.prepareLayoutImpl(t,this._table),this.loadData()},o.prototype.symbolSearchPopup=function(){return this._$symbolSearchPopup},o.prototype.widget=function(){return this._table},inherit(n,a),n.prototype.prepareLayout=function(){function t(t){return(new M).format(t)}var e,i,o,s,r,a,l,h,c,d,f,m,g,b,S,T,P,L,I,E,A,V,O,B,R,N,F,W,z,H,U,j,q,Y,G,K;for(this._table=$("<table/>"),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),e=this._study.metaInfo(),i={},o=0;o<e.plots.length;++o)if(!(this._study.isSelfColorerPlot(o)||this._study.isTextColorerPlot(o)||this._study.isDataOffsetPlot(o)||this._study.isOHLCColorerPlot(o))){if(a=e.plots[o],e.styles){if(e.styles[a.id])s=e.styles[a.id].isHidden;else{if(!this._study.isOHLCSeriesPlot(o))continue;if(r=e.plots[o].target,i[r])continue;s=e.ohlcPlots[r].isHidden,i[r]=r}if(s)continue}this._study.isLinePlot(o)||this._study.isBarColorerPlot(o)||this._study.isBgColorerPlot(o)?this._prepareLayoutForPlot(o,a):this._study.isPlotArrowsPlot(o)?this._prepareLayoutForArrowsPlot(o,a):this._study.isPlotCharsPlot(o)?this._prepareLayoutForCharsPlot(o,a):this._study.isPlotShapesPlot(o)?this._prepareLayoutForShapesPlot(o,a):this._study.isOHLCSeriesPlot(o)?(l={id:r,type:"ohlc"},this._study.isOHLCBarsPlot(o)?this._prepareLayoutForBarsPlot(o,l):this._study.isOHLCCandlesPlot(o)&&this._prepareLayoutForCandlesPlot(o,l)):TradingView.logError("Unknown plot type: "+a.type)}if((h=this._study.properties().bands)&&h.childCount()>0)for(o=0;o<h.childCount();o++)c=h[o],c.isHidden&&c.isHidden.value()||(d=$('<tr class="line"/>'),d.appendTo(this._table),f=$("<td/>"),f.appendTo(d),m=$("<input type='checkbox' class='visibility-switch'/>"),m.appendTo(f),g=c.name.value(),b=this.createLabeledCell(g,m).appendTo(d).addClass("propertypage-name-label"),S=$("<td/>"),S.appendTo(d),S.addClass("colorpicker-cell"),T=C(S),P=$("<td/>"),P.appendTo(d),L=k(),L.appendTo(P),I=$('<td colspan="4">').css({whiteSpace:"nowrap"}),I.appendTo(d),E=x(),E.render().appendTo(I),A=$("<input class='property-page-bandwidth' type='text'/>"),A.appendTo(I),V=[p(c.value.value())],O="Change band",B=new w(A,c.value,V,!1,this.model(),O),B.addFormatter(t),this.bindControl(B),this.bindControl(new _(m,c.visible,!0,this.model(),O)),this.bindControl(new v(T,c.color,!0,this.model(),O)),this.bindControl(new u(E,c.linestyle,parseInt,!0,this.model(),O)),this.bindControl(new y(L,c.linewidth,!0,this.model(),O)));if(this._study.properties().bandsBackground&&(c=this._study.properties().bandsBackground,R=$.t("Background"),O=$.t("Change band background"),d=this._prepareFilledAreaBackground(c.fillBackground,c.backgroundColor,c.transparency,R,O),d.appendTo(this._table)),this._study.properties().areaBackground&&(c=this._study.properties().areaBackground,R=$.t("Background"),O=$.t("Change area background"),d=this._prepareFilledAreaBackground(c.fillBackground,c.backgroundColor,c.transparency,R,O),d.appendTo(this._table)),void 0!==(N=e.filledAreas))for(o=0;o<N.length;++o)F=N[o],F.isHidden||(O="Change "+R,c=this._study.properties().filledAreasStyle[F.id],R=F.title||$.t("Background"),F.palette?(d=$('<tr class="line"/>'),f=$("<td/>"),f.appendTo(d),m=$("<input type='checkbox' class='visibility-switch'/>"),m.appendTo(f),this.bindControl(new _(m,c.visible,!0,this.model(),O+" visibility")),this.createLabeledCell(R,m).appendTo(d).addClass("propertypage-name-label"),d.appendTo(this._table),W=this._findPlotPalette(o,F),z=W.palette,H=W.paletteProps,this._prepareLayoutForPalette(0,F,z,H,O)):(d=this._prepareFilledAreaBackground(c.visible,c.color,c.transparency,R,O),d.appendTo(this._table)));for(U in e.graphics){j=e.graphics[U];for(q in j)c=this._property.graphics[U][q],n["_createRow_"+U].call(this,this._table,c)}Y=this._table.find(".visibility-switch.plot-visibility-switch"),1===Y.length&&(f=Y.parent(),f.css("display","none"),b=this._table.find(".propertypage-plot-with-palette"),1===b.length?b.css("display","none"):(b=this._table.find(".propertypage-name-label"),b.css("padding-left",0),b.find("label").attr("for",""))),G=this._prepareStudyPropertiesLayout(),this._table=this._table.add(G),D.isScriptStrategy(e)&&(K=this._prepareOrdersSwitches(),this._table=this._table.add(K)),this.loadData()},n.prototype._prepareOrdersSwitches=function(){var t,e,i,o,n,s,r,a=$('<table class="property-page study-strategy-properties" cellspacing="0" cellpadding="2">'),l="chart-orders-switch_"+Date.now().toString(36),h=$("<tr>").appendTo(a),c=$('<input id="'+l+'" type="checkbox">').appendTo($("<td>").appendTo(h));return $('<label for="'+l+'">'+$.t("Trades on Chart")+"</label>").appendTo($("<td>").appendTo(h)),t="chart-orders-labels-switch_"+Date.now().toString(36),e=$("<tr>").appendTo(a),i=$('<input id="'+t+'" type="checkbox">').appendTo($("<td>").appendTo(e)),$('<label for="'+t+'">'+$.t("Signal Labels")+"</label>").appendTo($("<td>").appendTo(e)),o="chart-orders-qty-switch_"+Date.now().toString(36),n=$("<tr>").appendTo(a),s=$('<input id="'+o+'" type="checkbox">').appendTo($("<td>").appendTo(n)),$('<label for="'+o+'">'+$.t("Quantity")+"</label>").appendTo($("<td>").appendTo(n)),r=this._study.properties(),this.bindControl(new _(c,r.strategy.orders.visible,!0,this.model(),"Trades on chart visibility")),this.bindControl(new _(i,r.strategy.orders.showLabels,!0,this.model(),"Signal labels visibility")),this.bindControl(new m(i,r.strategy.orders.visible,!0,this.model(),"Signal labels visibility",!0)),this.bindControl(new _(s,r.strategy.orders.showQty,!0,this.model(),"Quantity visibility")),this.bindControl(new m(s,r.strategy.orders.visible,!0,this.model(),"Quantity visibility",!0)),a},n.prototype._prepareLayoutForPlot=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,f,m=e.id,g=this._study.properties().styles[m],b=this._findPlotPalette(t,e),w=b.palette,S=b.paletteProps,T="Change "+m;w?(i=$('<tr class="line"/>'),i.appendTo(this._table),o=$("<td/>"),o.appendTo(i),o.addClass("visibility-cell"),n=$("<input type='checkbox' class='visibility-switch plot-visibility-switch'/>"),n.appendTo(o),this.bindControl(new _(n,g.visible,!0,this.model(),T)),s=g.title.value(),this.createLabeledCell(s,n).appendTo(i).addClass("propertypage-name-label propertypage-plot-with-palette"),this._prepareLayoutForPalette(t,e,w,S,T)):(i=$('<tr class="line"/>'),i.appendTo(this._table),o=$("<td/>"),o.appendTo(i),o.addClass("visibility-cell"),n=$("<input type='checkbox' class='visibility-switch plot-visibility-switch'/>"),n.appendTo(o),s=this._study.properties().styles[m].title.value(),this.createLabeledCell(s,n).appendTo(i).addClass("propertypage-name-label"),r=$("<td/>"),r.appendTo(i),r.addClass("colorpicker-cell"),a=C(r),l=$("<td/>"),l.appendTo(i),h=k(),h.appendTo(l),c=$("<td>"),c.appendTo(i),d=V(),d.appendTo(c),p=$("<td>"),p.appendTo(i),f=$("<input type='checkbox'>"),f.appendTo(p),this.createLabeledCell("Price Line",f).appendTo(i),this.bindControl(new _(n,g.visible,!0,this.model(),T)),this.bindControl(new v(a,g.color,!0,this.model(),T,g.transparency)),this.bindControl(new y(h,g.linewidth,!0,this.model(),T,this._study.metaInfo().isTVScript)),this.bindControl(new u(d,g.plottype,parseInt,!0,this.model(),T)),this.bindControl(new _(f,g.trackPrice,!0,this.model(),"Change Price Line")))},n.prototype._prepareLayoutForBarsPlot=function(t,e){var i,o,n,s,r,a,l=e.id,h=this._study.properties().ohlcPlots[l],c=this._findPlotPalette(t,e),d=c.palette,p=c.paletteProps,u="Change "+l,f=$('<tr class="line"/>');f.appendTo(this._table),i=$("<td/>"),i.appendTo(f),i.addClass("visibility-cell"),o=$("<input type='checkbox' class='visibility-switch'/>"),o.appendTo(i),this.bindControl(new _(o,h.visible,!0,this.model(),u)),n=h.title.value(),this.createLabeledCell(n,o).appendTo(f).addClass("propertypage-name-label"),d?(s=!0,this._prepareLayoutForPalette(t,e,d,p,u,s)):(r=$("<td/>"),r.appendTo(f),r.addClass("colorpicker-cell"),a=C(r),this.bindControl(new v(a,h.color,!0,this.model(),u)))},n.prototype._prepareLayoutForCandlesPlot=function(t,e){var i,o,n,s,r,a,l,h,c;this._prepareLayoutForBarsPlot(t,e),i=e.id,o=this._study.properties().ohlcPlots[i],n="Change "+i,s=$('<tr class="line"/>'),s.appendTo(this._table),r=$("<td/>"),r.appendTo(s),r.addClass("visibility-cell"),a=$("<input type='checkbox' class='visibility-switch'/>"),a.appendTo(r),this.bindControl(new _(a,o.drawWick,!0,this.model(),n)),l="Wick",this.createLabeledCell(l,a).appendTo(s),h=$("<td/>"),h.appendTo(s),h.addClass("colorpicker-cell"),c=C(h),this.bindControl(new v(c,o.wickColor,!0,this.model(),n))},n.prototype._prepareLayoutForShapesPlot=function(t,e){var i,o,n,s,r,a,l,h,c,d=e.id,p=this._study.properties().styles[d],f=this._findPlotPalette(t,e),m=f.palette,g=f.paletteProps,y="Change "+d,b=$('<tr class="line"/>');b.appendTo(this._table),i=$("<td/>"),i.appendTo(b),i.addClass("visibility-cell"),o=$("<input type='checkbox' class='visibility-switch'/>"),o.appendTo(i),this.bindControl(new _(o,p.visible,!0,this.model(),y)),n=this._study.properties().styles[d].title.value(),this.createLabeledCell(n,o).appendTo(b).addClass("propertypage-name-label"),s=$("<td/>"),s.appendTo(b),r=L(),r.appendTo(s),this.bindControl(new u(r,p.plottype,null,!0,this.model(),y)),a=$("<td/>"),a.appendTo(b),l=P(),l.appendTo(a),this.bindControl(new u(l,p.location,null,!0,this.model(),y)),m?this._prepareLayoutForPalette(t,e,m,g,y):(b=$('<tr class="line"/>'),b.appendTo(this._table),$("<td/>").appendTo(b),$("<td/>").appendTo(b),h=$("<td/>"),h.appendTo(b),h.addClass("colorpicker-cell"),c=C(h),this.bindControl(new v(c,p.color,!0,this.model(),y,p.transparency)))},n.prototype._prepareLayoutForCharsPlot=function(t,e){var i,o,n,s,r,a,l,h,c,d=e.id,p=this._study.properties().styles[d],f=this._findPlotPalette(t,e),m=f.palette,g=f.paletteProps,y="Change "+d,b=$('<tr class="line"/>');b.appendTo(this._table),i=$("<td/>"),i.appendTo(b),i.addClass("visibility-cell"),o=$("<input type='checkbox' class='visibility-switch'/>"),o.appendTo(i),this.bindControl(new _(o,p.visible,!0,this.model(),y)),n=this._study.properties().styles[d].title.value(),this.createLabeledCell(n,o).appendTo(b).addClass("propertypage-name-label"),s=$("<td/>"),s.appendTo(b),r=E(),r.appendTo(s),r.keyup(function(){var t=$(this),e=t.val();e&&(t.val(e.split("")[e.length-1]),t.change())}),this.bindControl(new w(r,p.char,null,!1,this.model(),y)),a=$("<td/>"),a.appendTo(b),l=P(),l.appendTo(a),this.bindControl(new u(l,p.location,null,!0,this.model(),y)),m?this._prepareLayoutForPalette(t,e,m,g,y):(b=$('<tr class="line"/>'),b.appendTo(this._table),$("<td/>").appendTo(b),$("<td/>").appendTo(b),h=$("<td/>"),h.appendTo(b),h.addClass("colorpicker-cell"),c=C(h),this.bindControl(new v(c,p.color,!0,this.model(),y,p.transparency)))},n.prototype._isStyleNeedsConnectPoints=function(t){return[O.PLOT_CROSS,O.PLOT_CIRCLES].indexOf(t)>=0},n.prototype._prepareLayoutForPalette=function(t,e,i,o,n,s){var r,a,l,h,c,d,p,f,m,g,b,w,S,T,x,P=t,L=e.id,I=null,E=L.startsWith("fill");I=s?this._study.properties().ohlcPlots[L]:E?this._study.properties().filledAreasStyle[L]:this._study.properties().styles[L],r=0;for(a in i.colors)l=o.colors[a],h=$('<tr class="line"/>'),h.appendTo(this._table),$("<td/>").appendTo(h),c=$("<td/>"),c.appendTo(h),c.addClass("propertypage-name-label"),c.html($.t(l.name.value())),d=$("<td/>"),d.appendTo(h),d.addClass("colorpicker-cell"),p=C(d),this.bindControl(new v(p,l.color,!0,this.model(),n,I.transparency)),!E&&this._study.isLinePlot(P)&&(f=$("<td/>"),f.appendTo(h),m=k(),m.appendTo(f),this.bindControl(new y(m,l.width,!0,this.model(),n,this._study.metaInfo().isTVScript)),g=$("<td>"),g.appendTo(h),0===r&&(b=V(),b.appendTo(g),this.bindControl(new u(b,I.plottype,parseInt,!0,this.model(),n)),w=$("<input type='checkbox'>"),S=$('<td colspan="4">').css({whiteSpace:"nowrap"}),T=$("<span>").html($.t("Price Line")),x=$("<span>"),x.append(w),S.append(x).append(T).appendTo(h),this.bindControl(new _(w,I.trackPrice,!0,this.model(),"Change Price Line")))),r++},n.prototype._prepareLayoutForArrowsPlot=function(t,e){var i,o,n,s,r,a,l,h=e.id,c=this._study.properties().styles[h],d="Change "+h,p=$('<tr class="line"/>');p.appendTo(this._table),i=$("<td/>"),i.appendTo(p),i.addClass("visibility-cell"),o=$("<input type='checkbox' class='visibility-switch'/>"),o.appendTo(i),n=this._study.properties().styles[h].title.value(),this.createLabeledCell(n,o).appendTo(p).addClass("propertypage-name-label"),s=$("<td/>"),s.appendTo(p),s.addClass("colorpicker-cell"),r=C(s),a=$("<td/>"),a.appendTo(p),a.addClass("colorpicker-cell"),l=C(a),this.bindControl(new _(o,c.visible,!0,this.model(),d)),this.bindControl(new v(r,c.colorup,!0,this.model(),d,c.transparency)),this.bindControl(new v(l,c.colordown,!0,this.model(),d,c.transparency))},n.prototype._findPlotPalette=function(t,e){var i,o=t,n=e.id,s=null,r=null,a=this._study.metaInfo().plots;if(this._study.isBarColorerPlot(o)||this._study.isBgColorerPlot(o))s=this._study.metaInfo().palettes[e.palette],r=this._study.properties().palettes[e.palette];else for(i=0;i<a.length;i++)if(a[i].target===n&&(this._study.isSelfColorerPlot(i)||this._study.isOHLCColorerPlot(i))){s=this._study.metaInfo().palettes[a[i].palette],r=this._study.properties().palettes[a[i].palette];break}return{palette:s,paletteProps:r}},n.prototype._prepareStudyPropertiesLayout=function(){var t,e,i=$('<table class="property-page study-properties" cellspacing="0" cellpadding="2">');return this._study.metaInfo().is_price_study||(t=this.createPrecisionEditor(),e=$("<tr>"),e.appendTo(i),$("<td>"+$.t("Precision")+"</td>").appendTo(e),$("<td>").append(t).appendTo(e),this.bindControl(new u(t,this._study.properties().precision,null,!0,this.model(),"Change Precision"))),"Compare@tv-basicstudies"===this._study.metaInfo().id&&(t=this.createSeriesMinTickEditor(),e=$("<tr>"),e.appendTo(i),$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(e),$("<td>").append(t).appendTo(e),this.bindControl(new u(t,this._study.properties().minTick,null,!0,this.model(),"Change MinTick"))),this._putStudyDefaultStyles(i),i},n.prototype._putStudyDefaultStyles=function(t,e){var i,o,n,s,r,a,l=null,h=this._study;return(!h.properties().linkedToSeries||!h.properties().linkedToSeries.value())&&($.each(this._model.m_model.panes(),function(t,e){$.each(e.dataSources(),function(t,i){if(i===h)return l=e,!1})}),this._pane=l,this._pane&&(this._pane.leftPriceScale().dataSources().indexOf(this._study)!==-1?i="left":this._pane.rightPriceScale().dataSources().indexOf(this._study)!==-1?i="right":this._pane.isOverlay(this._study)&&(i="none")),i&&(o=this,n={left:$.t("Scale Left"),right:$.t("Scale Right")},o._pane.actionNoScaleIsEnabled(h)&&(n.none=$.t("Screen (No Scale)")),s=this.createKeyCombo(n).val(i).change(function(){switch(this.value){case"left":o._model.move(o._study,o._pane,o._pane.leftPriceScale());break;case"right":o._model.move(o._study,o._pane,o._pane.rightPriceScale());break;case"none":o._model.move(o._study,o._pane,null)}}),r=this.addRow(t),$("<td>"+$.t("Scale")+"</td>").appendTo(r),a=$("<td>").appendTo(r).append(s),e&&e>2&&a.attr("colspan",e-1)),t)},n.prototype.widget=function(){return this._table},n.prototype._prepareFilledAreaBackground=function(t,e,i,o,n){var s,r,a,l=$('<tr class="line"/>'),h=$("<td/>");return h.appendTo(l),s=$("<input type='checkbox' class='visibility-switch'/>"),s.appendTo(h),this.createLabeledCell(o,s).appendTo(l).addClass("propertypage-name-label"),r=$("<td/>"),r.appendTo(l),r.addClass("colorpicker-cell"),a=C(r),this.bindControl(new _(s,t,!0,this.model(),n+" visibility")),this.bindControl(new v(a,e,!0,this.model(),n+" color",i)),l},inherit(s,a),s.prototype.prepareLayout=function(){if(this._study.properties().linkedToSeries&&this._study.properties().linkedToSeries.value())return void(this._table=$());this._table=$()},s.prototype.widget=function(){return this._table},n._createRow_horizlines=function(t,e){var i=this.addRow(t),o=e.name.value(),n=$("<input type='checkbox' class='visibility-switch'/>"),s=this.createColorPicker(),r=k(),a=x();$("<td>").append(n).appendTo(i),this.createLabeledCell(o,n).appendTo(i),$("<td>").append(s).appendTo(i),$("<td>").append(r).appendTo(i),$("<td>").append(a.render()).appendTo(i),this.bindControl(new _(n,e.visible,!0,this.model(),"Change "+o+" visibility")),this.bindControl(new v(s,e.color,!0,this.model(),"Change "+o+" color")),this.bindControl(new u(a,e.style,parseInt,!0,this.model(),"Change "+o+" style")),this.bindControl(new y(r,e.width,!0,this.model(),"Change "+o+" width"))},n._createRow_vertlines=function(t,e){var i=this.addRow(t),o=e.name.value(),n=$("<input type='checkbox' class='visibility-switch'/>"),s=this.createColorPicker(),r=k(),a=x();$("<td>").append(n).appendTo(i),this.createLabeledCell(o,n).appendTo(i),$("<td>").append(s).appendTo(i),$("<td>").append(r).appendTo(i),$("<td>").append(a.render()).appendTo(i),this.bindControl(new _(n,e.visible,!0,this.model(),"Change "+o+" visibility")),this.bindControl(new v(s,e.color,!0,this.model(),"Change "+o+" color")),this.bindControl(new u(a,e.style,parseInt,!0,this.model(),"Change "+o+" style")),this.bindControl(new y(r,e.width,!0,this.model(),"Change "+o+" width"))},n._createRow_lines=function(t,e){var i=this.addRow(t),o=e.title.value(),n=$("<input type='checkbox' class='visibility-switch'/>"),s=this.createColorPicker(),r=k(),a=x();$("<td>").append(n).appendTo(i),this.createLabeledCell(o,n).appendTo(i),$("<td>").append(s).appendTo(i),$("<td>").append(r).appendTo(i),$("<td>").append(a.render()).appendTo(i),this.bindControl(new _(n,e.visible,!0,this.model(),"Change "+o+" visibility")),this.bindControl(new v(s,e.color,!0,this.model(),"Change "+o+" color")),this.bindControl(new u(a,e.style,parseInt,!0,this.model(),"Change "+o+" style")),this.bindControl(new y(r,e.width,!0,this.model(),"Change "+o+" width"))},n._createRow_hlines=function(t,e){var i,o,n,s=this.addRow(t),r=e.name.value(),a=$("<input type='checkbox' class='visibility-switch'/>"),l=this.createColorPicker(),h=k(),c=x(),d=$("<input type='checkbox'>");$("<td>").append(a).appendTo(s),this.createLabeledCell(r,a).appendTo(s),$("<td>").append(l).appendTo(s),$("<td>").append(h).appendTo(s),$("<td>").append(c.render()).appendTo(s),$("<td>").appendTo(s),$("<td>").append(d).appendTo(s),this.createLabeledCell("Show Price",d).appendTo(s),this.bindControl(new _(a,e.visible,!0,this.model(),"Change "+r+" visibility")),this.bindControl(new v(l,e.color,!0,this.model(),"Change "+r+" color")),this.bindControl(new u(c,e.style,parseInt,!0,this.model(),"Change "+r+" style")),this.bindControl(new y(h,e.width,!0,this.model(),"Change "+r+" width")),this.bindControl(new _(d,e.showPrice,!0,this.model(),"Change "+r+" show price")),e.enableText.value()&&(s=this.addRow(t),$('<td colspan="2">').appendTo(s),i=$("<input type='checkbox'>"),$('<td class="text-center">').append(i).appendTo(s),this.createLabeledCell("Show Text",i).appendTo(s),this.bindControl(new _(i,e.showText,!0,this.model(),"Change "+r+" show text")),o=TradingView.createTextPosEditor(),$("<td>").append(o.render()).appendTo(s),this.bindControl(new u(o,e.textPos,parseInt,!0,this.model(),"Change "+r+" text position")),n=this.createFontSizeEditor(),$('<td colspan="2">').append(n).appendTo(s),this.bindControl(new u(n,e.fontSize,parseInt,!0,this.model(),"Change "+r+" font size")))},n._createRow_hhists=function(t,e){var i,o,n,s,r,a,l=e.title.value(),p=[],f=[],m=this.addRow(t),g=I();$("<td>").append(g).appendTo(m),this.createLabeledCell(l,g).appendTo(m),this.bindControl(new _(g,e.visible,!0,this.model(),"Change "+l+" Visibility")),m=this.addRow(t),i=$("<input/>"),i.attr("type","text"),i.addClass("ticker"),this.createLabeledCell($.t("Width (% of the Box)"),i).appendTo(m),$("<td>").append(i).appendTo(m),o=[d(40)],o.push(h(0)),o.push(c(100)),this.bindControl(new w(i,e.percentWidth,o,!1,this.model(),"Change Percent Width")),m=this.addLabeledRow(t,"Placement"),n=A(),$("<td>").append(n).appendTo(m),this.bindControl(new u(n,e.direction,null,!0,this.model(),"Change "+l+" Placement")),m=this.addRow(t),s=$("<input type='checkbox'>"),$("<td>").append(s).appendTo(m),this.createLabeledCell($.t("Show Values"),s).appendTo(m),this.bindControl(new _(s,e.showValues,!0,this.model(),"Change "+l+" Show Values")),m=this.addRow(t),r=this.createColorPicker(),this.createLabeledCell($.t("Text Color"),r).appendTo(m),$("<td>").append(r).appendTo(m),this.bindControl(new v(r,e.valuesColor,!0,this.model(),"Change "+l+" Text Color"));for(a in e.colors)isNumber(parseInt(a,10))&&(m=this.addRow(t),p[a]=e.titles[a].value(),f[a]=this.createColorPicker(),$("<td>").append(p[a]).appendTo(m),$("<td>").append(f[a]).appendTo(m),this.bindControl(new v(f[a],e.colors[a],!0,this.model(),"Change "+p[a]+" color")))},n._createRow_backgrounds=function(t,e){var i=this.addRow(t),o=$("<input type='checkbox' class='visibility-switch'/>"),n=e.name.value(),s=this.createColorPicker();$("<td>").append(o).appendTo(i),this.createLabeledCell(n,o).appendTo(i),$("<td>").append(s).appendTo(i),this.bindControl(new _(o,e.visible,!0,this.model(),"Change "+n+" visibility")),this.bindControl(new v(s,e.color,!0,this.model(),"Change "+n+" color",e.transparency))},n._createRow_polygons=function(t,e){var i=this.addRow(t),o=e.name.value(),n=this.createColorPicker();$("<td>").append(o).appendTo(i),$("<td>").append(n).appendTo(i),this.bindControl(new v(n,e.color,!0,this.model(),"Change "+o+" color"))},n._createRow_trendchannels=function(t,e){var i=this.addRow(t),o=e.name.value(),n=this.createColorPicker();$("<td>").append(o).appendTo(i),$("<td>").append(n).appendTo(i),this.bindControl(new v(n,e.color,!0,this.model(),"Change "+o+" color",e.transparency))},n._createRow_textmarks=function(t,e){var i=this.addLabeledRow(t),o=e.name.value(),n=this.createColorPicker(),s=this.createColorPicker(),r=this.createFontEditor(),a=this.createFontSizeEditor(),l=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),h=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');$("<td>").append(o).appendTo(i),"rectangle"!==e.shape.value()&&$("<td>").append(n).appendTo(i),$("<td>").append(s).appendTo(i),$("<td>").append(r).appendTo(i),$("<td>").append(a).appendTo(i),$("<td>").append(l).appendTo(i),$("<td>").append(h).appendTo(i),this.bindControl(new v(n,e.color,!0,this.model(),"Change "+o+" color",e.transparency)),this.bindControl(new v(s,e.fontColor,!0,this.model(),"Change "+o+" text color",e.transparency)),this.bindControl(new u(a,e.fontSize,parseInt,!0,this.model(),"Change "+o+" font size")),this.bindControl(new u(r,e.fontFamily,null,!0,this.model(),"Change "+o+" font")),this.bindControl(new _(l,e.fontBold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new _(h,e.fontItalic,!0,this.model(),"Change Text Font Italic"))},n._createRow_shapemarks=function(t,e){var i=this.addRow(t),o=$("<input type='checkbox' class='visibility-switch'/>"),n=e.name.value(),s=this.createColorPicker(),r=$("<input/>");r.attr("type","text"),r.addClass("ticker"),$("<td>").append(o).appendTo(i),this.createLabeledCell(n,o).appendTo(i),$("<td>").append(s).appendTo(i),this.createLabeledCell("Size",r).appendTo(i),$("<td>").append(r).appendTo(i),this.bindControl(new _(o,e.visible,!0,this.model(),"Change "+n+" visibility")),this.bindControl(new v(s,e.color,!0,this.model(),"Change "+n+" back color",e.transparency)),this.bindControl(new w(r,e.size,null,!1,this.model(),"Change size"))},TradingView.StudyInputsPropertyPage=o,e.StudyInputsPropertyPage=o,e.StudyStylesPropertyPage=n,e.StudyDisplayPropertyPage=s}).call(e,i(1))},,,,function(t,e){},,,,,,,function(t,e,i){(function(e){"use strict";function o(t,e,i){this._source=t,this._model=e,this._undoCheckpoint=i}var n=i(82).LineDataSource,s=i(171).Study,r=i(89).DataSource,a=i(36),l=i(183).bindPopupMenu,h=i(288),c=i(35).trackEvent;i(70),$.extend(o,{TAB_PRIORITY_COORDINATES:100,TAB_PRIORITY_DISPLAY:100,TAB_PRIORITY_STYLE:200,TAB_PRIORITY_INPUTS:300,TAB_PRIORITY_PROPERTIES:250,TAB_NAME_COORDINATES:"Coordinates",TAB_NAME_DISPLAY:"Properties",TAB_NAME_STYLE:"Style",TAB_NAME_INPUTS:"Inputs",TAB_NAME_PROPERTIES:"Properties",TAB_NAME_GRAPHICS:"Graphics",TAB_NAME_VISIBILITY:"Visibility",TAB_NAME_SOURCE_CODE:"Source Code",TAB_OPEN_DEFAULT:100,TAB_OPEN_USERSAVE:200,TAB_OPEN_OVERRIDE:300}),o.prototype.hide=function(t){TVDialogs.destroy(this._dialogTitle,{undoChanges:!!t})},o.prototype._onDestroy=function(t,e){var i,o=(e||{}).undoChanges;$(window).unbind("keyup.hidePropertyDialog"),o?(i=this._undoCheckpoint?this._undoCheckpoint:this._undoCheckpointOnShow)&&this._model.undoToCheckpoint(i):this._source.hasAlert.value()&&this._source.localAndServerAlersMismatch&&this._source.synchronizeAlert(!0),this._undoCheckpointOnShow&&delete this._undoCheckpointOnShow,window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.refresh()},o.prototype.isVisible=function(){return this._dialog&&this._dialog.is(":visible")},o.prototype.focusOnText=function(){this._dialog.find('input[type="text"]').focus().select()},o.prototype.switchTab=function(t,e){var i,o;if(this._tabs)return i=null,t?t=t.valueOf():null===t&&(t=void 0),"string"==typeof t&&$.each(this._tabs,function(e,o){if(o.name===t)return i=o,!1}),"object"==typeof t&&$.each(this._tabs,function(e,o){if(t===o||$(o.labelObject).is(t)||$(o.wrapperObject).is(t))return i=o,!1}),i||(i=this._tabs[~~t]),!!i&&($.each(this._tabs,function(t,e){var o=e===i;$(e.wrapperObject)[o?"show":"hide"](),$(e.labelObject)[o?"addClass":"removeClass"]("active")}),e&&(o=this.activeTabSettingsName())&&TVSettings.setValue(o,i.name),this._dialog.height()+100>$(window).height()&&!i.isScrollable&&this.makeScrollable(i),$(":focus").blur(),!0)},o.prototype.makeScrollable=function(t){var e=t.wrapperObject,i=$(t.objects[0]),o=i.width();e.css({height:$(window).height()/1.4,overflow:"auto"}),i.css("width",o+20),t.isScrollable=!0},o.prototype.appendToTab=function(t,e,i,o,n,s){var r,a;$(t).is("table")&&!$(t).find("tr").size()||(this._tabs||(this._tabs=[]),$.each(this._tabs,function(t,i){if(i.name===e)return r=t,!1}),void 0===r&&(this._tabs.push({name:e,localizedName:$.t(e),objects:$(),displayPriority:0,defaultOpen:0,isButton:!!n,callback:n?s||function(){}:null}),r=this._tabs.length-1),a=this._tabs[r],a.objects=a.objects.add(t),a.displayPriority=Math.max(a.displayPriority||0,i||0),a.defaultOpen=Math.max(a.defaultOpen||0,o||0))},o.prototype.insertTabs=function(){function t(t){r&&r===t.name&&(t.defaultOpen=Math.max(~~t.defaultOpen,o.TAB_OPEN_USERSAVE)),(!n||~~n.defaultOpen<~~t.defaultOpen)&&(n=t),t.labelObject=$('<a href="#" class="properties-tabs-label tv-tabs__tab"></a>').text(t.localizedName).appendTo(i._tabContainer),t.labelObject.bind("click",function(t){t.preventDefault(),i.switchTab(this,!0)});var e=$('<div class="main-properties"></div>');t.wrapperObject=$().add(e),t.objects.each(function(i,o){var n=$(o);n.is("table")?(n.data("layout-separated")&&(t.wrapperObject=t.wrapperObject.add('<div class="properties-separator"></div>').add(e=$('<div class="main-properties"></div>')),n.removeData("layout-separated")),e.append(n),n.children("tbody").each(function(i,n){if(0!==i&&$(n).data("layout-separated")){t.wrapperObject=t.wrapperObject.add('<div class="properties-separator"></div>').add(e=$('<div class="main-properties"></div>'));var s=$(o).clone(!0,!1).appendTo(e);s.children().remove(),s.append(n),$(n).removeData("layout-separated")}})):e.append(n)}),t.wrapperObject.appendTo(i._container)}function e(t){t.labelObject=$('<a href="#" class="properties-tabs-label tv-tabs__tab"></a>').text(t.localizedName).appendTo(i._tabContainer),t.labelObject.bind("click",t.callback)}var i,n,s,r;this._tabs&&(this._tabs.sort(function(t,e){return(e.displayPriority||0)-(t.displayPriority||0)}),i=this,n=null,s=this.activeTabSettingsName(),s&&(r=TVSettings.getValue(s)),$.each(this._tabs,function(i,o){o.isButton?e(o):t(o)}),this.switchTab(n))},o.prototype.activeTabSettingsName=function(){var t=i(102),e=this._source;if(e)return e instanceof t||e instanceof h.ChartWidget?"properties_dialog.active_tab.chart":e instanceof n?"properties_dialog.active_tab.drawing":e instanceof s?"properties_dialog.active_tab.study":void 0},o.prototype.show=function(t){function d(){v.hide(!0)}var p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,M,D,O=i(315);if(t=t||{},p=t.onWidget||!1,TradingView.isInherited(this._source.constructor,h.ChartWidget)&&c("GUI","Chart Properties"),TradingView.isInherited(this._source.constructor,s)&&c("GUI","Study Properties"),TradingView.isInherited(this._source.constructor,r)&&this._model.setSelectedSource(this._source),u=O.createStudyStrategyPropertyPage(this._source,this._model),_=O.createInputsPropertyPage(this._source,this._model),f=O.createStylesPropertyPage(this._source,this._model),m=O.createVisibilitiesPropertyPage(this._source,this._model),g=O.createDisplayPropertyPage(this._source,this._model),_||f||u)return v=this,y=null!==_,b=this._source.title(),w=TVDialogs.createDialog(b,{hideTitle:!0,dragHandle:".properties-tabs"}),S=w.find("._tv-dialog-content"),T=$('<div class="properties-tabs tv-tabs"></div>').appendTo(S),C=[],x=400,this._tabs=C,this._dialog=w,this._dialogTitle=b,this._dialog=w,this._container=S,this._tabContainer=T,this._undoCheckpointOnShow=this._model.createUndoCheckpoint(),w.on("destroy",function(t,e){v._onDestroy(t,e),_&&_.destroy(),u&&u.destroy(),f&&f.destroy(),g&&g.destroy(),m&&m.destroy(),$("select",S).each(function(){$(this).selectbox("detach")})}),t.selectScales&&f.setScalesOpenTab&&f.setScalesOpenTab(),t.selectTmz&&f.setTmzOpenTab&&f.setTmzOpenTab(),!this._model.readOnly()&&u&&u.widget().each(function(t,e){var i,n,s=+$(e).data("layout-tab-priority");isNaN(s)&&(s=o.TAB_PRIORITY_PROPERTIES),i=~~$(e).data("layout-tab-open"),n=$(e).data("layout-tab"),void 0===n&&(n=o.TAB_NAME_PROPERTIES),v.appendToTab(e,n,s,i)}),this._model.readOnly()||!y||_.widget().is(":empty")||_.widget().each(function(t,e){var n,s,r=i(377),a=_ instanceof r,l=+$(e).data("layout-tab-priority");TradingView.isNaN(l)&&(l=a?o.TAB_PRIORITY_COORDINATES:o.TAB_PRIORITY_INPUTS),n=~~$(e).data("layout-tab-open"),s=$(e).data("layout-tab"),void 0===s&&(s=a?o.TAB_NAME_COORDINATES:o.TAB_NAME_INPUTS),v.appendToTab(e,s,l,n)}),f&&f.widget().each(function(t,e){var n,s,r,a=+$(e).data("layout-tab-priority");TradingView.isNaN(a)&&(a=o.TAB_PRIORITY_STYLE),n=~~$(e).data("layout-tab-open"),s=i(367),!n&&f instanceof s&&(n=o.TAB_OPEN_DEFAULT),r=$(e).data("layout-tab"),void 0===r&&(r=o.TAB_NAME_STYLE),v.appendToTab(e,r,a,n)}),g&&g.widget().each(function(t,e){var i,n,s=+$(e).data("layout-tab-priority");TradingView.isNaN(s)&&(s=o.TAB_PRIORITY_DISPLAY),i=~~$(e).data("layout-tab-open"),n=$(e).data("layout-tab"),void 0===n&&(n=o.TAB_NAME_DISPLAY),v.appendToTab(e,n,s,i)}),m&&m.widget().each(function(t,e){v.appendToTab(e,o.TAB_NAME_VISIBILITY,o.TAB_PRIORITY_DISPLAY,!1)}),k=this._source instanceof s&&!TradingView.isMobileView&&!!this._source.metaInfo().pine,k&&this._source.metaInfo(),this.insertTabs(),this._helpItemRequired()&&this._createHelp(),I=110,$(".js-dialog").each(function(){var t=parseInt($(this).css("z-index"),10);t>I&&(I=t)}),w.css("z-index",I),P=$('<div class="main-properties main-properties-aftertabs"></div>').appendTo(S),L=$('<div class="dialog-buttons">').appendTo(P),E=function(){function t(e){e._childs&&e._childs.length&&$.each(e._childs,function(i,o){"percentage"===o?e.percentage.listeners().fire(e.percentage):t(e[o])})}var e=[];f&&"function"==typeof f.defaultProperties&&(e=e.concat(f.defaultProperties())),_&&"function"==typeof _.defaultProperties&&(e=e.concat(_.defaultProperties())),0===e.length&&v._source.properties?e=[v._source.properties()]:v._source._sessionsStudy&&(e=e.concat(v._source._sessionsStudy.properties())),e.length&&($.each(e,function(e,i){v._model.restoreFactoryDefaults(i),v._source.calcIsActualSymbol&&v._source.calcIsActualSymbol(),t(i)}),v._source.properties().minTick&&v._source.properties().minTick.listeners().fire(v._source.properties().minTick),v._source.properties().precision&&v._source.properties().precision.listeners().fire(v._source.properties().precision),_&&_.loadData(),u&&u.loadData(),f.onResoreDefaults&&f.onResoreDefaults(),f&&f.loadData(),m&&m.loadData())},A=function(){m&&m.loadData(),_&&_.loadData()},(!p||window.is_authenticated)&&f&&"function"==typeof f.createTemplateButton&&e.enabled("linetoolpropertieswidget_template_button")?f.createTemplateButton({popupZIndex:I,defaultsCallback:E,loadTemplateCallback:A}).addClass("tv-left").appendTo(L):TradingView.isInherited(this._source.constructor,s)?(V=[{title:$.t("Reset Settings"),action:E},{title:$.t("Save As Default"),action:function(){v._source.properties().saveDefaults()}}],M=$('<a href="#" class="_tv-button tv-left">'+$.t("Defaults")+'<span class="icon-dropdown"></span></a>'),M.on("click",function(t){t.preventDefault();var e=$(this);e.is(".active")||e.trigger("button-popup",[V,!0])}).appendTo(L),l(M,null,{direction:"down",event:"button-popup",notCloseOnButtons:!0,zIndex:I})):$('<a class="_tv-button tv-left">'+$.t("Defaults")+"</a>").appendTo(L).click(E),$('<a class="_tv-button ok">'+$.t("OK")+"</a>").appendTo(L).click(function(){v.hide()}),$('<a class="_tv-button cancel">'+$.t("Cancel")+"</a>").appendTo(L).on("click",d),w.find("._tv-dialog-title a").on("click",d),$(window).bind("keyup.hidePropertyDialog",function(t){13===t.keyCode&&"textarea"!==t.target.tagName.toLowerCase()&&v.hide()}),$("select",S).each(function(){var t=$(this),e="tv-select-container dialog";t.hasClass("tv-select-container-fontsize")&&(e+=" tv-select-container-fontsize"),t.selectbox({speed:100,classHolder:e})}),$('input[type="text"]',S).addClass("tv-text-input inset dialog"),$("input.ticker",S).TVTicker(),w.css("min-width",x+"px"),TVDialogs.applyHandlers(w),D={top:($(window).height()-w.height())/2,left:($(window).width()-w.width())/2},f&&"function"==typeof f.dialogPosition&&(D=f.dialogPosition(D,w)||D),TVDialogs.positionDialog(w,D),window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.hide(),a.emit("edit_object_dialog",{objectType:this._source===this._model.mainSeries()?"mainSeries":this._source instanceof n?"drawing":this._source instanceof s?"study":"other",scriptTitle:this._source.title()}),w},o.prototype._helpItemRequired=function(){return this._source._metaInfo&&!!this._source._metaInfo.helpURL},o.prototype._createHelp=function(){var t=$('<a class="help" href="#" target="_blank" title="'+$.t("Help")+'"></a>');t.attr("href",this._source._metaInfo.helpURL),this._tabContainer.prepend(t)},t.exports=o}).call(e,i(1))},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.FloatBinder,a=s.BooleanBinder,l=s.SliderBinder,h=s.ColorBinding,c=s.SimpleComboBinder,d=i(183),p=d.addColorPicker,u=d.createLineStyleEditor,_=d.createLineWidthEditor,f=d.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e){var i,o,n,s,l,c=e||$("<tr>").appendTo(this._table),d=$("<td>");return d.appendTo(c),i=$("<input type='checkbox' class='visibility-switch'>"),i.appendTo(d),e&&i.css("margin-left","15px"),o=$("<td>"),o.appendTo(c),n=$("<input type='text'>"),n.appendTo(o),n.css("width","70px"),this.bindControl(new r(n,t.coeff,!1,this.model(),"Change Pitchfork Line Coeff")),s=$("<td class='colorpicker-cell'>"),s.appendTo(c),l=p(s),this.bindControl(new a(i,t.visible,!0,this.model(),"Change Fib Retracement Line Visibility")),this.bindControl(new h(l,t.color,!0,this.model(),"Change Fib Retracement Line Color",0)),c},o.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,d,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,M,D,O,B,R,N,F,W;for(this._div=$(document.createElement("div")).addClass("property-page"),t=this._linetool.properties().trendline,e=$("<table>").appendTo(this._div).css("padding-bottom","3px"),t&&(i=$("<tr>").appendTo(e),o=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(o).appendTo(i),$("<td>").append($.t("Trend Line")).appendTo(i),this.bindControl(new a(o,t.visible,!0,this.model(),"Change Fib Retracement Line Visibility")),n=$("<td class='colorpicker-cell'>").appendTo(i),s=p(n),this.bindControl(new h(s,t.color,!0,this.model(),"Change Fib Retracement Line Color",0)),r=$("<td>").appendTo(i),d=_(),d.appendTo(r),this.bindControl(new l(d,t.linewidth,parseInt,this.model(),"Change Fib Retracement Line Width")),m=$("<td>").appendTo(i),g=u(),g.render().appendTo(m),this.bindControl(new c(g,t.linestyle,parseInt,!0,this.model(),"Change Fib Retracement Line Style"))),v=this._linetool.properties().levelsStyle,y=$("<tr>").appendTo(e),$("<td>").appendTo(y),$("<td>"+$.t("Levels Line")+"</td>").appendTo(y),$("<td>").appendTo(y),r=$("<td>").appendTo(y),d=_(),d.appendTo(r),this.bindControl(new l(d,v.linewidth,parseInt,this.model(),"Change Fib Retracement Line Width")),m=$("<td>").appendTo(y),g=u(),g.render().appendTo(m),this.bindControl(new c(g,v.linestyle,parseInt,!0,this.model(),"Change Fib Retracement Line Style")),this._table=$(document.createElement("table")).appendTo(this._div),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),b={},w=0;w<24;w++)S=w%8,y=b[S],T="level"+(w+1),b[S]=this.addLevelEditor(this._linetool.properties()[T],y);this.addOneColorPropertyWidget(this._table),C=$("<table cellpadding=0 cellspacing=0>").appendTo(this._div),x=$("<tr>").appendTo(C),this._linetool.properties().extendLines&&(P=$("<input type='checkbox' class='visibility-switch'>"),L=$("<label>").append(P).append($.t("Extend Lines")),$("<td>").append(L).appendTo(x)),this._linetool.properties().extendLeft&&(k=$("<input type='checkbox' class='visibility-switch'>"),L=$("<label>").append(k).append($.t("Extend Left")),$("<td>").append(L).appendTo(x)),this._linetool.properties().extendRight&&(I=$("<input type='checkbox' class='visibility-switch'>"),L=$("<label>").append(I).append($.t("Extend Right")),$("<td>").append(L).appendTo(x)),this._linetool.properties().reverse&&(E=$("<input type='checkbox' class='visibility-switch'>"),L=$("<label>").append(E).append($.t("Reverse")),$("<td>").append(L).appendTo(x)),A=$("<tr>").appendTo(C),V=$("<input type='checkbox' class='visibility-switch'>"),L=$("<label>").append(V).append($.t("Levels")),$("<td>").append(L).appendTo(A),M=$("<input type='checkbox' class='visibility-switch'>"),L=$("<label>").append(M).append($.t("Prices")),$("<td>").append(L).appendTo(A),D=$("<input type='checkbox' class='visibility-switch'>"),L=$("<label>").append(D).append($.t("Percents")),$("<td>").append(L).appendTo(A),O=$("<table cellspacing='0' cellpadding='0'>").appendTo(this._div),B=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),R=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>"),y=$("<tr>"),y.append("<td>"+$.t("Labels")+"</td>").append(B).append("<td>&nbsp</td>").append(R),y.appendTo(O),N=$("<table cellspacing='0' cellpadding='0'>").appendTo(this._div),y=$("<tr>").appendTo(N),F=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(F).appendTo(y),this.createLabeledCell($.t("Background"),F).appendTo(y),W=f(),$("<td>").append(W).appendTo(y),this.bindControl(new a(M,this._linetool.properties().showPrices,!0,this.model(),"Change Gann Fan Prices Visibility")),this.bindControl(new a(V,this._linetool.properties().showCoeffs,!0,this.model(),"Change Gann Fan Levels Visibility")),this.bindControl(new a(F,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility")),this.bindControl(new l(W,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency")),this._linetool.properties().extendLines&&this.bindControl(new a(P,this._linetool.properties().extendLines,!0,this.model(),"Change Fib Retracement Extend Lines")),this._linetool.properties().extendLeft&&this.bindControl(new a(k,this._linetool.properties().extendLeft,!0,this.model(),"Change Fib Retracement Extend Lines")),this._linetool.properties().extendRight&&this.bindControl(new a(I,this._linetool.properties().extendRight,!0,this.model(),"Change Fib Retracement Extend Lines")),this._linetool.properties().reverse&&this.bindControl(new a(E,this._linetool.properties().reverse,!0,this.model(),"Change Fib Retracement Reverse")),this.bindControl(new c(B,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Fib Labels Horizontal Alignment")),this.bindControl(new c(R,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Fib Labels Vertical Alignment")),this.bindControl(new a(D,this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents")),this.loadData()},o.prototype.widget=function(){return this._div},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e),this._linetool=i,this._templateList=new l(this._linetool._constructor,this.applyTemplate.bind(this))}var n=i(309),s=n.PropertyPage,r=n.ColorBinding,a=i(183).addColorPicker,l=i(368);inherit(o,s),o.prototype.applyTemplate=function(t){this._linetool.restoreTemplate(t),this._model.model().updateSource(this._linetool),this.loadData()},o.prototype.createTemplateButton=function(t){var e=this;return t=$.extend({},t,{getDataForSaveAs:function(){return e._linetool.template()}}),this._templateList.createButton(t)},o.prototype.createOneColorForAllLinesWidget=function(){var t=$("<td class='colorpicker-cell'>");return this.bindControl(new r(a(t),this._linetool.properties().collectibleColors,!0,this.model(),"Change All Lines Color",0)),{label:$("<td>"+$.t("Use one color")+"</td>"),editor:t}},o.prototype.addOneColorPropertyWidget=function(t){var e=this.createOneColorForAllLinesWidget(),i=$("<tr>");i.append($("<td>")).append(e.label).append(e.editor),i.appendTo(t)},o.prototype.appendTemplateRow=function(t){var e,i,o;is_authenticated&&(e=$(document.createElement("tr")),e.appendTo(t),i=$(document.createElement("td")),i.attr("colspan",2),i.appendTo(e),o=$('<div class="dialog-theme-buttons"></div>').appendTo(i),this.templateButton=$(this.createTemplateButton()),this.templateButton.appendTo(o),$('<tr><td class="property-page-separator-cell" colspan="6"><div class="property-page-separator"></div></td></tr>').appendTo(t))},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,i,o){var n={saveAsText:$.t("Save As..."),applyDefaultText:$.t("Apply Defaults")};this._toolName=t,this._applyTemplate=i,this._options=$.extend(n,o||{}),this._list=[],e.enabled("charting_library_base")||(this.templatesDeferred=this.loadData())}var n=i(183),s=n.showChartNameDialog,r=n.bindPopupMenu;o._cache={},o.prototype.getData=function(){return this._list},o.prototype.loadData=function(){var t=this;return this._toolName in o._cache?(this._list=o._cache[this._toolName],$.Deferred().resolve()):$.get("/drawing-templates/"+this._toolName+"/",function(e){t._list=e,o._cache[t._toolName]=e}).error(function(){TradingView.logWarn("Failed to load drawing template: "+t._toolName)})},o.prototype.templatesLoaded=function(){return this.templatesDeferred},o.prototype.invalidateToolCache=function(){delete o._cache[this._toolName]},o.prototype.createButton=function(t){var e,i=this;return t=$.extend({},t,i._options),e=$("<a></span></a>").addClass(t.buttonClass?t.buttonClass:"_tv-button").html(t.buttonInner?t.buttonInner:$.t("Template")+'<span class="icon-dropdown">'),r(e,null,{event:"button-popup",zIndex:t.popupZIndex,activeClass:t.popupActiveClass,direction:t.popupDirection}),e.bind("click",function(e){var o,n,r;e.stopPropagation(),$(this).is("active")||(o=[],"function"==typeof t.getDataForSaveAs&&(n=function(){runOrSignIn(function(){s(function(e){var o=JSON.stringify(t.getDataForSaveAs());i.saveTemplate(e,o)},{title:$.t("Save template as..."),label:$.t("Template name"),error:$.t("Please enter template name")},64)},{source:"Save line tool template",sourceMeta:"Chart"})},o.push({title:t.saveAsText,action:n,addClass:"special"})),"function"==typeof t.defaultsCallback&&o.push({title:t.applyDefaultText,action:t.defaultsCallback,addClass:"special"}),r=[],$.each(i._list,function(e,o){r.push({title:o,action:function(){i.loadTemplate.call(i,o,t.loadTemplateCallback)},deleteAction:function(){runOrSignIn(function(){var t=$.t("Do you realy want to delete {0} template?").format(o?'"'+o+'"':"");TVDialogs.showConfirm($.t("Template"),t,function(){i.removeTemplate.call(i,o)})},{source:"Delete line tool template"})}})}),r.length&&(r.sort(function(t,e){return t=t.title.toUpperCase(),e=e.title.toUpperCase(),t===e?0:t>e?1:-1}),o.push({separator:!0}),o=o.concat(r)),$(this).trigger("button-popup",[o]))}),e},o.prototype.loadTemplate=function(t,e){var i=this;return $.get("/drawing-template/"+this._toolName+"/?templateName="+encodeURIComponent(t),function(t){i._applyTemplate(JSON.parse(t.content)),e&&e()}).error(function(t){TradingView.logWarn(t.responseText)})},o.prototype.removeTemplate=function(t){if(t){var e=this;$.post("/remove-drawing-template/",{name:t,tool:e._toolName}).error(function(t){TradingView.logWarn(t.responseText)}),e.invalidateToolCache(),e._list=$.grep(e._list,function(e){return e!==t})}},o.prototype.saveTemplate=function(t,e){var i,o,n,s,r,a=this;t&&e&&(t=TradingView.clean(t),i=$.inArray(t,a._list)!==-1,o=function(){var o={name:t,tool:a._toolName,content:e},n=function(){i||a._list.push(t)};$.post("/save-drawing-template/",o,n).error(function(t){TradingView.logWarn(t.responseText)}),a.invalidateToolCache()},i?(n=$.t("Confirm replacing"),s=o,r=$.t('Do you realy want to replace "{0}"?').format(t),TVDialogs.showConfirm(n,r,s)):o())},o.prototype.deleteAction=function(t){var e=t,i=this;runOrSignIn(function(){var t=$.t("Do you realy want to delete {0} template?").format(e?'"'+e+'"':"");TVDialogs.showConfirm($.t("Template"),t,function(){i.removeTemplate.call(i,e)})},{source:"Delete line tool template"})},o.prototype.showSaveDialog=function(t){var e=this;runOrSignIn(function(){s(function(i){var o=JSON.stringify(t.template());e.saveTemplate(i,o)},{title:$.t("Save template as..."),label:$.t("Template name"),error:$.t("Please enter template name")},64)},{source:"Save line tool template"})},t.exports=o}).call(e,i(1))},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(366);inherit(o,n),t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.FloatBinder,a=s.SimpleComboBinder,l=s.BooleanBinder,h=s.ColorBinding,c=s.SliderBinder,d=i(183),p=d.addColorPicker,u=d.createLineStyleEditor,_=d.createLineWidthEditor,f=d.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e,i){var o,n,s,d,f,m,g,v,y,b,w=$("<tr>");w.appendTo(this._table),o=$("<td>"),o.appendTo(w),n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),t?(s=$("<td>"),s.appendTo(w),d=$("<input type='text'>"),d.appendTo(s),d.css("width","70px"),this.bindControl(new r(d,e.coeff,!1,this.model(),"Change Pitchfork Line Coeff"))):$("<td>"+$.t("Trend Line")+"</td>").appendTo(w),f=$("<td class='colorpicker-cell'>"),f.appendTo(w),m=p(f),g=$("<td>"),g.appendTo(w),v=_(),v.appendTo(g),t||(y=$("<td>"),y.appendTo(w),b=u(),b.render().appendTo(y),this.bindControl(new a(b,e.linestyle,parseInt,!0,this.model(),"Change Fib Speed Resistance Arcs Style"))),this.bindControl(new l(n,e.visible,!0,this.model(),"Change Fib Speed Resistance Arcs Visibility")),this.bindControl(new h(m,e.color,!0,this.model(),"Change Fib Speed Resistance Arcs Line Color",0)),this.bindControl(new c(v,e.linewidth,!0,this.model(),"Change Fib Speed Resistance Arcs Width"))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s,r;for(this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.addLevelEditor(null,this._linetool.properties().trendline,!1),t=1;t<=11;t++)e="level"+t,this.addLevelEditor("Level "+t,this._linetool.properties()[e],!1);this.addOneColorPropertyWidget(this._table),i=$("<input type='checkbox' class='visibility-switch'>"),o=this.addLabeledRow(this._table,$.t("Levels")),$("<td>").append(i).prependTo(o),this.bindControl(new l(i,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Speed Resistance Arcs Levels Visibility")),n=$("<input type='checkbox' class='visibility-switch'>"),o=this.addLabeledRow(this._table,$.t("Full Circles")),$("<td>").append(n).prependTo(o),this.bindControl(new l(n,this._linetool.properties().fullCircles,!0,this.model(),"Change Fib Speed Resistance Arcs Full Cirlces Mode")),o=$("<tr>"),o.appendTo(this._table),s=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(s).appendTo(o),$("<td>"+$.t("Background")+"</td>").appendTo(o),r=f(),$('<td colspan="3">').append(r).appendTo(o),this.bindControl(new l(s,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Arcs Background Visibility")),this.bindControl(new c(r,this._linetool.properties().transparency,!0,this.model(),"Change Fib Arcs Background Transparency")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SliderBinder,a=s.ColorBinding,l=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=this.createColorPicker(),e=this.createColorPicker(),i=this.addLabeledRow(this._table,"Background"),$("<td>").append(t).appendTo(i),$("<td>").append(e).appendTo(i),o=l(),n=this.createColorPicker(),i=this.addLabeledRow(this._table,"Border"),$("<td>").append(n).appendTo(i),$("<td>").appendTo(i),$("<td>").append(o).appendTo(i),this.bindControl(new a(n,this._linetool.properties().trendline.color,!0,this.model(),"Change Projection Line Color")),this.bindControl(new a(t,this._linetool.properties().color1,!0,this.model(),"Change Projection Background Color",this._linetool.properties().transparency)),this.bindControl(new a(e,this._linetool.properties().color2,!0,this.model(),"Change Projection Background Color",this._linetool.properties().transparency)),this.bindControl(new r(o,this._linetool.properties().linewidth,!0,this.model(),"Change Projection Border Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e,i),this.prepareLayout()}var n=i(161).LineToolElliott,s=i(367),r=i(309),a=r.SimpleComboBinder,l=r.ColorBinding,h=r.SliderBinder,c=r.BooleanBinder,d=i(183).createLineWidthEditor;inherit(o,s),o.prototype.prepareLayout=function(){var t,e,i,o,s,r;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=n.degrees,e=this.createKeyCombo(t),e.width(300),i=this.createColorPicker(),o=$('<input type="checkbox" class="visibility-switch">'),s=this.addLabeledRow(this._table,"Degree"),$("<td>").prependTo(s),$("<td>").append(e).appendTo(s),s=this.addLabeledRow(this._table,"Line Width"),r=d(),$("<td>").prependTo(s),$("<td>").append(r).appendTo(s),s=this.addLabeledRow(this._table,"Color"),$("<td>").prependTo(s),$("<td>").append(i).appendTo(s),s=this.addLabeledRow(this._table,"Show Wave",o),$("<td>").append(o).prependTo(s),this.bindControl(new l(i,this._linetool.properties().color,!0,this.model(),"Change Elliott Label Color")),this.bindControl(new a(e,this._linetool.properties().degree,parseInt,!0,this.model(),"Change Elliott Wave Size")),this.bindControl(new c(o,this._linetool.properties().showWave,!0,this.model(),"Change Elliott Labels Background")),this.bindControl(new h(r,this._linetool.properties().linewidth,parseInt,this.model(),"Change Elliott Wave Line Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){r.call(this,t,e),this._study=i,this.prepareLayout()}var n=i(374),s=i(309),r=s.PropertyPage,a=s.BooleanBinder,l=s.SimpleComboBinder,h=i(354).StudyStylesPropertyPage;inherit(o,r),inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n=$('<table class="property-page" cellspacing="0" cellpadding="2">'),s=$('<table class="property-page" cellspacing="0" cellpadding="2">'),r=$('<table class="property-page" cellspacing="0" cellpadding="2">'),c=$('<table class="property-page" cellspacing="0" cellpadding="2">'),d=$('<table class="property-page" cellspacing="0" cellpadding="2">'),p=this._study.properties();this._prepareSeriesStyleLayout(n,s,r,p),this._table=n.add(s).add(r).add(c).add(d),t=$('<input type="checkbox">'),e=this.addLabeledRow(c,"Price Line",t),$("<td>").append(t).prependTo(e),this.bindControl(new a(t,p.showPriceLine,!0,this.model(),"Change Price Price Line")),i=this.createSeriesMinTickEditor(),o=$("<tr>"),o.appendTo(d),$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(o),$("<td>").append(i).appendTo(o),this.bindControl(new l(i,p.minTick,null,!0,this.model(),"Change MinTick")),h.prototype._putStudyDefaultStyles.call(this,d)},o.prototype.loadData=function(){this.superclass.prototype.loadData.call(this),this.switchStyle()},o.prototype.switchStyle=function(){switch($(this._barsTbody).add(this._barsColorerTbody).add(this._candlesTbody).add(this._candlesColorerTbody).add(this._hollowCandlesTbody).add(this._lineTbody).add(this._areaTbody).css("display","none"),this._study.properties().style.value()){case TradingView.Series.STYLE_BARS:this._barsTbody.css("display","table-row-group"),this._barsColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_CANDLES:this._candlesTbody.css("display","table-row-group"),this._candlesColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._hollowCandlesTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_LINE:this._lineTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_AREA:this._areaTbody.css("display","table-row-group")}},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){(function(e){"use strict";function o(){}var n=i(309),s=n.PropertyPage,r=n.GreateTransformer,a=n.LessTransformer,l=n.ToIntTransformer,h=n.ToFloatTransformer,c=n.SimpleStringBinder,d=n.SimpleComboBinder,p=n.ColorBinding,u=n.BooleanBinder,_=n.SliderBinder,f=i(183),m=f.createLineWidthEditor,g=f.createPriceSourceEditor,v=i(94).NumericFormatter;inherit(o,s),o.prototype.getInputTitle=function(t,e){return e.inputInfo?e.inputInfo[t].name.value():t.toLowerCase().replace(/\b\w/g,function(t){return t.toUpperCase()})},o.prototype.prepareLayoutImpl=function(t,e,i,o){function n(e){u.refreshStateControls(p,t.inputs,i.inputs)}function s(t){return(new v).format(t)}var p,u,_,f,m,g,y,b,w,S,T,C,x,P,L,k,I;for(o=o||{},p={},u=this,_=0;_<t.inputs.length;_++){if(f=t.inputs[_],m=f.id,g=this.getInputTitle(m,i),y=$("<tr/>"),y.appendTo(e),b=$("<td/>"),b.appendTo(y),b.addClass("propertypage-name-label"),b.text($.t(g)),w=$("<td"+(o.valueColspan?' colspan = "'+o.valueColspan+'"':"")+"/>"),w.appendTo(y),S=null,f.options)for(S=$("<select/>"),T=0;T<f.options.length;T++)C=f.options[T],$("<option value='"+C+"'>"+$.t(C)+"</option>").appendTo(S);else S=$("<input/>"),"bool"===f.type?S.attr("type","checkbox"):S.attr("type","text");S.appendTo(w),S.css("width","100px"),x="Change "+g,f.options?this.bindControl(new d(S,i.inputs[m],null,!0,this.model(),x)):"integer"===f.type?(P=[l(f.defval)],f.min&&P.push(r(f.min)),f.max&&P.push(a(f.max)),this.bindControl(new c(S,i.inputs[m],P,!1,this.model(),x)),S.addClass("ticker")):"float"===f.type?(P=[h(f.defval)],f.min&&((("BarSetRenko@tv-prostudies"===t.id||"BarSetPnF@tv-prostudies"===t.id)&&"boxSize"===f.id||"BarSetKagi@tv-prostudies"===t.id&&"reversalAmount"===f.id)&&(k=this._model.model().mainSeries().symbolInfo(),L=k.minmov/k.pricescale),P.push(r(L||f.min))),f.max&&P.push(a(f.max)),I=new c(S,i.inputs[m],P,!1,this.model(),x),I.addFormatter(s),this.bindControl(I),S.addClass("ticker")):"text"===f.type&&this.bindControl(new c(S,this._property.inputs[m],null,!1,this.model(),x)),S.change(n),p[f.id]=y}this.refreshStateControls(p,t.inputs,i.inputs)},o.prototype.getMetaInfo=function(t){var e,i=this._model.m_model._studiesMetaData;for(e=0;e<i.length;e++)if(i[e].id===t)return i[e];return null},o.prototype._prepareSeriesStyleLayout=function(t,o,n,s){var r,a,l,h,c,f,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,M,D,O,B,R,N,F,W,z,H,U,j,q,Y,G,K,X,Z,J,Q,tt,et,it,ot,nt,st,rt,at,lt,ht,ct,dt,pt,ut,_t,ft,mt,gt,vt,yt,bt,wt,St,Tt,Ct,xt,Pt,Lt=i(373),kt=$("<tbody>").appendTo(t),It=this._candlesColorerTbody=$("<tbody>").appendTo(o),Et=this._barsColorerTbody=$("<tbody>").appendTo(o),At=this._haColorerTbody=$("<tbody>").appendTo(o),Vt=this._candlesTbody=$("<tbody>").appendTo(n),Mt=this._hollowCandlesTbody=$("<tbody>").appendTo(n),$t=this._haTbody=$("<tbody>").appendTo(n),Dt=this._barsTbody=$("<tbody>").appendTo(n),Ot=this._lineTbody=$("<tbody>").appendTo(n),Bt=this._areaTbody=$("<tbody>").appendTo(n),Rt=this._renkoTbody=$("<tbody>").appendTo(n),Nt=this._pbTbody=$("<tbody>").appendTo(n),Ft=this._kagiTbody=$("<tbody>").appendTo(n),Wt=this._pnfTbody=$("<tbody>").appendTo(n),zt=this.addLabeledRow(kt,"Style"),Ht=$(document.createElement("td")).appendTo(zt);Ht.addClass("property-wide-select"),r=$(document.createElement("select")),$("<option value="+TradingView.Series.STYLE_BARS+">"+$.t("Bars")+"</option>").appendTo(r),$("<option value="+TradingView.Series.STYLE_CANDLES+">"+$.t("Candles")+"</option>").appendTo(r),$("<option value="+TradingView.Series.STYLE_HOLLOW_CANDLES+">"+$.t("Hollow Candles")+"</option>").appendTo(r),this instanceof Lt||$("<option value="+TradingView.Series.STYLE_HEIKEN_ASHI+">"+$.t("Heikin Ashi")+"</option>").appendTo(r),$("<option value="+TradingView.Series.STYLE_LINE+">"+$.t("Line")+"</option>").appendTo(r),$("<option value="+TradingView.Series.STYLE_AREA+">"+$.t("Area")+"</option>").appendTo(r),r.css("width","100px").appendTo(Ht),this.switchStyle(),a=function(t){this._undoModel.setChartStyleProperty(this._property,t,this._undoText)},this.bindControl(new d(r,s.style,parseInt,!0,this.model(),"Change Series Style",a)),s.style.listeners().subscribe(this,this.switchStyle),l=this.createColorPicker(),h=this.createColorPicker(),c=this.createColorPicker(),f=this.createColorPicker(),v=this.createColorPicker(),y=this.createColorPicker(),b=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(v).add(y)),w=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(c)),S=$("<input type='checkbox'/>"),T=this.addLabeledRow(It,"Color bars based on previous close",S),$("<td>").append(S).prependTo(T),T=this.addLabeledRow(Vt,"Candles"),$("<td>").prependTo(T),$("<td>").append(l).appendTo(T),$("<td>").append(h).appendTo(T),T=this.addLabeledRow(Vt,"Borders",b),$("<td>").append(b).prependTo(T),$("<td>").append(v).appendTo(T),$("<td>").append(y).appendTo(T),T=this.addLabeledRow(Vt,"Wick",w),$("<td>").append(w).prependTo(T),$("<td>").append(c).appendTo(T),$("<td>").append(f).appendTo(T),this.bindControl(new p(l,s.candleStyle.upColor,!0,this.model(),"Change Candle Up Color")),this.bindControl(new p(h,s.candleStyle.downColor,!0,this.model(),"Change Candle Down Color")),this.bindControl(new u(w,s.candleStyle.drawWick,!0,this.model(),"Change Candle Wick Visibility")),this.bindControl(new p(c,s.candleStyle.wickUpColor,!0,this.model(),"Change Candle Wick Up Color")),this.bindControl(new p(f,s.candleStyle.wickDownColor,!0,this.model(),"Change Candle Wick Down Color")),this.bindControl(new u(b,s.candleStyle.drawBorder,!0,this.model(),"Change Candle Border Visibility")),this.bindControl(new p(v,s.candleStyle.borderUpColor,!0,this.model(),"Change Candle Up Border Color")),this.bindControl(new p(y,s.candleStyle.borderDownColor,!0,this.model(),"Change Candle Down Border Color")),this.bindControl(new u(S,s.candleStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close")),C=this.createColorPicker(),x=this.createColorPicker(),P=this.createColorPicker(),L=this.createColorPicker(),k=this.createColorPicker(),I=this.createColorPicker(),E=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(k).add(I)),A=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(P)),T=this.addLabeledRow(Mt,"Candles"),$("<td>").prependTo(T),$("<td>").append(C).appendTo(T),$("<td>").append(x).appendTo(T),T=this.addLabeledRow(Mt,"Borders",E),$("<td>").append(E).prependTo(T),$("<td>").append(k).appendTo(T),$("<td>").append(I).appendTo(T),T=this.addLabeledRow(Mt,"Wick",A),$("<td>").append(A).prependTo(T),$("<td>").append(P).appendTo(T),$("<td>").append(L).appendTo(T),this.bindControl(new p(C,s.hollowCandleStyle.upColor,!0,this.model(),"Change Hollow Candle Up Color")),this.bindControl(new p(x,s.hollowCandleStyle.downColor,!0,this.model(),"Change Hollow Candle Down Color")),this.bindControl(new u(A,s.hollowCandleStyle.drawWick,!0,this.model(),"Change Hollow Candle Wick Visibility")),this.bindControl(new p(P,s.hollowCandleStyle.wickUpColor,!0,this.model(),"Change Hollow Candle Wick Up Color")),this.bindControl(new p(L,s.hollowCandleStyle.wickDownColor,!0,this.model(),"Change Hollow Candle Down Wick Color")),this.bindControl(new u(E,s.hollowCandleStyle.drawBorder,!0,this.model(),"Change Hollow Candle Border Visibility")),this.bindControl(new p(k,s.hollowCandleStyle.borderUpColor,!0,this.model(),"Change Hollow Candle Up Border Color")),this.bindControl(new p(I,s.hollowCandleStyle.borderDownColor,!0,this.model(),"Change Hollow Candle Down Border Color")),V=$("<input type='checkbox'/>"),T=this.addLabeledRow(Et,"Color bars based on previous close",V),$("<td>").append(V).prependTo(T),M=$("<input type='checkbox'/>"),T=this.addLabeledRow(Et,"HLC Bars",M),$("<td>").append(M).prependTo(T),D=this.addColorPickerRow(Dt,"Up Color"),O=this.addColorPickerRow(Dt,"Down Color"),this.bindControl(new p(D,s.barStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new p(O,s.barStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new u(V,s.barStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close")),this.bindControl(new u(M,s.barStyle.dontDrawOpen,!0,this.model(),"Change HLC Bars")),B=g(),T=this.addLabeledRow(Ot,"Price Source"),$('<td colspan="3">').append(B).appendTo(T),R=this.addLabeledRow(Ot,"Type"),N=$('<td colspan="3">').appendTo(R),N.addClass("property-wide-select"),F=$(document.createElement("select")),$("<option value="+TradingView.Series.STYLE_LINE_TYPE_SIMPLE+">"+$.t("Simple")+"</option>").appendTo(F),$("<option value="+TradingView.Series.STYLE_LINE_TYPE_MARKERS+">"+$.t("With Markers")+"</option>").appendTo(F),$("<option value="+TradingView.Series.STYLE_LINE_TYPE_STEP+">"+$.t("Step")+"</option>").appendTo(F),F.appendTo(N),T=this.addLabeledRow(Ot,"Line"),W=this.createColorPicker(),z=m(),$("<td>").append(W).appendTo(T),$("<td>").append(z).appendTo(T),this.bindControl(new d(B,s.lineStyle.priceSource,null,!0,this.model(),"Change Price Source")),this.bindControl(new d(F,s.lineStyle.styleType,parseInt,!0,this.model(),"Change Line Type")),this.bindControl(new p(W,s.lineStyle.color,!0,this.model(),"Change Line Color")),this.bindControl(new _(z,s.lineStyle.linewidth,!0,this.model(),"Change Line Width")),s.haStyle&&(H=this.createColorPicker(),U=this.createColorPicker(),j=this.createColorPicker(),q=this.createColorPicker(),Y=this.createColorPicker(),G=this.createColorPicker(),K=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(Y).add(G)),X=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(j)),Z=$("<input type='checkbox'/>"),T=this.addLabeledRow(At,$.t("Color bars based on previous close"),Z),$("<td>").append(Z).prependTo(T),T=this.addLabeledRow($t,$.t("Candles")),$("<td>").prependTo(T),$("<td>").append(H).appendTo(T),$("<td>").append(U).appendTo(T),T=this.addLabeledRow($t,$.t("Borders"),K),$("<td>").append(K).prependTo(T),$("<td>").append(Y).appendTo(T),$("<td>").append(G).appendTo(T),T=this.addLabeledRow($t,$.t("Wick"),X),$("<td>").append(X).prependTo(T),$("<td>").append(j).appendTo(T),$("<td>").append(q).appendTo(T),this.bindControl(new p(H,s.haStyle.upColor,!0,this.model(),"Change Heikin Ashi Up Color")),this.bindControl(new p(U,s.haStyle.downColor,!0,this.model(),"Change Heikin Ashi Down Color")),this.bindControl(new u(X,s.haStyle.drawWick,!0,this.model(),"Change Heikin Ashi Wick Visibility")),this.bindControl(new p(j,s.haStyle.wickUpColor,!0,this.model(),"Change Heikin Ashi Wick Up Color")),this.bindControl(new p(q,s.haStyle.wickDownColor,!0,this.model(),"Change Heikin Ashi Wick Down Color")),this.bindControl(new u(K,s.haStyle.drawBorder,!0,this.model(),"Change Heikin Ashi Border Visibility")),this.bindControl(new p(Y,s.haStyle.borderUpColor,!0,this.model(),"Change Heikin Ashi Up Border Color")),this.bindControl(new p(G,s.haStyle.borderDownColor,!0,this.model(),"Change Heikin Ashi Down Border Color")),this.bindControl(new u(Z,s.haStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close"))),this instanceof Lt||e.enabled("charting_library_base")||($("<option value="+TradingView.Series.STYLE_RENKO+">"+$.t("Renko")+"</option>").appendTo(r),$("<option value="+TradingView.Series.STYLE_PB+">"+$.t("Line Break")+"</option>").appendTo(r),$("<option value="+TradingView.Series.STYLE_KAGI+">"+$.t("Kagi")+"</option>").appendTo(r),$("<option value="+TradingView.Series.STYLE_PNF+">"+$.t("Point & Figure")+"</option>").appendTo(r),J=this.createColorPicker(),Q=this.createColorPicker(),T=this.addLabeledRow(Rt,"Up bars"),$('<td class="some-colorpicker">').append(J).append(Q).appendTo(T),tt=this.createColorPicker(),et=this.createColorPicker(),T=this.addLabeledRow(Rt,"Down bars"),$('<td class="some-colorpicker">').append(tt).append(et).appendTo(T),it=this.createColorPicker(),ot=this.createColorPicker(),T=this.addLabeledRow(Rt,"Projection up bars"),$('<td class="some-colorpicker">').append(it).append(ot).appendTo(T),nt=this.createColorPicker(),st=this.createColorPicker(),T=this.addLabeledRow(Rt,"Projection down bars"),$('<td class="some-colorpicker">').append(nt).append(st).appendTo(T),this.prepareLayoutImpl(this.getMetaInfo("BarSetRenko@tv-prostudies"),Rt,s.renkoStyle),this.bindControl(new p(J,s.renkoStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new p(tt,s.renkoStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new p(it,s.renkoStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new p(nt,s.renkoStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),this.bindControl(new p(Q,s.renkoStyle.borderUpColor,!0,this.model(),"Change Border Bar Up Color")),this.bindControl(new p(et,s.renkoStyle.borderDownColor,!0,this.model(),"Change Border Bar Down Color")),this.bindControl(new p(ot,s.renkoStyle.borderUpColorProjection,!0,this.model(),"Change Projection Border Bar Up Color")),this.bindControl(new p(st,s.renkoStyle.borderDownColorProjection,!0,this.model(),"Change Projection Border Bar Down Color")),rt=this.createColorPicker(),at=this.createColorPicker(),T=this.addLabeledRow(Nt,"Up bars"),$('<td class="some-colorpicker">').append(rt).append(at).appendTo(T),lt=this.createColorPicker(),ht=this.createColorPicker(),T=this.addLabeledRow(Nt,"Down bars"),$('<td class="some-colorpicker">').append(lt).append(ht).appendTo(T),ct=this.createColorPicker(),dt=this.createColorPicker(),T=this.addLabeledRow(Nt,"Projection up bars"),$('<td class="some-colorpicker">').append(ct).append(dt).appendTo(T),pt=this.createColorPicker(),ut=this.createColorPicker(),T=this.addLabeledRow(Nt,"Projection down bars"),$('<td class="some-colorpicker">').append(pt).append(ut).appendTo(T),this.prepareLayoutImpl(this.getMetaInfo("BarSetPriceBreak@tv-prostudies"),Nt,s.pbStyle,{valueColspan:2}),this.bindControl(new p(rt,s.pbStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new p(lt,s.pbStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new p(ct,s.pbStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new p(pt,s.pbStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),this.bindControl(new p(at,s.pbStyle.borderUpColor,!0,this.model(),"Change Border Bar Up Color")),this.bindControl(new p(ht,s.pbStyle.borderDownColor,!0,this.model(),"Change Border Bar Down Color")),this.bindControl(new p(dt,s.pbStyle.borderUpColorProjection,!0,this.model(),"Change Projection Border Bar Up Color")),this.bindControl(new p(ut,s.pbStyle.borderDownColorProjection,!0,this.model(),"Change Projection Border Bar Down Color")),_t=this.addColorPickerRow(Ft,"Up bars"),ft=this.addColorPickerRow(Ft,"Down bars"),mt=this.addColorPickerRow(Ft,"Projection up bars"),gt=this.addColorPickerRow(Ft,"Projection down bars"),this.prepareLayoutImpl(this.getMetaInfo("BarSetKagi@tv-prostudies"),Ft,s.kagiStyle),this.bindControl(new p(_t,s.kagiStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new p(ft,s.kagiStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new p(mt,s.kagiStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new p(gt,s.kagiStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),vt=this.addColorPickerRow(Wt,"Up bars"),yt=this.addColorPickerRow(Wt,"Down bars"),bt=this.addColorPickerRow(Wt,"Projection up bars"),wt=this.addColorPickerRow(Wt,"Projection down bars"),this.prepareLayoutImpl(this.getMetaInfo("BarSetPnF@tv-prostudies"),Wt,s.pnfStyle),this.bindControl(new p(vt,s.pnfStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new p(yt,s.pnfStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new p(bt,s.pnfStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new p(wt,s.pnfStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color"))),St=g(),T=this.addLabeledRow(Bt,"Price Source"),$('<td colspan="3">').appendTo(T).append(St),Tt=this.createColorPicker(),Ct=m(),T=this.addLabeledRow(Bt,"Line"),$("<td>").appendTo(T).append(Tt),$('<td colspan="2">').appendTo(T).append(Ct),xt=this.createColorPicker(),Pt=this.createColorPicker(),T=this.addLabeledRow(Bt,"Fill"),$("<td>").appendTo(T).append(xt),$("<td>").appendTo(T).append(Pt),this.bindControl(new d(St,s.areaStyle.priceSource,null,!0,this.model(),"Change Price Source")),this.bindControl(new p(Tt,s.areaStyle.linecolor,!0,this.model(),"Change Line Color")),this.bindControl(new _(Ct,s.areaStyle.linewidth,!0,this.model(),"Change Line Width")),this.bindControl(new p(xt,s.areaStyle.color1,!0,this.model(),"Change Line Color",s.areaStyle.transparency)),this.bindControl(new p(Pt,s.areaStyle.color2,!0,this.model(),"Change Line Color",s.areaStyle.transparency))},t.exports=o}).call(e,i(1))},function(t,e,i){"use strict";function o(t,e){s.call(this,t,e),this.prepareLayout()}var n=i(309),s=n.PropertyPage,r=n.SimpleComboBinder;inherit(o,s),o.prototype.prepareLayout=function(){var t,e;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=this.createKeyCombo({open:$.t("Open"),high:$.t("High"),low:$.t("Low"),close:$.t("Close")}),e=this.addLabeledRow(this._table,$.t("Source",{context:"compare"})),$("<td>").appendTo(e).append(t),this.bindControl(new r(t,this._property.inputs.source,null,!0,this.model(),"Change Price Source")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e),this._linetool=i,this.prepareLayout()}var n=i(309).PropertyPage,s=i(354).StudyInputsPropertyPage,r=i(377),a=i(139);inherit(o,r),o.prototype.prepareLayout=function(){var t,e,o,n,r,l,h,c,d=i(365),p=$('<table class="property-page" cellspacing="0" cellpadding="0">'),u=$('<table class="property-page" cellspacing="0" cellpadding="0">').data({"layout-tab":d.TAB_NAME_INPUTS,"layout-tab-priority":d.TAB_PRIORITY_INPUTS});for(this._table=p.add(u),t=this._linetool.points(),e=0;e<t.length;e++)o=$("<tr>"),o.appendTo(p),n=$("<td>"),n.html("Point "+(e+1)+" Bar #"),n.appendTo(o),r=$("<td>"),r.appendTo(o),l=$("<input type='text'>"),l.appendTo(r),l.addClass("ticker"),h=this._linetool.properties().points[e],this.bindBarIndex(h.bar,l,this.model(),"Change "+this._linetool+" point bar index");c=a.findStudyMetaInfo(this._model.studiesMetaData(),this._linetool.studyId()),s.prototype.prepareLayoutImpl.call(this,c,u)},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e),this._linetool=i,this.prepareLayout()}var n=i(309),s=n.PropertyPage,r=n.GreateTransformer,a=n.LessTransformer,l=n.ToIntTransformer,h=n.SimpleStringBinder;i(70),inherit(o,s),o.BarIndexPastLimit=-5e4,o.BarIndexFutureLimit=15e3,o.prototype.bindBarIndex=function(t,e,i,n){var s=[l(t.value()),r(o.BarIndexPastLimit),a(o.BarIndexFutureLimit)];this.bindControl(new h(e,t,s,!1,i,n))},o.prototype.createPriceEditor=function(t){var e,i=this._linetool.ownerSource().formatter(),o=function(t){return i.format(t)},n=function(t){var e=i.parse(t);if(e.res)return e.price?e.price:e.value},s=$("<input type='text'>");return s.TVTicker({step:i._minMove/i._priceScale||1,formatter:o,parser:n}),t&&(e=[function(e){var i=n(e);return void 0===i?t.value():i}],this.bindControl(new h(s,t,e,!1,this.model(),"Change "+this._linetool+" point price")).addFormatter(function(t){return i.format(t)})),s},o.prototype._createPointRow=function(t,e,i){var o,n,s,r,a,l=$("<tr>"),h=$("<td>");return h.html($.t("Price")+i),h.appendTo(l),o=$("<td>"),o.appendTo(l),n=this.createPriceEditor(e.price),n.appendTo(o),s=$("<td>"),s.html($.t("Bar #")),s.appendTo(l),r=$("<td>"),r.appendTo(l),a=$("<input type='text'>"),a.appendTo(r),a.addClass("ticker"),this.bindBarIndex(e.bar,a,this.model(),"Change "+this._linetool+" point bar index"),l},o.prototype.prepareLayoutForTable=function(t){var e,i,o,n,s,r=this._linetool.points(),a=r.length;for(e=0;e<r.length;e++)i=r[e],(o=this._linetool.properties().points[e])&&(n=e||a>1?" "+(e+1):"",s=this._createPointRow(i,o,n),s.appendTo(t))},o.prototype.prepareLayout=function(){this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.prepareLayoutForTable(this._table),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e,i),this.prepareLayout()}function n(t,e,i){r.call(this,t,e,i)}var s=i(367),r=i(377),a=i(309),l=a.BooleanBinder,h=a.SimpleComboBinder,c=a.SimpleStringBinder,d=a.ColorBinding,p=a.SliderBinder,u=i(183),_=u.createLineStyleEditor,f=u.createLineWidthEditor;inherit(o,s),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,a,u,m,g,v,y,b;this._res=$("<div>"),this._table=$('<table class="property-page" cellspacing="0" cellpadding="2" style="width:100%"></table>').appendTo(this._res),t=f(),e=_(),i=this.createColorPicker(),o=this.addLabeledRow(this._table,"Line"),$("<td>").append(i).appendTo(o),$("<td>").append(t).appendTo(o),$('<td colspan="3">').append(e.render().css("display","block")).appendTo(o),n=$("<input type='checkbox' class='visibility-switch'>"),o=$("<tr>").appendTo(this._table),$('<td colspan="3">').append($("<label>").append(n).append($.t("Show Price"))).prependTo(o),s=$("<input type='checkbox'>"),o=$("<tr>").appendTo(this._table),$('<td colspan="3">').append($("<label>").append(s).append($.t("Show Text"))).prependTo(o),o=this.addLabeledRow(this._table,"Text:"),r=this.createColorPicker(),a=this.createFontSizeEditor(),u=this.createFontEditor(),m=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),g=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),$("<td>").append(r).appendTo(o),$("<td>").append(u).appendTo(o),$("<td>").append(a).appendTo(o),$("<td>").append(m).appendTo(o),$("<td>").append(g).appendTo(o),o=$("<tr>").appendTo(this._table),$("<td colspan='2'>").append($.t("Text Alignment:")).appendTo(o),v=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),y=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>").data("selectbox-css",{display:"block"}),$("<td>").append(v).appendTo(o),$("<td colspan='3'>").append(y).appendTo(o),b=$("<textarea rows='7' cols='60'>").css("width","100%"),o=$("<tr>").appendTo(this._table),$("<td colspan='7'>").append(b).appendTo(o),this.bindControl(new l(s,this._linetool.properties().showLabel,!0,this.model(),"Change Horz Line Text Visibility")),this.bindControl(new h(v,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment")),this.bindControl(new h(y,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment")),this.bindControl(new c(b,this._linetool.properties().text,null,!0,this.model(),"Change Text")),this.bindControl(new l(n,this._linetool.properties().showPrice,!0,this.model(),"Change Horz Line Price Visibility")),this.bindControl(new d(i,this._linetool.properties().linecolor,!0,this.model(),"Change Horz Line Color")),this.bindControl(new h(e,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Horz Line Style")),this.bindControl(new p(t,this._linetool.properties().linewidth,!0,this.model(),"Change Horz Line Width")),this.bindControl(new h(a,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new h(u,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new d(r,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color")),this.bindControl(new l(m,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new l(g,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),this.loadData()},o.prototype.widget=function(){return this._res},inherit(n,r),n.prototype.prepareLayout=function(){var t,e,i,o;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),(t=this._linetool.points()[0])&&(e=this._linetool.properties().points[0],i=this.createPriceEditor(e.price),o=$("<tr>").appendTo(this._table),$("<td>"+$.t("Price")+"</td>").appendTo(o),$("<td>").append(i).appendTo(o),this.loadData())},e.LineToolHorzLineStylesPropertyPage=o,e.LineToolHorzLineInputsPropertyPage=n},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e,i),this.prepareLayout()}function n(t,e,i){r.call(this,t,e,i)}var s=i(367),r=i(377),a=i(309),l=a.GreateTransformer,h=a.LessTransformer,c=a.ToFloatTransformer,d=a.ColorBinding,p=a.BooleanBinder,u=a.SimpleComboBinder,_=a.SimpleStringBinder,f=a.SliderBinder,m=i(183),g=m.createLineStyleEditor,v=m.createLineWidthEditor,y=i(94),b=y.NumericFormatter;inherit(o,s),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,a,l,h,c,_,m,y,b,w;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$("<tbody>").appendTo(this._table),e=v(),i=g(),o=this.createColorPicker(),n=this.addLabeledRow(t,$.t("Line")),$("<td>").append(o).appendTo(n),$("<td>").append(e).appendTo(n),$('<td colspan="3">').append(i.render()).appendTo(n),s=$("<tbody>").appendTo(this._table),n=this.addLabeledRow(s,$.t("Text")),r=this.createColorPicker(),a=this.createFontSizeEditor(),l=this.createFontEditor(),h=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),c=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),$("<td>").append(r).appendTo(n),$("<td>").append(l).appendTo(n),$("<td>").append(a).appendTo(n),$("<td>").append(h).appendTo(n),$("<td>").append(c).appendTo(n),_=$('<input type="checkbox">'),m=$('<input type="checkbox">'),n=this.addLabeledRow(s,$.t("Extend Right End")),$('<td colspan="3">').appendTo(n).append(_),n=this.addLabeledRow(s,$.t("Extend Left End")),$('<td colspan="3">').appendTo(n).append(m),y=$('<input type="checkbox">'),b=$('<input type="checkbox">'),w=$('<input type="checkbox">'),n=this.addLabeledRow(s,$.t("Show Price Range")),$('<td colspan="3">').appendTo(n).append(y),n=this.addLabeledRow(s,$.t("Show Bars Range")),$('<td colspan="3">').appendTo(n).append(b),n=this.addLabeledRow(s,$.t("Always Show Stats")),$('<td colspan="3">').appendTo(n).append(w),this.bindControl(new p(y,this._linetool.properties().showPriceRange,!0,this.model(),"Change Trend Line Show Price Range")),this.bindControl(new p(b,this._linetool.properties().showBarsRange,!0,this.model(),"Change Trend Line Show Bars Range")),this.bindControl(new u(a,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new u(l,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new d(r,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color")),this.bindControl(new p(h,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new p(c,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),this.bindControl(new d(o,this._linetool.properties().linecolor,!0,this.model(),"Change Trend Line Color")),this.bindControl(new u(i,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Trend Line Style")),this.bindControl(new f(e,this._linetool.properties().linewidth,!0,this.model(),"Change Trend Line Width")),this.bindControl(new p(_,this._linetool.properties().extendRight,!0,this.model(),"Change Trend Angle Extending Right")),this.bindControl(new p(m,this._linetool.properties().extendLeft,!0,this.model(),"Change Trend Angle Extending Left")),this.bindControl(new p(w,this._linetool.properties().alwaysShowStats,!0,this.model(),"Change Trend Line Always Show Stats")),this.loadData()},o.prototype.widget=function(){return this._table},inherit(n,r),n.prototype.prepareLayout=function(){var t,e,i,o,n,s;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=this._linetool.points()[0],e=this._linetool.properties().points[0],t&&e&&(i=this._createPointRow(t,e,""),this._table.append(i),i=$("<tr>").appendTo(this._table),$("<td>").append($.t("Angle")).appendTo(i),o=$("<input type='text'>"),$("<td>").append(o).appendTo(i),n=[c(e.price.value()),l(-360),h(360)],s=new _(o,this._linetool.properties().angle,n,!1,this.model(),"Change angle"),s.addFormatter(function(t){return(new b).format(t)}),this.bindControl(s),this.loadData())},n.prototype.widget=function(){return this._table},e.LineToolTrendAngleStylesPropertyPage=o,e.LineToolTrendAngleInputsPropertyPage=n},function(t,e,i){"use strict";function o(t,e,i){r.call(this,t,e,i),this.prepareLayout()}function n(t,e,i){s.call(this,t,e,i),this.prepareLayout()}var s=i(367),r=i(377),a=i(309),l=a.LessTransformer,h=a.GreateTransformer,c=a.ToIntTransformer,d=a.ToFloatTransformer,p=a.SimpleStringBinder,u=a.ColorBinding,_=a.SliderBinder,f=a.SimpleComboBinder,m=i(183).createLineWidthEditor,g=i(94).NumericFormatter;inherit(o,r),o.prototype.prepareLayout=function(){function t(t){return(new g).format(t)}var e,i,o,n,s,r,a,u,_,f,m,v;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),e=$("<tbody>").appendTo(this._table),i=this.addLabeledRow(e,"Stop Level. Ticks:"),o=$("<input type='text'>"),$("<td>").append(o).appendTo(i),o.addClass("ticker"),n=$("<input type='text'>"),$("<td>"+$.t("Price:")+"</td>").appendTo(i),$("<td>").append(n).appendTo(i),s=this.addLabeledRow(e,"Entry price:"),r=$("<input type='text'>"),$('<td colspan="2">').append(r).appendTo(s),a=this.addLabeledRow(e,"Profit Level. Ticks:"),u=$("<input type='text'>"),$("<td>").append(u).appendTo(a),u.addClass("ticker"),_=$("<input type='text'>"),$("<td>"+$.t("Price:")+"</td>").appendTo(a),$("<td>").append(_).appendTo(a),"LineToolRiskRewardLong"===this._linetool.getConstructor()&&(i.detach().appendTo(e),a.detach().prependTo(e)),f=[c(this._linetool.properties().stopLevel.value()),h(0),l(1e9)],this.bindControl(new p(o,this._linetool.properties().stopLevel,f,!1,this.model(),"Change "+this._linetool+" stop level")),f=[c(this._linetool.properties().profitLevel.value()),h(0),l(1e9)],this.bindControl(new p(u,this._linetool.properties().profitLevel,f,!1,this.model(),"Change "+this._linetool+" profit level")),f=[d(this._linetool.properties().entryPrice.value())],m=new p(r,this._linetool.properties().entryPrice,f,!1,this.model(),"Change "+this._linetool+" entry price"),m.addFormatter(t),this.bindControl(m),v=this,f=[d(this._linetool.properties().stopPrice.value()),function(t){return v._linetool.preparseStopPrice(t)}],m=new p(n,this._linetool.properties().stopPrice,f,!1,this.model(),"Change "+this._linetool+" stop price"),m.addFormatter(t),this.bindControl(m),f=[d(this._linetool.properties().targetPrice.value()),function(t){return v._linetool.preparseProfitPrice(t)}],m=new p(_,this._linetool.properties().targetPrice,f,!1,this.model(),"Change "+this._linetool+" stop price"),m.addFormatter(t),this.bindControl(m)},o.prototype.widget=function(){return this._table},inherit(n,s),n.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,a,l;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$("<tbody>").appendTo(this._table),e=m(),i=this.createColorPicker(),o=this.addLabeledRow(t,"Lines"),$("<td>").append(i).appendTo(o),$("<td>").append(e).appendTo(o),o=this.addLabeledRow(t,"Stop Color:"),n=this.createColorPicker(),$("<td>").append(n).appendTo(o),o=this.addLabeledRow(t,"Target Color:"),s=this.createColorPicker(),$("<td>").append(s).appendTo(o),o=this.addLabeledRow(t,"Text:"),r=this.createColorPicker(),a=this.createFontSizeEditor(),l=this.createFontEditor(),$("<td>").append(r).appendTo(o),$("<td>").append(l).appendTo(o),$("<td>").append(a).appendTo(o),this.bindControl(new u(i,this._linetool.properties().linecolor,!0,this.model(),"Change Risk/Reward line Color")),this.bindControl(new _(e,this._linetool.properties().linewidth,!0,this.model(),"Change Risk/Reward line width")),this.bindControl(new u(n,this._linetool.properties().stopBackground,!0,this.model(),"Change stop color",this._linetool.properties().stopBackgroundTransparency)),this.bindControl(new u(s,this._linetool.properties().profitBackground,!0,this.model(),"Change target color",this._linetool.properties().profitBackgroundTransparency)),this.bindControl(new f(a,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new f(l,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new u(r,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color")),this.loadData()},n.prototype.widget=function(){return this._table},e.LineToolRiskRewardInputsPropertyPage=o,e.LineToolRiskRewardStylesPropertyPage=n},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e,i),this.prepareLayout()}function n(t,e,i){r.call(this,t,e,i)}var s=i(367),r=i(377),a=i(309),l=a.BooleanBinder,h=a.SimpleComboBinder,c=a.SliderBinder,d=a.ColorBinding,p=i(183),u=p.createLineStyleEditor,_=p.createLineWidthEditor;inherit(o,s),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=_(),e=u(),i=this.createColorPicker(),o=this.addLabeledRow(this._table,"Line"),$("<td>").prependTo(o),$("<td>").append(i).appendTo(o),$("<td>").append(t).appendTo(o),$("<td>").append(e.render()).appendTo(o),n=$("<input type='checkbox' class='visibility-switch'>"),o=$("<tr>").appendTo(this._table),$("<td>").append(n).prependTo(o),this.createLabeledCell(2,"Show Time",n).appendTo(o),this.bindControl(new l(n,this._linetool.properties().showTime,!0,this.model(),"Change Vert Line Time Visibility")),this.bindControl(new d(i,this._linetool.properties().linecolor,!0,this.model(),"Change Vert Line Color")),this.bindControl(new h(e,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Vert Line Style")),this.bindControl(new c(t,this._linetool.properties().linewidth,!0,this.model(),"Change Vert Line Width")),this.loadData()},o.prototype.widget=function(){return this._table},inherit(n,r),n.prototype.prepareLayout=function(){var t,e,i,o;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),(t=this._linetool.points()[0])&&(e=$('<input type="text" class="ticker">'),i=$("<tr>").appendTo(this._table),$("<td>"+$.t("Bar #")+"</td>").appendTo(i),$("<td>").append(e).appendTo(i),o=this._linetool.properties().points[0],this.bindBarIndex(o.bar,e,this.model(),"Change "+this._linetool+" point bar index"),this.loadData())},e.LineToolVertLineStylesPropertyPage=o,e.LineToolVertLineInputsPropertyPage=n},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e,i),this.prepareLayout()}function n(t,e,i){r.call(this,t,e,i)}var s=i(367),r=i(377),a=i(309),l=a.ToFloatTransformer,h=a.SimpleComboBinder,c=a.ColorBinding,d=a.BooleanBinder,p=a.SimpleStringBinder;inherit(o,s),o.prototype.prepareLayout=function(){var t,e,i,o,n,s;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=$("<tbody>").appendTo(this._table),e=this.createColorPicker(),i=this.addLabeledRow(t,"Color"),$("<td>").append(e).appendTo(i),o=$('<select><option value="0">'+$.t("HL Bars")+'</option><option value="2">'+$.t("OC Bars")+'</option><option value="1">'+$.t("Line - Close")+'</option><option value="3">'+$.t("Line - Open")+'</option><option value="4">'+$.t("Line - High")+'</option><option value="5">'+$.t("Line - Low")+'</option><option value="6">'+$.t("Line - HL/2")+"</option></select>"),i=this.addLabeledRow(t,"Mode"),$("<td>").append(o).appendTo(i),i=$("<tr>").appendTo(t),$("<td>"+$.t("Mirrored")+"</td>").appendTo(i),n=$("<input type='checkbox'>"),$("<td>").append(n).appendTo(i),i=$("<tr>").appendTo(t),$("<td>"+$.t("Flipped")+"</td>").appendTo(i),s=$("<input type='checkbox'>"),$("<td>").append(s).appendTo(i),this.bindControl(new d(n,this._linetool.properties().mirrored,!0,this.model(),"Change Bars Pattern Mirroring")),this.bindControl(new d(s,this._linetool.properties().flipped,!0,this.model(),"Change Bars Pattern Flipping")),this.bindControl(new c(e,this._linetool.properties().color,!0,this.model(),"Change Bars Pattern Color")),this.bindControl(new h(o,this._linetool.properties().mode,null,!0,this.model(),"Change Bars Pattern Mode")),this.loadData()},o.prototype.widget=function(){return this._table},inherit(n,r),n.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,a,h;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=$("<tr>"),t.appendTo(this._table),e=$("<td>"),e.html($.t("Price")),e.appendTo(t),i=$("<td>"),i.appendTo(t),o=$("<input type='text'>"),o.appendTo(i),n=$("<td>"),n.html($.t("Bar #")),n.appendTo(t),s=$("<td>"),s.appendTo(t),r=$("<input type='text'>"),r.appendTo(s),r.addClass("ticker"),a=this._linetool.properties().points[0],h=[l(a.price.value())],this.bindControl(new p(o,a.price,h,!1,this.model(),"Change "+this._linetool+" point price")),this.bindBarIndex(a.bar,r,this.model(),"Change "+this._linetool+" point bar index"),this.loadData()},e.LineToolBarsPatternStylesPropertyPage=o,e.LineToolBarsPatternInputsPropertyPage=n},function(t,e,i){"use strict";function o(t,e,i){l.call(this,t,e),this._linetool=i,this.prepareLayout()}function n(t,e,i){s.call(this,t,e,i),this.prepareLayout()}var s=i(367),r=i(377),a=i(309),l=a.PropertyPage,h=a.SliderBinder,c=i(183).createTransparencyEditor;inherit(o,r),o.prototype.prepareLayout=function(){var t,e,o,n,s,a,l=i(365),h=$('<table class="property-page" cellspacing="0" cellpadding="0">'),c=$('<table class="property-page" cellspacing="0" cellpadding="0">').data({"layout-tab":l.TAB_NAME_INPUTS,"layout-tab-priority":l.TAB_PRIORITY_INPUTS});this._table=h.add(c),r.prototype.prepareLayoutForTable.call(this,h),t=$("<tr>").appendTo(c),$("<td>").append($.t("Avg HL in minticks")).appendTo(t),e=$("<td>").appendTo(t),o=$("<input type='text'>").addClass("ticker").appendTo(e),t=$("<tr>").appendTo(c),$("<td>").append($.t("Variance")).appendTo(t),n=$("<td>").appendTo(t),s=$("<input type='text'>").addClass("ticker").appendTo(n),a=this._linetool.properties(),this.bindInteger(o,a.averageHL,$.t("Change Average HL value"),1,5e4),this.bindInteger(s,a.variance,$.t("Change Variance value"),1,100),this.loadData()},o.prototype.widget=function(){return this._table},inherit(n,s),n.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,a,l,d,p;this._widget=$("<div>"),t=$("<table cellspacing=4>").appendTo(this._widget),e=this.createColorPicker(),i=this.createColorPicker(),o=this.createColorPicker(),n=this.createColorPicker(),s=this.createColorPicker(),r=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(n).add(s)),a=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(o)),l=this.addLabeledRow(t,$.t("Candles")),$("<td>").prependTo(l),$("<td>").append(e).appendTo(l),$("<td>").append(i).appendTo(l),l=this.addLabeledRow(t,$.t("Borders"),r),$("<td>").append(r).prependTo(l),$("<td>").append(n).appendTo(l),$("<td>").append(s).appendTo(l),$("<td>").appendTo(l),l=this.addLabeledRow(t,$.t("Wick"),a),$("<td>").append(a).prependTo(l),$("<td>").append(o).appendTo(l),$("<td>").appendTo(l),t=$("<table>").appendTo(this._widget),l=$("<tr>").appendTo(t),$("<td colspan='2'>").append($.t("Transparency")).appendTo(l),d=c(),$("<td colspan='2'>").append(d).appendTo(l),p=this._linetool.properties(),this.bindColor(e,p.candleStyle.upColor,"Change Candle Up Color"),this.bindColor(i,p.candleStyle.downColor,"Change Candle Down Color"),this.bindBoolean(a,p.candleStyle.drawWick,"Change Candle Wick Visibility"),this.bindColor(o,p.candleStyle.wickColor,"Change Candle Wick Color"),this.bindBoolean(r,p.candleStyle.drawBorder,"Change Candle Border Visibility"),this.bindColor(n,p.candleStyle.borderUpColor,"Change Candle Up Border Color"),this.bindColor(s,p.candleStyle.borderDownColor,"Change Candle Down Border Color"),this.bindControl(new h(d,p.transparency,!0,this.model(),"Change Guest Feed Transparency"))},n.prototype.widget=function(){return this._widget},e.LineToolGhostFeedInputsPropertyPage=o,e.LineToolGhostFeedStylesPropertyPage=n},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.SimpleComboBinder,h=s.SliderBinder,c=s.SimpleStringBinder,d=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,o,n,s,p=this.createColorPicker(),u=this.createFontSizeEditor(),_=this.createFontEditor(),f=this.createTextEditor(350,200),m=this.createColorPicker(),g=d(),v=this.createColorPicker(),y=$('<input type="checkbox">'),b=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),w=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');this.bindControl(new a(p,this._linetool.properties().color,!0,this.model(),"Change Text Color")),this.bindControl(new l(u,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new l(_,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new c(f,this._linetool.properties().text,null,!0,this.model(),"Change Text")),this.bindControl(new a(m,this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background",this._linetool.properties().transparency)),this.bindControl(new a(v,this._linetool.properties().bordercolor,!0,this.model(),"Change Text Color")),this.bindControl(new h(g,this._linetool.properties().linewidth,!0,this.model(),"Change Border Width")),this.bindControl(new r(y,this._linetool.properties().wordWrap,!0,this.model(),"Change Text Wrap")),this.bindControl(new r(b,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new r(w,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),t=i(365),e=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab-open",t.TAB_OPEN_OVERRIDE),o=$('<table class="property-page" cellspacing="0" cellpadding="2">'),n=$('<table class="property-page" cellspacing="0" cellpadding="2">'),this._table=e.add(n).add(o),$(document.createElement("tr")).append($(document.createElement("td")).attr({width:1}).append(p)).append($(document.createElement("td")).attr({width:1}).append(_)).append($(document.createElement("td")).attr({width:1}).append(u)).append($(document.createElement("td")).attr({width:1}).append(b)).append($(document.createElement("td")).append(w)).appendTo(e),$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(f)).appendTo(e),s=this.addLabeledRow(o,"Text Wrap",y),$("<td>").append(y).prependTo(s),s=this.addLabeledRow(n,"Background"),$("<td>").append(m).appendTo(s),s=this.addLabeledRow(n,"Border"),$("<td>").append(v).appendTo(s),$("<td>").append(g).appendTo(s),this.loadData(),setTimeout(function(){f.select(),f.focus()},20)},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.ColorBinding,l=s.BooleanBinder,h=s.SliderBinder,c=i(183),d=c.createLineStyleEditor,p=c.createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,c,u,_,f,m,g,v,y,b,w,S,T,C;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$("<tbody>").appendTo(this._table),e=p(),i=d(),o=this.createColorPicker(),n=this.addLabeledRow(t,$.t("Line")),$("<td>").append(o).appendTo(n),$("<td>").append(e).appendTo(n),$('<td colspan="3">').append(i.render()).appendTo(n),s=$("<tbody>").appendTo(this._table),c=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),u=$('<input type="checkbox">').appendTo(c),_=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),f=$('<input type="checkbox">').appendTo(_),m=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),g=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),n=this.addLabeledRow(s,$.t("Left End")),$('<td colspan="3">').appendTo(n).append(m).append(c),n=this.addLabeledRow(s,$.t("Right End")),$('<td colspan="3">').appendTo(n).append(g).append(_),n=this.addLabeledRow(s,$.t("Stats Text Color")),v=this.createColorPicker(),$("<td>").append(v).appendTo(n),this.bindControl(new a(v,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color")),y=$('<input type="checkbox">'),b=$('<input type="checkbox">'),w=$('<input type="checkbox">'),S=$('<input type="checkbox">'),T=$('<input type="checkbox">'),C=$('<input type="checkbox">'),n=this.addLabeledRow(s,$.t("Show Price Range")),$('<td colspan="3">').appendTo(n).append(y),n=this.addLabeledRow(s,$.t("Show Bars Range")),$('<td colspan="3">').appendTo(n).append(b),n=this.addLabeledRow(s,$.t("Show Date/Time Range")),$('<td colspan="3">').appendTo(n).append(w),n=this.addLabeledRow(s,$.t("Show Distance")),$('<td colspan="3">').appendTo(n).append(S),n=this.addLabeledRow(s,$.t("Show Angle")),$('<td colspan="3">').appendTo(n).append(T),n=this.addLabeledRow(s,$.t("Always Show Stats")),$('<td colspan="3">').appendTo(n).append(C),this.bindControl(new l(u,this._linetool.properties().extendLeft,!0,this.model(),"Change Trend Line Extending Left")),this.bindControl(new l(f,this._linetool.properties().extendRight,!0,this.model(),"Change Trend Line Extending Right")),this.bindControl(new a(o,this._linetool.properties().linecolor,!0,this.model(),"Change Trend Line Color")),this.bindControl(new r(i,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Trend Line Style")),this.bindControl(new h(e,this._linetool.properties().linewidth,!0,this.model(),"Change Trend Line Width")),this.bindControl(new r(m,this._linetool.properties().leftEnd,parseInt,!0,this.model(),"Change Trend Line Left End")),this.bindControl(new r(g,this._linetool.properties().rightEnd,parseInt,!0,this.model(),"Change Trend Line Right End")),this.bindControl(new l(y,this._linetool.properties().showPriceRange,!0,this.model(),"Change Trend Line Show Price Range")),this.bindControl(new l(b,this._linetool.properties().showBarsRange,!0,this.model(),"Change Trend Line Show Bars Range")),this.bindControl(new l(w,this._linetool.properties().showDateTimeRange,!0,this.model(),"Change Trend Line Show Date/Time Range")),this.bindControl(new l(S,this._linetool.properties().showDistance,!0,this.model(),"Change Trend Line Show Distance")),this.bindControl(new l(T,this._linetool.properties().showAngle,!0,this.model(),"Change Trend Line Show Angle")),this.bindControl(new l(C,this._linetool.properties().alwaysShowStats,!0,this.model(),"Change Trend Line Always Show Stats")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e),this._study=i,this.prepareLayout()}var n=i(309),s=n.PropertyPage,r=n.BooleanBinder,a=n.SimpleComboBinder,l=n.SliderBinder,h=n.ColorBinding,c=i(183),d=c.createLineWidthEditor,p=c.createPlotEditor;inherit(o,s),o.prototype.prepareLayout=function(){var t,e,o,n,s,c,u,_,f,m,g,v,y=this._study.properties();this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=this.addLabeledRow(this._table,"Volume"),e=p(),$("<td>").append(e).appendTo(t),this.bindControl(new a(e,y.styles.vol.plottype,parseInt,!0,this.model(),"Change Volume Plot Style")),o=this._study.metaInfo().version<=46&&"transparency"in y?y.transparency:y.styles.vol.transparency,n=this.createColorPicker(),$("<td>").append(n).appendTo(t),this.bindControl(new h(n,y.palettes.volumePalette.colors[0].color,!0,this.model(),"Change Up Volume color",o)),s=this.createColorPicker(),$("<td>").append(s).appendTo(t),this.bindControl(new h(s,y.palettes.volumePalette.colors[1].color,!0,this.model(),"Change Down Volume color",o)),c=$("<input type='checkbox'>"),$("<td>").appendTo(t),$("<td>").append(c).appendTo(t),$("<td>"+$.t("Price Line")+"</td>").appendTo(t),this.bindControl(new r(c,y.styles.vol.trackPrice,!0,this.model(),"Change Price Line")),u=y.styles.vol_ma,_=this.addLabeledRow(this._table,"Volume MA"),f=p(),$("<td>").append(f).appendTo(_),this.bindControl(new a(f,u.plottype,parseInt,!0,this.model(),"Change Volume MA Plot Style")),$("<td>").html("&nbsp;").appendTo(_),m=this.createColorPicker(),$("<td>").append(m).appendTo(_),this.bindControl(new h(m,u.color,!0,this.model(),"Change Volume MA color",u.transparency)),g=d(),$("<td>").append(g).appendTo(_),this.bindControl(new l(g,u.linewidth,!0,this.model(),"Change Volume MA Line Width")),c=$("<input type='checkbox'>"),$("<td>").append(c).appendTo(_),$("<td>"+$.t("Price Line")+"</td>").appendTo(_),this.bindControl(new r(c,u.trackPrice,!0,this.model(),"Change Price Line")),v=i(354).StudyStylesPropertyPage,v.prototype._putStudyDefaultStyles.call(this,this._table,8)},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.ColorBinding,a=s.SimpleComboBinder,l=s.SliderBinder,h=s.BooleanBinder,c=i(183),d=c.createLineStyleEditor,p=c.createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,c,u,_,f,m,g,v,y,b,w;this._block=$("<div>").addClass("property-page"),t=$('<table cellspacing="0" cellpadding="2">').appendTo(this._block),e=$("<tbody>").appendTo(t),i=p(),o=d(),n=this.createColorPicker(),s=this.addLabeledRow(e,$.t("Line")),$("<td>").append(n).appendTo(s),$("<td>").append(i).appendTo(s),$('<td colspan="3">').append(o.render()).appendTo(s),c=$('<table cellspacing="0" cellpadding="2">').appendTo(this._block),s=this.addLabeledRow(c,$.t("Background"),u),u=$('<input type="checkbox" class="visibility-switch">'),_=this.createColorPicker(),$("<td>").append(u).prependTo(s),$("<td>").append(_).appendTo(s),f=$('<table cellspacing="0" cellpadding="2">').appendTo(this._block),m=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),g=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),v=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),y=$('<input type="checkbox">').appendTo(v),b=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),w=$('<input type="checkbox">').appendTo(b),s=this.addLabeledRow(f,$.t("Left End")),$('<td colspan="3">').appendTo(s).append(m).append(v),s=this.addLabeledRow(f,$.t("Right End")),$('<td colspan="3">').appendTo(s).append(g).append(b),this.bindControl(new r(n,this._linetool.properties().linecolor,!0,this.model(),"Change Curve Line Color")),this.bindControl(new a(o,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Curve Line Style")),this.bindControl(new l(i,this._linetool.properties().linewidth,!0,this.model(),"Change Curve Line Width")),this.bindControl(new h(u,this._linetool.properties().fillBackground,!0,this.model(),"Change Curve Filling")),this.bindControl(new r(_,this._linetool.properties().backgroundColor,!0,this.model(),"Change Curve Background Color",this._linetool.properties().transparency)),this.bindControl(new a(m,this._linetool.properties().leftEnd,parseInt,!0,this.model(),"Change Curve Line Left End")),this.bindControl(new a(g,this._linetool.properties().rightEnd,parseInt,!0,this.model(),"Change Curve Line Right End")),this.bindControl(new h(y,this._linetool.properties().extendLeft,!0,this.model(),"Change Curve Line Extending Left")),this.bindControl(new h(w,this._linetool.properties().extendRight,!0,this.model(),"Change Curve Line Extending Right")),this.loadData()},o.prototype.widget=function(){return this._block},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.FloatBinder,l=s.ColorBinding,h=s.SimpleComboBinder,c=s.SliderBinder,d=i(183),p=d.addColorPicker,u=d.createLineStyleEditor,_=d.createLineWidthEditor,f=d.createTransparencyEditor;inherit(o,n),o.prototype.onResoreDefaults=function(){this._linetool.properties().style.listeners().fire(this._linetool.properties().style)},o.prototype.addLevelEditor=function(t,e,i){var o,n,s,d,f,m,g,v,y,b,w=$("<tr>");w.appendTo(this._table),t?(o=$("<td>"),o.appendTo(w),n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),s=$("<td>"),s.appendTo(w),d=$("<input type='text'>"),d.appendTo(s),d.css("width","70px"),this.bindControl(new r(n,e.visible,!0,this.model(),"Change Pitchfork Line Visibility")),this.bindControl(new a(d,e.coeff,!1,this.model(),"Change Pitchfork Line Coeff"))):($("<td></td>").appendTo(w),$("<td>"+$.t("Median")+"</td>").appendTo(w)),f=$("<td class='colorpicker-cell'>"),f.appendTo(w),m=p(f),g=$("<td>"),g.appendTo(w),v=_(),v.appendTo(g),y=$("<td>"),y.appendTo(w),b=u(),b.render().appendTo(y),this.bindControl(new l(m,e.color,!0,this.model(),"Change Pitchfork Line Color",0)),this.bindControl(new h(b,e.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style")),this.bindControl(new c(v,e.linewidth,!0,this.model(),"Change Pitchfork Line Width"))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s;for(this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.addLevelEditor(null,this._linetool.properties().median,!1),t=0;t<=8;t++)e="level"+t,this.addLevelEditor($.t("Level {0}").format(t+1),this._linetool.properties()[e],!1);this.addOneColorPropertyWidget(this._table),i=$("<tr>"),i.appendTo(this._table),o=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(o).appendTo(i),this.createLabeledCell("Background",o).appendTo(i),n=f(),$('<td colspan="3">').append(n).appendTo(i),s=$("<select><option value='0'>"+$.t("Original")+"</option><option value='3'>"+$.t("Schiff")+"</option><option value='1'>"+$.t("Modified Schiff")+"</option><option value='2'>"+$.t("Inside")+"</option></select>"),i=$("<tr>"),i.appendTo(this._table),$("<td>"+$.t("Style")+"</td>").appendTo(i),$("<td>").append(s).appendTo(i),this.bindControl(new h(s,this._linetool.properties().style,parseInt,!0,this.model(),"Change Pitchfork Style")),this.bindControl(new r(o,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfork Background Visibility")),this.bindControl(new c(n,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfork Background Transparency")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.FloatBinder,l=s.ColorBinding,h=s.SimpleComboBinder,c=s.SliderBinder,d=i(183),p=d.addColorPicker,u=d.createLineStyleEditor,_=d.createLineWidthEditor,f=d.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e,i){var o,n,s,d,f,m,g,v,y,b,w=$("<tr>");w.appendTo(this._table),t?(o=$("<td>"),o.appendTo(w),n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),s=$("<td>"),s.appendTo(w),d=$("<input type='text'>"),d.appendTo(s),d.css("width","70px"),this.bindControl(new r(n,e.visible,!0,this.model(),"Change Pitchfork Line Visibility")),this.bindControl(new a(d,e.coeff,!1,this.model(),"Change Pitchfork Line Coeff"))):$("<td colspan='2'>"+$.t("Median")+"</td>").appendTo(w),f=$("<td class='colorpicker-cell'>"),f.appendTo(w),m=p(f),g=$("<td>"),g.appendTo(w),v=_(),v.appendTo(g),y=$("<td>"),y.appendTo(w),b=u(),b.render().appendTo(y),this.bindControl(new l(m,e.color,!0,this.model(),"Change Pitchfork Line Color"),0),this.bindControl(new h(b,e.linestyle,parseInt,!0,this.model(),"Change Pitchfan Line Style")),this.bindControl(new c(v,e.linewidth,!0,this.model(),"Change Pitchfan Line Width"))},o.prototype.prepareLayout=function(){var t,e,i,o,n;for(this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.addLevelEditor(null,this._linetool.properties().median,!1),t=0;t<=8;t++)e="level"+t,this.addLevelEditor($.t("Level {0}").format(t+1),this._linetool.properties()[e],!1);this.addOneColorPropertyWidget(this._table),i=$("<tr>"),i.appendTo(this._table),o=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(o).appendTo(i),this.createLabeledCell($.t("Background"),o).appendTo(i),n=f(),$('<td colspan="3">').append(n).appendTo(i),this.bindControl(new r(o,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfan Background Visibility")),this.bindControl(new c(n,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfan Background Transparency")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._chartWidget=t,this._undoModel=e}function n(t,e,i){s.call(this,t,e,i),this.prepareLayout()}var s=i(367),r=i(309),a=r.SimpleStringBinder,l=r.SimpleComboBinder,h=r.ColorBinding,c=r.BooleanBinder,d=i(183).setAbsolutePos;o.prototype.attachSource=function(t,e){this._source=t,this._edit=$("<textarea>"),this._edit.css("width","300"),this._edit.css("height","150"),this._edit.appendTo(this._chartWidget._jqMainDiv),d(this._edit,e),this._edit.val(t.properties().text.value()),this._edit.focus();var i=this._edit;return i.select(),this._binding=new a(i,t.properties().text,null,!0,this._undoModel,"change line tool text"),this._edit.focusout(function(){t.properties().text.setValue(i.val())}),this._edit.mousedown(function(t){return!0}),i},inherit(n,s),n.prototype.prepareLayout=function(){var t,e,i,o,n=this.createColorPicker(),s=this.createColorPicker(),r=this.createFontSizeEditor(),d=this.createFontEditor(),p=this.createTextEditor(350,200),u=this.createColorPicker(),_=$('<input type="checkbox" class="visibility-switch">'),f=$('<input type="checkbox" class="visibility-switch">'),m=$('<input type="checkbox">'),g=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),v=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');this.bindControl(new h(n,this._linetool.properties().color,!0,this.model(),"Change Text Color")),this.bindControl(new l(r,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new l(d,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new a(p,this._linetool.properties().text,null,!0,this.model(),"Change Text")),this.bindControl(new h(u,this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background",this._linetool.properties().backgroundTransparency)),this.bindControl(new c(_,this._linetool.properties().fillBackground,!0,this.model(),"Change Text Background Fill")),this.bindControl(new c(f,this._linetool.properties().drawBorder,!0,this.model(),"Change Text Border")),this.bindControl(new h(s,this._linetool.properties().borderColor,!0,this.model(),"Change Text Border Color")),this.bindControl(new c(m,this._linetool.properties().wordWrap,!0,this.model(),"Change Text Wrap")),this.bindControl(new c(g,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new c(v,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),t=$('<table class="property-page" cellspacing="0" cellpadding="2">'),e=$('<table class="property-page" cellspacing="0" cellpadding="2">'),i=$('<table class="property-page" cellspacing="0" cellpadding="2">'),this._table=t.add(i).add(e),$(document.createElement("tr")).append($(document.createElement("td")).attr({width:1}).append(n)).append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(r)).append($(document.createElement("td")).attr({width:1}).append(g)).append($(document.createElement("td")).append(v)).appendTo(t),$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(p)).appendTo(t),o=this.addLabeledRow(e,$.t("Text Wrap"),m),$("<td>").append(m).prependTo(o),o=this.addLabeledRow(i,$.t("Background"),_),$("<td>").append(_).prependTo(o),$("<td>").append(u).appendTo(o),o=this.addLabeledRow(i,$.t("Border"),f),$("<td>").append(f).prependTo(o),$("<td>").append(s).appendTo(o),this.loadData(),setTimeout(function(){p.select(),p.focus()},20)},n.prototype.widget=function(){return this._table},n.prototype.dialogPosition=function(t,e){var i,o,n,s,r,a,l,h=5,c=0,d=this._linetool,p=d._model.paneForSource(d),u=this._model._chartWidget;return $.each(u.paneWidgets(),function(t,e){if(e._state===p)return c=$(e.canvas).offset().top,!1}),t||(t={}),o=t.left,n=t.top,s=(this._linetool.paneViews()||[])[0],s&&(i=s._floatPoints[0]),i&&(o=i.x,n=i.y+c),r=$(e).outerHeight(),a=$(window).height(),l=d.properties().fontsize.value(),n=n+r+l+h<=a?n+l+h:n-r-h,{top:n,left:o}},t.exports=n},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.ColorBinding,a=s.BooleanBinder,l=s.SliderBinder,h=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=h(),e=this.createColorPicker(),i=this.addLabeledRow(this._table,"Border"),i.prepend("<td>"),$("<td>").append(e).appendTo(i),$("<td>").append(t).appendTo(i),o=$('<input type="checkbox" class="visibility-switch">'),n=this.createColorPicker(),i=this.addLabeledRow(this._table,"Background",o),$("<td>").append(o).prependTo(i),$("<td>").append(n).appendTo(i),this.bindControl(new a(o,this._linetool.properties().fillBackground,!0,this.model(),"Change Rectangle Filling")),this.bindControl(new r(e,this._linetool.properties().color,!0,this.model(),"Change Rectangle Line Color")),this.bindControl(new r(n,this._linetool.properties().backgroundColor,!0,this.model(),"Change Rectangle Background Color",this._linetool.properties().transparency)),this.bindControl(new l(t,this._linetool.properties().linewidth,!0,this.model(),"Change Rectangle Border Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.SliderBinder,h=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=h(),e=this.createColorPicker(),i=this.addLabeledRow(this._table,$.t("Border")),i.prepend("<td>"),$("<td>").append(e).appendTo(i),$("<td>").append(t).appendTo(i),o=$('<input type="checkbox" class="visibility-switch">'),n=this.createColorPicker(),i=this.addLabeledRow(this._table,$.t("Background"),o),$("<td>").append(o).prependTo(i),$("<td>").append(n).appendTo(i),this.bindControl(new r(o,this._linetool.properties().fillBackground,!0,this.model(),"Change Ellipse Filling")),this.bindControl(new a(e,this._linetool.properties().color,!0,this.model(),"Change Ellipse Line Color")),this.bindControl(new a(n,this._linetool.properties().backgroundColor,!0,this.model(),"Change Ellipse Background Color",this._linetool.properties().transparency)),this.bindControl(new l(t,this._linetool.properties().linewidth,!0,this.model(),"Change Ellipse Border Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.SliderBinder,h=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=h(),e=this.createColorPicker(),i=this.addLabeledRow(this._table,"Border"),i.prepend("<td>"),$("<td>").append(e).appendTo(i),$("<td>").append(t).appendTo(i),o=$('<input type="checkbox" class="visibility-switch">'),n=this.createColorPicker(),i=this.addLabeledRow(this._table,"Background",o),$("<td>").append(o).prependTo(i),$("<td>").append(n).appendTo(i),this.bindControl(new r(o,this._linetool.properties().fillBackground,!0,this.model(),"Change Arc Filling")),this.bindControl(new a(e,this._linetool.properties().color,!0,this.model(),"Change Arc Line Color")),this.bindControl(new a(n,this._linetool.properties().backgroundColor,!0,this.model(),"Change Arc Background Color",this._linetool.properties().transparency)),this.bindControl(new l(t,this._linetool.properties().linewidth,!0,this.model(),"Change Arc Border Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.SliderBinder,h=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=h(),e=this.createColorPicker(),i=this.addLabeledRow(this._table,$.t("Border")),i.prepend("<td>"),$("<td>").append(e).appendTo(i),$("<td>").append(t).appendTo(i),o=$('<input type="checkbox" class="visibility-switch">'),n=this.createColorPicker(),i=this.addLabeledRow(this._table,$.t("Background"),o),$("<td>").append(o).prependTo(i),$("<td>").append(n).appendTo(i),this.bindControl(new r(o,this._linetool.properties().fillBackground,!0,this.model(),"Change Triangle Filling")),this.bindControl(new a(e,this._linetool.properties().color,!0,this.model(),"Change Triangle Line Color")),this.bindControl(new a(n,this._linetool.properties().backgroundColor,!0,this.model(),"Change Triangle Background Color",this._linetool.properties().transparency)),this.bindControl(new l(t,this._linetool.properties().linewidth,!0,this.model(),"Change Triangle Border Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.SimpleComboBinder,h=s.SliderBinder,c=i(183),d=c.createLineStyleEditor,p=c.createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,c,u,_,f,m,g,v,y,b,w,S;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=$("<tbody>").appendTo(this._table),e=p(),i=d(),o=this.createColorPicker(),n=$("<tr>").appendTo(t),$("<td></td><td>"+$.t("Channel")+"</td>").appendTo(n),$("<td>").append(o).appendTo(n),$("<td>").append(e).appendTo(n),$("<td>").append(i.render()).appendTo(n),n=$("<tr>").appendTo(t),s=$("<td>").appendTo(n),c=$("<input type='checkbox' class='visibility-switch'>"),c.appendTo(s),this.createLabeledCell("Middle",c).appendTo(n),u=p(),_=d(),f=this.createColorPicker(),$("<td>").append(f).appendTo(n),$("<td>").append(u).appendTo(n),$("<td>").append(_.render()).appendTo(n),n=$("<tr>").appendTo(t),m=$("<td>").appendTo(n),g=$("<input type='checkbox' class='visibility-switch'>"),g.appendTo(m),this.createLabeledCell("Background",g).appendTo(n),v=this.createColorPicker(),$("<td>").append(v).appendTo(n),y=$("<tbody>").appendTo(this._table),b=this.addEditorRow(y,"Extend Left",$("<input type='checkbox'>"),2),w=this.addEditorRow(y,"Extend Right",$("<input type='checkbox'>"),2),S=this._linetool.properties(),this.bindControl(new r(g,S.fillBackground,!0,this.model(),"Change Parallel Channel Fill Background")),this.bindControl(new r(c,S.showMidline,!0,this.model(),"Change Parallel Channel Show Center Line")),this.bindControl(new r(b,S.extendLeft,!0,this.model(),"Change Parallel Channel Extending Left")),this.bindControl(new r(w,S.extendRight,!0,this.model(),"Change Parallel Channel Extending Right")),this.bindControl(new a(o,S.linecolor,!0,this.model(),"Change Parallel Channel Color")),this.bindControl(new l(i,S.linestyle,parseInt,!0,this.model(),"Change Parallel Channel Style")),this.bindControl(new h(e,S.linewidth,!0,this.model(),"Change Parallel Channel Width")),this.bindControl(new a(f,S.midlinecolor,!0,this.model(),"Change Parallel Channel Middle Color")),this.bindControl(new l(_,S.midlinestyle,parseInt,!0,this.model(),"Change Parallel Channel Middle Style")),this.bindControl(new h(u,S.midlinewidth,!0,this.model(),"Change Parallel Channel Middle Width")),this.bindControl(new a(v,S.backgroundColor,!0,this.model(),"Change Parallel Channel Back Color",S.transparency)),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleStringBinder,a=s.ColorBinding,l=s.SimpleComboBinder;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">').css({width:"100%"}),t=$("<input type='text'>").css({width:"100%"}),e=$('<div class="property-page-fullwidth-wrapper">').append(t),i=this.createColorPicker(),o=this.createFontEditor(),n=$("<tr>").appendTo(this._table),$("<td>").css({width:"0"}).html($.t("Text")).appendTo(n),$('<td colspan="2">').append(e).appendTo(n),n=this.addLabeledRow(this._table,"Text Font"),n.children().css({whiteSpace:"nowrap"}),$("<td>").append(i).appendTo(n).css({width:"0"}),$("<td>").append(o).appendTo(n),this.bindControl(new a(i,this._linetool.properties().color,!0,this.model(),"Change Arrow Mark Text Color")),this.bindControl(new r(t,this._linetool.properties().text,null,!0,this.model(),"Change Arrow Mark Text")),this.bindControl(new l(o,this._linetool.properties().font,null,!0,this.model(),"Change Arrow Mark Font")),this.loadData(),setTimeout(function(){t.select(),t.focus()},20)},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.ColorBinding;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=this.createColorPicker(),e=this.createFontSizeEditor(),i=this.createColorPicker(),o=this.createColorPicker(),n=this.addLabeledRow(this._table,$.t("Text")),$("<td>").append(t).appendTo(n),$("<td>").append(e).appendTo(n),n=this.addLabeledRow(this._table,$.t("Background")),$("<td>").append(i).appendTo(n),n=this.addLabeledRow(this._table,$.t("Border")),$("<td>").append(o).appendTo(n),this.bindControl(new a(t,this._linetool.properties().color,!0,this.model(),"Change Price Text Color")),this.bindControl(new r(e,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Price Text Font Size")),this.bindControl(new a(i,this._linetool.properties().backgroundColor,!0,this.model(),"Change Background Color",this._linetool.properties().transparency)),this.bindControl(new a(o,this._linetool.properties().borderColor,!0,this.model(),"Change Border Color")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.ColorBinding,l=s.SimpleStringBinder;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,o,n,s,h,c,d,p=i(365),u=$('<table class="property-page" cellspacing="0" cellpadding="0">').css({width:"100%"}).data("layout-tab-open",p.TAB_OPEN_OVERRIDE),_=$('<table class="property-page" cellspacing="0" cellpadding="0">');this._table=u.add(_),t=$("<input type='text'>").css({width:"100%"}),e=this.createColorPicker(),o=this.createFontSizeEditor(),n=this.createColorPicker(),s=this.createColorPicker(),h=$("<tr>").appendTo(u),c=$('<div class="property-page-fullwidth-wrapper">').append(t),$("<td>").append(c).appendTo(h),d=this.addLabeledRow(_,$.t("Text")),$("<td>").append(e).appendTo(d),$("<td>").append(o).appendTo(d),d=this.addLabeledRow(_,$.t("Background")),$("<td>").appendTo(d).append(n),d=this.addLabeledRow(_,$.t("Border")),$("<td>").appendTo(d).append(s),$("<td>"),this.bindControl(new l(t,this._linetool.properties().text,null,!0,this.model(),"Change Balloon Text")),this.bindControl(new a(e,this._linetool.properties().color,!0,this.model(),"Change Baloon Text Color")),this.bindControl(new r(o,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Balloon Text Font Size")),this.bindControl(new a(n,this._linetool.properties().backgroundColor,!0,this.model(),"Change Balloon Background Color",this._linetool.properties().transparency)),this.bindControl(new a(s,this._linetool.properties().borderColor,!0,this.model(),"Change Balloon Border Color")),this.loadData(),setTimeout(function(){t.select(),t.focus()},0)},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SliderBinder,a=s.BooleanBinder,l=s.ColorBinding,h=s.SimpleComboBinder,c=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,d,p;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=c(),e=this.createColorPicker(),i=$('<input type="checkbox" class="visibility-switch">'),o=this.createColorPicker(),n=this.addLabeledRow(this._table,"Line"),$("<td>").prependTo(n),$("<td>").append(e).appendTo(n),$("<td>").append(t).appendTo(n),n=this.addLabeledRow(this._table,"Background",i),$("<td>").append(i).prependTo(n),$("<td>").append(o).appendTo(n),s=$("<tbody>").appendTo(this._table),d=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),p=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),n=this.addLabeledRow(s,$.t("Left End")),$("<td>").prependTo(n),$('<td colspan="3">').appendTo(n).append(d),n=this.addLabeledRow(s,$.t("Right End")),$("<td>").prependTo(n),$('<td colspan="3">').appendTo(n).append(p),this.bindControl(new l(e,this._linetool.properties().linecolor,!0,this.model(),"Change Brush Color")),this.bindControl(new r(t,this._linetool.properties().linewidth,!0,this.model(),"Change Brush Line Width")),this.bindControl(new a(i,this._linetool.properties().fillBackground,!0,this.model(),"Change Brush Filling")),this.bindControl(new l(o,this._linetool.properties().backgroundColor,!0,this.model(),"Change Brush Background Color",this._linetool.properties().transparency)),this.bindControl(new h(d,this._linetool.properties().leftEnd,parseInt,!0,this.model(),"Change Trend Line Left End")),this.bindControl(new h(p,this._linetool.properties().rightEnd,parseInt,!0,this.model(),"Change Trend Line Right End")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.ColorBinding,a=s.SliderBinder,l=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,h,c,d,p,u,_,f,m,g,v,y,b,w=$('<table class="property-page" cellspacing="0" cellpadding="2">'),S=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),T=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=w.add(S).add(T),t=this.createColorPicker(),e=l(),i=this.addLabeledRow(w,"Line"),$("<td>").append(t).appendTo(i),$("<td>").append(e).appendTo(i),o=$("<tr>").appendTo(S),n=$("<td>").appendTo(o).css({"vertical-align":"top",width:"50%"}),s=$("<td>").appendTo(o).css({"vertical-align":"top",width:"50%"}),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(n),c=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(s),d=this.addColorPickerRow(h,$.t("Source back color")),p=this.addColorPickerRow(h,$.t("Source text color")),u=this.addColorPickerRow(h,$.t("Source border color")),_=this.addColorPickerRow(h,$.t("Success back color")),f=this.addColorPickerRow(h,$.t("Success text color")),m=this.addColorPickerRow(c,$.t("Target back color")),g=this.addColorPickerRow(c,$.t("Target text color")),v=this.addColorPickerRow(c,$.t("Target border color")),y=this.addColorPickerRow(c,$.t("Failure back color")),b=this.addColorPickerRow(c,$.t("Failure text color")),this.bindControl(new r(t,this._linetool.properties().linecolor,!0,this.model(),"Forecast Line Color")),this.bindControl(new a(e,this._linetool.properties().linewidth,!0,this.model(),"Forecast Line Width")),this.bindControl(new r(t,this._linetool.properties().linecolor,!0,this.model(),"Forecast Line Color")),this.bindControl(new a(e,this._linetool.properties().linewidth,!0,this.model(),"Forecast Line Width")),this.bindControl(new r(d,this._linetool.properties().sourceBackColor,!0,this.model(),"Forecast Source Background Color",this._linetool.properties().transparency)),this.bindControl(new r(u,this._linetool.properties().sourceStrokeColor,!0,this.model(),"Forecast Source Border Color")),this.bindControl(new r(p,this._linetool.properties().sourceTextColor,!0,this.model(),"Forecast Source Text Color")),this.bindControl(new r(m,this._linetool.properties().targetBackColor,!0,this.model(),"Forecast Target Background Color")),this.bindControl(new r(v,this._linetool.properties().targetStrokeColor,!0,this.model(),"Forecast Target Border Color")),this.bindControl(new r(g,this._linetool.properties().targetTextColor,!0,this.model(),"Forecast Target Text Color")),this.bindControl(new r(_,this._linetool.properties().successBackground,!0,this.model(),"Forecast Success Back Color")),this.bindControl(new r(f,this._linetool.properties().successTextColor,!0,this.model(),"Forecast Success Text Color")),this.bindControl(new r(y,this._linetool.properties().failureBackground,!0,this.model(),"Forecast Failure Back Color")),this.bindControl(new r(b,this._linetool.properties().failureTextColor,!0,this.model(),"Forecast Failure Text Color")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.SliderBinder,h=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=h(),e=this.createColorPicker(),i=this.addLabeledRow(this._table,"Border"),i.prepend("<td>"),$("<td>").append(e).appendTo(i),$("<td>").append(t).appendTo(i),o=$('<input type="checkbox" class="visibility-switch">'),n=this.createColorPicker(),i=this.addLabeledRow(this._table,"Background",o),$("<td>").append(o).prependTo(i),$("<td>").append(n).appendTo(i),this.bindControl(new r(o,this._linetool.properties().fillBackground,!0,this.model(),"Change Polyline Filling")),this.bindControl(new a(e,this._linetool.properties().linecolor,!0,this.model(),"Change Polyline Line Color")),this.bindControl(new a(n,this._linetool.properties().backgroundColor,!0,this.model(),"Change Polyline Background Color",this._linetool.properties().transparency)),this.bindControl(new l(t,this._linetool.properties().linewidth,!0,this.model(),"Change Polyline Border Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.FloatBinder,l=s.ColorBinding,h=s.SliderBinder,c=i(183),d=c.addColorPicker,p=c.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e,i){var o,n,s,h,c,p,u=$("<tr>");u.appendTo(t),o=$("<td>"),o.appendTo(u),n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),s=$("<td>"),s.appendTo(u),h=$("<input type='text'>"),h.appendTo(s),h.css("width","70px"),this.bindControl(new r(n,i.visible,!0,this.model(),"Change Gann Square Line Visibility")),this.bindControl(new a(h,i.coeff,!1,this.model(),"Change Pitchfork Line Coeff")),c=$("<td class='colorpicker-cell'>"),c.appendTo(u),p=d(c),this.bindControl(new l(p,i.color,!0,this.model(),"Change Gann Square Line Color",0))},o.prototype.addFannEditor=function(t){var e,i,o=$("<tr>").appendTo(t),n=$("<input type='checkbox' class='visibility-switch'>");n.appendTo($("<td>").appendTo(o)),$("<td>"+$.t("Angles")+"</td>").appendTo(o),e=$("<td class='colorpicker-cell'>").appendTo(o),i=d(e),this.bindControl(new r(n,this._linetool.properties().fans.visible,!0,this.model(),"Change Gann Square Angles Visibility")),this.bindControl(new l(i,this._linetool.properties().fans.color,!0,this.model(),"Change Gann Square Angles Color",0))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s,a,l,c,d,u,_,f,m,g,v,y,b,w,S;for(this._table=$(document.createElement("table")),this._table.addClass("property-page property-page-unpadded"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this._table.css({width:"100%"}),t=$("<tbody>").appendTo(this._table),e=$("<tr>"),e.appendTo(t),i=$('<td width="50%">'),i.appendTo(e),o=$('<td width="50%">'),o.appendTo(e),n=$('<table cellspacing="0" cellpadding="2">'),n.appendTo(i),n.addClass("property-page"),s=$('<table cellspacing="0" cellpadding="2">'),s.appendTo(o),s.addClass("property-page"),$("<tr><td align='center' colspan='4'>"+$.t("Price Levels")+"</td></tr>").appendTo(n),$("<tr><td align='center' colspan='4'>"+$.t("Time Levels")+"</td></tr>").appendTo(s),a=1;a<=7;a++)l="hlevel"+a,this.addLevelEditor(n,$.t("Level {0}").format(a),this._linetool.properties()[l]);for(a=1;a<=7;a++)l="vlevel"+a,this.addLevelEditor(s,$.t("Level {0}").format(a),this._linetool.properties()[l]);this.addFannEditor(n),this.addOneColorPropertyWidget(s),o.css({"vertical-align":"top"}),i.css({"vertical-align":"top"}),c=$("<input type='checkbox' class='visibility-switch'>"),d=$("<input type='checkbox' class='visibility-switch'>"),u=$("<input type='checkbox' class='visibility-switch'>"),_=$("<input type='checkbox' class='visibility-switch'>"),f=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),m=$("<tr>").appendTo(f),g=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%","vertical-align":"top"}).appendTo(m)),v=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%","vertical-align":"top"}).appendTo(m)),y=this.addLabeledRow(g,$.t("Left Labels"),c),$("<td>").append(c).prependTo(y),y=this.addLabeledRow(v,$.t("Right Labels"),d),$("<td>").append(d).prependTo(y),y=this.addLabeledRow(g,$.t("Top Labels"),u),$("<td>").append(u).prependTo(y),y=this.addLabeledRow(v,$.t("Bottom Labels"),_),$("<td>").append(_).prependTo(y),this.bindControl(new r(c,this._linetool.properties().showLeftLabels,!0,this.model(),"Change Gann Square Left Labels Visibility")),this.bindControl(new r(d,this._linetool.properties().showRightLabels,!0,this.model(),"Change Gann Square Right Labels Visibility")),this.bindControl(new r(u,this._linetool.properties().showTopLabels,!0,this.model(),"Change Gann Square Top Labels Visibility")),this.bindControl(new r(_,this._linetool.properties().showBottomLabels,!0,this.model(),"Change Gann Square Bottom Labels Visibility")),this._table=this._table.add(f),y=$("<tr>"),y.appendTo(g),b=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(b).appendTo(y),w=p(),$("<td>").append(w).appendTo(y),this.bindControl(new r(b,this._linetool.properties().fillHorzBackground,!0,this.model(),"Change Gann Square Background Visibility")),this.bindControl(new h(w,this._linetool.properties().horzTransparency,!0,this.model(),"Change Gann Square Background Transparency")),y=$("<tr>"),y.appendTo(v),b=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(b).appendTo(y),w=p(),$("<td>").append(w).appendTo(y),this.bindControl(new r(b,this._linetool.properties().fillVertBackground,!0,this.model(),"Change Gann Square Background Visibility")),this.bindControl(new h(w,this._linetool.properties().vertTransparency,!0,this.model(),"Change Gann Square Background Transparency")),this._linetool.properties().reverse&&(S=$("<input type='checkbox' class='visibility-switch'>"),y=this.addLabeledRow(g,$.t("Reverse"),S),$("<td>").append(S).prependTo(y),this.bindControl(new r(S,this._linetool.properties().reverse,!0,this.model(),"Change Gann Box Reverse"))),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.SliderBinder,l=s.ColorBinding,h=i(183),c=h.addColorPicker,d=h.createLineWidthEditor,p=h.createTransparencyEditor;inherit(o,n),o.prototype.addOneColorPropertyWidget=function(t){var e=this.createOneColorForAllLinesWidget(),i=$("<tr>");i.append($("<td>")).append($("<td>")).append(e.editor).append($("<td>").append(e.label)),i.appendTo(t)},o.prototype.prepareLayout=function(){var t,e,i,o,n,s,h,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V;this._table=$(document.createElement("table")),this._table.addClass("property-page property-page-unpadded"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this._table.css({width:"100%"}),t=$("<tr>"),t.appendTo(this._table),e=this._linetool.properties(),i=$("<table>"),$("<td valign='top'>").append(i).appendTo(t),o=$("<tr>"),$("<td colspan='3'>"+$.t("Levels")+"</td>").appendTo(o),o.appendTo(i);for(n in e.levels._childs)s=e.levels[n],h=$("<tr>"),h.appendTo(i),$("<td>"+n+"</td>").appendTo(h),u=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(u).appendTo(h),_=$("<td class='colorpicker-cell'>"),_.appendTo(h),f=c(_),m=$("<td>"),m.appendTo(h),g=d(),g.appendTo(m),this.bindControl(new r(u,s.visible,!0,this.model(),"Change Gann Line Visibility")),this.bindControl(new l(f,s.color,!0,this.model(),"Change Gann Line Color",0)),this.bindControl(new a(g,s.width,!0,this.model(),"Change Gann Line Width"));v=$("<table>"),$("<td valign='top'>").append(v).appendTo(t),y=$("<tr>"),$("<td colspan='4'>"+$.t("Fans")+"</td>").appendTo(y),y.appendTo(v);for(n in e.fanlines._childs)b=e.fanlines[n],w=$("<tr>"),w.appendTo(v),u=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(u).appendTo(w),S=b.x.value()+"x"+b.y.value(),$("<td>"+S+"</td>").appendTo(w),_=$("<td class='colorpicker-cell'>"),_.appendTo(w),f=c(_),m=$("<td>"),m.appendTo(w),g=d(),g.appendTo(m),this.bindControl(new r(u,b.visible,!0,this.model(),"Change Gann Line Visibility")),this.bindControl(new l(f,b.color,!0,this.model(),"Change Gann Fan Color",0)),this.bindControl(new a(g,b.width,!0,this.model(),"Change Gann Line Width"));T=$("<table>"),$("<td valign='top'>").append(T).appendTo(t),C=$("<tr>"),$("<td colspan='4'>"+$.t("Arcs")+"</td>").appendTo(C),C.appendTo(T);for(n in e.arcs._childs)x=e.arcs[n],P=$("<tr>"),P.appendTo(T),u=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(u).appendTo(P),S=x.x.value()+"x"+x.y.value(),$("<td>"+S+"</td>").appendTo(P),_=$("<td class='colorpicker-cell'>"),_.appendTo(P),f=c(_),m=$("<td>"),m.appendTo(P),g=d(),g.appendTo(m),this.bindControl(new r(u,x.visible,!0,this.model(),"Change Gann Line Visibility")),this.bindControl(new l(f,x.color,!0,this.model(),"Change Gann Arc Color",0)),this.bindControl(new a(g,x.width,!0,this.model(),"Change Gann Line Width"));this.addOneColorPropertyWidget(T),L=$("<tbody>").appendTo(this._table),k=$('<input type="checkbox" class="visibility-switch">'),I=p(),E=$("<tr>").appendTo(L),A=$("<table>"),$('<td colspan="3">').append(A).appendTo(E),E=$("<tr>").appendTo(A),$("<td>").append(k).appendTo(E),$("<td>"+$.t("Background")+"</td>").appendTo(E),$("<td>").append(I).appendTo(E),this._linetool.properties().reverse&&(V=$("<input type='checkbox' class='visibility-switch'>"),E=this.addLabeledRow(A,$.t("Reverse"),V,!0),$("<td>").append(V).prependTo(E),this.bindControl(new r(V,this._linetool.properties().reverse,!0,this.model(),"Change Gann Square Reverse"))),this.bindControl(new r(k,this._linetool.properties().arcsBackground.fillBackground,!0,this.model(),"Change Gann Square Filling")),this.bindControl(new a(I,this._linetool.properties().arcsBackground.transparency,!0,this.model(),"Change Gann Square Background Transparency"))},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.SimpleComboBinder,h=s.SliderBinder,c=i(183),d=c.addColorPicker,p=c.createLineStyleEditor,u=c.createLineWidthEditor,_=c.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e,i,o){var n,s,c,_,f,m,g,v,y,b,w=$("<tr>");w.appendTo(this._tbody),n="control-level-"+i+"-"+o,s=$("<td>"),s.appendTo(w),c=$("<input type='checkbox' class='visibility-switch' id='"+n+"'>"),c.appendTo(s),_=this.createLabeledCell(t).appendTo(w),_.find("label").attr("for",n),f=$("<td class='colorpicker-cell'>"),f.appendTo(w),m=d(f),g=$("<td>"),g.appendTo(w),v=u(),v.appendTo(g),y=$("<td>"),y.appendTo(w),b=p(),b.render().appendTo(y),this.bindControl(new r(c,e.visible,!0,this.model(),"Change Gann Fan Line Visibility")),this.bindControl(new a(m,e.color,!0,this.model(),"Change Gann Fan Line Color",0)),this.bindControl(new l(b,e.linestyle,parseInt,!0,this.model(),"Change Gann Fan Line Style")),this.bindControl(new h(v,e.linewidth,!0,this.model(),"Change Gann Fan Line Width"))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s,a,l,c,d,p=$('<table class="property-page" cellspacing="0" cellpadding="2">'),u=$('<table class="property-page" cellspacing="0" cellpadding="2">');for(this._tbody=$("<tbody>").appendTo(p),t=1;t<=9;t++)e="level"+t,i=this._linetool.properties()[e],o=i.coeff1.value(),n=i.coeff2.value(),s="<sup>"+o+"</sup>&frasl;<sub>"+n+"</sub>",this.addLevelEditor(s,i,o,n);this.addOneColorPropertyWidget(this._tbody),a=$("<input type='checkbox' class='visibility-switch'>"),l=this.addLabeledRow(u,$.t("Labels"),a),$("<td>").append(a).prependTo(l),this.bindControl(new r(a,this._linetool.properties().showLabels,!0,this.model(),"Change Gann Fan Labels Visibility")),this._table=p.add(u),l=$("<tr>"),l.appendTo(this._table),c=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(c).appendTo(l),this.createLabeledCell($.t("Background"),c).appendTo(l),d=_(),$('<td colspan="3">').append(d).appendTo(l),this.bindControl(new r(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfan Background Visibility")),this.bindControl(new h(d,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfan Background Transparency")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.FloatBinder,a=s.SimpleComboBinder,l=s.BooleanBinder,h=s.ColorBinding,c=s.SliderBinder,d=i(183),p=d.addColorPicker,u=d.createLineStyleEditor,_=d.createLineWidthEditor,f=d.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e,i){var o,n,s,d,f,m,g,v,y,b,w=$("<tr>");w.appendTo(this._table),o=$("<td>"),o.appendTo(w),n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),t?(s=$("<td>"),s.appendTo(w),d=$("<input type='text'>"),d.appendTo(s),d.css("width","70px"),this.bindControl(new r(d,e.coeff,!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",n).appendTo(w),f=$("<td class='colorpicker-cell'>"),f.appendTo(w),m=p(f),g=$("<td>"),g.appendTo(w),v=_(),v.appendTo(g),t||(y=$("<td>"),y.appendTo(w),b=u(),b.render().appendTo(y),this.bindControl(new a(b,e.linestyle,parseInt,!0,this.model(),"Change Fib Circle Style"))),this.bindControl(new l(n,e.visible,!0,this.model(),"Change Fib Circle Visibility")),this.bindControl(new h(m,e.color,!0,this.model(),"Change Fib Circle Line Color",0)),this.bindControl(new c(v,e.linewidth,!0,this.model(),"Change Fib Circle Width"))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s,r;for(this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.addLevelEditor(null,this._linetool.properties().trendline,!1),t=1;t<=11;t++)e="level"+t,this.addLevelEditor("Level "+t,this._linetool.properties()[e],!1);this.addOneColorPropertyWidget(this._table),i=$("<input type='checkbox' class='visibility-switch'>"),o=this.addLabeledRow(this._table,"Levels",i),$("<td>").append(i).prependTo(o),n=$("<input type='checkbox' class='visibility-switch'>"),o=this.addLabeledRow(this._table,"Coeffs As Percents",n),$("<td>").append(n).prependTo(o),this.bindControl(new l(i,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Circle Levels Visibility")),o=$("<tr>"),o.appendTo(this._table),s=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(s).appendTo(o),this.createLabeledCell("Background",s).appendTo(o),r=f(),$('<td colspan="3">').append(r).appendTo(o),this.bindControl(new l(s,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfork Background Visibility")),this.bindControl(new c(r,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfork Background Transparency")),this.bindControl(new l(n,this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.FloatBinder,a=s.BooleanBinder,l=s.SliderBinder,h=s.SimpleComboBinder,c=s.ColorBinding,d=i(183),p=d.addColorPicker,u=d.createLineStyleEditor,_=d.createLineWidthEditor,f=d.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e,i){var o,n,s,d,f,m,g,v,y,b,w=$("<tr>");w.appendTo(this._table),o=$("<td>"),o.appendTo(w),n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),t?(s=$("<td>"),s.appendTo(w),d=$("<input type='text'>"),d.appendTo(s),d.css("width","70px"),this.bindControl(new r(d,e.coeff,!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell($.t("Trend Line"),n).appendTo(w),f=$("<td class='colorpicker-cell'>"),f.appendTo(w),m=p(f),g=$("<td>"),g.appendTo(w),v=_(),v.appendTo(g),y=$("<td>"),y.appendTo(w),b=u(),b.render().appendTo(y),this.bindControl(new a(n,e.visible,!0,this.model(),"Change Pitchfork Line Visibility")),this.bindControl(new c(m,e.color,!0,this.model(),"Change Pitchfork Line Color",0)),this.bindControl(new h(b,e.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style")),this.bindControl(new l(v,e.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,c,d,p,u;for(this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.addLevelEditor(null,this._linetool.properties().trendline,!1),t=1;t<=11;t++)e="level"+t,this.addLevelEditor($.t("Level {0}").format(t),this._linetool.properties()[e],!1);this.addOneColorPropertyWidget(this._table),i=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),o=$("<tr>").appendTo(i),$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(o)),$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(o)),n=$("<input type='checkbox' class='visibility-switch'>"),s=this.addLabeledRow(this._table,$.t("Show Labels"),n),$("<td>").append(n).prependTo(s),r=$("<table cellspacing='0' cellpadding='0'>"),c=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),d=$("<select><option value='top'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='bottom'>"+$.t("bottom")+"</option></select>"),s=$("<tr>"),s.append("<td>"+$.t("Labels")+"</td>").append(c).append("<td>&nbsp</td>").append(d),s.appendTo(r),s=$("<tr>"),$("<td colspan='5'>").append(r).appendTo(s),s.appendTo(this._table),this.bindControl(new h(c,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Trend-Based Fib Time Labels Alignment")),this.bindControl(new h(d,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Trend-Based Fib Time Labels Alignment")),s=$("<tr>"),s.appendTo(this._table),p=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(p).appendTo(s),this.createLabeledCell($.t("Background"),p).appendTo(s),u=f(),$('<td colspan="3">').append(u).appendTo(s),this.bindControl(new a(p,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility")),this.bindControl(new l(u,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency")),this.bindControl(new a(n,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Retracement Extend Lines")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.FloatBinder,h=s.SimpleComboBinder,c=s.SliderBinder,d=i(183),p=d.addColorPicker,u=d.createLineStyleEditor,_=d.createLineWidthEditor,f=d.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e,i){var o,n,s,h,c,d,u=$("<tr>");u.appendTo(t),o=$("<td>"),o.appendTo(u),n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),s=$("<td>"),s.appendTo(u),h=$("<input type='text'>"),h.appendTo(s),h.css("width","70px"),this.bindControl(new r(n,i.visible,!0,this.model(),"Change Gann Square Line Visibility")),this.bindControl(new l(h,i.coeff,!1,this.model(),"Change Pitchfork Line Coeff")),c=$("<td class='colorpicker-cell'>"),c.appendTo(u),d=p(c),this.bindControl(new a(d,i.color,!0,this.model(),"Change Gann Square Line Color",0))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s,l,d,p,m,g,v,y,b,w,S,T,C,x,P,L,k,I;for(this._table=$(document.createElement("table")),this._table.addClass("property-page property-page-unpadded"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this._table.css({width:"100%"}),t=$("<tbody>").appendTo(this._table),e=$("<tr>"),e.appendTo(t),i=$('<td width="50%">'),i.appendTo(e),o=$('<td width="50%">'),o.appendTo(e),n=$('<table cellspacing="0" cellpadding="2">'),n.appendTo(i),n.addClass("property-page"),s=$('<table cellspacing="0" cellpadding="2">'),s.appendTo(o),s.addClass("property-page"),$("<tr><td align='center' colspan='4'>"+$.t("Price Levels")+"</td></tr>").appendTo(n),$("<tr><td align='center' colspan='4'>"+$.t("Time Levels")+"</td></tr>").appendTo(s),l=1;l<=7;l++)d="hlevel"+l,this.addLevelEditor(n,"Level "+l,this._linetool.properties()[d]);for(l=1;l<=7;l++)d="vlevel"+l,this.addLevelEditor(s,"Level "+l,this._linetool.properties()[d]);this.addOneColorPropertyWidget(n),o.css({"vertical-align":"top"}),p=$("<input type='checkbox' class='visibility-switch'>"),m=$("<input type='checkbox' class='visibility-switch'>"),g=$("<input type='checkbox' class='visibility-switch'>"),v=$("<input type='checkbox' class='visibility-switch'>"),y=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),b=$("<tr>").appendTo(y),w=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(b)),S=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(b)),T=this.addLabeledRow(w,$.t("Left Labels"),p),$("<td>").append(p).prependTo(T),T=this.addLabeledRow(S,$.t("Right Labels"),m),$("<td>").append(m).prependTo(T),T=this.addLabeledRow(w,$.t("Top Labels"),g),$("<td>").append(g).prependTo(T),T=this.addLabeledRow(S,$.t("Bottom Labels"),v),$("<td>").append(v).prependTo(T),this.bindControl(new r(p,this._linetool.properties().showLeftLabels,!0,this.model(),"Change Gann Square Left Labels Visibility")),this.bindControl(new r(m,this._linetool.properties().showRightLabels,!0,this.model(),"Change Gann Square Right Labels Visibility")),this.bindControl(new r(g,this._linetool.properties().showTopLabels,!0,this.model(),"Change Gann Square Top Labels Visibility")),this.bindControl(new r(v,this._linetool.properties().showBottomLabels,!0,this.model(),"Change Gann Square Bottom Labels Visibility")),C=$('<table class="property-page" cellspacing="0" cellpadding="2">'),x=_(),P=u(),L=this.createColorPicker(),k=$("<input type='checkbox' class='visibility-switch'>"),T=this.addLabeledRow(C,$.t("Grid"),k),$("<td>").append(k).prependTo(T),$("<td>").append(L).appendTo(T),$("<td>").append(x).appendTo(T),$("<td>").append(P.render()).appendTo(T),this.bindControl(new r(k,this._linetool.properties().grid.visible,!0,this.model(),"Change Fib Speed Resistance Fan Grid Visibility")),this.bindControl(new a(L,this._linetool.properties().grid.color,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Color",0)),this.bindControl(new h(P,this._linetool.properties().grid.linestyle,parseInt,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Style")),this.bindControl(new c(x,this._linetool.properties().grid.linewidth,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Width")),this._table=this._table.add(y).add(C),T=$("<tr>"),T.appendTo(C),k=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(k).appendTo(T),this.createLabeledCell("Background",k).appendTo(T),I=f(),$('<td colspan="3">').append(I).appendTo(T),this.bindControl(new r(k,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Speed/Resistance Fan Background Visibility")),this.bindControl(new c(I,this._linetool.properties().transparency,!0,this.model(),"Change Fib Speed/Resistance Fan Background Transparency")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.ColorBinding,l=s.SliderBinder,h=i(183),c=h.createLineStyleEditor,d=h.createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$("<tbody>").appendTo(this._table),e=d(),i=c(),o=this.createColorPicker(),n=this.addLabeledRow(t,"Line"),$("<td>").append(o).appendTo(n),$("<td>").append(e).appendTo(n),$('<td colspan="3">').append(i.render()).appendTo(n),this.bindControl(new a(o,this._linetool.properties().linecolor,!0,this.model(),"Change Fib Spiral Line Color")),this.bindControl(new r(i,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Fib Spiral Line Style")),this.bindControl(new l(e,this._linetool.properties().linewidth,!0,this.model(),"Change Fib Spiral Line Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.FloatBinder,a=s.BooleanBinder,l=s.ColorBinding,h=s.SimpleComboBinder,c=s.SliderBinder,d=i(183),p=d.addColorPicker,u=d.createLineStyleEditor,_=d.createLineWidthEditor,f=d.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e,i){var o,n,s,d,f,m,g,v,y,b,w=$("<tr>");w.appendTo(this._table),o=$("<td>"),o.appendTo(w),n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),t?(s=$("<td>"),s.appendTo(w),d=$("<input type='text'>"),d.appendTo(s),d.css("width","70px"),this.bindControl(new r(d,e.coeff,!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell($.t("Trend Line"),n).appendTo(w),f=$("<td class='colorpicker-cell'>"),f.appendTo(w),m=p(f),g=$("<td>"),g.appendTo(w),v=_(),v.appendTo(g),y=$("<td>"),y.appendTo(w),b=u(),b.render().appendTo(y),this.bindControl(new a(n,e.visible,!0,this.model(),"Change Pitchfork Line Visibility")),this.bindControl(new l(m,e.color,!0,this.model(),"Change Pitchfork Line Color",0)),this.bindControl(new h(b,e.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style")),this.bindControl(new c(v,e.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,l,d;for(this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=1;t<=11;t++)e="level"+t,this.addLevelEditor("Level "+t,this._linetool.properties()[e],!1);this.addOneColorPropertyWidget(this._table),i=$("<input type='checkbox' class='visibility-switch'>"),o=this.addLabeledRow(this._table,$.t("Show Labels"),i),$("<td>").append(i).prependTo(o),n=$("<table cellspacing='0' cellpadding='0'>"),s=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),r=$("<select><option value='top'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='bottom'>"+$.t("bottom")+"</option></select>"),o=$("<tr>"),o.append("<td>"+$.t("Labels")+"</td>").append(s).append("<td>&nbsp</td>").append(r),o.appendTo(n),o=$("<tr>"),$("<td colspan='5'>").append(n).appendTo(o),o.appendTo(this._table),this.bindControl(new h(s,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Fib Time Zone Labels Alignment")),this.bindControl(new h(r,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Fib Time Zone Labels Alignment")),o=$("<tr>"),o.appendTo(this._table),l=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(l).appendTo(o),this.createLabeledCell($.t("Background"),l).appendTo(o),d=f(),$('<td colspan="3">').append(d).appendTo(o),this.bindControl(new a(i,this._linetool.properties().showLabels,!0,this.model(),"Change Fib Time Zone Labels Visibility")),this.bindControl(new c(d,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency")),this.bindControl(new a(l,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.FloatBinder,a=s.BooleanBinder,l=s.ColorBinding,h=s.SliderBinder,c=i(183),d=c.addColorPicker,p=c.createLineWidthEditor,u=c.createTransparencyEditor;inherit(o,n),o.prototype.addLevelEditor=function(t,e,i){var o,n,s,c,u,_,f,m,g=$("<tr>");g.appendTo(this._table),o=$("<td>"),o.appendTo(g),n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),t?(s=$("<td>"),s.appendTo(g),c=$("<input type='text'>"),c.appendTo(s),c.css("width","70px"),this.bindControl(new r(c,e.coeff,!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",n).appendTo(g),u=$("<td class='colorpicker-cell'>"),u.appendTo(g),_=d(u),f=$("<td>"),f.appendTo(g),m=p(),m.appendTo(f),this.bindControl(new a(n,e.visible,!0,this.model(),"Change Fib Wedge Visibility")),this.bindControl(new l(_,e.color,!0,this.model(),"Change Fib Wedge Line Color",0)),this.bindControl(new h(m,e.linewidth,!0,this.model(),"Change Fib Wedge Width"))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s;for(this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.addLevelEditor(null,this._linetool.properties().trendline,!1),t=1;t<=11;t++)e="level"+t,this.addLevelEditor("Level "+t,this._linetool.properties()[e],!1);this.addOneColorPropertyWidget(this._table),i=$("<input type='checkbox' class='visibility-switch'>"),o=this.addLabeledRow(this._table,"Levels",i),$("<td>").append(i).prependTo(o),this.bindControl(new a(i,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Wedge Levels Visibility")),o=$("<tr>"),o.appendTo(this._table),n=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(n).appendTo(o),this.createLabeledCell("Background",n).appendTo(o),s=u(),$('<td colspan="3">').append(s).appendTo(o),this.bindControl(new a(n,this._linetool.properties().fillBackground,!0,this.model(),"Change Wedge Background Visibility")),this.bindControl(new h(s,this._linetool.properties().transparency,!0,this.model(),"Change Wedge Background Transparency")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.ColorBinding,l=s.SliderBinder,h=i(183),c=h.createLineStyleEditor,d=h.createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=d(),e=c(),i=this.createColorPicker(),o=this.addLabeledRow(this._table,"Lines"),$("<td>").append(i).appendTo(o),$("<td>").append(t).appendTo(o),$("<td>").append(e.render()).appendTo(o),this.bindControl(new a(i,this._linetool.properties().linecolor,!0,this.model(),"Change Circle Lines Color")),this.bindControl(new r(e,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Circle Lines Style")),this.bindControl(new l(t,this._linetool.properties().linewidth,!0,this.model(),"Change Circle Lines Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.ColorBinding,l=s.SliderBinder,h=s.BooleanBinder,c=i(183),d=c.createLineStyleEditor,p=c.createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,c,u;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$("<tbody>").appendTo(this._table),e=p(),i=d(),o=this.createColorPicker(),n=this.addLabeledRow(t,$.t("Line")),$("<td>").append(o).appendTo(n),$("<td>").append(e).appendTo(n),$('<td colspan="3">').append(i.render()).appendTo(n),this._linetool.properties().fillBackground&&($("<td>").prependTo(n),s=$('<input type="checkbox" class="visibility-switch">'),c=this.createColorPicker(),u=$("<tbody>").appendTo(this._table),n=$("<tr>").appendTo(u),$("<td>").append(s).appendTo(n),$("<td>").append($.t("Background")).appendTo(n),$("<td>").append(c).appendTo(n)),this.bindControl(new a(o,this._linetool.properties().linecolor,!0,this.model(),"Change Time Cycles Color")),this.bindControl(new r(i,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Time Cycles Line Style")),this.bindControl(new l(e,this._linetool.properties().linewidth,!0,this.model(),"Change Time Cycles Line Width")),s&&(this.bindControl(new h(s,this._linetool.properties().fillBackground,!0,this.model(),"Change Time Cycles Filling")),this.bindControl(new a(c,this._linetool.properties().backgroundColor,!0,this.model(),"Change Time Cycles Background Color",this._linetool.properties().transparency)))},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.ColorBinding,l=s.BooleanBinder,h=s.SliderBinder,c=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,d,p,u,_,f,m,g,v;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$("<tbody>").appendTo(this._table),e=c(),i=this.createColorPicker(),o=this.addLabeledRow(t,$.t("Line")),$("<td>").prependTo(o),$("<td>").append(i).appendTo(o),$("<td>").append(e).appendTo(o),n=this.createColorPicker(),s=this.createColorPicker(),d=this.createFontSizeEditor(),p=this.createFontEditor(),u=this.createColorPicker(),_=$('<input type="checkbox" class="visibility-switch">'),f=this.createColorPicker(),m=$('<input type="checkbox" class="visibility-switch">'),this.bindControl(new a(n,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color")),this.bindControl(new r(d,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new r(p,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new a(u,this._linetool.properties().labelBackgroundColor,!0,this.model(),"Change Text Background",this._linetool.properties().labelBackgroundTransparency)),this.bindControl(new l(_,this._linetool.properties().fillLabelBackground,!0,this.model(),"Change Text Background Fill")),this.bindControl(new a(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background",this._linetool.properties().backgroundTransparency)),this.bindControl(new l(m,this._linetool.properties().fillBackground,!0,this.model(),"Change Text Background Fill")),this.bindControl(new a(s,this._linetool.properties().borderColor,!0,this.model(),"Change Text Border Color")),g=this.addLabeledRow(t,$.t("Background"),m),$("<td>").append(m).prependTo(g),$("<td>").append(f).appendTo(g),v=this.addLabeledRow(t,$.t("Label")),$("<td>").prependTo(v),$("<td>").append(n).appendTo(v),$("<td>").append(p).appendTo(v),$("<td>").append(d).appendTo(v),g=this.addLabeledRow(t,$.t("Label Background"),_),$("<td>").append(_).prependTo(g),$("<td>").append(u).appendTo(g),this.bindControl(new a(i,this._linetool.properties().linecolor,!0,this.model(),"Change Date Range Color")),this.bindControl(new h(e,this._linetool.properties().linewidth,!0,this.model(),"Change Date Range Line Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.ColorBinding,l=s.BooleanBinder,h=s.SliderBinder,c=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,d,p,u,_,f,m,g,v;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$("<tbody>").appendTo(this._table),e=c(),i=this.createColorPicker(),o=this.addLabeledRow(t,$.t("Line")),$("<td>").prependTo(o),$("<td>").append(i).appendTo(o),$("<td>").append(e).appendTo(o),n=this.createColorPicker(),s=this.createColorPicker(),d=this.createFontSizeEditor(),p=this.createFontEditor(),u=this.createColorPicker(),_=$('<input type="checkbox" class="visibility-switch">'),f=this.createColorPicker(),m=$('<input type="checkbox" class="visibility-switch">'),this.bindControl(new a(n,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color")),this.bindControl(new r(d,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new r(p,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new a(u,this._linetool.properties().labelBackgroundColor,!0,this.model(),"Change Text Background",this._linetool.properties().labelBackgroundTransparency)),this.bindControl(new l(_,this._linetool.properties().fillLabelBackground,!0,this.model(),"Change Text Background Fill")),this.bindControl(new a(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background",this._linetool.properties().backgroundTransparency)),this.bindControl(new l(m,this._linetool.properties().fillBackground,!0,this.model(),"Change Text Background Fill")),this.bindControl(new a(s,this._linetool.properties().borderColor,!0,this.model(),"Change Text Border Color")),g=this.addLabeledRow(t,$.t("Background"),m),$("<td>").append(m).prependTo(g),$("<td>").append(f).appendTo(g),v=this.addLabeledRow(t,$.t("Label")),$("<td>").prependTo(v),$("<td>").append(n).appendTo(v),$("<td>").append(p).appendTo(v),$("<td>").append(d).appendTo(v),g=this.addLabeledRow(t,$.t("Label Background"),_),$("<td>").append(_).prependTo(g),$("<td>").append(u).appendTo(g),this.bindControl(new a(i,this._linetool.properties().linecolor,!0,this.model(),"Change Date Range Color")),this.bindControl(new h(e,this._linetool.properties().linewidth,!0,this.model(),"Change Date Range Line Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.SliderBinder,h=s.SimpleComboBinder,c=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,d,p,u,_,f;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=c(),e=this.createColorPicker(),i=this.createColorPicker(),o=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),n=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),s=this.createFontSizeEditor(),d=this.createFontEditor(),p=this.addLabeledRow(this._table,"Border"),p.prepend("<td>"),$("<td>").append(e).appendTo(p),$("<td>").append(t).appendTo(p),u=$('<input type="checkbox" class="visibility-switch">'),_=this.createColorPicker(),d=this.createFontEditor(),p=this.addLabeledRow(this._table,"Background",u),$("<td>").append(u).prependTo(p),$("<td>").append(_).appendTo(p),this.bindControl(new r(u,this._linetool.properties().fillBackground,!0,this.model(),"Change Pattern Filling")),this.bindControl(new a(e,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color")),this.bindControl(new a(i,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color")),this.bindControl(new a(_,this._linetool.properties().backgroundColor,!0,this.model(),"Change Pattern Background Color",this._linetool.properties().transparency)),this.bindControl(new l(t,this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width")),this.bindControl(new h(s,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new h(d,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new r(o,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new r(n,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),f=$('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({width:1}).append(i)).append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(s)).append($(document.createElement("td")).css("vertical-align","top").attr({width:1}).append(o)).append($(document.createElement("td")).css("vertical-align","top").append(n)).append($("</tr></table>")),p=this.addLabeledRow(this._table,""),$('<td colspan="5">').append(f).appendTo(p),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.ColorBinding,a=s.SliderBinder,l=s.SimpleComboBinder,h=s.BooleanBinder,c=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,d,p,u;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=c(),e=this.createColorPicker(),i=this.createColorPicker(),o=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),n=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),s=this.createFontSizeEditor(),d=this.createFontEditor(),p=this.addLabeledRow(this._table,"Border"),p.prepend("<td>"),$("<td>").append(e).appendTo(p),$("<td>").append(t).appendTo(p),d=this.createFontEditor(),this.bindControl(new r(e,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color")),this.bindControl(new r(i,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color")),this.bindControl(new a(t,this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width")),this.bindControl(new l(s,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new l(d,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new h(o,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new h(n,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),u=$('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({width:1}).append(i)).append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(s)).append($(document.createElement("td")).css("vertical-align","top").attr({width:1}).append(o)).append($(document.createElement("td")).css("vertical-align","top").append(n)).append($("</tr></table>")),p=this.addLabeledRow(this._table,""),$('<td colspan="5">').append(u).appendTo(p),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e,i),this.prepareLayout()}var n=i(30),s=i(367),r=i(309),a=r.ColorBinding,l=r.SimpleComboBinder,h=r.SimpleStringBinder,c=r.BooleanBinder,d=i(278);inherit(o,s),o.prototype.prepareLayout=function(){var t,e,i,o,n=this.createColorPicker(),s=this.createFontSizeEditor(),r=this.createFontEditor(),d=this.createTextEditor(350,200),p=this.createColorPicker(),u=this.createColorPicker(),_=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),f=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');this.bindControl(new a(n,this._linetool.properties().textColor,!0,this.model(),"Change Text Color")),this.bindControl(new l(s,this._linetool.properties().fontSize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new l(r,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new h(d,this._linetool.properties().text,null,!0,this.model(),"Change Text")),this.bindControl(new a(p,this._linetool.properties().markerColor,!0,this.model(),"Change Marker and Border Color")),this.bindControl(new a(u,this._linetool.properties().backgroundColor,!0,this.model(),"Change Background Color",this._linetool.properties().backgroundTransparency)),this.bindControl(new c(_,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new c(f,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),t=$('<table class="property-page" cellspacing="0" cellpadding="2">'),e=$('<table class="property-page" cellspacing="0" cellpadding="2">'),i=$('<table class="property-page" cellspacing="0" cellpadding="2">'),this._table=t.add(i).add(e),$(document.createElement("tr")).append($(document.createElement("td")).attr({width:1}).append(n)).append($(document.createElement("td")).attr({width:1}).append(r)).append($(document.createElement("td")).attr({width:1}).append(s)).append($(document.createElement("td")).attr({width:1}).append(_)).append($(document.createElement("td")).append(f)).appendTo(t),$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(d)).appendTo(t),o=this.addLabeledRow(i,$.t("Label")),$("<td>").attr("colspan",2).append(p).appendTo(o),o=this.addLabeledRow(i,$.t("Background")),$("<td>").append(u).appendTo(o),this.loadData(),setTimeout(function(){d.select(),d.focus()},20)},o.prototype.widget=function(){return this._table},o.prototype.dialogPosition=function(t,e){var o,s,r,a,l,h,c,p,u,_,f=i(223).LineToolNote;if(t&&e){for(o=0,s=this._linetool._model.paneForSource(this._linetool),r=d.getChartWidget();o<r.paneWidgets().length;o++)if(r.paneWidgets()[o]._state===s){a=$(r.paneWidgets()[o].canvas).offset().left;break}return l=(this._linetool.paneViews()||[])[0],h=new n.Point(0,0),l&&(h=l._floatPoints[0]||this._linetool._fixedPoints[0]||h),c=(a||0)+h.x,p=f.TOOLTIP_WIDTH,u=c-p/2,_=e.outerWidth(),t.left<u&&t.left+_+10>u?(t.left-=t.left+_+10-u,t):t.left>u&&t.left<u+p+10?(t.left+=u+p+10-t.left,t):void 0}},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.BooleanBinder,a=s.ColorBinding,l=s.SliderBinder,h=s.SimpleComboBinder,c=i(183).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,d,p,u,_,f;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=c(),e=this.createColorPicker(),i=this.createColorPicker(),o=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),n=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),s=this.createFontSizeEditor(),d=this.createFontEditor(),p=this.addLabeledRow(this._table,"Border"),p.prepend("<td>"),$("<td>").append(e).appendTo(p),$("<td>").append(t).appendTo(p),u=$('<input type="checkbox" class="visibility-switch">'),_=this.createColorPicker(),d=this.createFontEditor(),p=this.addLabeledRow(this._table,"Background",u),$("<td>").append(u).prependTo(p),$("<td>").append(_).appendTo(p),this.bindControl(new r(u,this._linetool.properties().fillBackground,!0,this.model(),"Change Pattern Filling")),this.bindControl(new a(e,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color")),this.bindControl(new a(i,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color")),this.bindControl(new a(_,this._linetool.properties().backgroundColor,!0,this.model(),"Change Pattern Background Color",this._linetool.properties().transparency)),this.bindControl(new l(t,this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width")),this.bindControl(new h(s,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new h(d,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new r(o,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new r(n,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),f=$('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({width:1}).append(i)).append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(s)).append($(document.createElement("td")).css("vertical-align","top").attr({width:1}).append(o)).append($(document.createElement("td")).css("vertical-align","top").append(n)).append($("</tr></table>")),p=this.addLabeledRow(this._table,""),$('<td colspan="5">').append(f).appendTo(p),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.BooleanBinder,l=s.ColorBinding,h=s.SliderBinder,c=i(183),d=c.createLineStyleEditor,p=c.createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,c,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$("<tbody>").appendTo(this._table),e=p(),i=d(),o=this.createColorPicker(),n=this.addLabeledRow(t,$.t("Line")),$("<td>").append(o).appendTo(n),$("<td>").append(e).appendTo(n),$('<td colspan="3">').append(i.render()).appendTo(n),n=this.addLabeledRow(t,$.t("Text")),s=this.createColorPicker(),c=this.createFontSizeEditor(),u=this.createFontEditor(),_=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),f=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),$("<td>").append(s).appendTo(n),$("<td>").append(u).appendTo(n),$("<td>").append(c).appendTo(n),$("<td>").append(_).appendTo(n),$("<td>").append(f).appendTo(n),m=$("<tbody>").appendTo(this._table),g=$('<input type="checkbox" class="visibility-switch">'),v=this.createColorPicker(),n=this.addLabeledRow(m,$.t("Background"),g),y=$("<table>"),$('<td colspan="5">').append(y).appendTo(n),n=$("<tr>").appendTo(y),$("<td>").append(g).appendTo(n),$("<td>").append(v).appendTo(n),b=$("<tbody>").appendTo(this._table),w=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),S=$('<input type="checkbox">').appendTo(w),T=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),C=$('<input type="checkbox">').appendTo(T),x=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),P=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),n=this.addLabeledRow(b,$.t("Left End")),$('<td colspan="3">').appendTo(n).append(x).append(w),n=this.addLabeledRow(b,$.t("Right End")),$('<td colspan="3">').appendTo(n).append(P).append(T),L=$("<tbody>").appendTo(this._table),n=$("<tr>").appendTo(L),k=$("<input type='checkbox'>"),I=$("<label style='display:block'>").append(k).append($.t("Show Prices")),$("<td colspan='2'>").append(I).appendTo(n),this.bindControl(new r(c,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new r(u,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new l(s,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color")),this.bindControl(new a(_,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new a(f,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),this.bindControl(new a(k,this._linetool.properties().showPrices,!0,this.model(),"Change Disjoint Angle Show Prices")),this.bindControl(new a(S,this._linetool.properties().extendLeft,!0,this.model(),"Change Disjoint Angle Extending Left")),this.bindControl(new a(C,this._linetool.properties().extendRight,!0,this.model(),"Change Disjoint Angle Extending Right")),this.bindControl(new l(o,this._linetool.properties().linecolor,!0,this.model(),"Change Disjoint Angle Color")),this.bindControl(new r(i,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Disjoint Angle Style")),this.bindControl(new h(e,this._linetool.properties().linewidth,!0,this.model(),"Change Disjoint Angle Width")),this.bindControl(new r(x,this._linetool.properties().leftEnd,parseInt,!0,this.model(),"Change Disjoint Angle Left End")),this.bindControl(new r(P,this._linetool.properties().rightEnd,parseInt,!0,this.model(),"Change Disjoint Angle Right End")),this.bindControl(new a(g,this._linetool.properties().fillBackground,!0,this.model(),"Change Disjoint Angle Filling")),this.bindControl(new l(v,this._linetool.properties().backgroundColor,!0,this.model(),"Change Disjoint Angle Background Color",this._linetool.properties().transparency)),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309),r=s.SimpleComboBinder,a=s.ColorBinding,l=s.BooleanBinder,h=s.SliderBinder,c=i(183),d=c.createLineStyleEditor,p=c.createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,c,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I;this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$("<tbody>").appendTo(this._table),e=p(),i=d(),o=this.createColorPicker(),n=this.addLabeledRow(t,$.t("Line")),$("<td>").append(o).appendTo(n),$("<td>").append(e).appendTo(n),$('<td colspan="3">').append(i.render()).appendTo(n),n=this.addLabeledRow(t,$.t("Text")),s=this.createColorPicker(),c=this.createFontSizeEditor(),u=this.createFontEditor(),_=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),f=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),$("<td>").append(s).appendTo(n),$("<td>").append(u).appendTo(n),$("<td>").append(c).appendTo(n),$("<td>").append(_).appendTo(n),$("<td>").append(f).appendTo(n),m=$("<tbody>").appendTo(this._table),g=$('<input type="checkbox" class="visibility-switch">'),v=this.createColorPicker(),n=this.addLabeledRow(m,$.t("Background"),g),y=$("<table>"),$('<td colspan="5">').append(y).appendTo(n),n=$("<tr>").appendTo(y),$("<td>").append(g).appendTo(n),$("<td>").append(v).appendTo(n),b=$("<tbody>").appendTo(this._table),w=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),S=$('<input type="checkbox">').appendTo(w),T=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),C=$('<input type="checkbox">').appendTo(T),x=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),P=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),n=this.addLabeledRow(b,$.t("Left End")),$('<td colspan="3">').appendTo(n).append(x).append(w),n=this.addLabeledRow(b,$.t("Right End")),$('<td colspan="3">').appendTo(n).append(P).append(T),L=$("<tbody>").appendTo(this._table),n=$("<tr>").appendTo(L),k=$("<input type='checkbox'>"),I=$("<label style='display:block'>").append(k).append($.t("Show Prices")),$("<td colspan='2'>").append(I).appendTo(n),this.bindControl(new r(c,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size")),this.bindControl(new r(u,this._linetool.properties().font,null,!0,this.model(),"Change Text Font")),this.bindControl(new a(s,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color")),this.bindControl(new l(_,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new l(f,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic")),this.bindControl(new l(k,this._linetool.properties().showPrices,!0,this.model(),"Change Disjoint Angle Show Prices")),this.bindControl(new l(S,this._linetool.properties().extendLeft,!0,this.model(),"Change Disjoint Angle Extending Left")),this.bindControl(new l(C,this._linetool.properties().extendRight,!0,this.model(),"Change Disjoint Angle Extending Right")),this.bindControl(new a(o,this._linetool.properties().linecolor,!0,this.model(),"Change Disjoint Angle Color")),this.bindControl(new r(i,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Disjoint Angle Style")),this.bindControl(new h(e,this._linetool.properties().linewidth,!0,this.model(),"Change Disjoint Angle Width")),this.bindControl(new r(x,this._linetool.properties().leftEnd,parseInt,!0,this.model(),"Change Disjoint Angle Left End")),this.bindControl(new r(P,this._linetool.properties().rightEnd,parseInt,!0,this.model(),"Change Disjoint Angle Right End")),this.bindControl(new l(g,this._linetool.properties().fillBackground,!0,this.model(),"Change Disjoint Angle Filling")),this.bindControl(new a(v,this._linetool.properties().backgroundColor,!0,this.model(),"Change Disjoint Angle Background Color",this._linetool.properties().transparency)),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(367),s=i(309).ColorBinding;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=this.createColorPicker(),e=this.addLabeledRow(this._table,"Color:"),$("<td>").append(t).appendTo(e),i=this._linetool.properties(),this._div=$("<div>").append(this._table),this.bindControl(new s(t,i.color,!0,this.model(),"Change Icon Color")),this.loadData()},o.prototype.widget=function(){return this._div},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(366);inherit(o,n),t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,e,i){var o,n,s=e.m_model.properties();l.call(this,s,e),o=this._series=e.mainSeries(),this._chart=e.m_model,this._model=e,this._source=i,this._property=s,this._seriesProperty=o.properties(),this._scaleProperty=o.m_priceScale.properties(),this._mainAxisProperty=o.properties().priceAxisProperties,n=null,$.each(e.m_model.panes(),function(t,e){$.each(e.dataSources(),function(t,i){if(i===o)return n=e,!1})}),this._pane=n,this.prepareLayout(),this._themes=[]}var n=i(374),s=i(291).UndoHistory,r=i(365),a=i(309),l=a.PropertyPage,h=a.GreateTransformer,c=a.LessTransformer,d=a.ToIntTransformer,p=a.SimpleStringBinder,u=a.BooleanBinder,_=a.SliderBinder,f=a.ColorBinding,m=a.SimpleComboBinder,g=a.DisabledBinder,v=a.CheckboxWVBinding,y=i(102),b=i(99),w=i(183),S=w.addColorPicker,T=w.createLineStyleEditor,C=w.createLineWidthEditor,x=w.bindPopupMenu,P=i(91).DefaultProperty,L=i(135).availableTimezones,k=i(321);inherit(o,l),inherit(o,n),o.prototype.setScalesOpenTab=function(){this.scalesTab&&this.scalesTab.data("layout-tab-open",r.TAB_OPEN_OVERRIDE)},o.prototype.setTmzOpenTab=function(){this.tmzSessTable&&this.tmzSessTable.data("layout-tab-open",r.TAB_OPEN_OVERRIDE)},o.prototype.prepareLayout=function(){var t,i,o,n,s,r,a,l,w,S,x,P,I,E,A,V,M,D,O,B,R,N,F,W,z,H,U,j,q,Y,G,K,X,Z,J,Q,tt,et,it,ot,nt,st,rt,at,lt,ht,ct,dt,pt,ut,_t,ft,mt,gt,vt,yt,bt,wt,St,Tt,Ct,xt,Pt,Lt,kt,It,Et,At,Vt,Mt,$t,Dt,Ot,Bt,Rt,Nt,Ft,Wt,zt,Ht,Ut,jt,qt,Yt,Gt,Kt,Xt,Zt,Jt,Qt,te,ee,ie,oe,ne,se,re,ae,le,he,ce,de,pe,ue,_e,fe,me,ge,ve,ye,be,we,Se,Te,Ce,xe,Pe,Le,ke,Ie,Ee=this;if(e.enabled("chart_property_page_style")&&(t=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),i=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),o=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),this._prepareSeriesStyleLayout(t,i,o,this._seriesProperty),this._hasSeriesStyleLayout=!0,r=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),A=$('<input type="checkbox">'),V=this.addLabeledRow(r,$.t("Price Line"),A),$("<td>").append(A).prependTo(V),this.bindControl(new u(A,this._seriesProperty.showPriceLine,!0,this.model(),"Change Price Price Line")),M=C(),$("<td>").append(M).appendTo(V),this.bindControl(new _(M,this._seriesProperty.priceLineWidth,!0,this.model(),"Change Price Line Width")),a=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),D=this.createSeriesMinTickEditor(),O=$("<tr>"),O.appendTo(a),$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(O),$("<td>").append(D).appendTo(O),this.bindControl(new m(D,this._seriesProperty.minTick,null,!0,this.model(),"Change MinTick")),l=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),this._pane&&(this._pane.leftPriceScale().dataSources().indexOf(this._series)!==-1?B="left":this._pane.rightPriceScale().dataSources().indexOf(this._series)!==-1?B="right":this._pane.isOverlay(this._series)&&(B="none")),B&&(R={left:$.t("Scale Left"),right:$.t("Scale Right")},Ee._pane.actionNoScaleIsEnabled(Ee._series)&&(R.none=$.t("Screen (No Scale)")),N=this.createKeyCombo(R).val(B).change(function(){switch(this.value){case"left":Ee._model.move(Ee._series,Ee._pane,Ee._pane.leftPriceScale());break;case"right":Ee._model.move(Ee._series,Ee._pane,Ee._pane.rightPriceScale());break;case"none":Ee._model.move(Ee._series,Ee._pane,null)}}),F=this.addRow(l),$("<td>"+$.t("Scale")+"</td>").appendTo(F),$("<td>").appendTo(F).append(N))),e.enabled("chart_property_page_scales")&&(W=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),z=$('<input type="checkbox">').change(function(){this.checked&&setTimeout(function(){Ee._model.m_model.invalidate(new b(b.LIGHT_UPDATE))},0)}),H=this.addLabeledRow(W,$.t("Auto Scale"),z),U=function(t){this._undoModel.setAutoScaleProperty(this._property,t,Ee._series.priceScale(),this._undoText)},$("<td>").append(z).prependTo(H),this.bindControl(new u(z,this._scaleProperty.autoScale,!0,this.model(),"Auto Scale",U)),this.bindControl(new g(z,this._scaleProperty.autoScaleDisabled,!0,this.model(),"Auto Scale")),j=$('<input type="checkbox">'),q=this.addLabeledRow(W,$.t("Percentage"),j),Y=function(t){this._undoModel.setPercentProperty(this._property,t,Ee._series.priceScale(),this._undoText)},$("<td>").append(j).prependTo(q),this.bindControl(new u(j,this._mainAxisProperty.percentage,!0,this.model(),"Scale Percentage",Y)),this.bindControl(new g(j,this._mainAxisProperty.percentageDisabled,!0,this.model(),"Scale Percentage")),G=$('<input type="checkbox">'),K=this.addLabeledRow(W,$.t("Log Scale"),G),X=function(t){this._undoModel.setLogProperty(this._property,t,Ee._series.priceScale(),this._undoText)},$("<td>").append(G).prependTo(K),this.bindControl(new u(G,this._mainAxisProperty.log,!0,this.model(),"Log Scale",X)),this.bindControl(new g(G,this._mainAxisProperty.logDisabled,!0,this.model(),"Log Scale")),Z=$('<input type="checkbox">').change(function(){this.checked&&setTimeout(function(){Ee._model.m_model.invalidate(new b(b.LIGHT_UPDATE))},0)}),J=this.addLabeledRow(W,$.t("Scale Series Only"),Z),$("<td>").append(Z).prependTo(J),this.bindControl(new u(Z,this._property.scalesProperties.scaleSeriesOnly,!0,this.model(),"Scale Series Only")),Q=$("<input type='checkbox'/>"),tt=this.addLabeledRow(W,$.t("Lock scale"),Q),et=function(t){this._undoModel.setLockScaleProperty(this._property,t,Ee._series,this._undoText)},it=function(t){tt.toggle(t.value()===y.STYLE_PNF)},$("<td>").append(Q).prependTo(tt),this.bindControl(new u(Q,this._seriesProperty.lockScale,!0,this.model(),"Change lock scale",et)),this._seriesProperty.style.listeners().subscribe(this,it),ot=$("<input type='checkbox'/>"),nt=this.addLabeledRow(W,$.t("Track time"),ot),$("<td>").append(ot).prependTo(nt),this.bindControl(new v(ot,this._model.trackTime(),null,"Change track time")),st=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),rt=$('<input type="text" class="ticker">'),at=this.addLabeledRow(st,$.t("Top Margin"),rt),$("<td>").appendTo(at).append(rt),$("<td>%</td>").appendTo(at),lt=[d(this._property.paneProperties.topMargin.value())],lt.push(c(25)),lt.push(h(0)),this.bindControl(new p(rt,this._property.paneProperties.topMargin,lt,!0,this.model(),"Top Margin")),ht=$('<input type="text" class="ticker">'),ct=this.addLabeledRow(st,$.t("Bottom Margin"),ht),$("<td>").appendTo(ct).append(ht),$("<td>%</td>").appendTo(ct),dt=[d(this._property.paneProperties.bottomMargin.value())],dt.push(c(25)),dt.push(h(0)),this.bindControl(new p(ht,this._property.paneProperties.bottomMargin,dt,!0,this.model(),"Bottom Margin")),pt=$('<input type="text" class="ticker">'),ut=this.addLabeledRow(st,$.t("Right Margin"),pt),$("<td>").appendTo(ut).append(pt),$("<td>"+$.t("bars",{context:"margin"})+"</td>").appendTo(ut),_t=[d(this._property.timeScale.rightOffset.value())],_t.push(c(~~this._chart.m_timeScale.maxOffset())),_t.push(h(-200)),this.bindControl(new p(pt,this._property.timeScale.rightOffset,_t,!0,this.model(),"Right Margin")),ft=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),mt=$("<input type='checkbox' />"),gt=this.addLabeledRow(ft,$.t("Left Axis"),mt),$("<td>").append(mt).prependTo(gt),setTimeout(function(){this.bindControl(new u(mt,this._property.scalesProperties.showLeftScale,!0,this.model(),"Show Left Axis"))}.bind(this),0),vt=$("<input type='checkbox' />"),yt=this.addLabeledRow(ft,$.t("Right Axis"),vt),$("<td>").append(vt).prependTo(yt),setTimeout(function(){this.bindControl(new u(vt,this._property.scalesProperties.showRightScale,!0,this.model(),"Show Right Axis"))}.bind(this),0),e.enabled("countdown")&&(bt=$("<input type='checkbox'>"),wt=this.addLabeledRow(ft,$.t("Countdown"),bt),$("<td>").append(bt).prependTo(wt),this.bindControl(new u(bt,this._seriesProperty.showCountdown,!0,this.model(),"Change Show Countdown"))),St=$('<input type="checkbox">'),Tt=this.addLabeledRow(ft,$.t("Symbol Last Value"),St),$("<td>").append(St).prependTo(Tt),this.bindControl(new u(St,this._property.scalesProperties.showSeriesLastValue,!0,this.model(),"Change Symbol Last Value Visibility")),Ct=$('<input type="checkbox">'),xt=this.addLabeledRow(ft,$.t("Indicator Last Value"),Ct),$("<td>").append(Ct).prependTo(xt),this.bindControl(new u(Ct,this._property.scalesProperties.showStudyLastValue,!0,this.model(),"Change Indicator Last Value Visibility")),Pt=$('<input type="checkbox">'),Lt=this.addLabeledRow(ft,$.t("Symbol Labels"),Pt),$("<td>").append(Pt).prependTo(Lt),this.bindControl(new u(Pt,this._property.scalesProperties.showSymbolLabels,!0,this.model(),"Show Symbol Labels")),kt=$('<input type="checkbox">'),It=this.addLabeledRow(ft,$.t("Indicator Labels"),kt),$("<td>").append(kt).prependTo(It),this.bindControl(new u(kt,this._property.scalesProperties.showStudyPlotLabels,!0,this.model(),"Show Study Plots Labels")),Et=$("<input type='checkbox' />"),At=this.addLabeledRow(ft,$.t("Precise Labels"),Et),$("<td>").append(Et).prependTo(At),this.bindControl(new u(Et,this._scaleProperty.alignLabels,!0,this.model(),"Precise Labels")),Vt=$('<div class="property-page-column-2">').append(W).append(st),Mt=$('<div class="property-page-column-2">').append(ft),w=$("<div>").css("min-width","420px").data("layout-tab",$.t("Scales")),w.append(Vt).append(Mt),this.scalesTab=w),e.enabled("chart_property_page_background")&&($t=$('<table class="property-page" cellspacing="0" cellpadding="2">'),Dt=this.createColorPicker({hideTransparency:!0}),Ot=this.addLabeledRow($t,$.t("Background")),$('<td colspan="2">').append(Dt).appendTo(Ot),this.bindControl(new f(Dt,this._property.paneProperties.background,!0,this.model(),"Change Chart Background Color")),Bt=this.addLabeledRow($t,$.t("Vert Grid Lines")),Rt=this.createColorPicker(),$("<td>").append(Rt).appendTo(Bt),this.bindControl(new f(Rt,this._property.paneProperties.vertGridProperties.color,!0,this.model(),"Change Vert Grid Lines Color")),Nt=T(),$('<td colspan="2">').append(Nt.render()).appendTo(Bt),this.bindControl(new m(Nt,this._property.paneProperties.vertGridProperties.style,parseInt,!0,this.model(),"Change Vert Grid Lines Style")),Ft=this.addLabeledRow($t,$.t("Horz Grid Lines")),Wt=this.createColorPicker(),$("<td>").append(Wt).appendTo(Ft),this.bindControl(new f(Wt,this._property.paneProperties.horzGridProperties.color,!0,this.model(),"Change Horz Grid Lines Color")),zt=T(),$('<td colspan="2">').append(zt.render()).appendTo(Ft),this.bindControl(new m(zt,this._property.paneProperties.horzGridProperties.style,parseInt,!0,this.model(),"Change Horz Grid Lines Style")),Ht=this.createColorPicker(),Ut=this.addLabeledRow($t,$.t("Scales Text")),$("<td>").append(Ht).appendTo(Ut),this.bindControl(new f(Ht,this._property.scalesProperties.textColor,!0,this.model(),"Change Scales Text Color")),jt=this.createFontSizeEditor(),$("<td>").append(jt).appendTo(Ut),this.bindControl(new m(jt,this._property.scalesProperties.fontSize,parseInt,!0,this.model(),"Change Scales Font Size")),qt=this.createColorPicker(),Yt=this.addLabeledRow($t,$.t("Scales Lines")),$('<td colspan="2">').append(qt).appendTo(Yt),this.bindControl(new f(qt,this._property.scalesProperties.lineColor,!0,this.model(),"Change Scales Lines Color")),Gt=this.addLabeledRow($t,$.t("Watermark")),Kt=this.createColorPicker(),$("<td>").append(Kt).appendTo(Gt),this.bindControl(new f(Kt,this._property.symbolWatermarkProperties.color,!0,this.model(),"Change Symbol Watermark Color",this._property.symbolWatermarkProperties.transparency)),Xt=this.addLabeledRow($t,$.t("Crosshair")),Zt=this.createColorPicker(),$("<td>").append(Zt).appendTo(Xt),this.bindControl(new f(Zt,this._property.paneProperties.crossHairProperties.color,!0,this.model(),"Change Crosshair Color",this._property.paneProperties.crossHairProperties.transparency)),Jt=T(),$("<td>").append(Jt.render()).appendTo(Xt),this.bindControl(new m(Jt,this._property.paneProperties.crossHairProperties.style,parseInt,!0,this.model(),"Change Crosshair Style")),Qt=C(),$("<td>").append(Qt).appendTo(this.addRow($t).prepend("<td/><td/>")),this.bindControl(new _(Qt,this._property.paneProperties.crossHairProperties.width,!0,this.model(),"Change Crosshair Width")),te=$('<table class="property-page">'),ee=this.addLabeledRow(te,$.t("Navigation Buttons"),null,!0),ie=[],Object.keys(k.visibilityPropertyAvailableValues).forEach(function(t){ie.push('<option value="',t,'">',k.visibilityPropertyAvailableValues[t],"</option>")}),oe=$("<select>"+ie.join("")+"</select>"),$("<td>").append(oe).appendTo(ee),this.bindControl(new m(oe,k.visibilityProperty,null,!0,this.model(),"Change Navigation Buttons Visibility")),ne=$('<table class="property-page" cellspacing="0" cellpadding="2">'),se=$('<input type="checkbox">'),re=this.addLabeledRow(ne,$.t("Symbol Description"),se),$("<td>").append(se).prependTo(re),this.bindControl(new u(se,this._property.paneProperties.legendProperties.showSeriesTitle,!0,this.model(),"Change Symbol Description Visibility")),ae=$('<input type="checkbox">'),le=this.addLabeledRow(ne,$.t("OHLC Values"),ae),$("<td>").append(ae).prependTo(le),this.bindControl(new u(ae,this._property.paneProperties.legendProperties.showSeriesOHLC,!0,this.model(),"Change OHLC Values Visibility")),he=$('<input type="checkbox">'),ce=this.addLabeledRow(ne,$.t("Indicator Titles"),he),$("<td>").append(he).prependTo(ce),this.bindControl(new u(he,this._property.paneProperties.legendProperties.showStudyTitles,!0,this.model(),"Change Indicator Titles Visibility")),de=$('<input type="checkbox">'),pe=this.addLabeledRow(ne,$.t("Indicator Arguments"),de),ue=function(t){de.prop("disabled",!t.value())},$("<td>").append(de).prependTo(pe),this.bindControl(new u(de,this._property.paneProperties.legendProperties.showStudyArguments,!0,this.model(),"Change Indicator Arguments Visibility")),this._property.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,ue),ue(this._property.paneProperties.legendProperties.showStudyTitles),_e=$('<input type="checkbox">'),fe=this.addLabeledRow(ne,$.t("Indicator Values"),_e),$("<td>").append(_e).prependTo(fe),this.bindControl(new u(_e,this._property.paneProperties.legendProperties.showStudyValues,!0,this.model(),"Change Indicator Values Visibility")),me=$('<div class="property-page-column-2">').append($t),ge=$('<div class="property-page-column-2">').append(ne),ve=$('<div class="property-page-column-1">').append(te),S=$("<div>").css("min-width","520px").data("layout-tab",$.t("Background")),S.append(me).append(ge).append(ve)),e.enabled("chart_property_page_timezone_sessions")){for(P=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Timezone/Sessions")),this.tmzSessTable=P,ut=$("<tr>").appendTo(P),ye=$("<td>").appendTo(ut),be=$('<table cellspacing="0" cellpadding="0">').appendTo(ye),we=$("<tr>"),we.appendTo(be),Se=$("<td>"),Se.appendTo(we),Se.text($.t("Time Zone")),Te=$('<td colspan="2" class="tzeditor">'),Te.appendTo(we),Ce="",xe=0;xe<L.length;xe++)Ce+='<option value="'+L[xe].id+'">'+L[xe].title+"</option>";Pe=$("<select>"+Ce+"</select>"),Pe.appendTo(Te),this.bindControl(new m(Pe,this._property.timezone,null,!0,this.model(),"Change Timezone")),e.enabled("charting_library_base")||(this._series.createSessStudy(),this.createSessTable(P))}Le=e.enabled("chart_property_page_evetns_alerts")&&(e.enabled("alerts")||TradingView.isFeatureEnabled("esdindicatorfeature"))&&!e.enabled("charting_library_base"),Le&&(ke=e.enabled("alerts")?$.t("Events & Alerts"):$.t("Events"),E=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",ke),this.createEventsTable(E)),Ie=e.enabled("trading_options")||e.enabled("chart_property_page_trading"),Ie&&(I=this.createTradingTable()),n=$('<table class="property-page" cellspacing="0" cellpadding="2">'),s=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}).data("layout-separated",!0),x=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Drawings")),this._table=$().add(t).add(i).add(o).add(n).add(s).add(r).add(l).add(a).add(w).add(S).add(x).add(P).add(I).add(E),this.loadData()},o.prototype.widget=function(){return this._table},o.prototype.loadData=function(){this.superclass.prototype.loadData.call(this),this.switchStyle()},o.prototype.loadTheme=function(t){var e=this;$.get("/theme/?themeName="+encodeURIComponent(t),function(t){e.applyTheme(JSON.parse(t.content))})},o.prototype.applyTheme=function(t){var e=this._seriesProperty.extendedHours.value();this._model.model().restoreTheme(t),this._seriesProperty.extendedHours.value()!==e&&this._seriesProperty.extendedHours.listeners().fire(this._seriesProperty.extendedHours),this.loadData()},o.prototype.createTemplateButton=function(t){var i,o,n;return e.enabled("chart_property_page_template_button")?(i=this,t||(t={}),o=function(){var e,o=[];return o.push({title:$.t("Save As..."),action:function(){runOrSignIn(function(){themesUtils.showThemeSaveDialog(i._model)},{source:"Save theme in chart properties"})},addClass:"special"}),"function"==typeof t.defaultsCallback&&o.push({title:$.t("Apply Defaults"),action:t.defaultsCallback,addClass:"special"}),e=[],$.each(i._themes,function(t,o){e.push({title:$.t(o),action:function(){i.loadTheme(o)},deleteAction:is_authenticated?function(){var t=this,e=$.t("Do you realy want to delete theme",{theme:o?'"'+o+'"':""});e=TradingView.clean(e),TVDialogs.showConfirm($.t("Theme"),e,function(){t instanceof $&&t.remove(),$.post("/remove-theme/",{name:o}).error(function(t){TradingView.logError(t.responseText)}),themesUtils.themes.invalidate();for(var e=i._themes.length;e--;)i._themes[e]===o&&i._themes.splice(e,1)})}:void 0})}),e.length&&(e.sort(function(t,e){return t=t.title.toUpperCase(),e=e.title.toUpperCase(),t===e?0:t>e?1:-1}),o.push({separator:!0}),o=o.concat(e)),o},n=$('<a href="#" class="_tv-button">'+$.t("Themes")+'<span class="icon-dropdown"></span></a>'),x(n,null,{direction:"up",event:"button-popup",notCloseOnButtons:!0}),n.bind("click",function(){var t=$(this);t.is(".active")||themesUtils.themes.requestData(function(e){i._themes=e,t.trigger("button-popup",[o(),!0])})}),n):$("<span />")},o.prototype.switchStyle=function(){if(this._hasSeriesStyleLayout)switch($(this._barsTbody).add(this._barsColorerTbody).add(this._renkoTbody).add(this._pbTbody).add(this._kagiTbody).add(this._pnfTbody).add(this._candlesTbody).add(this._candlesColorerTbody).add(this._hollowCandlesTbody).add(this._lineTbody).add(this._areaTbody).add(this._haTbody).add(this._haColorerTbody).css("display","none"),this._seriesProperty.style.value()){case y.STYLE_BARS:this._barsTbody.css("display","table-row-group"),this._barsColorerTbody.css("display","table-row-group");break;case y.STYLE_CANDLES:this._candlesTbody.css("display","table-row-group"),this._candlesColorerTbody.css("display","table-row-group");break;case y.STYLE_HOLLOW_CANDLES:this._hollowCandlesTbody.css("display","table-row-group");break;case y.STYLE_LINE:this._lineTbody.css("display","table-row-group");break;case y.STYLE_AREA:this._areaTbody.css("display","table-row-group");break;case y.STYLE_RENKO:this._renkoTbody.css("display","table-row-group");break;case y.STYLE_PB:this._pbTbody.css("display","table-row-group");break;case y.STYLE_KAGI:this._kagiTbody.css("display","table-row-group");break;case y.STYLE_PNF:this._pnfTbody.css("display","table-row-group");break;case y.STYLE_HEIKEN_ASHI:this._haTbody.css("display","table-row-group"),this._haColorerTbody.css("display","table-row-group")}},o.prototype.onResoreDefaults=function(){var t,e=this._model.model().properties().paneProperties.topMargin,i=this._model.model().properties().paneProperties.bottomMargin;e.listeners().fire(e),i.listeners().fire(i),"undefined"!=typeof trading&&(s.setWatchedValue(trading.hideFloatingPanel,!1,"Restore Defaults"),s.setWatchedValue(trading.noConfirmEnabled,!1,"Restore Defaults")),t=this._model.model().properties().timezone,t.listeners().fire(t)},o.prototype.defaultProperties=function(){var t=this,e=[t._seriesProperty.extendedHours,t._property.scalesProperties.showLeftScale,t._property.scalesProperties.showRightScale,t._property.timeScale.rightOffset].map(function(t){return{property:t,previousValue:t.value()}});return setTimeout(function(){e.forEach(function(t){t.property.value()!==t.previousValue&&t.property.listeners().fire(t.property)});var i=new P("chartproperties.paneProperties.rightAxisProperties");$.each(["autoScale","percentage","log"],function(e,o){var n=t._scaleProperty[o],s=i[o].value();s!==n.value()&&n.setValue(s)})},0),[this._property,this._seriesProperty]},o.prototype.createEventsTable=function(t){var i,o,n,s,r,a,l,h,c,d,p,v,y,b,w,x,P,L,k,I,E,A,V,M,D,O,B,R,N,F,W;TradingView.isFeatureEnabled("esdindicatorfeature")&&(i=$("<tr>").appendTo(t),o=$('<input type="checkbox" />'),n=this.addLabeledRow(i,$.t("Show Dividends on Chart"),o),$("<td>").append(o).prependTo(n),n.append("<td>"),this.bindControl(new u(o,this._seriesProperty.esdShowDividends,!0,this.model(),"Change Show or Hide Dividends")),s=$('<input type="checkbox" />'),n=this.addLabeledRow(i,$.t("Show Splits on Chart"),s),$("<td>").append(s).prependTo(n),n.append("<td>"),this.bindControl(new u(s,this._seriesProperty.esdShowSplits,!0,this.model(),"Change Show or Hide Splits")),r=$('<input type="checkbox" />'),n=this.addLabeledRow(i,$.t("Show Earnings on Chart"),r),$("<td>").append(r).prependTo(n),n.append("<td>"),this.bindControl(new u(r,this._seriesProperty.esdShowEarnings,!0,this.model(),"Change Show or Hide Earnings")),a=this.createTableInTable(t),l=$('<input type="checkbox" />'),h=T(),c=C(),n=this.addLabeledRow(a,$.t("Earnings breaks"),l),$("<td>").append(l).prependTo(n),d=S($("<td>").appendTo(n)),$("<td>").append(h.render()).appendTo(n),$("<td>").append(c).appendTo(n),n.addClass("offset-row"),n.append("<td>"),this.bindControl(new u(l,this._seriesProperty.esdShowBreaks,!0,this.model(),"Change Show or Hide Earnings")),this.bindControl(new f(d,this._seriesProperty.esdBreaksStyle.color,!0,this.model(),"Change earnings color")),this.bindControl(new m(h,this._seriesProperty.esdBreaksStyle.style,parseInt,!0,this.model(),"Change style")),this.bindControl(new _(c,this._seriesProperty.esdBreaksStyle.width,!0,this.model(),"Change width")),p=function(t){l.prop("disabled",!t.value())},this._seriesProperty.esdShowEarnings.listeners().subscribe(this,p)),e.enabled("chart_events")&&TradingView.isFeatureEnabled("chart_events")&&(v=$('<input type="checkbox">'),y=$('<input type="checkbox">'),b=$('<input type="checkbox" />'),w=T(),x=C(),P=this.createColorPicker(),L=this._property.chartEventsSourceProperties,this.bindControl(new u(v,L.visible,!0,this.model(),"Change Show Economic Events on Chart")),this.bindControl(new u(y,L.futureOnly,!0,this.model(),"Change Show Only Future Events")),this.bindControl(new g(y,L.visible,!0,this.model(),"",!0)),this.bindControl(new g(b,L.visible,!0,this.model(),"",!0)),this.bindControl(new u(b,L.breaks.visible,!0,this.model(),"Change Show or Hide Events Breaks")),this.bindControl(new f(P,L.breaks.color,!0,this.model(),"Change Events Breaks Color")),this.bindControl(new m(w,L.breaks.style,parseInt,!0,this.model(),"Change Events Breaks Style")),this.bindControl(new _(x,L.breaks.width,!0,this.model(),"Change Events Breaks Width")),k=$("<tr>").appendTo(t),n=this.addLabeledRow(k,$.t("Show Economic Events on Chart"),v),$("<td>").append(v).prependTo(n),I=this.createTableInTable(t),n=this.addLabeledRow(I,$.t("Show Only Future Events"),y),$("<td>").append(y).prependTo(n),n.addClass("offset-row"),E=this.createTableInTable(t),n=this.addLabeledRow(E,$.t("Events Breaks"),b),$("<td>").append(b).prependTo(n),$("<td>").append(P).appendTo(n),$("<td>").append(w.render()).appendTo(n),$("<td>").append(x).appendTo(n),n.addClass("offset-row")),e.enabled("alerts")&&(A=$("<tr>").appendTo(t),V=$('<input type="checkbox" />'),n=this.addLabeledRow(A,$.t("Show Alert Labels"),V),$("<td>").append(V).prependTo(n),n.append("<td>"),M=this._property.alertsProperties.labels.visible,this.bindControl(new u(V,M,!0,this.model(),"Change Show or Hide Alert Labels",function(t){this._model.beginUndoMacro("Show Alert Labels"),this._model.setProperty(M,t,"Show Alert Labels"),this._model.endUndoMacro()}.bind(this))),D=this.createTableInTable(t),O=$('<input type="checkbox">'),B=C(),R=T(),N=R.render(),n=this.addLabeledRow(D,$.t("Extended Alert Line"),O),$("<td>").append(O).prependTo(n),F=S($("<td>").appendTo(n)),$("<td>").append(N).appendTo(n),$("<td>").append(B).appendTo(n),n.addClass("offset-row"),n.append("<td>"),this.bindControl(new u(O,this._property.alertsProperties.labels.line.visible,!0,this.model(),"Change Show or Hide Alert Labels Lines")),this.bindControl(new f(F,this._property.alertsProperties.labels.color,!0,this.model(),"Change Alerts Labels color")),this.bindControl(new m(R,this._property.alertsProperties.labels.line.style,parseInt,!0,this.model(),"Change style")),this.bindControl(new _(B,this._property.alertsProperties.labels.line.width,!0,this.model(),"Change width")),W=function(t){O.prop("disabled",!t.value()),N.prop("disabled",!t.value()),B.prop("disabled",!t.value())},M.listeners().subscribe(this,W))},o.prototype.createSessTable=function(t){var e,i,o,n,s,r=this._series.sessionsStudy().properties(),a=this.createTableInTable(t),l=r.name.value(),h=$("<input type='checkbox' />"),c=this.addLabeledRow(a,$.t("Session Breaks"),h),d=T(),p=this.createColorPicker(),g=C();return $("<td>").append(h).prependTo(c),$("<td>").append(p).appendTo(c),$("<td>").append(d.render()).appendTo(c),$("<td>").append(g).appendTo(c),this.bindControl(new u(h,r.graphics.vertlines.sessBreaks.visible,!0,this.model(),"Change "+l+" visibility")),this.bindControl(new f(p,r.graphics.vertlines.sessBreaks.color,!0,this.model(),"Change "+l+" color")),this.bindControl(new m(d,r.graphics.vertlines.sessBreaks.style,parseInt,!0,this.model(),"Change "+l+" style")),this.bindControl(new _(g,r.graphics.vertlines.sessBreaks.width,!0,this.model(),"Change "+l+" width")),a=this.createTableInTable(t),e=this._extendedHoursEditor=$('<input type="checkbox" />'),c=this.addLabeledRow(a,$.t("Extended Hours (Intraday Only)"),e),$("<td>").append(e).prependTo(c),this.bindControl(new u(e,this._seriesProperty.extendedHours,!0,this.model(),"Change Extended Hours")),this._seriesProperty.sessVis=r.graphics.vertlines.sessBreaks.visible,a=this.createTableInTable(t),i=this._createStudySessRow(a,$.t("Extended Hours"),r.graphics.backgrounds.outOfSession),o=this._createStudySessRow(a,$.t("In Session"),r.graphics.backgrounds.inSession),n=function(t){i.prop("disabled",!t.value()),o.prop("disabled",!t.value())},this._seriesProperty.extendedHours.listeners().subscribe(this,n),n(this._seriesProperty.extendedHours),s=this._series.isIntradayInterval(),h.prop("disabled",!s),a},o.prototype._createStudySessRow=function(t,e,i){var o,n=$("<input type='checkbox' />"),s=this.addLabeledRow(t,e,n),r=S($("<td>").appendTo(s));return this.bindControl(new u(n,i.visible,!0,this.model(),"Change "+e+" visibility")),this.bindControl(new f(r,i.color,!0,this.model(),e+" color",i.transparency)),o=$("<td>"),o.append(n).prependTo(s),s.addClass("offset-row"),n},o.prototype.createTradingTable=function(){var t,e,i,o,n,s,r,a,l,f,g,v=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Trading")),y=$("<tr>").appendTo(v),b=$("<td>").appendTo(y),w=$('<table cellspacing="0" cellpadding="0">').appendTo(b),S=$('<input type="checkbox">');return y=this.addLabeledRow(w,$.t("Show Positions"),S),$("<td>").append(S).prependTo(y),this.bindControl(new u(S,this._property.tradingProperties.showPositions,!0,this.model(),"Change Positions Visibility")),t=$('<input type="checkbox">'),y=this.addLabeledRow(w,$.t("Show Orders"),t),$("<td>").append(t).prependTo(y),this.bindControl(new u(t,this._property.tradingProperties.showOrders,!0,this.model(),"Change Orders Visibility")),e=$('<input type="checkbox">'),i=this.addLabeledRow(w,$.t("Extend Lines Left"),e),$("<td>").append(e).prependTo(i),this.bindControl(new u(e,this._property.tradingProperties.extendLeft,!0,this.model(),"Extend Lines Left")),o=C(),this.bindControl(new _(o,this._property.tradingProperties.lineWidth,!0,this.model(),"Change Connecting Line Width")),n=T(),this.bindControl(new m(n,this._property.tradingProperties.lineStyle,parseInt,!0,this.model(),"Change Connecting Line Style")),s=$('<input type="text" class="ticker">'),r=[d(this._property.tradingProperties.lineLength.value()),c(100),h(0)],this.bindControl(new p(s,this._property.tradingProperties.lineLength,r,!0,this.model(),"Change Connecting Line Length")),a=$("<tbody>"),l=this.addLabeledRow(w,$.t("Connecting Line"),a),$("<td>").prependTo(l),$("<td>").append(o).appendTo(l),$('<td colspan="3">').append(n.render()).appendTo(l),$('<td colspan="3">').append(s).appendTo(l),$("<td>%</td>").appendTo(l),f=$('<input type="checkbox">'),g=this.addLabeledRow(w,$.t("Show Executions"),f),$("<td>").append(f).prependTo(g),this.bindControl(new u(f,this._property.tradingProperties.showExecutions,!0,this.model(),"Change Executions Visibility")),v},t.exports=o}).call(e,i(1))},function(t,e,i){(function(e){"use strict";function o(t,e,i){s.call(this,t,e),this._linetool=i,this.prepareLayout()}var n=i(309),s=n.PropertyPage,r=n.BooleanBinder,a=n.RangeBinder;inherit(o,s),o.prototype.prepareLayout=function(){var t,i,o,n,s,l,h,c,d,p,u,_;this._block=$('<table class="property-page">'),t=this._linetool.properties().intervalsVisibilities,e.enabled("seconds_resolution")&&(i=$("<tr>").appendTo(this._block),o=$("<label>").append($.t("Seconds")),n=$("<input type='checkbox'>").addClass("visibility-checker").prependTo(o),$("<td>").css("padding-right","15px").append(o).appendTo(i),s=$("<input type='text'>").addClass("ticker-text"),$("<td>").append(s).appendTo(i),l=$("<div>").addClass("slider-range ui-slider-horizontal"),$("<td>").append(l).appendTo(i),h=$("<input type='text'>").addClass("ticker-text"),$("<td>").append(h).appendTo(i),this.bindControl(new r(n,t.seconds,!0,this.model(),"Change Line Tool Visibility On Seconds")),this.bindControl(new a(l,[t.secondsFrom,t.secondsTo],[1,59],!1,this.model(),[s,h],[$.t("Change Seconds From"),$.t("Change Seconds To")],n))),i=$("<tr>").appendTo(this._block),o=$("<label>").append($.t("Minutes")),c=$("<input type='checkbox'>").addClass("visibility-checker").prependTo(o),$("<td>").css("padding-right","15px").append(o).appendTo(i),s=$("<input type='text'>").addClass("ticker-text"),$("<td>").append(s).appendTo(i),l=$("<div>").addClass("slider-range ui-slider-horizontal"),$("<td>").append(l).appendTo(i),h=$("<input type='text'>").addClass("ticker-text"),$("<td>").append(h).appendTo(i),this.bindControl(new r(c,t.minutes,!0,this.model(),"Change Line Tool Visibility On Minutes")),this.bindControl(new a(l,[t.minutesFrom,t.minutesTo],[1,59],!1,this.model(),[s,h],[$.t("Change Minutes From"),$.t("Change Minutes To")],c)),i=$("<tr>").appendTo(this._block),o=$("<label>").append($.t("Hours")),d=$("<input type='checkbox'>").addClass("visibility-checker").prependTo(o),$("<td>").append(o).appendTo(i),s=$("<input type='text'>").addClass("ticker-text"),$("<td>").append(s).appendTo(i),l=$("<div>").addClass("slider-range ui-slider-horizontal"),$("<td>").append(l).appendTo(i),h=$("<input type='text'>").addClass("ticker-text"),$("<td>").append(h).appendTo(i),this.bindControl(new r(d,t.hours,!0,this.model(),"Change Line Tool Visibility On Hours")),this.bindControl(new a(l,[t.hoursFrom,t.hoursTo],[1,24],!1,this.model(),[s,h],[$.t("Change Minutes From"),$.t("Change Hours To")],d)),i=$("<tr>").appendTo(this._block),o=$("<label>").append($.t("Days")),p=$("<input type='checkbox'>").addClass("visibility-checker").prependTo(o),$("<td>").append(o).appendTo(i),s=$("<input type='text'>").addClass("ticker-text"),$("<td>").append(s).appendTo(i),l=$("<div>").addClass("slider-range ui-slider-horizontal"),$("<td>").append(l).appendTo(i),h=$("<input type='text'>").addClass("ticker-text"),$("<td>").append(h).appendTo(i),this.bindControl(new r(p,t.days,!0,this.model(),"Change Line Tool Visibility On Days")),this.bindControl(new a(l,[t.daysFrom,t.daysTo],[1,366],!1,this.model(),[s,h],[$.t("Change Minutes From"),$.t("Change Days To")],p)),i=$("<tr>").css("height","29px").appendTo(this._block),o=$("<label>").append($.t("Weeks")),u=$("<input type='checkbox'>").prependTo(o),$("<td>").append(o).appendTo(i),this.bindControl(new r(u,t.weeks,!0,this.model(),"Change Line Tool Visibility On Weeks")),i=$("<tr>").css("height","29px").appendTo(this._block),o=$("<label>").append($.t("Months")),_=$("<input type='checkbox'>").prependTo(o),$("<td>").append(o).appendTo(i),this.bindControl(new r(_,t.months,!0,this.model(),"Change Line Tool Visibility On Months")),this.loadData()},o.prototype.widget=function(){return this._block},t.exports=o}).call(e,i(1))},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e),this._study=i,this.prepareLayout()}var n=i(309),s=n.PropertyPage,r=n.GreateTransformer,a=n.LessTransformer,l=n.ToIntTransformer,h=n.ToFloatTransformer,c=n.BooleanBinder,d=n.SimpleComboBinder,p=n.SimpleStringBinder,u=i(94).NumericFormatter,_=i(140).assert;inherit(o,s),o.prototype._getStrategyInputs=function(){for(var t,e=0,i=this._study.metaInfo(),o={};e<i.inputs.length;e++)t=i.inputs[e],"strategy_props"===t.groupId&&(_(void 0!==t.internalID,"Strategy input id="+t.id+" doesn't have an internalID"),o[t.internalID]=i.inputs[e]);return TradingView.clone(o)},o.prototype._setStdInput=function(t,e,i){var o,n,s,_,f,m,g,v,y,b,w,S;if(t){if(o=t.id,n="study_input-"+o+"-"+Date.now().toString(36)+"-"+Math.random().toString(36),s=$("<tr>").appendTo(this._$table),_="Change "+e,f=$('<label for="'+n+'">'+$.t(e,{context:"input"})+"</label>"),"bool"===t.type)g=$('<td colspan="3">').appendTo(s),m=$('<input id="'+n+'" type="checkbox">').appendTo(g),f.appendTo(g),i!==!0&&this.bindControl(new c(m,this._property.inputs[o],!0,this.model(),_));else if($("<td>").addClass("propertypage-name-label").append(f).appendTo(s),v=$('<td colspan="2">').appendTo(s),t.options){for(m=$('<select id="'+n+'">').appendTo(v),y=0;y<t.options.length;y++)b=t.options[y],b instanceof jQuery?b.appendTo(m):$('<option value="'+b+'">'+b+"</option>").appendTo(m);i!==!0&&this.bindControl(new d(m,this._property.inputs[o],null,!0,this.model(),_))}else m=$('<input id="'+n+'" type="text">').appendTo(v),i!==!0&&("integer"!==t.type&&"float"!==t.type||(w=["integer"===t.type?l(t.defval):h(t.defval)],(0===t.min||t.min)&&w.push(r(t.min)),(0===t.max||t.max)&&w.push(a(t.max))),S=new p(m,this._property.inputs[o],w,!1,this.model(),_),"float"===t.type&&S.addFormatter(function(t){return(new u).format(t)}),this.bindControl(S)),m.addClass("ticker");return m}},o.prototype._setPyramidingInputs=function(t){var e=t.pyramiding,i=this._property.inputs[e.id],o=this._setStdInput({id:"pyramiding_switch",type:"bool"},$.t("Pyramiding"),!0),n=this._setStdInput(t.pyramiding,$.t("Allow up to")),s=n.closest("tr");_(void 0===this._onAllowUpToChanged),this._onAllowUpToChanged=function(t){t.value()>0?(o.prop("checked",!0),n.removeAttr("disabled"),s.removeClass("disabled")):(o.prop("checked",!1),n.attr("disabled","disabled"),s.addClass("disabled"))},i.subscribe(null,this._onAllowUpToChanged),o.change(function(){var t=!o.prop("checked");i.setValue(t?0:e.defval),t?n.attr("disabled","disabled"):n.removeAttr("disabled"),s.toggleClass("disabled",t)}),i.value()>0?o.prop("checked",!0):(o.prop("checked",!1),n.attr("disabled","disabled"),s.addClass("disabled")),s.children().last().removeAttr("colspan"),$("<td>").text("orders").appendTo(s)},o.prototype._setQtyInputs=function(t){function e(t){return t=+t,isNaN(t)||t<0?0:("percent_of_equity"!==s.val()?t=parseInt(t):t>100&&(t=100),t)}var i,o,n,s,r,a,l=this,h=t.default_qty_value,c=$.extend({},t.default_qty_type),d=this._property.inputs[h.id],u=this._setStdInput(h,$.t("Order size"),!0),_=new p(u,d,e,!1,this.model(),"Change Order Size");this.bindControl(_),i=u.closest("td"),i.removeAttr("colspan"),o=this._study.reportData()&&this._study.reportData().currency||"USD",n=$('<option value="cash_per_order">'+o+"</option>"),c.options=[$('<option value="fixed">'+$.t("Contracts")+"</option>"),n,$('<option value="percent_of_equity">'+$.t("% of equity")+"</option>")],s=this._setStdInput(c,"type"),r=s.closest("td"),a=r.closest("tr"),r.removeAttr("colspan"),r.detach().insertAfter(i),a.remove(),this._study.watchedData.subscribe(function(){var t=l._study.reportData()&&l._study.reportData().currency||"USD";n.text(t),s.closest("td").find("a[href=#cash_per_order]").text(t)})},o.prototype._setFillLimitsInputs=function(t){var e=this._setStdInput(t.backtest_fill_limits_assumption,$.t("Verify Price for Limit Orders")),i=e.closest("td");i.removeAttr("colSpan"),$("<td>").text("ticks").insertAfter(i)},o.prototype.prepareLayout=function(){this._$table=$(document.createElement("table")).addClass("property-page strategy-properties").attr("cellspacing","0").attr("cellpadding","2");var t=this._getStrategyInputs();t.initial_capital.min=1,this._setStdInput(t.initial_capital,$.t("Initial capital")),Array.isArray(t.currency.options)&&"NONE"===t.currency.options[0]&&(t.currency.options[0]=$('<option value="NONE">'+$.t("Default")+"</option>")),this._setStdInput(t.currency,$.t("Base currency")),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setPyramidingInputs(t),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setQtyInputs(t),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setStdInput(t.calc_on_order_fills,$.t("Recalculate After Order filled")),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setStdInput(t.calc_on_every_tick,$.t("Recalculate On Every Tick")),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setFillLimitsInputs(t),this.loadData()},o.prototype.widget=function(){return this._$table},o.prototype.loadData=function(){var t,e,i;s.prototype.loadData.call(this),t=this._getStrategyInputs(),e=t.pyramiding,i=this._property.inputs[e.id],i.setValue(i.value(),!0)},o.prototype.destroy=function(){var t,e,i;s.prototype.destroy.call(this),t=this._getStrategyInputs(),e=t.pyramiding,i=this._property.inputs[e.id],i.unsubscribe(null,this._onAllowUpToChanged)},t.exports=o},function(t,e,i){"use strict";i(61),i(96),e.lineToolsInfo={"zoom-out":{icon:i(427),localizedName:$.t("Zoom Out")},LineTool5PointsPattern:{icon:i(428),localizedName:$.t("XABCD Pattern")},LineToolABCD:{icon:i(429),localizedName:$.t("ABCD Pattern")},LineToolArc:{icon:i(430),localizedName:$.t("Arc")},LineToolArrow:{icon:i(431),localizedName:$.t("Arrow")},LineToolArrowMarkDown:{icon:i(432),localizedName:$.t("Arrow Mark Down")},LineToolArrowMarkLeft:{icon:i(433),localizedName:$.t("Arrow Mark Left")},LineToolArrowMarkRight:{icon:i(434),localizedName:$.t("Arrow Mark Right")},LineToolArrowMarkUp:{icon:i(435),localizedName:$.t("Arrow Mark Up")},LineToolBalloon:{icon:i(436),localizedName:$.t("Balloon")},LineToolBarsPattern:{icon:i(437),localizedName:$.t("Bars Pattern")},LineToolBezierCubic:{icon:i(438),localizedName:$.t("Double Curve")},LineToolBezierQuadro:{icon:i(439),localizedName:$.t("Curve")},LineToolBrush:{icon:i(440),localizedName:$.t("Brush")},LineToolCallout:{icon:i(441),localizedName:$.t("Callout")},LineToolCircleLines:{icon:i(442),localizedName:$.t("Cyclic Lines")},LineToolCypherPattern:{icon:i(443),localizedName:$.t("Cypher Pattern")},LineToolDateAndPriceRange:{icon:i(444),localizedName:$.t("Date and Price Range")},LineToolDateRange:{icon:i(445),localizedName:$.t("Date Range")},LineToolDisjointAngle:{icon:i(446),localizedName:$.t("Disjoint Angle")},LineToolElliottCorrection:{icon:i(447),localizedName:$.t("Elliott Correction Wave (ABC)")},LineToolElliottDoubleCombo:{icon:i(448),localizedName:$.t("Elliott Double Combo Wave (WXY)")},LineToolElliottImpulse:{icon:i(449),localizedName:$.t("Elliott Impulse Wave (12345)")},LineToolElliottTriangle:{icon:i(450),localizedName:$.t("Elliott Triangle Wave (ABCDE)")},LineToolElliottTripleCombo:{icon:i(451),localizedName:$.t("Elliott Triple Combo Wave (WXYXZ)")},LineToolEllipse:{icon:i(452),localizedName:$.t("Ellipse")},LineToolExtended:{icon:i(453),localizedName:$.t("Extended")},LineToolFibChannel:{icon:i(454),localizedName:$.t("Fib Channel")},LineToolFibCircles:{icon:i(455),localizedName:$.t("Fib Circles")},LineToolFibRetracement:{icon:i(456),localizedName:$.t("Fib Retracement")},LineToolFibSpeedResistanceArcs:{icon:i(457),localizedName:$.t("Fib Speed Resistance Arcs")},LineToolFibSpeedResistanceFan:{icon:i(458),localizedName:$.t("Fib Speed Resistance Fan")},LineToolFibSpiral:{icon:i(459),localizedName:$.t("Fib Spiral")},LineToolFibTimeZone:{icon:i(460),localizedName:$.t("Fib Time Zone")},LineToolFibWedge:{icon:i(461),localizedName:$.t("Fib Wedge")},LineToolFlagMark:{icon:i(462),localizedName:$.t("Flag Mark")},LineToolFlatBottom:{icon:i(463),localizedName:$.t("Flat Top/Bottom")},LineToolGannComplex:{icon:i(464),localizedName:$.t("Gann Square")},LineToolGannFan:{icon:i(465),localizedName:$.t("Gann Fan")},LineToolGannSquare:{icon:i(466),localizedName:$.t("Gann Box")},LineToolGhostFeed:{icon:i(467),localizedName:$.t("Ghost Feed")},LineToolHeadAndShoulders:{icon:i(468),localizedName:$.t("Head & Shoulders")},LineToolHorzLine:{icon:i(469),localizedName:$.t("Horizontal Line")},LineToolHorzRay:{icon:i(470),localizedName:$.t("Horizontal Ray")},LineToolInsidePitchfork:{icon:i(471),localizedName:$.t("Inside Pitchfork")},LineToolNote:{icon:i(472),localizedName:$.t("Note")},LineToolNoteAbsolute:{icon:i(473),localizedName:$.t("Anchored Note")},LineToolParallelChannel:{icon:i(474),localizedName:$.t("Parallel Channel")},LineToolPitchfan:{icon:i(475),localizedName:$.t("Pitchfan")},LineToolPitchfork:{icon:i(476),localizedName:$.t("Pitchfork")},LineToolPolyline:{icon:i(477),localizedName:$.t("Polyline")},LineToolPrediction:{icon:i(478),localizedName:$.t("Forecast")},LineToolPriceLabel:{icon:i(479),localizedName:$.t("Price Label")},LineToolPriceRange:{icon:i(480),localizedName:$.t("Price Range")},LineToolProjection:{icon:i(481),localizedName:$.t("Projection")},LineToolRay:{icon:i(482),localizedName:$.t("Ray")},LineToolRectangle:{icon:i(483),localizedName:$.t("Rectangle")},LineToolRegressionTrend:{icon:i(484),localizedName:$.t("Regression Trend")},LineToolRiskRewardLong:{icon:i(485),localizedName:$.t("Long Position")},LineToolRiskRewardShort:{icon:i(486),localizedName:$.t("Short Position")},LineToolRotatedRectangle:{icon:i(487),localizedName:$.t("Rotated Rectangle")},LineToolSchiffPitchfork:{icon:i(488),localizedName:$.t("Modified Schiff Pitchfork")},LineToolSchiffPitchfork2:{icon:i(489),localizedName:$.t("Schiff Pitchfork")},LineToolSineLine:{icon:i(490),localizedName:$.t("Sine Line")},LineToolText:{icon:i(491),localizedName:$.t("Text")},LineToolTextAbsolute:{icon:i(492),localizedName:$.t("Anchored Text")},LineToolThreeDrivers:{icon:i(493),localizedName:$.t("Three Drives Pattern")},LineToolTimeCycles:{icon:i(494),localizedName:$.t("Time Cycles")},LineToolTrendAngle:{icon:i(495),localizedName:$.t("Trend Angle")},LineToolTrendBasedFibExtension:{icon:i(496),localizedName:$.t("Trend-Based Fib Extension")},LineToolTrendBasedFibTime:{icon:i(497),localizedName:$.t("Trend-Based Fib Time")},LineToolTrendLine:{icon:i(498),localizedName:$.t("Trend Line")},LineToolTriangle:{icon:i(499),localizedName:$.t("Triangle")},LineToolTrianglePattern:{icon:i(500),localizedName:$.t("Triangle Pattern")},LineToolVertLine:{icon:i(501),localizedName:$.t("Vertical Line")},SyncDrawing:{icon:i(502),localizedName:$.t("Sync drawings to all charts")},arrow:{icon:i(503),localizedName:$.t("Arrow")},cursor:{icon:i(504),localizedName:$.t("Cross")},dot:{icon:i(505),localizedName:$.t("Dot")},drawginmode:{icon:i(506),localizedName:$.t("Stay in Drawing Mode")},eraser:{icon:i(507),localizedName:$.t("Eraser")},group:{icon:i(508),localizedName:$.t("Show Hidden Tools")},hideAllDrawings:{icon:i(509),localizedName:$.t("Hide All Drawing Tools")},lockAllDrawings:{icon:i(510),localizedName:$.t("Lock All Drawing Tools")},magnet:{icon:i(511),localizedName:$.t("Magnet Mode")},measure:{icon:i(512),localizedName:$.t("Measure (Shift + Click on the chart)")},removeAllDrawingTools:{icon:i(513),localizedName:$.t("Remove All Drawing Tools")},showObjectsTree:{icon:i(514),localizedName:$.t("Show Objects Tree")},zoom:{icon:i(515),localizedName:$.t("Zoom In")}}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M20.8 18.5c.7-1.2 1.2-2.5 1.2-4 0-4.1-3.4-7.5-7.5-7.5S7 10.4 7 14.5s3.4 7.5 7.5 7.5c1.5 0 2.9-.5 4.1-1.2l4.3 4.3 2.2-2.2-4.3-4.4zM14.5 20c-3 0-5.5-2.5-5.5-5.5S11.5 9 14.5 9s5.5 2.5 5.5 5.5-2.5 5.5-5.5 5.5zM11 15h7v-1h-7v1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M25.3 19L22.5 8H24V4h-4v4h1.3l-4 4h-2.4L12 7.6V4H8v4h1.5L5.7 23H4v4h4v-3.4l6.8-7.6h2.798L23 19.9V23h4v-4zM9 7V5h2v2zM7.003 26H5v-2h2v2zM14 15.4L7.2 23h-.397L10.5 8.102l-.498-.098h1.1l2.898 4.4zm3-.4h-2v-2h2zm4-8V5h2v2zm-3.002 8.102v-2.4l3.698-3.697L24.2 19h-.8zM26 22h-2v-2h2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M21 3v1.975l-9 4.91V9H8v4h1.34L7.648 24H6v4h4v-1.975l9-4.91V22h4v-4h-1.34l1.692-11H25V3zm1 1h2v2h-2zm-1 2.115V7h1.34l-1.692 11h-1.12L12 12.145v-1.12zM9 10h2v2H9zm1.352 3h1.12L19 18.855v1.12l-9 4.91V24H8.66zM20 19h2v2h-2zM7 25h2v2H7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M455.1 285.4C310.8 141.1 110.9 106.7 4.2 206l23.2 23.3c.2-.2.5-.4.8-.6l483.7 483.7c-.2.3-.4.5-.6.8l23.2 23.2c99.3-106.8 64.9-306.7-79.4-451zm76.2 400.1L55 209.2c98.3-58.6 256.8-19.5 376.3 100s158.7 278.1 100 376.3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M21 5v3.302l-5.598 2.3 1.7 1.702L9.298 20H6v4h4v-3.298l7.7-7.7 1.5 1.5 2.3-5.4.102-.1L25 9V5zM9 23H7v-2h2zM24 8l-1.9-.002.1-.2-.202.1L22 6h2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M16 27l10-13h-6V6h-8v8H6l10 13zm0-1.5L8 15h5V7h6v8h5l-8 10.5z"/><path d="M16 25.5L8 15h5V7h6v8h5z" opacity=".3"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M5 16l13 10v-6h8v-8h-8V6L5 16zm1.5 0L17 8v5h8v6h-8v5L6.5 16z"/><path d="M6.5 16L17 8v5h8v6h-8v5z" opacity=".3"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M26 16L13 6v6H5v8h8v6l13-10zm-1.5 0L14 24v-5H6v-6h8V8l10.5 8z"/><path d="M24.5 16L14 24v-5H6v-6h8V8z" opacity=".3"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M15 5L5 18h6v8h8v-8h6L15 5zm0 1.5L23 17h-5v8h-6v-8H7l8-10.5z"/><path d="M15 6.5L23 17h-5v8h-6v-8H7z" opacity=".3"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path fill-opacity=".2" d="M139.9 488.7H134c-64.3-2.9-113.9-55.5-113.9-116.9 0-64.3 55.5-116.9 122.7-116.9h309.7c67.2 0 122.7 52.6 122.7 116.9s-55.5 116.9-122.7 116.9H224.6v93.5l-84.7-93.5z"/><path d="M452.5 269.5c58.4 0 108.1 46.7 108.1 102.3s-49.7 102.3-108.1 102.3H210v70.1l-55.5-61.4-8.8-8.8H134c-55.5-2.9-99.3-49.7-99.3-102.3 0-55.5 49.7-102.3 108.1-102.3h309.7m0-29.1H142.8c-76 0-137.3 58.4-137.3 131.5 0 70.1 58.4 125.6 128.6 131.5l105.2 116.9V503.3h213.3c76 0 137.3-58.4 137.3-131.5s-61.4-131.5-137.4-131.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 4v2h-1v11h1v6h1v-6h1V6h-1V4zm8 0v2h-1v11h1v6h1v-6h1V6h-1V4zM4 5v2H3v11h1v6h1v-6h1V7H5V5zm9 0v2h-1v11h1v6h1v-6h1V7h-1V5zM8 7v6H7v11h1v2h1v-2h1V13H9V7zm9 0h1v9h-1zm8 0h1v9h-1zM4 8h1v9H4zm9 0h1v9h-1zm8 0v3h-1v11h1v2h1v-2h1V11h-1V8zm0 4h1v9h-1zM8 14h1v9H8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M23 3v4h1.447c-.458.96-3.4 6.5-10.447 6.5-4.187 0-6.633 2.41-7.938 4.758-1.304 2.35-1.558 4.687-1.558 4.687L5 23H3v4h4v-4H5.504c.018-.15.282-2.186 1.434-4.258C8.133 16.592 10.188 14.5 14 14.5c8.292 0 11.46-7.303 11.46-7.303L25 7h2V3h-4zm1 1h2v2h-2V4zM4 24h2v2H4v-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M23 3v1.5c-9.658 0-14.39 4.657-16.576 9.287C4.256 18.377 4.496 22.922 4.5 23H3v4h4v-4H5l.5-.027s-.237-4.39 1.826-8.76C9.39 9.843 13.658 5.5 23 5.5V7h4V3zm1 1h2v2h-2zM4 24h2v2H4z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M377.6 283.1s-136.2-10.2-183.8 170.2c-30.6 115.7-177 251.9-177 251.9l10.2 17s224.7-54.5 360.8-139.6c177-112.3 64.7-255.3 64.7-255.3l-74.9-44.2zm44.3-143L374.2 249l122.5 68.1 78.3-88.5-153.1-88.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path fill-opacity=".2" d="M179.9 462.6h-42.1c-25.9 0-48.6-22.7-48.6-48.6V284.6c0-25.9 22.7-48.6 48.6-48.6h388.5c25.9 0 48.6 22.7 48.6 48.6v129.5c0 25.9-22.7 48.6-48.6 48.6H264L56.9 605.1l123-142.5z"/><path d="M526.3 252.2c19.4 0 32.4 12.9 32.4 32.4v129.5c0 19.4-12.9 32.4-32.4 32.4H257.6l-9.7 6.5-97.1 64.7 16.2-16.2 45.3-55h-74.5c-19.4 0-32.4-12.9-32.4-32.4V284.6c0-19.4 12.9-32.4 32.4-32.4h388.5m0-32.4H137.8c-35.6 0-64.7 29.1-64.7 64.7V414c0 35.6 29.1 64.7 64.7 64.7h6.5L1.8 640.7H31l233-161.9h259c35.6 0 64.7-29.1 64.7-64.7V284.6c3.3-35.6-25.8-64.8-61.4-64.8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M7 4v22h1V4H7zm5 0v22h1V4h-1zm5 0v22h1V4h-1zm5 0v22h1V4h-1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M25.3 19L22.5 8H24V4h-4v4h1.3l-4 4h-2.4L12 7.6V4H8v4h1.5L5.7 23H4v4h4v-3.4l6.8-7.6h2.798L23 19.9V23h4v-4zM9 7V5h2v2zM7.003 26H5v-2h2v2zM14 15.4L7.2 23h-.397L10.5 8.102l-.498-.098h1.1l2.898 4.4zm3-.4h-2v-2h2zm4-8V5h2v2zm-3.002 8.102v-2.4l3.698-3.697L24.2 19h-.8zM26 22h-2v-2h2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10 4v1h9V4zm4.5 1l-3.387 5H14v5H5v-4H4v9h1v-4h9v9h-4v1h9v-1h-4v-9h4.5v3l5.5-3.5-5.5-3.5v3H15v-5h3.113zM25 15.5V20h1v-9h-1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M4 10v11h1v-5h15v3l5-3.5-5-3.5v3H5v-5H4zm21 5.5V21h1V10h-1v5.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M22 3v2.047L9 10.352V10H5v4h4v-2.566l13-5.307V7h4V3zm1 1h2v2h-2zM6 11h2v2H6zm-1 6v4h4v-.783l13 5.2V28h4v-4h-4v.34l-13-5.2V17zm1 1h2v2H6zm17 7h2v2h-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M6.593 11.064l-1-2.554h-3.22l-.988 2.554H.44L3.615 3H4.4l3.16 8.064h-.967zM5.303 7.67l-.935-2.49q-.18-.472-.373-1.158-.12.527-.347 1.16l-.944 2.487h2.598z"/><path d="M24.818 20.835q-1.323 0-2.092.884-.764.878-.764 2.41 0 1.577.736 2.44.742.857 2.11.857.84 0 1.917-.302v.818q-.835.313-2.06.313-1.775 0-2.74-1.076-.963-1.077-.963-3.06 0-1.242.462-2.175.467-.934 1.34-1.44.88-.505 2.065-.505 1.263 0 2.208.46l-.396.803q-.912-.428-1.824-.428z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M7.91 10.03h-.924l-1.62-5.377q-.116-.357-.26-.9-.142-.545-.147-.654-.122.724-.386 1.586l-1.57 5.345H2.08L-.056 2h.988l1.27 4.96q.263 1.044.384 1.89.148-1.005.44-1.967L4.463 2h.99l1.51 4.927q.263.852.445 1.923.103-.78.394-1.9L9.068 2h.988L7.91 10.03z"/><path d="M24.997 24l2.143-4.016h1.01L25.47 24.9v3.116h-.945v-3.07l-2.675-4.962h1.02L24.998 24z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M6 11.03h-.89V5.308q0-.714.044-1.35-.115.114-.258.24-.143.127-1.307 1.072l-.485-.628L5.23 3H6v8.03z"/><path d="M23.802 23.126q1.27 0 1.994.63.73.628.73 1.72 0 1.248-.796 1.956-.79.71-2.186.71-1.357 0-2.07-.435v-.88q.384.248.955.39.57.138 1.125.138.967 0 1.5-.456.538-.457.538-1.32 0-1.68-2.06-1.68-.522 0-1.395.16l-.473-.303.303-3.757h3.993v.84H22.75l-.204 2.412q.632-.126 1.258-.126z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M7.593 10.064l-1-2.554h-3.22l-.988 2.554H1.44L4.615 2H5.4l3.16 8.064h-.967zM6.303 6.67l-.935-2.49q-.18-.472-.373-1.158-.12.527-.347 1.16l-.944 2.487h2.598z"/><path d="M25.477 28.03H21V20h4.477v.83h-3.543v2.587h3.33v.824h-3.33v2.956h3.543v.835z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10.943 9.127c-1.294 0-2.347 1.06-2.347 2.35s1.058 2.347 2.347 2.347c1.29 0 2.348-1.058 2.348-2.347 0-1.29-1.052-2.35-2.346-2.35zm14.805.707l-5.873 5.87.824.825 5.875-5.88-.828-.817zM8.125 13.357l-4.7 4.702.823.822 4.7-4.7-.823-.826zm5.637 0l-.823.825 2.346 2.347.822-.826-2.348-2.348zm4.23 2.82c-1.294 0-2.347 1.057-2.347 2.346 0 1.295 1.058 2.35 2.347 2.35 1.29 0 2.348-1.06 2.348-2.35.005-1.29-1.054-2.347-2.348-2.347z"/><path d="M8.91 9.03h-.924l-1.62-5.377q-.116-.357-.26-.9-.142-.545-.147-.654-.122.724-.386 1.586L4.004 9.03H3.08L.944 1h.988l1.27 4.96q.263 1.044.384 1.89.148-1.005.44-1.967L5.463 1h.99l1.51 4.927q.263.852.445 1.923.103-.78.394-1.9L10.068 1h.988L8.91 9.03z"/><path d="M27.52 28.03H22v-.73l4.263-6.46h-4.13V20H27.4v.73l-4.263 6.455h4.384v.846z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M13 5v1.557C10.26 6.84 7.792 7.69 5.887 8.95c-2.36 1.564-3.885 3.78-3.885 6.27 0 2.49 1.525 4.708 3.885 6.27 2.36 1.563 5.574 2.508 9.115 2.508 3.54 0 6.755-.945 9.115-2.508 2.36-1.562 3.885-3.78 3.885-6.27 0-2.49-1.525-4.706-3.885-6.27C22.21 7.69 19.743 6.84 17 6.558V5zm1 1h2v2h-2zm3 1.562c2.555.282 4.838 1.08 6.563 2.223C25.727 11.218 27 13.14 27 15.22c0 2.082-1.273 4-3.438 5.434-2.164 1.433-5.198 2.342-8.56 2.342s-6.398-.91-8.563-2.342C4.27 19.22 3 17.302 3 15.22c0-2.08 1.27-4 3.435-5.433 1.723-1.14 4.006-1.94 6.56-2.22V9h4z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M23.605 6.646l-4.34 4.34L16 11l-.014 3.307L13.293 17H10v3.293l-3.354 3.353.708.708L10.707 21H14v-3.293l2.67-2.67L20 15v-3.334l4.313-4.312zM17 12h2v2h-2zm-6 6h2v2h-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M387.382 160.99L19.62 528.75 5.193 514.327l367.763-367.762zM399.6 195.6v67.3l-259 259H73.2v81.6h81.6v-67.3l259-259h67.3v-81.6h-81.5zM134.4 583.1H93.6v-40.8h40.8v40.8zm326.3-326.3h-40.8V216h40.8v40.8zm114.2 73.4L426.1 481.1h-53l175.4-175.4-14.3-14.3-367.1 367.2 14.3 14.3 175.4-175.4v53l-151 150.9 14.3 14.3L371 564.8h69.3v-67.3l150.9-150.9-16.3-16.4zm-155 212.1h-40.8v-40.8h40.8v40.8zm88.53-257.64L162.304 630.787 147.88 616.36l346.125-346.124z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M297.6 362.3c-32.2 0-58.6 26.4-58.6 58.6s26.4 58.6 58.6 58.6 58.6-26.4 58.6-58.6-26.3-58.6-58.6-58.6zm0 87.9c-17.6 0-29.3-14.7-29.3-29.3 0-17.6 14.7-29.3 29.3-29.3 17.6 0 29.3 14.7 29.3 29.3 0 17.6-11.7 29.3-29.3 29.3zm0-175.8c-79.1 0-146.5 64.5-146.5 146.5s64.5 146.5 146.5 146.5S444.2 503 444.2 420.9s-67.4-146.5-146.6-146.5zm0 263.8c-64.5 0-117.2-52.7-117.2-117.2s52.7-117.2 117.2-117.2S414.8 356.5 414.8 421s-52.7 117.2-117.2 117.2zm0-322.4c-114.3 0-205.1 90.8-205.1 205.1S183.3 626 297.6 626s205.1-90.8 205.1-205.1-90.8-205.1-205.1-205.1zm0 381c-96.7 0-175.8-79.1-175.8-175.8s79.1-175.8 175.8-175.8S473.4 324.3 473.4 421s-79.1 175.8-175.8 175.8zm0-468.9c-161.2 0-293 131.9-293 293s131.9 293 293 293 293-131.9 293-293-131.8-293-293-293zm0 556.8C151.1 684.7 33.9 567.5 33.9 421s117.2-263.7 263.7-263.7S561.3 274.5 561.3 421 444.2 684.7 297.6 684.7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M4.3 642.1H591v-32.6H4.3v32.6zm0-195.6H591v-32.6H4.3v32.6zm0-228.1V251H591v-32.6H4.3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M297.6 439.5c79 0 146.3-64.4 146.3-146.3h-29.3c0 64.4-52.7 117.1-117.1 117.1s-117.1-52.7-117.1-117.1h-29.3c.2 82 64.6 146.3 146.5 146.3zm0-87.7c32.2 0 58.5-26.3 58.5-58.5h-29.3c0 17.6-14.6 29.3-29.3 29.3s-29.3-14.6-29.3-29.3h-29.3c.2 32.1 26.5 58.5 58.7 58.5zm0 146.3c114.1 0 204.8-90.7 204.8-204.8h-29.3c0 96.6-79 175.6-175.6 175.6s-175.6-79-175.6-175.6H92.8c0 114.1 90.7 204.8 204.8 204.8zM561 293.2c0 146.3-117.1 263.4-263.4 263.4S34.3 439.5 34.3 293.2H5c0 161 131.7 292.6 292.6 292.6s292.6-131.7 292.6-292.6H561z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M14.04 3.303l-.788 1.838.92.4.787-1.84-.92-.39zM5 4.5V25h20.5v-1H21v-6.102l.182.424 1.838-.787-.393-.92-1.627.7v-7.61l2.854-2.852-.708-.708L20.293 9h-7.607l.7-1.627-.92-.393-.788 1.838.424.182H6V4.5H5zM6 10h13.293l-5 5h-4.178l.117-.273-.92-.395-.285.668H6v-5zm4.89.656l-.788 1.838.918.395.79-1.84-.92-.4zm9.11.05V24h-5v-3.027l.668-.286-.395-.92-.273.118v-4.178l5-5zm6.303 4.335l-1.838.79.394.92 1.83-.79-.4-.91zM6 16h2.6l-.075.172.92.392.242-.564h3.606l-6.31 6.31.1-.23-.92-.394-.163.378V16zm8 .707v3.605l-.564.243.392.92L14 21.4V24H7.936l.378-.162-.394-.92-.23.098 6.31-6.31zM7.738 18.01l-.79 1.838.92.394.788-1.84-.918-.392zm11.21.18l-1.837.79.4.918 1.84-.787-.39-.92zm-7.35 3.154l-1.84.787.394.92 1.838-.78-.392-.92z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M411.2 234c-83.058 0-152.1 69.043-152.1 152.1 0 17.915 3.948 35.028 11.01 50.504l-150.4 30.076c-12.193-30.528-18.91-63.825-18.91-98.68h-20c0 36.155 6.758 70.764 19.046 102.652l-95.88 19.174 5.06 25.3L110.48 494.84C157.367 589.342 254.892 654.5 367.3 654.5c126.89 0 232.2-102.785 232.2-232.2 0-103.637-84.663-188.3-188.3-188.3zm0 20c92.76 0 168.3 75.54 168.3 168.3 0 118.587-96.087 212.2-212.2 212.2-102.81 0-192.092-58.358-236.532-143.72l153.378-30.673c22.716 30.04 58.685 49.694 98.655 49.694 54.71 0 100.4-45.69 100.4-100.4 0-46.72-38.25-82.4-82.4-82.4v20c33.46 0 62.4 26.53 62.4 62.4 0 43.5-36.9 80.4-80.4 80.4-29.91 0-57.24-13.27-76.33-34.15l90.29-18.05-5.06-25.3-101.3 20.26c-7.21-14.045-11.3-29.85-11.3-46.45 0-71.94 60.16-132.1 132.1-132.1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M7 4v22h1V4zm5 0v22h1V4zm10 0v22h1V4z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M566.4 639.5C530.1 399.6 337.6 207.1 97.7 170.8v-33.5H14V221h27.9v418.5H14v83.7h83.7v-27.9h418.5v27.9h83.7v-83.7h-33.5zM41.9 165.2h27.9v27.9H41.9v-27.9zm27.9 530.1H41.9v-27.9h27.9v27.9zm27.9-27.9v-27.9H69.8v-106c67 16.7 117.2 67 133.9 133.9h-106zm133.9 0c-16.7-80.9-80.9-145.1-161.8-161.8v-83.7c125.5 22.3 223.2 120 245.5 245.5h-83.7zm111.6 0C320.9 527.9 209.3 416.3 69.8 394v-83.7c186.9 22.3 334.8 170.2 359.9 357.1h-86.5zm173 0h-58.6C432.5 466.5 270.7 304.7 69.8 279.6V221h27.9v-19.5c226 36.3 404.5 214.8 438 438h-19.5v27.9zm55.8 27.9h-27.9v-27.9H572v27.9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path d="M303.306 426.633v-241.3h189.7l-93.1 120.7 96.5 120.6zM276.9 399.2c-3.4-3.4-6.9-3.4-13.8-3.4H111.4V154.4h148.3c3.4 0 13.8 10.3 17.2 17.2zm-17.2-262.1H94.2V413h169c13.8 0 31 31 31 31V164.7s-13.8-27.6-34.5-27.6zm-172.4 0H52.8v586.2h34.5zm443.606 30.933h-241.4v275.9h241.4l-110.4-138z"/><path d="M107.02 155.182v244.363h172.126V155.182H107.02zm194.423 26.754v251.5h206.91l-108.81-127.534L508.35 181.936H301.44z" opacity=".2"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M22 4v2.87L7 13.048V13H3v4h4v-2.87l15-6.177V8h4V4h-4zm1 1h2v2h-2V5zM4 14h2v2H4v-2zm-1 8v4h4v-1.5h15V26h4v-4h-4v1.5H7V22H3zm1 1h2v2H4v-2zm19 0h2v2h-2v-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M4 4v22h22V4zm2.12 1H11v.285l-.303.832c-.85-.32-1.644-.564-2.36-.74C7.474 5.167 6.76 5.065 6.12 5zm6.048 0H18v5.38c-2.16-1.71-4.19-2.907-6-3.72V5.465zM19 5h5.293L19 10.293zm6 .707V11h-5.293zM5 5.91c.69.014 1.72.102 3.098.44.68.167 1.44.4 2.257.71L8.922 11H5zm7 1.856c1.574.743 3.314 1.785 5.172 3.234H12zm-1 .45V11H9.986zM5 12h3.56l-2.183 6H5zm4.623 0H11v6H7.44zM12 12h5.293L12 17.293zm7.848 0H25v5.832l-.465.168h-.97c-.76-2.048-1.93-4.177-3.717-6zm-.848.574c1.636 1.63 2.735 3.547 3.473 5.426H19zm-1 .133V18h-5.293zM5 19h1.014L5 21.785zm2.078 0h3.215L5.24 24.053zM12 19h6v1.377l-6 2.182zm7 0h2.785L19 20.014zm5.715 0H25v6h-.04c-.048-1.186-.233-3.292-.97-5.736zm-1.68.61c.682 2.29.868 4.265.92 5.39H19v-3.922zM11 19.708v3.215L5.947 24.76zm7 1.734V25h-6v-1.377zm-7 2.546V25H8.215z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M14.04 3.303l-.788 1.838.92.4.787-1.84-.92-.39zM5 4.5V25h20.5v-1H7.936l.378-.162-.394-.92-.23.098L23.855 6.854l-.708-.708L6.984 22.31l.098-.23-.92-.394-.162.378V4.5H5zm7.465 2.48l-.787 1.838.918.393.79-1.83-.92-.39zm-1.576 3.676l-.79 1.838.92.395.79-1.84-.92-.4zm-1.58 3.676l-.79 1.84.92.392.78-1.837-.92-.395zm16.99.71l-1.84.786.39.92 1.83-.79-.397-.917zm-3.68 1.573l-1.84.79.39.917 1.84-.787-.4-.92zM7.73 18.01l-.787 1.838.92.394.78-1.84-.918-.392zm11.213.18l-1.84.79.39.918 1.84-.787-.396-.92zm-3.68 1.578l-1.84.787.392.92 1.84-.788-.396-.92zm-3.678 1.576l-1.84.787.393.92 1.84-.78-.393-.92z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 5v20h20V5H5zm14 1h5v3h-5V6zm0 4h5v4h-5v-4zm-6-4h5v3h-5V6zm0 4h5v4h-5v-4zm5 5v5h-5v-5h5zM9 6h3v3H9V6zm0 4h3v4H9v-4zm3 5v5H9v-5h3zM6 6h2v3H6V6zm0 4h2v4H6v-4zm0 5h2v5H6v-5zm0 9v-3h2v3H6zm3 0v-3h3v3H9zm4 0v-3h5v3h-5zm11 0h-5v-3h5v3zm-5-4v-5h5v5h-5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 5v2h-1v11h1v4h1v-4h1V7h-1V5zm8 3v2h-1v11h1v4h1v-4h1V10h-1V8zM4 11v2H3v11h1v2h1v-2h1V13H5v-2zm9-7v2h-1v11h1v3h1v-3h1V6h-1V4zM8 4v2H7v11h1v6h1v-6h1V6H9V4zm9 4h1v9h-1zm8 3h1v9h-1zm-4-3v3h-1v11h1v2h1v-2h1V11h-1V8zM8 7h1v9H8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M13 0v4h1.06l-5.2 13h-.247l-3-6H7V7H3v4h.8l-1.958 8.242-1.91.262.136.992 1.526-.21L.236 26H0v4h4v-4H1.264l1.392-5.86L7 19.546V21h4v-2.002l7-.96V19h4v-1.512l4.043-.554L28.33 24H26v4h4v-4h-.617l-2.332-7.203 3.02-.414-.13-.992-3.19.44-1.9-5.83H26V6h-4v4h.99l-2.898 4.867L15.844 4H17V0zm1 1h2v2h-2zm.95 3.46L19.073 15H18v2.027l-7 .96V17H9.94zM23 7h2v2h-2zM4 8h2v2H4zm19.924 2.39l1.805 5.577-3.73.512V15h-.83zM4.72 11.452L7.495 17H7v1.535l-4.096.56zM21 16v2h-2v-2zm-11 2v2H8v-2zm17 7h2.18v2H27zM1.025 27H3v2H1v-1.893z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.999999 30.000001" width="30" height="30" enable-background="new 0 0 841.9 595.3"><path d="M3 17h4v-2h16v2h4v-4h-4v1H7v-1H3zm1-1v-2h2v2zm20 0v-2h2v2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.999999 30.000001" width="30" height="30" enable-background="new 0 0 841.9 595.3"><path d="M3 13v4h4v-2h21v-1H7v-1zm1 1h2v2H4z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M15.646 3.646L8.29 11.002l-.35.352.015 1.308L8.06 22v.006L18.294 22l8.06-7.646-.707-.708L18.293 21h-.586L15 18.293v-2.586l6.354-6.353-.708-.708L14.293 15h-2.586L8.89 12.184l-.003-.364 7.467-7.466zm-6.74 9.967L11 15.707v2.586l-2.02 2.02zM12 16h2v2h-2zm-.293 3h2.586l3 3H9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path fill-opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M297.7 127.9c-127.1 0-230.1 101.6-230.1 227 0 118.4 104.2 240.4 173.8 314.7 26 27.8 56.3 44.2 56.3 44.2s32.5-16.7 60.4-45.3c69.5-71.3 169.6-183.5 169.6-313.7 0-125.2-103-226.9-230-226.9zm0 335c-57.8 0-104.6-46.8-104.6-104.6S240 253.7 297.7 253.7s104.6 46.8 104.6 104.6-46.8 104.6-104.6 104.6z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M297.7 232.8c-69.3 0-125.5 56.2-125.5 125.5s56.2 125.5 125.5 125.5 125.5-56.2 125.5-125.5-56.1-125.5-125.5-125.5zm0 230.1c-57.8 0-104.6-46.8-104.6-104.6S240 253.7 297.7 253.7s104.6 46.8 104.6 104.6-46.8 104.6-104.6 104.6zm0-335c-127.1 0-230.1 101.6-230.1 227 0 118.4 104.2 240.4 173.8 314.7 26 27.8 56.3 44.2 56.3 44.2s32.5-16.7 60.4-45.3c69.5-71.3 169.6-183.5 169.6-313.7 0-125.2-103-226.9-230-226.9zM352.6 651c-25.4 26.5-54.9 42-54.9 42s-27.5-15.3-51.2-41.1c-63.3-69.1-158-182.3-158-292.3 0-116.4 93.6-210.8 209.1-210.8s209.1 94.4 209.1 210.8c.1 121-90.9 225.2-154.1 291.4z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9" class="text"><path fill-opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M184.1 270C86.7 270 7.7 349.2 7.7 447c0 92.3 79.9 187.4 133.2 245.4 19.9 21.6 43.1 34.5 43.1 34.5s24.9-13 46.3-35.3C283.7 636 360.5 548.5 360.5 447c0-97.8-79-177-176.4-177zm.1 277.5c-53.2 0-96.3-43.8-96.3-97.9 0-54.1 43.1-97.9 96.3-97.9s96.3 43.8 96.3 97.9c-.1 54-43.1 97.9-96.3 97.9z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M184.2 351.7c-53.2 0-96.3 43.8-96.3 97.9 0 54.1 43.1 97.9 96.3 97.9s96.3-43.8 96.3-97.9c-.1-54.1-43.1-97.9-96.3-97.9zm0 167.6c-40.1 0-72.7-32.5-72.7-72.7s32.5-72.7 72.7-72.7 72.7 32.5 72.7 72.7-32.6 72.7-72.7 72.7zm-.1-249.3C86.7 270 7.7 349.2 7.7 447c0 92.3 79.9 187.4 133.2 245.4 19.9 21.6 43.1 34.5 43.1 34.5s24.9-13 46.3-35.3C283.7 636 360.5 548.5 360.5 447c0-97.8-79-177-176.4-177zM225 674c-18.9 20.3-40.9 32.1-40.9 32.1s-20.5-11.7-38.1-31.4C99 622 28.5 535.6 28.5 451.7c0-88.9 69.7-160.9 155.7-160.9 85.9 0 155.6 72 155.6 160.9 0 92.2-67.8 171.8-114.8 222.3zm343.4-363.4h19.8c-7.1 47.4-54.7 84.1-113.1 84.1s-105.8-36.7-113-84.1h18.7c8.5 31.8 42.3 56.1 83.9 59.5V248.5h-60.4V228h60.4v-21.5c-12.4-4.2-21.5-15.5-21.5-29.2 0-17.2 14.2-31.2 31.7-31.2s31.7 14 31.7 31.2c0 13.9-9.4 25.3-22.2 29.3V228h59.7v20.5h-59.7v121.6c41.7-3.4 75.5-27.6 84-59.5zm-81.5-133.2c0-6.6-5.4-11.9-12.1-11.9s-12.1 5.3-12.1 11.9 5.4 11.9 12.1 11.9 12.1-5.4 12.1-11.9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 4v3.293L7.293 17H4v4h4v-3.293L17.707 8H21V4zm1 1h2v2h-2zm7.646 4.646L19.293 16H16v3.293l-6.354 6.353.708.708 6.376-6.377L20 20l.014-3.307 6.34-6.34zM17 17h2v2h-2zM5 18h2v2H5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M5 4v2H4v4h1v12H4v4h4v-1h12v1h4v-1h2v-1h-2v-2h-3.293l-2.816-2.816 9.3-3.72-.37-.93-9.69 3.878L14.71 16l9.646-9.646-.708-.708L14 15.293l-2.414-2.414 3.88-9.7-.93-.37-3.72 9.29L8 9.29V6H6V4zm0 3h2v2H5zm1 3h1.39l3.12 3.12L6.86 22H6zm5.184 3.89l2.11 2.11-4.925 4.924zM14 16.708l2.11 2.11-7.034 2.814zm2.88 2.88l3.12 3.12V24H8v-.86zM5 23h2v2H5zm16 0h2v2h-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M15.646 3.646L7.293 12 11 15.707v2.586l-7.354 7.353.708.708L11.707 19h2.586L18 22.707l8.354-8.353-.708-.708L18 21.293l-3-3v-2.586l6.354-6.353-.708-.708L14.293 15h-2.586l-3-3 7.647-7.646zM12 16h2v2h-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M22 4v1H11.793L5 11.793V22H4v4h4v-1h8.207L20 20.707V17h5V8h1V4zm1 1h2v2h-2zM12.207 6H22v2h2v8h-5v4.293L15.793 24H8v-2H6v-9.793zM5 23h2v2H5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M18 2v4h-2l3.44 4L23 6h-2V2h-3zm-6 7v2h-1v9h1v4h1v-4h1v-9h-1V9h-1zm-4 2v4H7v10h1v2h1v-2h1V15H9v-4H8zm4 1h1v7h-1v-7zm7.5 0a1.5 1.5 0 0 0-1.5 1.5 1.5 1.5 0 0 0 1.5 1.5 1.5 1.5 0 0 0 1.5-1.5 1.5 1.5 0 0 0-1.5-1.5zm-.006.996a.498.498 0 0 1 .498.498.498.498 0 0 1-.498.498.498.498 0 0 1-.498-.498.498.498 0 0 1 .498-.498zM8 15.72h1.19V24H8v-8.28z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9" class="text"><path d="M10.17 6.45c-1.145 0-2.077.928-2.077 2.078v6.225c0 .9.575 1.668 1.373 1.953L6.596 20H3v4h4l.057-2.825 6.635-4.35h12.23c1.146 0 2.078-.927 2.078-2.077v-6.22c0-1.15-.927-2.077-2.077-2.077zm.715 1.037h14.163c1.056 0 1.916.87 1.916 1.942v4.39c0 1.07-.86 1.94-1.916 1.94H13.66l-4.013 2.71-.383.02 1.238-2.775c-.83-.18-1.337-.964-1.337-1.9V9.43c0-1.073.663-1.943 1.72-1.943zM4 21h2v2H4z"/><path fill-opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M25.06 7.523H10.894c-1.056 0-1.72.87-1.72 1.943v4.397c0 .937.51 1.72 1.337 1.9L9.28 18.54l.384-.026 4.014-2.71H25.06c1.055 0 1.915-.87 1.915-1.94v-4.4c0-1.072-.86-1.942-1.916-1.942z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M9 4v1h11V4H9zm5.5 1l-3.387 5H14v15H9v1h11v-1h-5V10h3.113L14.5 5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M3 3v4h1v16H3v4h4v-1h16v1h4v-4h-2l.5-.008c-.155-9.757-4.81-14.485-9.402-16.646C11.553 4.206 7.095 4.496 7 4.502V3zm1 1h2v2H4zm3 1l.033.498s4.31-.285 8.64 1.752C20 9.286 24.346 13.556 24.5 23H23v2H7v-2H5V7h2zM4 24h2v2H4zm20 0h2v2h-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M23.646 5.646L18.293 11H15v3.293L8.293 21H5v4h4v-3.293L15.707 15H19v-3.293l5.354-5.353zM16 12h2v2h-2zM6 22h2v2H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M4 4v4h2v16h16v2h4v-4h-2V6H8V4zm1 1h2v2H5zm3 2h15v15h-1v1H7V8h1zm15 16h2v2h-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M537.9 163.6l-14.7-26.4L54.4 400.9l14.7 26.4 468.8-263.7zM57.4 550.4L72 576.8 540.9 313l-14.7-26.4L57.4 550.4zm0 146.5L72 723.3l468.8-263.7-14.7-26.4L57.4 696.9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" width="30" height="30"><path d="M10 10v2h38v-2H10zm19 2l-6 6h5v14H10v2h18v6h-5l6 6 6-6h-5v-6h18v-2H30V18h5l-6-6zm0 34H10v2h38v-2H29z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" width="30" height="30"><path d="M10 48v-2h38v2H10zm19-2l-6-6h5V26H10v-2h18v-6h-5l6-6 6 6h-5v6h18v2H30v14h5l-6 6zm0-34H10v-2h38v2H29z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M10 2v3.293L5.293 10H2v4h3.293L16 24.707V28h4v-3.293L24.707 20H28v-4h-3.293L14 5.293V2h-4zm1 1h2v2h-2V3zm-.293 3h2.586L24 16.707v2.586L19.293 24h-2.586L6 13.293v-2.586L10.707 6zM3 11h2v2H3v-2zm22 6h2v2h-2v-2zm-8 8h2v2h-2v-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 2v10.994h2V7.2l2 5.794h2l2.004-5.8.002 4.89V13l2-.002v-.916L27 2h-2l-3 7.398L19 2h-2zm-1.354 1.646L7.293 12 11 15.707v2.586L8.293 21H4v1h14.707l7.647-7.646-.708-.708L18.293 21h-.586L15 18.293v-2.586l1-1-.707-.707-1 1h-2.586l-3-3 7.647-7.646-.708-.708zM12 16h2v2h-2v-2zm-.293 3h2.586l2 2H9.707l2-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M15.646 3.646L7.293 12 11 15.707v2.586L8.293 21H4v1h14.707l7.647-7.646-.708-.708L18.293 21h-.586L15 18.293v-2.586l6.354-6.353-.708-.708L14.293 15h-2.586l-3-3 7.647-7.646zM12 16h2v2h-2zm-.293 3h2.586l2 2H9.707z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M10 2.5c-1.208 0-2.17.765-2.88 1.775-.706 1.01-1.215 2.3-1.6 3.58-.766 2.56-1.018 5.096-1.018 5.096L5 13H3v4h4v-4H5.504c.008-.076.254-2.453.975-4.855.36-1.22.85-2.43 1.46-3.295.6-.865 1.27-1.35 2.06-1.35.25 0 .59.218 1 .812.4.595.81 1.503 1.21 2.608.793 2.21 1.55 5.2 2.3 8.2.75 3 1.493 6.01 2.32 8.3.414 1.145.844 2.112 1.33 2.83.488.718 1.08 1.25 1.83 1.25 1.207 0 2.17-.765 2.88-1.775.705-1.01 1.214-2.3 1.6-3.58.765-2.56 1.017-5.096 1.017-5.096L25 17h2v-4h-4v4h1.496c-.008.076-.254 2.453-.975 4.855-.36 1.22-.85 2.43-1.46 3.295-.6.865-1.26 1.35-2.06 1.35-.25 0-.59-.218-1-.813-.4-.594-.81-1.502-1.21-2.607-.79-2.21-1.55-5.2-2.3-8.2-.75-3-1.49-6.01-2.32-8.3-.41-1.145-.84-2.112-1.33-2.83-.49-.718-1.08-1.25-1.83-1.25zM4 14h2v2H4v-2zm20 0h2v2h-2v-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M129.8 244.3L5 609.7h54.8l42.6-121.8h121.8l39.6 121.8h57.8L190.7 244.3h-60.9zm-18.2 213.1l51.8-155.3 51.8 155.3H111.6zm456.6 115.7c-3 0-9.1 0-9.1-3-3-6.1-3-9.1-3-18.3v-134c0-82.2-91.3-82.2-103.5-82.2-30.4 0-109.6 3-109.6 91.3h39.6c3-39.6 42.6-60.9 70-60.9 30.4 0 54.8 15.2 54.8 45.7 0 18.3-18.3 30.4-36.5 33.5 0 0-67 9.1-82.2 18.3-15.2 3-45.7 21.3-45.7 70 0 42.6 27.4 76.1 76.1 76.1 33.5 0 67-18.3 91.3-42.6 0 12.2 3 24.4 12.2 30.4 6.1 6.1 18.3 9.1 33.5 9.1 6.1 0 21.3-3 33.5-6.1V567c-9.2 3.1-18.3 6.1-21.4 6.1zm-60.9-63.9c0 42.6-36.5 70-76.1 70-30.4 0-48.7-9.1-48.7-51.8 0-21.3 33.5-39.6 42.6-39.6 24.4-3 54.8-6.1 85.2-15.2v36.5h-3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path fill-rule="evenodd" clip-rule="evenodd" d="M567.7 358.1h20c-7.2 47.7-55.1 84.7-113.9 84.7s-106.7-37-113.9-84.7h18.9c8.6 32.1 42.6 56.5 84.5 59.9V295.6h-60.8v-20.7h60.8v-21.6c-12.5-4.2-21.7-15.6-21.7-29.4 0-17.3 14.3-31.4 31.9-31.4 17.6 0 31.9 14.1 31.9 31.4 0 14-9.5 25.5-22.4 29.5v21.5h60.1v20.7H483V418c42-3.4 76.1-27.8 84.7-59.9zm-82.1-134.2c0-6.6-5.4-12-12.1-12-6.7 0-12.1 5.3-12.1 12s5.4 12 12.1 12c6.6 0 12.1-5.4 12.1-12zm-85.5 295.4v92.6c0 5.5 4.2 13.1 6 15.2 1.8 2 4.3 3.1 7.6 3.1 2.4 0 2.2-.5 6.8-1.4v20.9c-7 1.6-10.9 2.4-16 2.4-10.8 0-18-3.4-23-7.7-4.9-4.2-9.2-5.9-10.1-15.5-19.1 20.2-37.9 22.5-65.6 22.5-36.5 0-59.5-22.7-59.5-54.8 0-60.9 75.4-59.9 56.1-57.7 0 0 68.5-5.2 68.5-22.8 0-20.7-11.9-32.3-42.5-32.3-14.3 0-24.9 3-31.8 8.9-6.9 5.9-11 6.7-12.1 18.8h-30c3.6-55.3 70.9-52.6 75.3-52 3.2-.2 23 .1 41.2 9.3 17 8.7 29.1 26.4 29.1 50.5zm-31.5 29.3c-21.8 11.8-38.4 11.5-61.2 17.4-6 1.5-30.9 5.3-30.9 28.2 0 30.4 14.7 37.1 37 37.1 30.5 0 55.1-18.3 55.1-50.5v-32.2zm-204.2 19.2H67.6l-29.1 84.3H1.7l96.4-272.2h41.2l92.9 272.2h-38.8l-29-84.3zM115.9 421L80.5 526.6h71L115.9 421z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M25 2v4h1.387l-2.602 7.145L21 12.005V10h-4v.37l-3-1.23V7h-4v.506L6 5.87V3H2v4h1.072l1.76 11H4v1.664l-2.416-.89-.346.94L4 20.73V22h3.45l2.55.937v1.995h3.828v-.584L18 25.88V28h4v-.646l2.002.736.346-.938L22 26.29V24h-1.102l3.473-9.535 2.44.998.38-.926-2.47-1.014L27.46 6H29V2zm1 1h2v2h-2zM3 4h2v2H3zm3 2.95l4 1.636V11h.287l-4.264 7h-.18L4.083 7H6zM11 8h2v2h-2zm3 2.223l3 1.226V14h.652l-5.502 7h-.318l-.11-10H14zM18 11h2v2h-2zm-7.266 1.19l.098 8.81H10v.873l-2-.736V18h-.805zM21 13.085l2.44.998-3.13 8.602L19.583 14H21zm-2.385 1.307l.8 9.607H18v.81l-4.172-1.54V21h-.406zM7 19v2H5v-2zm6 3v2h-2v-1.996zm6 3h2v2h-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M1 15.5v1s1.647.007 3.277.822C5.907 18.138 7.5 19.667 7.5 23H6v4h4v-4H8.508c.03-.186.287-1.697 1.176-3.252.946-1.656 2.51-3.248 5.316-3.248 2.267 0 3.876 1.59 4.955 3.27 1.01 1.57 1.456 3.032 1.516 3.23H20v4h4v-4h-1.5c0-3.333 1.592-4.862 3.223-5.678C27.353 16.507 29 16.5 29 16.5v-1s-1.853-.007-3.723.928c-1.488.744-2.984 2.162-3.54 4.552-.25-.544-.545-1.132-.942-1.75-1.17-1.82-3.062-3.73-5.795-3.73-3.194 0-5.13 1.908-6.184 3.752-.26.453-.468.905-.638 1.33-.62-2.158-2.05-3.45-3.455-4.154C2.853 15.493 1 15.5 1 15.5zM7 24h2v2H7zm14 0h2v2h-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M21 5v3.3L8.3 21H5v4h4v-1h16v-1h-7c0-3.5-1.5-5.5-3.3-7l7-7H25V5zm1 1h2v2h-2zm-8 10.7c1.75 1.3 3 3.55 3 6.3H9v-1.3zM6 22h2v2H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M25 17H6.05l-.03-3.68 16.187-7.386-.414-.91L5.016 12.68 5.05 17H5v1h.057v.004l.5-.004H25v-1zm0 3H5v1h20v-1zm0 3H5v1h20v-1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17 5v18.95l-3.68.03L5.934 7.792l-.91.414 7.656 16.777L17 24.95V25h1v-.057h.004l-.004-.5V5h-1zm3 0v20h1V5h-1zm3 0v20h1V5h-1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M21 5v3.3L8.3 21H5v4h4v-3.3L21.7 9H25V5zm1 1h2v2h-2zM6 22h2v2H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M4 3v4h1.012L5 23H4v4h4v-3.373L22.78 7H26V3h-4v1H8V3zm1 1h2v2H5zm18 0h2v2h-2zM8 5h14v1.373L7.22 23H6l.012-16H8zM5 24h2v2H5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M4.5 3.238V22H3v4h4v-2.05l5-2.24V22h4v-2.08l13.238-5.926L22 10.848V9h-4v.107L14 7.37V5h-4v.63zm1 1.526L10 6.72V9h1.44L5.5 20.883zM11 6h2v2h-2zm3 2.46l4 1.737V13h1.064l-4.755 4.078L12.51 9H14zM19 10h2v2h-2zm-7.184.482L13.488 18H12v2.615l-5 2.24V22h-.94zM22 11.937l4.76 2.07L16 18.823V18h-1.232l5.834-5H22zM13 19h2v2h-2zm-9 4h2v2H4z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.999999 30.000001" width="30" height="30" enable-background="new 0 0 841.9 595.3"><path d="M17 27v-4h-2V7h2V3h-4v4h1v16h-1v4zm-1-1h-2v-2h2zm0-20h-2V4h2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M11.527 5.975c-1.345 0-2.692.508-3.713 1.53l-.283.282c-2.04 2.04-2.04 5.385 0 7.426l2.18 2.178c-.3-1.1-.26-2.29.17-3.36l-.58-.58c-1.09-1.09-1.09-2.8 0-3.89l.29-.28c1.1-1.09 2.8-1.09 3.89 0l2.76 2.76c1.09 1.1 1.09 2.8 0 3.89l-.28.28c-.313.32-.69.54-1.08.67l1.86 1.86c.353-.21.69-.45.994-.75l.28-.285c2.04-2.042 2.04-5.383 0-7.424l-2.76-2.76c-1.02-1.02-2.367-1.53-3.71-1.53zm1.733 5.285c-.337.208-.655.453-.946.744l-.283.283c-2.04 2.04-2.04 5.385 0 7.426l2.76 2.758c2.04 2.05 5.39 2.05 7.43 0l.29-.28c2.04-2.04 2.04-5.38 0-7.42l-2.18-2.18c.31 1.11.26 2.29-.17 3.37l.58.58c1.09 1.1 1.09 2.8 0 3.89l-.28.29c-1.09 1.093-2.793 1.093-3.89 0l-2.76-2.76c-1.09-1.092-1.09-2.796 0-3.89l.28-.284c.31-.304.67-.513 1.04-.65l-1.86-1.86zM18 13.492v.31l.03.028c-.007-.113-.01-.226-.03-.338z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-200 -70 1000 1000"><path d="M486.2 398L109.1 120v468.6L246.3 520l106.6 201.9 99.1-49.6-103-205.7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path d="M16 15h1V8h-1v7zm2 1v1h7v-1h-7zm-2 9h1v-7h-1v7zm-8-8h7v-1H8v1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-750 -750 2095.3 2341.9" enable-background="new 0 0 595.3 841.9"><circle cx="297.6" cy="420.9" r="294.8"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M19.2 6.6c-.4-.4-1-.4-1.4 0l-1.2 1.2 1.8 1.8 1.9-1.9-1.1-1.1zM6 22l2.8-2.7L7.5 18 6 22zm3.3-6.9c-.4.4-1.6 1.7-1.2 2.1l1.3 1.3 8.3-8.3-1.8-1.8-6.6 6.7z" opacity=".4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M9 25l2.8-2.7-1.3-1.3L9 25zM22.2 9.6c-.4-.4-1-.4-1.4 0l-1.2 1.2 1.8 1.8 1.9-1.9-1.1-1.1zm-9.9 8.5c-.4.4-1.6 1.7-1.2 2.1l1.3 1.3 8.3-8.3-1.8-1.8-6.6 6.7z" opacity=".75"/><path fill-rule="evenodd" clip-rule="evenodd" d="M15.3 21.1c-.4.4-1.6 1.7-1.2 2.1l2.6 2.6c.4.4 1.7-.8 2.1-1.2l6.6-6.6-3.6-3.5-6.5 6.6zM12 28l4-1.5-2.5-2.5-1.5 4zm15.4-13.2l-2.1-2.1c-.4-.4-1-.4-1.4 0l-1.2 1.2 3.5 3.5 1.2-1.2c.3-.4.3-1 0-1.4z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M17.948 5.54L7.705 15.468s-.942 1.36-1.67 3.24c-1.255 3.03.314 4.6 1.15 5.226.626.418 4.705 1.045 6.376-.524l10.77-10.767.11-3.866-6.49-3.237zm5.333 7.004l-9.61 9.616c-1.77 1.777-5.43 1.36-6.16.836-.42-.315-1.462-1.987-.63-3.764.838-1.986 1.57-3.24 1.57-3.24l9.515-9.407 5.435 3.03-.107 2.93zm-.52-2.822l-9.2 9.095-5.22-3.034-.31.627 5.124 2.928c-.105.524-.626 1.986-1.252 3.03-1.043 1.57-2.61 1.672-2.61 1.672l.94.418s1.152.106 2.09-1.36c.94-1.465 1.57-3.345 1.57-3.345l9.824-9.617-.94-.414zm1.46-.942l-5.02 4.91v3.453l5.02-4.497zm-6.27-3.24l-4.81 4.702 6.17 3.45 5.02-4.81z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M5.5 13A2.5 2.5 0 0 0 3 15.5 2.5 2.5 0 0 0 5.5 18 2.5 2.5 0 0 0 8 15.5 2.5 2.5 0 0 0 5.5 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5A2.5 2.5 0 0 0 15 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 15 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5 2.5 2.5 0 0 0-2.5-2.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 14c.1 0 .3 0 .4.1l.7-.7c-.4-.2-.7-.3-1.1-.3-1.6 0-2.9 1.3-2.9 2.9 0 .4.1.8.2 1.1l.8-.8v-.4c0-1 .8-1.9 1.9-1.9zm-4.7 5.2C10.2 18 8.9 16.7 8.3 16c1.1-1.2 4.7-5 8.2-5 .9 0 1.9.3 2.8.7l.7-.7c-1.1-.6-2.3-.9-3.5-.9-4.6 0-9 5.4-9.2 5.6L7 16l.3.4c.1.1 1.6 2 3.8 3.6l.7-.8zm13.9-3.5c-.1-.1-1.5-1.8-3.4-3.2l2.8-2.8-.7-.7L9 24.3l.7.7 3.7-3.7c1 .4 2 .7 3 .7 4.9 0 9-5.4 9.2-5.6l.4-.4-.3-.3zm-7.2.5c-.1.9-.9 1.6-1.7 1.7l1.7-1.7zm-2 4.8c-.7 0-1.5-.2-2.2-.5l1.7-1.7c.2 0 .4.1.6.1 1.5 0 2.9-1.3 2.9-2.9 0-.2 0-.4-.1-.5l2.3-2.3c1.4 1.1 2.6 2.3 3.1 2.9-1.2 1.2-4.6 4.9-8.3 4.9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M20 13h-1v-1.5C19 9 17 7 14.5 7S10 9 10 11.5V13H9c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h11c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-8-.9c0-1.7 1.1-3.1 2.5-3.1s2.5 1.4 2.5 3.1v.9h-5v-.9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M22 14c-.3-3.9-3.5-7-7.5-7S7.3 10.1 7 14v9h5v-9h.1c.2-1.1 1.2-2 2.4-2s2.2.9 2.4 2h.1v9h5v-9zm-11 8H8v-4h3v4zm10 0h-3v-4h3v4z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M15 6v2h-1v6h1v2h1v-2h1V8h-1V6zm5 1v2h-1v6h1v2h1v-2h1V9h-1V7zM4 8v16h23v-5H9V8zm1 1h3v2H6v1h2v2H6v1h2v2H6v1h2v1.293l-3 3zm3.707 11H11v2h1v-2h2v2h1v-2h2v2h1v-2h2v2h1v-2h2v2h1v-2h2v3H5.707z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M12 7v1H9v2h13V8h-3V7h-7zm-2 4v12h11V11H10z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M18.827 8.17c-1.227.817-.993 1.49-.993 2.318 0 .703-.29 1.49-.62 1.778-.33.29-.8.965-.8.965l1.168 1.25s.823-.52 1.038-.72c.414-.37 1.407-.66 2.193-.66 1.737 0 2.387-.54 2.454-2.49.017-.5-.07-1.63-.07-1.63l-.795.02c-.458 2.406-1.457 2.53-2.28 1.79-.823-.74-1.13-1.193.386-2.774l-.48-.626-1.2.79zM6.46 7.716c-.29.455 1.2 3.847 1.984 4.468.91.785 1.903.496 2.896-.828.827-1.117.827-1.158.083-1.985-.414-.45-1.158-.82-1.696-.82s-1.034-.17-1.157-.38c-.332-.49-1.863-.86-2.11-.45zm3.983 5.846c0 .372 4.95 4.826 8.467 7.68 2.192 1.78 3.268 2.027 2.77.62-.454-1.24-7.983-10.328-8.81-10.576-.618 1.114-1.67 1.914-2.427 2.276zm-.468 5.778C7.74 21.367 7.74 21.367 8.57 22.194c.826.827.826.827 3.018-1.406 1.383-1.414 2.168-2.514 2.168-2.514l-1.272-1.21s-1.268 1.118-2.51 2.276z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.95 9.95h-1v3h-3v1h3v3h1v-3h3v-1h-3v-3zm5.8 7.5c.7-1.2 1.2-2.5 1.2-4 0-4.1-3.4-7.5-7.5-7.5s-7.5 3.4-7.5 7.5 3.4 7.5 7.5 7.5c1.5 0 2.9-.5 4.1-1.2l4.3 4.3 2.2-2.2-4.3-4.4zm-6.3 1.5c-3 0-5.5-2.5-5.5-5.5s2.5-5.5 5.5-5.5 5.5 2.5 5.5 5.5-2.5 5.5-5.5 5.5z"/></svg>'},function(t,e,i){"use strict";var o=i(102);t.exports[o.STYLE_AREA]=i(517),t.exports[o.STYLE_BARS]=i(518),t.exports[o.STYLE_CANDLES]=i(519),t.exports[o.STYLE_HEIKEN_ASHI]=i(520),t.exports[o.STYLE_HOLLOW_CANDLES]=i(521),t.exports[o.STYLE_LINE]=i(522)},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M453.8 360.2l-92.1 6L234 517.7l-86.2-86.1L5.2 514.7v118.9h585.3V268.1z" opacity=".3"/><path d="M234 508.8c-156 222.067-78 111.033 0 0zm309-276.3l-71.3 95.1h-101L236.9 488l-92.1-112.9-38.6 41.6-101 98.1 41.6 41.6 95.1-95.1L234 574.2 397.4 387h104l89.1-118.9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 4v7h-3v2h3v7h2v-2h3v-2h-3V4h-2zM7 6v12H4v2h3v2h2V10h3V8H9V6H7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9zm-1 6h3v9H8v-9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9zm6 3h3v10h-3V7zm-7 3h3v9H8v-9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M142.5 447.4c-102.74 102.74-83.44 83.44 0 0m399-186.2l-70.9 94.6H370.1l-136 159.6-91.6-112.3-38.5 41.4L6.5 542l41.4 41.4 94.6-94.6 91.6 112.3 162.6-186.2h103.5l88.7-118.2z"/></svg>'},,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 12"><path fill-rule="evenodd" d="M0 0h2v2H0V0zm4 0h2v2H4V0zM0 5h2v2H0V5zm4 0h2v2H4V5zm-4 5h2v2H0v-2zm4 0h2v2H4v-2z"/></svg>'},,,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M10.5 5.333h-.75V3.81C9.75 1.707 8.07 0 6 0 3.93 0 2.25 1.707 2.25 3.81v1.523H1.5c-.825 0-1.5.686-1.5 1.524v7.62C0 15.313.675 16 1.5 16h9c.825 0 1.5-.686 1.5-1.524V6.857c0-.838-.675-1.524-1.5-1.524zM6 12c-.825 0-1.5-.675-1.5-1.5S5.175 9 6 9s1.5.675 1.5 1.5S6.825 12 6 12zm2.325-6.75h-4.65v-1.5A2.326 2.326 0 0 1 6 1.425 2.326 2.326 0 0 1 8.325 3.75v1.5z"/></svg>'},,,,,,,,,function(t,e,i){(function(t){"use strict";var e=function(){this.type="test_call",this.content=""},i={wrapValue:function(t){return""+t},sendEvent:function(t,i){var o=new e;o.type=i||"event",o.content=t,window.external.notify(JSON.stringify(o))}};void 0!==t&&t&&t.exports&&(t.exports=i)}).call(e,i(8)(t))},function(t,e,i){"use strict";function o(t,e,i){function o(i){var o,n,r="";r=h.enabled("charting_library_base")?(e.snapshotUrl?"":"https://www.tradingview.com/x/")+i:window.location.protocol+"//"+window.location.host+"/x/"+i+"/",_.attr({href:r}),f.attr("data-clipboard-text",r),m.val(r),p.stop(),u.css({visibility:"visible"}),setTimeout(function(){var t=m.get(0);t.focus&&t.focus(),t.select&&t.select()}),o=c.Twitter.getStatus(t.activeChartWidget.value().symbolProperty().value(),r),$('<a class="twitter-share-button _tv-dialog-social _tv-dialog-social-twitter"></a>').attr({href:"https://twitter.com/share?count=none&text="+encodeURIComponent(o)+"&url=%20",rel:"nofollow"}).appendTo(v),$('<script src="//platform.twitter.com/widgets.js"></script>').appendTo(v),n=new s(f),n.on("ready",function(){n.on("aftercopy",function(){l.trackEvent("GUI","Copied Image Link"),TVDialogs.showMessage($.t("Copied to clipboard"))})})}var n,d,p,u,_,f,m,g,v;void 0===e&&(e={}),TVDialogs.createModalDialog($.t("Image URL"),{addClass:"_tv-dialog-min-width"}),n=TVDialogs.modalDialog,d=n.find("._tv-dialog-content"),p=a.unifiedSpinner("mini").spin(d.get(0)),u=$('<div class="main tv-text">').css({visibility:"hidden"}).appendTo(d),_=$("<a>").text($.t("Save image")).attr({target:"_blank"}).css("text-decoration","underline"),f=$('<span class="copy-clipboard-button _tv-button">'+$.t("Copy link")+"</span>"),m=$("<input>").attr({readonly:!0,type:"text"}).bind("click focus",function(){var t=this;t.select&&t.select()}),$("<p>").appendTo(u).append(_," "+$.t("or copy url:")),g=$('<form class="copy-image-url">').append(f,m),$("<p>").css({position:"relative"}).appendTo(u).append(g),s.isFlashUnusable()&&g.addClass("copy-unavailable"),v=$('<p class="_tv-dialog-socials">').appendTo(u),TVDialogs.positionDialog(),TVDialogs.applyHandlers(),l.trackEvent("GUI","Get image button"),s.config({swfPath:TradingView.wrapUrl("images/ZeroClipboard.swf")}),r.takeSnapshot(t,function(t){i&&i(t),o(t)},function(){p.stop(),TVDialogs.showError($.t("URL cannot be received"),n)},{snapshotUrl:e.snapshotUrl})}function n(t,e,i){r.takeSnapshot(t,function(t){i&&i(t)},function(){console.warn($.t("Error while trying to create snapshot."))},{snapshotUrl:e.snapshotUrl})}var s,r,a,l,h,c;i(61),i(96),s=i(538),r=i(275),a=i(338),l=i(35),h=i(1),c=i(539),e.getImageOfChart=o,e.getImageOfChartSilently=n},,function(t,e){"use strict";function i(t){return window.location.protocol+"//"+window.location.host+"/x/"+t+"/"}!function(t){function e(t,e){return"https://twitter.com/intent/tweet?&status="+encodeURIComponent(o(t,i(e)))}function o(t,e){return TradingView.isCmeWidget?e+" from cmegroup.com via @tradingview $"+t:"$"+t+" chart "+e+" via http://www.tradingview.com"}function n(t){var i=550,o=420,n=open("about:blank","snapshot_tweet","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width="+i+",height="+o+",left="+Math.round(screen.width/2-i/2)+",top="+Math.round(screen.height/2-o/2));return{onFailure:function(){n.close()},onSuccess:function(i){n.location.href=e(t,i)}}}t.getStatus=o,t.shareSnapshot=n}(e.Twitter||(e.Twitter={}))},function(t,e,i){(function(e){"use strict";function o(t){function o(){if(!t.favoriteChartTypes)return[];var e={Bars:u.STYLE_BARS,Candles:u.STYLE_CANDLES,Line:u.STYLE_LINE,Area:u.STYLE_AREA,"Heiken Ashi":u.STYLE_HEIKEN_ASHI,"Hollow Candles":u.STYLE_HOLLOW_CANDLES};return t.favoriteChartTypes.map(function(t){return e[t]})}var a,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,M;t=t||{},a=this._chartWidgetCollection=t.chartWidgetCollection,f=this._chartWidget=a.activeChartWidget.value(),m=this._onWidget=f.onWidget(),g=this,v=Modernizr.touch?"touchstart":"click",y=$(".header-chart-panel").eq(0),this._$right=y.find(".right"),this._$left=y.find(".left"),this._itemsVisibility=t.itemsVisibility,TradingView.isMobileView&&!TradingView.winMobileMode&&this._createBackButton(this),a.readOnly()||(e.enabled("header_symbol_search")&&(b=this.createGroup("symbol-search").appendTo(this._$left),w=$('<div class="symbol-edit-widget no-last"></div>').appendTo(b),S=$('<div class="symbol-edit-wrap">').appendTo(w),T=null,!e.enabled("charting_library_base")&&d.canShowSpreadActions()&&(C=$('<div class="symbol-edit-buttonswrap">').appendTo(S),T=$('<div class="spread-actions">').appendTo(C).on("mousedown",function(t){t.preventDefault()})),x=$('<div class="symbol-edit-inputspacer">').appendTo(S),P=$('<input type="text" class="symbol-edit" maxlenght="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+'">').appendTo(x),d.bindToInput(P,{syncWithChartWidget:!0,spreadActions:T}),function(){var t=!1;P.on("focus",function(){t=!0,S.addClass("expanded")}),P.on("blur",function(){t=!1,setTimeout(function(){t||S.removeClass("expanded")},40)})}()),e.enabled("header_resolutions")&&(b=this.createGroup("intervals",{single:!0,showInNarrowView:!0}).appendTo(this._$left),L={onWidget:m,submenuBtnAddClass:"apply-common-tooltip"},t.interval_options&&$.extend(L,t.interval_options),!TradingView.isMobileView&&e.enabled("items_favoriting")||$.extend(L,{notShowQuicks:!0,popupSpacing:1}),TradingView.isOnFeaturePage&&$.extend(L,{notShowQuicks:!0}),this._interval=new l(L),loginStateChange.subscribe(this,function(){window.is_authenticated&&this._interval.forceUpdate()}),e.enabled("charting_library_base")&&ChartApiInstance.on("configuration_received",function(){g._interval.forceUpdate()}),this._interval.element().addClass("no-first").appendTo(b),this._interval.onResize.subscribe(a,a.updateLayout),t.favoriteIntervals&&this._interval.setUpStarredItemsList(t.favoriteIntervals)),e.enabled("header_chart_type")&&(k=null,k=[{id:u.STYLE_BARS,title:$.t("Bars")},{id:u.STYLE_CANDLES,title:$.t("Candles")},{id:u.STYLE_HOLLOW_CANDLES,title:$.t("Hollow Candles")},{id:u.STYLE_LINE,title:$.t("Line")},{id:u.STYLE_AREA,title:$.t("Area")},{id:u.STYLE_HEIKEN_ASHI,title:$.t("Heikin Ashi")}],I=o()||[1,4,5,6],!TradingView.isMobileView&&!TradingView.isOnFeaturePage||e.enabled("charting_library_base")||(I=[]),m?I=[1,3]:e.enabled("collapsible_header")&&this._createMinimizeButton(t.headerChartPanel),this._style_list=new p("StyleWidget",k.map(function(t){return{id:t.id,title:t.title,svg:$(_[t.id]).attr({width:26,height:26}),favoriteButton:{title:t.title,addClass:"apply-common-tooltip"}}}),{defaultFavorites:I,addClass:"chart-style-widget",popupAddClass:"chart-style-popup",notShowQuicks:!!TradingView.isMobileView||!e.enabled("items_favoriting"),showJustDefaultQuicks:I&&I.length&&e.enabled("predefined_items_only_may_be_starred"),tooltip:$.t("Bar's Style"),addTooltipClass:"apply-common-tooltip"}),a.activeChartStyle.subscribe(function(t){g._style_list.setValue(t)},{callWithLast:!0}),g._style_list.onChange().subscribe(this,function(t){a.activeChartStyle.setValue(t)}),g._style_list.onResize().subscribe(a,a.updateLayout)),window.studyMarket=new h(a,window.user,{onWidget:m,fundamentalsOnly:t.fundamentalsOnly}),this._createLayout(t,g,v)),this._chartWidget.readOnly()||TradingView.isMobileView||!e.enabled("header_undo_redo")||(this._undoRedo=new n(this._$left,this._chartWidget),this._undoRedo.undoElement().addClass("apply-common-tooltip"),this._undoRedo.redoElement().addClass("apply-common-tooltip")),e.enabled("header_screenshot")&&(E=this.createGroup("screenshot",{single:!0}).appendTo(this._$right),A=$('<a class="button getimage"></a>').append($(i(570)).attr({class:"icon"})).addClass("apply-common-tooltip").attr("title",$.t("Take instant snapshot of your chart. No more Paint or other editors to save screenshots – simply click the button and copy the link of the picture.")).appendTo(E),E.click(function(t){if(!e.enabled("show_dialog_on_snapshot_ready")){if(A.hasClass("process"))return;A.addClass("process"),c.subscribe("onScreenshotReady",function(t){A.removeClass("process")},null,!0)}f.actions().takeScreenshot.callbacks().fire(),t.preventDefault()})),e.enabled("header_saveload")&&(V=e.enabled("header_saveload_to_the_right")?this._$right:this._$left,b=e.enabled("charting_library_base")?this.createGroup("save-load",{single:!0,showInNarrowView:!0}).appendTo(V):V,M=$("<div>").addClass("save-load-buttons").appendTo(b),this._saveLoad=new r(M,a,{popupDirection:"down",popupReverse:!0}),this._saveLoad.onTitleSizeChanged.subscribe(a,a.updateLayout),TradingView.isOnFeaturePage&&this._saveLoad.hideTitle()),e.enabled("header_widget_dom_node")||$(".header-chart-panel").css("display","none"),f.withModel(this,s.prototype.bindToModel)}var n=i(541),s=i(544),r=i(548),a=i(563),l=i(565),h=i(567),c=i(36),d=i(334),p=i(183).FavoredList,u=i(102),_=i(516);inherit(o,s),o.prototype._createUndoRedoGroup=function(){return this._undoRedo=new n(this._$left,this._chartWidget),this._undoRedo.undoElement().addClass("apply-common-tooltip"),this._undoRedo.redoElement().addClass("apply-common-tooltip"),this.createGroup("undo-redo",{single:!0}).append(this._undoRedo.element())},o.prototype._createFullscreenGroup=function(){this._fullscreen=new a;var t=this.createGroup("fullscreen",{single:!0});return this._fullscreen.element().addClass("apply-common-tooltip").appendTo(t),t},o.prototype._createLayout=function(t,i,o){var n=[];e.enabled("header_chart_type")&&n.push(this._createBarsGroup(i)),e.enabled("header_settings")&&e.enabled("show_chart_property_page")&&n.push(this._createPropertiesGroup(o,t.chartWidgetCollection)),e.enabled("header_indicators")&&n.push(this._createIndicatorsGroup(o)),e.enabled("header_compare")&&n.push(this._createCompareGroup(i,t.chartWidgetCollection,o)),!e.enabled("header_undo_redo")||this._chartWidget.readOnly()||TradingView.isMobileView||n.push(this._createUndoRedoGroup()),e.enabled("header_fullscreen_button")&&!TradingView.isMobileView&&n.push(this._createFullscreenGroup()),n.forEach(function(t){t.appendTo(this._$left)},this),e.enabled("caption_buttons_text_if_possible")&&this._setupCaptionButtons()},o.prototype._setupCaptionButtons=function(){var t=this._$left,e=t.children(".group"),i=this._chartWidgetCollection&&this._chartWidgetCollection.updateLayout,o=function(){for(var t,i=0,o=e.toArray();i<e.length;i++)if(void 0!==t){if($(o[i]).offset().top>t+5)return!1}else t=$(o[i]).offset().top;return!0},n=function(){t.addClass("captions"),o()||t.removeClass("captions"),t.find("svg").pixelSnap(),"function"==typeof i&&i()};this._style_list.onResize().subscribe(null,n),this._interval.onResize.subscribe(null,n),this._domeButton&&this._domeButton.onResize.subscribe(null,n),window.studyTemplates&&studyTemplates.onFavoriteListResize.subscribe(null,n),$(window).resize(n),n()},o.prototype._createMinimizeButton=function(t){t&&t.size()&&$(document.createElement("span")).addClass("tv-close-panel top").appendTo(t).on("click",function(e){e.isDefaultPrevented()||(e.preventDefault(),t.toggleClass("hidden"),c.emit("toggle_header",!t.hasClass("hidden")),$(window).trigger("resize"))})},t.exports=o}).call(e,i(1))},function(t,e,i){"use strict";function o(){this._$wrap=$(document.createElement("span")),this._undo=$('<span class="button undo disabled"></span>').append($(i(542))).attr("title","").appendTo(this._$wrap),this._redo=$('<span class="button redo disabled"></span>').append($(i(543))).attr("title","").appendTo(this._$wrap);var t=this;this._undo.click(function(){t.undo()}),this._redo.click(function(){t.redo()}),n.undoStack().onChange().subscribe(this,this.update),n.redoStack().onChange().subscribe(this,this.update)}var n=i(291).UndoHistory,s=i(35).trackEvent;o.prototype.update=function(){var t=n.undoStack(),e=n.redoStack();t.isEmpty()?(this._undo.addClass("disabled"),this._undo.attr("title",null)):(this._undo.removeClass("disabled"),this._undo.attr("title",$.t("Undo {0}").format(t.head().text()||""))),e.isEmpty()?(this._redo.addClass("disabled"),this._redo.attr("title",null)):(this._redo.removeClass("disabled"),this._redo.attr("title",$.t("Redo {0}").format(e.head().text()||"")))},o.prototype.undo=function(){this._undo.hasClass("disabled")||(s("GUI","Undo"),n.undo())},o.prototype.redo=function(){this._redo.hasClass("disabled")||(s("GUI","Redo"),n.redo())},o.prototype.element=function(){return this._$wrap},o.prototype.undoElement=function(){return this._undo},o.prototype.redoElement=function(){return this._redo},t.exports=o},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path d="M15 13.4C15 4.1 7.5 5 7.5 5V1.7L0 6.5l7.5 4.9V8.2c5.8 0 7.5 5.1 7.5 5.2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path d="M7.5 8.2v3.2L15 6.5 7.5 1.7V5S0 4.1 0 13.4c0-.1 1.7-5.2 7.5-5.2z"/></svg>'},function(t,e,i){(function(e){"use strict";function o(){}var n=i(332).AddCompareDialog,s=i(36),r=i(337);TradingView.SYMBOL_SEARCH_MAX_LENGTH=100,o.prototype._createBackButton=function(t){var e=t.createGroup("back-button").appendTo(t._$left);t._backButton=$('<div class="mobile-back-button"><i></i></div>').click(function(){window.history.length>1&&window.history.back(),window.location.pathname="/"}).appendTo(e)},o.prototype._createBarsGroup=function(t){var e=this.createGroup("bars-style",{single:!0});return t._style_list.element().appendTo(e),e},o.prototype._createPropertiesGroup=function(t,o){var n,s=this.createGroup("properties",{single:!0});return this._onWidget&&!e.enabled("header_settings")||(n=$("<span>").addClass("button iconed properties apply-common-tooltip").append($(i(545)).attr({width:17,height:17})).appendTo(s),n.on(t,function(t){t.pageX=n.offset().left,t.pageY=n.offset().top+n.height()+15,TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Style")),o.activeChartWidget.value().showChartProperties({_lastEvent:t}).then(function(t){n.addClass("active"),t.on("destroy",function(){n.removeClass("active")})})}),n.attr("title",$.t("Chart Properties"))),s},o.prototype._createCompareGroup=function(t,e,o){var s=this.createGroup("compare",{single:!0}),r=$('<a class="button toggle-caption compare apply-common-tooltip">').append($(i(546))).append($('<span class="caption">'+$.t("Compare")+"</span>")).appendTo(s);return this._compareButton=r,this._compareButton.on(o,function(t){var i,o;t.preventDefault(),i=new n(e),o=i.show(),r.addClass("active"),o.on("destroy",function(){r.removeClass("active")})}),this._compareButton.attr("title",$.t("Compare or Add Symbol")),s},o.prototype._createIndicatorsGroup=function(t,o){var n=this.createGroup("indicators",{single:!0,showInNarrowView:!0});return this._indicatorsButton=$('<a class="button toggle-caption indicators'+(this._onWidget?" no-last":"")+' apply-common-tooltip">').append($(i(547))).append($('<span class="caption">'+$.t("Indicators")+"</span>")).appendTo(n),e.enabled("charting_library_base")||e.enabled("widget")?this._indicatorsButton.attr("title",$.t("Indicators")):this._indicatorsButton.attr("title",$.t("Indicators, Fundamentals, Economy and Add-ons")),this._indicatorsButton.on(t,function(t){t.preventDefault(),window.studyMarket.isVisible()?window.studyMarket.hide():(window.studyMarket.show(),s.emit("indicators_dialog"))}),r.registerListener("IndicatorsHotkey",function(t){if(47===t.which&&$(t.target).is("body")&&!window.studyMarket.isVisible())return window.studyMarket.show(),window.studyMarket.selectSearchPage(),t.preventDefault(),t.stopPropagation(),!0}),window.studyMarket.visibilityChanged.subscribe(this,function(t){this._indicatorsButton.toggleClass("active",t)}),!TradingView.onWidget()&&e.enabled("study_templates")&&studyTemplates.appendMenuButtonTo(n),n},o.prototype.createGroup=function(t,e){e=e||{};var i=$("<div>").addClass("group");return e.right&&i.addClass("right"),e.single&&i.addClass("space-single"),t&&i.addClass("header-group-"+t),i},o.prototype.bindToModel=function(){var t=this._chartWidget.model();this._model=t},o.prototype.backButton=function(){return this._backButton},o.prototype.saveLoadWidget=function(){return this._saveLoad||TradingView.logWarn("No save-load widget created in footer")},o.prototype.styleIconPosition=function(t){return"-%1px 0".replace("%1",19*~~t)},o.styleIconPosition=o.prototype.styleIconPosition,t.exports=o}).call(e,i(1))},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 600 600" enable-background="new -2.4 120.9 600 600"><path d="M594 473.5V368.8h-76c-5.7-23.8-15.2-46.4-27.5-66.4l53.8-53.8-73.9-73.9-53.8 53.4c-20.6-12.8-42.7-21.8-66.4-27.5v-75.9H245.5v75.9c-23.8 5.7-46.4 15.2-66.4 27.5l-53.8-53.8-73.9 73.9 53.4 53.8C92 322.6 83 344.7 77.3 368.4h-76V473h75.9c5.7 23.8 15.2 46.4 27.5 66.4L51 593.3l73.9 73.9 53.8-53.4c20.6 12.8 42.7 21.8 66.4 27.5v75.9h104.6v-75.9c23.8-5.7 46.4-15.2 66.4-27.5l53.8 53.8 73.9-73.9-53.4-53.8c12.8-20.6 21.8-42.7 27.5-66.4H594zm-296.4 69.7c-67.3 0-122.3-54.6-122.3-122.3 0-67.3 54.6-122.3 122.3-122.3 67.3 0 122.3 54.6 122.3 122.3-.4 67.4-54.9 122.3-122.3 122.3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17"><path d="M8.5.36L6.45 2H1v1h2l-3 8a3.54 3.5 0 0 0 3.055 2.97 3.5 3.5 0 0 0 .004 0 3.54 3.5 0 0 0 .44.03 3.5 3.5 0 0 0 .35-.018A3.54 3.5 0 0 0 7 11L4 3h9l-3 8a3.54 3.5 0 0 0 3.502 3A3.54 3.5 0 0 0 17 11l-3-8h2V2h-5.45L8.5.36zm0 1.28l.45.36h-.9l.45-.36zm-5 2.694L6 11H1l2.5-6.666zm10 0L16 11h-5l2.5-6.666z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17"><path d="M16 0a1 1 0 0 0-1 1 1 1 0 0 0 .127.484L13.017 5A1 1 0 0 0 13 5a1 1 0 0 0-.258.035L10.965 3.26A1 1 0 0 0 11 3a1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 .082.393L7.12 6.008a1 1 0 0 0-.12-.01 1 1 0 0 0-.44.104l-1.564-1.04A1 1 0 0 0 5 4.998a1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 .002.066l-1.56 1.04A1 1 0 0 0 1 5.998a1 1 0 0 0-1 1 1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.002-.064l1.56-1.04A1 1 0 0 0 4 6a1 1 0 0 0 .44-.103l1.564 1.04A1 1 0 0 0 6 7a1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.082-.39l1.965-2.62A1 1 0 0 0 10 4a1 1 0 0 0 .258-.035l1.777 1.777A1 1 0 0 0 12 6a1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.127-.482L15.983 2A1 1 0 0 0 16 2a1 1 0 0 0 1-1 1 1 0 0 0-1-1zm-1 5v10h2V5h-2zM9 7v8h2V7H9zM3 9v6h2V9H3zm9 1v5h2v-5h-2zM0 11v4h2v-4H0zm6 0v4h2v-4H6z"/></svg>'},function(t,e,i){(function(e,o){"use strict";function n(t,o,r){function d(){o.metaInfo.name.value()||u._readOnly?u.setTitle(o.metaInfo.name.value()):u.hideTitle()}var p,u;r=$.extend({popupDirection:"up",popupReverse:!1},r||{}),this._options=r,this.onTitleSizeChanged=new e,this._container=t=$(t),this._chartWidgetCollection=o,this._readOnly=o.readOnly(),this._savedCharts=[],this._editEnabled=!0,this.loadChartDialog=new l,this.renameChartDialog=new a,this._load=$('<span class="load button first apply-common-tooltip"></span>').append($(i(561))).attr("title",$.t("Load Chart Layout")).click(this.signInOrLoadChart.bind(this)).appendTo(t),this._title=$('<span class="title apply-common-tooltip"></span>'),r.hideChartTitle&&this._title.hide(),this._sep=$("<span>").addClass("separator"),this._optionsMenu=$('<span class="button with-arrow options last">').append($("<span>").addClass("arrow-icon")),h(this._optionsMenu,this._getSavedCharts.bind(this),{direction:r.popupDirection,reverse:r.popupReverse,notCloseOnButtons:!0,popupSpacing:r.popupSpacing}),this._readOnly?(this._save=$(),this._copy=$('<span class="copy">'+$.t("Copy")+"</span>").appendTo(t).click($.proxy(this,"cloneChart")),this._title.addClass("read-only"),this._titleReadOnly=$("<span>").addClass("read-only").appendTo(this._title),this._sep.appendTo(this._copy),this._optionsMenu.hide()):(p=$.t("Save Chart Layout saves not just some particular chart, it saves all charts for all symbols and intervals which you are modifying while working with this Layout"),this._save=$('<span class="save button apply-common-tooltip"></span>').attr("title",p).append($(i(562))).appendTo(t).click($.proxy(this,"signInOrSaveChart")),this._copy=$(),this._titleInput=$('<span type="text" maxlength="80">').appendTo(this._title),this._title.bind("click",$.proxy(this,"_renameChart")),this._title.attr("title",$.t("Rename Chart Layout")),this._titleSize=$('<span class="sizer">').appendTo(this._title),this._sep.appendTo(this._save)),this._title.appendTo(t),this._optionsMenu.appendTo(t),this._savecopy=$().add(this._save).add(this._copy).mousedown(function(t){if(t.button)return!1;this._save.addClass("active")}.bind(this)).mouseup(function(){this._save.removeClass("active")}.bind(this)),u=this,o.metaInfo.name.subscribe(function(){d()}),d(),loginStateChange.subscribe(this,this._refreshSavedChartsList),TVXWindowEvents.on("saved-charts-change",$.proxy(this._otherTabUpdated,this)),TVXWindowEvents.on("saved-charts-change-favorites",$.proxy(this._favoritesUpdated,this)),s.undoStack().onChange().subscribe(this,function(){if(!s.undoStack().isEmpty()){var t=s.undoStack().head().text();if("scroll"===t||"scale time"===t)return}this._setChanges(!0),this.autosave()}),c.registerListener("LoadChartDialogHotkey",function(t){return!t.ctrlKey&&(!(46!==t.which||!$(t.target).is("body"))&&(this.loadMenu(),t.preventDefault(),t.stopPropagation(),!0))}.bind(this)),this.favorites=TVSettings.getJSON(n.FAVORITES_KEY,{}),window.saver.chartSaved().subscribe(this,n.prototype._onChartSaved),window.saver.chartAboutToBeSaved().subscribe(this,n.prototype._onChartAboutToBeSaved)}var s=i(291).UndoHistory,r=i(276),a=i(549),l=i(551),h=i(183).bindPopupMenu,c=i(337),d=i(35).trackEvent,p=i(559).deleteChart;n.FAVORITES_KEY="loadChartDialog.favorites",n.prototype._favoritesUpdated=function(t){this.favorites=JSON.parse(t),this.loadChartDialog.updateFavoritesData(this.favorites)},n.prototype._otherTabUpdated=function(t){this._savedCharts=JSON.parse(t),this.loadChartDialog.updateChartsData(this._getLoadMenuCharts())},n.prototype._renameChart=function(){var t=this;t._editEnabled&&this.renameChartDialog.show(this.getTitle(),!1).then(function(e){t.setTitle(e),t.saveChart()})},n.prototype._setTitle=function(t){this._titleInput.text(t),this._titleValue=t,this._savecopy.removeClass("last").addClass("titled"),t?this._options.hideChartTitle||(this._optionsMenu.show(),this._title.show()):(this._optionsMenu.hide(),this._title.hide(),this._savecopy.addClass("last").removeClass("titled")),this._setInputSuze(),this._setChanges(!0)},n.prototype._setReadOnlyTitle=function(t){this._titleReadOnly.html(t).attr("title",t.replace(/<[^>]+>/g,"")),this._savecopy.removeClass("last").addClass("titled"),this._title.addClass("last"),this._options.hideChartTitle||this._title.show()},n.prototype.setTitle=function(t){if(this._readOnly){var e=TradingView.clean(this._chartWidgetCollection.metaInfo.username.value());t=(t?TradingView.clean(t)+": ":"")+"view-only chart by "+'<a href="/u/%1/">%1</a>'.replace(/%1/g,e),this._setReadOnlyTitle(t)}else this._setTitle(t)},n.prototype.hideTitle=function(){this._title.hide(),this._optionsMenu.hide(),this._titleInput.text(""),this._savecopy.removeClass("titled").addClass("last")},n.prototype.getTitle=function(){return this._titleValue},n.prototype._setInputSuze=function(){this._titleSize.text(this._titleInput.text()),this._titleInput.width(this._titleSize.width()),this.onTitleSizeChanged.fire()},n.prototype.cloneChart=function(){var t,e=this;o.enabled("save_old_chart_before_save_as")&&this._chartWidgetCollection.metaInfo.id.value()&&this._saveChart(),t=new a($.t("Copy Chart Layout")),t.show($.t("{0} copy",!0).format(e._chartWidgetCollection.metaInfo.name.value())).then(function(t){o.enabled("saved_charts_count_restriction")&&!user.is_pro&&e._savedCharts.length>=5?goProDialog({feature:"savedChartsLimit"}).open():o.enabled("saveload_storage_customization")?(e._chartWidgetCollection.metaInfo.uid.setValue(void 0),e._chartWidgetCollection.metaInfo.id.setValue(void 0),e.setTitle(t),e.saveChart()):window.open("/chart/?clone="+e._chartWidgetCollection.metaInfo.uid.value()+"&name="+encodeURIComponent(t),"_blank")})},n.prototype._setChanges=function(t){t=!!t,this._haveChanges=t,!t&&this.getTitle()?this._save.addClass("no-change"):this._save.removeClass("no-change")},n.prototype._process=function(t){t=!!t,t?this._save.addClass("process"):this._save.removeClass("process")},n.prototype._onChartAboutToBeSaved=function(){this._saving=!0,this._process(!0),this._editEnabled=!1},n.prototype._onChartSaved=function(t){this._stopProcess(),t&&this._setChanges(!1)},n.prototype._stopProcess=function(){this._saving=!1,this._process(!1),this._editEnabled=!0},n.prototype._saveChart=function(t,e){if(!this._readOnly&&!this._saving&&this._haveChanges)try{window.saver.saveChartSilently(function(){"function"==typeof t&&t.call(this)},null,function(){"function"==typeof e&&e.call(this)})}catch(t){this._stopProcess(),TradingView.logError("Error while saving",t)}},n.prototype._autosaveInterval=6e4,n.prototype.autosave=function(){o.enabled("charts_auto_save")&&(this._chartWidgetCollection.onfeatures||(this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=0),this._autosaveTimer=setTimeout(function(){this._chartWidgetCollection.metaInfo.id.value()&&this._saveChart()}.bind(this),this._autosaveInterval)))},n.prototype._goChartPage=function(t){"/chart/"===location.pathname&&(location.href="/chart/"+t+(TradingView.isMobileView?"?mobile=1":""))},n.prototype.saveChart=function(){var t,e;this._chartWidgetCollection.onfeatures||(t=this.getTitle(),t?(this._chartWidgetCollection.metaInfo.name.setValue(t),this._saveChart(function(){d("GUI","Save Chart Layout"),this._goChartPage(this._chartWidgetCollection.metaInfo.uid.value()),this._refreshSavedChartsList()}.bind(this))):(e=new a($.t("Save New Chart Layout"),$.t("Chart layout name")+":",64),e.show(null,!0).then(function(t){this.setTitle(t),this.saveChart()}.bind(this))))},n.prototype.signInOrSaveChart=function(){o.enabled("saveload_requires_authentication")?runOrSignIn($.proxy(this,"saveChart"),{source:"Save chart",sourceMeta:"Chart"}):this.saveChart()},n.prototype.signInOrLoadChart=function(){o.enabled("saveload_requires_authentication")?runOrSignIn($.proxy(this,"loadMenu"),{source:"Load chart",sourceMeta:"Chart"}):this.loadMenu()},n.prototype.signInOrRenameChart=function(){o.enabled("saveload_requires_authentication")?runOrSignIn($.proxy(this,"_renameChart"),{source:"Rename chart"}):this._renameChart()},n.prototype.signInOrSaveAs=function(){o.enabled("saveload_requires_authentication")?runOrSignIn($.proxy(this,"cloneChart"),{source:"Clone chart"}):this.cloneChart()},n.prototype.saveChartByEnter=function(t){13===t.keyCode&&(this._titleInput.blur(),this.signInOrSaveChart())},n.prototype._refreshSavedChartsList=function(t){o.enabled("saveload_requires_authentication")&&!is_authenticated?this._savedCharts=[]:r.getCharts(function(t){this._savedCharts=t,TVXWindowEvents.emit("saved-charts-change",JSON.stringify(t))}.bind(this)).then(function(){t&&t()})},n.prototype._getSavedChartsList=function(){return this._savedCharts},n.prototype._fastDelete=function(t,e){this._savedCharts.splice(e,1),t===this._chartWidgetCollection.metaInfo.id.value()&&(o.enabled("saveload_storage_customization")?(this._chartWidgetCollection.clearChartMetaInfo(),this.setTitle(void 0)):location.href="/chart/")},n.prototype._getSavedCharts=function(){var t=[];return this.isSaved()&&t.push({title:this.getTitle(),disabled:!0,addClass:"save-load-chart-title"}),this._readOnly||(t.push({title:$.t("Save Chart Layout"),action:this.signInOrSaveChart.bind(this)}),this.isSaved()&&(t.push({title:$.t("Save As..."),action:this.signInOrSaveAs.bind(this)}),t.push({title:$.t("Rename..."),action:this.signInOrRenameChart.bind(this)}))),t},n.prototype.isSaved=function(){return!!this.getTitle()},n.prototype._getLoadMenuCharts=function(){var t=[],e=this,i=this._getSavedChartsList();return i.length&&i.forEach(function(i,o){t.push({id:i.id,title:i.name,symbol:i.short_symbol,interval:i.interval,toolsCount:0,modified:i.modified_iso,active:function(){return i.id===e._chartWidgetCollection.metaInfo.id.value()},openAction:function(){r.loadChart(i)},deleteAction:function(t){p(i.image_url,function(){e._fastDelete(i.id,o),TVXWindowEvents.emit("saved-charts-change",JSON.stringify(e._savedCharts)),t.resolve()},t.reject.bind(t))},favoriteAction:function(t){e.favorites=t,TVSettings.setJSON(n.FAVORITES_KEY,t),TVXWindowEvents.emit("saved-charts-change-favorites",JSON.stringify(t))}})}),t},n.prototype.loadMenu=function(){var t=this;this._load.addClass("process"),this._refreshSavedChartsList(function(){t._load.removeClass("process"),t.loadChartDialog.show(t._getLoadMenuCharts(),t.favorites)})},t.exports=n}).call(e,i(34),i(1))},function(t,e,i){"use strict";function o(t,e,i){this.title=t||$.t("Rename Chart Layout"),this.label=e||$.t("Enter a new chart layout name")+":",this.maxlength=i||""}i(550);var n=i(67).createDialog;o.prototype.show=function(t,e){var i,o,s,r,a=$('<input class="tv-control-input" name="value">');return a.attr("maxlength",this.maxlength),a.val(t),i=$("<div>"),i.append($('<div class="tv-rename-chart-dialog__label">').text(this.label)),i.append(a),o=n({title:this.title,content:i,actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions i-align_right tv-dialog__section--no-border">',width:470,destroyOnClose:e,actions:[{name:"submit",type:"primary",text:$.t("Save"),key:13},{name:"cancel",type:"default",text:$.t("Cancel"),method:"close"}]}),s=$.Deferred(),r=function(t){var e=a.val();e?(s.resolve(e),t.close()):(t.error($.t("Please enter chart layout name")),a.focus())},o.on("action:submit",r),o.open(),a.focus().select(),s},t.exports=o},function(t,e){},function(t,e,i){(function(e,o,n){"use strict";function s(){this.title=$.t("Load Chart Layout"),this._removeDialogShown=!1,this.options={},this.matchedItems=[],this.itemsData=[],this.qs=new s.QuickSearch(this.fieldsExtractor,this.searchResult.bind(this)),this.sortObj=new s.SortObject(this.modifiedCompare),this.nameSort=new s.SortObject(this.nameCompare),this.symbolSort=new s.SortObject(this.symbolCompare),this.toolsSort=new s.SortObject(this.toolsCompare),l.on("chart_loaded",s.onChartLoaded,this)}var r,a,l=i(36),h=i(67).createDialog,c=i(552).createSearchControl,d=i(37).regExpEscape;i(556),r='<div class="js-table-row tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--item {{^withFavs}}tv-load-chart-dialog-table__row--item-without-favs{{/withFavs}} {{#isActive}}i-active{{/isActive}}">{{#withFavs}}<div class="tv-load-chart-dialog-table__favorite-icon-container {{#starred}}i-starred{{/starred}}"><span class="js-empty-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--empty">'+i(557)+'</span><span class="js-filled-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--filled">'+i(558)+'</span></div>{{/withFavs}}<div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-name">{{title}}</div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-modified">{{modifiedDate}}</div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-symbol">{{chartSymbol}}</div><div class="js-remove-button tv-load-chart-dialog-table__column-name-action tv-load-chart-dialog-table__remove-icon">'+i(58)+"</div></div>",a='<div class="tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--header"><div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-name">'+$.t("Chart Layout Name")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-modified">'+$.t("Last Modified")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-symbol">'+$.t("Active Symbol")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div></div>',s.onChartLoaded=function(){this.itemsData&&this.itemsData.length>0&&this._refreshChartsList()},s.QuickSearch=function(t,e){this.fieldsExtractor=t,this.callback=e,this.regExps=[]},s.QuickSearch.prototype.onInput=function(t){this.query=t,this.createRegexps(t),this.search()},s.QuickSearch.prototype.createRegexps=function(t){this.regExps=[],this.regExps.push(RegExp("("+t.split("").map(function(t){return d(t)}).join(")(.*?)(")+")","i"))},s.QuickSearch.prototype.match=function(t){var e,i,o,n;for(e=0;e<this.regExps.length;e++)for(i=this.regExps[e],i.lastIndex=0,o=this.fieldsExtractor(t),n=0;n<o.length;n++)if(i.test(o[n]))return!0;return 0===this.regExps.length},s.QuickSearch.prototype.search=function(){var t,e,i=[];for(t=0;t<this.items.length;t++)e=this.items[t],this.match(e)&&i.push(e);this.callback(i,this.regExps)},s.QuickSearch.prototype.setItems=function(t){this.items=t},s.SortObject=function(t,e){this.isAscending=!1,this.sortingFunc=t,this.getPredicate=function(){return function(t,e){var i=this.sortingFunc(t,e);return this.isAscending&&(i*=-1),i}.bind(this)},this.inverse=function(){this.isAscending=!this.isAscending},this.setIsAscending=function(t){return"boolean"==typeof t&&(this.isAscending=t),this.isAscending},this.reset=function(){this.isAscending=!1}},s.prototype.fieldsExtractor=function(t){var e=s.symbolWrap(t);return[t.title,e]},s.prototype.saveFavorite=function(t,e){e?this.favorites[t]=e:delete this.favorites[t]},s.prototype.filterFavorites=function(){var t={};this.itemsData.map(function(e){this.favorites.hasOwnProperty(e.id)&&(t[e.id]=!0)}.bind(this)),this.favorites=t},s.prototype.getFavorite=function(t){return this.favorites.hasOwnProperty(t)},s.prototype._onFavoriteClicked=function(t,e,i){this.saveFavorite(t.id,e),this.filterFavorites(),this.fillList(),t.favoriteAction(this.favorites),i.preventDefault()},s.prototype._onItemClicked=function(t,e){e.defaultPrevented||this.itemsList.executing!==!0&&(this.itemsList.executing=!0,t.openAction(),setTimeout(function(){this.itemsList.executing=!1}.bind(this),1e3))},s.prototype._onRemoveButtonClicked=function(t,e){var i=this,o=$.Deferred();this._removeDialogShown=!0,o.done(function(){i.removeItem(t)}).always(function(){setTimeout(function(){i._removeDialogShown=!1})}),t.deleteAction(o),e.preventDefault()},s.prototype._createListItem=function(t){var i=$(e.render(r,{isActive:t.active(),title:t.title,withFavs:o.enabled("items_favoriting"),starred:this.getFavorite(t.id),modifiedDate:n.unix(t.modified).format("L LT"),chartSymbol:""===t.symbol?"multiple charts":t.symbol+", "+t.interval}));return o.enabled("items_favoriting")&&(i.find(".js-empty-star")[0].addEventListener("click",this._onFavoriteClicked.bind(this,t,!0)),i.find(".js-filled-star")[0].addEventListener("click",this._onFavoriteClicked.bind(this,t,!1))),i.find(".js-remove-button")[0].addEventListener("click",this._onRemoveButtonClicked.bind(this,t)),i[0].addEventListener("click",this._onItemClicked.bind(this,t)),i},s.prototype.removeItem=function(t){var e=this.itemsData.indexOf(t);e>-1&&this.itemsData.splice(e,1),this.setChartsData(this.itemsData)},s.prototype.modifiedCompare=function(t,e){var i=t.modified;return n(e.modified).diff(n(i))},s.prototype.nameCompare=function(t,e){return t.title.localeCompare(e.title)},s.symbolWrap=function(t){return""===t.symbol?"multiple charts":t.symbol+" "+t.interval},s.prototype.symbolCompare=function(t,e){return s.symbolWrap(t).localeCompare(s.symbolWrap(e))},s.prototype.toolsCompare=function(t,e){var i=t.toolsCount,o=e.toolsCount;return i<o?-1:i===o?0:1},s.prototype.sortClick=function(t){this.setSort($(t.target).data("sort"),!0),this.fillList()},s.prototype.setSort=function(t,e){var i,o,n={field:TVSettings.getValue("loadChartDialog.sort.field")||"modified",isAscending:TVSettings.getValue("loadChartDialog.sort.asc")||"0"},s=t||n.field,r=e?"0"===n.isAscending?"1":"0":n.isAscending;this.currentSortObj&&!(i=s!==n.field)||(this.currentSortObj="name"===s?this.nameSort:"symbol"===s?this.symbolSort:"tools"===s?this.toolsSort:this.sortObj,i&&TVSettings.setValue("loadChartDialog.sort.field",s)),this.currentSortObj.setIsAscending("1"===r),r!==n.isAscending&&TVSettings.setValue("loadChartDialog.sort.asc",r),o=this,$.each(this.header.children(".tv-load-chart-dialog-table__column--header"),function(){var t=$(this),e=t.data("sort")===s;t.removeClass("i-active i-dropped"),e&&t.addClass("i-active "+(o.currentSortObj.isAscending?"":"i-dropped"))})},s.prototype.sortList=function(){var t,e=[],i=[];this.matchedItems.map(function(t){this.favorites.hasOwnProperty(t.id)?e.push(t):i.push(t)}.bind(this)),void 0!==this.currentSortObj&&(t=this.currentSortObj.getPredicate(),i.sort(t),e.sort(t)),this.matchedItems=e.concat(i)},s.prototype.fillList=function(){var t,e;for(this.sortList(),this.itemsList=this.itemsList.detach(),this.itemsList[0].innerHTML="",t=this.matchedItems.length,e=0;e<t;++e)this.itemsList.append(this._createListItem(this.matchedItems[e]));this.itemsListContainer.toggleClass("i-empty",0===this.itemsData.length),this.highlightOccurrences(this.qs.regExps),this._dialog&&(this._dialog.scrollToStart(),this._dialog.updateScroll()),this.itemsListContainer.prepend(this.itemsList)},s.prototype.searchResult=function(t,e){this.matchedItems=t,this.fillList()},s.prototype.updateChartsData=function(t){this.setChartsData(t)},s.prototype.updateFavoritesData=function(t){this.favorites=t,this.itemsList&&this.qs.search()},s.prototype._refreshChartsList=function(){this.qs.setItems(this.itemsData),this.qs.search()},s.prototype.setChartsData=function(t){this.itemsList&&(this.itemsData=t,this.qs.setItems(t),this.qs.search())},s.prototype.layoutHeader=function(){var t=$(a);return t.find(".js-column-name").data("sort","name"),t.find(".js-column-modified").data("sort","modified"),t.find(".js-column-symbol").data("sort","symbol"),t.appendTo(this.content),t},s.prototype.resetSort=function(){this.sortObj.reset(),this.nameSort.reset(),this.symbolSort.reset(),this.toolsSort.reset(),this.currentSortObj=this.sortObj},s.prototype.show=function(t,e){var i=c({placeholder:$.t("Search")}),o=$("<div>");o.append(i.$control),o.append('<div class="tv-load-chart-dialog-table">'),this.content=$("<div>").appendTo(o.find(".tv-load-chart-dialog-table")),this.header=this.layoutHeader(),this.setSort(),this.itemsListContainer=$('<div class="tv-load-chart-dialog-table__items-list-container js-dialog__scroll-wrap">').appendTo(this.content),this.itemsList=$('<div class="tv-load-chart-dialog-table__items-list">').appendTo(this.itemsListContainer),$('<div class="tv-load-chart-dialog-table__empty-list-placeholder">').text($.t("There are no saved charts")).appendTo(this.itemsListContainer),this.header.children(".tv-load-chart-dialog-table__column--header").click($.proxy(this,"sortClick")),i.inputChangedDelegate.subscribe(this.qs,this.qs.onInput),this.favorites=e,this.setChartsData(t),this.qs.onInput(""),this._dialog&&this._dialog.close(),this._dialog=h({title:this.title,width:600,height:550,content:o,contentWrapTemplate:"<div>",destroyOnClose:!0,isClickOutFn:function(){return!this._removeDialogShown&&void 0}.bind(this)}),this._dialog.open()},s.prototype.highlightOccurrences=function(t){this.itemsList.children(".js-table-row").each(function(){var e,i=$(this).find(".js-column-name"),o=i.text();o=s.highlightText(o,t),i.html(o),e=$(this).find(".js-column-symbol"),o=e.text(),o=s.highlightText(o,t),e.html(o)})},s.highlightText=function(t,e){var i,o,n,s,r,a;if(t=$("<div>").text(t).html(),0===e.length)return t;for(i=0;i<e.length;i++){if(o=e[i],o.lastIndex=0,n="",s="",(r=o.exec(t))&&r.length)for(a=1;a<r.length;a++)n+=a%2?'<span class="i-match">$'+a+"</span>":"$"+a;if((s=t.replace(o,n))&&s!==t)return s}},t.exports=s}).call(e,i(52),i(1),i(7))},function(t,e,i){(function(t){"use strict";function o(t,e,i){e.toggleClass("i-hidden",""===t.val()),i.fire(t.val())}function n(){var e,i,n,r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],a=$(s);return r.addClass&&a.addClass(r.addClass),r.withoutControls&&a.addClass("tv-search-row--without-controls"),e=a.find(".js-input-control"),i=a.find(".js-reset-button"),r.placeholder&&e.attr("placeholder",r.placeholder),i[0].addEventListener("click",function(){e.val("").trigger("input").focus()}),n=new t,e.on("input propertychange",o.bind(null,e,i,n)),o(e,i,n),{$control:a,$input:e,inputChangedDelegate:n}}Object.defineProperty(e,"__esModule",{value:!0}),e.createSearchControl=n,i(553);var s='<div class="tv-search-row"><input class="tv-search-row__input js-input-control" type="text" name="q" value="" autocomplete="off"><span class="tv-search-row__input-reset i-hidden js-reset-button">'+i(554)+'</span><span class="tv-search-row__search-icon">'+i(555)+"</span></div>"}).call(e,i(34))},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 95.939 95.939" width="95.939" height="95.939"><path d="M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18px" height="18px"><path fill-rule="evenodd" d="M12.5 11h-.79l-.28-.27A6.47 6.47 0 0 0 13 6.5 6.5 6.5 0 1 0 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z"/></svg>'},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 15" width="16" height="15"><path d="M8 0L5.656 4.75l-5.25.78 3.781 3.72-.875 5.22L8 12l4.688 2.47-.876-5.22 3.782-3.72-5.25-.78L8 0zm0 3.406l1.344 2.72 3.03.436-2.187 2.157.5 3.03L8 10.312 5.312 11.75l.5-3.03L3.626 6.56l3.03-.437L8 3.405z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 15" width="16" height="15"><path d="M8 12l-4.702 2.472.898-5.236L.392 5.528l5.257-.764L8 0l2.35 4.764 5.258.764-3.804 3.708.898 5.236z"/></svg>'},function(t,e,i){"use strict";function o(t,e,i){var o=(0,n.createConfirmDialog)({type:"modal",content:$.t("Are you sure you want to delete this chart?"),addClass:"delete-chart-dialog"}),r=function(){var t=i;i=null,t&&t()};o.on("action:yes",function(){i=null,s.removeChart(t,e),o.close()}),o.on("action:no",r),o.on("afterClose",r),o.open()}var n,s;Object.defineProperty(e,"__esModule",{value:!0}),e.deleteChart=o,n=i(560),s=i(276)},function(t,e,i){"use strict";function o(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return(0,s.createDialog)(n({},r,t))}var n,s,r;Object.defineProperty(e,"__esModule",{value:!0}),n=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},e.createConfirmDialog=o,s=i(67),r={width:400,destroyOnClose:!0,title:$.t("Confirmation"),content:$.t("Are you sure?"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',actions:[{name:"yes",type:"success",text:$.t("Yes"),key:13},{name:"no",type:"default",text:$.t("No"),method:"close"}]}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 18" width="26" height="18"><path d="M12 0C8.4 0 5.4 2.8 5.1 6.3 2 6.1.1 9 0 11.1 0 13.9 2.2 16 4.7 16h4.9l-1-1H4.7C2.8 15 1 13.3 1 11.2 1 9 3 6.7 6 7.4 6 3 9 1 12 1s3.7 1.2 5.1 2.9c1.5.1 3.3.6 4.2 1.7 1 1.5 1.2 2.6 1.2 4.2 1.4.4 2.5 1.5 2.5 2.7-.2 1.6-1.3 2.5-2.6 2.5h-5l-1 1h5.9c2.8 0 3.7-1.9 3.7-3.5s-1-3-2.5-3.4c0-1.6-.5-2.9-1.4-4.1-.9-1.2-2.7-2-4.5-2.1C16.3 1.2 14.3 0 12 0zm-2 7v5H7l6 6 6-6h-3V7h-6zm1 1h4v5h1.6L13 16.6 9.4 13H11V8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 18" width="26" height="18"><path d="M12 0C8.4 0 5.4 2.8 5.1 6.3 2 6.1.1 9 0 11.1 0 13.9 2.2 16 4.7 16H9v-1H4.7C2.8 15 1 13.3 1 11.2 1 9 3 6.7 6 7.4 6 3 9 1 12 1s3.7 1.2 5.1 2.9c1.5.1 3.3.6 4.2 1.7 1 1.5 1.2 2.6 1.2 4.2 1.4.4 2.5 1.5 2.5 2.7-.2 1.6-1.3 2.5-2.6 2.5H17v1h5.3c2.8 0 3.7-1.9 3.7-3.5s-1-3-2.5-3.4c0-1.6-.5-2.9-1.4-4.1-.9-1.2-2.7-2-4.5-2.1C16.3 1.2 14.3 0 12 0zm1 6l-6 6h3v5h6v-5h3l-6-6z"/></svg>'},function(t,e,i){(function(e){"use strict";function o(){var t=this;this.isFullscreen=!1,this._e=$("<span>").addClass("button fullscreen iconed apply-common-tooltip").attr("title",$.t("Fullscreen mode")).append($(i(564)).attr({width:18,height:18})),this._e.click(function(){t.startFullscreen()}),$(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",function(){var e;["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement","msFullscreenElement"].forEach(function(t){if(!(t in document))return!1;e=!!document[t]}),null!=e&&(e?t._onStartFullscreen():t._onExitFullscreen())})}o.prototype.element=function(){return this._e},o.prototype.startFullscreen=function(){["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"].forEach(function(t){if("function"==typeof document.documentElement[t])return document.documentElement[t](),!0}),this._onStartFullscreen()},o.prototype._onStartFullscreen=function(){var t,i,o=this;e.enabled("side_toolbar_in_fullscreen_mode")?(t=$(".header-chart-panel"),t.hide()):(i=$("#chart-area"),i.addClass("fullscreen")),this._$exitButton||(this._$exitButton=$('<div class="tv-exit-fullscreen-button">'+$.t("Exit Full Screen (ESC)")+"</div>").on("click",this.exitFullscreen.bind(this)).appendTo(document.body)),$(window).resize(),$(document).off("keyup.toggleFullscreen").on("keyup.toggleFullscreen",function(t){27===t.keyCode&&o.exitFullscreen()})},o.prototype.exitFullscreen=function(){["exitFullscreen","mozCancelFullScreen","mozExitFullscreen","webkitExitFullscreen","msExitFullscreen"].forEach(function(t){if("function"==typeof document[t])return document[t](),!0}),this._onExitFullscreen()},o.prototype._onExitFullscreen=function(){var t,i;this._$exitButton&&($(".tv-exit-fullscreen-button").remove(),delete this._$exitButton),e.enabled("side_toolbar_in_fullscreen_mode")?(t=$(".header-chart-panel"),t.show()):(i=$("#chart-area"),i.removeClass("fullscreen")),$(window).resize(),$(document).off("keyup.toggleFullscreen")},t.exports=o}).call(e,i(1))},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586.09999 586.09996" width="586.1" height="586.1" enable-background="new 0 0 595.3 841.9"><path d="M172.6 367.9l-97.7 97.7L0 390.7v195.4h195.4l-74.9-74.9 97.7-97.7-45.6-45.6zM195.4 0H0v195.4l74.9-74.9 97.7 97.7 45.6-45.6-97.7-97.7L195.4 0zm195.3 0l74.9 74.9-97.7 97.7 45.6 45.6 97.7-97.7 74.9 74.9V0H390.7zm22.8 367.9l-45.6 45.6 97.7 97.7-74.9 74.9h195.4V390.7l-74.9 74.9-97.7-97.7z"/></svg>'},function(t,e,i){(function(e,o){"use strict";function n(t){var n=i(566);this._options=$.extend({interval:1},t||{}),this._e=$("<div>").addClass("intervals-container favored-list-container"),this._quick=$("<div>").addClass("quick").appendTo(this._e),this._quicked={},this._main=$('<span class="apply-common-tooltip">').text(this.shortLabel(this._options.interval)).attr("title",this.fullLabel(this._options.interval)).appendTo(this._quick),this._main.data("interval",this._options.interval),e.enabled("header_interval_dialog_button")&&this._setIntervalDialogButton(),this._mainSub=$("<span>").addClass("submenu").attr("title",$.t("Time Interval")).append($("<i>")).appendTo(this._e),t&&"string"==typeof t.submenuBtnAddClass&&this._mainSub.addClass(t.submenuBtnAddClass),this._quick.on("click",this._selectInterval.bind(this)),this._mainSub.on("click",this._selectMenu.bind(this)),this._menu=new n(this,this._mainSub,this._options),this.onResize=new o,r.intraday.subscribe(this._fullUpdate.bind(this)),r.supportedResolutions.subscribe(this._fullUpdate.bind(this)),t.interval&&r.interval.setValue(t.interval),r.interval.subscribe(this.activateInterval.bind(this),{callWithLast:!0}),TVXWindowEvents.on("intervalwidget-change",this._onChangeInAnotherTab.bind(this)),this._fullUpdate()}var s=i(93),r=i(278),a=i(110).translatedIntervalString;n.prototype.forceUpdate=function(){this._fullUpdate(!0)},n.prototype._fullUpdate=function(t){this._setupIntervals(t),this._setupQuicks(t),this.reactivateInterval(),this._resize()},n.prototype._onChangeInAnotherTab=function(){this._fullUpdate(!0)},n.prototype.isDefaultInterval=function(t){return t in ChartApiInstance.defaultResolutions()},n.getIntervals=function(){return TradingView.clone(ChartApiInstance.defaultResolutions())},n.prototype._setupIntervals=function(){this._intervals=n.getIntervals()},n.sortIntervals=function(t){Array.isArray(t)||(t=Object.keys(t));var e=function(t){var e=new s(t);return e.kind()!==s.MINUTES?{S:1/60,D:1440,W:10080,M:43200}[e.letter()]*e.multiplier():e.multiplier()};return t.sort(function(t,i){return e(t)-e(i)})},n.prototype.getSortedIntervals=function(){return n.sortIntervals(this._intervals)},n.prototype.setUpStarredItemsList=function(t){var e,i={};for(e=0;e<t.length;++e)i[t[e]]=!0;this._setupQuicks(!1,i)},n.prototype._setupQuicks=function(t,i){this._options.notShowQuicks&&!i||(i=i||{},e.enabled("star_some_intervals_by_default")&&(i={1:!0,30:!0,60:!0}),this._quicked=TVSettings.getJSON("IntervalWidget.quicks",i,t),this._quicked=this._removeCustomIntervalQuicks(this._quicked)),this._addQuicked(this._quicked)},n.prototype._removeCustomIntervalQuicks=function(t){var e={};return Object.keys(t).forEach(function(i){this.isDefaultInterval(i)&&(e[i]=t[i])},this),e},n.prototype.element=function(){return this._e},n.prototype.mainButton=function(){return this._main},n.prototype._quicks=function(){return this._quick.find("span").slice(0,-1)},n.prototype.postfix=function(t,e){if(e){var i=" ";switch(t){case"D":i+=$.t("day",{count:e});break;case"W":i+=$.t("week",{count:e});break;case"M":i+=$.t("month",{count:e});break;case"S":i+=$.t("second",{count:e});break;case"m":i+=$.t("minute",{count:e});break;case"h":i+=$.t("hour",{count:e})}return i}switch(t){case"m":return"";case"h":return $.t("h",{context:"dates"});default:return $.t(t.toUpperCase(),{count:0})}},n.prototype.readable=function(t,e,i){function o(t){return t>=60&&!(t%60)}var n,r;if(t=t,n="m",e=e,r=new s(t),!r.isValid())throw new TypeError("Wrong interval value: "+t);return r.kind()!==s.MINUTES&&(n=r.letter()),t=r.multiplier(),r.kind()===s.MINUTES&&o(t)&&(t=~~(t/60),n="h"),e=e?t:null,""+(t=i&&1===t&&r.isDWM()?"":t)+this.postfix(n,e)},n.prototype.shortLabel=function(t){return a(this.readable(t,!1))},n.prototype.fullLabel=function(t){return this.readable(t,!0)},n.prototype._addQuicked=function(t){var e,o,s,r,a,l,h,c;for(t=n.sortIntervals(t),e=this._quicks(),o=$(),s=!1,e.size()>t.length&&(e.slice(t.length).remove(),s=!0),r=i(335),a=0;a<t.length;a++)l=t[a],h=e.eq(a),c=!1,h.size()?h.data("interval")!==l&&(c=!0):(h=$('<span class="apply-common-tooltip">'),o=o.add(h),c=!0),c&&(h.data("interval",l).attr("title",this.fullLabel(l)).text(this.shortLabel(l)),s=!0),h.toggleClass("selected",l===this.getInterval()).toggleClass("disabled",!r.isAvailable(l));this._main.before(o),s&&this._resize()},n.prototype._resize=function(){this.onResize.fire()},n.prototype.addQuick=function(t){this._quicked[t]=!0,this._addQuicked(this._quicked),this.saveSettings(),this.reactivateInterval()},n.prototype._quickWithInterval=function(t){var e=null;return this._quicks().each(function(i,o){if(o=$(o),t===o.data("interval"))return e=o,!1}),e},n.prototype.inQuick=function(t){return null!=this._quickWithInterval(t)},n.prototype.removeQuick=function(t){this._quickWithInterval(t)&&(this._quickWithInterval(t).remove(),this._resize(),delete this._quicked[t],this.saveSettings(),this.reactivateInterval())},n.prototype.toggleQuick=function(t){var e=this.inQuick(t);return e?this.removeQuick(t):this.addQuick(t),!e},n.prototype.hasQuicks=function(){return!!this._quicks().length},n.prototype.deactivate=function(t){this._quick.find("span").removeClass("selected")},n.prototype.activateInterval=function(t){this.deactivate(),this.inQuick(t)?this._quickWithInterval(t).addClass("selected"):(this.hasQuicks()&&this._main.addClass("selected"),this._main.data("interval")!==t&&(this._main.text(this.shortLabel(t)),this._main.attr("title",this.fullLabel(t)),this._main.data("interval",t),this._resize()))},n.prototype.reactivateInterval=function(){this.activateInterval(this.getInterval())},n.prototype.getInterval=function(){return r.interval.value()},n.prototype.setInterval=function(t){r.interval.setValue(""+t)},n.prototype._selectInterval=function(t){var e=$(t.target),i=e.data("interval");this.hasQuicks()||this.getInterval()!==i?e.hasClass("disabled")||this.setInterval(i):this._selectMenu()},n.prototype._selectMenu=function(t){this._mainSub.hasClass("active")?this._menu.close():this._menu.open(this.getSortedIntervals())},n.prototype._setIntervalDialogButton=function(){var t=i(339);this._intervalDialogButton=$("<span>").addClass("submenu interval-dialog-button apply-common-tooltip").attr("title",$.t("Open Interval Dialog")).append($("<i>")).appendTo(this._e).click(function(){var e=new t({callback:function(t){r.interval.setValue(t)}}).show(),i=$(this);i.addClass("active"),e.on("destroy",function(){i.removeClass("active")})})},n.prototype.addInterval=function(t){},n.prototype.removeInterval=function(t){},n.prototype.saveIntervals=function(){},n.prototype.saveQuicked=function(){TVSettings.setJSON("IntervalWidget.quicks",this._quicked)},n.prototype.saveSettings=function(){this.saveQuicked(),this.saveIntervals(),TVXWindowEvents.emit("intervalwidget-change")},t.exports=n}).call(e,i(1),i(34))},function(t,e,i){"use strict";function o(t,e,i){this._options=i||{},this._w=t,this._opener=e,this._addMetric=1,this._addOpened=!1}var n=i(93),s=i(335),r=i(183).bindPopupMenu,a=i(1);i(70),o.prototype._interval=function(t){var e=$(t.target);e.hasClass("disabled")||(this._w.setInterval(e.data("interval")),this.close())},o.prototype._quickTitle=function(t){return t?$.t("Remove from favorites"):$.t("Add to favorites")},o.prototype._onQuick=function(t){var e=$(t.target).closest(".item"),i=this._w.toggleQuick(e.data("interval"));return e.toggleClass("quicked",i),$(t.target).closest(".to-quick").attr("title",this._quickTitle(i)),!1},o.prototype._onDelete=function(t){var e=$(t.target.parentNode);return this._w.removeInterval(e.data("interval")),this._reopen(),!1},o.prototype._showControlButtons=function(){return!0},o.prototype._append=function(t,e){var o=$("<span>").addClass("item").toggleClass("active",e===this._w.getInterval()).toggleClass("quicked",this._w.inQuick(e)).toggleClass("disabled",!s.isAvailable(e)).text(this._w.fullLabel(e)).data("interval",e);this._showControlButtons()&&(this._w.isDefaultInterval(e)||o.prepend($("<span>").addClass("delete").attr("title",$.t("Remove custom interval")).click(this._onDelete.bind(this))),this._w._options.notShowQuicks||o.prepend($("<span>").addClass("to-quick").append($(i(187)).attr({width:16,height:16})).attr("title",this._quickTitle(this._w.inQuick(e))).click(this._onQuick.bind(this)))),o.click(this._interval.bind(this)),t.append(o)},o.prototype._appendAdd=function(t){function e(){var t,e=parseInt(s.val());e<1&&s.val(1),t={1:1440,60:24,D:364,W:52,M:12}[this._addMetric],e>t&&s.val(t)}var i,o=$("<span>").addClass("item-add"),n=$('<span class="item-add-wrap">').appendTo(o),s=$('<input type="text">').addClass("tv-text-input inset minutes").val(1).appendTo(n).TVTicker(),a=$("<span>").addClass("_tv-button mins").append($("<span>")).append($("<i>")).appendTo(n),l=$("<span>").addClass("_tv-button add").text($.t("Add")).appendTo(n),h={1:$.t("minute_plural"),60:$.t("hour_plural"),D:$.t("day_plural"),W:$.t("week_plural"),M:$.t("month_plural")};a.find("span").text(h[this._addMetric||1]),s.change(e.bind(this)),i=this,r(a,null,{direction:"up",event:"button-popup",addClass:"thin small-font metrics",popupSpacing:~~this._w._options.popupSpacing,onRemove:function(){i._addOpened=!1}}),a.click(function(){i._addOpened=!0,a.trigger("button-popup",[$.map(h,function(t,o){return{title:t.toUpperCase(),active:o===i._addMetric,action:function(){return i._addMetric=o,a.find("span").text(t),e.call(i),!1}}})])}),l.click(function(){}),t.append($("<div>").addClass("separator")),t.append(o)},o.prototype._addInterval=function(t){this._w.addInterval(t),this._reopen({highlight:t})},o.prototype._open=function(t,e){var i,o,s,r,l;t.find(".item, .item-add, .separator").remove(),i=[],o=[],s=[],r=[],l=$("<span>").addClass("separator"),$.each(e,function(t,e){var a=new n(e);a.isDWM()?r.push(e):a.kind()===n.HOURS?s.push(e):a.kind()===n.MINUTES?o.push(e):i.push(e)}),i.length&&i.forEach(function(e){this._append(t,e)}.bind(this)),o.length&&(t.append(l.clone()),o.forEach(function(e){this._append(t,e)}.bind(this))),s.length&&(t.append(l.clone()),s.forEach(function(e){this._append(t,e)}.bind(this))),r.length&&(t.append(l.clone()),r.forEach(function(e){this._append(t,e)}.bind(this))),a.enabled("custom_resolutions_box")&&this._appendAdd(t)},o.prototype._reopen=function(t){if(this._open(this._menu,this._w.getSortedIntervals()),t&&t.highlight){var e=this._menu.find(".item").filter(function(){return $(this).data("interval")===t.highlight});e.length&&e.highlight(2)}},o.prototype.open=function(t){var e,i=this,o=$("<div>").addClass("charts-popup-list intervals-list favored-list").toggleClass("touch",Modernizr.touch),n=this._w.mainButton().offset(),s=this._w.mainButton().outerHeight(),r=n.top+s+parseInt(i._options.popupSpacing||0);o.appendTo(document.body),o.css({top:r,left:n.left}).show(),this._menu=o,this._opener.addClass("active"),this._open(o,t),e=Math.min($("body").height(),$(window).height())-s-r-10,this._setMaxHeight(o,e),setTimeout(function(){o.on("mousedownoutside",function(t){this.close(t)&&o.unbind("mousedownoutside")}.bind(this))}.bind(this),0)},o.prototype._setMaxHeight=function(t,e){t.height()>=e&&(t.css("max-height",e+"px"),t.width(t.width()+18))},o.prototype.close=function(t){return(!t||!$(t.target).parents("span.item-add, .charts-popup-list.metrics").length)&&(!(t&&$(t.target).hasClass("submenu")&&$(t.target).parents(".intervals-container").length)&&(this._menu.remove(),$(document.body).off(".interval-menu"),delete this._menu,this._opener.removeClass("active"),!0))},t.exports=o},function(t,e,i){(function(e,o,n){"use strict";function s(t,i,o){this.HIGHLIGHT_STUDY_NUM_FLICKS=2,this._BASIC_STUDIES_PACKAGE_NAME="tv-basicstudies",this._CUSTOM_STUDIES_PACKAGE_NAME="Script$USER",this._PUBLISHED_STUDIES_PACKAGE_NAME="Script$PUB",this._STANDARD_STUDIES_PACKAGE_NAME="Script$STD",this._SCRIPTING_PACKAGE_NAME="tv-scripting",this._FUNDAMENTAL_PACKAGE_NAME="Script$EDGR",this._BASIC_STUDIES_PAGE_NAME=e.enabled("plain_studymarket")?"Technical Analysis":"Built-ins",this._FUNDAMENTALS_PAGE_NAME=$.t("Fundamentals"),this._dialog=null,this._chartWidgetCollection=t,this._chart=t.activeChartWidget.value(),this._options=$.extend({},this.DEFAULT_OPTIONS,o||{}),this.concretizeOptions(),this._user=i,this.setup(),TVXWindowEvents.on("StudyFavoritesChanged",function(t){var e=JSON.parse(t),i=e.favorites||e,o=e.favoritesExtra||{};this._onExternalFavoritesChanged(i,o)}.bind(this)),this._backtestingEnabled=TradingView.isFeatureEnabled("backtesting")}var r,a,l,h=i(36),c=i(69).SidebarCustomScroll,d=i(139),p=i(67).createDialog,u=(i(560).createConfirmDialog,i(66).createNoticeDialog),_=i(552).createSearchControl,f=i(46),m=i(33),g=i(47),v=i(334),y=i(345).AddSymbolCheckbox,b=i(337),w=i(140).assert,S=i(353);i(568),i(569),i(358),r='<div class="tv-insert-indicator-dialog__body js-dialog__scroll-wrap"><div class="tv-insert-indicator-dialog__left-panel">{{^minimized}}<div id="js-search-placeholder"></div>{{/minimized}}<div class="tv-insert-indicator-dialog__left-panel-content-wrapper js-left-panel-wrapper"><div class="tv-insert-indicator-dialog__tabs-viewport js-tabs-viewport"><div class="tv-insert-indicator-dialog__tabs-container js-tabs-container"></div></div></div></div><div class="tv-insert-indicator-dialog__right-panel js-right-panel">{{#minimized}}{{#withSearch}}<div id="js-search-placeholder"></div>{{/withSearch}}{{/minimized}}<div class="tv-insert-indicator-dialog__pages js-pages"></div></div></div>',a='<div class="tv-insert-indicator-dialog__tabs-group"><div class="tv-insert-indicator-dialog__tab tv-insert-indicator-dialog__tab--group-head js-tab js-tab-head">{{title}}<span class="tv-caret"></span></div><div class="tv-insert-indicator-dialog__tabs"></div></div>',l='<div class="js-study-item tv-insert-study-item {{^withFavorites}}i-without-stars{{/withFavorites}}">{{#withFavorites}}<div class="tv-insert-study-item__favorite-icon js-favorite-icon"><span class="tv-insert-study-item__star tv-insert-study-item__star--filled">'+i(558)+'</span><span class="tv-insert-study-item__star tv-insert-study-item__star--empty">'+i(557)+'</span></div>{{/withFavorites}}<div class="tv-insert-study-item__title"><div class="tv-insert-study-item__title-text" title="{{titleTooltip}}">{{{title}}}</div></div></div>',s.prototype.setup=function(){this._initialized=!1,this._loadMore=null,this._$economyTabInput=null,this._$symbolSearchPopup=null,this._market=null,this._studies=null,this._packagesWithTabNames={},this._favs=[],this._favsExtra={},this._pages={},this._tabs={},this._subProductIds={},this.favsChanged=new o,this.visibilityChanged=new o,this.studiesReady=new $.Deferred,this.marketPagesReady=new $.Deferred,this._pubSearchCount=[0,0,0],this._pubSearchCanLoad=[!0,!0,!0],this._pubSearchEntries=[],this._pubSearchCache=[],this._pubSearchDfd=null,this._pubSearchPageShown=!1,this._w_market_tabs=null,this._w_technical_tabs=null},s.prototype.init=function(){if(this._initialized)return void this.getStudyInfo();this.setupMarketInfo(),this.getStudyInfo(),this.setUser(this._user),this.prepareLayout(),this.attachHandlers(),this._initialized=!0},s.prototype.DEFAULT_OPTIONS={onWidget:!1,hideMarketPages:!1,selectBasicPage:!0,minimized:!1,searchKeywords:{earning:RegExp("EPS"),earnings:RegExp("EPS"),"trailing twelve months":RegExp("TTM")}},s.prototype._FAV_KEY="studyMarket.favorites",s.prototype._FAV_EXTRA_KEY="studyMarket.favorites.extra",s.prototype._PAGE_KEY="studyMarket.page",s.prototype._ECONOMY_TAB="Economy & Symbols",s.prototype._PUB_SEARCH_ENTRIES_ON_PAGE=20,s.prototype.concretizeOptions=function(){e.enabled("study_market_minimized")&&(this._options.hideMarketPages=!0,this._options.selectBasicPage=!0,this._options.minimized=!0),this._options.onWidget&&(this._options.hideMarketPages=!0)},s.prototype.setupMarketInfo=function(){},s.prototype.getStudyInfo=function(){this._chart.withModel(this,function(){this.setupStudyInfo()})},s.prototype.setupStudyInfo=function(){var t=this._chartWidgetCollection.activeChartWidget.value().model().studiesMetaData();this._studies={},t=t.filter(function(t){return!this.isHidedStudy(t)},this),t.forEach(function(t){var e,i=this.getStudyPackageName(t);!("Script$EOTPRO"===i||this._options.minimized&&i!==this._BASIC_STUDIES_PACKAGE_NAME||this._options.onWidget&&d.isScriptStrategy(t))&&(e=this.resolvePackageName(i),w(void 0!==e,"Cannot resolve packageName "+i),this._studies[e]=this._studies[e]||[],this._studies[e].push(t))}.bind(this),this),this._studies_length!==t.length&&(this._studies_length=t.length,this.setUser(this._user)),this.studiesReady.resolve()},s.prototype.resolvePackageName=function(t){return t in this._subProductIds?this._subProductIds[t]:t},s.prototype.setUser=function(t){window.is_authenticated?this.setupUserData(t):this.setAnonymous()},s.prototype.setupUserData=function(t){this._user=t,this.loadFavorites(),this.updateMarketPages()},s.prototype.setAnonymous=function(){this.setupUserData(null),this.favsChanged.fire()},s.prototype.isHidedStudy=function(t){var e;return this._options.onWidget&&(e="IchimokuCloud@tv-basicstudies"===t.id),!!t.is_hidden_study&&!e},s.prototype.loadFavorites=function(){var t,e,i,o,n,s=m.getJSON(this._FAV_KEY,[]);for(s=s.favorites||s,t=[],e=0;e<s.length;e++)i=d.cutFullId(s[e]),t.indexOf(i)===-1&&t.push(i);for(this._favs=this._applyGlobalFilter(t),this._favsExtra=m.getJSON(this._FAV_EXTRA_KEY,{}),e=this._favs.length-1;e>=0;--e)i=this._favs[e],d.getPackageName(i)===this._SCRIPTING_PACKAGE_NAME&&(o=d.cutScriptIdPart(i),TVScript.pineType(o)===TVScript.PineType.UserSaved&&(d.hasUserIdSuffix(o)||window.user&&(n=i.replace("@tv-scripting",";"+window.user.id+"@tv-scripting"),this._favs.splice(e+1,0,n),this._favsExtra[i]&&(this._favsExtra[n]=this._favsExtra[i]))));this.favsChanged.fire()},s.prototype.saveFavorites=function(){m.setJSON(this._FAV_KEY,this._favs),m.setJSON(this._FAV_EXTRA_KEY,this._favsExtra)},s._breakpointDevice="phone-vertical",s.prototype._switchPagesContainer=function(t,e){this._options.minimized||(t===s._breakpointDevice?this._w_pages.detach().appendTo(this._widget.find(".js-left-panel-wrapper")):e===s._breakpointDevice&&this._w_pages.detach().appendTo(this._widget.find(".js-right-panel")))},s.prototype.prepareLayout=function(){var t,o=this;this._widget=$(n.render(r,{withSearch:e.enabled("study_dialog_search_control"),minimized:this._options.minimized})),this._w_tabs=this._widget.find(".js-tabs-container"),this._w_pages=this._widget.find(".js-pages"),this._loadMore=null,this.preparePages(),!this._options.selectBasicPage||this._options.fundamentalsOnly||g.device===s._breakpointDevice&&!this._options.minimized?this._options.fundamentalsOnly&&(g.device!==s._breakpointDevice||this._options.minimized)?this.selectPage(this._FUNDAMENTALS_PAGE_NAME):g.device===s._breakpointDevice&&this.selectPage(""):this.selectPage(this._BASIC_STUDIES_PAGE_NAME),this._scroll=new c(this._widget.find(".js-tabs-viewport"),this._w_tabs,{showBottomShadow:!1}),this._w_pages.scroll(function(){var t,e;o._loadMore&&(t=$.map(o._w_pages.children(":visible"),function(t){return $(t).outerHeight(!0)}).reduce(function(t,e){return t+e},0),e=o._widget.find(".js-right-panel").height(),t>e&&t-o._w_pages.scrollTop()===e&&o._loadMore())}),t='<div class="tv-dialog__section tv-dialog__section--title js-dialog__drag tv-insert-indicator-dialog__title-container js-title-container"><div class="tv-insert-indicator-dialog__back-button js-back-button js-dialog__no-drag">'+i(324)+'</div><div class="js-title-text tv-dialog__title tv-insert-indicator-dialog__title-text">{{{ title }}}</div></div>',this._dialog=p({title:" ",titleTemplate:t,contentWrapTemplate:this._widget,addClass:"tv-insert-indicator-dialog "+(this._options.minimized?"i-minimized":""),width:this._options.minimized?490:842,height:580,withScroll:!1,focusFirstControl:!1,closeOnClickAtOtherDialogs:!1,isClickOutFn:function(t){var e=S.instance();if(e)return e.isEventOut(t);if(this._$symbolSearchPopup)return this._$symbolSearchPopup[0]!==t.target&&!this._$symbolSearchPopup[0].contains(t.target)&&void 0}.bind(this)}),this._dialog.on("afterClose",this._onDialogClosed.bind(this)),this._dialog.$title.find(".js-back-button").on(Modernizr.touch?"touchend":"click",this.selectPage.bind(this,"")),g.on("changeDevice",function(t,e){t===s._breakpointDevice&&this.currentPage()&&this.currentPage().hasClass("js-marketplace-page")&&this.selectPage(""),t===s._breakpointDevice&&(this._scroll.scrollToStart(),this._updateDialogTitleText()),this._switchPagesContainer(t,e)}.bind(this)),this._switchPagesContainer(g.device,""),this._showHideBackButton(),this.hide()},s.prototype._updateDialogTitleText=function(){var t,e,i;if(this._dialog){if(t=""!==this._currentPageTitle,e=g.device!==s._breakpointDevice,!t||e||this._options.minimized)return void this._dialog.setTitleText(this._dialogTitleText);i=this.currentPage(),this._dialog.setTitleText(i.data("fullTitle"))}},s.prototype.currentPage=function(){return this._pages[this._currentPageTitle]},s.prototype.preparePages=function(){this.addSearchPage(),e.enabled("items_favoriting")&&this.addFavoritesPage(),this._options.fundamentalsOnly||this.prepareBasicPage(),this._options.fundamentalsOnly||this.addEconomyPage()},s.prototype.addEconomyPage=function(){var t,e,i=this.addPage(this._ECONOMY_TAB,{withoutTopPadding:!0,noFlex:!0}),o=_({withoutControls:!0,placeholder:$.t("Symbol"),addClass:"tv-insert-indicator-dialog__economy"});this._$economyTabInput=o.$input,t=new y({labelRight:$.t("Overlay the main chart")}),this._symbolSearch=v.bindToInput(this._$economyTabInput,{keepFocus:!0,clearAfterAccept:!0,callback:function(e){var i=this._chartWidgetCollection.activeChartWidget.value();i&&i.addSymbol(e,t.checked)}.bind(this),onPopupOpen:function(t){this._$symbolSearchPopup=t,this._$symbolSearchPopup.css("z-index",this._dialog.zIndex)}.bind(this),onPopupClose:function(){this._$symbolSearchPopup=null}.bind(this)}),i.append(o.$control),e=$('<div class="tv-insert-indicator-dialog__economy-content">'),e.append(t.$el),i.append(e)},s.prototype.addFavoritesPage=function(){this.addPage("Favorites",{})},s.prototype.prepareBasicPage=function(){var t=this.addPage(this._BASIC_STUDIES_PAGE_NAME,{packageName:this._BASIC_STUDIES_PACKAGE_NAME,technical:!e.enabled("plain_studymarket")});this._basicPage=t,this.studiesReady.done(function(){this.resetBasicPage()}.bind(this))},s.prototype._applyGlobalFilter=function(t){return this._parentSource&&(t=t.filter(d.canBeChild)),t},s.prototype._applyStrategiesFilter=function(t){if(!this._backtestingEnabled)return t;var e=this._parentSource?"not_strategies":"none";return"not_strategies"!==e&&"only_strategies"!==e||(t=t.filter(function(t){var i=d.isScriptStrategy(t);return"not_strategies"===e?!i:i})),t},s.prototype.resetBasicPage=function(){var t,e,i=this.getPage(this._BASIC_STUDIES_PAGE_NAME);this._studies&&(t=this._studies[this._BASIC_STUDIES_PACKAGE_NAME]||[],e=this._studies[this._STANDARD_STUDIES_PACKAGE_NAME]||[],t=t.concat(e),t=this._applyStrategiesFilter(t),t=this._applyGlobalFilter(t),this.preparePageStudies(i,t))},s.prototype.resetAllPages=function(){this.resetBasicPage(),this.resetCustomScriptPage(),this.resetPublishedScriptPage()},s.prototype.resetCustomScriptPage=function(){},s.prototype.resetPublishedScriptPage=function(){},s.prototype._createItemsList=function(){return $('<div class="tv-insert-indicator-dialog__items-list">')},s.prototype._createSubGroupItem=function(t){return $('<div class="tv-insert-study-item tv-insert-study-item--subgroup-header">').text(t)},s.prototype._createItemsGroup=function(t,e,i){var o,n=this._createItemsList();return this.fillStudies(n,t,i),o=$('<div class="tv-insert-indicator-dialog__subgroup">'),e.length&&o.append(this._createSubGroupItem(e)),o.append(n),o},s.prototype.addSearchPage=function(){var t,e,i=_({addClass:"tv-insert-indicator-dialog__search-control"});this._tabs.search=i.$control.data("title","search"),this._pages.search=$('<div class="tv-insert-indicator-dialog__page tv-insert-indicator-dialog__page--search">').data("title","search"),this._pages.search.data("fullTitle",$.t("Search")),t=null,this._search_value=null,this._search_input=i.$input,i.inputChangedDelegate.subscribe(null,function(){t&&clearTimeout(t),t=setTimeout(function(){t=null,this.search(this._search_input.val())}.bind(this),200)}.bind(this)),this._search_input.focus(function(){this.search(this._search_input.val())}.bind(this)),e=this._widget.find("#js-search-placeholder"),e.length&&e.parent()[0].replaceChild(this._tabs.search[0],e[0]),this._w_pages.prepend(this._pages.search)},s.prototype.search=function(t,i,o){function n(t,e,i,o,n,s){t.push(e),t[t.length-1].matchPriority=o,n&&(t[t.length-1].matchIndex=i.match(s).index)}var s,r,a,l,h,c=this;(this._search_value!==t||i)&&(s=this._pages.search,r=[],a=function(t){return t.replace(/[!-\/[-^{-}]/g,"\\$&")},""!==t&&(l=t.split("").map(function(t,e){var i=a(t);return 0!==e&&(i="[/\\s-]"+i),"("+i+")"}).join("(.*?)")+"(.*)",r.push({fullMatch:RegExp("("+a(t)+")","i"),re:RegExp("^"+l,"i"),reserveRe:RegExp(l,"i"),fuzzyHighlight:!0}),t.toLowerCase()in this.DEFAULT_OPTIONS.searchKeywords&&r.push({fullMatch:this.DEFAULT_OPTIONS.searchKeywords[t.toLowerCase()],re:this.DEFAULT_OPTIONS.searchKeywords[t.toLowerCase()],fuzzyHighlight:!1})),this._search_value=t,h=$.Deferred(),c._currentAsyncSearchDfd=h,e.enabled("plain_studymarket")?h.resolve([]):PublishedScript.suggest(t).done(function(t){var e=[];t&&t.results;h.resolve(e)}).fail(function(){h.resolve([])}),h.done(function(e){var i,o,a,l,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x;if(c._currentAsyncSearchDfd===h){for(i=Object.keys(c._studies),i.indexOf(c._PUBLISHED_STUDIES_PACKAGE_NAME)<0&&i.push(c._PUBLISHED_STUDIES_PACKAGE_NAME),i.sort(),o=[c._BASIC_STUDIES_PACKAGE_NAME,c._STANDARD_STUDIES_PACKAGE_NAME,c._PUBLISHED_STUDIES_PACKAGE_NAME,c._CUSTOM_STUDIES_PACKAGE_NAME],a=o.length;a--;)l=o[a],(d=i.indexOf(l))!==-1&&(i.splice(d,1),i.unshift(l));for(p={},u=0,_=0;_<i.length;_++){if(f=i[_],m=[],f===c._PUBLISHED_STUDIES_PACKAGE_NAME)m=e;else for(g=c._studies[f],a=0;a<g.length;a++)if(v=g[a],r.length)for(y=0;y<r.length;y++)b=r[y].re,b.lastIndex=0,w=r[y].fullMatch,S=v.shortDescription,S&&S.toLowerCase()===t.toLowerCase()?n(m,v,S,3,!0,w):S&&w.test(S)?n(m,v,S,2,!0,w):(S=v.description_localized||v.description||v.scriptName,w.test(S)?n(m,v,S,1,!0,w):b.test(S)&&n(m,v,S,0,!1,b));else m.push(v);if(m=c._applyGlobalFilter(m),m.length){switch(T=f,f){case c._BASIC_STUDIES_PACKAGE_NAME:case c._STANDARD_STUDIES_PACKAGE_NAME:T=c._BASIC_STUDIES_PAGE_NAME;break;case c._CUSTOM_STUDIES_PACKAGE_NAME:T=$.t("My Scripts");break;case c._PUBLISHED_STUDIES_PACKAGE_NAME:T=$.t("Public Library");break;default:f in c._packagesWithTabNames&&(T=c._packagesWithTabNames[T])}T in p||(p[T]=[]),p[T]=p[T].concat(m),u+=m.length}}for(s.html(""),C=Object.keys(p),a=0;a<C.length;++a)T=C[a],m=p[T],r.length&&Array.prototype.sort.call(m,function(t,e){if(t.matchPriority<e.matchPriority)return 1;if(t.matchPriority>e.matchPriority)return-1;if(t.matchPriority===e.matchPriority)switch(t.matchIndex){case void 0:return 0;default:return t.matchIndex>e.matchIndex?1:t.matchIndex<e.matchIndex?-1:0}}),x=this._createItemsGroup(m,this._options.minimized?"":$.t(T),r),s.append(x);0===u&&s.append('<p class="tv-insert-indicator-dialog__not-found-message">'+$.t("No indicators matched your criteria.")+"</p>")}}.bind(this))),o||this.selectPage("search")},s.prototype.updateSearchPage=function(){var t=this._search_input.val();this.search(t,!0,!0)},s.prototype.updateMarketPages=function(){},s.prototype.preparePageStudies=function(t,e,i,o){if(t){o||(e=this.sortStudies(e)),t.empty();var n=this._createItemsList();this.fillStudies(n,e,null),t.append(n)}},s.prototype.addPage=function(t,e){var i,o,n,s,r,a;return e=$.extend({},e),i=$.t(t),o=t.toLowerCase(),n=$('<div class="tv-insert-indicator-dialog__page">').data("title",o),s=$('<div class="tv-insert-indicator-dialog__tab js-tab"></div>').text(i).data("title",o).attr("title",i),r=e.technical?$.t("Technical Analysis")+": ":"",n.data("fullTitle",r+i),s.toggleClass("tv-insert-indicator-dialog__tab--beta",!!e.beta),e.packageName&&(this._packagesWithTabNames[e.packageName]=t),this._pages[o]=n,this._tabs[o]=s,e.withoutTopPadding&&n.addClass("tv-insert-indicator-dialog__page--without-top-padding"),e.noFlex&&n.addClass("tv-insert-indicator-dialog__page--no-flex"),e.technical||e.market?(a=e.technical?this._getOrCreateTechnicalTab():this._getOrCreateMarketTab(),a.find(".tv-insert-indicator-dialog__tabs").append(s),e.market&&n.addClass("js-marketplace-page")):this._w_market_tabs?s.insertBefore(this._w_market_tabs):this._w_tabs.append(s),this._w_pages.append(n),n.toggleClass("i-hidden",o!==this._currentPageTitle),n},s.prototype._createGroupTab=function(t,e){var i=$(n.render(a,{title:t}));return i.find(".js-tab-head").on("click",function(){this._expandCollapseTabs(i,e)}.bind(this)),this._expandCollapseTabs(i,e,m.getBool(e,!0),!0),i.data("settings-open-key",e),this._w_tabs.append(i),i},s.prototype._getOrCreateMarketTab=function(){return this._w_market_tabs||(this._w_market_tabs=this._createGroupTab($.t("Marketplace Add-ons"),"studyMarket.marketTabIsOpen"),this._w_market_tabs.addClass("tv-insert-indicator-dialog__tabs-group--marketplace")),this._w_market_tabs},s.prototype._getOrCreateTechnicalTab=function(){return this._w_technical_tabs||(this._w_technical_tabs=this._createGroupTab($.t("Technical Analysis"),"studyMarket.technicalTabIsOpen")),this._w_technical_tabs},s.prototype._onDialogClosed=function(){this.visibilityChanged.fire(!1),b.removeListener("StudyMarket")},s.prototype.hide=function(){this._dialog.close()},s.prototype.show=function(t){var i,o;this.init(),i=!1,o=t instanceof TradingView.Study&&t||null,o!==this._parentSource&&(this._parentSource=o,this._dialogTitleText=this._parentSource?$.t("Apply Indicator on {0}").format(this._parentSource.title(!0)):$.t("Indicators"),i=!0),this._updateDialogTitleText(),this._widget.on("keyup.hideDialogStudy",function(t){27===t.which&&(this._widget.unbind("keyup.hideDialogStudy"),this.hide())}.bind(this)),this._clearInput(),this.loadFavorites(),i&&this.resetAllPages(),this._scroll.scrollTo(0),this.visibilityChanged.fire(!0),this.focusAddSymbolInput(this._currentPageTitle),b.registerListener("StudyMarket",function(t){return!t.ctrlKey&&(47!==t.which&&(t.which&&13===t.which?(t.target===this._search_input.get(0)&&this._insertStudyByShortDescription(),!0):!!t.charCode&&(!(!t.which||t.which<=32)&&(!/^(input|textarea)$/i.test(t.target.tagName)&&(t.preventDefault(),!!(TradingView.onWidget()||this._options.minimized&&!e.enabled("study_dialog_search_control"))||(this._search_input.focus(),this._search_input[0].value=String.fromCharCode(t.charCode),!0))))))}.bind(this)),this._dialog.open()},s.prototype.isVisible=function(){return!!this._initialized&&this._widget.is(":visible")},s.prototype.getPage=function(t){return t=t.toLowerCase(),this._pages[t]},s.prototype.focusAddSymbolInput=function(t){t===this._ECONOMY_TAB.toLowerCase()&&this._$economyTabInput&&this._$economyTabInput.focus()},s.prototype._showHideBackButton=function(){if(this._dialog&&!this._options.minimized){var t=""!==this._currentPageTitle;this._dialog.$el.find(".js-title-container").toggleClass("i-with-back-button",t)}},s.prototype.selectPage=function(t){var e,i,o,n,s,r;if(t=t.toLowerCase(),this.focusAddSymbolInput(t),this._currentPageTitle!==t)if(""===t||t in this._pages&&t in this._tabs&&("favorites"!==t||this.hasVisibleFavorites())){for(e in this._pages)if(i=t===e,o=this._pages[e],o.toggleClass("i-hidden",!i),this._tabs[e].toggleClass("i-active",i),i){if(o.trigger("show-page"),n=this._tabs[e].parents(".tv-insert-indicator-dialog__tabs-group"),0===n.length)continue;s=n.find(".js-tab-head"),this._expandCollapseTabs(n,s.data("settings-open-key"),!0,!0)}this._currentPageTitle=t,this._w_pages.scrollTop(0),m.setValue(this._PAGE_KEY,t),r=""!==this._currentPageTitle,this._widget.find(".js-tabs-viewport").toggleClass("i-active",!r),this._w_pages.toggleClass("i-active",r),this._showHideBackButton(),r||this._search_input.blur(),this._updateDialogTitleText()}else this.selectPage(this._BASIC_STUDIES_PAGE_NAME)},s.prototype.attachHandlers=function(){var t=Modernizr.touch?"touchend":"click",i=this;Modernizr.touch&&this._w_pages.on("touchstart",".js-study-item",function(t){i._touchStart=$.extend({},t.originalEvent.touches[0])}),this._w_tabs.on("click",".js-tab",this._onTabClicked.bind(this)),e.enabled("items_favoriting")&&(this._w_pages.on(t,".js-favorite-icon",this.toggleItem.bind(this)),this.favsChanged.subscribe(this,this.updateFavorites)),this._w_pages.on(t,".js-study-item",function(t){var e;i._touchStart&&(e=i._w_pages.find(".tv-insert-study-item")[0].clientHeight,Math.abs(i._touchStart.screenY-t.originalEvent.changedTouches[0].screenY)>e)||i.insertThisStudy.call(i,t)}),loginStateChange.subscribe(this,this.onLoginStateChange),this._w_pages.on("click",".js-offer-screenshots",function(t){t.currentTarget.getAttribute("data-fancybox-inited")||(t.currentTarget.setAttribute("data-fancybox-inited",!0),$(this).find("a").fancybox({type:"image",live:!1,afterShow:function(){$(".fancybox-overlay").on("click",function(t){t.stopPropagation()})}}),setTimeout(function(){$(t.target).click()},0)),t.preventDefault()})},s.prototype._onTabClicked=function(t){var e=$(t.currentTarget).data("title");e&&"search"!==e&&this.selectPage(e),t.stopPropagation()},s.prototype._expandCollapseTabs=function(t,e,i,o){var n,s=t.hasClass("i-dropped");if(void 0===i)i=!t.hasClass("i-dropped");else if(s===i&&!o)return;if(n=t.find(".tv-insert-indicator-dialog__tabs"),t.toggleClass("i-dropped",!!i),o)return void n.toggleClass("i-hidden",!i);n.removeClass("i-hidden"),n.velocity(i?"slideDown":"slideUp",{duration:f.dur/2,complete:function(){m.setValue(e,i),this._scroll.updateScroll()}.bind(this)})},s.prototype.toggleItem=function(t){var e=$(t.target).closest(".js-study-item").data("study");return this.toggleFavorite(e.id),this.toggleEverywhere(e.id),!1},s.prototype.toggleEverywhere=function(t){var e=this.isFavorite(t);this._w_pages.find(".js-study-item").filter(function(e,i){var o=$(i).data("study");return!!o&&d.cutFullId(o.id)===t}).find(".js-favorite-icon").toggleClass("i-starred",e).attr("title",this.favTitle(e))},s.prototype.toggleFavorite=function(t){this.isFavorite(t)?this.removeFavorite(t):this.addFavorite(t)},s.prototype.isFavorite=function(t){var t=d.cutFullId(t);return this._favs.indexOf(t)!==-1},s.prototype.addFavorite=function(t){return t=d.cutFullId(t),!this.isFavorite(t)&&(this._favs.push(t),this.saveFavorites(),TVXWindowEvents.emit("StudyFavoritesChanged",JSON.stringify({favorites:this._favs,favoritesExtra:this._favsExtra})),this.favsChanged.fire(),!0)},s.prototype.removeFavorite=function(t){return t=d.cutFullId(t),!!this.isFavorite(t)&&(this._favs.splice(this._favs.indexOf(t),1),this.saveFavorites(),TVXWindowEvents.emit("StudyFavoritesChanged",JSON.stringify({favorites:this._favs,favoritesExtra:this._favsExtra})),this.favsChanged.fire(),!0)},s.prototype.updateFavorites=function(){var t,e,i,o,n,r,a,l,h,c=this.getVisibleFavorites();if(0===c.length)return"favorites"===this._currentPageTitle&&this.selectPage(g.device===s._breakpointDevice?"":this._BASIC_STUDIES_PAGE_NAME),this._w_pages.find(".js-favorite-icon").removeClass("i-starred"),void this._tabs.favorites.hide();for(t=$.Deferred(),e=[],i=[],o=0;o<c.length;o++)if(n=c[o],(r=this.getStudyPackageName({id:n}))!==this._PUBLISHED_STUDIES_PACKAGE_NAME){for(l=this._studies[r]||[],h=0;h<l.length;h++)if(d.cutFullId(l[h].id)===n){e.push(l[h]);break}}else(a=(/^Script\$([^@]+)/.exec(n)||0)[1])&&i.push(a);i.length&&!this._options.minimized||t.resolve(e),t.done(function(t){t=this._applyStrategiesFilter(t),this.preparePageStudies(this._pages.favorites,t),this._w_pages.find(".js-study-item").find(".js-favorite-icon").removeClass("i-starred"),c.forEach(this.toggleEverywhere,this)}.bind(this)),this._tabs.favorites.show()},s.prototype.hasFavorites=function(){return!!this._favs.length},s.prototype.hasVisibleFavorites=function(){return!!this.getVisibleFavorites().length},s.prototype.getVisibleFavorites=function(){return this.checkExcludePackageStudies(this._favs)},s.prototype.checkExcludePackageStudies=function(t){return t.filter(function(t){var e=this.getStudyPackageName({id:t});return e===this._PUBLISHED_STUDIES_PACKAGE_NAME||!!(this._studies&&this._studies[e]&&$.grep(this._studies[e],function(e){return t===e.id}).length>0)&&(e===this._BASIC_STUDIES_PACKAGE_NAME||e===this._STANDARD_STUDIES_PACKAGE_NAME||e===this._CUSTOM_STUDIES_PACKAGE_NAME||e===this._SCRIPTING_PACKAGE_NAME||e===this._FUNDAMENTAL_PACKAGE_NAME||pro.hasPackage(e)&&e in this._studies)},this)},s.prototype.sortStudies=function(t){return t.sort(function(t,e){return t=t.scriptName||t.description_localized||t.description,e=e.scriptName||e.description_localized||e.description,t>e?1:t<e?-1:0})},s.prototype.fillStudies=function(t,e,i){var o;t.empty(),e.forEach(function(e){e?o=this.createStudyListItem(e,i):(o=document.createElement("div"),o.className="placeholder"),t.append(o)},this)},s.prototype.createStudyListItem=function(t,i){var o,s,r,a,h,c,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I=t.description_localized||$.t(t.scriptName||t.description||" ",{context:"study"}),E=this.isFavorite(t.id),A=[];if(i&&I)for(o=[],i instanceof RegExp?o.push({re:i,fuzzyHighlight:!1}):$.isArray(i)&&(o=i),s=0;s<o.length;s++)if(r=o[s].fullMatch,a=o[s].reserveRe,h=o[s].re,r.lastIndex=0,h.lastIndex=0,c=r.exec(I),c?o[s].fuzzyHighlight=!1:(c=h.exec(I),!c&&a&&(c=a.exec(I)),o[s].fuzzyHighlight=!0),c)if(o[s].fuzzyHighlight)for(p=c.index,u=1;u<c.length;u++)_=c[u].length,u%2&&(A[p]=!0),p+=_;else for(f=0;f<c[0].length;f++)A[c.index+f]=!0;return m=TradingView.clean(I,!0),g=m.replace(/./g,function(t,e){if("<"===t?t="&lt;":"&"===t?t="&amp;":'"'===t&&(t="&quot;"),A[e]){if(" "===t||"-"===t||"/"===t)return A[e+1]=!0,t;t='<span class="i-match">'+t+"</span>"}return t}),v=!!t.pine,y=this.getStudyPackageName(t),b=v&&y===this._PUBLISHED_STUDIES_PACKAGE_NAME,w=v&&y===this._CUSTOM_STUDIES_PACKAGE_NAME,S=v&&(y===this._STANDARD_STUDIES_PACKAGE_NAME||y===this._FUNDAMENTAL_PACKAGE_NAME),T=v&&[TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH,TVScript.Access.ACCESS_CLOSED_NO_AUTH].indexOf(t.pine.access)>=0,C=!!t.TVScriptSourceCode,x=this._favsExtra[t.id]&&this._favsExtra[t.id].isSourceCodeClosed,P=!TradingView.isMobileView&&v&&!S&&!T&&(w||b||C||E&&!x),L=$(n.render(l,{publishedOrUserScript:!TradingView.isMobileView&&(w||b),title:g,titleTooltip:TradingView.strip_tags(m),isStrategy:d.isScriptStrategy(t),author:t.author&&t.author.username,likes:t.agreeCount?t.agreeCount+" "+$.t("like",{count:t.agreeCount}):"",showMoreButton:!!t.imageUrl,deleteButton:!t.imageUrl&&w,withFavorites:e.enabled("items_favoriting")&&!this._options.minimized})),P||L.find(".js-show-source-btn").removeClass("js-show-source-btn").addClass("i-empty"),L.data("study",t),void 0!==t.isCustomIndicator&&L.addClass("custom-indicator"),e.enabled("items_favoriting")&&(k=L.find(".js-favorite-icon"),k.toggleClass("i-starred",!!E),k.attr("title",this.favTitle(!!E))),e.enabled("graying_disabled_tools_enabled")&&ChartApiInstance.studiesAccessController.isToolGrayed(t.description)&&L.addClass("i-grayed"),L},s.prototype.favTitle=function(t){return t?$.t("Remove from favorites"):$.t("Add to favorites")},s.prototype.insertThisStudy=function(t){var i,o=$(t.target).closest(".js-study-item");if(!o.hasClass("placeholder"))return i=o.data("study"),e.enabled("graying_disabled_tools_enabled")&&ChartApiInstance.studiesAccessController.isToolGrayed(i.description)?void h.emit("onGrayedObjectClicked",{type:"study",name:i.description}):(o.highlight(this.HIGHLIGHT_STUDY_NUM_FLICKS),this.insertStudy(i),!1)},s.prototype.insertStudy=function(t){var e,i,o=this._chartWidgetCollection.activeChartWidget.value();o&&(e=o.insertStudyStub(t.description),i=d.replaceWithFullStudyMetaInfoAsync(o.model().studiesMetaData(),t),i.done(function(t){var i;if(o.removeStudyStub(e.id())){if(this._parentSource&&!d.canBeChild(t))return i=u({type:"modal",title:$.t("Oops!"),content:$.t("This indicator cannot be applied to another indicator")}),void i.open();o.insertStudyOrShowDialog(t,this._parentSource),this._is_on_chart=!0}}.bind(this)),i.fail(function(t){TradingView.logError("Error: "+t),e.setStatus(t)}))},s.prototype.onLoginStateChange=function(t){t||this.setUser(window.user),this.resetAllPages(),this.setup()},s.prototype.getStudyList=function(t){function e(t){i.push(t)}var i,o;if(!this.studiesReady.isResolved())return[];i=[];for(o in this._studies)(o===this._BASIC_STUDIES_PACKAGE_NAME||pro.hasPackage(o))&&(this._studies[o].forEach(e),t&&i.push({separator:!0}));return t&&i.splice(i.length-1,1),i},s.prototype.getStudyPackageName=function(t){var e,i,o,n,s;if(t&&t.id)return(e=d.getPackageName(t.id))!==this._SCRIPTING_PACKAGE_NAME?e:(i=t.id.split("@"),o=i[0],0!==o.indexOf("Script$")&&0!==o.indexOf("StrategyScript$")?e:(n=o.indexOf("_"),n!==-1?(e=o.substring(0,n),s=pro.getSuperProduct(e),s?s:e):/^(Strategy|)Script\$USER;/.test(o)?"Script$USER":/^(Strategy|)Script\$PUB;/.test(o)?"Script$PUB":/^(Strategy|)Script\$STD;/.test(o)?this._STANDARD_STUDIES_PACKAGE_NAME:o))},s.prototype.studyIsUserTVScript=function(t){if(t&&t.id)return"Script$USER"===this.getStudyPackageName(t)},s.prototype.studyIsPublishedScript=function(t){if(t&&t.id)return"Script$PUB"===this.getStudyPackageName(t)},s.prototype.selectSearchPage=function(){this.selectPage("search"),this._clearInput()},s.prototype._insertStudyByShortDescription=function(){var t,e,i,o=this._search_value;for(o=o.trim(),t=this._studies[this._BASIC_STUDIES_PACKAGE_NAME],e=0;e<t.length;e++)if(i=t[e],i.shortDescription&&i.shortDescription.toUpperCase()===o.toUpperCase()){this.insertStudy(i);break}},s.prototype._clearInput=function(){this._search_input.val(""),"search"===this._currentPageTitle&&this._search_input.val("").trigger("input").focus()},s.prototype._getScriptType=function(){return 0},s.prototype._pubSearchEntryAlreadyLoaded=function(t){var e=t.scriptIdPart.split(";")[1];return!(this._pubSearchCache.indexOf(e)<0)||(this._pubSearchCache.push(e),!1)},s.prototype._addPubSearchResult=function(t,e){t.length&&(t.forEach(function(t){this._pubSearchEntryAlreadyLoaded(t)||(this._pubSearchEntries.push(t),this._pubSearchCount[t.scriptType]++)},this),0===e&&(this._pubSearchCount[0]+=t.length),this._pubSearchEntries.sort(function(t,e){return e.agreeCount-t.agreeCount}))},s.prototype._getPublicLibraryRequestParams=function(t){var e=this._pubSearchCount[t],i=this._PUB_SEARCH_ENTRIES_ON_PAGE;return e<this._PUB_SEARCH_ENTRIES_ON_PAGE&&(i=this._PUB_SEARCH_ENTRIES_ON_PAGE-e),{offset:e,count:i,type:t}},s.prototype._onExternalFavoritesChanged=function(t,e){var i,o,n=[];for(i=0;i<t.length;i++)o=d.cutFullId(t[i]),n.indexOf(o)===-1&&n.push(o);this._favs=n,this._favsExtra=e,this.saveFavorites(),this.favsChanged.fire()},t.exports=s}).call(e,i(1),i(34),i(52))},function(t,e){},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 11.5"><path d="M7.5 4.8c-1.1 0-1.9.9-1.9 1.9s.9 1.9 1.9 1.9c1.1 0 1.9-.9 1.9-1.9s-.9-1.9-1.9-1.9zM13 1.9h-2.2c0-1-.9-1.9-2-1.9H6.1C5 0 4.2.9 4.2 1.9H1.9c-1 0-1.9.9-1.9 2v5.7c0 1.1.9 1.9 1.9 1.9H13c1.1 0 1.9-.9 1.9-1.9V3.9c.1-1.1-.8-2-1.9-2zm-5.5 8.3C5.6 10.2 4 8.6 4 6.7s1.5-3.4 3.4-3.4 3.4 1.5 3.4 3.4c.1 1.9-1.4 3.5-3.3 3.5z"/></svg>'},function(t,e,i){(function(e,o){"use strict";function n(t){function i(){var t=P.last();L.toolsGroupsHeight=t.offset().top+t.outerHeight(),$(window).resize()}var r,a,h,c,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L=this;t=t||{},this.options=t,l.init(),r=this._container=t.container,this._chartWidgetCollection=t.chartWidgetCollection,this._container.on("contextmenu",function(t){t.preventDefault()}),this._allToolGroups=[],this._toolsFilter=new n.ModernToolsFilter(t.drawingsAccess||{type:"black",tools:[]}),t.readOnly||(a=$("<div>").addClass("tools-group no-delimiter").appendTo(r),this._main=a,this.appendToolsGroup([{tool:"cursor"},{tool:"dot"},{tool:"arrow"},{tool:"eraser"}]),this.appendToolsGroup([{tool:"LineToolTrendLine"},{tool:"LineToolTrendAngle"},{tool:"LineToolHorzLine",shortcut:{keys:"Alt+H",immediately:!0}},{tool:"LineToolHorzRay"},{tool:"LineToolVertLine",shortcut:{keys:"Alt+V",immediately:!0}},{tool:"LineToolArrow"},{tool:"LineToolRay"},{tool:"LineToolExtended"},{tool:"LineToolParallelChannel"},{tool:"LineToolDisjointAngle"},{tool:"LineToolFlatBottom"}]),this.appendToolsGroup([{tool:"LineToolPitchfork"},{tool:"LineToolSchiffPitchfork2"},{tool:"LineToolSchiffPitchfork"},{tool:"LineToolInsidePitchfork"},{tool:"LineToolPitchfan"},{tool:"LineToolGannSquare"},{tool:"LineToolGannComplex"},{tool:"LineToolGannFan"},{tool:"LineToolFibRetracement"},{tool:"LineToolTrendBasedFibExtension"},{tool:"LineToolFibSpeedResistanceFan"},{tool:"LineToolFibTimeZone"},{tool:"LineToolTrendBasedFibTime"},{tool:"LineToolFibCircles"},{tool:"LineToolFibSpiral"},{tool:"LineToolFibSpeedResistanceArcs"},{tool:"LineToolFibWedge"},{tool:"LineToolFibChannel"}]),this.appendToolsGroup([{tool:"LineToolBrush"},{tool:"LineToolRectangle"},{tool:"LineToolRotatedRectangle"},{tool:"LineToolEllipse"},{tool:"LineToolTriangle"},{tool:"LineToolPolyline"},{tool:"LineToolBezierQuadro"},{tool:"LineToolBezierCubic"},{tool:"LineToolArc"}]),this.appendToolsGroup([{tool:"LineToolText"},{tool:"LineToolTextAbsolute"},{tool:"LineToolNote"},{tool:"LineToolNoteAbsolute"},{tool:"LineToolCallout"},{tool:"LineToolBalloon"},{tool:"LineToolPriceLabel"},{tool:"LineToolArrowMarkLeft"},{tool:"LineToolArrowMarkRight"},{tool:"LineToolArrowMarkUp"},{tool:"LineToolArrowMarkDown"},{tool:"LineToolFlagMark"}]),this.appendToolsGroup([{tool:"LineTool5PointsPattern"},{tool:"LineToolCypherPattern"},{tool:"LineToolABCD"},{tool:"LineToolTrianglePattern"},{tool:"LineToolThreeDrivers"},{tool:"LineToolHeadAndShoulders"},{tool:"LineToolElliottImpulse"},{tool:"LineToolElliottTriangle"},{tool:"LineToolElliottTripleCombo"},{tool:"LineToolElliottCorrection"},{tool:"LineToolElliottDoubleCombo"},{tool:"LineToolCircleLines"},{tool:"LineToolTimeCycles"},{tool:"LineToolSineLine"}]),this.appendToolsGroup([{tool:"LineToolRiskRewardLong"},{tool:"LineToolRiskRewardShort"},{tool:"LineToolPrediction"},{tool:"LineToolDateRange"},{tool:"LineToolPriceRange"},{tool:"LineToolDateAndPriceRange"},{tool:"LineToolBarsPattern"},{tool:"LineToolGhostFeed"},{tool:"LineToolProjection"}]),this._toolsFilter.isToolEnabled("Font Icons")&&(h=new this.Button(this.createIconActions(),{addClass:"font-awesome line-tool-icons-popup",buttonClass:"font-awesome"},!0),this._icons=h,a.append(h.element()),this._allToolGroups.push(h)),TradingView.isMobileView||(c=$("<div>").addClass("tools-group").appendTo(r),p=new this.Button({tool:"zoom",action:function(){l.tool.setValue("zoom")}}),c.append(p.element()),this._allToolGroups.push(p),L._chartWidgetCollection&&(u=new this.Button({tool:"zoom-out",action:function(){var t,e=L._chartWidgetCollection;e&&(t=e.activeChartWidget.value().model())&&t.zoomFromViewport()}}),c.append(u.element()),u.element().addClass("js-hidden"),function(){function t(){var i=L._chartWidgetCollection.activeChartWidget.value(),o=i.model(),n=!1;o?(e!==o&&(e&&e.zoomStack().onChange().unsubscribe(null,t),o.zoomStack().onChange().subscribe(null,t),e=o),n=!o.zoomStack().isEmpty()):i.withModel(null,t),u.element().toggleClass("js-hidden",!n)}var e=null;L._chartWidgetCollection.activeChartWidget.subscribe(t,{callWithLast:!0})}()),_=new this.Button({tool:"measure",action:function(){l.tool.setValue("measure")}}),c.append(_.element()),this._allToolGroups.push(_)),f=$("<div>").addClass("tools-group").appendTo(r),m=!!l.properties().magnet.value(),g=new this.Button({tool:"magnet",action:this.ToolbarActions.magnet.bind(this)}),this.magnet=g,f.append(g.element()),g.activate(m),l.properties().magnet.subscribe(this,function(t){g.activate(t.value())}),(!t.onWidget&&!TradingView.isMobileView||e.enabled("charting_library_base"))&&(m=!!l.properties().stayInDrawingMode.value(),v=new this.Button({tool:"drawginmode",action:this.ToolbarActions.drawingmode.bind(this)}),this.drawingmode=v,f.append(v.element()),v.activate(m),l.properties().stayInDrawingMode.subscribe(this,function(t){v.activate(t.value())}),m=!!l.lockDrawings().value(),y=new this.Button({tool:"lockAllDrawings",action:this.ToolbarActions.lockDrawings.bind(this)}),this.lockDrawings=y,f.append(y.element()),y.activate(m),l.lockDrawings().subscribe(this,function(t){y.activate(t.value())}),m=!!l.hideAllDrawings().value(),b=new this.Button({tool:"hideAllDrawings",action:this.ToolbarActions.hideAllDrawings.bind(this)}),this.hideAllDrawings=b,f.append(b.element()),b.activate(m),l.hideAllDrawings().subscribe(this,function(t){b.activate(t.value())}),e.enabled("support_multicharts")&&(m=!!l.drawOnAllCharts().value(),w=new this.Button({tool:"SyncDrawing",action:this.ToolbarActions.drawAllCharts.bind(this)}),this.drawOnAllCharts=w,f.append(w.element()),w.activate(m),l.drawOnAllCharts().subscribe(this,function(t){w.activate(t.value())})),S=$("<div>").addClass("tools-group").appendTo(r),this.removeAndObjectsTreeTools=S,T=new this.Button({tool:"showObjectsTree",action:this.ToolbarActions.showObjectsTree.bind(this)}),this.showObjectsTree=T,S.append(T.element()),C=new this.Button({tool:"removeAllDrawingTools",action:this.ToolbarActions.removeTools.bind(this)}),this.removeTools=C,S.append(C.element()),x=$("<div>").addClass("tools-group no-delimiter").appendTo(r),this.responsiveToolbar=new this.ResponsiveToolbar(this),x.append(this.responsiveToolbar.getButton().element())),t.onWidget||(this._favoriteDrawingToolbar=new s({top:window.headerChartPanel.outerHeight()+61,left:window.innerWidth/2}),this._favoriteDrawingToolbar.onButtonClicked().subscribe(null,function(t){this._onLinetoolButtonClicked(t,!0)}.bind(this)))),t.readOnly||l.tool.subscribe(function(t){this._syncView(t)}.bind(this),{callWithLast:!0}),$(document).bind("keydown","esc",function(){l.resetToCursor(!0)}),this._twoColumnLayout=!1,(!t.onWidget&&!TradingView.isMobileView||e.enabled("charting_library_base"))&&(P=r.find(".tools-group"),window.loaded?i():$(window).load(i),$(window).on("resize",this.updateToolsVisibility.bind(this))),this.visible=new o,this.visible.subscribe(this,function(t){this._fold(!t.value()),this.$panelClose&&this.$panelClose.prop("title",this.getVisibilityChangeText(t.value())),TVSettings.setValue("ChartSideToolbarWidget.visible",t.value())}),this.visible.setValue("boolean"==typeof t.forceVisible?t.forceVisible:TVSettings.getBool("ChartSideToolbarWidget.visible",!0)),this.$panelClose=$('<a href="#" class="tv-close-panel left" title="'+this.getVisibilityChangeText(this.visible.value())+'"></a>'),this.$panelClose.on("click",function(t){var e,i=this.activeChartWidget().model();i&&(e=this.visible.value(),this.$panelClose.prop("title",this.getVisibilityChangeText(!e)),i.setProperty(this.visible,!e,this.getVisibilityChangeText(e)),d.emit("toggle_sidebar",!e),t.preventDefault())}.bind(this)).appendTo(r),t.onResize&&(this.onResize=t.onResize),$(window).on("resize",this.updateLayout.bind(this))}var s=i(572).FavoriteDrawingToolbar,r=i(209),a=i(101),l=i(92),h=i(426).lineToolsInfo,c=i(576).LinetoolsFavoritesStore,d=i(36),p=i(183).bindPopupMenu,u=i(91).saveDefaultProperties;n.prototype.updateToolsVisibility=function(){var t=$(window).height()<this.toolsGroupsHeight+10;t!==this._twoColumnLayout&&(this.magnet.element().toggleClass("js-hidden",t),this.drawingmode.element().toggleClass("js-hidden",t),this.lockDrawings.element().toggleClass("js-hidden",t),this.hideAllDrawings.element().toggleClass("js-hidden",t),this.drawOnAllCharts&&this.drawOnAllCharts.element().toggleClass("js-hidden",t),this.showObjectsTree.element().toggleClass("js-hidden",t),this.removeTools.element().toggleClass("js-hidden",t),this.removeAndObjectsTreeTools.toggleClass("js-hidden",t),this.responsiveToolbar.getButton().element().toggleClass("js-hidden",!t),this._twoColumnLayout=t)},n.prototype.updateLayout=function(){this.onResize&&this.onResize(this._container)},n.prototype.appendToolsGroup=function(t){var e,i=this.filterEnabledTools(this.extendTools(t));i.length>0&&(e=new this.Button(i),this._main.append(e.element()),this._allToolGroups.push(e))},n.prototype.filterEnabledTools=function(t){return t.filter(function(t){return this._toolsFilter.isToolEnabled(h[t.tool].localizedName)},this)},n.prototype.element=function(){return this._container},n.prototype._syncView=function(t){var e,i,o,n;if(this._allToolGroups)for(e=this._allToolGroups.length;e--;)if(i=this._allToolGroups[e],i.textAsIcon)i.activate("LineToolIcon"===t);else{for(o=!1,n=i.tools.length;n--;)i.tools[n].tool===t&&(i.setCurrent(n),o=!0);i.activate(o)}},n.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},n.prototype._onLinetoolButtonClicked=function(t,e){if(l.tool.value()===t)return void(e&&l.resetToCursor());TradingView.supportTouch()&&this._chartWidgetCollection.selectedSource.value()&&this.activeChartWidget().model().lineBeingCreated()&&this.activeChartWidget().model().cancelCreatingLine(),l.tool.setValue(t)},n.prototype.extendTools=function(t){var e=this,i=this._addToFavorite.bind(this),o=e._removeFromFavorite.bind(this);return $.map(t,function(t){var n={tool:t.tool,addClass:e._toolsFilter.isToolGrayed(h[t.tool].localizedName)&&" grayed",shortcut:t.shortcut,action:e._onLinetoolButtonClicked.bind(e,t.tool,!1),favOptions:{allowMakeFavorite:!e.options.onWidget,addToFavorite:i,removeFromFavorite:o}};return n.favOptions.isFavorite=c.isFavorite(t.tool),t.shortcut&&a.bind(t.shortcut.keys,function(i){return i.preventDefault(),t.shortcut.immediately?e.activeChartWidget().activePaneWidget&&e.activeChartWidget().activePaneWidget.drawRightThere(t.tool):n.action(),!1}),n})},n.prototype._addToFavorite=function(t){t.favOptions.isFavorite=!0,c.addFavorite(t.tool)},n.prototype._removeFromFavorite=function(t){t.favOptions.isFavorite=!1,c.removeFavorite(t.tool)},n.prototype.createIconActions=function(t){var e=this,i=r.availIcons,o=TVSettings.getJSON("linetoolicon.recenticons");return o&&(i=o.concat(["separator"]).concat(i)),$.map(i,function(t){return"separator"===t?{separator:!0}:{tool:"LineToolIcon",name:String.fromCharCode(t),addClass:e._toolsFilter.isToolGrayed("Font Icons")&&" grayed",action:function(){var i,o,n=defaults("linetoolicon");n.icon=t,TradingView.saveDefaults("linetoolicon",n),l.tool.setValue("LineToolIcon"),e._icons.setTools(e.createIconActions()),i=TVSettings.getJSON("linetoolicon.recenticons")||[],o=10,i=$.grep(i,function(e){return e!==t}),i.unshift(t),i.length>o&&(i=i.slice(0,o)),TVSettings.setJSON("linetoolicon.recenticons",i)}}})},n.prototype.changeTool=function(t){t?this._chartWidget.setCurrentTool(t):this._chartWidget.setCurrentTool(this._chartWidget.currentCursorTool())},n.prototype._fold=function(t){t=!!t,this._container.toggleClass("hidden",t),$(window).resize()},n.prototype.getVisibilityChangeText=function(t){return t?$.t("Hide Drawings Toolbar"):$.t("Show Drawings Toolbar")},n.prototype.Button=function(t,e,o){t=Array.isArray(t)?t:[t],this.isGroup=t.length>1,this.textAsIcon=o,this.setTools(t),this._e=$("<span>").addClass("button").addClass("apply-common-tooltip common-tooltip-vertical"),this._main=$("<span>").addClass("main"),o&&(this._main.addClass("text-as-icon"),this._main.text(this._firstNonGrayedTool().localizedName)),this.isGroup&&(this._side=$("<span>").addClass("side").append($(i(578)).attr({width:3,height:6})),this._e.addClass("subgroup"));var n=o?$.t("Icon"):this.tools[0].localizedName;this._e.append(this._main).attr("title",n).append(this._side),this.isGroup&&(e=$.extend({direction:TradingView.isMobileView?"up":"right",event:"button-popup",addClass:"drawings-popup-list favored-list",reverse:!1,popupSpacing:TradingView.isMobileView?15:4,svg:!o,listInner:!0,listTable:!0,wrapIcon:!0},e||{}),o||(e.addClass+=" iconed"),"function"==typeof TradingView.setWidgetLogoOverlayVisibility&&(this._e.on(e.event,function(){TradingView.setWidgetLogoOverlayVisibility(!1)}),e.onRemove=function(){TradingView.setWidgetLogoOverlayVisibility(!0)}),p(this._e,null,e)),this.activated=t.activated||!1,this.setCurrent(this.tools.indexOf(this._firstNonGrayedTool())),this.isGroup?(Modernizr.touch?(this._main.bind("touchstart",$.proxy(this,"_startclick")),this._main.bind("touchend",$.proxy(this,"_stopclick"))):(this._main.mousedown($.proxy(this,"_startclick")),this._main.mouseup($.proxy(this,"_stopclick"))),this._side.click($.proxy(this,"_submenu")),this._e.click(function(){return!1})):this._e.click($.proxy(this,"action"))},n.prototype.Button.prototype.toggle=function(){switch(this.element().css("display")){case"none":this.element().css("display","block");break;case"block":this.element().css("display","none")}},n.prototype.Button.prototype._isToolGrayed=function(t){return t.addClass&&t.addClass.indexOf("grayed")>-1},n.prototype.Button.prototype._firstNonGrayedTool=function(){var t,e;for(t=0;t<this.tools.length;++t)if(e=this.tools[t],!this._isToolGrayed(e)&&!e.separator)return e;return this.tools[0]},n.prototype.Button.prototype.element=function(){return this._e},n.prototype.Button.prototype.setTools=function(t){if(Array.isArray(t)){var e=this;this.tools=$.map(t,$.proxy(function(t,i){if(t.separator)return{separator:!0};var o=t.name||h[t.tool].localizedName;return{icon:e.textAsIcon?t.name:t.tool,name:o,shortcut:t.shortcut,localizedName:o,tool:t.tool,addClass:t.addClass,action:"function"==typeof t.action?t.action:e._defaultAction,favOptions:t.favOptions}},this))}},n.prototype.Button.prototype._setIcon=function(t){var e=$(h[t].icon).attr({width:30,height:30});this._main.empty().append(e)},n.prototype.Button.prototype._setTextAsIcon=function(t){this._main.text(t)},n.prototype.Button.prototype.setIcon=function(t){this.icon=t,this.textAsIcon?this._setTextAsIcon(t):this._setIcon(t)},n.prototype.Button.prototype._getPopupMenuItems=function(){function t(t){return t?$.t("Remove from favorites"):$.t("Add to favorites")}var e=this;return $.map(this.tools,function(o,n){var s,r;return o.separator?o:(s=function(){e._isToolGrayed(o)?d.emit("onGrayedObjectClicked",{type:"drawing",name:h[o.tool].localizedName}):(e.setCurrent(n),o.action.call(e,o),$(document).trigger("click"),$(document).trigger("touch"))},!e.textAsIcon&&o.favOptions.allowMakeFavorite&&(r=$('<span class="to-quick" title="'+t(o.favOptions.isFavorite)+'"></span>').append($(i(187)).attr({width:16,height:16})).toggleClass("quicked",!!o.favOptions.isFavorite)),{title:""+o.localizedName,action:s,shortcut:o.shortcut,active:n===e.current,svg:!e.textAsIcon&&$(h[o.icon].icon).attr({width:30,height:30}),addClass:o.addClass,buttons:e.textAsIcon||!o.favOptions.allowMakeFavorite?void 0:[{el:r,handler:function(e){o.favOptions.isFavorite?(o.favOptions.removeFromFavorite(o),r.removeClass("quicked").attr("title",t(!1))):(o.favOptions.addToFavorite(o),r.addClass("quicked").attr("title",t(!0))),e.stopPropagation(),e.preventDefault()}}]})})},n.prototype.Button.prototype._defaultAction=function(){this.activate()},n.prototype.Button.prototype._startclick=function(){this._e.hasClass("active")?($(document).trigger("click"),this.action()):this._delay=setTimeout($.proxy(function(){this._delay=null,this.openSubmenu()},this),200)},n.prototype.Button.prototype._stopclick=function(){this._delay&&(clearTimeout(this._delay),this._delay=null,this.action())},n.prototype.Button.prototype._submenu=function(){if(this._e.hasClass("active"))return void $(document).trigger("click");this.openSubmenu()},n.prototype.Button.prototype.activate=function(t){t=void 0===t||!!t,this.activated=t,t?this._e.addClass("selected"):this._e.removeClass("selected"),this.textAsIcon||this._setIcon(this.icon)},n.prototype.Button.prototype.action=function(){var t=this.getCurrent();this._isToolGrayed(t)?d.emit("onGrayedObjectClicked",{type:"drawing",name:h[t.tool].localizedName}):t.action.call(this,t)},n.prototype.Button.prototype.openSubmenu=function(){this._e.trigger("button-popup",[this._getPopupMenuItems()])},n.prototype.Button.prototype.setCurrent=function(t){if(t>=0&&t<this.tools.length){var e=this.tools[t];this.setIcon(e.icon),this._isToolGrayed(e)?this._e.find(".main").addClass(" grayed"):this._e.find(".main").removeClass(" grayed"),this.isGroup&&!this.textAsIcon&&this._e.attr("title",e.localizedName),this.current=t}},n.prototype.Button.prototype.getCurrent=function(){return this.tools[this.current]},n.prototype.Button.prototype.setCurrentTool=function(t,e){var i,o=this;"LineToolIcon"===t?(i=String.fromCharCode(defaults("linetoolicon").icon),$.each(this.tools,function(t,e){if(e.icon===i)return o.setCurrent(t),o.activate(),!1})):$.each(this.tools,function(e,i){if(i.tool===t)return o.setCurrent(e),o.activate(),!1})},n.prototype.ResponsiveToolbar=function(t,e){this.initButton(t,e),this.initPopupMenu()},n.prototype.ResponsiveToolbar.prototype.initButton=function(t){this.button=new n.prototype.Button({tool:"group",addClass:"block",action:function(){var e,i;this.button.activate(!this.button.activated),e=[this.getMenuItem("Magnet Mode",t.ToolbarActions.magnet.bind(t),t.magnet.activated),this.getMenuItem("Stay in Drawing Mode",t.ToolbarActions.drawingmode.bind(t),t.drawingmode.activated),this.getMenuItem("Lock All Drawing Tools",t.ToolbarActions.lockDrawings.bind(t),t.lockDrawings.activated),this.getMenuItem("Hide All Drawing Tools",t.ToolbarActions.hideAllDrawings.bind(t),t.hideAllDrawings.activated),t.drawOnAllCharts&&this.getMenuItem("Sync drawings to all charts",t.ToolbarActions.drawAllCharts.bind(t),t.drawOnAllCharts.activated),this.getSeparator(),this.getMenuItem("Show Objects Tree...",t.ToolbarActions.showObjectsTree.bind(t)),this.getMenuItem("Remove All Drawing Tools",t.ToolbarActions.removeTools.bind(t))],i=e.filter(function(t){return void 0!==t}),this.button.element().trigger("button-popup",[i])}.bind(this)}),this.button.element().addClass("js-hidden")},n.prototype.ResponsiveToolbar.prototype.getSeparator=function(){return{separator:!0}},n.prototype.ResponsiveToolbar.prototype.getMenuItem=function(t,e,i){return{title:$.t(t),action:e,addClass:this.getClass(i)}},n.prototype.ResponsiveToolbar.prototype.initPopupMenu=function(){p(this.button.element(),null,{direction:"right",event:"button-popup",reverse:!0,notCloseOnButtons:!0,onRemove:function(){this.button.activate(!1)}.bind(this)})},n.prototype.ResponsiveToolbar.prototype.getClass=function(t){var e="setting-hidden";return t&&(e+=" checked"),e},n.prototype.ResponsiveToolbar.prototype.getButton=function(){return this.button},n.prototype.ResponsiveToolbar.prototype.getButtonElement=function(){return this.button.element()},n.prototype.ToolbarActions={magnet:function(t){this.magnet.activate(!this.magnet.activated),u(!0),l.properties().magnet.setValue(this.magnet.activated),u(!1)},drawingmode:function(){this.drawingmode.activate(!this.drawingmode.activated),u(!0),l.properties().stayInDrawingMode.setValue(this.drawingmode.activated),u(!1)},lockDrawings:function(){this.lockDrawings.activate(!this.lockDrawings.activated),l.lockDrawings().setValue(this.lockDrawings.activated)},hideAllDrawings:function(){this.hideAllDrawings.activate(!this.hideAllDrawings.activated),l.hideAllDrawings().setValue(this.hideAllDrawings.activated)},drawAllCharts:function(){this.drawOnAllCharts.activate(!this.drawOnAllCharts.activated),u(!0),l.drawOnAllCharts().setValue(this.drawOnAllCharts.activated),u(!1)},showObjectsTree:function(){this.activeChartWidget().showSourceProperties()},removeTools:function(){this._chartWidgetCollection.activeChartWidget.value().model().removeAllDrawingTools()}},n.ModernToolsFilter=function(t){this._toolsAccess=t},n.ModernToolsFilter.prototype._findTool=function(t){var e,i,o=null;for(e=0;e<this._toolsAccess.tools.length;++e)if(i=this._toolsAccess.tools[e],i.name===t){o=i;break}return o},n.ModernToolsFilter.prototype.isToolEnabled=function(t){var e=this._findTool(t);return!(!e||!e.grayed)||("black"===this._toolsAccess.type?!e:!!e)},n.ModernToolsFilter.prototype.isToolGrayed=function(t){var e=this._findTool(t);return e&&e.grayed},t.exports=n}).call(e,i(1),i(83))},function(t,e,i){(function(t,o){"use strict";var n,s,r,a,l,h,c,d,p,u;i(61),i(52),i(64),i(96),n=i(573),s=i(576),r=i(100),a=i(304),l=i(34),h=i(92),c=i(426),d=i(33),i(577),p='<span class="tv-favorited-drawings-toolbar__widget {{#isActive}}i-active{{/isActive}} apply-common-tooltip" title="{{title}}">{{{icon}}}</span>',u=function(e){function i(t){e.call(this,{allowSortable:!Modernizr.touch,defaultPosition:t,positionSettingsKey:"chart.favoriteDrawingsPosition"}),this._linetoolsWidgets={},this._onButtonClicked=new l,this._attachHandlers(),this._loadVisibilityState()}return t(i,e),i.prototype.show=function(){d.setValue(i._visibilitySettingsKey,!0),this.isVisible()||this._renderAllLinetools(),e.prototype.show.call(this)},i.prototype.hide=function(){d.setValue(i._visibilitySettingsKey,!1),e.prototype.hide.call(this)},i.prototype.onButtonClicked=function(){return this._onButtonClicked},i.prototype._onFavoriteAdded=function(t){this.addWidget(this._createLinetoolWidget(t)),this.show()},i.prototype._onFavoriteRemoved=function(t){this.removeWidget(this._linetoolsWidgets[t]),delete this._linetoolsWidgets[t],0===s.LinetoolsFavoritesStore.favoritesCount()&&this.hide()},i.prototype._onFavoriteMoved=function(){this._renderAllLinetools()},i.prototype._onSelectedLinetoolChanged=function(t){var e=this;Object.keys(this._linetoolsWidgets).forEach(function(i){var o=e._linetoolsWidgets[i];t===i?o.classList.add("i-active"):o.classList.remove("i-active")})},i.prototype._createLinetoolWidget=function(t){var e=this,i=$(o.render(p,{icon:c.lineToolsInfo[t].icon,isActive:t===h.tool.value(),title:c.lineToolsInfo[t].localizedName}))[0];return i.addEventListener("click",function(i){i.preventDefault(),e._onButtonClicked.fire(t)}),this._linetoolsWidgets[t]=i,i},i.prototype._renderAllLinetools=function(){var t=this;this._linetoolsWidgets={},this.removeWidgets(),s.LinetoolsFavoritesStore.favorites().forEach(function(e){t.addWidget(t._createLinetoolWidget(e))})},i.prototype._attachHandlers=function(){var t=this;s.LinetoolsFavoritesStore.favoriteAdded.subscribe(this,this._onFavoriteAdded),s.LinetoolsFavoritesStore.favoriteRemoved.subscribe(this,this._onFavoriteRemoved),s.LinetoolsFavoritesStore.favoriteMoved.subscribe(this,this._onFavoriteMoved),s.LinetoolsFavoritesStore.favoritesSynced.subscribe(null,function(){t._loadVisibilityState(),t._renderAllLinetools()}),this.onWidgetsReordered().subscribe(this,function(e,i){if(s.LinetoolsFavoritesStore.favoriteMoved.unsubscribe(t,t._onFavoriteMoved),!s.LinetoolsFavoritesStore.moveFavorite(s.LinetoolsFavoritesStore.favorite(e),i))throw Error("Something went wrong");s.LinetoolsFavoritesStore.favoriteMoved.subscribe(t,t._onFavoriteMoved)}),this.onContextMenu(function(e){e.preventDefault();var i=new r.Action({text:$.t("Hide Favorite Drawings Toolbar")});i.callbacks().subscribe(null,function(){t.hide()}),a.createMenu([i]).show(e)}),h.tool.subscribe(this._onSelectedLinetoolChanged.bind(this))},i.prototype._loadVisibilityState=function(){var t=s.LinetoolsFavoritesStore.favoritesCount()>0;d.getBool(i._visibilitySettingsKey,!0)&&t?this.show():this.hide()},i._visibilitySettingsKey="ChartFavoriteDrawingToolbarWidget.visible",i}(n.FloatingToolbar),e.FavoriteDrawingToolbar=u}).call(e,i(95),i(52))},function(t,e,i){"use strict";var o,n,s,r,a,l,h=i(61);i(574),i(64),o=i(46),n=i(33),s=i(34),r=i(524),a='<div class="tv-floating-toolbar i-closed i-hidden"><div class="tv-floating-toolbar__widget-wrapper"><div class="tv-floating-toolbar__drag js-drag">'+r+'</div><div class="tv-floating-toolbar__content js-content"></div></div></div>',i(575),l=function(){function t(e){this._widget=document.createElement("div"),this._isVertical=!1,this._hiddingTimeoutId=null,this._isVisible=!1,this._windowResizeListener=this._onWindowResize.bind(this),this._reorderedDelegate=new s,t._toolbars.push(this),this._options=e,this._widget=h(a).get(0),this._content=this._widget.getElementsByClassName("js-content").item(0),this._setZIndex(t._startZIndex+t._toolbars.length-1),this._options.addClass&&(this._widget.className+=" "+this._options.addClass),this._options.layout&&"auto"!==this._options.layout&&(this._isVertical="vertical"===this._options.layout,this._updateLayoutType())}return t.prototype.destroy=function(){this.hide(!0),t._toolbars.splice(t._toolbars.indexOf(this),1),document.body.contains(this._widget)&&document.body.removeChild(this._widget),this._widget.innerHTML=""},t.prototype.isVisible=function(){return this._isVisible},t.prototype.isVertical=function(){return this._isVertical},t.prototype.show=function(){var t=this;this.isVisible()||(document.body.contains(this._widget)||(this._init(),document.body.appendChild(this._widget)),this._setHiddingTimeout(null),window.addEventListener("resize",this._windowResizeListener),this.raise(),this._isVisible=!0,this._widget.classList.contains("i-hidden")?(this._widget.classList.remove("i-hidden"),setTimeout(function(){t.isVisible()&&t._widget.classList.remove("i-closed")})):this._widget.classList.remove("i-closed"),this._onWindowResize())},t.prototype.hide=function(t){var e,i,o=this;void 0===t&&(t=!1),this.isVisible()&&(e=this._widget.classList.contains("i-closed"),this._widget.classList.add("i-closed"),this._isVisible=!1,t||e?(this._setHiddingTimeout(null),this._widget.classList.add("i-hidden")):(i=setTimeout(function(){o._setHiddingTimeout(null),o._widget.classList.add("i-hidden")},this.hideDuration()),this._setHiddingTimeout(i)),window.removeEventListener("resize",this._windowResizeListener))},t.prototype.raise=function(){t._toolbars.length+t._startZIndex!==this._zIndex()&&(t._toolbars.splice(t._toolbars.indexOf(this),1),t._toolbars.push(this),t._updateAllZIndexes())},t.prototype.hideDuration=function(){return.75*o.dur},t.prototype.addWidget=function(t,e){var i,o,n;if(void 0===e&&(e={}),i=this.widgetsCount(),void 0===e.index&&(e.index=i),e.index<0||e.index>i)throw Error("Index must be in [0, "+i+"]");o=document.createElement("div"),o.className="tv-floating-toolbar__widget js-widget",o.appendChild(t),n=e.index===i?null:this._content.childNodes.item(e.index),this._content.insertBefore(o,n),this._onWindowResize()},t.prototype.removeWidget=function(t){var e=this._findWrapperForWidget(t);e&&(this._content.removeChild(e),this._onWindowResize())},t.prototype.widgetsCount=function(){return this._content.childNodes.length},t.prototype.showWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.remove("i-hidden")},t.prototype.hideWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.add("i-hidden")},t.prototype.removeWidgets=function(){for(;this._content.firstChild;)this._content.removeChild(this._content.firstChild);this._onWindowResize()},t.prototype.onWidgetsReordered=function(){return this._reorderedDelegate},t.prototype.onContextMenu=function(t){this._widget.addEventListener("contextmenu",t)},t.prototype._determineCurrentLayoutVertical=function(t){var e=this._isVertical?t.height:t.width;return window.innerWidth<e},t.prototype._getWidget=function(){return this._widget},t.prototype._findWrapperForWidget=function(t){var e,i,o=this._content.getElementsByClassName("js-widget");for(e=0;e<o.length;++e)if(i=o.item(e),i.contains(t))return i;return null},t.prototype._onVerticalChanged=function(t,e){},t.prototype._setHiddingTimeout=function(t){null!==this._hiddingTimeoutId&&clearTimeout(this._hiddingTimeoutId),this._hiddingTimeoutId=t},t.prototype._updateLayoutType=function(){this._isVertical?this._widget.classList.add("i-vertical"):this._widget.classList.remove("i-vertical")},t.prototype._onWindowResize=function(){var t;"auto"===(this._options.layout||"auto")&&(t=this._isVertical,this._isVertical=this._determineCurrentLayoutVertical(this._widget.getBoundingClientRect()),this._updateLayoutType(),t!==this._isVertical&&this._onVerticalChanged(this._isVertical,t)),this._checkPosition()},t.prototype._checkPosition=function(){var t=this._widget.getBoundingClientRect();t.right>window.innerWidth?this._widget.style.left=Math.max(0,window.innerWidth-t.width)+"px":t.left<0&&(this._widget.style.left="0"),t.bottom>window.innerHeight?this._widget.style.top=Math.max(0,window.innerHeight-t.height)+"px":t.top<0&&(this._widget.style.top="0")},t.prototype._setZIndex=function(t){this._widget.style.zIndex=t+""},t.prototype._zIndex=function(){return+this._widget.style.zIndex},t.prototype._loadPosition=function(){var t=n.getJSON(this._options.positionSettingsKey,this._options.defaultPosition);this._widget.style.left=t.left+"px",this._widget.style.top=t.top+"px",this._onWindowResize()},t.prototype._savePosition=function(){var t=this._widget.getBoundingClientRect();n.setJSON(this._options.positionSettingsKey,{left:t.left,top:t.top})},t.prototype._init=function(){this._loadPosition(),h(this._widget).draggable({containment:"window",handle:".js-drag",stop:this._savePosition.bind(this)}),this._options.allowSortable&&this._initSortable(),this._widget.addEventListener(Modernizr.touch?"touchstart":"mousedown",this.raise.bind(this))},t.prototype._initSortable=function(){var t=this,e=-1;h(this._content).sortable({start:function(t,i){e=i.item.index()},stop:function(i,o){var n=o.item.index();e!==n&&t._reorderedDelegate.fire(e,n)},tolerance:"point"})},t._updateAllZIndexes=function(){t._toolbars.forEach(function(e,i){e._setZIndex(t._startZIndex+i)})},t._startZIndex=20,t._toolbars=[],t}(),e.FloatingToolbar=l},,function(t,e){},function(t,e,i){"use strict";var o,n=i(34),s=i(33);!function(t){function e(e){return t.favorites.indexOf(e)}function i(){t.favorites=[],s.getJSON("chart.favoriteDrawings",[]).forEach(function(e){t.favorites.push(e.tool||e)}),t.favoritesSynced.fire()}function o(){s.setJSON("chart.favoriteDrawings",t.favorites)}t.favorites=[],t.favoritesSynced=new n,t.favoriteIndex=e,t.saveFavorites=o,i(),s.onSync.subscribe(null,i)}(o||(o={})),function(t){function e(){return o.favorites.slice()}function i(){return o.favorites.length}function s(t){return t<0||t>=i()?"":o.favorites[t]}function r(e){return!l(e)&&(o.favorites.push(e),o.saveFavorites(),t.favoriteAdded.fire(e),!0)}function a(e){var i=o.favoriteIndex(e);return i!==-1&&(o.favorites.splice(i,1),o.saveFavorites(),t.favoriteRemoved.fire(e),!0)}function l(t){return o.favoriteIndex(t)!==-1}function h(e,n){if(n<0||n>=i())return!1;var s=o.favoriteIndex(e);return s!==-1&&n!==s&&(o.favorites.splice(s,1),o.favorites.splice(n,0,e),o.saveFavorites(),t.favoriteMoved.fire(e,s,n),!0)}t.favoriteAdded=new n,t.favoriteRemoved=new n,t.favoriteMoved=new n,t.favoritesSynced=o.favoritesSynced,t.favorites=e,t.favoritesCount=i,t.favorite=s,t.addFavorite=r,t.removeFavorite=a,t.isFavorite=l,t.moveFavorite=h}(e.LinetoolsFavoritesStore||(e.LinetoolsFavoritesStore={}))},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3.0000003 6" width="3" height="6"><path d="M0 0c-.04 1.99 0 4.61 0 6l3-3z"/></svg>'},function(t,e,i){(function(e,o){"use strict";function n(t){this._chartWidgetCollection=t,this._bindings=[],this._hasAlertWathcedValue=null,this._$templatesButton=null,this._currentProperties=null,this._toolbarWidgets=[],this._clearProeprtiesOnHideTimeoutId=null,this._init(),this.attachHandlers()}function s(t,e){t.push({id:e,widget:$('<div class="tv-linetool-properties-toolbar__text">'+e+"</div>")[0]})}function r(t,e){t.push({id:e.value,widget:$(e.iconSvgCode)[0]})}function a(t,e){return $("<div>").addClass("tv-linetool-properties-toolbar__icon tv-linetool-properties-toolbar__icon--stroked").addClass(e).append(t)[0]}function l(t){return a(t,"tv-linetool-properties-toolbar__icon--line-width")}function h(t){return a(t,"tv-linetool-properties-toolbar__icon--line-style")}function c(t){return a(t,"tv-linetool-properties-toolbar__icon--line-end")}var d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P=i(309),L=P.PropertyPage,k=P.ColorBinding,I=i(269).BarsMarksContainer,E=i(82).LineDataSource,A=i(92),V=i(368),M=i(183).bindPopupMenu,D=i(91).DefaultProperty,O=i(580).GroupButtonFloatingToolbar,B=i(365);i(358),i(582),n.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},n.prototype.selectedSource=function(){return this._chartWidgetCollection.selectedSource.value()},n.prototype._init=function(){this._floatingToolbar=new O({addClass:"tv-linetool-properties-toolbar",defaultPosition:{top:window.headerChartPanel.outerHeight()+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position"}),this._floatingToolbar.onWidgetStateChanged().subscribe(this,this._onPropertyChangedInToolbar),this._sourceActions=this._createSourceActions(),this._sourceActions.forEach(function(t){this._floatingToolbar.addWidget(t.button)},this)},n.prototype._bindPopupMenuDirection=function(){return this._floatingToolbar.isVertical()?"right":"down"},n.prototype._onPropertyChangedInToolbar=function(t,e){this._currentProperties&&this.activeChartWidget().model().setProperty(this._currentProperties[t],e)},n.prototype._onPropertyChanged=function(t,e){this._floatingToolbar.setGroupedWidgetState(t,e.value())},n.prototype._hideAllSourceActions=function(){this._sourceActions.forEach(function(t){this._floatingToolbar.hideWidget(t.button)},this),this._sourceActionsVisible=!1},n.prototype._updateSourceActionsVisibility=function(t){this._sourceActionsVisible=!1,this._sourceActions.forEach(function(e){!e.isVisibleForSource||e.isVisibleForSource(t)?(this._floatingToolbar.showWidget(e.button),this._sourceActionsVisible=!0):this._floatingToolbar.hideWidget(e.button)},this)},n.prototype.attachHandlers=function(){A.tool.subscribe(this.onToolChanged.bind(this),{callWithLast:!0}),this._chartWidgetCollection.selectedSource.subscribe(this.onSourceChanged.bind(this))},n.prototype.onToolChanged=function(t,e){if(t&&t.toLowerCase().indexOf("linetool")!==-1){var e=e instanceof D?e:new D(t.toLowerCase());this._hideAllSourceActions(),this.showPropertiesOf(t,e),this.showTemplatesOf({tool:t,properties:e}),this._updateVisibility()}else this.selectedSource()?this.onSourceChanged(this.selectedSource()):this.hide()},n.prototype.findSourceOnWidget=function(t){var e,i,o,n;for(e=0;e<this.activeChartWidget().model().panes().length;e++)for(i=this.activeChartWidget().model().panes()[e],o=i.orderedSources(),n=0;n<o.length;n++)if(o[n]===t)return o[n]},n.prototype.onSourceChanged=function(t){if(this._hasAlertWathcedValue&&(this._hasAlertWathcedValue.destroy(),this._hasAlertWathcedValue=null),!t)return void this.hide();t instanceof E&&!(t instanceof I)&&this.findSourceOnWidget(t)?(!t.userEditEnabled()||"LineToolBrush"!==t.toolname&&this.activeChartWidget().model().lineBeingCreated()?this._hideAllSourceActions():(this._updateSourceActionsVisibility(t),t.canHasAlert()&&(this._hasAlertWathcedValue=t.hasAlert.spawn(),this._hasAlertWathcedValue.subscribe(this._updateSourceActionsVisibility.bind(this,t)))),this.showPropertiesOf(t.getConstructor(),t.properties()),this.showTemplatesOf({source:t}),this._setupToggleLockButton(t),this._updateVisibility()):this.hide()},n.prototype.showTemplatesOf=function(t){var o,n,s,r,a;e.enabled("line_tool_templates")&&(o=t.source,o?(n=o.getConstructor(),s=o.properties()):(n=t.tool,s=t.properties),this._$templatesButton&&(this._floatingToolbar.removeWidget(this._$templatesButton[0]),this._$templatesButton=null),r=this,a=function(t){o?(o.restoreTemplate(t),r.activeChartWidget().model().model().updateSource(this._linetool),r.onSourceChanged(o)):(s.merge(t),s.listeners().fire(this),s.saveDefaults(),r.onToolChanged(n,s))},TradingView.onWidget()&&!window.is_authenticated||!e.enabled("linetoolpropertieswidget_template_button")||(this._templatesList=new V(n,a,{buttonInner:'<div class="tv-linetool-properties-toolbar__icon">'+i(583)+'</div><span class="tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret"></span>',buttonClass:"tv-linetool-properties-toolbar__button apply-common-tooltip",defaultsCallback:function(){s.restoreFactoryDefaults(),r.showPropertiesOf(n,s)},saveAsText:$.t("Save Drawing Template As..."),applyDefaultText:$.t("Apply Default Drawing Template"),getDataForSaveAs:o?function(){return o.template()}:null,popupActiveClass:"i-dropped",popupDirection:this._bindPopupMenuDirection.bind(this)}),this._$templatesButton=this._templatesList.createButton().attr("title",$.t("Templates")),this._floatingToolbar.addWidget(this._$templatesButton[0],{index:0})),this._templatesVisible=!0)},n.prototype.templatesList=function(){return this._templatesList},n.prototype._createButton=function(t){var e,i,o;return t=t||{},e=document.createElement("div"),e.setAttribute("title",t.title),e.className+="tv-linetool-properties-toolbar__button apply-common-tooltip",e.addEventListener("click",t.callback),t.svgIcon&&(i=document.createElement("div"),i.classList.add("tv-linetool-properties-toolbar__icon"),i.appendChild(t.svgIcon),e.appendChild(i)),t.addCaret&&(o=document.createElement("div"),o.className="tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret",e.appendChild(o)),e},n.prototype._createSettingsButton=function(){var t=this;return this._createButton({title:$.t("Settings"),callback:function(){new B(t.selectedSource(),t.activeChartWidget().model()).show({onWidget:t.activeChartWidget()._options.onWidget})},svgIcon:$(i(584))[0]})},n.prototype._createZOrderButton=function(){var t=this._createButton({title:$.t("Visual Order"),callback:function(){t.classList.contains("i-dropped")||$(t).trigger("button-popup",[this._getZOrderActions()])}.bind(this),svgIcon:$(i(585))[0],addCaret:!0});return M($(t),null,{direction:this._bindPopupMenuDirection.bind(this),event:"button-popup",reverse:!1,notCloseOnButtons:!0,activeClass:"i-dropped"}),t},n.prototype._createCloneButton=function(){var t,o=$.t("Clone");return e.enabled("datasource_copypaste")&&(o+=", "+$.t("Copy")),e.enabled("support_multicharts")&&(o+=", "+$.t("Sync")),t=this._createButton({title:o,callback:function(){t.classList.contains("i-dropped")||$(t).trigger("button-popup",[this._getCloneActions()])}.bind(this),svgIcon:$(i(586))[0],addCaret:!0}),M($(t),null,{direction:this._bindPopupMenuDirection.bind(this),event:"button-popup",reverse:!1,notCloseOnButtons:!0,activeClass:"i-dropped"}),t},n.prototype._createLockButton=function(){var t=this._createButton({title:$.t("Lock"),callback:function(){this.activeChartWidget().toggleLockSelectedObject()}.bind(this),svgIcon:$(i(527))[0]});return this._lockChangeListener=function(e){e.value()?t.classList.add("i-active"):t.classList.remove("i-active")},t},n.prototype._createHideButton=function(){return this._createButton({title:$.t("Hide"),callback:function(){this.activeChartWidget().hideSelectedObject()}.bind(this),svgIcon:$(i(587))[0]})},n.prototype._createRemoveButton=function(){return this._createButton({title:$.t("Remove"),callback:function(){this.activeChartWidget().removeSelectedSource()}.bind(this),svgIcon:$(i(588))[0]})},n.prototype._createSourceActions=function(){var t=[{button:this._createSettingsButton()}];return t.push({button:this._createZOrderButton()},{button:this._createCloneButton(),isVisibleForSource:function(t){var e=TradingView.className(t.constructor);return!this.activeChartWidget().model().model().isSingleInstanceLineTool(e)}.bind(this)},{button:this._createLockButton()},{button:this._createHideButton()},{button:this._createRemoveButton()}),t},n.prototype._getCloneActions=function(){var t=this.activeChartWidget().model(),i=this.selectedSource(),o=[];return i.properties().clonable.value()&&o.push({title:$.t("Clone"),action:function(){t.cloneLineTool(i)}}),e.enabled("datasource_copypaste")?(o.push({title:$.t("Copy"),shortcut:"Ctrl-C",action:function(){t.copySourceToClip(i)}}),e.enabled("support_multicharts")?(o.push({title:$.t("Sync"),action:function(){t.copyToOtherCharts(i)}}),o):o):o},n.prototype._getZOrderActions=function(){var t=[],e=this.selectedSource(),i=this.activeChartWidget().model(),o={title:$.t("Bring to Front"),action:function(){i.bringToFront(e)}},n={title:$.t("Send to Back"),action:function(){i.sendToBack(e)}},s={title:$.t("Bring Forward"),action:function(){i.changeZOrder(e,1)}},r={title:$.t("Send Backward"),action:function(){i.changeZOrder(e,-1)}},a=i.paneForSource(this.selectedSource()),l=a.getZOrderMinMax();return e.zorder()===l.minZOrder&&(n.disabled=!0,r.disabled=!0),e.zorder()===l.maxZOrder&&(s.disabled=!0,o.disabled=!0),t.push(o,n,s,r),t},n.prototype._getPossibleProperty=function(t){var e,i,o=[],s=this._defaultToolProperties();for(e=0;e<s.length;e++)i=s[e],i.name in t&&o.push(i);return t.extendLeft||(o=o.map(function(t){return"leftEnd"===t.name&&(t.comboboxOptions=t.comboboxOptions.filter(function(t){return t.value!==n.LINE_EXTEND})),t})),t.extendRight||(o=o.map(function(t){return"rightEnd"===t.name&&(t.comboboxOptions=t.comboboxOptions.filter(function(t){return t.value!==n.LINE_EXTEND})),t})),o},n.prototype.showPropertiesOf=function(t,e){var i,o,n,a,l,h,c,d;if(this._toolExceptionCases||(this._toolExceptionCases=this._createToolExceptionCases()),i=this._toolExceptionCases[t]||this._getPossibleProperty(e),this._clearProperties(),this._propertiesVisible=!1,i.length){for(o={},n=i.length-1;n>=0;--n)if(a=i[n],l=e[a.name],"function"!=typeof(h=a.showIf)||h(l,e)){if(!l)continue;if(this._propertiesVisible=!0,c=[],"combobox"!==a.inputType){d=this.colorPropertyControl(l,a,e),this._floatingToolbar.addWidget(d[0],{index:this._$templatesButton?1:0}),this._toolbarWidgets.push(d[0]);continue}a.simple?a.comboboxOptions.forEach(s.bind(null,c)):a.comboboxOptions.forEach(r.bind(null,c)),a.propertyProxy&&(l=a.propertyProxy(e,this.activeChartWidget().model())),o[a.name]=l,l.subscribe(this,this._onPropertyChanged.bind(this,a.name,l)),this._floatingToolbar.addGroupedWidget({id:a.name,currentStateId:l.value(),stateWidgetAddClass:"tv-linetool-properties-toolbar__sub-widget",states:c,widgetAddClass:"tv-linetool-properties-toolbar__grouped-button",tooltip:a.title},{index:this._$templatesButton?1:0})}this._currentProperties=o}},n.prototype._updateVisibility=function(){this._propertiesVisible||this._sourceActionsVisible||this._templatesVisible?this._show():this.hide()},n.prototype._clearProperties=function(){this._currentProperties&&(this._clearProeprtiesOnHideTimeoutId&&(clearTimeout(this._clearProeprtiesOnHideTimeoutId),this._clearProeprtiesOnHideTimeoutId=null),Object.keys(this._currentProperties).forEach(function(t){this._currentProperties[t].unsubscribeAll(this),this._floatingToolbar.removeGroupedWidget(t)},this),this._currentProperties=null,this._toolbarWidgets.forEach(function(t){this._floatingToolbar.removeWidget(t)},this),this._toolbarWidgets=[],this.clearBindings())},n.prototype.hide=function(){this._floatingToolbar.hide(),this._clearProeprtiesOnHideTimeoutId=setTimeout(this._clearProperties.bind(this),this._floatingToolbar.hideDuration())},n.prototype._show=function(){this._floatingToolbar.show()},n.prototype.refresh=function(){this.onSourceChanged(this.selectedSource())},n.prototype._setupToggleLockButton=function(t){t!==this._selectedSourceBk&&(this._selectedSourceBk&&this._selectedSourceBk.properties().frozen&&this._selectedSourceBk.properties().frozen.unsubscribe(this,this._lockChangeListener),t&&t.properties().frozen&&(t.properties().frozen.subscribe(this,this._lockChangeListener),this._lockChangeListener(t.properties().frozen)),this._selectedSourceBk=t)},n.prototype.bindControl=function(t){this._bindings.push(t)},n.prototype.clearBindings=function(t){for(var e=this._bindings.length;e--;)this._bindings[e].destroy();this._bindings.length=0},n.prototype.colorPropertyControl=function(t,e,i){var o,s,r=L.prototype.createColorPicker({addClass:"tv-linetool-properties-toolbar__color-picker apply-common-tooltip",direction:this._bindPopupMenuDirection.bind(this)});return r.attr("title",e.title),o=r.find("input"),s=$(e.iconSvgCode),s.on("click",function(t){o.data("tvcolorpicker")||o.focus()}),$(document).on("click",function(t){o.data("tvcolorpicker")?o.addClass("i-active"):o.removeClass("i-active")}),o.after(s),this.bindControl(new k(r,t,!0,this.activeChartWidget().model(),null,n.getTransparency(e,i))),"string"==typeof e.addClass&&r.addClass(e.addClass),r},n.getTransparency=function(t,e){if(t.transparency)return t.transparencyField?e[t.transparencyField].value():e.transparency.value()},n.prototype.createLineEndPropertyProxy=function(t,e){return function(i,s){var r,a;return r=i[e]&&i[e].value()?n.LINE_EXTEND:i[t].value(),a=new o(r),a.subscribe(this,function(o){var n=o.value();n<2?(s.beginUndoMacro(""),i[t].setValue(n),i[e]&&i[e].setValue(!1),s.endUndoMacro()):(s.beginUndoMacro(""),i[t].setValue(E.LINEEND_NORMAL),i[e]&&i[e].setValue(!0),s.endUndoMacro())}),a}},n.LINE_EXTEND=42,d=l(i(589)),p=l(i(590)),u=l(i(591)),_=l(i(592)),f=h(i(593)),m=h(i(594)),g=c(i(595)),v=c(i(596)),y=c(i(597)),b=c(i(598)),w=c(i(599)),S=c(i(600)),T=i(601),C=i(602),x=i(603),n.prototype._defaultToolProperties=function(){return[{name:"color",inputType:"colorPicker",iconSvgCode:T,title:$.t("Color")},{name:"linecolor",inputType:"colorPicker",iconSvgCode:T,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:C,title:$.t("Background Color"),transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:d},{value:2,iconSvgCode:p},{value:3,iconSvgCode:u},{value:4,iconSvgCode:_}],title:$.t("Width")},{name:"linestyle",title:$.t("Style"),inputType:"combobox",comboboxOptions:[{value:0,iconSvgCode:d},{value:1,iconSvgCode:f},{value:2,iconSvgCode:m}]},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:E.LINEEND_NORMAL,iconSvgCode:g},{value:E.LINEEND_ARROW,iconSvgCode:v},{value:n.LINE_EXTEND,iconSvgCode:y}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:E.LINEEND_NORMAL,iconSvgCode:b},{value:E.LINEEND_ARROW,iconSvgCode:w},{value:n.LINE_EXTEND,iconSvgCode:S}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]},n.prototype._riskPropertiesExceptionCases=function(){return[{name:"textcolor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:x},{name:"profitBackground",title:$.t("Profit Background Color"),inputType:"colorPicker",iconSvgCode:C,transparency:!0,transparencyField:"profitBackgroundTransparency"},{name:"stopBackground",title:$.t("Stop Background Color"),inputType:"colorPicker",iconSvgCode:C,transparency:!0,transparencyField:"stopBackgroundTransparency"},{name:"linecolor",title:$.t("Border color"),inputType:"colorPicker",iconSvgCode:T}]},n.prototype._elliottPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:T}]},n.prototype._rangeExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:T,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:C,title:$.t("Background Color"),transparency:!0,transparencyField:"backgroundTransparency"},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:d},{value:2,iconSvgCode:p},{value:3,iconSvgCode:u},{value:4,iconSvgCode:_}],title:"Width"}]},n.prototype._textPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:x},{name:"backgroundColor",title:$.t("Background Color"),inputType:"colorPicker",iconSvgCode:C,showIf:function(t,e){return!e||!e.fillBackground||!!e.fillBackground.value()}},{name:"borderColor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:T},{name:"bordercolor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:T},{name:"fontsize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},n.prototype._notePropertiesExceptionCases=function(){return[{name:"markerColor",title:$.t("Marker Color"),inputType:"colorPicker",iconSvgCode:T},{name:"textColor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:x},{name:"fontSize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},n.prototype._brushPropertiesExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:T,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:C,transparency:!0,showIf:function(t,e){return e.fillBackground.value()},title:$.t("Background Color")},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:d},{value:2,iconSvgCode:p},{value:3,iconSvgCode:u},{value:4,iconSvgCode:_}],title:$.t("Line Width")},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:E.LINEEND_NORMAL,iconSvgCode:g},{value:E.LINEEND_ARROW,iconSvgCode:v}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:E.LINEEND_NORMAL,iconSvgCode:b},{value:E.LINEEND_ARROW,iconSvgCode:w}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]},n.prototype._oneColorForAllLines=function(){return[{name:"collectibleColors",inputType:"colorPicker",iconSvgCode:T,title:$.t("One color for all lines")}]},n.prototype._createToolExceptionCases=function(){return{LineToolRegressionTrend:[],LineToolGannSquare:n.prototype._oneColorForAllLines(),LineToolFibTimeZone:n.prototype._oneColorForAllLines(),LineToolBrush:n.prototype._brushPropertiesExceptionCases(),LineToolPolyline:n.prototype._brushPropertiesExceptionCases(),LineToolText:n.prototype._textPropertiesExceptionCases(),LineToolTextAbsolute:n.prototype._textPropertiesExceptionCases(),LineToolBalloon:n.prototype._textPropertiesExceptionCases(),LineToolCallout:n.prototype._textPropertiesExceptionCases(),LineToolPriceLabel:n.prototype._textPropertiesExceptionCases(),LineToolArrowMarkLeft:[],LineToolArrowMarkRight:[],LineToolArrowMarkUp:[],LineToolArrowMarkDown:[],LineToolFlagMark:[],LineToolThumbUp:[],LineToolThumbDown:[],LineToolElliottCircle:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottSubminuette:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinor:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMajorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolDateRange:n.prototype._rangeExceptionCases(),LineToolPriceRange:n.prototype._rangeExceptionCases(),LineToolDateAndPriceRange:n.prototype._rangeExceptionCases(),LineToolIcon:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:C}],LineToolNote:n.prototype._notePropertiesExceptionCases(),LineToolNoteAbsolute:n.prototype._notePropertiesExceptionCases(),LineToolThreeDrivers:[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:T}],LineToolRiskRewardLong:n.prototype._riskPropertiesExceptionCases(),LineToolRiskRewardShort:n.prototype._riskPropertiesExceptionCases(),LineToolBarsPattern:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:C}],LineToolProjection:[{name:"color1",title:$.t("Background color 1"),inputType:"colorPicker",iconSvgCode:C,transparency:!0},{name:"color2",title:$.t("Background color 2"),inputType:"colorPicker",iconSvgCode:C,transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:d},{value:2,iconSvgCode:p},{value:3,iconSvgCode:u},{value:4,iconSvgCode:_}]}],LineToolFibCircles:n.prototype._oneColorForAllLines(),LineToolFibChannel:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceArcs:n.prototype._oneColorForAllLines(),LineToolFibRetracement:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceFan:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibTime:n.prototype._oneColorForAllLines(),LineToolFibWedge:n.prototype._oneColorForAllLines(),LineToolGannComplex:n.prototype._oneColorForAllLines(),LineToolGannFan:n.prototype._oneColorForAllLines(),LineToolPitchfan:n.prototype._oneColorForAllLines(),LineToolPitchfork:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork2:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork:n.prototype._oneColorForAllLines(),LineToolInsidePitchfork:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibExtension:n.prototype._oneColorForAllLines()}},t.exports=n}).call(e,i(1),i(83))},function(t,e,i){(function(t){"use strict";var o,n=i(573),s=i(34);i(358),i(581),o=function(e){function i(t){e.call(this,i._prepareOptions(t)),this._onWidgetStateChangedDelegate=new s,this._statedWidgets=[],this._currentPopup=null,this._onWindowClickedListener=this._onWindowClicked.bind(this)}return t(i,e),i.prototype.show=function(){e.prototype.show.call(this),document.addEventListener("mousedown",this._onWindowClickedListener)},i.prototype.hide=function(){e.prototype.hide.call(this),document.removeEventListener("mousedown",this._onWindowClickedListener)},i.prototype.destroy=function(){this._closePopup(),e.prototype.destroy.call(this)},i.prototype.addGroupedWidget=function(t,e){var o,n,s;if(void 0===e&&(e={}),t.states.length<=0||i._getStateIndexById(t,t.currentStateId)===-1)throw Error("Argument is invalid (count: "+t.states.length+", state: "+t.currentStateId+")");o=document.createElement("div"),o.className="tv-grouped-floating-toolbar__widget-wrapper apply-common-tooltip",t.widgetAddClass&&o.classList.add(t.widgetAddClass),o.setAttribute("title",t.tooltip),n={statedWidget:t,toolbarWidget:o},s=this._onWidgetClicked.bind(this,n),n.clickListener=s,o.addEventListener("click",s),this._updateWidgetPreview(n),this.addWidget(o,e),this._statedWidgets.push(n)},i.prototype.removeGroupedWidget=function(t){var e,i,o=this._statedWidgets.length;for(e=0;e<o;++e)if(i=this._statedWidgets[e],i.statedWidget.id===t)return this._isPopupCreatedForWidget(t)&&this._closePopup(),i.toolbarWidget.removeEventListener("click",i.clickListener),this.removeWidget(i.toolbarWidget),this._statedWidgets.splice(e,1),void this._updatePopupPosition();throw Error("Unknown groupdId("+t+")")},i.prototype.setGroupedWidgetState=function(t,e){var o,n;for(o=0;o<this._statedWidgets.length;++o)if(n=this._statedWidgets[o],n.statedWidget.id===t){if(i._getStateIndexById(n.statedWidget,e)===-1)throw Error("Unknown stateId ("+e+")");return n.statedWidget.currentStateId=e,this._updateSubWidgetsState(n.statedWidget),void this._updateWidgetPreview(n)}},i.prototype.onWidgetStateChanged=function(){return this._onWidgetStateChangedDelegate},i.prototype._onVerticalChanged=function(t,e){this._updatePopupPosition()},i.prototype._onWidgetClicked=function(t,e){var i=this._currentPopup&&this._isPopupCreatedForWidget(t.statedWidget.id);this._closePopup(),i||this._createPopup(t)},i.prototype._createPopup=function(t){var e,i=this,o={createdFor:t.toolbarWidget,element:document.createElement("div"),stateWidgetId:t.statedWidget.id,widgets:[]};o.element.className+="tv-grouped-floating-toolbar__popup js-popup",e=t.statedWidget.states.length,t.statedWidget.states.forEach(function(n,s){var r=i._createSubWidget(t,n),a=i._onSubWidgetClicked.bind(i,t,n.id);r.addEventListener("click",a),o.widgets.push({clickListener:a,stateWidget:n,widget:r}),r.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-right-"+s),r.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-left-"+(e-s+1)),o.element.appendChild(r)}),this._currentPopup=o,this._updateSubWidgetsState(t.statedWidget),t.toolbarWidget.classList.add("i-dropped"),this._getWidget().appendChild(this._currentPopup.element),Promise.resolve().then(function(){i._currentPopup&&i._currentPopup.element.classList.add("i-opened")}),this._updatePopupPosition()},i.prototype._closePopup=function(){var t,e,i=this;this._statedWidgets.forEach(function(t){t.toolbarWidget.classList.contains("i-dropped")&&t.toolbarWidget.classList.remove("i-dropped")}),this._currentPopup&&(t=this._currentPopup.widgets,e=this._currentPopup.element,this._currentPopup=null,t.forEach(function(t){t.widget.removeEventListener("click",t.clickListener)}),e.classList.remove("i-opened"),e.addEventListener("transitionend",function(t){t.target===e&&i._getWidget().removeChild(e)}))},i.prototype._updateWidgetPreview=function(t){var e,o=i._getStateIndexById(t.statedWidget,t.statedWidget.currentStateId);if(o===-1)throw Error("Unknown state id: "+t.statedWidget.currentStateId);e=t.statedWidget.states[o].widget.cloneNode(!0),t.toolbarWidget.firstChild?t.toolbarWidget.replaceChild(e,t.toolbarWidget.firstChild):(t.toolbarWidget.appendChild(e),t.toolbarWidget.appendChild(i._createCaret()))},i.prototype._updateSubWidgetsState=function(t){this._currentPopup&&this._isPopupCreatedForWidget(t.id)&&this._currentPopup.widgets.forEach(function(e){e.stateWidget.id===t.currentStateId?e.widget.classList.add(i._activeSubWidgetClass):e.widget.classList.remove(i._activeSubWidgetClass)})},i.prototype._updatePopupPosition=function(){var t,e,i,o,n,s,r,a;if(this._currentPopup){if(t=this._currentPopup.createdFor,e=this._getWidget().getBoundingClientRect(),!(i=this._findWrapperForWidget(t))||!this._currentPopup)throw Error("Toolbar has no wrapper for preview's widget or there is no popup");o=i.getBoundingClientRect(),n=this._currentPopup.element.getBoundingClientRect(),s=this._currentPopup.element,this.isVertical()?(s.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),s.style.top=o.top-e.top-1+"px",s.style.left="",e.left>window.innerWidth-e.right?s.classList.add("tv-grouped-floating-toolbar__popup--at-left"):s.classList.remove("tv-grouped-floating-toolbar__popup--at-left")):(s.classList.remove("tv-grouped-floating-toolbar__popup--at-left"),r=o.left+n.width,a=0,a=r>window.innerWidth?e.left+n.width<=window.innerWidth?-1:e.width-n.width-1:o.left-e.left-1,s.style.left=a+"px",e.bottom+n.height>window.innerHeight?s.classList.add("tv-grouped-floating-toolbar__popup--at-top"):(s.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),s.style.top=""))}},i.prototype._isPopupCreatedForWidget=function(t){return!(!this._currentPopup||this._currentPopup.stateWidgetId!==t)},i.prototype._createSubWidget=function(t,e){var i=document.createElement("div");return i.className+="tv-grouped-floating-toolbar__sub-widget",t.statedWidget.stateWidgetAddClass&&i.classList.add(t.statedWidget.stateWidgetAddClass),i.appendChild(e.widget),i},i.prototype._onSubWidgetClicked=function(t,e){this._closePopup(),t.statedWidget.currentStateId!==e&&(this.setGroupedWidgetState(t.statedWidget.id,e),this._onWidgetStateChangedDelegate.fire(t.statedWidget.id,e))},i.prototype._onWindowClicked=function(t){if(this.isVisible()&&this._currentPopup&&!i._isEventInElement(t,this._currentPopup.element)){for(var e=0;e<this._statedWidgets.length;++e)if(i._isEventInElement(t,this._statedWidgets[e].toolbarWidget))return;this._closePopup()}},i._getStateIndexById=function(t,e){for(var i=0;i<t.states.length;++i)if(t.states[i].id===e)return i;return-1},i._createCaret=function(){var t=document.createElement("div");return t.className="tv-caret tv-caret--small tv-caret--colored tv-grouped-floating-toolbar__caret",t},i._prepareOptions=function(t){var e=" tv-grouped-floating-toolbar";return t.addClass?t.addClass+=e:t.addClass=e,t},i._isEventInElement=function(t,e){return t.target===e||e.contains(t.target)},i._activeSubWidgetClass="tv-grouped-floating-toolbar__sub-widget--current",i}(n.FloatingToolbar),e.GroupButtonFloatingToolbar=o}).call(e,i(95))},function(t,e){},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path d="M0 2h2V0C.9 0 0 .9 0 2zm6-2H4v2h2V0zm6 0v2h2c0-1.1-.9-2-2-2zm0 10h2V8h-2v2zm0 4c1.1 0 2-.9 2-2h-2v2zm0-8h2V4h-2v2zM8 2h2V0H8v2zM0 14h12V2H0v12zM2 2h10v10H2V2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 16"><path d="M15.09 6.857s-.571 0-.724-.533c-.114-.457-.305-.876-.533-1.295-.229-.495.152-.876.152-.876l.571-.571c.229-.229.229-.61 0-.876l-.762-.762c-.229-.229-.61-.229-.876 0l-.571.571s-.381.381-.876.152c-.419-.229-.838-.419-1.295-.533-.533-.152-.533-.724-.533-.724v-.8a.602.602 0 0 0-.61-.61H7.966a.602.602 0 0 0-.61.61v.8s0 .571-.533.724c-.457.114-.876.305-1.295.533-.495.229-.876-.152-.876-.152l-.571-.571c-.229-.229-.61-.229-.876 0l-.762.762c-.229.229-.229.61 0 .876l.571.571s.381.381.152.876c-.229.419-.419.838-.533 1.295-.152.495-.724.533-.724.533h-.8a.602.602 0 0 0-.61.61v1.067c0 .343.267.61.61.61h.8s.571 0 .724.533c.114.457.305.876.533 1.295.229.495-.152.876-.152.876l-.571.571c-.229.229-.229.61 0 .876l.762.762c.229.229.61.229.876 0l.571-.571s.381-.381.876-.152c.419.229.838.419 1.295.533.495.152.533.724.533.724v.8c0 .343.267.61.61.61h1.067c.343 0 .61-.267.61-.61v-.8s0-.571.533-.724c.457-.114.876-.305 1.295-.533.495-.229.876.152.876.152l.571.571c.229.229.61.229.876 0l.762-.762c.229-.229.229-.61 0-.876l-.571-.571s-.381-.381-.152-.876c.229-.419.419-.838.533-1.295.152-.495.724-.533.724-.533h.8c.343 0 .61-.267.61-.61V7.467a.602.602 0 0 0-.61-.61h-.8zM8.5 11.555a3.541 3.541 0 0 1-3.556-3.556A3.541 3.541 0 0 1 8.5 4.443a3.541 3.541 0 0 1 3.556 3.556A3.561 3.561 0 0 1 8.5 11.555z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M1.5 2H0v12c0 .825.675 1.5 1.5 1.5h12V14h-12V2zm13.056-2H4.445c-.794 0-1.444.65-1.444 1.444v10.111c0 .794.65 1.444 1.444 1.444h10.111c.794 0 1.444-.65 1.444-1.444V1.444C16 .65 15.35 0 14.556 0z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 15"><path d="M1 0C.45 0 0 .45 0 1v11h1V1h9V0H1zm2.467 2C2.66 2 2 2.65 2 3.444v10.111c0 .794.66 1.444 1.467 1.444h8.067c.807 0 1.467-.65 1.467-1.444V3.444c0-.794-.66-1.444-1.467-1.444H3.467zM3 3h9v11H3V3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 12"><path d="M8.25 0C4.5 0 1.297 2.332 0 5.625c1.297 3.292 4.5 5.625 8.25 5.625s6.953-2.333 8.25-5.625C15.203 2.332 12 0 8.25 0zm0 9.375c-2.07 0-3.75-1.68-3.75-3.75 0-2.07 1.68-3.75 3.75-3.75 2.07 0 3.75 1.68 3.75 3.75 0 2.07-1.68 3.75-3.75 3.75zm0-6C7.005 3.375 6 4.38 6 5.625s1.005 2.25 2.25 2.25 2.25-1.005 2.25-2.25-1.005-2.25-2.25-2.25z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 13"><path d="M1 11.571C1 12.357 1.6 13 2.333 13h5.333c.733 0 1.333-.643 1.333-1.429V3h-8v8.571zM8.5 1L6.786 0H3.215L1.501 1h-1.5v1h10V1h-1.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 1"><path stroke-linecap="round" stroke-width="1" d="M1 1h20"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 2"><path stroke-linecap="round" stroke-width="2" d="M1 1h20"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 4"><path stroke-linecap="round" stroke-width="3" d="M1.5 2h18.5"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 4"><path stroke-linecap="round" stroke-width="4" d="M2 2h18"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 2"><path stroke-dasharray="1,3" stroke-linecap="round" stroke-width="1.5" d="M1 .75h22"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 2"><path stroke-dasharray="3" stroke-linecap="round" stroke-width="1.5" d="M1 1h22"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 4"><path stroke-linecap="round" stroke-width="1.5" d="M2 2h17"/><circle cx="3" cy="2" r="2"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21 7"><path stroke-linecap="round" stroke-width="1.5" d="M20 3.373H9"/><path d="M.46 3.25l8.834 3.008V.242z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 4"><g transform="matrix(-1 0 0 1 20 0)"><path stroke-linecap="round" stroke-width="1.5" d="M2 2h17"/><circle cx="3" cy="2" r="2"/><circle cx="11" cy="2" r="2"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 4"><g transform="matrix(-1 0 0 1 20 0)"><path stroke-linecap="round" stroke-width="1.5" d="M2 2h17"/><circle cx="3" cy="2" r="2"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21 7"><path stroke-linecap="round" stroke-width="1.5" d="M1 3.373h11"/><path d="M20.54 3.25l-8.834 3.008V.242z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 4"><path stroke-linecap="round" stroke-width="1.5" d="M2 2h17"/><circle cx="3" cy="2" r="2"/><circle cx="11" cy="2" r="2"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 39 39"><path d="M0 0v39h39V0zm7.5 29h24v4h-24z" class="bg"/><path d="M24.748 16.001l-3.75-3.749L11 22.251V26h3.75l9.998-9.999zm2.96-2.96a.996.996 0 0 0 0-1.409l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.96 1.96 3.75 3.75 1.96-1.96z" class="icon"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 39 39"><path d="M0 0v39h39V0zm7.5 29h24v4h-24z" class="bg"/><path d="M24.06 17.94L15.123 9l-1.41 1.41 2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.499-5.5c.59-.58.59-1.53 0-2.12zM12.713 19l4.79-4.79L22.29 19h-9.579zM26.5 20.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z" class="icon"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 39 39"><path d="M0 0v39h39V0zm7.5 29h24v4h-24z" class="bg"/><path d="M23.594 26L22.5 22.671h-5.904L15.426 26H13l6.446-16h.574L26 26h-2.405zm-3.965-11.863l-2.459 6.95h4.712l-2.252-6.95z" class="icon"/></svg>'},function(t,e,i){"use strict";var o=i(291).UndoHistory,n=i(142),s=i(605),r=i(607),a=i(613),l=i(615),h=l.ChartApiInterface,c=l.HandlerInfo;TradingView.STUDY_COUNT_LIMIT=120,JSServer.ChartApi=function(t){this._notificationHandlers=[],this._sessions=[],this.studyCounter=0,this._connected=!1,this._enabled=!1,this._studyEngine=new r(t),this._callbacks={},this._symbolIdCache={},this._seriesIdCache={},this._recentSeriesId={},this._enableLogging=!1,this._enabledMoreBarsRequest=!0,this._serverTimeOffset=0,this._autosaveTimeoutSeconds=5;var e=this;this._studyEngine.on("configuration_received",function(){e._fireEvent("configuration_received")}),this._studyEngine.on("realtime_tick",function(t){var i={time:t.value[0]/1e3,open:t.value[1],high:t.value[2],low:t.value[3],close:t.value[4],volume:t.value[5]};e._fireEvent("realtime_tick",i,!0)}),this._autosavePaused=void 0,this._setupAutoSave()},JSServer.ChartApi.prototype._makeSymbolKey=function(t,e){if(!t||!e)throw Error("incorrect identifiers");return t+"_"+e},JSServer.ChartApi.prototype._makeSeriesKey=function(t,e){if(!t||!e)throw Error("incorrect identifiers");return t+"_"+e},JSServer.ChartApi.prototype.destroy=function(){this._studyEngine.destroy(),this._studyEngine=null},JSServer.ChartApi.prototype.purgeCache=function(t){this._symbolIdCache={},this._studyEngine.purgeCache(),this._studyEngine.purgeRangeExtensionData(),this._studyEngine.purgeDataCache()},JSServer.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(t){this._enabledMoreBarsRequest=t},JSServer.ChartApi.prototype.setTimeFramesList=function(t){var e,i,o,n,r,a,l,h;for(this._timeframes=[],e=/(\d+)(\w+)/,i=0;i<t.length;++i)o=t[i],n=e.exec(o.text),r=n[2].toLowerCase(),a=parseInt(n[1]),l="y"===r?12*a+"m":a+r,h=s.Symbol.parsePeriod(o.resolution),this._timeframes.push({text:$.t(o.title)||a+$.t(r,{context:"dates",count:a}),description:o.description||"",value:l,targetResolution:o.resolution,requiresIntraday:h.isIntraday})},JSServer.ChartApi.prototype._setupAutoSave=function(){var t=this,e=!1;o.undoStack().onChange().subscribe(this,function(){t._autosavePaused?e=!0:(setTimeout(t._fireEvent.bind(t,"onAutoSaveNeeded",void 0,!0),0),t._autosavePaused=setTimeout(function(){e&&t._fireEvent("onAutoSaveNeeded",void 0,!0),t._autosavePaused=void 0,e=!1},1e3*t._autosaveTimeoutSeconds))})},JSServer.ChartApi.prototype.setAutoSaveDelay=function(t){this._autosaveTimeoutSeconds=+t},JSServer.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols},JSServer.ChartApi.prototype.availableTimeFrames=function(t,e){return t?this._timeframes.filter(function(e){return!(e.requiresIntraday&&!t.has_intraday)&&!(t.supported_resolutions&&t.supported_resolutions.indexOf(e.targetResolution)<0)}):[]},JSServer.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||{1:1,3:1,5:1,15:1,30:1,45:1,60:1,120:1,180:1,240:1,D:1,W:1,M:1}},JSServer.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()},JSServer.ChartApi.prototype.supportedExchangesList=function(){return this._studyEngine.supportedExchangesList()},JSServer.ChartApi.prototype.futuresRegex=function(){return this._studyEngine.futuresRegex()},JSServer.ChartApi.prototype.start=function(){this._enabled=!0,this._fireEvent("start_enabled")},JSServer.ChartApi.prototype._logMessage=function(t){this._enableLogging&&console.log(t)},JSServer.ChartApi.prototype.unsubscribe=function(t,e){var i=this._callbacks[t];i&&i.splice(i.indexOf(e),1)},JSServer.ChartApi.prototype.on=function(t,e){return this._callbacks.hasOwnProperty(t)||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},JSServer.ChartApi.prototype._fireEvent=function(t,e,i){var o,n;if(this._callbacks.hasOwnProperty(t))for(o=this._callbacks[t].slice(0),i||(this._callbacks[t]=[]),n=0;n<o.length;++n)o[n](e)},JSServer.ChartApi.prototype.chartCreateSession=function(t,e){},JSServer.ChartApi.prototype.chartDeleteSession=function(t){},JSServer.ChartApi.prototype.createSession=function(t,e){TradingView.ChartapiMessagerInstances[t]=new a(this,t),this._sessions[t]=e,this._notificationHandlers[t]=e,this.connected()&&e.onMessage({method:"connected",params:[]})},JSServer.ChartApi.prototype.removeSession=function(t){delete this._sessions[t],delete this._notificationHandlers[t],this.chartDeleteSession(t),this._studyEngine.stopSources(t)},JSServer.ChartApi.prototype.connected=function(){return this._connected},JSServer.ChartApi.prototype._getHost=function(t){return t},JSServer.ChartApi.prototype._isSafari5=function(){return!!navigator.appVersion.match(/\/5\.[^\/]*?Safari\//)},JSServer.ChartApi.prototype._isIE9=function(){return!!navigator.appVersion.match(/MSIE 9/)},JSServer.ChartApi.prototype._isIOS5=function(){return!!navigator.appVersion.match(/iPad, CPU 5/)},JSServer.ChartApi.prototype._getPort=function(t){return this._isSafari5()||this._isIE9()?8081:t},JSServer.ChartApi.prototype.connect=function(){if(!this._enabled){var t=this;return void this.on("start_enabled",function(){t.connect()})}this.connected()||(this._connected=!0,this.sessionid="dummy session id",this._notifySessions({method:"connected",params:[]}))},JSServer.ChartApi.prototype.disconnect=function(){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.switchTimezone=function(t,e){if(TradingView.ChartapiMessagerInstances[t].setTimezone(e),this._recentSeriesId[t]){this._studyEngine.purgeEndOfDataFlags(t,this._recentSeriesId[t]);var i=this;this._doWhenSeriesSymbolIdIsReady(t,this._recentSeriesId[t],function(e){var o=i._seriesIdCache[i._makeSeriesKey(t,i._recentSeriesId[t])].resolution;i._studyEngine.recreateSources(e.name,o,t,!0),i._doWhenSeriesDataReceived(t,function(){var o=i._seriesIdCache[i._makeSeriesKey(t,i._recentSeriesId[t])].resolution,n=TradingView.ChartapiMessagerInstances[t].lastBar(i._recentSeriesId[t]);n&&i._studyEngine.rebuildExtrapolatedData(t,e.name,o,e.info,1e3*n.value[0])})})}},JSServer.ChartApi.prototype.receiveLocalResponse=function(t){this._logMessage("< "+t.method),this._dispathNotification(t),this._fireEvent("message_"+t.method,void 0,!0)},JSServer.ChartApi.prototype.getMarks=function(t,e,i,o,n){this._studyEngine.getMarks(t,e,i,o,n)},JSServer.ChartApi.prototype.getTimescaleMarks=function(t,e,i,o,n){this._studyEngine.getTimescaleMarks(t,e,i,o,n)},JSServer.ChartApi.prototype.resolveSymbol=function(t,e,i,o,n){function s(e,o){TradingView.ChartapiMessagerInstances[t].onSymbolError(e,o),TradingView.ChartapiMessagerInstances[t].onSeriesClearData(0,""),r._symbolIdCache[r._makeSymbolKey(t,e)]={name:i,status:"invalid_symbol"},r._fireEvent(r._makeSymbolKey(t,e)+"_resolve_fail"),r._fireEvent("resolve_fail",{session:t,symbolId:e},!0)}this._notificationHandlers[t][e]=new c(o,e),this._symbolIdCache[this._makeSymbolKey(t,e)]=null;var r=this;this._studyEngine.resolveSymbol(i,function(o){if(o.errmsg)return void s(e,o.errmsg);r._symbolIdCache[r._makeSymbolKey(t,e)]={name:i,info:o,status:"ok"},r._fireEvent(r._makeSymbolKey(t,e)+"_resolved",o),r._fireEvent("symbol_resolved",{symbolInfo:o,symbolId:e,session:t},!0),TradingView.ChartapiMessagerInstances[t].onSymbolResolved(e,o)},function(t){s(e,t)})},JSServer.ChartApi.prototype._doWhenSymbolIdIsReady=function(t,e,i){function o(){return{name:s._symbolIdCache[s._makeSymbolKey(t,e)].name,info:s._symbolIdCache[s._makeSymbolKey(t,e)].info}}function n(){r&&(i(o()),r=!1,s.unsubscribe(s._makeSymbolKey(t,e)+"_resolved",n),s.unsubscribe(s._makeSymbolKey(t,e)+"_resolve_fail",n))}var s=this,r=!0;this._symbolIdCache[this._makeSymbolKey(t,e)]?n():(this.on(this._makeSymbolKey(t,e)+"_resolved",n),this.on(this._makeSymbolKey(t,e)+"_resolve_fail",n))},JSServer.ChartApi.prototype._doWhenSeriesDataReceived=function(t,e){TradingView.ChartapiMessagerInstances[t].seriesCompleted.subscribe(null,e,!0)},JSServer.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(t,e,i,o){function n(){var e=h._symbolIdCache[h._makeSymbolKey(t,c)];return{name:e.name,info:e.info}}function s(){i(n())}function r(){h.unsubscribe("symbol_resolved",l),h.unsubscribe("resolve_fail",a)}function a(e){e.symbolId===c&&e.session===t&&(r(),o&&o())}function l(e){e.symbolId===c&&e.session===t&&(r(),s())}var h=this,c=this._seriesIdCache[t+"_"+e].symbolId;this._symbolIdCache[this._makeSymbolKey(t,c)]?s():(this.on("symbol_resolved",l),this.on("resolve_fail",a))},JSServer.ChartApi.prototype.createSeries=function(t,e,i,o,n,r,a){i=i||"";var l=this;this._notificationHandlers[t][e]=new c(function(r){if("series_completed"===r.method){var h=s.Symbol.parsePeriod(n);h.range&&l._applyRange(t,o,e,i,h.range)}a(r)},e),this._recentSeriesId[t]=e,TradingView.ChartapiMessagerInstances[t].setResolution(s.Symbol.parsePeriod(n).pureResolution),this._seriesIdCache[t+"_"+e]={symbolId:o,resolution:n,turnaround:i},this._studyEngine.updateSeriesTurnaround(t,e,i),this._doWhenSeriesSymbolIdIsReady(t,e,function(o){l._studyEngine.seriesTurnaround(t,e)===i&&l._studyEngine.createSeries(o.name,n,t,e,i)})},JSServer.ChartApi.prototype.removeSeries=function(t,e,i){this._notificationHandlers[t][e]=new c(i,e),this._studyEngine.removeSeries(t,e)},JSServer.ChartApi.prototype.setVisibleTimeRange=function(t,e,i,o,n){function s(){var s,a;r=t.data(),s=[r.timeToBarIndex(i,TradingView.SEARCH_FROM_LEFT),r.timeToBarIndex(o,TradingView.SEARCH_FROM_RIGHT)],r.valueAt(s[1])[0]<o&&t.syncModel()&&(a=t.syncModel().distance(r.valueAt(s[1])[0],o),a.success&&(s[1]+=a.result)),TradingView.ChartapiMessagerInstances[e].onSeriesTimeframeUpdate(l,h._seriesIdCache[e+"_"+l].turnaround,s[0],s[1],!0),t.requestMoreData(),n&&n()}var r=t.data(),a=!!r.timeToBarIndex(i,TradingView.SEARCH_FROM_LEFT),l=this._recentSeriesId[e],h=this;a?s():(this._studyEngine.ensureExtendedTo(l,e,i),this._doWhenSeriesDataReceived(e,s))},JSServer.ChartApi.prototype._exactBarsCountOfTimeFrame=function(t,e){var i,o=chartWidget.model().mainSeries().bars(),s=chartWidget.model().mainSeries().symbolInfo().session,r=o._valueAt(o.size()-1)[0],a=n.alignPeriodsBack(s,t.resolution,t.interval,1,1e3*r),l=o.size();for(a/=1e3,i=0,i=0;i<l&&!(o._valueAt(i)[0]>a);++i);return l-i},JSServer.ChartApi.prototype._applyRange=function(t,e,i,o,n){var s,r,a,l=chartWidget.model().mainSeries().bars().size();0!==l&&(s=this._exactBarsCountOfTimeFrame(n,this._symbolIdCache[this._makeSymbolKey(t,e)].info),r=Math.max(0,l-1-s),a=Math.max(r,l-1),TradingView.ChartapiMessagerInstances[t].onSeriesTimeframeUpdate(i,o,r,a))},JSServer.ChartApi.prototype.modifySeries=function(t,e,i,o,n,r,a){var l,h;i=i||"",l=this._seriesIdCache[t+"_"+e]?this._seriesIdCache[t+"_"+e].resolution:void 0,TradingView.ChartapiMessagerInstances[t].setResolution(s.Symbol.parsePeriod(n).pureResolution),h=this,this._notificationHandlers[t][e]=new c(function(a){var c,d;"series_completed"===a.method&&(c=s.Symbol.parsePeriod(l),d=s.Symbol.parsePeriod(n),d.range&&c.range!==d.range&&h._applyRange(t,o,e,i,d.range)),r(a)},e),this._recentSeriesId[t]=e,this._studyEngine.updateSeriesTurnaround(t,e,i),a&&(this._seriesIdCache[this._makeSeriesKey(t,a)]=null),this._seriesIdCache[this._makeSymbolKey(t,e)]={symbolId:o,resolution:n,turnaround:i},this._doWhenSeriesSymbolIdIsReady(t,e,function(i){h._studyEngine.purgeEndOfDataFlags(t,e),h._studyEngine.purgeRangeExtensionData(t),h._studyEngine.recreateSources(i.name,n,t,!0)})},JSServer.ChartApi.prototype.requestMoreData=function(t,e,i,o){if(this._enabledMoreBarsRequest){var n=this;setTimeout(function(){n._notificationHandlers[t][e]=new c(o,e),n._studyEngine.extendSeriesRange(e,t,i)})}},JSServer.ChartApi.prototype.setStudiesAccessController=function(t){this.studiesAccessController=t},JSServer.ChartApi.prototype.setWatchlistSettings=function(t){this._watchlistSettings=t},JSServer.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()},JSServer.ChartApi.prototype.requestMetadata=function(t,e,i){this._notificationHandlers[t][e]=new c(i,e);var o=this.studiesAccessController.getEnabledTools();TradingView.ChartapiMessagerInstances[t].onRequestMetadata(e,o)},JSServer.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<TradingView.STUDY_COUNT_LIMIT},JSServer.ChartApi.prototype.createStudy=function(t,e,i,o,n,s,r){var a,l,h;if(!this.isCanCreateStudy())throw Error("Exceeded the limit of studies");a=this,i=i||"",this._notificationHandlers[t][e]=new c(r,e),l=this._seriesIdCache[this._makeSeriesKey(t,o)].symbolId,h=this._seriesIdCache[this._makeSeriesKey(t,o)].resolution,this._doWhenSymbolIdIsReady(t,l,function(o){a._studyEngine.createStudy(o.name,h,t,e,i,n,s),a.studyCounter++})},JSServer.ChartApi.prototype.rebindStudy=function(t,e,i,o,n,s,r,a){throw Error("Not implemented")},JSServer.ChartApi.prototype.removeStudy=function(t,e){this._notificationHandlers[t][e]=null,this._studyEngine.removeStudy(t,e),this.studyCounter--},JSServer.ChartApi.prototype.modifyStudy=function(t,e,i,o,n){var s=this;setTimeout(function(){i=i||"",s._notificationHandlers[t][e]=new c(n,e),s._studyEngine.recomputeStudy(e,o,t,i)},0)},JSServer.ChartApi.prototype.createPointset=function(t,e,i,o,n,s,r){i=i||"",this._notificationHandlers[t][e]=new c(r,e);var a=this;this._doWhenSymbolIdIsReady(t,o,function(i){a._studyEngine.createPointset(t,e,i.info.full_name,i.info,n,s)})},JSServer.ChartApi.prototype.modifyPointset=function(t,e,i,o,n){throw Error("This call is not implemented")},JSServer.ChartApi.prototype.removePointset=function(t,e,i){this._notificationHandlers[t][e]=null,this._studyEngine.removePointset(e)},JSServer.ChartApi.prototype.requestMoreTickmarks=function(t,e,i,o){this._notificationHandlers[t][e]=new c(o,e);var n=this;this._doWhenSeriesSymbolIdIsReady(t,e,function(o){var s=n._seriesIdCache[n._makeSeriesKey(t,e)].resolution;n._studyEngine.onMoreTickmarksRequested(t,o.name,o.info,s,i)})},JSServer.ChartApi.prototype.requestFirstBarTime=function(t,e,i,o){this._notificationHandlers[t][e]=new c(o,e)},JSServer.ChartApi.prototype._invokeHandler=function(t,e){t&&t(e)},JSServer.ChartApi.prototype._sendRequest=function(t,e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._onMessage=function(t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._convertTimescaleResponse=function(t){var e,i=t.marks;for(e=0;e<i.length;++e)i[e]={span:i[e][0],time:i[e][1],index:i[e][2]};return t},JSServer.ChartApi.prototype._dispathNotification=function(t){var e,i,o,n,s,r,a,l,h,c,d=t.params.shift();if(this._notificationHandlers[d])switch(t.method){case"timescale_update":e=t.params[0],i=t.params[1],o=this._convertTimescaleResponse(i),o.clear=0===i.changes.length&&0===i.marks.length,this._notificationHandlers[d].onMessage({method:"timescale_update",params:o});for(n in e)s={},s.customId=n,s.plots=e[n].series,e[n].ns&&(s.nonseries=e[n].ns),s.turnaround=e[n].turnaround,r={method:"data_update",params:s},this._invokeNotificationHandler(d,n,r);break;case"tickmark_update":o=this._convertTimescaleResponse(t.params[0]),o.changes=[],this._notificationHandlers[d].onMessage({method:"timescale_update",params:o});break;case"data_update":for(n in t.params[0]){a=t.params[0][n],s={},s.customId=n,s.plots=a.series?a.series:a.plots,s.turnaround=a.turnaround,"s"in a&&"ns"in a&&(s.plots=a.s,s.nonseries=a.ns);for(l in s.plots)for(h in s.plots[l].value)1e100===s.plots[l].value[h]&&(s.plots[l].value[h]=void 0);r={method:"data_update",params:s},this._invokeNotificationHandler(d,n,r)}break;case"index_update":for(n in t.params[0])r={method:"index_update",params:t.params[0][n]},this._invokeNotificationHandler(d,n,r);break;case"critical_error":TradingView.logNormal(new Date+" critical_error session:"+this.sessionid+" reason:"+t.params[0]),this._notificationHandlers[d].onMessage({method:"critical_error",params:t.params});break;case"quote_symbol_data":case"quote_list_fields":case"depth_symbol_error":case"depth_symbol_success":case"dd":case"dpu":case"depth_bar_last_value":this._notificationHandlers[d].onMessage({method:t.method,params:t.params});break;default:c=t.params[0],this._invokeNotificationHandler(d,c,t)}},JSServer.ChartApi.prototype._invokeNotificationHandler=function(t,e,i){if(void 0!==e){var o=this._notificationHandlers[t][e];void 0!==o&&o&&this._invokeHandler(o.handler,i),"series_deleted"!==i.method&&"study_deleted"!==i.method||delete this._notificationHandlers[t][e]}},JSServer.ChartApi.prototype.searchSymbols=function(t,e,i,o,n){0===t.length&&0===e.length&&0===i.length&&n([]),this._studyEngine.searchSymbols(t,e,i,n)},JSServer.ChartApi.prototype._notifySessions=function(t){var e,i;for(e in this._sessions){if(!this._sessions.hasOwnProperty(e))return;i=this._sessions[e],"function"==typeof i.onMessage&&i.onMessage(t)}},JSServer.ChartApi.prototype.unpack=function(t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.reconnectTimeout=function(t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.quoteCreateSession=function(t){return this._studyEngine.quoteCreateSession(t)},JSServer.ChartApi.prototype.quoteDeleteSession=function(t){return this._studyEngine.quoteDeleteSession(t)},JSServer.ChartApi.prototype.quoteSetFields=function(t,e){return this._studyEngine.quoteSetFields(t,e)},JSServer.ChartApi.prototype.quoteAddSymbols=function(t,e){return e.indexOf(void 0)!==-1&&(console.warn("Got undefined in quoteAddSymbols"),e=e.filter(function(t){return!!t})),this._studyEngine.quoteAddSymbols(t,e)},JSServer.ChartApi.prototype.quoteRemoveSymbols=function(t,e){return this._studyEngine.quoteRemoveSymbols(t,e)},JSServer.ChartApi.prototype.quoteFastSymbols=function(t,e){return this._studyEngine.quoteFastSymbols(t,e)},JSServer.ChartApi.prototype.quoteHibernateAll=function(t){return this._studyEngine.quoteHibernateAll(t)},JSServer.ChartApi.prototype.depthCreateSession=function(t){return this._studyEngine.depthCreateSession(t)},JSServer.ChartApi.prototype.depthDeleteSession=function(t){return this._studyEngine.depthDeleteSession(t)},JSServer.ChartApi.prototype.depthSetSymbol=function(t,e){return this._studyEngine.depthSetSymbol(t,e)},JSServer.ChartApi.prototype.depthClearSymbol=function(t){},JSServer.ChartApi.prototype.depthSetScale=function(t,e){},JSServer.ChartApi.prototype.createStudiesAccessController=function(t,e,i){return new this.StudiesAccessController(this._studyEngine,t&&JSON.parse(t)||{type:"black",tools:[]})},JSServer.ChartApi.prototype.StudiesAccessController=function(t,e){this._studyEngine=t,this._studiesAccess=e},JSServer.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(t){var e,i,o=null;for(e=0;e<this._studiesAccess.tools.length;++e)if(i=this._studiesAccess.tools[e],i.name===t||i===t){o=i;break}return o},JSServer.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){return this._studyEngine.studiesMetadata().filter(function(t){var e=this._findTool(t.description);return"black"===this._studiesAccess.type?!e||e.grayed:!!e},this)},JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(t){var e=this._findTool(t);return e&&e.grayed},JSServer.ChartApi.prototype.serverTimeOffset=function(){return this._studyEngine.serverTimeOffset()},JSServer.ChartApi.prototype.alignTimePoint=function(t,e,i){return this._studyEngine.alignTimePoint(t,e,i)},JSServer.ChartApi.prototype.disconnectCount=function(){return 0},TradingView.requireFullInterfaceImplementation(JSServer.ChartApi,"JSServer.ChartApi",h,"ChartApiInterface"),t.exports=JSServer.ChartApi},function(t,e,i){(function(e){"use strict";var o=i(606),n=function(){function t(t,e,i,o,n){var s,r=n,a=0;if(isNaN(t.get(e-1)))return{index:NaN,value:NaN};for(s=0;s<e;++s)o(t.get(s),r)&&(a=s,r=t.get(s));return{index:a,value:r}}function n(t,e){return 100*t/e}function s(t,e,i,o,n){var s,r,a;this._areaRight=t,this._areaLeft=e,this._pivotType=i,this._series=o,this._currentIndex=n.new_var(0),this._currentValue=n.new_var(NaN),this._pivotIndex=n.new_var(-1),this._index=S.n(n),this._isNewBar=n.symbol.isNewBar,s=this._currentIndex.get(1),r=this._currentValue.get(1),a=this._pivotIndex.get(1),this._index>1&&(this._currentIndex.set(s),this._currentValue.set(r),this._pivotIndex.set(a))}function r(t,e,i){var o,n,r,a,l;this._deviation=t,o=i.new_var(S.high(i)),n=i.new_var(S.low(i)),o.get(2*e+1),n.get(2*e+1),this._pivotHigh=new s(e,e,s.HIGH,o,i),this._pivotLow=new s(e,e,s.LOW,n,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=S.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed,r=this._lastIndex.get(1),a=this._lastVal.get(1),l=this._lastType.get(1),this._index>1&&this.addPivot(r,a,l),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function a(t){this.symbol=t,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0}function l(t){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=t}function h(t,e){this.timezone=t||"America/New_York",this.session=e||"0000-0000"}function c(t,e,i,o){this.periodBase=i,this.tickerid=t,this.period=e,this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.session=new w.Session,this.other_sessions={},this.script=o,this.ticker=c.parseTicker(t);var n=c.parsePeriod(e);this.resolution=n.resolution,this.interval=n.interval,this.bb_cache={}}function d(t,e,i,o,n,s,r){this.body=n,this.symbols=[],this.runner=o,this.inputCallback=r,this.out=s,this.ctx=new a(this.add_sym(t,e,i)),this.init()}function p(t){this.symbols=[],this.barsets=[],this.subscription=[],this.host=t,this.isRecalculated=!1,this.start()}function u(t){p.feed=t}function _(t){this.runner=new p(t)}function f(t,e){this.info=t,this.bars=e||[],this.isBarClosed=!0}function m(t,e){this.period=t,this.generateEmptyBars=!!e}function g(){}function v(){}var y="undefined"!=typeof window?window:e,b=y.PineJsCalendar?y.PineJsCalendar:i(137),w=i(142),S={};return S.max_series_size=10001,S.n=function(t){return t.symbol.index+1},S.nz=function(t,e){return e=e||0,isFinite(t)?t:e},S.na=function(t){return 0===arguments.length?NaN:isNaN(t)?1:0},S.isZero=function(t){return Math.abs(t)<=1e-10},S.toBool=function(t){return isFinite(t)&&!S.isZero(t)},S.eq=function(t,e){return S.isZero(t-e)},S.neq=function(t,e){return!S.eq(t,e)},S.ge=function(t,e){return S.isZero(t-e)||t>e},S.gt=function(t,e){return!S.isZero(t-e)&&t>e},S.lt=function(t,e){return!S.isZero(t-e)&&t<e},S.le=function(t,e){return S.isZero(t-e)||t<e},S.and=function(t,e){return isNaN(t)||isNaN(e)?NaN:S.isZero(t)||S.isZero(e)?0:1},S.or=function(t,e){return isNaN(t)||isNaN(e)?NaN:S.isZero(t)&&S.isZero(e)?0:1},S.not=function(t){return isNaN(t)?NaN:S.isZero(t)?1:0},S.max=Math.max,S.min=Math.min,S.pow=Math.pow,S.abs=Math.abs,S.log=Math.log,S.log10=function(t){return Math.log(t)/Math.LN10},S.sqrt=Math.sqrt,S.sign=function(t){return isNaN(t)?NaN:S.isZero(t)?0:t>0?1:-1},S.exp=Math.exp,S.sin=Math.sin,S.cos=Math.cos,S.tan=Math.tan,S.asin=Math.asin,S.acos=Math.acos,S.atan=Math.atan,S.floor=Math.floor,S.ceil=Math.ceil,S.round=Math.round,S.avg=function(t,e,i,o,n,s){var r,a;if(2===arguments.length)return(t+e)/2;for(r=0,a=0;a<arguments.length;a++)r+=arguments[a];return r/arguments.length},S.open=function(t){return t.symbol.open},S.high=function(t){return t.symbol.high},S.low=function(t){return t.symbol.low},S.close=function(t){return t.symbol.close},S.hl2=function(t){return(t.symbol.high+t.symbol.low)/2},S.hlc3=function(t){return(t.symbol.high+t.symbol.low+t.symbol.close)/3},S.ohlc4=function(t){return(t.symbol.open+t.symbol.high+t.symbol.low+t.symbol.close)/4},S.volume=function(t){return t.symbol.volume},S.time=function(t,e,i){return t.symbol.bartime(e,i)},S.period=function(t){return t.symbol.period},S.tickerid=function(t){return t.symbol.tickerid},S.ticker=function(t){return t.symbol.ticker},S.interval=function(t){return t.symbol.interval},S.isdwm=function(t){return t.symbol.isdwm()},S.isintraday=function(t){return!t.symbol.isdwm()},S.isdaily=function(t){return"D"===t.symbol.resolution},S.isweekly=function(t){return"W"===t.symbol.resolution},S.ismonthly=function(t){return"M"===t.symbol.resolution},S.year=function(t){return S.timepart(t.symbol,b.YEAR,arguments[1])},S.month=function(t){return S.timepart(t.symbol,b.MONTH,arguments[1])},S.weekofyear=function(t){return S.timepart(t.symbol,b.WEEK_OF_YEAR,arguments[1])},S.dayofmonth=function(t){return S.timepart(t.symbol,b.DAY_OF_MONTH,arguments[1])},S.dayofweek=function(t){return S.timepart(t.symbol,b.DAY_OF_WEEK,arguments[1])},S.hour=function(t){return S.timepart(t.symbol,b.HOUR_OF_DAY,arguments[1])},S.minute=function(t){return S.timepart(t.symbol,b.MINUTE,arguments[1])},S.second=function(t){return S.timepart(t.symbol,b.SECOND,arguments[1])},S.iff=function(t,e,i){return S.not(t)?i:e},S.rising=function(t,e){for(var i=1;i<e+1;++i)if(t.get(i)>t.get(0))return 0;return 1},S.falling=function(t,e){for(var i=1;i<e+1;++i)if(t.get(i)<t.get(0))return 0;return 1},S.timepart=function(t,e,i){var o=b.utc_to_cal(t.timezone,i||t.bartime());return b.get_part(o,e)},S.rsi=function(t,e){return S.isZero(e)?100:S.isZero(t)?0:100-100/(1+t/e)},S.sum=function(t,e,i){var o=i.new_var(),n=S.nz(t.get())+S.nz(o.get(1))-S.nz(t.get(e));return o.set(n),n},S.sma=function(t,e,i){var o=S.sum(t,e,i);return S.na(t.get(e-1))?NaN:o/e},S.rma=function(t,e,i){var o=S.sum(t,e,i),n=e-1,s=t.get(n),r=i.new_var(),a=r.get(1),l=t.get(),h=S.na(s)?NaN:S.na(a)?o/e:(l+a*n)/e;return r.set(h),h},S.fixnan=function(t,e){var i=e.new_var();return isNaN(t)?i.get(1):(i.set(t),t)},S.tr=function(t,e){var i,o,n;return 1===arguments.length&&(e=t,t=void 0),i=void 0!==t&&!!t,o=e.new_var(S.close(e)),n=o.get(1),i&&isNaN(n)&&(n=S.close(e)),S.max(S.max(S.high(e)-S.low(e),S.abs(S.high(e)-n)),S.abs(S.low(e)-n))},S.atr=function(t,e){var i=e.new_var(S.tr(e));return S.sma(i,t,e)},S.ema=function(t,e,i){var o=S.sum(t,e,i),n=i.new_var(),s=t.get(0),r=t.get(e-1),a=n.get(1),l=S.na(r)?NaN:S.na(a)?o/e:2*(s-a)/(e+1)+a;return n.set(l),l},S.wma=function(t,e,i){var o,n,s=0;for(e=Math.round(e),o=e;o>=0;o--)n=e-o,s+=n*t.get(o);return 2*s/(e*(e+1))},S.vwma=function(t,e,i){var o=i.new_var(S.volume(i)),n=i.new_var(t.get(0)*S.volume(i));return S.sma(n,e,i)/S.sma(o,e,i)},S.swma=function(t,e){return(t.get(0)+2*t.get(1)+2*t.get(2)+t.get(3))/6},S.lowestbars=function(e,i,o){return-t(e,i,o,function(t,e){return S.lt(t,e)},Number.MAX_VALUE).index},S.lowest=function(e,i,o){return t(e,i,o,function(t,e){return S.lt(t,e)},Number.MAX_VALUE).value},S.highestbars=function(e,i,o){return-t(e,i,o,function(t,e){return S.gt(t,e)},Number.MIN_VALUE).index},S.highest=function(e,i,o){return t(e,i,o,function(t,e){return S.gt(t,e)},Number.MIN_VALUE).value},S.cum=function(t,e){var i=e.new_var(),o=S.nz(i.get(1))+t;return i.set(o),o},S.accdist=function(t){var e=S.high(t),i=S.low(t),o=S.close(t),n=S.volume(t);return S.cum(o===e&&o===i||e===i?0:n*(2*o-i-e)/(e-i),t)},S.correlation=function(t,e,i,o){var n=S.sma(t,i,o),s=S.sma(e,i,o),r=o.new_var(t.get()*e.get());return(S.sma(r,i,o)-n*s)/Math.sqrt(S.variance2(t,n,i)*S.variance2(e,s,i))},S.stoch=function(t,e,i,o,s){var r=S.highest(e,o),a=S.lowest(i,o);return S.fixnan(n(t.get()-a,r-a),s)},S.tsi=function(t,e,i,o){var n=o.new_var(S.change(t)),s=o.new_var(S.abs(S.change(t))),r=o.new_var(S.ema(n,i,o)),a=o.new_var(S.ema(s,i,o));return S.ema(r,e,o)/S.ema(a,e,o)},S.cross=function(t,e,i){function o(t){return t<0?-1:0===t?0:1}if(isNaN(t)||isNaN(e))return!1;var n=i.new_var(o(t-e));return!isNaN(n.get(1))&&n.get(1)!==n.get()},S.linreg=function(t,e,i){var o,n,s,r,a,l,h=0,c=0,d=0,p=0;for(o=0;o<e;++o)n=t.get(o),s=e-1-o,r=s+1,h+=r,c+=n,d+=r*r,p+=n*r;return a=(e*p-h*c)/(e*d-h*h),l=c/e,l-a*h/e+a+a*(e-1-i)},S.sar=function(t,e,i,o){function n(e,i){var o=m.get();return g.set(e),m.set(i),v.set(1e3*t),y.set(o),o}var s,r,a=S.high(o),l=S.low(o),h=S.close(o),c=o.new_var(a),d=o.new_var(l),p=o.new_var(h),u=p.get(1),_=d.get(1),f=c.get(1),m=o.new_var(),g=o.new_var(),v=o.new_var(),y=o.new_var(),b=y.get(1);if(isNaN(u))return NaN;if(s=1e-7,isNaN(b)&&(S.ge(h,u)?(g.set(1),m.set(Math.max(a,f)),b=Math.min(l,_)):(g.set(-1),b=Math.max(a,f),m.set(Math.min(l,_))),v.set(1e3*t)),1===g.get()){if(S.gt(a,m.get())&&(m.set(a),v.set(Math.min(v.get()+1e3*e,1e3*i))),S.le(l,b))return n(-1,l)}else if(S.lt(l,m.get())&&(m.set(l),v.set(Math.min(v.get()+1e3*e,1e3*i))),S.ge(a,b))return n(1,a);return r=b+v.get()*(m.get()-b)/1e3,1===g.get()?S.ge(r,l)&&(r=l-s):S.le(r,a)&&(r=a+s),y.set(r),r},S.alma=function(t,e,i,o){var n,s,r,a=Math.floor(i*(e-1)),l=e/o*(e/o),h=[],c=0;for(n=0;n<e;++n)s=Math.exp(-1*Math.pow(n-a,2)/(2*l)),c+=s,h.push(s);for(n=0;n<e;++n)h[n]/=c;for(r=0,n=0;n<e;++n)r+=h[n]*t.get(e-n-1);return r},S.wvap=function(t,e){return t.get()-t.get(1)},S.change=function(t){return t.get()-t.get(1)},S.roc=function(t,e){var i=t.get(e);return 100*(t.get()-i)/i},S.dev=function(t,e,i){var o=S.sma(t,e,i);return S.dev2(t,e,o)},S.dev2=function(t,e,i){var o,n,s,r=0;for(o=0;o<e;o++)n=t.get(o),s=S.abs(n-i),r+=s;return r/e},S.stdev=function(t,e,i){var o=S.variance(t,e,i);return S.sqrt(o)},S.variance=function(t,e,i){var o=S.sma(t,e,i);return S.variance2(t,o,e)},S.variance2=function(t,e,i){var o,n,s,r=0;for(o=0;o<i;o++)n=t.get(o),s=S.abs(n-e),r+=s*s;return r/i},S.percentrank=function(t,e){var i,o,n,s;if(S.na(t.get(e-1)))return NaN;for(i=0,o=t.get(),n=1;n<e;n++)s=t.get(n),S.ge(o,s)&&i++;return 100*i/e},s.LOW=0,s.HIGH=1,s.prototype.isPivotFound=function(){return this._pivotIndex.get()!==-1},s.prototype.pivotIndex=function(){return this._pivotIndex.get()},s.prototype.currentValue=function(){return this._currentValue.get()},s.prototype.pivotType=function(){return this._pivotType},s.prototype.reset=function(){this._currentValue.set(NaN),this._currentIndex.set(0),this._pivotIndex.set(-1)},s.prototype.isRightSideOk=function(t){return t-this._currentIndex.get()===this._areaRight},s.prototype.isViolate=function(t,e){if(t<1||isNaN(this._currentValue.get()))return!0;var i=this._series.get(this._index-t);return!!isNaN(i)||(i===this._currentValue.get()?e:this._pivotType===s.HIGH?i>this._currentValue.get():i<this._currentValue.get())},s.prototype.processPoint=function(t){this.isViolate(t,!1)&&(this._currentValue.set(this._series.get()),this._currentIndex.set(t))},s.prototype.isRestartNeeded=function(t){return t-this._currentIndex.get()>this._areaRight},s.prototype.update=function(){var t,e;if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(this._pivotIndex.get()===-1){for(t=!0,e=0;e<this._areaLeft;++e)if(this.isViolate(this._currentIndex.get()-1-e,!0)){t=!1;break}t&&this._pivotIndex.set(this._currentIndex.get())}}else this._pivotIndex.get()!==-1&&this._pivotIndex.set(-1);if(this.isRestartNeeded(this._index))for(this.reset(),e=0;e<=this._areaRight;++e)this.processPoint(this._index-this._areaRight+e)},r.prototype.addPivot=function(t,e,i){this._lastIndex.set(t),this._lastVal.set(e),this._lastType.set(i)},r.prototype.updatePivot=function(t,e){this._lastIndex.set(t),this._lastVal.set(e)},r.prototype.lastPrice=function(){return this._lastVal.get()},r.prototype.lastIndex=function(){return this._lastIndex.get()},r.prototype.addPoint=function(t,e,i){var o;return isNaN(this._lastVal.get())?void this.addPivot(t,e,i):(o=this._lastVal.get(),this._lastType.get()===i?void((i===s.HIGH?e>o:e<o)&&this.updatePivot(t,e)):void(Math.abs(o-e)/e>this._deviation&&this.addPivot(t,e,i)))},r.prototype.processPivot=function(t){t.update(),this._isBarClosed&&t.isPivotFound()&&this.addPoint(t.pivotIndex(),t.currentValue(),t.pivotType())},S.zigzag=function(t,e,i){return new r(t,e,i).lastPrice()},S.zigzagbars=function(t,e,i){var o=new r(t,e,i);return o.lastIndex()===-1?NaN:o.lastIndex()-S.n(i)},a.prototype.new_sym=function(t,e,i){return this.symbol.script.add_sym(t,e,i)},a.prototype.select_sym=function(t){this.symbol=this.symbol.script.get_sym(t)},a.prototype.new_var=function(t){var e,i=this.vars;return i.length<=this.vars_index&&i.push(new l(this.symbol)),e=i[this.vars_index++],arguments.length>0&&e.set(t),e},a.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new a(this.symbol)),this.ctx[this.ctx_index++]},a.prototype.prepare=function(t){var e,i;for(this.ctx_index=0,this.vars_index=0,e=0;e<this.vars.length;e++)this.vars[e].prepare(t);for(i=0;i<this.ctx.length;i++)this.ctx[i].prepare(t)},a.prototype.stop=function(){this.symbol=null,this.vars=null},l.prototype.valueOf=function(){return this.get(0)},l.prototype.get=function(t){return isNaN(t)&&(t=0),t=t||0,this.hist?t>=this.hist.length?(console.error("not enough depth: "+this),NaN):this._get(t):(this.mindepth=S.max(this.mindepth,t),NaN)},l.prototype._get=function(t){var e=this.hist_pos-t;return e<0&&(e+=this.hist.length),this.hist[e]},l.prototype.set=function(t){this.hist&&(this.hist[this.hist_pos]=t,this.modified=!0)},l.prototype.prepare=function(t){t===this.symbol&&(t.isNewBar?(this.original=this.get(0),!this.modified&&this.hist||this.add_hist()):this.set(this.original),this.modified=!1)},l.prototype.add_hist=function(){var t,e,i;if(!this.hist){for(t=S.na(this.mindepth)?S.max_series_size:S.min(this.mindepth+1,S.max_series_size),t=Math.round(t),e=Array(t),i=0;i<t;i++)e[i]=NaN;this.hist=e,this.hist_pos=-1}this.hist_pos=Math.min(this.hist_pos+1,this.hist.length),this.hist_pos===this.hist.length&&(this.hist_pos=this.hist.length-1,this.hist.shift(),this.hist.push(NaN)),this.hist[this.hist_pos]=this.original},l.prototype.adopt=function(t,e,i){var o,n,s,r;return this.hist||(this.mindepth=NaN),o=e.get(),n=t.indexOf(o),0!==i&&(s=e.get(1),S.na(s)||(r=t.indexOf(s),n=n===r?-1:n)),n<0?NaN:this._get(n)},l.prototype.indexOf=function(t){var e,i,n,s;return this.hist?S.na(t)?-1:(e=this.hist.length,i=this.symbol.index+1,n=Math.min(e,i),s=o.upperbound_int(this.hist,t,0,n),0===s?-1:n-s):(this.mindepth=NaN,-1)},c.parseTicker=function(t){var e=t.indexOf(":");return e===-1?t:t.substr(e+1)},c.parsePeriod=function(t){var e,i,o,n,s,r,a,l;return t+="",e=t.slice(0),i=e.indexOf(",")>=0,i&&(n=e.split(","),o=c.parsePeriod(n[1]),e=n[0]),s=!1,r=!1,a=e[e.length-1],"DWM".indexOf(a)===-1&&("S"===a?r=!0:(s=!0,a="")),l=parseInt(s?e:e.length>1?e.slice(0,e.length-1):1),{resolution:a,interval:l,pureResolution:""+l+a,isIntraday:s,isSeconds:r,range:o}},c.newBarBuilder=function(t,e,i){var o=c.parsePeriod(t);return w.newBarBuilder(o.resolution,o.interval,e,i)},c.newSession=function(t,e){var i=b.get_timezone(t);return(new w.Session).init(i,e)},c.prototype.set_symbolinfo=function(t){t||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=t,this.timezone=b.get_timezone(t.timezone),this.session.init(this.timezone,t.session);for(var e in this.other_sessions)this.other_sessions.hasOwnProperty(e)&&this.other_sessions[e].init(this.timezone,e)},c.prototype.get_session=function(t){if(!t)return this.session;var e=this.other_sessions[t];return e||(e=new w.Session,this.other_sessions[t]=e),e},c.prototype.isdwm=function(){return""!==this.resolution&&"S"!==this.resolution},c.prototype.enable_dwm_aligning=function(t,e){this.dwm_aligner=c.newBarBuilder(this.period,t,e)},c.prototype.bartime=function(t,e){var i,o,n,s,r=this.time;return t&&(i=t,e&&(i+=e),o=this.bb_cache[i],o||(n=this.get_session(e),o=c.newBarBuilder(t,n),this.bb_cache[i]=o),r=o.alignTime(r)),!this.isdwm()||isNaN(r)?r:(s=b.utc_to_cal(this.timezone,r),this.session.spec.correctTradingDay(s,this.timezone),b.cal_to_utc(this.timezone,s))},c.prototype.lastbar=function(t){var e,i;isNaN(t.time)||(e=t.time,this.dwm_aligner&&(this.dwm_aligner.moveTo(e),e=this.dwm_aligner.startOfBar(0)),i=this.time!==e,i&&this.index>=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),this.time=e,this.open=t.open,this.high=t.high,this.low=t.low,this.close=t.close,this.volume=t.volume,this.updatetime=t.updatetime,this.isNewBar=i,this.isBarClosed=t.isBarClosed,this.isNewBar&&this.index++,this.script.calc(this))},d.prototype.calc=function(t){var e,i=this.ctx,o=this.body;i.prepare(t),e=o.main(i,this.inputCallback),!isNaN(i.symbol.time)&&this.out&&this.out(i.symbol,e)},d.prototype.init=function(){var t=this.ctx,e=this.body;e.init&&e.init(t,this.inputCallback),e.main(t,this.inputCallback)},d.prototype.add_sym=function(t,e,i){var o=this.runner.add_sym(t,e,i,this);return this.symbols.push(o),o.isdwm()&&this.symbols.length>1&&o.enable_dwm_aligning(this.symbols[0].session,o.session),o},d.prototype.stop=function(){this.symbols=null,this.ctx.stop(),this.ctx=null},d.prototype.get_sym=function(t){return this.symbols[t]},p.prototype.add_sym=function(t,e,i,o){var n=new c(t,e,i,o);return this.symbols.push(n),n},p.prototype.get_sym=function(t){return this.symbols[t]},p.prototype.start=function(){function t(t,o){var n=p.feed.subscribe(t.tickerid,t.period,t.periodBase,function(t){e.update(o,t)},s.onErrorCallback,s.symbolInfo,s.sessionId,s.rangeExtension);i.push(n)}var e,i,o,n,s=this.host;for(this._script=new d(s.tickerid,s.period,s.periodBase||s.period,this,s.body,s.out,s.input),e=this,i=[],o=this.symbols,n=0;n<o.length;n++)t(o[n],n);this.subscription=i},p.prototype.stop=function(){var t,e=this.subscription;if(!e&&!this._script)return void console.warn("Recurring script engine stop happened.");for(t=0;t<e.length;t++)p.feed.unsubscribe(e[t]);this.subscription=null,this._script.stop(),this._script=null,this.symbols=null},p.prototype.update=function(t,e){var i,o;if(!e)return void console.error("Unexpected barset = null");i=this.symbols[t],this.isRecalculated?(o=e.bar(e.count()-1),o.isBarClosed=e.isLastBarClosed(),i.lastbar(o)):this.barsets[t]||(this.barsets[t]=e,i.set_symbolinfo(e.symbolinfo()),this.recalc())},p.prototype.recalc=function(){var t,e,i,o,n,s,r,a=this.symbols;for(t=0;t<a.length;t++)if(!this.barsets[t])return;for(e=a.length-1;e>=0;e--)for(i=a[e],o=this.barsets[e],n=o.count(),s=0;s<n;s++)r=o.bar(s),r.isBarClosed=s!==n-1||o.isLastBarClosed(),i.lastbar(r);this.isRecalculated=!0,this.host.recalc(this,{endOfData:this.barsets[0].endOfData,nextTime:this.barsets[0].nextTime})},p.feed={subscribe:function(t,e,i,o){console.error("must be initialized with setupFeed")},unsubscribe:function(t){console.error("must be initialized with setupFeed")}},_.prototype.stop=function(){this.runner.stop()},f.prototype.symbolinfo=function(){return this.info},f.prototype.isLastBarClosed=function(){return this.isBarClosed},f.prototype.bar=function(t){return this.bars[t]},f.prototype.count=function(){return this.bars.length},f.prototype.add=function(t,e){var i=t,o=this.bars,n=o.length,s=i.time,r=0===n?NaN:o[n-1].time;0===n||r<s?o.push(i):r===s?o[n-1]=i:console.error("time order violation, prev: "+new Date(r).toUTCString()+", cur: "+new Date(s).toUTCString()),this.isBarClosed=!!e},m.prototype.init=function(t){this.bb=c.newBarBuilder(this.period,t.symbol.session),this.bbEmptyBars=this.generateEmptyBars?c.newBarBuilder(this.period,t.symbol.session):void 0},m.prototype.extrapolate=function(t,e){return isNaN(t)||isNaN(e)?void 0:w.extrapolateBarsFrontToTime(this.bbEmptyBars,t,e)},m.prototype.main=function(t){var e=t.symbol.time,i=this.bb.alignTime(e),o=t.new_var(i),n=S.na(i),s=o.get(1),r=S.na(s)?1:S.neq(i,s),a=t.new_var(),l=t.new_var(),h=t.new_var(),c=t.new_var(),d=a.get(1),p=l.get(1),u=h.get(1),_=c.get(1),f=n?NaN:r?S.open(t):d,m=n?NaN:r?S.high(t):S.max(S.high(t),p),g=n?NaN:r?S.low(t):S.min(S.low(t),u),v=n?NaN:S.close(t),y=n?NaN:r?S.volume(t):S.volume(t)+_,b=n?NaN:e,w=t.symbol.isBarClosed&&this.bb.isLastBar(e),T=this.generateEmptyBars&&r?this.extrapolate(s,i):void 0,C=t.new_var(S.close(t)),x=C.get(1),P=T instanceof Array?x:NaN;return a.set(f),l.set(m),h.set(g),c.set(y),[i,f,m,g,v,y,b,w,T,P]},g.prototype.main=function(t){var e,i,o,n,s=t.new_var(S.open(t)),r=t.new_var(S.close(t)),a=s.get(1),l=r.get(1),h=S.ohlc4(t),c=S.na(s.get(1))?(S.open(t)+S.close(t))/2:(a+l)/2;return s.set(c),r.set(h),e=S.max(S.high(t),S.max(c,h)),i=S.min(S.low(t),S.min(c,h)),o=S.volume(t),n=t.symbol,[n.time,c,e,i,h,o,n.updatetime,n.isBarClosed]},v.prototype.main=function(t){return[S.open(t),S.high(t),S.low(t),S.close(t),S.volume(t)]},{Std:S,Series:l,Symbol:c,SymbolInfo:h,StudyEngine:_,BarSet:f,OHLCV:v,BarBuilder:m,HeikenAshi:g,setupFeed:u}}();t.exports=n}).call(e,function(){return this}())},function(t,e){"use strict";function i(t,e){return t<e}function o(t,e,i,o,n){var s,r,a;for(void 0===o&&(o=0),void 0===n&&(n=t.length),s=n-o;0<s;)r=s>>1,a=o+r,i(t[a],e)?(o=a+1,s-=r+1):s=r;return o}function n(t,e,n,s){return void 0===n&&(n=0),void 0===s&&(s=t.length),o(t,e,i,n,s)}function s(t,e,i,o,n){var s,r,a;for(void 0===o&&(o=0),void 0===n&&(n=t.length),s=n-o;0<s;)r=s>>1,a=o+r,i(e,t[a])?s=r:(o=a+1,s-=r+1);return o}function r(t,e,o,n){return void 0===o&&(o=0),void 0===n&&(n=t.length),s(t,e,i,o,n)}e.lowerbound=o,e.lowerbound_int=n,e.upperbound=s,e.upperbound_int=r},function(t,e,i){(function(e,o){"use strict";var n,s,r=i(608),a=i(605),l=i(609),h=i(610),c=i(611),d=i(142),p=i(93),u=i(36);i(612),i(613),n=i(614).DatafeedRequestsCachedProcessor,s=function(t){function i(t,i){var n,s;return e.enabled("disable_resolution_rebuild")||!p.isDWM(t)?null:(n=o.get_timezone(i.timezone),s=new d.Session,s.init(n,i.session),a.Symbol.newBarBuilder(t,s,s))}function s(t,e,i,o,n){return _._cachedDatafeed.subscribe(t,e,i,o,n)}function r(t){return _._cachedDatafeed.unsubscribe(t)}function u(t,e,i){_.resolveSymbol(t,e,i)}var _=this;this._studiesCache={},this._metainfoCache=[],this._extrapolationManager=h,this._externalDatafeed=t,this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._callbacks={},this._serverTimeOffset=0,_._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),_._datafeedConfiguration=_._adoptConfigurationData(window.configurationData),_._fireEvent("configuration_received"),_._externalDatafeed.getServerTime&&_._externalDatafeed.getServerTime(function(t){_._serverTimeOffset=t-(new Date).valueOf()/1e3}),this._pointsetsManager=c,this._rangeExtensionData={},this._quotesInfo=[],this._depthInfo=[],this._fullNameSymbolInfoMap={},this._endOfData={},this._computeStudyCounter=0,this._create_dwm_aligner=i,this._cachedDatafeed=new n(t,i),this._extendedRange=function(t){return _._rangeExtensionData[t]&&_._rangeExtensionData[t].summary},this._extendedTime=function(t){return _._rangeExtensionData[t]&&_._rangeExtensionData[t].time},l.setupFeed({resolve:u,subscribe:s,unsubscribe:r,calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth?this._externalDatafeed.calculateHistoryDepth.bind(this._externalDatafeed):void 0})},s.prototype.destroy=function(){this._externalDatafeed=null},s.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={}},s.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},s.prototype._logMessage=function(t){e.enabled("charting_library_debug_mode")&&console.log(t)},s.prototype._extendRange=function(t,e){this._rangeExtensionData[t]||(this._rangeExtensionData[t]={}),void 0===this._rangeExtensionData[t].summary&&(this._rangeExtensionData[t].summary=0),this._rangeExtensionData[t].summary+=e},s.prototype.on=function(t,e){return this._callbacks.hasOwnProperty(t)||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},s.prototype._fireEvent=function(t,e,i){var o,n;if(this._callbacks.hasOwnProperty(t)){for(o=this._callbacks[t],n=0;n<o.length;++n)o[n](e);i||(this._callbacks[t]=[])}},s.prototype._adoptConfigurationData=function(t){var e,i,o,n=TradingView.merge({},t),s=n.supported_resolutions;if(!s||0===s.length)return n.supported_resolutions=void 0,n;for(e={},i=0;i<s.length;i++){if(o=s[i],e.hasOwnProperty(o))throw Error("Duplicating resolution `"+o+"`");e[o]=1}return n.supported_resolutions=e,n},s.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions},s.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]},s.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]},s.prototype.futuresRegex=function(){return this._datafeedConfiguration.futures_regex||/$a/},s.prototype._findStudyObject=function(t){var e=t.split("@")[0],i=JSServer.studyLibrary.filter(function(i){return i.metainfo.id===t||i.metainfo.shortDescription===e});if(0===i.length)throw Error("Study `"+t+"` not found");return i[0]},s.prototype.getMarks=function(t,e,i,o,n){function s(t){function e(e,i){return isArray(t[e])?t[e][i]:t[e]}var i,o;if(isArray(t))return t;for(i=[],o=0;o<t.id.length;++o)i.push({id:e("id",o),time:e("time",o),color:e("color",o),text:e("text",o),label:e("label",o),labelFontColor:e("labelFontColor",o),minSize:e("minSize",o)});return i}var r,a={red:6,green:5,blue:4,yellow:3};this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks&&(this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name,n,new Date(1e3*e).toUTCString(),new Date(1e3*i).toUTCString())),r=this,this._externalDatafeed.getMarks(t,e,i,function(e){var i,l,h=s(e).map(function(t){return t.time=parseInt(t.time),t});r._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name,n,JSON.stringify(h))),i=r._create_dwm_aligner(n,t),l=h.map(function(t){return t.tickmark=null!==i?i.tradingDayToSessionStart(1e3*t.time)/1e3:t.time,t.direction=a[t.color],t.onClicked=function(){u.emit("onMarkClick",t.id)},t.label=!!t.label&&t.label[0],t}),o(l)},n))},s.prototype.getTimescaleMarks=function(t,e,i,o,n){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name,n,new Date(1e3*e).toUTCString(),new Date(1e3*i).toUTCString()));var s=this;this._externalDatafeed.getTimescaleMarks(t,e,i,function(e){var i,r;s._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name,n,JSON.stringify(e))),i=s._create_dwm_aligner(n,t),r=e.map(function(t){return t.tickmark=null!==i?i.tradingDayToSessionStart(1e3*t.time)/1e3:t.time,t}),o(r)},n)}},s.prototype._computeStudy=function(t,e,i,o,n,s,r,l,h){function c(t,e,i){var o,n,s,r,a=t.time,h="number"==typeof e?[e]:e;for(o=0;o<h.length;++o)n=h[o],n&&"object"==typeof n&&(_["plot_"+o]=n.offset,n=n.value,f++),"number"==typeof n&&isNaN(n)&&(n=void 0),h[o]=n;s=u.length-1,r=s<0||a>u[s].value[0],r?u.push({index:u.length,value:[a].concat(h)}):u[s].value=[a].concat(h),d||l([u[u.length-1]],r,u.length,_,i)}var d=!0,p=this._computeStudyCounter++,u=[],_={},f=0,m=this,g=function(l){var p;if(a.Symbol.parsePeriod(o).isIntraday&&!l.has_intraday)return void h("Unsupported resolution");if(p=new a.StudyEngine({tickerid:i,symbolInfo:l,period:o,body:e,sessionId:t,onErrorCallback:h,rangeExtension:{getRangeExtensionCount:m._extendedRange.bind(this,t),getRangeExtensionTime:m._extendedTime.bind(this,t)},input:function(t){return s[t]},out:function(t,e){c(t,e,l)},recalc:function(t,e){d=!1,r(u,f>0?_:void 0,l,e)}}),!m._studiesCache[t]||!m._studiesCache[t][n])throw Error("This should never happen");m._studiesCache[t][n].engine=p},v=function(t){h(t)},y=function(){return m._studiesCache[t]&&m._studiesCache[t][n]&&m._studiesCache[t][n].activeResolve===p};m._studiesCache[t][n].activeResolve=p,this.resolveSymbol(i,function(){y()&&g.apply(m,arguments)},function(){y()&&v.apply(m,arguments)})},s.prototype._createStudy=function(t,e,i,o,n,s,r){function a(t){var e,i,s;if(Array.isArray(t))return t;for(e=[],i=l._studiesCache[o][n].metainfo.inputs,s=0;s<i.length;s++)e[s]=t[i[s].id];return e}var l=this;r=a(r),TradingView.ChartapiMessagerInstances[o].onStudyLoading(n,s),l._computeStudy(o,i,t,e,n,r,function(i,r,a){TradingView.ChartapiMessagerInstances[o].onDataUpdate(n,s,l._convertBarsTimeToUnix(i),r,a,l._extendedRange(t,e)),TradingView.ChartapiMessagerInstances[o].onStudyCompleted(n,s)},function(i,r,a,h,c){TradingView.ChartapiMessagerInstances[o].onDataUpdate(n,s,l._convertBarsTimeToUnix(i),h,c,l._extendedRange(t,e))},function(t){TradingView.ChartapiMessagerInstances[o].onStudyError(n,t)})},s.prototype.purgeEndOfDataFlags=function(t,e){for(var i in this._studiesCache[t])e&&e!==i||(this._studiesCache[t][i].firstBarTime=null)},s.prototype.stopSources=function(t){var e,i;for(e in this._studiesCache[t])(i=this._studiesCache[t][e])&&(i.engine&&i.engine.stop(),i.activeResolve=-1);l.unsubscribeUnused()},s.prototype.recreateSources=function(t,e,i,o){var n,s;this.stopSources(i);for(n in this._studiesCache[i])(s=this._studiesCache[i][n])&&(s.symbol=t,s.resolution=e,"series"===s.type&&this.createSeries(t,e,i,n,s.turnaround,o));for(n in this._studiesCache[i])(s=this._studiesCache[i][n])&&"study"===s.type&&this._createStudy(t,e,s.studyObject,i,n,s.turnaround,s.inputs)},s.prototype.removeStudy=function(t,e){this._studiesCache[t]&&this._studiesCache[t][e]&&this._studiesCache[t][e].engine&&(this._studiesCache[t][e].engine.stop(),l.unsubscribeUnused()),this._studiesCache[t][e]=null},s.prototype.removeSeries=function(t,e){this.removeStudy(t,e)},s.prototype.recomputeStudy=function(t,e,i,o){var n=this._studiesCache[i][t];if(!n)throw Error("This should never happen");n.inputs=e,n.turnaround=o,n.engine&&n.engine.stop(),this._createStudy(n.symbol,n.resolution,n.studyObject,i,t,o,e)},s.prototype._convertBarsTimeToUnix=function(t){var e,i,o=[];for(e=0;e<t.length;++e)i={index:t[e].index,value:[].concat(t[e].value)},i.value[0]/=1e3,o.push(i);return o},s.prototype.createStudy=function(t,e,i,o,n,s,r){var a=this._findStudyObject(s),l=new a.constructor;this._studiesCache[i]=this._studiesCache[i]||{},this._studiesCache[i][o]={studyObject:l,symbol:t,resolution:e,guid:o,type:"study",inputs:r,metainfo:a.metainfo,turnaround:n},this._createStudy(t,e,l,i,o,n,r)},s.prototype.purgeRangeExtensionData=function(t){t?this._rangeExtensionData[t]={summary:0}:this._rangeExtensionData={}},s.prototype.ensureExtendedTo=function(t,e,i){var o,n=this._studiesCache[e][t];if(!n)throw Error("This should never happen");this.purgeRangeExtensionData(e),this._rangeExtensionData[e]||(this._rangeExtensionData[e]={}),this._rangeExtensionData[e].time=i,o=this,setTimeout(function(){o.recreateSources(n.symbol,n.resolution,e,!0)},0)},s.prototype.extendSeriesRange=function(t,e,i){var o,n,s=this._studiesCache[e][t];if(!s)throw Error("This should never happen");if(this._isEndOfData(e,t,s.turnaround))return o=s.engine.runner.host.symbolInfo.data_status,void setTimeout(function(){TradingView.ChartapiMessagerInstances[e].onSeriesCompleted(t,s.turnaround,o)},0);i+=10,this._extendRange(e,i),n=this,setTimeout(function(){n.recreateSources(s.symbol,s.resolution,e,!0)},0)},s.prototype.updateSeriesTurnaround=function(t,e,i){this._studiesCache[t]||(this._studiesCache[t]={}),this._studiesCache[t][e]||(this._studiesCache[t][e]={}),this._studiesCache[t][e].type="series",this._studiesCache[t][e].turnaround=i},s.prototype.seriesTurnaround=function(t,e){return this._studiesCache[t]&&this._studiesCache[t][e]&&this._studiesCache[t][e].turnaround},s.prototype.createSeries=function(t,i,o,n,s,r){function l(t,e,n){h._extrapolationManager.storage(o,t.full_name,i).setLastBarTime(e,n)}var h,c=t,d=new a.OHLCV;this._studiesCache[o]=this._studiesCache[o]||{},this._studiesCache[o][n]={symbol:t,resolution:i,studyObject:d,guid:n,type:"series",turnaround:s},TradingView.ChartapiMessagerInstances[o].onSeriesLoading(n,s),h=this,this._computeStudy(o,d,c,i,n,[],function(e,a,c,d){var p,u,_,f,m,g=h._studiesCache[o][n];if(!g)throw Error("This should never happen");if(p=h._convertBarsTimeToUnix(e),u=p.length>0?1e3*p[0].value[0]:void 0,d.nextTime&&(!u||d.nextTime<u/1e3))return void h.ensureExtendedTo(n,o,d.nextTime);0!==p.length&&(g.firstBarTime=u,_=p[p.length-1],l(c,p.length-1,1e3*_.value[0]),h.rebuildExtrapolatedData(o,t.name,i,c,1e3*_.value[0]),r&&TradingView.ChartapiMessagerInstances[o].onSeriesClearData(n,s),TradingView.ChartapiMessagerInstances[o].onTimescaleUpdate(n,s,p,c,0),f=h._extrapolationManager.storage(o,c.full_name,i),Promise.resolve().then(function(){h._pointsetsManager.broadcastPointsetsUpdates(c.full_name,i,e,f,c,function(t,e){TradingView.ChartapiMessagerInstances[o].onPointsetDataUpdate(t,s,e,c)})})),m=0===p.length||d&&d.endOfData,m&&(h._logMessage("Series has no more data on server: {0}".format(c.full_name)),h._setEndOfData(o,n,s),0===p.length&&TradingView.ChartapiMessagerInstances[o].onSeriesClearData(n,s)),TradingView.ChartapiMessagerInstances[o].onSeriesCompleted(n,s,c.data_status)},function(t,e,r,a,c){var d,p=h._convertBarsTimeToUnix(t),u=p[p.length-1];if(e){if(!h._studiesCache[o][n])throw Error("This should never happen");d=r-1,h._logMessage("New bar arrived: symbol {0}, bar {1}".format(c.full_name,JSON.stringify(u))),TradingView.ChartapiMessagerInstances[o].onTimescaleUpdate(n,s,[u],c,d),l(c,d,1e3*u.value[0]),h.rebuildExtrapolatedData(o,c.full_name,i,c,1e3*u.value[0])}else h._logMessage("Last bar update: symbol {0}, bar {1}".format(c.full_name,JSON.stringify(u))),TradingView.ChartapiMessagerInstances[o].onDataUpdate(n,s,p,void 0,c);h._fireEvent("realtime_tick",t[t.length-1],!0)},function(t){h._logMessage("Series error: {0}".format(t)),TradingView.ChartapiMessagerInstances[o].onSeriesError(n,t),e.enabled("clear_bars_on_series_error")&&TradingView.ChartapiMessagerInstances[o].onSeriesClearData(n,s)})},s.prototype.onMoreTickmarksRequested=function(t,e,i,o,n){this._extrapolationManager.storage(t,i.full_name,o).onTickmarksNeeded(i,n)},s.prototype.removePointset=function(t){this._pointsetsManager.removePointset(t)},s.prototype.rebuildExtrapolatedData=function(t,e,i,o,n){this._extrapolationManager.storage(t,o.full_name,i).rebuild(n,o)},s.prototype.createPointset=function(t,e,i,o,n,s){var r=this._extrapolationManager.storage(t,o.full_name,n);this._pointsetsManager.createPointset(e,i,n,s,r,o)},s.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map(function(t){return t.metainfo})),this._metainfoCache},s.prototype.searchSymbols=function(t,e,i,o){function n(t){s._logMessage("Symbol search response: {0}".format(JSON.stringify(t))),o(t)}this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(t,e,i));var s=this;"function"==typeof this._externalDatafeed.searchSymbols?this._externalDatafeed.searchSymbols(t,e,i,n):this._externalDatafeed.searchSymbolsByName(t,e,i,n)},s.prototype.validateSymbolInfo=function(t){function e(t){console.warn("SymbolInfo validation: "+t)}var i,o;if((void 0===t.minmov||t.minmov<=0)&&e("minmov must be positive"),(void 0===t.pricescale||t.pricescale<=0)&&e("pricescale must be positive"),void 0!==t.name&&0!==t.name.length||e("name must be non-empty stirng"),void 0!==t.session&&0!==t.session.length||e("session must be non-empty stirng"),void 0!==t.timezone&&0!==t.timezone.length||e("timezone must be non-empty stirng"),void 0!==t.intraday_multipliers)if(i=t.intraday_multipliers,Array.isArray(i))for(o=0;o<i.length;++o)"string"!=typeof i[o]&&e('intraday_multipliers[{0}] = "{1}" must be string (now: {2})'.format(o+1,i[o],typeof i[o]));else e("intraday_multipliers must be array")},s.prototype.resolveSymbol=function(t,e,i){var o,n=l.parseSymbol(t).symbol;this._resolveRequests[n]?o=this._resolveRequests[n]:(o=this.resolveSymbolInternal(n),this._resolveRequests[n]=o),o.done(e).fail(i)},s.prototype.resolveSymbolInternal=function(t){var e,i=this,o=$.Deferred();return this._logMessage("Symbol resolve requested: `{0}` ".format(t)),e=!0,this._externalDatafeed.resolveSymbol(t,function(n){e&&console.warn("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),i._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(t,JSON.stringify(n))),n.base_name||(n.base_name=[n.name]),n.legs||(n.legs=[n.name]),n.exchange||(n.exchange=n["exchange-listed"]),n.full_name||(n.full_name=n.symbol||(n.exchange?n.exchange+":"+n.name:n.name)),n.pro_name||(n.pro_name=n.full_name),n.data_status||(n.data_status="streaming"),n.ticker||(n.ticker=n.symbol),!n.session&&n["session-regular"]&&(n.session=n["session-regular"]),!n.minmov&&n.minmovement&&(n.minmov=n.minmovement),i.validateSymbolInfo(n),i._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(t,JSON.stringify(n))),i._fullNameSymbolInfoMap[n.full_name]=n,o.resolve(n)},function(e){i._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(t,e)),o.reject(e)}),e=!1,o.promise()},s.prototype._createMarketStatusWatchers=function(t,e){void 0===this._marketStatusWatchers[t]&&(this._marketStatusWatchers[t]={});var i=this;e.forEach(function(e){void 0===i._marketStatusWatchers[t][e]&&(i._marketStatusWatchers[t][e]=new r(i,t,e))})},s.prototype._removeMarketStatusWatchers=function(t){var e=this;Object.keys(this._marketStatusWatchers[t]||{}).forEach(function(i){e._marketStatusWatchers[t][i].stop()}),this._marketStatusWatchers[t]={}},s.prototype._stopQuotesSubscription=function(t){this._quotesInfo[t].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[t].listenerGUID),this._quotesInfo[t].listenerGUID=void 0),this._removeMarketStatusWatchers(t)},s.prototype._startQuotesSubscription=function(t){function i(e,i){var o=s._marketStatusWatchers[t][e.n];e.symbolname=e.n,e.status=e.s,e.values=e.v,e.values.change=e.v.ch,e.values.last_price=e.v.lp,e.values.change_percent=e.v.chp,e.values.current_session=e.v.cs||o&&o.marketStatus(),e.values.pricescale=i.pricescale,e.values.minmov=i.minmov,e.values.minmove2=i.minmove2||0,e.values.fractional=i.fractional||!1,o&&e.v.cs&&o.stop(),TradingView.ChartapiMessagerInstances[t].onQuotesData([t].concat([e]))}function o(t){t.forEach(function(t){void 0!==n[t.n]?null!==n[t.n]&&i(t,n[t.n]):s.resolveSymbol(t.n,function(e){n[t.n]=e,i(t,e)},function(){n[t.n]=null})})}var n={},s=this,r=this._quotesInfo[t].symbols;0!==r.length&&(this._externalDatafeed.getQuotes&&!e.enabled("charting_library")&&this._externalDatafeed.getQuotes(r,function(e){s._quotesInfo[t]&&(o(e),s._quotesInfo[t].listenerGUID=t,s._externalDatafeed.subscribeQuotes(r,s._quotesInfo[t].fastSymbols,o,s._quotesInfo[t].listenerGUID))}),this._createMarketStatusWatchers(t,r))},s.prototype._restartQuotesSubscription=function(t){this._stopQuotesSubscription(t),this._startQuotesSubscription(t)},s.prototype.quoteCreateSession=function(t){this._quotesInfo[t]={symbols:[],fastSymbols:[],listenerGUID:void 0}},s.prototype.quoteDeleteSession=function(t){this._stopQuotesSubscription(t),this._quotesInfo[t]=null},s.prototype.quoteSetFields=function(t,e){},s.prototype.quoteAddSymbols=function(t,e){this._quotesInfo[t].symbols=this._filteredSymbols(this._quotesInfo[t].symbols.concat(e)),this._restartQuotesSubscription(t)},s.prototype.quoteRemoveSymbols=function(t,e){this._quotesInfo[t].symbols=this._quotesInfo[t].symbols.filter(function(t){return e.indexOf(t)<0}),this._restartQuotesSubscription(t)},s.prototype.quoteFastSymbols=function(t,e){this._quotesInfo[t].fastSymbols=this._filteredSymbols(e),this._restartQuotesSubscription(t)},s.prototype.quoteHibernateAll=function(t){},s.prototype._stopDepthSubscription=function(t){this._depthInfo[t].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[t].listenerGUID),this._depthInfo[t].listenerGUID=void 0)},s.prototype._startDepthSubscription=function(t){function e(t){return t.map(function(t){return{p:t.price,v:t.volume}})}function i(t){var i={};return i.s=s,i.bids=e(t.bids),i.asks=e(t.asks),i}function o(e){e.snapshot?TradingView.ChartapiMessagerInstances[t].onDepthData([t].concat([i(e)])):TradingView.ChartapiMessagerInstances[t].onDepthUpdate([t].concat([i(e)]))}var n=this,s=this._depthInfo[t].symbol;s&&this._fullNameSymbolInfoMap[s]&&this._externalDatafeed.subscribeDepth&&(n._depthInfo[t].listenerGUID=this._externalDatafeed.subscribeDepth(s,function(e){n._depthInfo[t]&&o(e)}))},s.prototype._restartDepthSubscription=function(t){this._stopDepthSubscription(t),this._startDepthSubscription(t)},s.prototype.depthCreateSession=function(t){this._depthInfo[t]={symbol:null,listenerGUID:void 0}},s.prototype.depthDeleteSession=function(t){this._depthInfo[t].symbol=null,this._stopDepthSubscription(t),delete this._depthInfo[t]},s.prototype.depthSetSymbol=function(t,e){this._depthInfo[t].symbol=e,this._restartDepthSubscription(t)},s.prototype._filteredSymbols=function(t){var e=[];return t.forEach(function(t){t instanceof Object||e.indexOf(t)<0&&e.push(t)}),e},s.prototype._isEndOfData=function(t,e,i){var o=t+"!"+e+"@"+i;return!!this._endOfData[o]},s.prototype._setEndOfData=function(t,e,i){var o=t+"!"+e+"@"+i;this._endOfData[o]=!0},s.prototype.alignTimePoint=function(t,e,i){var o=this._create_dwm_aligner(e,i);return o?o.tradingDayToSessionStart(1e3*t)/1e3:t},s.prototype.serverTimeOffset=function(){return this._serverTimeOffset},t.exports=s}).call(e,i(1),i(137))},function(t,e,i){(function(e){"use strict";var o=i(142),n={},s=function(t,i,s){function r(){var t={};t.symbolname=_,t.status="ok",t.values={},t.values.current_session=p,n[_]=p,TradingView.ChartapiMessagerInstances[f].onQuotesData([f].concat([t]))}function a(t,i,n){var s=e.get_timezone(i);h=(new o.Session).init(s,t),c=n,m=setTimeout(l,6e4),l(),r()}function l(){var t,e;if(h){if(c)return void(p="out_of_session");t=o.isTradingNow(new Date,h),e=t?"market":"out_of_session",e!==p&&(p=e,r())}}var h,c,d={},p=n[s]||"out_of_session",u=!1,_=s,f=i,m=null;return t.resolveSymbol(s,function(t){u||a(t.session,t.timezone,t.expired)},function(){}),d.stop=function(){u=!0,m&&clearTimeout(m)},d.marketStatus=function(){return p},d};t.exports=s}).call(e,i(137))},function(t,e,i){(function(e){"use strict";var o=function(){function t(t){this.host=t,this.cache={}}function o(t){var e=t.indexOf(",");return e===-1?t:t.slice(0,e)}function n(t,e,i,o,n){return n+t+e+i+(s(o)?"_":"")}function s(t){return t.has_empty_bars||t.force_session_rebuild}function r(t){if(0!==t.indexOf("="))return{symbol:t};var e;try{e=JSON.parse(t.slice(1))}catch(e){return{symbol:t}}return e.type&&(0===e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?e.builder=new d.HeikenAshi:console.error("unknown builder type: "+e.type)),"string"!=typeof e.symbol&&(e.session=e.symbol.session||e.session,e.symbol=e.symbol.symbol),e}function a(e){t.instance=new t(e),d.setupFeed(t.instance)}var l,h,c,d=i(605),p=i(142),u=d.Symbol,_=d.StudyEngine,f=d.BarBuilder,m=d.BarSet;return t.prototype.getCache=function(t){return this.cache[t]},t.prototype.putCache=function(t,e){this.cache[t]=e},t.prototype.subscribe=function(t,e,i,o,s,r,a,l){var h=n(t,e,i,r,a),c=this.getCache(h);return c||(c=this.createItem(t,e,i,r,l),this.putCache(h,c)),c.listeners.addListener(o,s),{key:h,listener:o}},t.prototype.unsubscribe=function(t){var e=this.getCache(t.key);e&&e.listeners.removeListener(t.listener)},t.prototype.removeUnused=function(){var t,e,i,o,n,s=[];for(t in this.cache)this.cache[t]&&(e=this.cache[t],0===e.listeners.listenersCount()&&s.push(t));if(0!==s.length){for(i=0;i<s.length;i++)o=s[i],n=this.cache[o],this.cache[o]=null,n.stop();this.removeUnused()}},t.prototype.rebuildFrom=function(t,e,i){var o,n,s,r,a=u.parsePeriod(t),l=u.parsePeriod(e);if(""!==a.resolution&&!a.isSeconds){if(i.has_weekly_and_monthly)return a.resolution;if(void 0===i.has_daily||i.has_daily)return"D";""!==l.resolution&&(l.resolution="",l.interval=i.intraday_multipliers?i.intraday_multipliers[0]:1)}if(a.isIntraday&&void 0!==i.has_intraday&&!i.has_intraday)return"";if(a.isSeconds&&!i.has_seconds)return"";if(o=""!==a.resolution?l.interval:""===l.resolution?Math.min(a.interval,l.interval):a.interval,(n=a.isIntraday?i.intraday_multipliers:i.seconds_multipliers)&&-1===n.indexOf(o)){for(s=n.length-1;s>=0;s--)if(r=+n[s],o%r==0)return r+(a.isSeconds?"S":"");return""}return o+(a.isSeconds?"S":"")},t.prototype.createItem=function(t,e,i,n,a){var d,p,u,_,m,g,v=new c,y=r(t);return y.builder?new h(v,y.symbol,e,i,y.builder,n,a):(d=o(e),p=this.rebuildFrom(d,o(i),n),u=s(n),d!==p||u?(_=n.has_empty_bars,m=$.extend({},n),u&&(m.has_empty_bars=!1,m.force_session_rebuild=!1),new h(v,y.symbol,e,p,new f(e,_),m,a)):(g=y.session&&"extended"!==y.session,new l(v,y.symbol,e,i,g,this.host,n,a)))},l=function(t,e,i,n,s,r,a,l){this.listeners=t,this.host=r;var h=this;this.host.resolve(e,function(t){s&&t.regular_session&&(t.session=t.regular_session);var r=h.calculateFromTo(t,n||i,e,l);h.subs=h.host.subscribe(t,o(i),r,function(t){h.listeners.fire(t)},function(t){h.listeners.onError(t)})},function(t){h.listeners.onError(t)})},l.prototype._create_dwm_aligner=function(t,i){var o=e.get_timezone(i.timezone),n=new p.Session;return n.init(o,i.session),u.newBarBuilder(t,n,n)},l.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)},l.prototype.calculateFromTo=function(t,i,o,n){var s,r,a,l,h,c,d,_,f=u.parsePeriod(i),m=(new Date).valueOf(),g=t.expired?e.cal_to_utc(e.get_timezone(t.timezone),new Date(1e3*t.expiration_date))||m:m;return""===f.resolution?(r=f.interval,a="D"):"S"===f.resolution?(r=10*f.interval,a=""):(l="D"===f.resolution?1:"W"===f.resolution?5:30,r=12*l*f.interval,a="M"),f.range?(r=f.range.interval,a=f.range.resolution):this.host.calculateHistoryDepth&&(h=this.host.calculateHistoryDepth(i,a,r))&&(r=h.intervalBack||r,a=void 0===h.resolutionBack?a:h.resolutionBack),c=t.sessionString||t.session,s=p.alignPeriodsBack(c,a,r,1,g),n&&n.getRangeExtensionTime&&(d=n.getRangeExtensionTime())&&(s=Math.min(1e3*d,s)),n&&n.getRangeExtensionCount&&(_=n.getRangeExtensionCount())>0&&(s=p.alignPeriodsBack(c,f.resolution,f.interval,_,s)),{from:s,to:g+6e4}},h=function(t,e,i,o,n,s,r){if(this.listeners=t,this.isRecalculated=!1,""===o)return console.error("unsupported resolution for rebuild: "+i),void this.listeners.onError("unsupported resolution for rebuild: "+i);this.symbolInfo=s;var a=this;this.engine=new _({tickerid:e,period:o,periodBase:i,body:n,symbolInfo:s,rangeExtension:r,recalc:function(t,e){a._recalc(e)},out:function(t,e){a._out(t,e)},onErrorCallback:function(t){a.listeners.onError(t)}})},h.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},h.prototype._recalc=function(t){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new m(this.symbolInfo)),t&&(this.barset.nextTime=t.nextTime,this.barset.endOfData=t.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},h.prototype._out=function(t,e){var i,o,n,s,r,a,l,h=e[0];if(!isNaN(h)){if(i={time:h,open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5],updatetime:e[6]},o=e[7],this.barset||(this.barset=new m(t.info)),(n=e[8])instanceof Array)for(s=0;s<n.length;s++)r=e[9],a=n[s],l={time:a,open:r,high:r,low:r,close:r,volume:0,updatetime:a},this.barset.add(l,!0),this.isRecalculated&&this.listeners.fire(this.barset);this.barset.add(i,o),this.isRecalculated&&this.listeners.fire(this.barset)}},c=function(){this.listeners=[]},c.prototype.listenersCount=function(){return this.listeners.reduce(function(t,e){return t+(e?1:0)},0)},c.prototype.addListener=function(t,e){this.listeners.push({dataListener:t,onErrorCallback:e}),this.barset&&t(this.barset),this.errorMsg&&e(this.errorMsg)},c.prototype.removeListener=function(t){var e,i=this.listeners.filter(function(e){return e.dataListener===t});0!==i.length&&(e=this.listeners.indexOf(i[0]),delete this.listeners[e])},c.prototype.onError=function(t){var e,i,o,n;for(this.errorMsg=t||"unspecified error",e=this.listeners,i=e.length,o=0;o<i;o++)(n=e[o])&&n.onErrorCallback&&n.onErrorCallback(t)},c.prototype.fire=function(t){var e,i,o,n;for(this.barset=t,e=this.listeners,i=e.length,o=0;o<i;o++)(n=e[o])&&n.dataListener(t)},{setupFeed:a,parseSymbol:r,unsubscribeUnused:function(){t.instance.removeUnused()}}}();t.exports=o}).call(e,i(137))},function(t,e,i){"use strict";var o=function(){function t(t,e,i){return t+","+e+","+i}function e(e,i,o){delete n[t(e,i,o)]}function o(e,i,o){function r(t){return"undefined"!=typeof TradingView&&TradingView.ChartapiMessagerInstances?n[t]=new a(TradingView.ChartapiMessagerInstances[e],l.pureResolution):n[t]=new a(null,l.pureResolution),n[t]}var l=s.Symbol.parsePeriod(o),h=t(e,i,l.pureResolution);return n[h]?n[h]:r(h)}var n={},s=i(605),r=i(142),a=function(t,e,i){this._chartApiMessager=t,this._lastRealBarTime=null,this._lastRealBarIndex=null,this._resolution=e,this._extrapolatedBarsCache=[],this._onReadyCallbacks=[],this._maxDepth=i||100};return a.prototype.ready=function(){return null!==this._lastRealBarIndex},a.prototype.rebuild=function(t,e){this._lastRealBarTime=t;var i=this._extrapolatedBarsCache.length;this._extrapolatedBarsCache=[],this.ensureExtrapolatedToBar(e,i)},a.prototype.historyExtrapolator=function(){return void 0===this._historyExtrapolator&&(this._historyExtrapolator=new a(null,this._resolution,Math.max(this._maxDepth,1e3))),this._historyExtrapolator},a.prototype.getPointTimeUTC=function(t,e,i){var o,n;return 0===e?t:!this.ready()||t<this._lastRealBarTime/1e3?(this.historyExtrapolator().setLastBarTime(0,1e3*t),this.historyExtrapolator().getPointTimeUTC(t,e,i)):(o=0===this._extrapolatedBarsCache.length||t===this._lastRealBarTime/1e3,n=o?-1:this.indexOfBar(t,i)-this._lastRealBarIndex-1,this.ensureExtrapolatedToBar(i,n+e+1),this._extrapolatedBarsCache[n+e])},a.prototype.findDistanceInBars=function(t,e,i){return t===e?0:(this.historyExtrapolator().setLastBarTime(0,1e3*t),this.historyExtrapolator().indexOfBar(e,i))},a.prototype.indexOfBar=function(t,e){this._ensureExtrapolatedToTime(e,1e3*t);var i=r.lower_bound(this._extrapolatedBarsCache,t,function(t,e){return t>e?1:t<e?-1:0});return i===-1?i:this._lastRealBarIndex+i+1},a.prototype._extrapolateData=function(t,e){var i,o,n;if(!this._lastRealBarTime)throw Error("No real bars known, so cannot extrapolate anything");if(!(i=e(this._lastRealBarTime))||0===i.length)return void(null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,t,this._resolution));for(o=0;o<i.length;++o)i[o]=i[o]/1e3;for(i[0]===this._lastRealBarTime/1e3&&(i=i.slice(1)),this._extrapolatedBarsCache=i,n=i.slice(0),n.sort(),o=0;o<n.length-1;++o)n[o]===n[o+1]&&console.error("Duplicating extrapolated bars: duplicated "+new Date(1e3*n[o]));null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,i,t,this._resolution)},a.prototype.onTickmarksNeeded=function(t,e){if(this.ready())this.ensureExtrapolatedToBar(t,e);else{var i=this;this._onReadyCallbacks.push(function(){i.ensureExtrapolatedToBar(t,e)})}},a.prototype.ensureExtrapolatedToBar=function(t,e){var i=this;return this._extrapolateData(t,function(o){return i._extrapolatedBarsCache.length>=e||!i._shouldExtrapolateMore()?null:r.extrapolateBarsFrontByCount(i.newBarBuilder(t),o,e)})},a.prototype._ensureExtrapolatedToTime=function(t,e){var i=this;return this._extrapolateData(t,function(o){if(o>=e||!i._shouldExtrapolateMore())return null;var n=r.extrapolateBarsFrontToTime(i.newBarBuilder(t),o,e);return n[n.length-1]<e&&console.warn("Extrapolation error: not enough data created"),n})},a.prototype.newBarBuilder=function(t){var e=s.Symbol.newSession(t.timezone,t.session);return s.Symbol.newBarBuilder(this._resolution,e)},a.prototype._shouldExtrapolateMore=function(){return this._extrapolatedBarsCache.length<this._maxDepth},a.prototype.setLastBarTime=function(t,e){(null===this._lastRealBarIndex||this._lastRealBarIndex===t&&this._lastRealBarTime!==e)&&(this._extrapolatedBarsCache=[]),this._extrapolatedBarsCache&&this._extrapolatedBarsCache.length&&this._lastRealBarIndex!==t&&(this._lastRealBarIndex>t?this._extrapolatedBarsCache=[]:this._extrapolatedBarsCache.shift(t-this._lastRealBarIndex)),this._lastRealBarIndex=t,this._lastRealBarTime=e;for(var i=0;i<this._onReadyCallbacks.length;++i)this._onReadyCallbacks[i]();this._onReadyCallbacks=[]},{remove:e,storage:o}}();t.exports=o},function(t,e,i){(function(e){"use strict";var o=i(142),n=i(93),s=function(){function t(t,e){return t}function s(t,e){var i=m.get_timezone(t.timezone),n=new o.Session;return n.init(i,t.session),f.Symbol.newBarBuilder(e,n,n)}function r(e,i,o,n,s,r){var a,l,h,c,d=t(i,o);for(u.hasOwnProperty(d)||(u[d]=[]),a=[],l=0;l<n.length;++l)n[l][1]<0&&(n[l][1]=0),0!==n[l][1]?(h=s.getPointTimeUTC(n[l][0],n[l][1],r),a.push(h)):n[l][0]&&a.push(n[l][0]);c={guid:e,points:a},u[d].push(c)}function a(t){var e,i,o;for(e in u)for(i=u[e],o=0;o<i.length;++o)if(i[o].guid===t)return void i.splice(o,1)}function l(t,e,i,o,n){var s,r,a,l=[];for(s=0;s<t.points.length;++s){if(r=t.points[s],null===(a=c(e,r,i,o,n)))return null;l.push({index:s,value:[a,r]})}return l}function h(e,i,o,n,s,r){var a,h,c,d,p=t(e,i);if(u.hasOwnProperty(p))for(a=u[p].length,h=0;h<a;++h)c=u[p][h],null!==(d=l(c,o,n,s,i))&&r(c.guid,d)}function c(t,e,i,r,a){var l,h,c=new n(a),d=s(r,a);return 1e3*(e=(c.isDWM()?d.tradingDayToSessionStart:d.alignTimeIfPossible).call(d,1e3*e)/1e3)<t[0].value[0]?-p(r,a,e,t[0].value[0]/1e3,i):(l=o.lower_bound(t,1e3*e,function(t,e){return t.value[0]>e?1:t.value[0]<e?-1:0}))>=0&&e<t[t.length-1].value[0]?(t[l].value[0]/1e3!==e&&0!==l&&l--,t[l].index):(h=i.indexOfBar(e,r),h===-1?null:h)}function d(t,e,i,o,s){function r(t,e){var i=new Date(1e3*t),o=new Date(1e3*e),n=12*(o.getFullYear()-i.getFullYear());return n-=i.getMonth()+1,n+=o.getMonth(),n<=0?0:n}var a,l,h,c,d,p,u,_,f,g,v,y,b,w,S;if(e.kind()===n.MONTHS)a=r(o,s)/e.multiplier();else if(e.kind()===n.WEEKS)l=Math.ceil((s-o)/604800),a=Math.ceil(l/e.multiplier());else{if(h=m.utc_to_cal(i.timezone,+new Date(1e3*o)),c=m.utc_to_cal(i.timezone,+new Date(1e3*s)),(d=(s-o)/86400)>4*(7-i.spec.weekEndsCount()))u=d/7,p=u*(7-i.spec.weekEndsCount());else{for(_=0,f={},g=h;g.valueOf()<=c.valueOf();g=m.add_days_considering_dst(i.timezone,g,1))v=m.get_day_of_week(g),void 0===f[v]&&(f[v]=i.spec.isWeekEnd(v)),f[v]&&_++;p=d-_}if(e.kind()===n.DAYS)a=Math.ceil(p/e.multiplier());else{if(y=e.kind()===n.HOURS?60*e.multiplier()*60:e.kind()===n.SECONDS?e.multiplier():60*e.multiplier(),d<1&&(b=i.spec.findSession(m.get_day_of_week(h),m.get_minutes_from_midnight(h)),w=i.spec.findSession(m.get_day_of_week(c),m.get_minutes_from_midnight(c)),b===w))return Math.ceil((s-o)/y);v=i.spec.entries[0]._dayOfWeek,S=60*i.spec.entries.reduce(function(t,e){return t+(e._dayOfWeek===v?e._length:0)},0),a=Math.ceil(p*S/y)}}return a}function p(t,e,i,r,a){var l,h,c,p=new n(e),u=m.get_timezone(t.timezone),_=new o.Session;return _.init(u,t.session),l=s(t,e),h=p.isDWM()?l.tradingDayToSessionStart:l.alignTimeIfPossible,i=h.call(l,1e3*i)/1e3,r=h.call(l,1e3*r)/1e3,i>=r?0:(c=d(t,p,_,i,r),c>=1e3?c:a.findDistanceInBars(i,r,t))}var u={},_="undefined"!=typeof window?window:e,f=i(605),m=_.PineJsCalendar?_.PineJsCalendar:i(137);return{createPointset:r,removePointset:a,broadcastPointsetsUpdates:h,tests:{approxBarsInterval:d,indexOfTime:c}}}();t.exports=s}).call(e,function(){return this}())},function(t,e,i){"use strict";var o=i(605);JSServer.studyLibrary=[{name:"Accumulation/Distribution",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Accumulation/Distribution",shortDescription:"Accum/Dist",is_price_study:!1,inputs:[],id:"Accumulation/Distribution@tv-basicstudies-1",scriptIdPart:"",name:"Accumulation/Distribution"},constructor:function(){this.f_0=function(t,e,i,n){return o.Std.or(o.Std.and(o.Std.eq(t,e),o.Std.eq(t,i)),o.Std.eq(e,i))?0:(2*t-i-e)/(e-i)*n},this.main=function(t,e){var i,n,s;return this._context=t,this._input=e,i=this.f_0(o.Std.close(this._context),o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),n=o.Std.cum(i,this._context),s=n,[s]}}},{name:"Advance/Decline",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Advance/Decline",shortDescription:"AD",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Advance/Decline@tv-basicstudies-1",scriptIdPart:"",name:"Advance/Decline"},constructor:function(){this.f_0=function(t,e){return o.Std.gt(t,e)},this.f_1=function(t,e){return o.Std.lt(t,e)},this.f_2=function(t,e){return 0===e?t:t/e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.open(this._context)),s=this._context.new_var(n),r=o.Std.sum(s,i,this._context),a=this.f_1(o.Std.close(this._context),o.Std.open(this._context)),l=this._context.new_var(a),h=o.Std.sum(l,i,this._context),c=this.f_2(r,h),d=c,[d]}}},{name:"Arnaud Legoux Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:.85,in_2:6}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Arnaud Legoux Moving Average",shortDescription:"ALMA",is_price_study:!0,inputs:[{id:"in_0",name:"Window Size",defval:9,type:"integer",min:0,max:5e3},{id:"in_1",name:"Offset",defval:.85,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"Sigma",defval:6,type:"float",min:-1e12,max:1e12}],id:"Arnaud Legoux Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Arnaud Legoux Moving Average"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._input(1),r=this._input(2),a=this._context.new_var(i),l=o.Std.alma(a,n,s,r),[l]}}},{name:"Aroon",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF6A00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0094FF"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Aroon",shortDescription:"Aroon",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Aroon@tv-basicstudies-1",scriptIdPart:"",name:"Aroon"},constructor:function(){this.f_0=function(t,e){return 100*(t+e)/e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.high(this._context),s=i+1,r=this._context.new_var(n),a=o.Std.highestbars(r,s,this._context),l=this.f_0(a,i),h=o.Std.low(this._context),c=this._context.new_var(h),d=o.Std.lowestbars(c,s,this._context),p=this.f_0(d,i),u=l,_=p,[u,_]}}},{name:"Average Directional Index",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ADX",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Average Directional Index",shortDescription:"ADX",is_price_study:!1,inputs:[{id:"in_0",name:"ADX Smoothing",defval:14,type:"integer",min:-1e12,max:1e12},{id:"in_1",name:"DI Length",defval:14,type:"integer",min:-1e12,max:1e12}],id:"average_directional_Index@tv-basicstudies-1",scriptIdPart:"",name:"Average Directional Index"},constructor:function(){this.f_0=function(t){var e=this._context.new_var(o.Std.high(this._context)),i=o.Std.change(e),n=this._context.new_var(o.Std.low(this._context)),s=-o.Std.change(n),r=this._context.new_var(o.Std.tr(void 0,this._context)),a=o.Std.rma(r,t,this._context),l=this._context.new_var(o.Std.and(o.Std.gt(i,s),o.Std.gt(i,0))?i:0),h=o.Std.fixnan(100*o.Std.rma(l,t,this._context)/a,this._context),c=this._context.new_var(o.Std.and(o.Std.gt(s,i),o.Std.gt(s,0))?s:0);return[h,o.Std.fixnan(100*o.Std.rma(c,t,this._context)/a,this._context)]},this.f_1=function(t,e){var i=this.f_0(t),n=i[0],s=i[1],r=n+s,a=this._context.new_var(o.Std.abs(n-s)/(o.Std.eq(r,0)?1:r));return[100*o.Std.rma(a,e,this._context)]},this.main=function(t,e){return this._context=t,this._input=e,this.f_1(this._input(0),this._input(1))}}},{name:"Average True Range",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Average True Range",shortDescription:"ATR",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Average True Range@tv-basicstudies-1",scriptIdPart:"",name:"Average True Range"},constructor:function(){this.main=function(t,e){var i,n,s,r;return this._context=t,this._input=e,i=this._input(0),n=o.Std.tr(this._context),s=this._context.new_var(n),r=o.Std.rma(s,i,this._context),[r]}}},{name:"Awesome Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Awesome Oscillator",shortDescription:"AO",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[],id:"Awesome Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Awesome Oscillator"},constructor:function(){this.f_0=function(t,e){return t-e},this.f_1=function(t){return o.Std.le(t,0)?0:1},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p;return this._context=t,this._input=e,i=o.Std.hl2(this._context),n=this._context.new_var(i),s=o.Std.sma(n,5,this._context),r=this._context.new_var(i),a=o.Std.sma(r,34,this._context),l=this.f_0(s,a),h=l,c=this._context.new_var(l),d=o.Std.change(c),p=this.f_1(d),[h,p]}}},{name:"Balance of Power",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Balance of Power",shortDescription:"Balance of Power",is_price_study:!1,inputs:[],id:"Balance of Power@tv-basicstudies-1",scriptIdPart:"",name:"Balance of Power"},constructor:function(){this.f_0=function(t,e,i,o){return(t-e)/(i-o)},this.main=function(t,e){return this._context=t,this._input=e,[this.f_0(o.Std.close(this._context),o.Std.open(this._context),o.Std.high(this._context),o.Std.low(this._context))]}}},{name:"Bollinger Bands",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands",shortDescription:"BB",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands"},constructor:function(){this.f_0=function(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._input(1),r=this._context.new_var(i),a=o.Std.sma(r,n,this._context),l=this._context.new_var(i),h=o.Std.stdev(l,n,this._context),c=this.f_0(s,h),d=this.f_1(a,c),p=this.f_2(a,c),u=a,_=d,f=p,[u,_,f]}}},{name:"Bollinger Bands %B",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:1},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],filledAreasStyle:{fill_0:{color:"#008080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands %B",shortDescription:"BB %B",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands %B@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands %B"},constructor:function(){this.f_0=function(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.f_3=function(t,e,i){return(t-e)/(i-e)},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._input(1),r=this._context.new_var(i),a=o.Std.sma(r,n,this._context),l=this._context.new_var(i),h=o.Std.stdev(l,n,this._context),c=this.f_0(s,h),d=this.f_1(a,c),p=this.f_2(a,c),u=this.f_3(i,p,d),_=u,[_]}}},{name:"Bollinger Bands Width",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands Width",shortDescription:"BBW",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands Width@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands Width"},constructor:function(){this.f_0=function(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.f_3=function(t,e,i){return(t-e)/i},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._input(1),r=this._context.new_var(i),a=o.Std.sma(r,n,this._context),l=this._context.new_var(i),h=o.Std.stdev(l,n,this._context),c=this.f_0(s,h),d=this.f_1(a,c),p=this.f_2(a,c),u=this.f_3(d,p,a),_=u,[_]}}},{name:"Chaikin Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Money Flow",shortDescription:"CMF",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Chaikin Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Money Flow"},constructor:function(){this.f_0=function(t,e,i,n){return o.Std.or(o.Std.and(o.Std.eq(t,e),o.Std.eq(t,i)),o.Std.eq(e,i))?0:(2*t-i-e)/(e-i)*n},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),s=this._context.new_var(n),r=o.Std.sum(s,i,this._context),a=o.Std.volume(this._context),l=this._context.new_var(a),h=o.Std.sum(l,i,this._context),c=this.f_1(r,h),d=c,[d]}}},{name:"Chaikin Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:3,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Oscillator",shortDescription:"Chaikin Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"short",defval:3,type:"integer",min:1,max:2e3},{id:"in_1",name:"long",defval:10,type:"integer",min:1,max:2e3}],id:"Chaikin Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Oscillator"},constructor:function(){this.f_0=function(t,e){return t-e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=o.Std.accdist(this._context),r=this._context.new_var(s),a=o.Std.ema(r,i,this._context),l=this._context.new_var(s),h=o.Std.ema(l,n,this._context),c=this.f_0(a,h),d=c,[d]}}},{name:"Chande Kroll Stop",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10,in_1:1,in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Long",histogramBase:0,joinPoints:!1},plot_1:{title:"Short",histogramBase:0,joinPoints:!1}},description:"Chande Kroll Stop",shortDescription:"Chande Kroll Stop",is_price_study:!0,inputs:[{id:"in_0",name:"p",defval:10,type:"integer",min:1,max:4999},{id:"in_1",name:"x",defval:1,type:"integer",min:1,max:1e12},{id:"in_2",name:"q",defval:9,type:"integer",min:1,max:1e12}],id:"Chande Kroll Stop@tv-basicstudies-1",scriptIdPart:"",name:"Chande Kroll Stop"},constructor:function(){this.f_0=function(t,e,i){return t-e*i},this.f_1=function(t,e,i){return t+e*i},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=this._input(2),r=o.Std.high(this._context),a=this._context.new_var(r),l=o.Std.highest(a,i,this._context),h=o.Std.atr(i,this._context),c=this.f_0(l,n,h),d=this._context.new_var(r),p=o.Std.lowest(d,i,this._context),u=this.f_1(p,n,h),_=this._context.new_var(c),f=o.Std.highest(_,s,this._context),m=this._context.new_var(u),g=o.Std.lowest(m,s,this._context),v=g,y=f,[v,y]}}},{name:"Chande Momentum Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chande Momentum Oscillator",shortDescription:"ChandeMO",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:2e3}],id:"Chande Momentum Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chande Momentum Oscillator"},constructor:function(){this.f_0=function(t){return o.Std.ge(t,0)?t:0},this.f_1=function(t){return o.Std.ge(t,0)?0:-t},this.f_2=function(t,e){return 100*t/e},this.f_3=function(t,e){return this.f_2(t-e,t+e)},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),s=this._context.new_var(n),r=o.Std.change(s),a=this.f_0(r),l=this.f_1(r),h=this._context.new_var(a),c=o.Std.sum(h,i,this._context),d=this._context.new_var(l),p=o.Std.sum(d,i,this._context),u=this.f_3(c,p),_=u,[_]}}},{name:"Chop Zone",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#34dddd",width:1,style:0},1:{color:"#006400",width:1,style:0},2:{color:"#98fb98",width:1,style:0},3:{color:"#00FF00",width:1,style:0},4:{color:"#8B0000",width:1,style:0},5:{color:"#FF0000",width:1,style:0},6:{color:"#FF7F00",width:1,style:0},7:{color:"#ffc04c",width:1,style:0},8:{color:"#FFFF00",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Chop Zone",shortDescription:"Chop Zone",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"},2:{name:"Color 2"},3:{name:"Color 3"},4:{name:"Color 4"},5:{name:"Color 5"},6:{name:"Color 6"},7:{name:"Color 7"},8:{name:"Color 8"}},valToIndex:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8}}},inputs:[],id:"chop_zone@tv-basicstudies-1",scriptIdPart:"",name:"Chop Zone"},constructor:function(){this.f_0=function(){var t=o.Std.close(this._context),e=o.Std.hlc3(this._context),i=this._context.new_var(o.Std.high(this._context)),n=o.Std.highest(i,30,this._context),s=o.Std.lowest(i,30,this._context),r=25/(n-s)*s,a=this._context.new_var(t),l=this._context.new_var(o.Std.ema(a,34,this._context)),h=(l.get(1)-l.get(0))/e*r,c=o.Std.sqrt(1+h*h),d=o.Std.round(180*o.Std.acos(1/c)/3.141592653589793),p=o.Std.iff(o.Std.gt(h,0),-d,d),u=o.Std.and(o.Std.gt(p,-2.14),o.Std.le(p,-.71))?7:8,_=o.Std.and(o.Std.gt(p,-3.57),o.Std.le(p,-2.14))?6:u,f=o.Std.and(o.Std.gt(p,-5),o.Std.le(p,-3.57))?5:_,m=o.Std.le(p,-5)?4:f,g=o.Std.and(o.Std.lt(p,2.14),o.Std.ge(p,.71))?3:m,v=o.Std.and(o.Std.lt(p,3.57),o.Std.ge(p,2.14))?2:g,y=o.Std.and(o.Std.lt(p,5),o.Std.ge(p,3.57))?1:v;return[1,o.Std.ge(p,5)?0:y]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Choppiness Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:61.8},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:38.2}],filledAreasStyle:{fill_0:{color:"#008000",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Choppiness Index",shortDescription:"CHOP",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Choppiness Index@tv-basicstudies-1",scriptIdPart:"",name:"Choppiness Index"},constructor:function(){this.f_0=function(t,e,i,n){return 100*o.Std.log10(t/(e-i))/n},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f;return this._context=t,this._input=e,i=this._input(0),n=o.Std.atr(1,this._context),s=this._context.new_var(n),r=o.Std.sum(s,i,this._context),a=o.Std.high(this._context),l=this._context.new_var(a),h=o.Std.highest(l,i,this._context),c=o.Std.low(this._context),d=this._context.new_var(c),p=o.Std.lowest(d,i,this._context),u=o.Std.log10(i),_=this.f_0(r,h,p,u),f=_,[f]}}},{name:"Commodity Channel Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:100},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-100}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Commodity Channel Index",shortDescription:"CCI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Commodity Channel Index@tv-basicstudies-1",scriptIdPart:"",name:"Commodity Channel Index"},constructor:function(){this.f_0=function(t,e,i){return(t-e)/(.015*i)},this.main=function(t,e){var i,n,s,r,a,l,h,c;return this._context=t,this._input=e,i=o.Std.hlc3(this._context),n=this._input(0),s=this._context.new_var(i),r=o.Std.sma(s,n,this._context),a=this._context.new_var(i),l=o.Std.dev(a,n,this._context),h=this.f_0(i,r,l),c=h,[c]}}},{name:"Coppock Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:14,in_2:11}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Coppock Curve",shortDescription:"Coppock Curve",is_price_study:!1,inputs:[{id:"in_0",name:"WMA Length",defval:10,type:"integer",min:-1e12,max:5e3},{id:"in_1",name:"Long RoC Length",defval:14,type:"integer",min:1,max:4999},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:1,max:4999}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve"},constructor:function(){this.f_0=function(t,e){return t+e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=this._input(2),r=o.Std.close(this._context),a=this._context.new_var(r),l=o.Std.roc(a,n),h=this._context.new_var(r),c=o.Std.roc(h,s),d=this.f_0(l,c),p=this._context.new_var(d),u=o.Std.wma(p,i,this._context),_=u,[_]}}},{name:"Correlation Coeff",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:40,visible:!0,color:"#800080"}},precision:4,inputs:{in_0:"AAPL",in_1:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Correlation Coeff",shortDescription:"CC",is_price_study:!1,inputs:[{id:"in_0",name:"sym",defval:"AAPL",type:"symbol"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Correlation Coeff@tv-basicstudies-1",scriptIdPart:"",name:"Correlation Coeff"},constructor:function(){this.init=function(t,e){this._context=t,this._input=e,this._context.new_sym(this._input(0),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p;return this._context=t,this._input=e,i=this._context.new_var(this._context.symbol.time),this._input(0),o.Std.period(this._context),n=o.Std.close(this._context),s=this._input(1),this._context.select_sym(1),r=this._context.new_var(this._context.symbol.time),a=o.Std.close(this._context),l=this._context.new_var(a),this._context.select_sym(0),h=l.adopt(r,i,0),c=this._context.new_var(n),d=this._context.new_var(h),p=o.Std.correlation(c,d,s,this._context),[p]}}},{name:"Detrended Price Oscillator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:21,in_1:!1}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"DPO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Detrended Price Oscillator",shortDescription:"DPO",is_price_study:!1,is_hidden_study:!1,id:"detrended_price_oscillator@tv-basicstudies-1",bands:[{id:"hline_0",name:"Zero",isHidden:!1}],inputs:[{id:"in_0",name:"Period",defval:21,type:"integer",min:1,max:1e12},{id:"in_1",name:"isCentered",defval:!1,type:"bool"}],scriptIdPart:"",name:"Detrended Price Oscillator"},constructor:function(){this.f_0=function(){var t=this._input(0),e=this._input(1),i=Math.floor(t/2+1),n=this._context.new_var(o.Std.close(this._context)),s=this._context.new_var(o.Std.sma(n,t,this._context)),r=this._context.new_var(o.Std.close(this._context)),a=r.get(i)-s,l=o.Std.close(this._context)-s.get(i),h=e?a:l,c=-i;return[h,e?c:0]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_0();return[{value:i[0],offset:i[1]}]}}},{name:"Directional Movement Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"ADX",histogramBase:0,joinPoints:!1}},description:"Directional Movement Index",shortDescription:"DMI",is_price_study:!1,inputs:[{id:"in_0",name:"DI Length",defval:14,type:"integer",min:1,max:2e3},{id:"in_1",name:"ADX Smoothing",defval:14,type:"integer",min:1,max:50}],id:"Directional Movement Index@tv-basicstudies-1",scriptIdPart:"",name:"Directional Movement Index"},constructor:function(){this.f_0=function(t){return-t},this.f_1=function(t,e){return o.Std.and(o.Std.gt(t,e),o.Std.gt(t,0))?t:0},this.f_2=function(t,e){return 100*t/e},this.f_3=function(t,e){return t+e},this.f_4=function(t,e,i){return o.Std.abs(t-e)/(o.Std.eq(i,0)?1:i)},this.f_5=function(t){return 100*t},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=o.Std.high(this._context),r=this._context.new_var(s),a=o.Std.change(r),l=o.Std.low(this._context),h=this._context.new_var(l),c=o.Std.change(h),d=this.f_0(c),p=o.Std.tr(this._context),u=this._context.new_var(p),_=o.Std.rma(u,i,this._context),f=this.f_1(a,d),m=this._context.new_var(f),g=o.Std.rma(m,i,this._context),v=this.f_2(g,_),y=o.Std.fixnan(v,this._context),b=this.f_1(d,a),w=this._context.new_var(b),S=o.Std.rma(w,i,this._context),T=this.f_2(S,_),C=o.Std.fixnan(T,this._context),x=this.f_3(y,C),P=this.f_4(y,C,x),L=this._context.new_var(P),k=o.Std.rma(L,n,this._context),I=this.f_5(k),E=y,A=C,V=I,[E,A,V]}}},{name:"Donchian Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Lower",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Basis",histogramBase:0,joinPoints:!1}},description:"Donchian Channels",shortDescription:"DC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_0",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u;return this._context=t,this._input=e,i=this._input(0),n=o.Std.low(this._context),s=this._context.new_var(n),r=o.Std.lowest(s,i,this._context),a=o.Std.high(this._context),l=this._context.new_var(a),h=o.Std.highest(l,i,this._context),c=o.Std.avg(h,r),d=r,p=h,u=c,[d,p,u]}}},{name:"Double Exponential Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double Exponential Moving Average",shortDescription:"DEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Double Exponential Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Double Exponential Moving Average"},constructor:function(){this.f_0=function(t,e){return 2*t-e},this.main=function(t,e){var i,n,s,r,a,l,h,c;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),s=this._context.new_var(n),r=o.Std.ema(s,i,this._context),a=this._context.new_var(r),l=o.Std.ema(a,i,this._context),h=this.f_0(r,l),c=h,[c]}}},{name:"Ease of Movement",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:1e4,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Ease of Movement",shortDescription:"EOM",is_price_study:!1,inputs:[{id:"in_0",name:"Divisor",defval:1e4,type:"integer",min:1,max:1e9},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement"},constructor:function(){this.f_0=function(t,e,i,o,n){return t*e*(i-o)/n},this.main=function(t,e){var i,n,s,r,a,l,h,c,d;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=o.Std.hl2(this._context),r=this._context.new_var(s),a=o.Std.change(r),l=this.f_0(i,a,o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),h=this._context.new_var(l),c=o.Std.sma(h,n,this._context),d=c,[d]}}},{name:"Elders Force Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Elders Force Index",shortDescription:"EFI",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:13,type:"integer",min:1,max:2e3}],id:"Elders Force Index@tv-basicstudies-1",scriptIdPart:"",name:"Elders Force Index"},constructor:function(){this.f_0=function(t,e){return t*e},this.main=function(t,e){var i,n,s,r,a,l,h,c;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),s=this._context.new_var(n),r=o.Std.change(s),a=this.f_0(r,o.Std.volume(this._context)),l=this._context.new_var(a),h=o.Std.ema(l,i,this._context),c=h,[c]}}},{name:"Envelope",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20,in_1:10,in_2:!1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Envelope",shortDescription:"Env",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"percent",defval:10,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"exponential",defval:!1,type:"bool"}],id:"Envelope@tv-basicstudies-1",scriptIdPart:"",name:"Envelope"},constructor:function(){this.f_0=function(t,e,i){return t?e:i},this.f_1=function(t,e){return t*(1+e)},this.f_2=function(t,e){return t*(1-e)},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m,g;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._input(1),r=this._input(2),a=this._context.new_var(i),l=o.Std.ema(a,n,this._context),h=this._context.new_var(i),c=o.Std.sma(h,n,this._context),d=this.f_0(r,l,c),p=s/100,u=this.f_1(d,p),_=this.f_2(d,p),f=d,m=u,g=_,[f,m,g]}}},{name:"Fisher Transform",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,bands:[{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:1.5},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:0},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:-1.5}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Fisher",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Trigger",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Fisher Transform",shortDescription:"Fisher",is_price_study:!1,bands:[{id:"hline_0",name:"Level",isHidden:!1},{id:"hline_1",name:"Level",isHidden:!1},{id:"hline_2",name:"Level",isHidden:!1},{id:"hline_3",name:"Level",isHidden:!1},{id:"hline_4",name:"Level",isHidden:!1}],inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e12}],id:"fisher_transform@tv-basicstudies-1",scriptIdPart:"",name:"Fisher Transform"},constructor:function(){this.f_0=function(t){var e=o.Std.lt(t,-.99)?-.999:t;return[o.Std.gt(t,.99)?.999:e]},this.f_1=function(){var t,e,i,n=this._input(0),s=this._context.new_var(o.Std.hl2(this._context)),r=o.Std.highest(s,n,this._context),a=this._context.new_var(o.Std.hl2(this._context)),l=o.Std.lowest(a,n,this._context),h=this._context.new_var(),c=this.f_0(.66*((o.Std.hl2(this._context)-l)/o.Std.max(r-l,.001)-.5)+.67*o.Std.nz(h.get(1)));return h.set(c[0]),t=this._context.new_var(),t.set(.5*o.Std.log((1+h.get(0))/o.Std.max(1-h.get(0),.001))+.5*o.Std.nz(t.get(1))),e=t.get(1),i=t.get(0),[i,e]},this.main=function(t,e){return this._context=t,this._input=e,this.f_1()}}},{name:"Historical Volatility",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Historical Volatility",shortDescription:"HV",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:1e12}],id:"historical_volatility@tv-basicstudies-1",scriptIdPart:"",name:"Historical Volatility"},constructor:function(){this.f_0=function(){var t=this._input(0),e=o.Std.or(o.Std.isintraday(this._context),o.Std.and(o.Std.isdaily(this._context),o.Std.eq(o.Std.interval(this._context),1)))?1:7,i=this._context.new_var(o.Std.close(this._context)),n=this._context.new_var(o.Std.log(o.Std.close(this._context)/i.get(1)));return[100*o.Std.stdev(n,t,this._context)*o.Std.sqrt(365/e)]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Hull MA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Hull MA",shortDescription:"HMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Hull MA@tv-basicstudies-1",scriptIdPart:"",name:"Hull MA"},constructor:function(){this.f_0=function(t,e){return 2*t-e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=n/2,r=this._context.new_var(i),a=o.Std.wma(r,s,this._context),l=this._context.new_var(i),h=o.Std.wma(l,n,this._context),c=this.f_0(a,h),d=o.Std.sqrt(n),p=o.Std.round(d),u=this._context.new_var(c),_=o.Std.wma(u,p,this._context),f=_,[f]}}},{name:"Ichimoku Cloud",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0496ff"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#991515"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"},plot_3:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_4:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#008000",width:1,style:0},1:{color:"#FF0000",width:1,style:0}}}},filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:9,in_1:26,in_2:52,in_3:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",type:"line"},{id:"plot_4",type:"line"},{id:"plot_5",palette:"palette_0",target:"fill_0",type:"colorer"}],styles:{plot_0:{title:"Conversion Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Base Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Lagging Span",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Lead 1",histogramBase:0,joinPoints:!1,isHidden:!1},plot_4:{title:"Lead 2",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ichimoku Cloud",shortDescription:"Ichimoku",is_price_study:!0,is_hidden_study:!1,id:"Ichimoku Cloud@tv-basicstudies-1",palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},filledAreas:[{id:"fill_0",objAId:"plot_3",objBId:"plot_4",type:"plot_plot",title:"Plots Background",isHidden:!1,palette:"palette_0"}],inputs:[{id:"in_0",name:"Conversion Line Periods",defval:9,type:"integer",min:1,max:1e12},{id:"in_1",name:"Base Line Periods",defval:26,type:"integer",min:1,max:1e12},{id:"in_2",name:"Lagging Span 2 Periods",defval:52,type:"integer",min:1,max:1e12},{id:"in_3",name:"Displacement",defval:26,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"Ichimoku Cloud"},constructor:function(){this.donchian=function(t){var e=this._context.new_var(o.Std.low(this._context)),i=this._context.new_var(o.Std.high(this._context));return o.Std.avg(o.Std.lowest(e,t,this._context),o.Std.highest(i,t,this._context))},this.f_1=function(){var t=this._input(0),e=this._input(1),i=this._input(2),n=this._input(3),s=this.donchian(t),r=this.donchian(e),a=o.Std.avg(s,r),l=this.donchian(i);return[s,r,o.Std.close(this._context),a,l,-n,n,n,o.Std.gt(a,l)?0:1]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_1();return[i[0],i[1],{value:i[2],offset:i[5]},{value:i[3],offset:i[6]},{value:i[4],offset:i[7]},i[8]]}}},{name:"Keltner Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:!0,in_1:20,in_2:1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Middle",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Keltner Channels",shortDescription:"KC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"useTrueRange",defval:!0,type:"bool"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"mult",defval:1,type:"float",min:-1e12,max:1e12}],id:"Keltner Channels@tv-basicstudies-1",scriptIdPart:"",name:"Keltner Channels"},constructor:function(){this.f_0=function(t,e,i,o){return t?e:i-o},this.f_1=function(t,e,i){return t+e*i},this.f_2=function(t,e,i){return t-e*i},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._input(1),r=this._input(2),a=this._context.new_var(i),l=o.Std.ema(a,s,this._context),h=this.f_0(n,o.Std.tr(this._context),o.Std.high(this._context),o.Std.low(this._context)),c=this._context.new_var(h),d=o.Std.ema(c,s,this._context),p=this.f_1(l,d,r),u=this.f_2(l,d,r),_=p,f=l,m=u,[_,f,m]}}},{name:"Klinger Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Klinger Oscillator",shortDescription:"Klinger Oscillator",is_price_study:!1,inputs:[],id:"Klinger Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Klinger Oscillator"},constructor:function(){this.f_0=function(t,e){return o.Std.ge(t,0)?e:-e},this.f_1=function(t,e){return t-e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f;return this._context=t,this._input=e,i=o.Std.hlc3(this._context),n=this._context.new_var(i),s=o.Std.change(n),r=this.f_0(s,o.Std.volume(this._context)),a=this._context.new_var(r),l=o.Std.ema(a,34,this._context),h=this._context.new_var(r),c=o.Std.ema(h,55,this._context),d=this.f_1(l,c),p=this._context.new_var(d),u=o.Std.ema(p,13,this._context),_=d,f=u,[_,f]}}},{name:"Know Sure Thing",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:10,in_1:15,in_2:20,in_3:30,in_4:10,in_5:10,in_6:10,in_7:15,in_8:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"KST",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Know Sure Thing",shortDescription:"KST",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"roclen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"roclen2",defval:15,type:"integer",min:1,max:2e3},{id:"in_2",name:"roclen3",defval:20,type:"integer",min:1,max:2e3},{id:"in_3",name:"roclen4",defval:30,type:"integer",min:1,max:2e3},{id:"in_4",name:"smalen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_5",name:"smalen2",defval:10,type:"integer",min:1,max:2e3},{id:"in_6",name:"smalen3",defval:10,type:"integer",min:1,max:2e3},{id:"in_7",name:"smalen4",defval:15,type:"integer",min:1,max:2e3},{id:"in_8",name:"siglen",defval:9,type:"integer",min:1,max:2e3}],id:"Know Sure Thing@tv-basicstudies-1",scriptIdPart:"",name:"Know Sure Thing"},constructor:function(){this.f_0=function(t,e,i,o){return t+2*e+3*i+4*o},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,E,A,V,M,$,D,O,B,R,N,F,W;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=this._input(2),r=this._input(3),a=this._input(4),l=this._input(5),h=this._input(6),c=this._input(7),d=this._input(8),p=o.Std.close(this._context),u=i,_=this._context.new_var(p),f=o.Std.roc(_,u),m=a,g=this._context.new_var(f),v=o.Std.sma(g,m,this._context),y=n,b=this._context.new_var(p),w=o.Std.roc(b,y),S=l,T=this._context.new_var(w),C=o.Std.sma(T,S,this._context),x=s,P=this._context.new_var(p),L=o.Std.roc(P,x),k=h,I=this._context.new_var(L),E=o.Std.sma(I,k,this._context),A=r,V=this._context.new_var(p),M=o.Std.roc(V,A),$=c,D=this._context.new_var(M),O=o.Std.sma(D,$,this._context),B=this.f_0(v,C,E,O),R=this._context.new_var(B),N=o.Std.sma(R,d,this._context),F=B,W=N,[F,W]}}},{name:"Least Squares Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:25,in_1:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Least Squares Moving Average",shortDescription:"LSMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:25,type:"integer",min:1,max:1e12},{id:"in_1",name:"Offset",defval:0,type:"integer",min:-1e12,max:1e12}],id:"Least Squares Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Least Squares Moving Average"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=o.Std.close(this._context),r=this._context.new_var(s),a=o.Std.linreg(r,i,n),l=a,[l]}}},{name:"Linear Regression Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Linear Regression Curve",shortDescription:"LRC",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3}],id:"Linear Regression Curve@tv-basicstudies-1",scriptIdPart:"",name:"Linear Regression Curve"},constructor:function(){this.main=function(t,e){var i,n,s,r,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._context.new_var(i),r=o.Std.linreg(s,n,0),a=r,[a]}}},{name:"MA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA Cross",shortDescription:"MA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"MA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA Cross"},constructor:function(){this.f_0=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=o.Std.close(this._context),r=this._context.new_var(s),a=o.Std.sma(r,i,this._context),l=this._context.new_var(s),h=o.Std.sma(l,n,this._context),c=a,d=h,p=o.Std.cross(a,h,this._context),u=this.f_0(p,a),[c,d,u]}}},{name:"Mass Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Mass Index",shortDescription:"Mass Index",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Mass Index@tv-basicstudies-1",scriptIdPart:"",name:"Mass Index"},constructor:function(){this.f_0=function(t,e){return t-e},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.high(this._context),o.Std.low(this._context)),s=this._context.new_var(n),r=o.Std.ema(s,9,this._context),a=this._context.new_var(r),l=o.Std.ema(a,9,this._context),h=this.f_1(r,l),c=this._context.new_var(h),d=o.Std.sum(c,i,this._context),p=d,[p]}}},{name:"McGinley Dynamic",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"McGinley Dynamic",shortDescription:"McGinley Dynamic",is_price_study:!0,is_hidden_study:!1,id:"mcginley_dynamic@tv-basicstudies-1",inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"McGinley Dynamic"},constructor:function(){this.f_0=function(){var t,e=this._input(0),i=o.Std.close(this._context),n=this._context.new_var(i),s=o.Std.ema(n,e,this._context),r=this._context.new_var(),a=r.get(1)+(i-r.get(1))/(e*o.Std.pow(i/r.get(1),4));return r.set(o.Std.na(r.get(1))?s:a),t=r.get(0),[t]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Momentum",metainfo:{_metainfoVersion:30,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:10,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Mom",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Momentum",shortDescription:"Mom",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"Momentum@tv-basicstudies-1",scriptIdPart:"",name:"Momentum"},constructor:function(){this.main=function(t,e){var i,n,s,r,a;return this._context=t,this._input=e,i=this._input(0),n=o.Std[this._input(1)](this._context),s=this._context.new_var(n),r=s.get(i),a=r?n-r:null,[a]}}},{name:"Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"}},precision:4,bands:[{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#9915ff",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Money Flow",shortDescription:"MFI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Money Flow"},constructor:function(){this.f_0=function(t,e,i){return t*(o.Std.le(e,0)?0:i)},this.f_1=function(t,e,i){return t*(o.Std.ge(e,0)?0:i)},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.hlc3(this._context),s=this._context.new_var(n),r=o.Std.change(s),a=this.f_0(o.Std.volume(this._context),r,n),l=this._context.new_var(a),h=o.Std.sum(l,i,this._context),c=this.f_1(o.Std.volume(this._context),r,n),d=this._context.new_var(c),p=o.Std.sum(d,i,this._context),u=o.Std.rsi(h,p),_=u,[_]}}},{name:"Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average",shortDescription:"MA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),s=this._input(2),r=this._context.new_var(i),a=o.Std.sma(r,n,this._context),l=a,[{value:l,offset:s}]}}},{name:"Moving Average Convergence/Divergence",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:12,in_1:26,in_3:"close",in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Histogram",histogramBase:0,joinPoints:!1},plot_1:{title:"MACD",histogramBase:0,joinPoints:!1},plot_2:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"MACD",shortDescription:"MACD",is_price_study:!1,inputs:[{id:"in_0",name:"fastLength",defval:12,type:"integer",min:1,max:2e3},{id:"in_1",name:"slowLength",defval:26,type:"integer",min:1,max:2e3},{id:"in_3",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"signalLength",defval:9,type:"integer",min:1,max:50}],id:"Moving Average Convergence/Divergence@tv-basicstudies-1",scriptIdPart:"",name:"MACD"},constructor:function(){this.f_0=function(t,e){return t-e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m,g;return this._context=t,this._input=e,i=o.Std[this._input(2)](this._context),n=this._input(0),s=this._input(1),r=this._input(3),a=this._context.new_var(i),l=o.Std.ema(a,n,this._context),h=this._context.new_var(i),c=o.Std.ema(h,s,this._context),d=this.f_0(l,c),p=this._context.new_var(d),u=o.Std.sma(p,r,this._context),_=this.f_0(d,u),f=_,m=d,g=u,[f,m,g]}}},{name:"Moving Average Exponential",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Exponential",shortDescription:"EMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Exponential@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Exponential"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),s=this._input(2),r=this._context.new_var(i),a=o.Std.ema(r,n,this._context),l=a,[{value:l,offset:s}]}}},{name:"Moving Average Weighted",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Weighted",shortDescription:"WMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Weighted@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Weighted"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),s=this._input(2),r=this._context.new_var(i),a=o.Std.wma(r,n,this._context),l=a,[{value:l,offset:s}]}}},{name:"Net Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Net Volume",shortDescription:"Net Volume",is_price_study:!1,inputs:[],id:"Net Volume@tv-basicstudies-1",scriptIdPart:"",name:"Net Volume"},constructor:function(){this.f_0=function(t,e,i){return o.Std.gt(t,0)?e:o.Std.lt(i,0)?-e:0*e},this.main=function(t,e){var i,n,s,r,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),s=o.Std.change(n),r=this.f_0(s,o.Std.volume(this._context),s),a=r,[a]}}},{name:"On Balance Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"On Balance Volume",shortDescription:"OBV",is_price_study:!1,inputs:[],id:"On Balance Volume@tv-basicstudies-1",scriptIdPart:"",name:"On Balance Volume"},constructor:function(){this.f_0=function(t,e,i){return o.Std.gt(t,0)?e:o.Std.lt(i,0)?-e:0*e},this.main=function(t,e){var i,n,s,r,a,l;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),s=o.Std.change(n),r=this.f_0(s,o.Std.volume(this._context),s),a=o.Std.cum(r,this._context),l=a,[l]}}},{name:"Parabolic SAR",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:.02,in_1:.02,in_2:.2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Parabolic SAR",shortDescription:"SAR",is_price_study:!0,inputs:[{id:"in_0",name:"start",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_1",name:"increment",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"maximum",defval:.2,type:"float",min:-1e12,max:1e12}],id:"Parabolic SAR@tv-basicstudies-1",scriptIdPart:"",name:"Parabolic SAR"},constructor:function(){this.main=function(t,e){var i,n,s,r,a;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=this._input(2),r=o.Std.sar(i,n,s,this._context),a=r,[a]}}},{name:"Price Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10,in_1:21}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Price Oscillator",shortDescription:"PPO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:21,type:"integer",min:1,max:2e3}],id:"Price Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Price Oscillator"},constructor:function(){this.f_0=function(t,e){return(t-e)/e*100},this.main=function(t,e){var i,n,s,r,a,l,h,c,d;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._input(1),r=this._context.new_var(i),a=o.Std.sma(r,n,this._context),l=this._context.new_var(i),h=o.Std.sma(l,s,this._context),c=this.f_0(a,h),d=c,[d]}}},{name:"Price Volume Trend",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"PVT",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Price Volume Trend",shortDescription:"PVT",is_price_study:!1,is_hidden_study:!1,id:"price_volume_trend@tv-basicstudies-1",inputs:[],scriptIdPart:"",name:"Price Volume Trend"},constructor:function(){this.f_0=function(){var t=this._context.new_var(o.Std.close(this._context));return[o.Std.cum(o.Std.change(t)/t.get(1)*o.Std.volume(this._context),this._context)]},this.main=function(t,e){return this._context=t,this._input=e,[this.f_0()[0]]}}},{name:"Rate Of Change",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ROC",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Rate Of Change",shortDescription:"ROC",is_price_study:!1,bands:[{id:"hline_0",name:"Zero Line",isHidden:!1}],inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e12}],id:"rate_of_change@tv-basicstudies-1",scriptIdPart:"",name:"Rate Of Change"},constructor:function(){this.main=function(t,e){var i,n,s;return this._context=t,this._input=e,i=this._context.new_var(o.Std.close(this._context)),n=this._input(0),s=100*(i.get(0)-i.get(n))/i.get(n),[s]}}},{name:"Relative Strength Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Strength Index",shortDescription:"RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Relative Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Strength Index"},constructor:function(){this.f_0=function(t){return o.Std.max(t,0)},this.f_1=function(t){return-o.Std.min(t,0)},this.f_2=function(t,e){return o.Std.eq(t,0)?100:o.Std.eq(e,0)?0:100-100/(1+e/t)},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._context.new_var(i),r=o.Std.change(s),a=this.f_0(r),l=this._context.new_var(a),h=o.Std.rma(l,n,this._context),c=this.f_1(r),d=this._context.new_var(c),p=o.Std.rma(d,n,this._context),u=this.f_2(p,h),_=u,[_]}}},{name:"Relative Vigor Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"RVGI",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Relative Vigor Index",shortDescription:"RVGI",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Vigor Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Vigor Index"},constructor:function(){this.f_0=function(t,e){return t-e},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.open(this._context)),s=this._context.new_var(n),r=o.Std.swma(s,this._context),a=this._context.new_var(r),l=o.Std.sum(a,i,this._context),h=this.f_0(o.Std.high(this._context),o.Std.low(this._context)),c=this._context.new_var(h),d=o.Std.swma(c,this._context),p=this._context.new_var(d),u=o.Std.sum(p,i,this._context),_=this.f_1(l,u),f=this._context.new_var(_),m=o.Std.swma(f,this._context),g=_,v=m,[g,v]}}},{name:"Relative Volatility Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Volatility Index",shortDescription:"RVI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Volatility Index"},constructor:function(){this.f_0=function(t,e){return o.Std.le(t,0)?0:e},this.f_1=function(t,e){return o.Std.gt(t,0)?0:e},this.f_2=function(t,e){return t/(t+e)*100},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),s=this._context.new_var(n),r=o.Std.stdev(s,i,this._context),a=this._context.new_var(n),l=o.Std.change(a),h=this.f_0(l,r),c=this._context.new_var(h),d=o.Std.ema(c,14,this._context),p=this.f_1(l,r),u=this._context.new_var(p),_=o.Std.ema(u,14,this._context),f=this.f_2(d,_),m=f,[m]}}},{name:"SMI Ergodic Indicator/Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:5,in_1:20,in_2:5}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Indicator",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1},plot_2:{title:"Oscillator",histogramBase:0,joinPoints:!1}},description:"SMI Ergodic Indicator/Oscillator",shortDescription:"SMIIO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"siglen",defval:5,type:"integer",min:1,max:2e3}],id:"SMI Ergodic Indicator/Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"SMI Ergodic Indicator/Oscillator"},constructor:function(){this.f_0=function(t,e){return t-e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=this._input(2),r=o.Std.close(this._context),a=this._context.new_var(r),l=o.Std.tsi(a,i,n,this._context),h=this._context.new_var(l),c=o.Std.ema(h,s,this._context),d=this.f_0(l,c),p=l,u=c,_=d,[p,u,_]}}},{name:"Smoothed Moving Average",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Smoothed Moving Average",shortDescription:"SMMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"smoothed_moving_average@tv-basicstudies-1",scriptIdPart:"",name:"Smoothed Moving Average"},constructor:function(){this.f_0=function(){var t,e=this._input(0),i=o.Std[this._input(1)](this._context),n=this._context.new_var(i),s=o.Std.sma(n,e,this._context),r=this._context.new_var(),a=(r.get(1)*(e-1)+i)/e;return r.set(o.Std.na(r.get(1))?s:a),t=r.get(0),[t]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Stochastic",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:75,visible:!0}},inputs:{in_0:14,in_1:1,in_2:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic",shortDescription:"Stoch",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"smoothK",defval:1,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=this._input(2),r=o.Std.close(this._context),a=o.Std.high(this._context),l=o.Std.low(this._context),h=this._context.new_var(r),c=this._context.new_var(a),d=this._context.new_var(l),p=o.Std.stoch(h,c,d,i,this._context),u=this._context.new_var(p),_=o.Std.sma(u,n,this._context),f=this._context.new_var(_),m=o.Std.sma(f,s,this._context),g=_,v=m,[g,v]}}},{name:"Stochastic RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:80,visible:!0}},inputs:{in_0:14,in_1:14,in_2:3,in_3:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic RSI",shortDescription:"Stoch RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"lengthRSI",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"lengthStoch",defval:14,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothK",defval:3,type:"integer",min:1,max:1e4},{id:"in_3",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic RSI@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic RSI"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._input(1),r=this._input(2),a=this._input(3),l=o.Std.rsi(i,n),h=this._context.new_var(l),c=this._context.new_var(l),d=this._context.new_var(l),p=o.Std.stoch(h,c,d,s,this._context),u=this._context.new_var(p),_=o.Std.sma(u,r,this._context),f=this._context.new_var(_),m=o.Std.sma(f,a,this._context),g=_,v=m,[g,v]}}},{name:"TRIX",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:18}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"TRIX",histogramBase:0,joinPoints:!1}},description:"TRIX",shortDescription:"TRIX",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:18,type:"integer",min:1,max:2e3}],id:"TRIX@tv-basicstudies-1",scriptIdPart:"",name:"TRIX"},constructor:function(){this.f_0=function(t){return o.Std.log(t)},this.f_1=function(t){return 1e4*t},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context)),s=this._context.new_var(n),r=o.Std.ema(s,i,this._context),a=this._context.new_var(r),l=o.Std.ema(a,i,this._context),h=this._context.new_var(l),c=o.Std.ema(h,i,this._context),d=this._context.new_var(c),p=o.Std.change(d),u=this.f_1(p),_=u,[_]}}},{name:"Triple EMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Triple EMA",shortDescription:"TEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Triple EMA@tv-basicstudies-1",scriptIdPart:"",name:"Triple EMA"},constructor:function(){this.f_0=function(t,e,i){return 3*(t-e)+i},this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),s=this._context.new_var(n),r=o.Std.ema(s,i,this._context),a=this._context.new_var(r),l=o.Std.ema(a,i,this._context),h=this._context.new_var(l),c=o.Std.ema(h,i,this._context),d=this.f_0(r,l,c),p=d,[p]}}},{name:"True Strength Indicator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:25,in_1:13,in_2:13}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"True Strength Indicator",shortDescription:"True Strength Indicator",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"long",defval:25,type:"integer",min:1,max:4999},{id:"in_1",name:"short",defval:13,type:"integer",min:1,max:4999},{id:"in_2",name:"siglen",defval:13,type:"integer",min:1,max:4999}],id:"True Strength Indicator@tv-basicstudies-1",scriptIdPart:"",name:"True Strength Indicator"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l,h,c;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=this._input(2),r=o.Std.close(this._context),a=this._context.new_var(r),l=o.Std.tsi(a,n,i,this._context),h=l,c=this._context.new_var(h),[h,o.Std.ema(c,s,this._context)]}}},{name:"Ultimate Oscillator",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:14,in_2:28}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"UO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ultimate Oscillator",shortDescription:"UO",is_price_study:!1,inputs:[{id:"in_0",name:"length7",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"length14",defval:14,type:"integer",min:1,max:1e12},{id:"in_2",name:"length28",defval:28,type:"integer",min:1,max:1e12}],id:"ultimate_oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Ultimate Oscillator"},constructor:function(){this.f_0=function(t,e,i){var n=this._context.new_var(t),s=this._context.new_var(e);return[o.Std.sum(n,i,this._context)/o.Std.sum(s,i,this._context)]},this.f_1=function(){var t=this._input(0),e=this._input(1),i=this._input(2),n=this._context.new_var(o.Std.close(this._context)),s=o.Std.max(o.Std.high(this._context),n.get(1)),r=this._context.new_var(o.Std.close(this._context)),a=o.Std.min(o.Std.low(this._context),r.get(1)),l=o.Std.close(this._context)-a,h=s-a,c=this.f_0(l,h,t),d=this.f_0(l,h,e),p=this.f_0(l,h,i);return[100*(4*c[0]+2*d[0]+p[0])/7]},this.main=function(t,e){return this._context=t,this._input=e,this.f_1()}}},{name:"VWMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"VWMA",shortDescription:"VWMA",is_price_study:!0,inputs:[{id:"in_0",name:"len",defval:20,type:"integer",min:1,max:1e4}],id:"VWMA@tv-basicstudies-1",scriptIdPart:"",name:"VWMA"},constructor:function(){this.main=function(t,e){var i,n,s,r,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),s=this._context.new_var(i),r=o.Std.vwma(s,n,this._context),a=r,[a]}}},{name:"Volume Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Volume Oscillator",shortDescription:"Volume Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:4999},{id:"in_1",name:"longlen",defval:10,type:"integer",min:1,max:4999}],id:"Volume Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Volume Oscillator"},constructor:function(){this.f_0=function(t,e){return 100*(t-e)/e},this.main=function(t,e){var i,n,s,r,a,l,h,c,d;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=o.Std.volume(this._context),r=this._context.new_var(s),a=o.Std.ema(r,i,this._context),l=this._context.new_var(s),h=o.Std.ema(l,n,this._context),c=this.f_0(a,h),d=c,[d]}}},{name:"Vortex Indicator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"VI +",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"VI -",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Vortex Indicator",shortDescription:"VI",is_price_study:!1,is_hidden_study:!1,id:"vortex_indicator@tv-basicstudies-1",inputs:[{id:"in_0",name:"Period",defval:14,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Vortex Indicator"},constructor:function(){this.f_0=function(){var t=this._input(0),e=this._context.new_var(o.Std.low(this._context)),i=this._context.new_var(o.Std.abs(o.Std.high(this._context)-e.get(1))),n=o.Std.sum(i,t,this._context),s=this._context.new_var(o.Std.high(this._context)),r=this._context.new_var(o.Std.abs(o.Std.low(this._context)-s.get(1))),a=o.Std.sum(r,t,this._context),l=this._context.new_var(o.Std.atr(1,this._context)),h=o.Std.sum(l,t,this._context);return[n/h,a/h]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Willams %R",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-20},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-80}],filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Willams %R",shortDescription:"%R",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Willams %R@tv-basicstudies-1",scriptIdPart:"",name:"Willams %R"},constructor:function(){this.f_0=function(t,e,i){return 100*(t-e)/(e-i)},this.main=function(t,e){var i,n,s,r,a,l,h,c,d;return this._context=t,this._input=e,i=this._input(0),n=o.Std.high(this._context),s=this._context.new_var(n),r=o.Std.highest(s,i,this._context),a=o.Std.low(this._context),l=this._context.new_var(a),h=o.Std.lowest(l,i,this._context),c=this.f_0(o.Std.close(this._context),r,h),d=c,[d]}}},{name:"Williams Alligator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:21,in_1:13,in_2:8}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Jaw",histogramBase:0,joinPoints:!1},plot_1:{title:"Teeth",histogramBase:0,joinPoints:!1},plot_2:{title:"Lips",histogramBase:0,joinPoints:!1}},description:"Williams Alligator",shortDescription:"Alligator",is_price_study:!0,inputs:[{id:"in_0",name:"jawLength",defval:21,type:"integer",min:1,max:2e3},{id:"in_1",name:"teethLength",defval:13,type:"integer",min:1,max:2e3},{id:"in_2",name:"lipsLength",defval:8,type:"integer",min:1,max:2e3}],id:"Williams Alligator@tv-basicstudies-1",scriptIdPart:"",name:"Williams Alligator"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l,h,c,d,p,u,_,f;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=this._input(2),r=o.Std.hl2(this._context),a=this._context.new_var(r),l=o.Std.ema(a,i,this._context),h=this._context.new_var(r),c=o.Std.ema(h,n,this._context),d=this._context.new_var(r),p=o.Std.ema(d,s,this._context),u=l,_=c,f=p,[{value:u,offset:8},{value:_,offset:5},{value:f,offset:3}]}}},{name:"Williams Fractals",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{plottype:"shape_triangle_down",visible:!0,location:"BelowBar",transparency:0,color:"#800000"},plot_1:{plottype:"shape_triangle_up",visible:!0,location:"AboveBar",transparency:0,color:"#808000"}},precision:4,inputs:{in_0:2}},plots:[{id:"plot_0",type:"shapes"},{id:"plot_1",type:"shapes"}],styles:{plot_0:{title:"Shapes",isHidden:!1},plot_1:{title:"Shapes",isHidden:!1}},description:"Williams Fractals",shortDescription:"Fractals",is_price_study:!0,is_hidden_study:!1,id:"Williams Fractals@tv-basicstudies-1",inputs:[{id:"in_0",name:"Periods",defval:2,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Williams Fractals",isCustomIndicator:!0},constructor:function(){this.f_0=function(){var t=this._input(0),e=this._context.new_var(o.Std.high(this._context)),i=o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t+2),e.get(t)),o.Std.lt(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))),o.Std.or(o.Std.or(o.Std.and(o.Std.lt(e.get(t+3),e.get(t)),o.Std.and(o.Std.and(o.Std.lt(e.get(t+2),e.get(t)),o.Std.eq(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t))))),o.Std.and(o.Std.and(o.Std.lt(e.get(t+4),e.get(t)),o.Std.lt(e.get(t+3),e.get(t))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))))),o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t+5),e.get(t)),o.Std.and(o.Std.lt(e.get(t+4),e.get(t)),o.Std.eq(e.get(t+3),e.get(t)))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t))))),o.Std.and(o.Std.and(o.Std.and(o.Std.lt(e.get(t+6),e.get(t)),o.Std.lt(e.get(t+5),e.get(t))),o.Std.and(o.Std.eq(e.get(t+4),e.get(t)),o.Std.le(e.get(t+3),e.get(t)))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))))))),n=this._context.new_var(o.Std.low(this._context));return[o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t+2),n.get(t)),o.Std.gt(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))),o.Std.or(o.Std.or(o.Std.and(o.Std.gt(n.get(t+3),n.get(t)),o.Std.and(o.Std.and(o.Std.gt(n.get(t+2),n.get(t)),o.Std.eq(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t))))),o.Std.and(o.Std.and(o.Std.gt(n.get(t+4),n.get(t)),o.Std.gt(n.get(t+3),n.get(t))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))))),o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t+5),n.get(t)),o.Std.and(o.Std.gt(n.get(t+4),n.get(t)),o.Std.eq(n.get(t+3),n.get(t)))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t))))),o.Std.and(o.Std.and(o.Std.and(o.Std.gt(n.get(t+6),n.get(t)),o.Std.gt(n.get(t+5),n.get(t))),o.Std.and(o.Std.eq(n.get(t+4),n.get(t)),o.Std.ge(n.get(t+3),n.get(t)))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))))))),i]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_0();return[{value:i[0],offset:-2},{value:i[1],offset:-2}]}}}]},function(t,e,i){(function(e){"use strict";var o=i(142),n=i(93),s=i(34),r=function(t,e){this._server=t,this._session=e,this._timezone=null,this._isDWM=!1,this._resolution=null,this.seriesCompleted=new s,this._lastBarUpdates={}};r.prototype.lastBar=function(t){return this._lastBarUpdates[t]},r.prototype._userTimezone=function(){return this._timezone},r.prototype.setTimezone=function(t){this._timezone="exchange"===t?"exchange":e.get_timezone(t)},r.prototype.setResolution=function(t){this._isDWM=n.isDWM(t),this._resolution=t},r.prototype.onRequestMetadata=function(t,e){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,t,e]})},r.prototype.onSymbolResolved=function(t,e){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,t,e]})},r.prototype.onSymbolError=function(t,e){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,t,e]})},r.prototype.onStudyError=function(t,e){this._server.receiveLocalResponse({method:"study_error",params:[this._session,t,e]})},r.prototype.onSeriesLoading=function(t,e){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,t,e]})},r.prototype.onSeriesCompleted=function(t,e,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,t,i,e]}),this.seriesCompleted.fire(t)},r.prototype.onSeriesError=function(t,e){this._server.receiveLocalResponse({method:"series_error",params:[this._session,t,e]})},r.prototype.onSeriesClearData=function(t,e){var i={};i[t]={series:[],turnaround:e},this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,i,{index:0,zoffset:0,changes:[],marks:[]}]})},r.prototype.onStudyCompleted=function(t,e){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,t,e]})},r.prototype.onStudyLoading=function(t,e){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,t,e]})},r.prototype._calcMarksTime=function(t,i,n,s,r){var a,l,h,c,d,p=e.get_timezone(i),u=this;if(this._isDWM)for(d=new o.Session,d.init(p,n),c=0;c<t.length;c++)h=t[c],a=s(h),l=e.utc_to_cal(p,1e3*a),l=d.spec.correctTradingDay(l,p),e.set_hms(l,0,0,0,0),t[c]=r(h,parseInt(l.valueOf()/1e3));else for(c=0;c<t.length;c++)t[c]=r(t[c],u.timeInTimezone(s(t[c]),p))},r.prototype.onTickmarksUpdated=function(t,e,i,o){var s,r,a,l,h,c,d;if(n.isEqual(o,this._resolution)){for(s=e.slice(0),this._calcMarksTime(s,i.timezone,i.session,function(t){return t},function(t,e){return e}),r=[],a=[],h=0;h<s.length;++h)c=s[h],r.push([this._spanByTime(c,l),c,t+h]),a.push(c),l=c;d={method:"tickmark_update",params:[this._session,{index:t,zoffset:0,changes:a,marks:r}]},this._server.receiveLocalResponse(d)}},r.prototype.onTimescaleUpdate=function(t,e,i,o,n){var s,r,a,l,h,c,d;for(this._lastBarUpdates[t]=i&&i[i.length-1],this._calcMarksTime(i,o.timezone,o.session,function(t){return t.value[0]},function(t,e){return t.exTime=e,t}),s={},s[t]={series:i,turnaround:e},r=[],a=[],h=0;h<i.length;++h)c=i[h].exTime,r.push([this._spanByTime(c,l),c,n+h]),a.push(i[h].value[0]),l=c;d={method:"timescale_update",params:[this._session,s,{index:n,zoffset:0,changes:a,marks:r}]},this._server.receiveLocalResponse(d)},r.prototype.onSeriesTimeframeUpdate=function(t,e,i,o,n){var s={method:"series_timeframe",params:[this._session,t,e,i,o,n]};this._server.receiveLocalResponse(s)},r.prototype.onPointsetDataUpdate=function(t,e,i,o){this._onDataUpdate(t,e,i,void 0,o,1)},r.prototype.onDataUpdate=function(t,e,i,o,n){this._onDataUpdate(t,e,i,o,n,0)},r.prototype._onDataUpdate=function(t,e,i,o,n,s){var r,a={},l=o?JSON.stringify({offsets:o}):"";a[t]={s:i,ns:{d:l,indexes:[]},turnaround:e},r={method:"data_update",params:[this._session,a]},this._server.receiveLocalResponse(r)},r.prototype.onQuotesData=function(t){this._server.receiveLocalResponse({method:"quote_symbol_data",params:t})},r.prototype.onDepthData=function(t){this._server.receiveLocalResponse({method:"dd",params:t})},r.prototype.onDepthUpdate=function(t){this._server.receiveLocalResponse({method:"dpu",params:t})},r.prototype.timeInTimezone=function(t,i){return"exchange"===this._userTimezone()?parseInt(e.utc_to_cal(i,1e3*t).valueOf()/1e3):parseInt(e.utc_to_cal(this._userTimezone(),1e3*t).valueOf()/1e3)},r.prototype._spanByTime=function(t,e){function i(t){return 60*t*60*1e3}function o(t){return 60*t*1e3}function n(t){return 1e3*t}var s,r,a,l=[{divisor:1,span:20},{divisor:n(1),span:19},{divisor:o(5),span:21},{divisor:o(30),span:22},{divisor:i(1),span:30},{divisor:i(3),span:31},{divisor:i(6),span:32},{divisor:i(12),span:33}];if(!e)return 20;if(s=new Date(1e3*e),r=new Date(1e3*t),r.getYear()!==s.getYear())return 70;if(r.getUTCMonth()!==s.getUTCMonth())return 60;if(r.getUTCDate()!==s.getUTCDate())return 50;for(a=l.length-1;a>=0;--a)if(Math.floor(s/l[a].divisor)!==Math.floor(r/l[a].divisor))return l[a].span},TradingView.ChartapiMessagerInstances=[],t.exports=r}).call(e,i(137))},function(t,e,i){"use strict";function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){return t.ticker+"_"+e}function a(t){return new Date(t).toISOString()}var l,h,c,d,p,u,_,f,m,g;Object.defineProperty(e,"__esModule",{value:!0}),l=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(93),c=n(h),d=i(606),p=i(605),u=n(p),_=i(1),f=o(_),m=function(){function t(e,i,o,n){s(this,t),this._datafeed=e,this._symbolInfo=i,this._resolution=o,this._dwmAligner=n,this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._gaps=[],this._needPurgeCache=!1,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null}return l(t,[{key:"addSubscription",value:function(t,e,i){var o=this,n=this._getNextSubscriptionId(),s=parseInt(t.from/1e3),r=parseInt(t.to/1e3);return this._pendingSubscribers.push({key:n,range:{from:s,to:r},onHistoryCallback:e,onErrorCallback:i}),this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null),setTimeout(function(){return o._processNextPendingSubscriber()},0),n}},{key:"removeSubscription",value:function(t){var e,i=this,o=this._pendingSubscribers.find(function(e){return e.key===+t});return o?void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(o),1):(e=this._subscribers.find(function(e){return e.key===+t}))?(this._subscribers.splice(this._subscribers.indexOf(e),1),void(this._subscribers.length||(this._unsubscribeRealtime(),this._symbolInfo.expired||this._symbolInfo.expiration_date||(this._resetCacheTimeout=setTimeout(function(){return i.purgeCache()},0))))):void console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,t))}},{key:"purgeCache",value:function(){this._logMessage("Reset cache"),this._needPurgeCache=!0,this._resetCacheTimeout=null}},{key:"_logMessage",value:function(t,e){(f.enabled("charting_library_debug_mode")||e)&&console.log("FEED [{0}|{1}]: {2}".format(this._symbolInfo.name,this._resolution,t))}},{key:"_purgeCache",value:function(){this._cache={bars:[]},this._gaps=[],this._errorMessage=null,this._needPurgeCache=!1,this._leftDate=null,this._endOfData=!1}},{key:"_processNextPendingSubscriber",value:function(){var t,e,i,o,n,s;if(this._pendingSubscribers.length&&!this._requesting){if(this._needPurgeCache&&this._purgeCache(),t=this._pendingSubscribers.pop(),this._logMessage("Processing bars request {0} from {1} to {2} ".format(t.key,a(1e3*t.range.from),a(1e3*t.range.to))),this._errorMessage)return this._logMessage("Return error:"+this._errorMessage),t.onErrorCallback(this._errorMessage),void this._processNextPendingSubscriber();if((!this._leftDate||t.range.from<this._leftDate)&&(e=new c.default(this._resolution),i=(e.inMilliseconds()||0)/1e3,o=!this._leftDate,n=!o&&!!this._cache.bars.length&&this._cache.bars[0].time/1e3-t.range.from<i,(o||!n)&&!this._endOfData))return this._pendingSubscribers.push(t),void this._ensureRequestedTo(t.range.from);s=this._moveSubscriberToRealtime(t),this._returnHistoryDataToSubscriber(t,s),this._subscribeRealtimeIfNeeded(),this._processNextPendingSubscriber()}}},{key:"_moveSubscriberToRealtime",value:function(t){var e={key:t.key,onHistoryCallback:t.onHistoryCallback,barset:null};return this._subscribers.push(e),e}},{key:"_subscribeRealtimeIfNeeded",value:function(){!this._subscribers.length||this._realtimeOn||this._symbolInfo.expired||this._symbolInfo.expiration_date||this._subscribeRealtime()}},{key:"_subscribeRealtime",value:function(){var t,e,i=this;this._symbolInfo.expired||this._realtimeOn||(t=function(t){i._dwmAligner&&(t.time=i._dwmAligner.tradingDayToSessionStart(t.time)),i._putToCacheNewBar(t),i._subscribers.forEach(function(e){var i=e.barset;i.add(t),e.onHistoryCallback(i)})},e=function(){i._unsubscribeRealtime();var t=i._leftDate;i._purgeCache(),i._ensureRequestedTo(t)},this._realtimeOn=!0,this._datafeed.subscribeBars(this._symbolInfo,this._resolution,t,r(this._symbolInfo,this._resolution),e),this._logMessage("Subscribed to realtime"))}},{key:"_unsubscribeRealtime",value:function(){!this._symbolInfo.expired&&this._realtimeOn&&(this._datafeed.unsubscribeBars(r(this._symbolInfo,this._resolution)),this._logMessage("Unsubscribed from realtime"),this._realtimeOn=!1)}},{key:"_returnHistoryDataToSubscriber",value:function(t,e){var i,o=t.range,n=this._createBarset(o.from);n.count()>0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(t.key,n.count(),a(n.bars[0].time),a(n.bars[n.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(t.key)),e.barset=n,i=this._inGapNextTime(o.from),i&&(this._logMessage("Request {0} is in gap, nextTime = {1}".format(t.key,a(1e3*i))),n.nextTime=i),this._endOfData&&t.range.from<=this._leftDate&&(n.endOfData=!0),t.onHistoryCallback(n)}},{key:"_createBarset",value:function(t){var e=(0,d.lowerbound)(this._cache.bars,1e3*t,function(t,e){return t.time<e});return new u.default.BarSet(this._symbolInfo,this._cache.bars.slice(e))}},{key:"_ensureRequestedTo",value:function(t){var e,i,o,n=this;if(this._leftDate&&this._leftDate<t)return void this._processNextPendingSubscriber();e=!this._leftDate,this._requesting=!0,i=t,o=this._leftDate?this._leftDate-1:this._symbolInfo.expiration_date||parseInt(this._now()/1e3),this._leftDate=t,this._logMessage("Requesting data: [{0} ... {1}] ".format(a(1e3*i),a(1e3*o))),this._datafeed.getBars(this._symbolInfo,this._resolution,i,o,function(t,e){n._requesting=!1,n._processBars(t,e)},function(t){n._requesting=!1,n._errorMessage=t,n._processNextPendingSubscriber()},e)}},{key:"_processBars",value:function(t,e){var i,o;this._checkBars(t),this._alignBarsTime(t),t.length>0?(i=t[0].time,o=t[t.length-1].time,this._logMessage("Receiving bars: total {0} bars in [{1} ... {2}] ".format(t.length,a(i),a(o))),i<1e3*this._leftDate&&this._logMessage("Returned more data than needed"),this._putToCache(t)?this._cache.bars.length&&this._leftDate>this._cache.bars[0].time/1e3&&(this._leftDate=this._cache.bars[0].time/1e3):this._logMessage("Incremental update failed. Starting full update.",!0),e&&e.nextTime?console.warn("nextTime should be set when there is no data in the requested period only"):e&&e.noData&&console.warn("noData should be set when there is no data in the requested period and earlier only")):(this._logMessage("Receiving bars: barset is empty"),e&&e.nextTime?(this._logMessage("Next time received: `{0}`".format(a(1e3*e.nextTime))),this._addGap(e.nextTime),this._leftDate=Math.min(this._leftDate||this._now()/1e3,e.nextTime+1)):e&&e.noData&&(this._logMessage("EOD received"),this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._cache.bars[0].time/1e3))),this._processNextPendingSubscriber()}},{key:"_now",value:function(){return Date.now()+6e4}},{key:"_addGap",value:function(t){var e;this._gaps.find(function(e){return e.from===t})||(e=(this._cache.bars.length?this._cache.bars[0].time:this._now())/1e3,this._gaps.push({from:t,to:e}))}},{key:"_inGapNextTime",value:function(t){var e=this._gaps.find(function(e){return e.from<t&&e.to>t});return e?e.from:null}},{key:"_getNextSubscriptionId",value:function(){return this._nextSubscriptionId++}},{key:"_checkBars",value:function(t){if(f.enabled("charting_library_debug_mode"))for(var e=1;e<t.length;e++)t[e].time<=t[e-1].time&&console.error("Corrupted bars, time {0} at {1} > {2} at {3}".format(t[e].time,e,t[e-1].time,e-1))}},{key:"_putToCache",value:function(t){if(0===t.length)return!0;if(this._cache.bars.length===t.length&&this._cache.bars[0].time===t[0].time&&this._cache.bars[this._cache.bars.length-1].time===t[t.length-1].time)return this._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!==this._cache.bars.length&&t[t.length-1].time===this._cache.bars[0].time&&this._cache.bars.splice(0,1),0!==this._cache.bars.length&&t[t.length-1].time>=this._cache.bars[0].time){var e=this._cache.bars[this._cache.bars.length-1].time===t[t.length-1].time;if(this._cache.bars=[],!e)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return Array.prototype.unshift.apply(this._cache.bars,t),this._checkBars(this._cache.bars),!0}},{key:"_putToCacheNewBar",value:function(t){var e=this._cache.bars.length,i=t.time,o=0===e?NaN:this._cache.bars[e-1].time;0===e||o<i?this._cache.bars.push(t):o===i?this._cache.bars[e-1]=t:console.error("putToCacheNewBar: time violation, prev: "+a(o)+", cur: "+a(i))}},{key:"_alignBarsTime",value:function(t){if(this._dwmAligner)for(var e=0;e<t.length;e++)t[e].time=this._dwmAligner.tradingDayToSessionStart(t[e].time)}}]),t}(),g=function(){function t(e,i){s(this,t),this._threads={},this._datafeed=e,this._dwmAlignerCreator=i}return l(t,[{key:"createThread",value:function(t,e){return new m(this._datafeed,t,e,this._dwmAlignerCreator(e,t))}},{key:"purgeCache",value:function(){this._forEachThread(function(t,e){return e.purgeCache()})}},{key:"_forEachThread",value:function(t){var e=this;Object.keys(this._threads).forEach(function(i){return t(i,e._threads[i])})}},{key:"subscribe",value:function(t,e,i,o,n){var s,a=r(t,e);return this._threads[a]||(this._threads[a]=this.createThread(t,e)),s=this._threads[a].addSubscription(i,o,n),a+'"'+s}},{key:"unsubscribe",value:function(t){var e,i,o=t.split('"');if(2!==o.length)return void console.warn("Wrong guid format");e=o[0],i=o[1],this._threads[e].removeSubscription(i)}}]),t}(),e.DatafeedRequestsCachedProcessor=g},function(t,e,i){"use strict";function o(t,e){this.handler=t,this.customId=e,this.requestHook=null}function n(){}TradingView.WEB_SOCKET_WAS_CONNECTED=!1,n.REBIND_STUDY_STANDALONE_TO_CHILD=1,n.REBIND_STUDY_CHILD_TO_STANDALONE=2,n.prototype.defaultWatchlistSymbols=function(){},n.prototype.availableTimeFrames=function(t,e){},n.prototype.defaultResolutions=function(){},n.prototype.supportedSymbolsTypes=function(){},n.prototype.supportedExchangesList=function(){},n.prototype.futuresRegex=function(){},n.prototype.quoteCreateSession=function(t){},n.prototype.quoteDeleteSession=function(t){},n.prototype.quoteSetFields=function(t,e){},n.prototype.quoteAddSymbols=function(t,e){},n.prototype.quoteRemoveSymbols=function(t,e){},n.prototype.quoteFastSymbols=function(t,e){},n.prototype.depthCreateSession=function(t,e,i){},n.prototype.depthDeleteSession=function(t){},n.prototype.depthSetSymbol=function(t,e){},n.prototype.depthClearSymbol=function(t){},n.prototype.depthSetScale=function(t,e){},n.prototype.chartCreateSession=function(t,e){},n.prototype.chartDeleteSession=function(t){},n.prototype.createSession=function(t,e){},n.prototype.removeSession=function(t){},n.prototype.connected=function(){},n.prototype._getHost=function(t){},n.prototype.connect=function(){},n.prototype.disconnect=function(){},n.prototype.switchTimezone=function(t,e){},n.prototype.resolveSymbol=function(t,e,i,o,n){},n.prototype.createSeries=function(t,e,i,o,n,s,r){},n.prototype.removeSeries=function(t,e,i){},n.prototype.modifySeries=function(t,e,i,o,n,s){},n.prototype.requestMoreData=function(t,e,i,o){},n.prototype.requestMetadata=function(t,e,i){},n.prototype.isCanCreateStudy=function(t,e){},n.prototype.createStudy=function(t,e,i,o,n,s,r){},n.prototype.rebindStudy=function(t,e,i,o,n,s,r,a){},n.prototype.removeStudy=function(t,e,i){},n.prototype.modifyStudy=function(t,e,i,o,n){},n.prototype.createPointset=function(t,e,i,o,n,s,r){},n.prototype.modifyPointset=function(t,e,i,o,n){},n.prototype.removePointset=function(t,e,i){},n.prototype.requestMoreTickmarks=function(t,e,i,o){},n.prototype.requestFirstBarTime=function(t,e,i,o){},n.prototype._invokeHandler=function(t,e){},n.prototype._sendRequest=function(t,e){},n.prototype._onMessage=function(t){},n.prototype._convertTimescaleResponse=function(t){},n.prototype._dispathNotification=function(t){},n.prototype._invokeNotificationHandler=function(t,e,i){},n.prototype._notifySessions=function(t){},n.prototype.unpack=function(t){},n.prototype.reconnectTimeout=function(t){},n.prototype.searchSymbols=function(t){},n.prototype.serverTimeOffset=function(){},n.prototype._isSafari5=function(){},n.prototype._isIE9=function(){},n.prototype._isIOS5=function(){},n.prototype._getPort=function(t){},n.prototype.getMarks=function(t,e,i,o,n){},n.prototype.getTimescaleMarks=function(t,e,i,o,n){},TradingView.declareClassAsPureInterface(n,"ChartApiInterface"),TradingView.ChartApiInterface=n,TradingView.HandlerInfo=o,e.HandlerInfo=o,e.ChartApiInterface=n},function(t,e,i){(function(e){"use strict";var o=i(175).StudyConsts,n=i(139),s=function(){function t(t){e.enabled("charting_library_debug_mode")&&console.warn("Overrides:"+t)}function s(t,e,i,o){t.defaults.inputs[e]=o,t.inputs[i].defval=o}function r(t,e){t.defaults.precision=e}function a(e,i,o,n){var s,r,a=o[1];if("color"===a){if(s=c(e,i),r=o.length>2?parseInt(o[2]):NaN,null==s&&!isNaN(r)&&r>0)return void t("Plot `{1}` of `{0}` does not have color #{2}".format(e.description,o[0],r));0==r||isNaN(r)?(e.defaults.styles[i].color=n,null!=s&&(s.colors[0].color=n)):s.colors[r].color=n}else{if(!e.defaults.styles[i].hasOwnProperty(a))return void t("Plot `{1}` of `{0}` does not have property `{2}`".format(e.description,o[0],a));"plottype"===a&&(n=y[n]),e.defaults.styles[i][a]=n}}function l(e,i,o,n){var s=o[1];if(!e.defaults.bands[i].hasOwnProperty(s))return void t("Band `{1}` of `{0}` does not have property `{2}`".format(e.description,o[0],s));"plottype"===s&&(n=y[n]),e.defaults.bands[i][s]=n}function h(e,i,o,n){var s=o[1];if(!e.defaults.filledAreasStyle[i].hasOwnProperty(s))return void t("Area `{1}` of `{0}` does not have property `{2}`".format(e.description,o[0],s));e.defaults.filledAreasStyle[i][s]=n}function c(t,e){for(var i in t.plots)if("colorer"===t.plots[i].type&&t.plots[i].target===e)return t.defaults.palettes[t.plots[i].palette];return null}function d(t){var e,i,o=JSServer.studyLibrary;for(e=0;e<o.length;++e)if(i=o[e].metainfo,i.description.toLowerCase()===t.toLowerCase()||i.shortDescription.toLowerCase()===t.toLowerCase())return i;return null}function p(t,e){for(var i=0;i<t.inputs.length;++i)if(t.inputs[i].name.toLowerCase()===e.toLowerCase())return{id:t.inputs[i].id,index:i};return null}function u(t,e){for(var i in t.styles)if(t.styles[i].title.toLowerCase()===e.toLowerCase())return i;return null}function _(t,e){for(var i in t.filledAreas)if(t.filledAreas[i].title.toLowerCase()===e.toLowerCase())return t.filledAreas[i].id;return null}function f(t,e){if(!t.bands)return null;for(var i in t.bands)if(t.bands[i].name.toLowerCase()===e.toLowerCase())return i;return null}var m,g,v={"volume.transparency":"!transparency","upper limit":"UpperLimit","lower limit":"LowerLimit"},y={};if(Object.keys(o).forEach(function(t){0===t.indexOf("PLOT_")&&0!==t.indexOf("PLOT_TYPE_")&&(y[t.toLowerCase().substring(5)]=o[t])}),m={},m.setMetainfoProperty=function(e,i,o){var n,c,d,m,g,y,b,w,S,T,C;if(i=v[i]||i,n=i.split("."),c=n[0],0===c.indexOf("!"))return void(e[c.slice(1)]=o);d=c.split(":"),c=d[0],c=v[c]||c,m=null,g=null,y=null,b=null,w="options"===c,S="precision"===c&&e.defaults&&e.defaults.precision,T=2===d.length?d[1]:null,"plot"!==T&&T||(m=u(e,c)),"band"!==T&&T||(g=f(e,c)),"area"!==T&&T||(y=_(e,c)),"input"!==T&&T||(b=p(e,c)),C=!!m+!!g+!!b+!!w+!!y+!!S,0===C?t("Study `{0}` has no plot or input `{1}`".format(e.description,c)):C>1?t("Study `{0}` ambiguous identifier `{1}`".format(e.description,c)):m?a(e,m,n,o):b?s(e,b.id,b.index,o):g?l(e,g,n,o):y?h(e,y,n,o):S?r(e,o):e[n[1]]=o},m.setProperty=function(e,i){var o=e.split(".")[0],n=d(o);if(!n)return void t("Study `{0}` not found".format(o));m.setMetainfoProperty(n,e.substring(o.length+1),i)},m.applyDefaultsToFactoryDefaults=function(t){var e={};t.forEach(function(t){var i=t.split(".")[0],o=d(i);o&&(e[o.id]=o)}),Object.keys(e).forEach(function(t){var i=e[t];n.createDefaultsForStudy(i)})},i(612),"undefined"!=typeof __initialMetainfoOverrides&&__initialMetainfoOverrides)for(g in __initialMetainfoOverrides)m.setProperty(g,__initialMetainfoOverrides[g]);return m}();t.exports=s}).call(e,i(1))},function(t,e,i){"use strict";function o(t,e,i,o){this._chartWidgetCollection=t,this._chartSaverInstance=e,this._chartApiInstance=i,this._saveLoad=o}var n,s=i(278),r=i(618),a=i(287),l=i(36),h=i(304),c=i(65),d=i(51).closeAllDialogs,p=i(92),u=i(565),_=i(276);o.prototype.subscribe=function(t,e){l.subscribe(t,e)},o.prototype.onContextMenu=function(t){l.subscribe("onContextMenu",function(e){e.callback(t(e.unixtime,e.price))})},o.prototype.onGrayedObjectClicked=function(t){l.subscribe("onGrayedObjectClicked",t)},o.prototype.activeChart=function(){return new r(this._chartWidgetCollection.activeChartWidget.value())},o.prototype.changeSymbol=function(t,e,i){s.interval.setValue(e),s.symbol.setValue(t),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},o.prototype.setLayout=function(t){this._chartWidgetCollection.layout.setValue(t)},o.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},o.prototype.chartsCount=function(){return a[this.layout()].count},o.prototype.chart=function(t){if(void 0===t&&(t=0),t<0||t>this.chartsCount())throw Error("Incorrect index: "+t);return new r(this._chartWidgetCollection.getAll()[t])},o.prototype.getSymbolInterval=function(t){var e={symbol:s.symbol.value(),interval:s.interval.value()};return t&&t(e),e},o.prototype.getVisibleRange=function(t){var e=this.activeChart().getVisibleRange();return t&&t(e),e},o.prototype.saveChart=function(t){var e=this;this._chartSaverInstance.whenReadyToSave(function(){var i=e._chartSaverInstance.saveToJSON();return t&&t(JSON.parse(i.content))})},o.prototype.loadChart=function(t){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(t.json),this._chartWidgetCollection.purgeUnusedWidgets(),t.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(t.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(t.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(t.extendedData.name)),s.symbol.setValue(this.activeChart().symbol()),l.emit("chart_loaded")},o.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter(function(t){return!t.is_hidden_study}).map(function(t){return t.name||t.description})},o.prototype.getSavedCharts=function(t){_.getCharts(t)},o.prototype.loadChartFromServer=function(t){_.loadChart(t)},o.prototype.saveChartToServer=function(t,e,i,o){this._chartSaverInstance.saveChartSilently(t,i,e,o)},o.prototype.removeChartFromServer=function(t,e){_.removeChart(t,e)},o.prototype.getIntervals=function(){return u.sortIntervals(u.getIntervals())},o.prototype.closePopupsAndDialogs=function(){c.dialogs.forEach(function(t){t.dialog.find("._tv-dialog-title-close").click()}),d(),h.hideAll()},n={cursor:"",dot:"",arrow_cursor:"arrow",eraser:"",measure:"",zoom:"",brush:"LineToolBrush"},o.prototype.selectLineTool=function(t){var e=i(620);if(e[t])t=e[t].name;else{if(!n.hasOwnProperty(t))return;t=n[t]||t}p.tool.value()!==t&&(TradingView.supportTouch()&&this._chartWidgetCollection.selectedSource.value()&&this._chartWidgetCollection.activeChartWidget.value().model().lineBeingCreated()&&this._chartWidgetCollection.activeChartWidget.value().model().cancelCreatingLine(),p.tool.setValue(t))},o.prototype.selectedLineTool=function(){var t,e,o,s=i(620),r=Object.keys(s),a=p.tool.value();for(t=0;t<r.length;++t)if(s[r[t]].name===a)return r[t];for(r=Object.keys(n),t=0;t<r.length;++t){if(e=r[t],(o=n[e])&&o===a)return r[t];if(e===a)return e}return""},o.prototype.createStudyTemplate=function(t,e){var i=this.activeChart().createStudyTemplate(t);return e&&e(i),i},o.prototype.mainSeriesPriceFormatter=function(){return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()},o.prototype.showNoticeDialog=function(t){function e(){i&&(i(),i=null)}t=t||{},t.title=t.title||"",t.body=t.body||"";var i=t.callback;c.showNotice(t.title,"",{html:t.body,onOkButtonClick:e}).on("destroy",e)},o.prototype.showConfirmDialog=function(t){function e(t){i&&(i(t),i=null)}if(t=t||{},t.title=t.title||"",t.body=t.body||"",!t.callback)throw Error("callback must be exist");var i=t.callback;c.showConfirm(t.title,t.body,e.bind(null,!0),e.bind(null,!1),{okButtonText:$.t("OK"),cancelButtonText:$.t("Cancel")}).on("destroy",e.bind(null,!1))},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t){var e,i,o=Object.keys(p),n=o.length;for(e=0;e<n;++e)if(i=o[e],p[i].name===t)return i;return null}var n=i(619),s=i(616),r=i(139),a=i(91).DefaultProperty,l=i(209).availIcons,h=i(142),c=i(93),d=i(137),p=i(620),u=i(294).createTooManyStudiesNotice,_=function(t){this._chartWidget=t};_.prototype._makeSubscriptionFromDelegate=function(t){var e=$.extend({},t);return delete e.fire,e},_.prototype.executeAction=function(t){this._chartWidget.executeActionByName(t)},_.prototype.executeActionById=function(t){this._chartWidget.executeActionById(t)},_.prototype.getCheckableActionState=function(t){return this._chartWidget.getCheckableActionState(t)},_.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},_.prototype.clearMarks=function(){this._chartWidget.clearMarks()},_.prototype.symbol=function(){return this._chartWidget.getSymbol()},_.prototype.symbolExt=function(){var t=this._chartWidget.model().mainSeries().symbolInfo();return t?{symbol:t.name,full_name:t.full_name,exchange:t.exchange,description:t.description,type:t.type}:null},_.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},_.prototype.setSymbol=function(t,i){function o(){n._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,o),i&&i()}if(t!==this.symbol()||e.enabled("same_data_requery")){var n=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,o),this._chartWidget.setSymbol(t)}},_.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},_.prototype.setResolution=function(t,e){function i(){o._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,i),e&&e()}if((t=t.toUpperCase())!==this.resolution()){var o=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,i),this._chartWidget.setResolution(t)}},_.prototype.setEntityVisibility=function(t,e){var i,o=this._chartWidget.model().model().dataSourceForId(t);o&&(i=o.properties())&&i.visible&&i.visible.setValue(e)},_.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(t){return{id:t._id,name:t._metaInfo.description}})},_.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(function(t){return{id:t._id,name:o(t.toolname)}}).filter(function(t){return null!==t.name})},_.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},_.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},_.prototype.removeEntity=function(t){var e=this._chartWidget.model().chartModel().dataSourceForId(t);if(!e)return void console.warn("Can't find a source with id: "+t);this._chartWidget.model().chartModel().removeSource(e,!0)},_.prototype.createStudyTemplate=function(t){return this._chartWidget.model().model().studyTemplate(t.saveInterval)},_.prototype.applyStudyTemplate=function(t){this._chartWidget.model().model().restoreStudyTemplate(t,""+1e3*Math.random())},_.prototype.setVisibleRange=function(t,e){if(void 0===t||!t.from||!t.to||isNaN(t.from)||isNaN(t.to))return void console.warn("Wrong time range: "+JSON.stringify(t));var i=this._alignPoints([parseInt(t.from),parseInt(t.to)]);t.from=i[0],t.to=i[1],this._chartWidget.setVisibleTimeRange(t.from,t.to,e)},_.prototype.getVisibleRange=function(){var t=this._chartWidget.model().timeScale(),e=t.visibleBars(),i={from:t.indexToUserTime(e.firstBar()<0?0:e.firstBar()),to:t.indexToUserTime(e.lastBar())};return{from:(+i.from||0)/1e3,to:(+i.to||0)/1e3}},_.prototype.getVisiblePriceRange=function(){return this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},_.prototype._createTradingPrimitive=function(t,e){function i(){var t=o._chartWidget.model().timeScale().m_points.lastTimePointIndex();return{index:t,price:o._chartWidget.model().mainSeries().data().valueAt(t)[4]}}var o=this,n=this._chartWidget.model().model(),s=n.paneForSource(this._chartWidget.model().model().mainSeries());return(e?this._chartWidget.model().chartModel():this._chartWidget.model()).createLineTool(s,i(),t)._adapter},_.prototype.createOrderLine=function(t){var t=t||{};return this._createTradingPrimitive("LineToolOrder",t.disableUndo)},_.prototype.createPositionLine=function(t){var t=t||{};return this._createTradingPrimitive("LineToolPosition",t.disableUndo)},_.prototype.createExecutionShape=function(t){var t=t||{};return this._createTradingPrimitive("LineToolExecution",t.disableUndo)},_.prototype.createVerticalLine=function(t,e){this._chartWidget.createShape(t,$.extend(e,{shape:"vertical_line"}))},_.prototype.createShape=function(t,e,i){return this.createMultipointShape([t],e,i)},_.prototype._alignPoints=function(t){var e,i=this._chartWidget.model().model(),o=i.mainSeries(),n=o.symbolInfo(),s=d.get_timezone(n.timezone);return i.timeScale().isEmpty()?t:(e=(new h.Session).init(s,n.session),t.map(function(t){return t?h.alignExchangeTimeToSessionStartAndReturnUTC(e.timezone,e.spec,new Date(1e3*t))/1e3:t}))},_.prototype.createMultipointShape=function(t,i,o){function n(t,e,i,o){var n,s,r,a=S.closestIndexLeft(e)||0,l={index:a},h=S.valueAt(a);return e>h&&(n=w.syncModel().distance(h,e),n.success&&(l.index=l.index+n.result)),i?l.price=i:(s=["open","high","low","close"],r=o?s.indexOf(o)+1:1,r<=0&&(r=1),l.price=T.valueAt(a)[r]),l}var s,r,h,d,u,_,f,m,g,v,y=i.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),b=this._chartWidget.model().model(),w=b.mainSeries(),S=b.timeScale().points(),T=w.data();if(!b.timeScale().isEmpty()){for(s=b.paneForSource(w),r=t.map(function(t){return t.time}),h=c.isDWM(w.interval())&&!e.enabled("disable_resolution_rebuild")?this._alignPoints(r):r,u=[],d=0;d<t.length;d++)_=t[d],u.push(n(_.time,h[d],_.price,_.channel));if(f=p[i.shape]||p.flag,"LineToolPolyline"===f.name)u[0].price===u[u.length-1].price&&u[0].index===u[u.length-1].index||u.push(u[0]);else if("LineToolIcon"===f.name){if(i.icon=i.icon||i.overrides&&i.overrides.icon,!i.hasOwnProperty("icon"))throw Error("icon must be specified in options");if(l.indexOf(i.icon)===-1)throw Error("icon value must be valid");i.overrides=i.overrides||{},i.overrides.icon=i.icon}if(m=new a(f.name.toLowerCase()),i.overrides)for(g in i.overrides)m[g]&&m[g].setValue(i.overrides[g]);if(f.supportsText&&i.text&&m.text.setValue(i.text),v=y.createLineTool(s,u[0],f.name,m),v.pointsCount()!==u.length&&v.pointsCount()!==-1)throw Error("Wrong points count for "+i.shape+". Required "+v.pointsCount());for(d=1;d<u.length&&this._chartWidget.model().lineBeingCreated();d++)y.coninueCreatingLine(u[d],{},d<u.length-1);return i.lock&&v.setUserEditEnabled(!1),i.disableSelection&&(v.customization.disableSelection=!0),i.disableSave&&(v.customization.disableSave=!0),i.hasOwnProperty("showInObjectsTree")&&(v.customization.showInObjectsTree=i.showInObjectsTree),i.zOrder&&("top"===i.zOrder?y.bringToFront(v):"bottom"===i.zOrder&&y.sendToBack(v)),o&&o(v.id()),v.id()}},_.prototype.createStudy=function(t,e,i,o,a,l,h){var c,d,p,_;if(h&&h.checkLimit&&!this._chartWidget.model().canCreateStudy())return void u().open();if(t=t.toLowerCase(),c=r.findStudyMetaInfoByDescription(this._chartWidget.model().studiesMetaData(),t),c=$.extend({},c),delete c.state,c||console.warn("Study `"+t+"` not found."),d={},l){l=l;for(p in l)s.setMetainfoProperty(c,p,l[p]);d.styles=c.defaults.styles,d.bands=c.defaults.bands,d.filledAreasStyle=c.defaults.filledAreasStyle}o&&(d.inputs=n.getStudyRecordFromArray([t].concat(o),this._chartWidget).inputs),_=this._chartWidget.model().chartModel().insertStudy(c,d,e),i&&_.setUserEditEnabled(!1),a&&a(_.id())},_.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},_.prototype.setChartType=function(t){this._chartWidget.model().mainSeries().properties().style.setValue(t)},_.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},_.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onCompleted())},_.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onSymbolResolved())},_.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},_.prototype.dataReady=function(t){var e=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return t&&(e?this.onDataLoaded().subscribe(null,t,!0):t()),!e},_.prototype.crossHairMoved=function(t){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,t)},t.exports=_}).call(e,i(1))},function(t,e){"use strict";var i=function(){function t(t){return t.is_price_study}function e(t,e){var i,o=e.slice(0).toLowerCase();if(t){for(i=0;i<t.length;++i)if(t[i].description.toLowerCase()===o||t[i].shortDescription.toLowerCase()===o)return t[i];throw Error("Can't find metainfo for `"+e+"`")}throw Error("There is no studies metainfo at all")}function i(t){return t.inputs.map(function(t){return{id:t.id,type:t.type,name:t.name}})}function o(o,n){var s,a,l,h,c,d,p,u,_;if(!Array.isArray(o))return s=e(n.model().studiesMetaData(),o),{id:s.id,overlay:t(s)};for(a=o.slice(0),l=a[0],s=e(n.model().studiesMetaData(),l),h=t(s),c=i(s),p=a.splice(1),u=0;u<p.length;++u)d||(d={}),_=r[c[u].type]||r.string,d[c[u].id]=_(p[u]);return{id:s.id,name:l,overlay:h,inputs:d}}function n(t,o,n){function s(t){return t.name.toLowerCase()===a}var r,a,l,h=e(n.model().studiesMetaData(),t),c=i(h),d={};for(r in o)a=r.toLowerCase(),l=c.filter(s),0!==l.length?(l=l[0],d[l.id]=o[r]):console.warn("Uknown input `"+r+"` of `"+t+"`");return{id:h.id,name:t,inputs:d}}var s={},r={bool:function(t){return!!t},integer:function(t){return parseInt(t)},float:function(t){return parseFloat(t)},string:function(t){return t}};return s.getStudyRecordFromArray=function(t,e){return e=e||chartWidget,o(t,e)},s.getStudyRecordFromObject=function(t,e,i){return i=i||chartWidget,n(t,e,i)},s}();t.exports=i},function(t,e){"use strict";t.exports={text:{name:"LineToolText",supportsText:!0},anchored_text:{name:"LineToolTextAbsolute",supportsText:!0},note:{name:"LineToolNote",supportsText:!0},anchored_note:{name:"LineToolNoteAbsolute",supportsText:!0},callout:{name:"LineToolCallout",supportsText:!0},balloon:{name:"LineToolBalloon",supportsText:!0},arrow_up:{name:"LineToolArrowMarkUp",supportsText:!0},arrow_down:{name:"LineToolArrowMarkDown",supportsText:!0},arrow_left:{name:"LineToolArrowMarkLeft",supportsText:!0},arrow_right:{name:"LineToolArrowMarkRight",supportsText:!0},price_label:{name:"LineToolPriceLabel"},flag:{name:"LineToolFlagMark"},vertical_line:{name:"LineToolVertLine"},horizontal_line:{name:"LineToolHorzLine"},horizontal_ray:{name:"LineToolHorzRay"},trend_line:{name:"LineToolTrendLine"},trend_angle:{name:"LineToolTrendAngle"},arrow:{name:"LineToolArrow"},ray:{name:"LineToolRay"},extended:{name:"LineToolExtended"},parallel_channel:{name:"LineToolParallelChannel"},disjoint_angle:{name:"LineToolDisjointAngle"},flat_bottom:{name:"LineToolFlatBottom"},pitchfork:{name:"LineToolPitchfork"},schiff_pitchfork_modified:{name:"LineToolSchiffPitchfork"},schiff_pitchfork:{name:"LineToolSchiffPitchfork2"},inside_pitchfork:{name:"LineToolInsidePitchfork"},pitchfan:{name:"LineToolPitchfan"},gannbox:{name:"LineToolGannSquare"},gannbox_square:{name:"LineToolGannComplex"},gannbox_fan:{name:"LineToolGannFan"},fib_retracement:{name:"LineToolFibRetracement"},fib_trend_ext:{name:"LineToolTrendBasedFibExtension"},fib_speed_resist_fan:{name:"LineToolFibSpeedResistanceFan"},fib_timezone:{name:"LineToolFibTimeZone"},fib_trend_time:{name:"LineToolTrendBasedFibTime"},fib_circles:{name:"LineToolFibCircles"},fib_spiral:{name:"LineToolFibSpiral"},fib_speed_resist_arcs:{name:"LineToolFibSpeedResistanceArcs"},fib_wedge:{name:"LineToolFibWedge"},fib_channel:{name:"LineToolFibChannel"},xabcd_pattern:{name:"LineTool5PointsPattern"},cypher_pattern:{name:"LineToolCypherPattern"},abcd_pattern:{name:"LineToolABCD"},triangle_pattern:{name:"LineToolTrianglePattern"},"3divers_pattern":{name:"LineToolThreeDrivers"},head_and_shoulders:{name:"LineToolHeadAndShoulders"},elliott_impulse_wave:{name:"LineToolElliottImpulse"},elliott_triangle_wave:{name:"LineToolElliottTriangle"},elliott_triple_combo:{name:"LineToolElliottTripleCombo"},elliott_correction:{name:"LineToolElliottCorrection"},elliott_double_combo:{name:"LineToolElliottDoubleCombo"},cyclic_lines:{name:"LineToolCircleLines"},time_cycles:{name:"LineToolTimeCycles"},sine_line:{name:"LineToolSineLine"},long_position:{name:"LineToolRiskRewardLong"},short_position:{name:"LineToolRiskRewardShort"},forecast:{name:"LineToolPrediction"},date_range:{name:"LineToolDateRange"},price_range:{name:"LineToolPriceRange"},date_and_price_range:{name:"LineToolDateAndPriceRange"},bars_pattern:{name:"LineToolBarsPattern"},ghost_feed:{name:"LineToolGhostFeed"},projection:{name:"LineToolProjection"},rectangle:{name:"LineToolRectangle"},rotated_rectangle:{name:"LineToolRotatedRectangle"},ellipse:{name:"LineToolEllipse"},triangle:{name:"LineToolTriangle"},polyline:{name:"LineToolPolyline"},curve:{name:"LineToolBezierQuadro"},double_curve:{name:"LineToolBezierCubic"},arc:{name:"LineToolArc"},icon:{name:"LineToolIcon"}}},function(t,e,i){"use strict";var o=i(605);i(612),JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol"}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(1),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,s,r,a;return this._context=t,i=this._context.new_var(this._context.symbol.time),o.Std.period(this._context),this._context.select_sym(1),n=this._context.new_var(this._context.symbol.time),s=o.Std[e(0)](this._context),r=this._context.new_var(s),this._context.select_sym(0),a=r.adopt(n,i,0),[a]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{},high:{},low:{},close:{}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(0),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,s,r,a,l;return this._context=t,i=this._context.new_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_var(this._context.symbol.time),s=this._context.new_var(o.Std.open(this._context)),r=this._context.new_var(o.Std.high(this._context)),a=this._context.new_var(o.Std.low(this._context)),l=this._context.new_var(o.Std.close(this._context)),this._context.select_sym(0),[s.adopt(n,i,0),r.adopt(n,i,0),a.adopt(n,i,0),l.adopt(n,i,0)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{showMA:!1,maLength:20}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"},{id:"maLength",name:"MA Length",defval:20,type:"integer",min:1,max:2e3}],id:"Volume@tv-basicstudies-1"},constructor:function(){this.f_0=function(t,e){return o.Std.gt(t,e)?0:1},this.f_1=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,s,r,a,l,h;return this._context=t,this._input=e,i=this._input(0),n=o.Std.volume(this._context),s=this.f_0(o.Std.open(this._context),o.Std.close(this._context)),r=o.Std.volume(this._context),a=this._context.new_var(r),l=o.Std.sma(a,this._input(1),this._context),h=this.f_1(i,l),[n,s,h]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"ZigZag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l,h,c;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=i/100,r=n/2,a=o.Std.zigzag(s,r,this._context),l=o.Std.zigzagbars(s,r,this._context),h=a,c=l,[h,c]}}}])}]);