(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[93202],{963894:(e,t)=>{"use strict";t.CircularBuffer=void 0;var n=function(){function e(e){this._start=0,this._size=0,this._buffer=new Array(e)}return e.prototype.size=function(){return this._size},e.prototype.capacity=function(){return this._buffer.length},e.prototype.enqueue=function(e){this._size=this._size)throw new Error("Index is out of range");var t=(this._start+e)%this._buffer.length;return this._buffer[t]},e.prototype.forEach=function(e,t){for(var n=0;n{"use strict";n.d(t,{default:()=>i});var o=n(144315);const i=function(e){return(0,o.default)(e,4)}},729030:(e,t,n)=>{"use strict";n.d(t,{getSymbolData:()=>l});var o=n(120780),i=n(438874),a=n(250378),r=n(685503),s=n(159954);function l(e,t,n,l=!0,c=!1){const d=n.join(","),u=(0,i.getSymbolDataUrl)(t,d,l,c),h={signal:e,method:"GET",credentials:"include",headers:{Accept:"application/json"}};return(0,o.fetch)(u,h,{logOnErrorStatus:!1}).then((e=>{if(400===e.status){const{status:t,statusText:n}=e;return e.json().then((e=>{const o=e.errmsg;throw new a.BadRequestErrorResponse({status:t,statusText:n,error:o})}))}if(404===e.status){const{status:t,statusText:n}=e;return e.json().then((o=>{if("symbol_not_exists"===o.code){const e=o.errmsg;throw new s.SymbolDoesNotExistErrorResponse({status:t,statusText:n,error:e})}throw new r.HttpErrorResponse(e)}))}if(e.ok)return e.json().then((e=>e));throw new r.HttpErrorResponse(e)}))}},304986:(e,t,n)=>{"use strict";n.d(t,{getThemeFromUserSettings:()=>a,saveThemeInUserSettings:()=>r});var o=n(62802),i=n(278855);function a(){return(0,i.getThemeFromCookie)()||(0,o.getValue)("current_theme.name")||null}function r(e){(0,i.setThemeToCookie)(e),(0,o.setValue)("current_theme.name",e,{forceFlush:!0})}},429874:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_THEME:()=>c.DEFAULT_THEME,extractThemeFromModel:()=>W,getCurrentTheme:()=>h,getStdTheme:()=>T,getStdThemeNames:()=>b,getStdThemedValue:()=>_,getTheme:()=>f,getThemeNames:()=>y,getThemedColor:()=>p,isPublicTheme:()=>u,isStdTheme:()=>N,isStdThemeName:()=>w,isStdThemedDefaultValue:()=>I,isThemeExist:()=>E,loadTheme:()=>m,removeTheme:()=>C,restoreTheme:()=>S,saveTheme:()=>A,savedThemeName:()=>g,syncTheme:()=>v,themes:()=>d.themes,translateStdThemeName:()=>F});var o=n(724377),i=n(42292),a=n(304986);const r=n(787703);var s=n(86746),l=n(331633),c=n(484400),d=n(514811);function u(e){ return!e.isPrivate}function h(){return d.themes[l.watchedTheme.value()]||d.themes[c.DEFAULT_THEME]}function p(e){return h().getThemedColor(e)}async function m(e,t){const{themeName:n,standardTheme:o,syncState:a=!0,noUndo:r=!1,applyOverrides:s=!1,onlyActiveChart:l=!1}=t,c=await(o?Promise.resolve(T(n)):f(n)),d=!o;if(void 0!==c.content){const t=!o||l;s&&(void 0!==(u=c.content).chartProperties&&(0,i.applyDefaultsOverrides)(u.chartProperties),void 0!==u.mainSourceProperties&&(0,i.applyDefaultsOverrides)(u.mainSourceProperties,void 0,!0,"mainSeriesProperties")),await e.applyTheme({theme:c.content,onlyActiveChart:t,restoreNonThemeDefaults:d,themeName:n,standardTheme:o,syncState:a,noUndo:r})}var u;return c}function S(){(0,l.setTheme)((0,a.getThemeFromUserSettings)()||c.DEFAULT_THEME)}function g(){return(0,a.getThemeFromUserSettings)()}function v(){(0,a.saveThemeInUserSettings)(h().name)}function f(e){return r.loadTheme(e)}function y(){return r.loadThemes()}function b(){return s.getStdThemeNames()}function w(e){return b().includes(e)}function T(e){return s.getStdChartTheme(e)||{content:void 0}}function _(e,t){const n=t||h().name,o=s.getStdChartTheme(n),i=0!==e.length&&e.split(".");return o&&o.content&&i?i.reduce(((e,t)=>e[t]),o.content):null}function I(e,t,n){const i=_(e,n);return null!==i&&(0,o.areEqualRgba)((0,o.parseRgba)(i),(0,o.parseRgba)(String(t)))}function A(e,t){return r.saveTheme(e,t)}function C(e){return r.removeTheme(e)}function E(e){return r.isThemeExist(e)}function F(e){return s.translateThemeName(e)}function N(e){return s.isStdTheme(e)}function W(e){return{content:{chartProperties:{paneProperties:e.model().properties().childs().paneProperties.state(),scalesProperties:e.model().properties().childs().scalesProperties.state()},sessions:e.model().sessions().properties().state(),mainSourceProperties:e.model().mainSeries().properties().state(),version:e.model().version()}}}},39654:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getIsoLanguageCodeFromLanguage:()=>i});const o={ar_AE:"ar",br:"pt",de_DE:"de",ca_ES:"ca",he_IL:"he",id_ID:"id",in:"en",kr:"ko",ms_MY:"ms",sv_SE:"sv",th_TH:"th",uk:"en",vi_VN:"vi",zh_CN:"zh-Hans",zh_TW:"zh-Hant",zh:"zh-Hans",hu_HU:"hu-HU"};function i(e){return o[e]||e}},72368:(e,t,n)=>{"use strict";n.d(t,{canShowNewSymbolSearch:()=>l,getCurrentLocaleInfoCountry:()=>c,isMobile:()=>r,isPlatformMobile:()=>s});var o=n(314802),i=n(244842),a=n(638456);function r(){const e=window.matchMedia("(min-width: 602px) and (min-height: 445px)").matches;return a.CheckMobile.any()&&!e}function s(){return!(0,o.isOnMobileAppPage)("any")&&r()}function l(){return!i.enabled("widget")&&!(0,o.isOnMobileAppPage)("any")}function c(){var e,t;return null===(t=null===(e=window.initData)||void 0===e?void 0:e.currentLocaleInfo)||void 0===t?void 0:t.flag.toUpperCase()}},530254:(e,t,n)=>{"use strict";n.d(t,{MAX_VAL:()=>u,format:()=>h,getFractionalDigitsNumber:()=>m,getMetricPrefix:()=>p});var o=n(650151),i=n(960521),a=n(182436),r=n(943994),s=n(425755),l=n(31341);const c=new Map;let d=null;const u=1e100;function h(e,t,n=2){ return Math.abs(e)>=u?"—":"volume"===t?function(e){d||(d=new r.VolumeFormatter);return d.format(e)}(e):"percents"===t?(0,l.forceLTRStrSsr)(function(e,t){let n="";e<0&&(n="−",e=-e);return n+function(e){if(c.has(e))return(0,o.ensureDefined)(c.get(e));const t=new a.NumericFormatter(e);return c.set(e,t),t}(t).format(e)}(e,n)+"%"):(0,l.forceLTRStrSsr)(function(e){return(new s.FinancialsFormatter).format(e)}(e))}function p(e){const t=Math.abs(e);return t<995?{symbol:"",multiplier:1}:t<999995?{symbol:"K",multiplier:1e3}:t<999999995?{symbol:"M",multiplier:1e6}:t<999999999995?{symbol:"B",multiplier:1e9}:{symbol:"T",multiplier:1e12}}function m(e){const t=(0,i.Big)(e);return Math.max(t.c.length-t.e-1,0)}},515828:(e,t,n)=>{"use strict";n.d(t,{MINDS_GROUP_PATH_PATTERN:()=>o,createMindsPath:()=>i});const o="/minds/groups/:symbol/";function i(e,t,n){let i=o.replace(":symbol",encodeURIComponent(e));if(!t)return i;const a=new URLSearchParams;return a.set("mind",t),n&&a.set("editable","true"),i+=`?${a.toString()}`,i}},199687:(e,t,n)=>{"use strict";n.d(t,{DEFAULT_PERIOD:()=>c,PERIODS:()=>l,PageId:()=>o,getFinancialsPages:()=>r,getStatementsCategories:()=>s});var o,i=n(444372),a=n(610203);function r(){return[{id:o.Overview,children:i.t(null,void 0,n(37260))},{id:o.Statements,children:i.t(null,void 0,n(861589))},{id:o.Statistics,children:i.t(null,void 0,n(751706))},{id:o.Dividends,children:i.t(null,void 0,n(634135))},{id:o.Earnings,children:i.t(null,void 0,n(783851))},{id:o.Revenue,children:i.t(null,void 0,n(259285))}]}function s(){return[{id:"income statements",children:i.t(null,void 0,n(676712))},{id:"balance sheet",children:i.t(null,void 0,n(342134))},{id:"cash flow",children:i.t(null,void 0,n(638237))}]}!function(e){e.Overview="overview",e.Statements="statements",e.Statistics="statistics",e.Dividends="dividends",e.Earnings="earnings",e.Revenue="revenue"}(o||(o={}));const l=(e=a.PeriodId.Quarter)=>[{id:a.PeriodId.Year,title:i.t(null,void 0,n(34314))},{id:e,title:e===a.PeriodId.HalfYear?i.t(null,void 0,n(512421)):i.t(null,void 0,n(908831))}],c=e=>l(e)[1].id},951713:(e,t,n)=>{"use strict";n.d(t,{getHideOptions:()=>d,getSavedHideMode:()=>h,toggleHideMode:()=>u});var o=n(650151),i=n(444372),a=n(62802),r=n(439016),s=n(885482),l=n(597101);let c=null;function d(){if(null!==c)return c;const e=(0,r.tradingService)();return c=new Map([["drawings",{label:i.t(null,void 0,n(413277)),dataName:"hide-drawing-tools",tooltip:{active:i.t(null,void 0,n(998116)),inactive:i.t(null,void 0,n(895551))},getBoxedValue:()=>(0,s.hideAllDrawings)(),trackLabel:"hide drawings"}],["indicators",{label:i.t(null,void 0,n(44177)),dataName:"hide-indicators",tooltip:{active:i.t(null,void 0,n(249982)),inactive:i.t(null,void 0,n(986306))},getBoxedValue:()=>(0,s.hideAllIndicators)(),trackLabel:"hide indicators"}],["positions",{label:i.t(null,void 0,n(190540)),dataName:"hide-positions-and-orders",tooltip:{active:i.t(null,void 0,n(262632)),inactive:i.t(null,void 0,n(770803))},getBoxedValue:()=>(0,o.ensureNotNull)(e).showTradedSources,inverted:!0,trackLabel:"hide positions" }],["all",{label:i.t(null,void 0,n(133911)),dataName:"hide-all",tooltip:{active:e?i.t(null,void 0,n(538293)):i.t(null,void 0,n(839046)),inactive:e?i.t(null,void 0,n(67927)):i.t(null,void 0,n(44312))},trackLabel:"hide all"}]]),e||c.delete("positions"),c}function u(e){e?a.setValue("ChartToolsHideMode",e):e=h();const t=p();let n=!t;return"all"===e?(m(((e,t,o)=>{e.setValue(o?!n:n)})),l.hideStateChange.fire({hideMode:e,isActive:n}),n):(m(((o,i,a)=>{if(i===e){const e=t?!a:!o.value();o.setValue(e),n=a?!e:e}else o.setValue(Boolean(a))})),l.hideStateChange.fire({hideMode:e,isActive:n}),n)}function h(){const e=a.getValue("ChartToolsHideMode","drawings");return d().has(e)?e:"drawings"}function p(){let e=!0;return m(((t,n,o)=>{const i=t.value();e=e&&(o?!i:i)})),e}function m(e){d().forEach(((t,n)=>{var o;const i=null===(o=t.getBoxedValue)||void 0===o?void 0:o.call(t);i&&e(i,n,t.inverted)}))}},306388:(e,t,n)=>{"use strict";n.d(t,{initSymbolListService:()=>r});var o=n(564894),i=n(83871),a=n(244842);function r(){return Promise.all([Promise.all([n.e(32662),n.e(5987),n.e(98996),n.e(43387),n.e(66458),n.e(4343),n.e(44597),n.e(1413),n.e(52078),n.e(19216),n.e(16005),n.e(16165),n.e(90385),n.e(42942),n.e(5483),n.e(62526),n.e(3889),n.e(92158),n.e(17774),n.e(5069),n.e(44692),n.e(1026)]).then(n.bind(n,999614)),Promise.all([n.e(32662),n.e(5987),n.e(98996),n.e(43387),n.e(66458),n.e(4343),n.e(44597),n.e(1413),n.e(52078),n.e(19216),n.e(16005),n.e(16165),n.e(90385),n.e(42942),n.e(5483),n.e(62526),n.e(3889),n.e(92158),n.e(17774),n.e(5069),n.e(44692),n.e(1026)]).then(n.bind(n,38506)),Promise.all([n.e(32662),n.e(5987),n.e(98996),n.e(43387),n.e(66458),n.e(4343),n.e(44597),n.e(1413),n.e(52078),n.e(19216),n.e(16005),n.e(16165),n.e(90385),n.e(42942),n.e(5483),n.e(62526),n.e(3889),n.e(92158),n.e(17774),n.e(5069),n.e(44692),n.e(1026)]).then(n.bind(n,850935)),Promise.all([n.e(32662),n.e(5987),n.e(98996),n.e(43387),n.e(66458),n.e(4343),n.e(44597),n.e(1413),n.e(52078),n.e(19216),n.e(16005),n.e(16165),n.e(90385),n.e(42942),n.e(5483),n.e(62526),n.e(3889),n.e(92158),n.e(17774),n.e(5069),n.e(44692),n.e(1026)]).then(n.bind(n,244692)),a.enabled("widget")?null:Promise.all([n.e(32662),n.e(5987),n.e(98996),n.e(43387),n.e(66458),n.e(4343),n.e(44597),n.e(1413),n.e(52078),n.e(19216),n.e(16005),n.e(16165),n.e(90385),n.e(42942),n.e(5483),n.e(62526),n.e(3889),n.e(92158),n.e(17774),n.e(5069),n.e(44692),n.e(1026)]).then(n.bind(n,216752))]).then((([e,t,n,a,r])=>{if((0,o.hasService)(i.SYMBOL_LIST_SERVICE))return(0,o.service)(i.SYMBOL_LIST_SERVICE);const{store:s,runner:l}=e.configureStore(),c=l.run(t.symbolListRepositorySaga);(0,o.registerService)(i.SYMBOL_LIST_SERVICE,{store:s,runner:l,actions:{addSymbols:a.addSymbolsThunk,initWidget:n.initWidget,saveListAs:a.saveListAsThunk,createNewWatchList:a.userCreateWatchlistThunk},task:c});const d=(0,o.service)(i.SYMBOL_LIST_SERVICE);return null!==r&&r.getCustomSymbolListSynchronizationServiceInstance(d),d}))}},621618:(e,t,n)=>{"use strict";n.d(t,{ActionsProvider:()=>bn,createActionCopyPrice:()=>Sn, createActionToggleVisibilityDataSources:()=>fn,createActionTrade:()=>un,createChangeIntervalsVisibilitiesAction:()=>mn,createLinesAction:()=>gn,createPasteAction:()=>hn,createSyncDrawingActions:()=>vn,createVisualOrderAction:()=>pn,defaultContextMenuOptions:()=>cn});var o=n(650151),i=n(201089),a=n(960521),r=n(389137),s=n(444372),l=n(244842),c=n(373571),d=n(175070),u=n(982217),h=n(238433),p=n(794349),m=n(461794),S=n(345848),g=n(939243),v=n(651065),f=n(772466),y=n(827710),b=n(439016),w=n(406849),T=n(454984),_=n(778737),I=n(674053),A=n(516684),C=n(520533),E=n(922850),F=n(985139),N=n(414592),W=n(709081),P=n(711496),M=n(834075),L=n(526075),x=n(860037),D=n(500521),k=n(263955),O=n(921692),V=n(184586),R=n(314802),U=n(638456),B=n(453817),H=n(811630),j=n(311225),z=n(926225),$=n(470316),G=n(104436),Y=n(943855),q=n(519073),Z=n(568247),K=n(356893),X=n(713473),J=n(981107),Q=n(167975),ee=n(809796),te=n(885482),ne=n(223699),oe=n(506312),ie=n(440941),ae=n(395098),re=n(793993),se=n(62745),le=n(354950),ce=n(447285),de=n(547871),ue=n(971417),he=n(305934),pe=n(747971);const me=(0, i.getLogger)("Chart.ActionsProvider"),Se=new ee.TranslatedString("change visibility",s.t(null,void 0,n(521511))),ge=new ee.TranslatedString("pin to scale {label}",s.t(null,void 0,n(156015))),ve=new ee.TranslatedString("pin to right scale",s.t(null,void 0,n(22615))),fe=new ee.TranslatedString("pin to left scale",s.t(null,void 0,n(84018))),ye=new ee.TranslatedString("change earnings visibility",s.t(null,void 0,n(88217))),be=new ee.TranslatedString("change dividends visibility",s.t(null,void 0,n(184944))),we=new ee.TranslatedString("change splits visibility",s.t(null,void 0,n(374488))),Te=new ee.TranslatedString("change continuous contract switch visibility",s.t(null,void 0,n(407017))),_e=new ee.TranslatedString("change futures contract expiration visibility",s.t(null,void 0,n(628288))),Ie=new ee.TranslatedString("change latest news and Minds visibility",s.t(null,void 0,n(819839))),Ae=new ee.TranslatedString("show all ideas",s.t(null,void 0,n(813622))),Ce=new ee.TranslatedString("show ideas of followed users",s.t(null,void 0,n(826267))),Ee=new ee.TranslatedString("show my ideas only",s.t(null,void 0,n(740061))),Fe=new ee.TranslatedString("change events visibility on chart",s.t(null,void 0,n(979574))),Ne=new ee.TranslatedString("add this symbol to entire layout",s.t(null,void 0,n(527982))),We=new ee.TranslatedString("add this indicator to entire layout",s.t(null,void 0,n(182388))),Pe=new ee.TranslatedString("add this strategy to entire layout",s.t(null,void 0,n(894292))),Me=new ee.TranslatedString("add this financial metric to entire layout",s.t(null,void 0,n(422856))),Le=new ee.TranslatedString("apply drawing template",s.t(null,void 0,n(349037))),xe=new ee.TranslatedString("lock objects",s.t(null,void 0,n(168163))),De=new ee.TranslatedString("unlock objects",s.t(null,void 0,n(766824))),ke=new ee.TranslatedString("change visibility at current interval and above",s.t(null,void 0,n(678422))),Oe=new ee.TranslatedString("change visibility at current interval and below",s.t(null,void 0,n(249529))),Ve=new ee.TranslatedString("change visibility at current interval",s.t(null,void 0,n(416698))),Re=new ee.TranslatedString("change visibility at all intervals",s.t(null,void 0,n(666927))),Ue=s.t(null,void 0,n(287085)),Be=(0, Q.appendEllipsis)(s.t(null,void 0,n(952302))),He=s.t(null,void 0,n(581428)),je=s.t(null,void 0,n(831971)),ze=s.t(null,void 0,n(514125)),$e=s.t(null,void 0,n(444538)),Ge=s.t(null,void 0,n(556948)),Ye=s.t(null,void 0,n(920207)),qe=s.t(null,void 0,n(665810)),Ze=s.t(null,void 0,n(603822)),Ke=s.t(null,void 0,n(697324)),Xe=s.t(null,void 0,n(500764)),Je=s.t(null,void 0,n(708128)),Qe=s.t(null,void 0,n(361201)),et=s.t(null,void 0,n(832156)),tt=s.t(null,void 0,n(591130)),nt=s.t(null,void 0,n(737680)),ot=s.t(null,void 0,n(243707)),it=s.t(null,void 0,n(739065)),at=s.t(null,void 0,n(454727)),rt=s.t(null,void 0,n(366156)),st=s.t(null,void 0,n(976598)),lt=s.t(null,void 0,n(203485)),ct=s.t(null,void 0,n(745828)),dt=s.t(null,void 0,n(702899)),ut=s.t(null,void 0,n(640887)),ht=s.t(null,void 0,n(753387)),pt=s.t(null,void 0,n(796712)),mt=s.t(null,void 0,n(126354)),St=s.t(null,void 0,n(219796)),gt=s.t(null,void 0,n(559901)),vt=s.t(null,void 0,n(223221)),ft=s.t(null,void 0,n(422198)),yt=s.t(null,void 0,n(127557)),bt=s.t(null,void 0,n(598486)),wt=s.t(null,void 0,n(973106)),Tt=s.t(null,void 0,n(85964)),_t=s.t(null,void 0,n(559192)),It=s.t(null,void 0,n(583182)),At=(0,Q.appendEllipsis)(s.t(null,void 0,n(592206))),Ct=(0,Q.appendEllipsis)(s.t(null,void 0,n(303612))),Et=(0,Q.appendEllipsis)(s.t(null,void 0,n(389517))),Ft=s.t(null,void 0,n(813345)),Nt=(0,Q.appendEllipsis)(s.t(null,void 0,n(309908))),Wt=s.t(null,void 0,n(35216)),Pt=s.t(null,void 0,n(552977)),Mt=s.t(null,void 0,n(419611)),Lt=s.t(null,void 0,n(738342)),xt=s.t(null,void 0,n(715101)),Dt=s.t(null,void 0,n(642284)),kt=s.t(null,void 0,n(246771)),Ot=s.t(null,void 0,n(966263)),Vt=s.t(null,void 0,n(830816)),Rt=s.t(null,void 0,n(124620)),Ut=s.t(null,void 0,n(484813)),Bt=s.t(null,void 0,n(772973)),Ht=s.t(null,void 0,n(748284)),jt=s.t(null,void 0,n(487933)),zt=s.t(null,void 0,n(258669)),$t=(0,Q.appendEllipsis)(s.t(null,void 0,n(389517))),Gt=s.t(null,void 0,n(308251)),Yt=s.t(null,void 0,n(34059)),qt=s.t(null,void 0,n(364288)),Zt=s.t(null,void 0,n(777920)),Kt=s.t(null,void 0,n(575669)),Xt=s.t(null,void 0,n(608886)),Jt=s.t(null,void 0,n(618008)),Qt=s.t(null,void 0,n(733606)),en=(0,Q.appendEllipsis)(s.t(null,void 0,n(979758))),tn=(0,Q.appendEllipsis)(s.t(null,void 0,n(218001))),nn=s.t(null,void 0,n(729682)),on=s.t(null,void 0,n(28851)),an=s.t(null,void 0,n(420366)),rn=s.t(null,void 0,n(956977)),sn=s.t(null,void 0,n(601184)),ln=s.t(null,void 0,n(873436)),cn={general:!0,mainSeries:!0,mainSeriesTrade:!1,esdStudies:!0,studies:!0,fundamentals:!0,lineTools:!0,publishedCharts:!0,ordersAndPositions:!0,alerts:!0,chartEvents:!0,objectTree:!0,gotoLineTool:!1};function dn(e){return(0,J.isActingAsSymbolSource)(e)?e.symbolTitle(u.TitleDisplayTarget.StatusLine,!0,!0):(0,m.clean)(e.title(u.TitleDisplayTarget.StatusLine,!0),!0)}function un(e,t,n){if(e.model().isInReplay().value())return null;const o=e.model().mainSeries(),i=o.symbolInfo();if(o.isConvertedToOtherCurrency()||o.isConvertedToOtherUnit()||(0,v.isNonTradableSymbolType)(null==i?void 0:i.type))return null;const a=new c.Action({ actionId:"Trading.TradeFromChart",options:{},optionsLoader:()=>{const t=new Promise((async(t,o)=>{const i=(0,b.tradingService)();if(null===i||0===(await i.brokersMetainfo()).length)return void t({label:Ue,disabled:!0});const a=e.model().mainSeries();let r;n&&(r=n.localY),(0,w.createTradeContext)(a,r).then((e=>{try{return i.chartContextMenuActions(e,{hideNotExecutableAction:!0})}catch(e){return me.logError(e.message),[]}})).then((e=>{0!==e.length?t({name:"trade",label:Ue,subItems:e,statName:"Trading"}):t({label:Ue,disabled:!0})})).catch((()=>{o("Unable to get Trade Context")}))}));return(0,T.makeTimeLimited)(t,5e3,"Action trade not received")}});return a}function hn(e,t){return!t.isEmpty()&&l.enabled("datasource_copypaste")?new pe.ActionWithStandardIcon({actionId:"Chart.Clipboard.PasteSource",options:{label:nn.trim(),shortcutHint:(0,$.humanReadableHash)($.Modifiers.Mod+86),statName:"Paste",onExecute:()=>e.chartWidgetCollection().clipboard.uiRequestPaste(t)}}):null}function pn(e,t){const n=e.model(),o=n.availableZOrderOperations(t),i=[new pe.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.BringToFront",options:{label:mt,statName:"BringToFront",disabled:!o.bringToFrontEnabled,onExecute:()=>n.bringToFront(t)}}),new pe.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.SendToBack",options:{label:St,statName:"SendToBack",disabled:!o.sendToBackEnabled,onExecute:()=>n.sendToBack(t)}}),new pe.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.BringForward",options:{label:gt,statName:"BringForward",disabled:!o.bringForwardEnabled,onExecute:()=>n.bringForward(t)}}),new pe.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.SendBackward",options:{label:vt,statName:"SendBackward",disabled:!o.sendBackwardEnabled,onExecute:()=>n.sendBackward(t)}})];return new pe.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder",options:{label:ft,iconId:"Chart.VisualOrder",statName:"VisualOrder",subItems:i}})}function mn(e,t){const n=e.model(),o=(e,o)=>{const i=ne.Interval.parse(n.mainSeries().interval()),a=(0,ae.getIntervalsVisibilitiesForMode)(i,e),r=[],s=[];t.forEach((e=>{const t=e.properties().intervalsVisibilities.childs();r.push(t.ticks),s.push(a.ticks),r.push(t.seconds),s.push(a.seconds),r.push(t.secondsFrom),s.push(a.secondsFrom),r.push(t.secondsTo),s.push(a.secondsTo),r.push(t.minutes),s.push(a.minutes),r.push(t.minutesFrom),s.push(a.minutesFrom),r.push(t.minutesTo),s.push(a.minutesTo),r.push(t.hours),s.push(a.hours),r.push(t.hoursFrom),s.push(a.hoursFrom),r.push(t.hoursTo),s.push(a.hoursTo),r.push(t.days),s.push(a.days),r.push(t.daysFrom),s.push(a.daysFrom),r.push(t.daysTo),s.push(a.daysTo),r.push(t.weeks),s.push(a.weeks),r.push(t.weeksFrom),s.push(a.weeksFrom),r.push(t.weeksTo),s.push(a.weeksTo),r.push(t.months),s.push(a.months),r.push(t.monthsFrom),s.push(a.monthsFrom),r.push(t.monthsTo),s.push(a.monthsTo),r.push(t.ranges),s.push(a.ranges)})),n.setProperties(r,s,o,(0,he.sourcesAffectState)(t))},i=[new pe.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.CurrentAndAbove", options:{label:bt,statName:"currentAndAboveIntervals",onExecute:()=>o(3,ke)}}),new pe.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.CurrentAndBelow",options:{label:wt,statName:"currentAndBelowIntervals",onExecute:()=>o(2,Oe)}}),new pe.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.Current",options:{label:Tt,statName:"currentInterval",onExecute:()=>o(1,Ve)}}),new pe.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.All",options:{label:_t,statName:"allIntervals",onExecute:()=>o(0,Re)}})];return new pe.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility",options:{label:yt,statName:"IntervalsVisibility",subItems:i}})}function Sn(e,t){var n,o,i;const a=e.defaultPriceScale(),r=void 0!==t?a.coordinateToPrice(t,null!==(o=null===(n=e.mainDataSource())||void 0===n?void 0:n.firstValue())&&void 0!==o?o:0):e.model().mainSeries().lastValueData(4,!0,!0).price,s=null===(i=e.mainDataSource())||void 0===i?void 0:i.formatter();if(void 0===r||!s)return null;const l=s.format(r),c=s.format(r,{ignoreLocaleNumberFormat:!0});return new pe.ActionWithStandardIcon({actionId:"Chart.Clipboard.CopyPrice",options:{label:`${on} ${l}`,statName:"CopyPrice",onExecute:()=>(0,re.getClipboard)().writeText(c)}})}function gn(e){const t=e.actions(),n=[t.showPriceLine];return n.push(t.showSeriesPrevCloseLine),n.push(t.showPrePostMarketPriceLine),n.push(t.showHighLowPriceLines),e.model().model().hasCustomSource("bidask")&&n.push(t.showBidAskLines),new pe.ActionWithStandardIcon({actionId:"Chart.Lines",options:{label:It,statName:"Lines",subItems:n}})}function vn(e,t){const n=[];{if(te.isToolCreatingNow.value())return n;const o=()=>t.some((e=>e.isSynchronizable()));{if(!window.user.is_pro)return n;if(!o())return n;let i=t[0].sharingMode().value();i=t.every((e=>e.sharingMode().value()===i))?i:null;const a=e.model();n.push(new c.Action({actionId:"Chart.LineTool.NoSync",options:{label:Xt,statName:"NoSyncDrawing",checkable:!0,checked:0===i,onExecute:e=>{e.isChecked()&&a.shareLineTools(t,0)}}}),new c.Action({actionId:"Chart.LineTool.SyncInLayout",options:{label:Jt,statName:"SyncDrawingInLayout",checkable:!0,checked:1===i,onExecute:e=>{e.isChecked()&&a.shareLineTools(t,1)}}}),new c.Action({actionId:"Chart.LineTool.SyncGlobally",options:{label:Qt,statName:"SyncDrawingGlobally",checkable:!0,checked:2===i,onExecute:e=>{e.isChecked()&&a.shareLineTools(t,2)}}}))}}return n}function fn(e,t){const n=t[0].properties().visible.value(),o=n?je:He,i=n?"Chart.Hide":"Chart.ShowObject",a=n?"Chart.SelectedObject.Hide":"Chart.SelectedObject.Show";return new pe.ActionWithStandardIcon({actionId:a,options:{checkable:!0,statName:"ToggleVisibilitySelectedObject",label:o,iconId:i,onExecute:()=>{const o=e.model();o.withMacro(Se,(()=>{t.forEach((e=>{o.setProperty(e.properties().visible,!n,Se,ie.lineToolsDoNotAffectChartInvalidation&&(0,X.isLineTool)(e))}))}))}}})}function yn(){var e,t;return!(0,U.onWidget)()&&!(0, R.isOnMobileAppPage)("any")&&!!(null===(t=null===(e=window.widgetbar)||void 0===e?void 0:e.layout)||void 0===t?void 0:t.canOpen())}class bn{constructor(e,t){this._chartWidget=e,this._options=(0,r.merge)((0,r.clone)(cn),t||{})}async contextMenuActionsForSources(e,t,n,o,i){const a=e[0],r=this._options,s=[];if(a===this._chartWidget.model().mainSeries()&&r.mainSeries)s.push(...await this._contextMenuActionsForSeries(a,n));else if((0,h.isESDStudy)(a)&&r.esdStudies)s.push(...this._contextMenuActionsForESD());else if((0,h.isRollDatesStudy)(a))s.push(...this._contextMenuActionsForRollDates());else if((0,O.isFuturesContractExpiration)(a))s.push(...this._contextMenuActionsForFuturesContractExpiration());else if((0,V.isLatestUpdatesSource)(a))s.push(...this._contextMenuActionsForisLatestUpdates());else if((0,h.isStudy)(a)&&r.studies)s.push(...await this._contextMenuActionsForStudy(a,t,n));else if(a instanceof E.PublishedChartsTimeline&&r.publishedCharts)s.push(...this._contextMenuActionsForPublishedTimeline(a));else if((a instanceof _.LineToolOrder||a instanceof I.LineToolPosition)&&r.ordersAndPositions)s.push(...this._contextMenuActionsForTradingDrawings(a));else if((0,N.isAlertLabel)(a)&&a.alert().id().value()&&!a.alert().isNew()&&r.alerts)s.push(...await this._contextMenuActionsForAlertLabel(a.alert(),o));else if((0,X.isLineTool)(a)&&r.lineTools){const t=e.filter(X.isLineTool);s.push(...await this._contextMenuActionsForLineTool(t))}else(function(e){return e.name()===ce.ChartEventsSourceId.Value})(a)&&r.chartEvents&&s.push(...this._contextMenuActionsForChartEvents(a));return s.length&&(null==i?void 0:i.length)&&s.push(new c.Separator),s.push(...null!=i?i:[]),s}_isReadOnly(){return this._chartWidget.readOnly()}_createActionScale(e){const t=(0,o.ensureNotNull)(e.priceScale()),n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(e)),a=i.priceScalePosition(t),r=("left"===a?i.leftPriceScales():i.rightPriceScales()).indexOf(t),s=n.priceScaleSlotsCount().totallySlots<2?"dontneedname":"needname",l="overlay"===a?"":(0,d.getPriceAxisNameInfo)(a,r).label,c=it.format({label:l}),u={"left-needname":c,"left-dontneedname":rt,"right-needname":c,"right-dontneedname":st,"overlay-needname":at,"overlay-dontneedname":at}[a+"-"+s];return new pe.ActionWithStandardIcon({actionId:"Chart.Source.ChangePriceScale",options:{label:u,iconId:"Chart.PriceScale",subItems:this._createActionScaleItems(e)}})}_createActionResetInputPoints(e){const t=e.metaInfo(),o=t.inputs.filter(se.isTimeOrPriceNotHiddenInput);return 0===o.length?null:new pe.ActionWithStandardIcon({actionId:"Chart.Source.ResetInputPoints",options:{label:tn,onExecute:async()=>{let i;try{const a=e.properties().childs().inputs.state();for(const e of Object.keys(a))o.find((t=>t.id===e))||delete a[e];const r=new le.Property({inputs:a }),s=await Promise.all([n.e(14819),n.e(73224),n.e(72718),n.e(93327),n.e(99410),n.e(32662),n.e(5987),n.e(98996),n.e(43387),n.e(66458),n.e(5761),n.e(4343),n.e(28430),n.e(70428),n.e(44597),n.e(1413),n.e(4908),n.e(52078),n.e(70621),n.e(89508),n.e(62033),n.e(13633),n.e(61204),n.e(19216),n.e(37132),n.e(66323),n.e(14),n.e(50473),n.e(37657),n.e(35697),n.e(31149),n.e(85258),n.e(16005),n.e(79656),n.e(83483),n.e(87940),n.e(63276),n.e(63751),n.e(5378),n.e(29647),n.e(77382),n.e(87473),n.e(10637),n.e(16165),n.e(85131),n.e(10714),n.e(94712),n.e(44794),n.e(39076),n.e(45338),n.e(66233),n.e(47877),n.e(42332),n.e(57876),n.e(84418),n.e(95884),n.e(20221),n.e(21975),n.e(70631),n.e(98133),n.e(45183),n.e(55713),n.e(75803),n.e(38982),n.e(90385),n.e(92833),n.e(42942),n.e(3889),n.e(92158),n.e(39434),n.e(68581),n.e(18561),n.e(26854),n.e(70334),n.e(97406),n.e(31063),n.e(53030)]).then(n.bind(n,280881));i=(await s.selectInputValuesOnChart(this._chartWidget,o,r,t.shortDescription,t.inputs)).customSourceId,e.properties().mergeAndFire(r.state())}finally{void 0!==i&&this._chartWidget.model().model().removeCustomSource(i)}}}})}_createActionLayoutChartsSync(){return new B.LayoutChartsSyncContextMenuAction(this._chartWidget.linkingGroupIndex().readonly(),(e=>this._chartWidget.model().setLinkingGroupIndex(e)))}_createActionScaleDetach(e,t,n,i){const a=this._chartWidget.model().model(),r=(0,o.ensureNotNull)(a.paneForSource(e));if(!r.canCreateNewPriceScale())return null;const s=(0,o.ensureNotNull)(e.priceScale()),l=s.canDetachSource(e),c=r.priceScalePosition(s),u=l||c!==t;if(!u)return null;const h=a.priceScaleSlotsCount(),p={left:{labelled:Ke,sided:nt},right:{labelled:Ke,sided:ot}},m="left"===t?r.leftPriceScales().length:r.rightPriceScales().length,S=h[t]>m?"labelled":"sided",g=(0,d.getPriceAxisNameInfo)(t,m).label,v=p[t][S].format({label:g});return new pe.ActionWithStandardIcon({actionId:"Chart.Source.ChangePriceScale",options:{checkable:!1,disabled:!u,label:v,statName:i,payload:e,onExecute:n}})}_onDetachLeft(e){const t=e.getPayload(),n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(t));this._chartWidget.model().detachToLeft(t,i)}_onDetachRight(e){const t=e.getPayload(),n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(t));this._chartWidget.model().detachToRight(t,i)}_createActionScaleDetachLeft(e){return this._createActionScaleDetach(e,"left",this._onDetachLeft.bind(this),"ToggleScaleLeft")}_createActionScaleDetachRight(e){return this._createActionScaleDetach(e,"right",this._onDetachRight.bind(this),"ToggleScaleRight")}_onMoveToScale(e){const t=e.getPayload();if(t.datasource.priceScale()===t.priceScale)return;const n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(t.datasource));this._chartWidget.model().moveToScale(t.datasource,i,t.priceScale,t.undoText)}_createMoveToScaleAction(e,t,n,o){const i=e.priceScale()===t;return new pe.ActionWithStandardIcon({actionId:"Chart.Source.MoveToOtherScale",options:{checkable:!0,checked:i,label:n,statName:"ToggleScale",payload:{datasource:e, priceScale:t,undoText:o},onExecute:this._onMoveToScale.bind(this)}})}_onNoScale(e){const t=e.getPayload().datasource,n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(t));i.isOverlay(t)||this._chartWidget.model().detachNoScale(t,i)}_createActionNoScale(e){const t=this._chartWidget.model().model(),n=(0,o.ensureNotNull)(t.paneForSource(e)),i=n.actionNoScaleIsEnabled(e);return new pe.ActionWithStandardIcon({actionId:"Chart.Source.MoveToNoScale",options:{checkable:!0,checked:n.isOverlay(e),label:lt,disabled:!i,statName:"ToggleNoScale",payload:{datasource:e},onExecute:this._onNoScale.bind(this)}})}_createActionScaleItems(e){const t=[],n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(e)),a=n.priceScaleSlotsCount().totallySlots>1,r=i.rightPriceScales(),s=i.leftPriceScales(),l=this._createActionScaleDetachRight(e),u=this._createActionScaleDetachLeft(e),h=r.length+s.length+(null===l?0:1)+(null===u?0:1)>2,p={right:{hidden:{checked:{labelled:ze,sided:$e},unchecked:{labelled:Ge,sided:Ye}},visible:{checked:{labelled:qe,sided:Ze},unchecked:{labelled:Ke,sided:Xe}}},left:{hidden:{checked:{labelled:ze,sided:Je},unchecked:{labelled:Ge,sided:Qe}},visible:{checked:{labelled:qe,sided:et},unchecked:{labelled:Ke,sided:tt}}}},m={right:ve,left:fe},S={left:i.visibleLeftPriceScales(),right:i.visibleRightPriceScales()},g=(t,n)=>{const o=("right"===n?r:s)[t],i=S[n].includes(o)?"visible":"hidden",l=e.priceScale()===o?"checked":"unchecked",c=a?"labelled":"sided",u=p[n],h=(0,d.getPriceAxisNameInfo)(n,t).label;return{actionText:u[i][l][c].format({label:h}),undoText:a?ge.format({label:h}):m[n]}};t.push(...r.map(((t,n)=>{const o=g(n,"right");return this._createMoveToScaleAction(e,t,o.actionText,o.undoText)}))),null!==l&&t.push(l);h&&(r.length>0||null!==l)&&t.push(new c.Separator);t.push(...s.map(((t,n)=>{const o=g(n,"left");return this._createMoveToScaleAction(e,t,o.actionText,o.undoText)}))),null!==u&&t.push(u);h&&(s.length>0||null!==u)&&t.push(new c.Separator);return t.push(this._createActionNoScale(e)),t}_createActionMergeUp(e){const t=this._chartWidget.model();return t.model().isMergeUpAvailableForSource(e)?new pe.ActionWithStandardIcon({actionId:"Chart.Source.MergeUp",options:{label:dt,statName:"MergeUp",onExecute:()=>t.mergeSourceUp(e)}}):null}_createActionUnmergeUp(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new pe.ActionWithStandardIcon({actionId:"Chart.Source.UnmergeUp",options:{label:ut,statName:"UnmergeUp",onExecute:()=>t.unmergeSourceUp(e)}}):null}_createActionMergeDown(e){const t=this._chartWidget.model();return t.model().isMergeDownAvailableForSource(e)?new pe.ActionWithStandardIcon({actionId:"Chart.Source.MergeDown",options:{label:ht,statName:"MergeDown",onExecute:()=>t.mergeSourceDown(e)}}):null}_createActionUnmergeDown(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new pe.ActionWithStandardIcon({actionId:"Chart.Source.UnmergeDown",options:{label:pt,statName:"UnmergeDown",onExecute:()=>t.unmergeSourceDown(e)} }):null}_mergeContentMenuItems(e){return[this._createActionMergeUp(e),this._createActionUnmergeUp(e),this._createActionMergeDown(e),this._createActionUnmergeDown(e)].filter(r.notNull)}_createActionMove(e){const t=this._mergeContentMenuItems(e);return t.length>0?new pe.ActionWithStandardIcon({actionId:"Chart.Source.MoveToPane",options:{label:ct,iconId:"Chart.Move",subItems:t}}):null}async _contextMenuActionsForSeries(e,t){var n;const i=[],a=this._chartWidget.model().model(),r=(0,o.ensureNotNull)(a.paneForSource(e)),s=this._chartWidget.actions(),d=t&&"localY"in t?t.localY:void 0;if(this._isReadOnly())i.push(fn(this._chartWidget,[e])),i.push(new c.Separator),i.push(this._createActionScale(e));else{if(e.alertCreationAvailable().value()){const t=(await(0,de.getAlertsChartActionCreators)()).createAlert(this._chartWidget,{series:e,localY:d});null!==t&&i.push(t)}if(i.push(this._createActionAddChildStudy(e)),this._options.fundamentals){const t=this._createActionAddFundamentals(e);null!==t&&i.push(t)}if(this._options.mainSeriesTrade){const e=un(this._chartWidget);null!==e&&i.push(e)}i.length>0&&!(i[i.length-1]instanceof c.Separator)&&i.push(new c.Separator),l.enabled("symbol_info")&&i.push(s.showSymbolInfoDialog),yn()&&i.push(this._chartWidget.actions().showDataWindow);const t=a.mainSeries().symbolInfo();if(s.showFinancials&&null!==t&&(0,P.hasFinancialsByTypespecs)(t.type,t.typespecs)&&i.push(s.showFinancials),i.length>0&&!(i[i.length-1]instanceof c.Separator)&&i.push(new c.Separator),!r.isEmpty()&&l.enabled("datasource_copypaste")){const e=Sn(r,d),t=hn(this._chartWidget,r);(e||t)&&(e&&i.push(e),t&&i.push(t),i.push(new c.Separator))}i.push(pn(this._chartWidget,[e]));const o=this._createActionMove(e);null!==o&&i.push(o),i.push(this._createActionScale(e)),this._chartWidget.isMultipleLayout().value()&&(this._chartWidget.chartWidgetCollection().lock.symbol.value()||this._chartWidget.chartWidgetCollection().lock.interval.value())&&i.push(this._createActionLayoutChartsSync()),i.push(fn(this._chartWidget,[e])),i.push(new c.Separator);Boolean(null===(n=window.widgetbar)||void 0===n?void 0:n.widget("watchlist"))&&s.addToWatchlist&&i.push(s.addToWatchlist),l.enabled("text_notes")&&i.push(s.addToTextNotes),i[i.length-1]instanceof c.Separator||i.push(new c.Separator),l.enabled("show_chart_property_page")&&!this._chartWidget.onWidget()&&i.push(s.mainSeriesPropertiesAction),i[i.length-1]instanceof c.Separator&&i.pop()}return i}_createActionAddChildStudy(e){const t=this._chartWidget.model().model();return new pe.ActionWithStandardIcon({actionId:"Chart.Indicator.ApplyChildIndicator",options:{label:At.format({studyTitle:dn(e)}),iconId:"Chart.ApplyIndicator",statName:"ApplyIndicator",onExecute:()=>{const n=this._chartWidget.showIndicators((0,h.isStudy)(e)?[e]:[]);if(n&&(0,h.isStudy)(e)){const e=()=>{(0,S.trackEvent)("SOS","Apply SOS","Apply by RC menu")},o=t.studyInserted();o.subscribe(this,e),n.visible().subscribe((t=>{t||o.unsubscribe(this,e)}),{once:!0})}}}})}_createActionAddFundamentals(e){{const t=e.symbolInfo() ;if(null!==t&&"forex"!==t.type&&!(0,q.hasCryptoTypespec)(t.typespecs||[]))return new pe.ActionWithStandardIcon({actionId:"Chart.Indicator.ApplyFinancials",options:{label:Ct.format({instrumentName:dn(e)}),iconId:"Chart.Financials",statName:"ApplyFundamental",onExecute:()=>{this._chartWidget.showFundamentals(e!==this._chartWidget.model().mainSeries()?e:void 0)}}})}return null}_createActionShowSymbolInfoDialog(e,t){const n=this._chartWidget.model().model();return new pe.ActionWithStandardIcon({actionId:"Chart.Dialogs.ShowSymbolInfo",options:{label:en,iconId:"Chart.SymbolInfo",checkable:!1,statName:"SymbolInfo",onExecute:()=>{const o={symbolInfo:e.symbolInfo(),unitDescription:e=>e?t.description(e):"",dateFormatter:n.dateFormatter()};(0,Z.showSymbolInfoDialog)(o)}}})}_createActionShowProperties(e){return new pe.ActionWithStandardIcon({actionId:"Chart.Indicator.ShowSettingsDialog",options:{label:Et,iconId:"Settings",statName:"EditSelectedObject",onExecute:()=>this._chartWidget.showSourceProperties(e)}})}async _contextMenuActionsForStudy(e,t,o){const i=t!==this._chartWidget.model().paneForSource(e),a=this._chartWidget.actions(),r=o&&"localY"in o?o.localY:void 0,d=[];if(!e.userEditEnabled())return d;if(this._chartWidget.readOnly())d.push(fn(this._chartWidget,[e])),d.push(new c.Separator),(0,f.isNonSeriesStudy)(e)||d.push(this._createActionScale(e));else{if(e.alertCreationAvailable().value()){const t=(await(0,de.getAlertsChartActionCreators)()).createAlert(this._chartWidget,{series:e,localY:r});null!==t&&d.push(t)}if(l.enabled("study_on_study")&&e.canHaveChildren()&&d.push(this._createActionAddChildStudy(e)),(0,h.isCompareOrOverlayStudy)(e)&&this._options.fundamentals){const t=this._createActionAddFundamentals(e);null!==t&&d.push(t)}const t=this._createApplyToEntireLayoutCommand(e);null!==t&&d.push(t);const o=this._createAddIndicatorToFavoritesCommand(e);if(o&&d.push(o),d.length>0&&!(d[d.length-1]instanceof c.Separator)&&d.push(new c.Separator),l.enabled("symbol_info")&&(0,h.isCompareOrOverlayStudy)(e)&&null!==e.symbolInfo()&&(d.push(this._createActionShowSymbolInfoDialog(e,this._chartWidget.model().model().availableUnits())),d.push(new c.Separator)),i||d.push(pn(this._chartWidget,[e])),d.push(mn(this._chartWidget,[e])),!(0,f.isNonSeriesStudy)(e)&&!i){const t=this._createActionMove(e);null!==t&&d.push(t),d.push(this._createActionScale(e))}d.push(new c.Separator);const p=e.metaInfo();if(!(0,U.onWidget)()){const{scriptIdPart:t,id:o,pine:i}=p;let a;if((0,h.isFundamentalStudy)(e)){const e=(0,oe.getFundamentalIdFromScriptIdPart)(p.scriptIdPart);if(e){const{default:t}=await n.e(54875).then(n.t.bind(n,384898,19));e in t&&(a=()=>(0,x.showSupportDialog)({solutionId:t[e]}))}}else if(!i||L.StudyMetaInfo.hasStdSuffix(t)){const{default:e}=await n.e(95937).then(n.t.bind(n,676006,19));(t in e||o in e)&&(a=()=>(0,x.showSupportDialog)({solutionId:e[t]||e[o]}))}else L.StudyMetaInfo.hasPubSuffix(t)&&(a=async()=>{try{const{chartImageUrl:n}=await(0,A.requestScriptInfo)(t);(0,D.pushChartPage)({chartId:n, chartName:e.title(u.TitleDisplayTarget.StatusLine)})}catch(e){(0,k.showScriptInfoErrorNoticeDialog)()}});if(void 0!==a){const t=(0,h.isFundamentalStudy)(e)?(0,Q.appendEllipsis)(s.t(null,void 0,n(213563))):p.pine?(0,Q.appendEllipsis)(s.t(null,void 0,n(907859))):(0,Q.appendEllipsis)(s.t(null,void 0,n(111741)));d.push(new c.Action({actionId:"Chart.Indicator.About",options:{label:t,statName:"OpenSelectedObjectAbout",onExecute:a}}))}}if(!(0,h.isFundamentalStudy)(e)&&p.pine&&a.viewSourceCode){const{scriptIdPart:t,pine:{version:n}}=p;d.push(a.viewSourceCode);const o=this._createActionResetInputPoints(e);o&&d.push(o),d.push(new c.Separator),a.viewSourceCode.update({disabled:!1}),(0,C.isAuthToGetPineSourceCode)(t,n).then((e=>{e||a.viewSourceCode.update({disabled:!0})})).catch((e=>{me.logError("Failed isAuthToGetPineSourceCode, reason: "+e)}))}if(window.is_authenticated&&(0,j.isUserStudyWithLogs)(e)&&(d.push(new c.Action({actionId:"Chart.Indicator.PineLogs",options:{label:s.t(null,void 0,n(249313)),statName:"PineLogs",onExecute:()=>{(0,z.openPineLogsInRightPanel)(e)}}})),d.push(new c.Separator)),e.copiable()){const t=new pe.ActionWithStandardIcon({actionId:"Chart.Clipboard.CopySource",options:{label:Wt,shortcutHint:(0,$.humanReadableHash)($.Modifiers.Mod+67),statName:"Copy",onExecute:()=>{this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy([e])}}});d.push(t)}d.push(fn(this._chartWidget,[e])),d.push(a.studyRemove);const m=!this._chartWidget.onWidget()&&this._options.objectTree&&a.paneObjectTree,S=yn();(m||S)&&(d.push(new c.Separator),m&&d.push(a.paneObjectTree),S&&d.push(this._chartWidget.actions().showDataWindow)),d.push(new c.Separator),l.enabled("property_pages")&&new y.MetaInfoHelper(p).hasUserEditableOptions()&&d.push(this._createActionShowProperties(e)),d[d.length-1]instanceof c.Separator&&d.pop()}return d}_createLineToolTemplateAction(e){{const t=this._chartWidget.model(),o=n=>{t.applyLineToolTemplate(e,n,Le)};return new c.Action({actionId:"Chart.LineTool.Templates",options:{},optionsLoader:async()=>{const{LinetoolTemplatesList:i}=await Promise.all([n.e(5483),n.e(90728),n.e(3177)]).then(n.bind(n,998777)),a=new i(e.toolname,o),r=[];if(l.enabled("drawing_templates")){const t=new pe.ActionWithStandardIcon({actionId:"Chart.LineTool.Templates.SaveAs",options:{label:Nt,statName:"SaveAs",onExecute:()=>{a.showSaveDialog((t=>{const n=JSON.stringify(e.template());a.saveTemplate(t,n)}))}}});r.push(t)}const s=new pe.ActionWithStandardIcon({actionId:"Chart.LineTool.Templates.ApplyDefaults",options:{label:Ft,statName:"ApplyDefault",onExecute:()=>{t.restorePropertiesForSource(e),window.lineToolPropertiesToolbar.refresh()}}});return r.push(s),new Promise((e=>{a.templatesLoaded().then((()=>{var e;const t=null!==(e=a.getData())&&void 0!==e?e:[];t.length>0&&r.push(new c.Separator),t.forEach(((e,t)=>{const n=new pe.ActionWithStandardIcon({actionId:"Chart.LineTool.Templates.Apply",options:{label:e,statName:"ApplyTemplate",onExecute:()=>a.loadTemplate(e),toolbox:{type:G.ToolboxType.Delete,action:()=>{a.deleteAction(e)}}, showToolboxOnHover:!0}});r.push(n)}))}),(e=>{me.logWarn(e)})).then((()=>{e({label:Mt,statName:"Template",subItems:r})}))}))}})}}_createActionToggleLockLineTools(e){const t=e[0].properties().frozen.value(),n=t?xt:Dt;return new pe.ActionWithStandardIcon({actionId:"Chart.SelectedObject.ToggleLocked",options:{label:n,statName:"ToggleLockSelectedObject",checkable:!0,iconId:t?"Chart.UnlockObject":"Chart.LockObject",onExecute:()=>{if(1===e.length)this._chartWidget.toggleLockSelectedObject();else{const n=t?De:xe,o=this._chartWidget.model();o.withMacro(n,(()=>{e.forEach((e=>{o.setProperty(e.properties().frozen,!t,n,ie.lineToolsDoNotAffectChartInvalidation)}))}))}}}})}async _contextMenuActionsForLineTool(e){const t=[],n=this._chartWidget.actions(),i=this._chartWidget.model().model(),r=()=>{t.push(pn(this._chartWidget,e))},s=()=>{t.push(mn(this._chartWidget,e))},d=()=>{const n=e.filter((e=>e.cloneable()));if(n.length>0){const e=new pe.ActionWithStandardIcon({actionId:"Chart.LineTool.Clone",options:{label:Pt,iconId:"Chart.Clone",shortcutHint:(0,$.humanReadableModifiers)($.Modifiers.Mod)+"Drag",statName:"Clone",onExecute:()=>this._chartWidget.model().cloneLineTools(n,!1)},id:"Clone"});t.push(e)}return!!n.length},h=()=>{const n=e.filter((e=>e.copiable()));if(n.length>0){const e=new c.Action({actionId:"Chart.Clipboard.CopyLineTools",options:{label:Wt,shortcutHint:(0,$.humanReadableHash)($.Modifiers.Mod+67),statName:"Copy",onExecute:()=>this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy(n)},id:"Copy"});t.push(e)}return!!n.length},p=()=>{const n=vn(this._chartWidget,e);return t.push(...n),n.length>0},m=async e=>{if(this._chartWidget.model().isInReplay().value())return;const n=e.getOrderTemplate();if(null===n)return;const r=(0,b.tradingService)();if(null!==r){const e=r.activeBroker();if(e&&1===e.connectionStatus()&&e.metainfo().configFlags.supportLimitOrders){const s=i.mainSeries(),{symbol:l}=await r.getActualSymbol(s.proSymbol()),{tradable:d}=await e.isTradable(l);if(d){const{qty:{step:i}}=await e.symbolInfo(l);n.symbol=l,n.qty=function(e,t){return(0,a.Big)(e).div(t).round(void 0,0).mul(t).toNumber()}(n.qty,i),t.push(new c.Separator),t.push(function(e){const t=(0,o.ensureNotNull)((0,b.tradingService)());return new pe.ActionWithStandardIcon({actionId:"Chart.LineTool.CreateLimitOrderFromState",options:{label:Be,statName:"CreateLimitOrder",onExecute:()=>{t.trackEvent("Chart Context Menu","RiskRewardCreateLimitOrder"),(0,o.ensureNotNull)(t.brokerCommandsUI()).placeOrder(e)}}})}(n))}}else null===e&&(t.push(new c.Separator),t.push((0,o.ensureNotNull)(function(){const e=(0,o.ensureNotNull)((0,b.tradingService)());return new c.Action({actionId:"Trading.ShowSelectBrokerPanel",options:{label:Be,statName:"ShowSelectBrokerNotification",onExecute:()=>{var t;(0,M.isMobileTradingAvailable)()&&!(null===(t=window.TradingView.bottomWidgetBar)||void 0===t?void 0:t.isVisible().value())?e.toggleTradingPanelPopup():e.toggleTradingWidget(),e.onNeedSelectBroker.fire()}}})}())))}},S=e=>{const n=new pe.ActionWithStandardIcon({ actionId:"Chart.ScrollToLineTool",options:{label:Lt.format({lineToolName:e.title(u.TitleDisplayTarget.StatusLine)}),statName:"GoToLineTool",checkable:!1,onExecute:async()=>this._chartWidget.model().scrollToLineTool(e)}});t.push(n)},g=e=>{const t=this._chartWidget.model().model().lineToolsGroupModel(),n=e.map((e=>t.groupForLineTool(e)));return new Set(n).size<=1};if(1===e.length){const o=e[0];if(this._chartWidget.readOnly())t.push(fn(this._chartWidget,[o]));else if(o.userEditEnabled()){if(H.alertsAvailable&&!this._chartWidget.onWidget()){const e=await(0,de.getAlertsChartActionCreators)();if(o.hasAlert&&o.hasAlert().value())t.push(e.editAlertOnLineDataSource(o)),t.push(new c.Separator);else if(o.canHasAlert()&&o.alertCreationAvailable().value()){const n=e.createAlert(this._chartWidget,{drawing:o});null!==n&&(t.push(n),t.push(new c.Separator))}}{const e=this._createLineToolTemplateAction(o);null!==e&&t.push(e)}r(),s(),this._options.objectTree&&n.paneObjectTree&&t.push(n.paneObjectTree),await m(o),t.push(new c.Separator);let e=d();e=h()||e,e&&t.push(new c.Separator),e=p(),e&&t.push(new c.Separator),t.push(this._createActionToggleLockLineTools([o])),t.push(fn(this._chartWidget,[o])),t.push(n.lineRemove),o.points().length>0&&this._options.gotoLineTool&&(t.push(new c.Separator),S(o));const i=await this._chartWidget.propertiesDefinitionsForSource(o);if(l.enabled("property_pages")&&null!==i&&(t.push(new c.Separator),t.push(n.format)),o.additionalActions){t.push(new c.Separator);const e=o.additionalActions(this._chartWidget.model());t.push(...e)}}}else this._options.objectTree&&n.paneObjectTree&&t.push(n.paneObjectTree),g(e)&&r(),s(),t.length>0&&t.push(new c.Separator),d(),h(),p(),t.push(new c.Separator),t.push(this._createActionToggleLockLineTools(e)),t.push(fn(this._chartWidget,e)),t.push(n.lineRemove),l.enabled("property_pages")&&(t.push(new c.Separator),t.push(n.format));return t}_createEarningsShow(){const e=this._chartWidget.model().mainSeries().properties().childs().esdShowEarnings;return new c.Action({actionId:"Chart.ToggleVisibility.Earnings",options:{label:kt,checkable:!0,checked:e.value(),name:"ToggleShowEarnings",statName:"ToggleShowEarnings",onExecute:t=>this._chartWidget.model().setProperty(e,t.isChecked(),ye)}})}_createDividendsShow(){const e=this._chartWidget.model().mainSeries().properties().childs().esdShowDividends;return new c.Action({actionId:"Chart.ToggleVisibility.Dividends",options:{label:Ot,checkable:!0,checked:e.value(),name:"ToggleShowDividends",statName:"ToggleShowDividends",onExecute:t=>this._chartWidget.model().setProperty(e,t.isChecked(),be)}})}_createSplitsShow(){const e=this._chartWidget.model().mainSeries().properties().childs().esdShowSplits;return new c.Action({actionId:"Chart.ToggleVisibility.Splits",options:{checkable:!0,label:Vt,checked:e.value(),name:"ToggleShowSplits",statName:"ToggleShowSplits",onExecute:t=>this._chartWidget.model().setProperty(e,t.isChecked(),we)}})}_contextMenuActionsForESD(){const e=[];return this._chartWidget.readOnly()||e.push((0, o.ensureNotNull)(this._createDividendsShow()),(0,o.ensureNotNull)(this._createSplitsShow()),(0,o.ensureNotNull)(this._createEarningsShow())),e}_contextMenuActionsForRollDates(){const e=[];if(!this._chartWidget.readOnly()){const t=this._chartWidget.model().mainSeries().properties().childs().showContinuousContractSwitches;e.push(new c.Action({actionId:"Chart.ToggleVisibility.ContinuousContractSwitch",options:{label:Rt,checkable:!0,checked:t.value(),name:"ToggleShowContractSwitches",statName:"ToggleShowContractSwitches",onExecute:e=>this._chartWidget.model().setProperty(t,e.isChecked(),Te)}}))}return e}_contextMenuActionsForFuturesContractExpiration(){const e=[];if(!this._chartWidget.readOnly()){const t=this._chartWidget.model().mainSeries().properties().childs().showFuturesContractExpiration;e.push(new c.Action({actionId:"Chart.ToggleVisibility.ContractExpiration",options:{label:Ut,checkable:!0,checked:t.value(),name:"ToggleShowFuturesContractExpirations",statName:"ToggleShowFuturesContractExpirations",onExecute:e=>this._chartWidget.model().setProperty(t,e.isChecked(),_e)}}))}return e}_contextMenuActionsForisLatestUpdates(){const e=[];if(!this._chartWidget.readOnly()){const t=this._chartWidget.model().mainSeries().properties().childs().showLastNews;e.push(new c.Action({actionId:"Chart.ToggleVisibility.LatestNewsAndMinds",options:{label:Bt,checkable:!0,checked:t.value(),name:"ToggleShowLatestUpdates",statName:"ToggleShowLatestUpdates",onExecute:e=>this._chartWidget.model().setProperty(t,e.isChecked(),Ie)}}))}return e}_contextMenuActionsForPublishedTimeline(e){const t=this._chartWidget.actions(),n=[];if(n.push(t.lineHide),window.is_authenticated){const t=e.properties().childs().filter,o=new c.Action({actionId:"Chart.ShowAllIdeas",options:{checked:t.value()===F.PublishedChartsFilter.None,checkable:!0,label:Ht,name:"ToggleAllIdeas",statName:"ToggleAllIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,F.PublishedChartsFilter.None,Ae)}}),i=new c.Action({actionId:"Chart.ShowIdeasOfFollowedUsers",options:{checked:t.value()===F.PublishedChartsFilter.Following,checkable:!0,label:jt,name:"ToggleIdeasOfPeopleAndUser",statName:"ToggleIdeasOfPeopleAndUser",onExecute:()=>this._chartWidget.model().setProperty(t,F.PublishedChartsFilter.Following,Ce)}}),a=new c.Action({actionId:"Chart.ShowMyIdeasOnly",options:{checked:t.value()===F.PublishedChartsFilter.Private,checkable:!0,label:zt,name:"ToggleUserIdeas",statName:"ToggleUserIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,F.PublishedChartsFilter.Private,Ee)}});n.push(new c.Separator,o,i,a)}return n}_contextMenuActionsForTradingDrawings(e){return e.contextMenuItems()}async _contextMenuActionsForAlertLabel(e,t){if(H.alertsAvailable&&!this._chartWidget.onWidget()){const{getAlertLabelContextMenuActions:o}=await n.e(46745).then(n.bind(n,430836)),i=(0,g.getSettingsProperty)().childs().line.childs().visible,a=`chart_alert_context_menu_${null!=t?t:"line"}`,r="chart_alert";return o({alert:e,chartWidget:this._chartWidget,labelExtendProperty:i,analytics:{actionLabel:a, actionSource:r}})}return[]}_contextMenuActionsForChartEvents(e){const t=[];if(l.enabled("property_pages")){const e=new c.Action({actionId:"Chart.Dialogs.ShowGeneralSettings.EventsAndAlertsTab",options:{label:$t,statName:"Format",onExecute:()=>this._chartWidget.showGeneralChartProperties(p.TabNames.eventsAndAlerts)}});t.push(e)}const n=new c.Action({actionId:"Chart.ToggleVisibility.EconomicEvents",options:{label:Gt,name:"HideEvents",statName:"HideEvents",onExecute:()=>this._chartWidget.model().setProperty(e.properties().childs().visible,!1,Fe)}});return t.push(n),t}_createApplyToEntireLayoutCommand(e){if(!this._chartWidget.chartWidgetCollection().applyIndicatorsToAllChartsAvailable())return null;const t=this._chartWidget.model().model();if(e.parentSources().length>0)return null;const n=(0,o.ensureNotNull)(t.paneForSource(e)),i=t.paneForSource(t.mainSeries())===n,a=e instanceof Y.StudyCompare&&e.priceScale()===t.mainSeries().priceScale()&&(0,o.ensureNotNull)(e.priceScale()).isPercentage(),r=i?void 0:t.panes().indexOf(n);let s=qt,l=We,d="AddStudyToEntireLayout";return(0,J.isActingAsSymbolSource)(e)&&(s=Yt,l=Ne,d="AddSymbolToEntireLayout"),(0,h.isStudyStrategy)(e)&&(s=Zt,l=Pe,d="AddStrategyToEntireLayout"),e instanceof W.Fundamental&&(s=Kt,l=Me,d="AddFundamentalToEntireLayout"),new c.Action({actionId:"Chart.AddIndicatorToAllCharts",options:{label:s,statName:d,onExecute:()=>{const n=(0,o.ensureNotNull)((0,K.clipboardDataForSources)(t.id(),[e])),s=this._chartWidget.chartWidgetCollection(),c={isOnMainPane:i,asCompare:a,paneIndex:r};s.applyIndicatorToAllCharts(this._chartWidget,n,c,l)}},id:"applyStudyToEntireLayout"})}_createAddIndicatorToFavoritesCommand(e){const t=e.metaInfo();let o;if((0,U.onWidget)()||(0,h.isCompareOrOverlayStudy)(e))return null;if((0,h.isFundamentalStudy)(e)){const e=(0,ue.extractPineId)(t.fullId);if(!e)return null;o=()=>n.e(69790).then(n.bind(n,659422)).then((({FavoriteFundamentals:t})=>{const n=t.getInstance();return{label:n.isFav(e)?ln:sn,onExecute:()=>n.toggleFavorite(e)}}))}else{const e=t.scriptIdPart||t.id;if(!e)return null;o=()=>n.e(69790).then(n.bind(n,158409)).then((({FavoriteScriptsModel:t})=>{const n=t.getInstance();return{label:n.isFav(e)?rn:an,onExecute:()=>n.toggleFavorite(e)}}))}return new c.Action({actionId:"Chart.Indicator.AddFavorites",id:"addIndicatorToFavorites",optionsLoader:o,options:{statName:"AddIndicatorToFavorites"}})}}},523359:(e,t,n)=>{"use strict";n.r(t),n.d(t,{addSymbolDialogHasOpenedKey:()=>r,showAddSymbolDialog:()=>s});var o=n(167222),i=n(305514),a=n(251954);const r="addSymbolDialogHasOpenedKey";function s(e){(0,o.runOrSigninWithFeature)((()=>{(0,i.showWatchListsDialog)({addSymbol:e,onOpen:l})}),{feature:"watchList",source:"add symbol to watchlist"})}function l(){a.emit(r)}},157954:(e,t,n)=>{"use strict";n.d(t,{DateFormatter:()=>a});var o=n(551775),i=n(958067);class a{constructor(e="yyyy-MM-dd",t=!1){this._dateFormatFunc=t?(0,i.getDateFormatWithWeekday)(e):i.dateFormatFunctions[e]}format(e){ return o.customFormatters&&o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!1)}formatLocal(e){return o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.formatLocal?o.customFormatters.dateFormatter.formatLocal(e):o.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!0)}parse(e){if(""===e)return{res:!1};let t=e;return o.customFormatters&&o.customFormatters.dateFormatter&&!o.customFormatters.dateFormatter.parse&&console.warn("You need to provide a `parse` function as part of `dateFormatter`"),o.customFormatters&&o.customFormatters.dateFormatter&&o.customFormatters.dateFormatter.parse&&(t=String(o.customFormatters.dateFormatter.parse(e))),{res:!0,value:t}}}},425755:(e,t,n)=>{"use strict";n.d(t,{FINANCIALS_FORMATTER_MAX_VALUE:()=>l,FinancialsFormatter:()=>u});var o=n(650151),i=n(444372),a=n(31341),r=n(84924),s=n(417759);const l=1e100,c=/^(-?\d+)(\.(\d+))?([KMBT])?$/,d={decimalSign:".",groupingSeparator:""};class u{constructor(e=2,t){this._formatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:null!=t?t:e,maximumFractionDigits:e,useGrouping:!1})}format(e){var t;if(Math.abs(e)>=l)return i.t(null,void 0,n(343088));const u=this._formatter.format(Math.abs(e)),h=e<0&&0!=+u?"−":"",p=(0,o.ensureNotNull)(c.exec(u)),[,m,,S,g]=p,v=null!==(t=(0,r.getNumberFormat)())&&void 0!==t?t:d,f=+m;let y=`${h}${(0,s.formatNumber)(f,v)}`;return S&&(y=`${y}${v.decimalSign}${S}`),g&&(y=(0,a.forceLTRStrSsr)(`${y} ${g}`)),y}}},451798:(e,t,n)=>{"use strict";n.d(t,{magnetEnabled:()=>m,magnetMode:()=>S,setIsMagnetEnabled:()=>g,setMagnetMode:()=>v});var o=n(853965),i=n(401580),a=n(80646),r=n(885482),s=n(616117),l=n(237872);const c=new i.WatchedValue(!1),d=new i.WatchedValue(a.MagnetMode.WeakMagnet),u=(0,l.modifierPressed)(),h=(0,l.shiftPressed)();function p(){const e=u.value();if(h.value()&&(r.isToolEditingNow.value()||r.isToolCreatingNow.value()))return void c.setValue(!1);let t,n;if(r.activePointSelectionMode.value()===r.SelectPointMode.Replay)t=n=!1;else{const o=r.tool.value(),i=r.isStudyEditingNow.value()||r.activePointSelectionMode.value()===r.SelectPointMode.Study;t=e&&((0,s.isLineToolName)(o)||r.isToolEditingNow.value()||(0,r.toolIsMeasure)(o)||i),n=(0,r.properties)().childs().magnet.value()}d.setValue(!n&&t?a.MagnetMode.StrongMagnet:(0,r.properties)().childs().magnetMode.value()),c.setValue(t?!n:n)}function m(){return c}function S(){return d}function g(e){(0,o.allowSavingDefaults)(!0),(0,r.properties)().childs().magnet.setValue(e),(0,o.allowSavingDefaults)(!1)}function v(e){(0,o.allowSavingDefaults)(!0),(0,r.properties)().childs().magnetMode.setValue(e),(0,r.properties)().childs().magnet.setValue(!0),(0,o.allowSavingDefaults)(!1)}(0,r.runOnDrawingStateReady)((()=>{(0,r.properties)().childs().magnet.subscribe(null,p),(0,r.properties)().childs().magnetMode.subscribe(null,p),u.subscribe(p),h.subscribe(p),r.tool.subscribe(p),r.isToolEditingNow.subscribe(p),p()}))},238433:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createStudy:()=>k, hasConfirmInputs:()=>U,isCompareOrOverlayStudy:()=>D,isESDStudy:()=>M,isFundamentalStudy:()=>P,isOverlayStudy:()=>x,isRollDatesStudy:()=>L,isStudy:()=>F,isStudyStrategy:()=>N,isStudyStub:()=>W,isSymbolicStudy:()=>H,studyColorRotationMode:()=>O,useSameColorRotationComparator:()=>R});n(244842);var o=n(526075),i=n(470452),a=n(980004),r=n(275028),s=n(334473),l=n(193211),c=n(709081),d=n(682541),u=n(867539),h=n(894718),p=n(153730),m=n(410491),S=n(744966),g=n(576678),v=n(556983),f=n(857191),y=n(205838),b=n(677395),w=n(7195),T=n(943855),_=n(738949),I=n(306682),A=n(390030),C=n(470130),E=n(537919);function F(e){return e instanceof i.Study}function N(e){return e instanceof a.StudyStrategy}function W(e){return e instanceof I.StudyStub}function P(e){return e instanceof c.Fundamental}function M(e){return e instanceof s.study_ESD$TV_EARNINGS||e instanceof s.study_ESD$TV_SPLITS||e instanceof s.study_ESD$TV_DIVIDENDS}function L(e){return e instanceof l.study_ESD$TV_ROLLDATES}function x(e){return e instanceof w.study_Overlay}function D(e){return x(e)||e instanceof T.StudyCompare}function k(e,t,n,s,l,c){var d;{const i=2===c;if(o.StudyMetaInfo.isReplayStrategy(s))return new r.ReplayStudyStrategy(e,t,n,s,i);if(o.StudyMetaInfo.isScriptStrategy(s))return new a.StudyStrategy(e,t,n,s,i)}const u=(0,C.studyNameByMetaInfo)(s),h=new((null===(d=(0,E.getStudyInfoByName)(u))||void 0===d?void 0:d.studyConstructor)||i.Study)(e,t,n,s);return void 0!==l&&h.setId(l),h}function O(e){const t=(0,C.studyNameByMetaInfo)(e),n=(0,E.getStudyInfoByName)(t);return n?n.colorRotationMode:void 0===e.pine||o.StudyMetaInfo.isStandardPine(e.id)?1!==e.plots.length?"shift":"loop":null}function V(e,t){return e.id===t.id&&(o=t,((n=e).pine?n.pine.version:void 0)===(o.pine?o.pine.version:void 0));var n,o}function R(e){const t=(0,C.studyNameByMetaInfo)(e),n=(0,E.getStudyInfoByName)(t);if(n){const e=n.colorRotationComparator;if(void 0!==e)return e}return V}function U(e){return(null!=e?e:[]).some((e=>e.confirm))}(0,E.addStudyInfoToMap)("study_PivotPointsStandard",(0,E.createStudyInfo)(b.study_PivotPointsStandard)),(0,E.addStudyInfoToMap)("study_Overlay",(0,E.createStudyInfo)(w.study_Overlay,"loop")),(0,E.addStudyInfoToMap)("study_Compare",(0,E.createStudyInfo)(T.StudyCompare,"loop")),(0,E.addStudyInfoToMap)("study_Volume",(0,E.createStudyInfo)(A.VolumeStudy)),(0,E.addStudyInfoToMap)("study_VbPVisible",(0,E.createStudyInfo)(p.VbPVisibleWrapper)),(0,E.addStudyInfoToMap)("study_ScriptWithDataOffset",(0,E.createStudyInfo)(_.study_ScriptWithDataOffset)),(0,E.addStudyInfoToMap)("study_Earnings",(0,E.createStudyInfo)(s.study_ESD$TV_EARNINGS)),(0,E.addStudyInfoToMap)("study_Splits",(0,E.createStudyInfo)(s.study_ESD$TV_SPLITS)),(0,E.addStudyInfoToMap)("study_Dividends",(0,E.createStudyInfo)(s.study_ESD$TV_DIVIDENDS)),(0,E.addStudyInfoToMap)("study_BarSetContinuousRollDates",(0,E.createStudyInfo)(l.study_ESD$TV_ROLLDATES)),(0,E.addStudyInfoToMap)(C.fundamentalsPrefix,(0,E.createStudyInfo)(c.Fundamental,"loop",((e,t)=>(0,C.isFundamentalStudyMetaInfo)(t)))),(0, E.addStudyInfoToMap)("study_ElliottWave",(0,E.createStudyInfo)(d.study_ElliottWave)),(0,E.addStudyInfoToMap)("study_LinearRegression",(0,E.createStudyInfo)(u.LinearRegressionStudy)),(0,E.addStudyInfoToMap)("study_PivotPointsHighLow",(0,E.createStudyInfo)(h.study_PivotPointsHighLow)),(0,E.addStudyInfoToMap)("study_VbPSessions",(0,E.createStudyInfo)(m.SessionVolumeStudy)),(0,E.addStudyInfoToMap)("study_VbPPeriodic",(0,E.createStudyInfo)(p.VolumeProfileBaseStudy)),(0,E.addStudyInfoToMap)("study_VbPSessionsRoughDetailed",(0,E.createStudyInfo)(S.SessionVolume2Study)),(0,E.addStudyInfoToMap)("study_ZigZag",(0,E.createStudyInfo)(g.study_ZigZag)),(0,E.addStudyInfoToMap)("study_VbPAutoAnchored",(0,E.createStudyInfo)(p.VolumeProfileBaseStudy)),(0,E.addStudyInfoToMap)("study_TPOPeriodic",(0,E.createStudyInfo)(v.TpoPeriodicStudy)),(0,E.addStudyInfoToMap)("study_TPOSessions",(0,E.createStudyInfo)(f.TpoSessionsStudy)),(0,E.addStudyInfoToMap)("study_VolumeFootprint",(0,E.createStudyInfo)(y.VolumeFootprintStudy)),(0,E.addStudyInfoToMap)("StudyStrategy",(0,E.createStudyInfo)(a.StudyStrategy)),(0,E.addStudyInfoToMap)("ReplayStudyStrategy",(0,E.createStudyInfo)(r.ReplayStudyStrategy));const B=["Overlay@tv-basicstudies","CorrelationCoefficient@tv-basicstudies","Correlation Coeff@tv-basicstudies","Spread@tv-basicstudies","Ratio@tv-basicstudies"];function H(e){return B.includes(e.id)}},466931:(e,t,n)=>{"use strict";n.d(t,{setSupportPortalProblemsHost:()=>i,supportPortalProblemsHost:()=>o});let o="";function i(e){o=e}},845437:e=>{e.exports=''}}]);