(window.webpackJsonp=window.webpackJsonp||[]).push([["library"],{"+6II":function(e,t,i){"use strict";i.r(t);var n=i("mrSG"),r=(i("EsMY"),0),o=0,s=0;function a(){clearTimeout(r),clearTimeout(o),clearTimeout(s)}var l,c="tooltip-root-element";function u(){var e=document.getElementById(c);e?l=e:((l=document.createElement("div")).id=c,document.body.appendChild(l))}function h(){l&&(l.innerHTML="")}"interactive"===document.readyState?u():document.addEventListener("DOMContentLoaded",u);var d=i("Eyy1"),p={default:"",white:"theme-white","round-shadow":"theme-round-shadow"},f=Object.keys(p);var _=i("CPmC"),m=i("/DW5"),v=i("gWrr"),y=i("Ialn"),g=(i("HbRj"),i("XAms")),b=i("Hr11"),S=i("Wo0S");function w(e){var t=e.getAttribute("title");return t&&(Object(_.b)(e,"text",t),e.removeAttribute("title")),Object(_.a)(e,"text")||""}function P(e){var t,i=M.cloneNode(!0),n=E(i),r=e.content;switch(r.type){case"element":n.innerHTML="",n.appendChild(r.data);break;case"html":n.innerHTML=r.data;break;case"text":if(e.hotkey){var o=k.cloneNode(!0);o.innerText=r.data,n.appendChild(o)}else n.innerText=r.data}if(e.hotkey){var s="none"!==r.type,a=A.cloneNode(!0),l=Object(m.a)(e.hotkey),c=l.keys.map((function(e){return''+e+""}));a.innerHTML=(t=l.text).format.apply(t,c).replace(/\s\+\s/g,'+'),n.classList.add(S["common-tooltip__body--with-hotkey"]),s&&a.classList.add(S["common-tooltip__hotkey-block--divider"]),n.appendChild(a)}return i.addEventListener("contextmenu",g.a),i}function C(e,t){var i=t.rect;if(i){!function(e,t){var i,n=f.includes(t)?p[t]:"";(i=e.classList).remove.apply(i,f.map((function(e){return p[e]})).filter((function(e){return!!e}))),n&&!e.classList.contains(n)&&e.classList.add(n)}(e,t.colorTheme||"default"),t.addClass&&e.classList.add(t.addClass);var n=E(e),r=e.querySelector("."+S["common-tooltip__button-container"]);n.classList.toggle(S["common-tooltip__body--width_wide"],Boolean(t.wide)),n.classList.toggle(S["common-tooltip__body--no-padding"],Boolean(t.noPadding)),n.classList.toggle(S["common-tooltip__body--width_narrow"],Boolean(t.narrow)),n.classList.toggle(S["common-tooltip__body--no-buttons"],!0),e.classList.toggle(S["common-tooltip--no-pointer-events"],!Modernizr.pointerevents),n.style.left=x(0),n.style.width=x(n.clientWidth+(Boolean(t.noPadding)?0:2));var o=document.body.clientWidth,s=window.innerHeight,a=t.vertical,l=t.extendMargin||a&&i.w<20||!a&&i.h<20;e.classList.toggle(S["common-tooltip--farther"],l),e.classList.toggle(S["common-tooltip--vertical"],a),e.classList.toggle(S["common-tooltip--horizontal"],!a);var c=function(e){return e.querySelector("."+S["common-tooltip__ear-holder"])}(e),u="";if(a){var h=s-10,d=h-12,_=Object(b.clamp)(i.y+i.h/2,22,d),m=e.offsetHeight,v=_-m/2,g=v+m;e.style.left=x(i.x+i.w),e.style.top=x(v),v<10?n.style.top=r.style.top=x(10-v):g>h&&(n.style.top=r.style.top=x(h-g));var w=(e.querySelector(":last-child")||n).getBoundingClientRect().right+10>o ;e.classList.toggle(S["common-tooltip--direction_reversed"],w),e.classList.toggle(S["common-tooltip--direction_normal"],!w),u=w?"after":"before",Object(y.isRtl)()?(u=t.otr?"after":u,u=t.otl?"before":u):(u=t.otr?"before":u,u=t.otl?"after":u),c.classList.toggle(S["common-tooltip__ear-holder--before"],"before"===u),c.classList.toggle(S["common-tooltip__ear-holder--after"],"after"===u),"after"===u&&(e.style.left="auto",e.style.right=x(o-i.x))}else{var P=i.x-(n.offsetWidth-i.w)/2,C=o-10-e.offsetWidth,T=Math.max(10,Math.min(P,C));e.style.bottom=x(s-i.y),e.style.left=x(T);w=C\n\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\n',L='\n\t
\n',O='\n\t
\n',M=Object(v.b)(I),A=Object(v.b)(L),k=Object(v.b)(O);function E(e){return e.querySelector("."+S["common-tooltip__body"])}var V=i("lxNp");i.d(t,"showOnElement",(function(){return j})),i.d(t,"show",(function(){return F})),i.d(t,"updateTooltipText",(function(){return W})),i.d(t,"hide",(function(){return H}));var D=!1,B=null,R=null;Modernizr.mobiletouch||document.addEventListener("mouseover",(function(e){for(var t=e.target,i=e.currentTarget,n=function(e,t,i){var n=[];for(;e&&e!==t;)e.classList&&e.classList.contains(i)&&n.push(e),e=e.parentElement||(r=e.parentNode)&&(r.nodeType===Node.ELEMENT_NODE?r:null);var r;return n}(t,i,"apply-common-tooltip"),r=function(t){if("buttons"in e){if(1&e.buttons)return"continue"}else if(1===e.which)return"continue";var i=function(){return j(t)};if(i()){var n=function(){t.removeEventListener("common-tooltip-update",i),t.removeEventListener("mouseleave",n),t.removeEventListener("mousedown",n),document.removeEventListener("scroll",n),R&&(R.destroy(),R=null),H()};return t.addEventListener("common-tooltip-update",i),t.addEventListener("mouseleave",n),t.addEventListener("mousedown",n),document.addEventListener("scroll",n),null===R&&(R=Object(V.createGroup)({desc:"Tooltip"})).add({desc:"Hide",hotkey:27,handler:n}),"break"}},o=0,s=n;o'},"+hLl":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolBrush",(function(){return a}));var n=i("mrSG"),r=i("Ocx9"),o=i("DVnF"),s=i("j3hX"),a=function(e){function t(i,n){var r=e.call(this,i,n||t.createProperties())||this;return r._loadPaneViews(i),r}return Object(n.c)(t,e),t.prototype.properties=function(){return e.prototype.properties.call(this)},t.prototype.smooth=function(){return this.properties().childs().smooth.value()},t.prototype.name=function(){return"Brush"},t.prototype.hasEditableCoordinates=function(){return!1},t.createProperties=function(e){var i=new r.DefaultProperty("linetoolbrush",e);return t._configureProperties(i),i},t.prototype._loadPaneViews=function(e){var t=this;i.e("lt-pane-views").then(i.bind(null,"00XE")).then((function(i){t._setPaneViews([new i.BrushPaneView(t,e)])}))},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"ZSes")).then((function(e){return e.BrushDefinitionsViewModel}))},t._configureProperties=function(e){o.a._configureProperties(e), e.addChild("backgroundsColors",new s.LineToolColorsProperty([e.childs().backgroundColor],e.childs().fillBackground))},t}(o.a)},"+q2u":function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererCrossShape",(function(){return s}));var n=i("mrSG"),r=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._drawItemShape=function(e,t,i){var n=i.width,r=i.height,o=i.x-n/2,s=i.vertOffset,a=i.y-r/2+s,l=t.pixelRatio,c=this._lineWidth(t),u=c%2?.5:0,h=Math.round(o*l),d=Math.round((o+n)*l);(d-h)%2!=c%2&&(d+=1);var p=Math.floor((h+d)/2)+u,f=Math.round(a*l),_=Math.round((a+r)*l);(_-f)%2!=c%2&&(_+=1);var m=Math.floor((f+_)/2)+u;e.moveTo(p,f),e.lineTo(p,_),e.moveTo(h,m),e.lineTo(d,m)},t.prototype._calcBoundingBox=function(t){var i=t.width,n=t.height,r=t.x-i/2,s=t.vertOffset,a=t.y-n/2+s,l=r,c=r+i,u=a,h=a+n,d=new o.Point(l,u),p=new o.Point(c,h),f=Object(o.box)(d,p),_=e.prototype._calcBoundingBox.call(this,t);return _&&(f=this._unionBox(f,_)),f},t}(r.c)},"/+9u":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i("jCNj");function r(e,t){void 0===t&&(t=Date.now());var i=Object(n.get_timezone)(e).offset_utc(t),r="",o=i/1e3/60/60;o%1&&(r=":"+o%1*60);return{offset:i,string:"UTC"+(o>0?"+"+(o-o%1)+r:0===o?"":String(o-o%1+r))}}},"//lZ":function(e,t,i){"use strict";i.r(t),i.d(t,"doAnimate",(function(){return s}));var n=i("mrSG");var r={from:0,duration:250,easing:i("9uLv").easingFunc.easeOutCubic},o=function(){function e(e){var t=this;this._doing=!0,this._completed=!1,this._options=Object(n.a)(Object(n.a)({},r),e);var i=performance.now();window.requestAnimationFrame((function(e){t._animation(i,t._options.from,e)}))}return e.prototype.stop=function(){this._doing=!1},e.prototype.completed=function(){return this._completed},e.prototype._animation=function(e,t,i){var n=this;if(this._doing){var r,o,s,a=(i=!i||i<1e12?performance.now():i)-e,l=a>=this._options.duration||t===this._options.to,c=(r=this._options.from,o=this._options.to,s=this._options.easing(a/this._options.duration),r*(1-s)+o*s),u=l?this._options.to:c,h=u-t;this._options.onStep(h,u),l?this._finishAnimation():window.requestAnimationFrame((function(t){n._animation(e,u,t)}))}else this._finishAnimation()},e.prototype._finishAnimation=function(){this._options.onComplete&&this._options.onComplete(),this._completed=!0},e}();function s(e){return new o(e)}},"//lt":function(e,t,i){"use strict";var n;i.r(t),i.d(t,"PaneCursorType",(function(){return n})),function(e){e[e.Default=0]="Default",e[e.Pointer=1]="Pointer",e[e.Eraser=2]="Eraser",e[e.Dot=3]="Dot",e[e.Grabbing=4]="Grabbing",e[e.ZoomIn=5]="ZoomIn",e[e.VerticalResize=6]="VerticalResize",e[e.HorizontalResize=7]="HorizontalResize",e[e.DiagonalNeSwResize=8]="DiagonalNeSwResize",e[e.DiagonalNwSeResize=9]="DiagonalNwSeResize"}(n||(n={}))},"/3z9":function(e,t,i){"use strict";i.r(t),i.d(t,"isMacKeyboard",(function(){return o})),i.d(t,"Modifiers",(function(){return n})),i.d(t,"modifiersFromEvent",(function(){return s})),i.d(t,"hashFromEvent",(function(){return a })),i.d(t,"humanReadableModifiers",(function(){return l})),i.d(t,"humanReadableHash",(function(){return h}));var n,r=i("qFKp"),o=Object(r.isMac)()||r.CheckMobile.iOS();function s(e){var t=0;return e.shiftKey&&(t+=1024),e.altKey&&(t+=512),e.ctrlKey&&(t+=256),e.metaKey&&(t+=2048),t}function a(e){return s(e)|e.keyCode}function l(e){var t="";return 256&e&&(t+=o?"^":"Ctrl + "),512&e&&(t+=o?"⌥":"Alt + "),1024&e&&(t+=o?"⇧":"Shift + "),2048&e&&(t+=o?"⌘":"Win + "),t}!function(e){e[e.None=0]="None",e[e.Alt=512]="Alt",e[e.Shift=1024]="Shift",e[e.Mod=o?2048:256]="Mod",e[e.Control=256]="Control",e[e.Meta=2048]="Meta"}(n||(n={}));for(var c={9:"⇥",13:"↵",27:"Esc",8:o?"⌫":"Backspace",32:"Space",35:"End",36:"Home",37:"←",38:"↑",39:"→",40:"↓",45:"Ins",46:"Del",191:"/"},u=1;u<=16;u++)c[u+111]="F"+u;function h(e){var t=l(e),i=255&e;return t+=i in c?c[i]:String.fromCharCode(i)}},"/5ju":function(e,t,i){"use strict";i.r(t);var n=i("Kxc7"),r=i("hY0g"),o=i.n(r),s=i("FQhm"),a=i("htUT"),l=i("/z0S"),c=i("YFKU");i("HbRj"),i("+GxX");var u=i("mrSG");i("zUrt");function h(){return Object(u.b)(this,void 0,void 0,(function(){var e,t;return Object(u.d)(this,(function(i){switch(i.label){case 0:return[2,!0];case 1:return t=i.sent(),[2,e>t]}}))}))}var d=i("fZEr"),p=function(){function e(e,t){this._visibility=new o.a(!1),this._chartWidgetCollection=e,this._doSave=t}return e.prototype.hide=function(){var e;null===(e=this._hide)||void 0===e||e.call(this),this._visibility.setValue(!1)},e.prototype.visible=function(){return this._visibility.readonly()},e}(),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(u.c)(t,e),t.prototype.cloneChart=function(){var e=this;this._cloneChart().then((function(){return e._visibility.setValue(!0)}))},t.prototype.show=function(){Object(l.a)(this.cloneChart.bind(this),{source:"Clone chart"})},t.prototype._cloneChart=function(){return Object(u.b)(this,void 0,void 0,(function(){var e,t,i=this;return Object(u.d)(this,(function(r){switch(r.label){case 0:return[3,2];case 1:r.sent(),r.label=2;case 2:return e=this._chartWidgetCollection,[4,h()];case 3:return r.sent()?(t=this,[4,Object(d.b)({title:Object(c.t)("Copy Chart Layout"),text:Object(c.t)("Enter a new chart layout name")+":",maxLength:64,initValue:Object(c.t)("{0} copy",{context:"ex: AAPL chart copy"}).format(e.metaInfo.name.value()),onRename:function(t){var r=t.newValue,o=t.dialogClose;n.enabled("saveload_storage_customization")&&(e.metaInfo.uid.deleteValue(),e.metaInfo.id.deleteValue(),e.metaInfo.name.setValue(r),i._doSave()),o()},onClose:function(){return i._visibility.setValue(!1)}})]):[3,5];case 4:return t._hide=r.sent(),[3,6];case 5:0,r.label=6;case 6:return[2]}}))}))},t}(p),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(u.c)(t,e),t.prototype.show=function(e,t,i){var n=this;this._saveNewChart(e,t,i).then((function(){return n._visibility.setValue(!0)}))},t.prototype._saveNewChart=function(e,t,i){return Object(u.b)(this,void 0,void 0,(function(){var n,r,o,s=this ;return Object(u.d)(this,(function(a){switch(a.label){case 0:return n=this._chartWidgetCollection,r=n.metaInfo.name.value(),[4,h()];case 1:return a.sent()?(o=this,[4,Object(d.b)({title:Object(c.t)("Save New Chart Layout"),text:Object(c.t)("Enter a new chart layout name")+":",maxLength:64,initValue:r,onRename:function(r){var o=r.newValue,a=r.dialogClose;n.metaInfo.name.setValue(o),s._doSave(e,t,i),a()},onClose:function(){return s._visibility.setValue(!1)}})]):[3,3];case 2:return o._hide=a.sent(),[3,4];case 3:0,a.label=4;case 4:return[2]}}))}))},t}(p),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(u.c)(t,e),t.prototype.show=function(){this._renameChart(),this._visibility.setValue(!0)},t.prototype._renameChart=function(){var e=this;Object(l.a)((function(){return Object(u.b)(e,void 0,void 0,(function(){var e,t,i,n=this;return Object(u.d)(this,(function(r){switch(r.label){case 0:return e=this._chartWidgetCollection,t=e.metaInfo.name.value(),i=this,[4,Object(d.b)({title:Object(c.t)("Rename Chart Layout"),text:Object(c.t)("Enter a new chart layout name")+":",maxLength:64,initValue:t,onRename:function(t){var i=t.newValue,r=t.dialogClose;e.metaInfo.name.setValue(i),n._doSave(),r()},onClose:function(){return n._visibility.setValue(!1)}})];case 1:return i._hide=r.sent(),[2]}}))}))}),{source:"Rename chart"})},t}(p);i.d(t,"SaveChartService",(function(){return v}));var v=function(){function e(e,t){var i=this;this._autosaveTimer=null,this._watchedAutoSaveEnabled=new o.a,this._toggleAutoSaveEnabledHandler=this._toggleAutoSaveEnabled.bind(this),this._doSave=function(e,t,n,r){var o=i._chartWidgetCollection;void 0!==e&&e(),i._chartSaver.saveChartSilently((function(e){var i;i=o.metaInfo.uid.value(),"/chart/"===location.pathname&&(location.href="/chart/"+i),void 0!==t&&t(e)}),(function(){void 0!==n&&n()}),{autoSave:Boolean(r)})},this._chartWidgetCollection=e,this._chartSaver=t,this._createController=new _(e,this._doSave),this._renameController=new m(e,this._doSave),this._saveAsController=new f(e,this._doSave),this._chartChangesWatcher=new a.ChartChangesWatcher(e.undoHistory,t,s),e.saveKeysPressed().subscribe(this,this.saveChartOrShowTitleDialog),this._chartChangesWatcher.getOnChange().subscribe(this,this._onStateChanged)}return e.prototype.autoSaveEnabled=function(){return this._watchedAutoSaveEnabled},e.prototype.destroy=function(){0},e.prototype.getCreateController=function(){return this._createController},e.prototype.getRenameController=function(){return this._renameController},e.prototype.getSaveAsController=function(){return this._saveAsController},e.prototype.cloneChart=function(){this._saveAsController.cloneChart()},e.prototype.saveChartAs=function(){this._saveAsController.show()},e.prototype.renameChart=function(){this._renameController.show()},e.prototype.saveNewChart=function(e,t,i){this._createController.show(e,t,i)},e.prototype.saveExistentChart=function(e,t,i){this._doSave(e,t,i)},e.prototype.saveChartOrShowTitleDialog=function(e,t,i){ var n=this,r=window.saver.isSaveInProcess(),o=this._chartChangesWatcher.hasChanges(),s=!!this._chartWidgetCollection.metaInfo.id.value();window.is_authenticated&&(r||!o&&s)||Object(l.a)((function(){null!=n._chartWidgetCollection.metaInfo.id.value()?n.saveExistentChart(e,t,i):n.saveNewChart(e,t,i)}),{source:"Save chart",sourceMeta:"Chart"})},e.prototype.whenReadyToSave=function(e){this._chartSaver.whenReadyToSave(e)},e.prototype.saveToJSON=function(){return this._chartSaver.saveToJSON()},e.prototype.saveChartSilently=function(e,t,i){this._chartSaver.saveChartSilently(e,t,i)},e.prototype.setAutoSaveEnabled=function(e){var t=this;window.is_authenticated&&window.saver.isSaveInProcess()||Object(l.a)((function(){t._watchedAutoSaveEnabled.setValue(e)}),{source:"AutoSave chart"})},e.prototype.saveChartLineTools=function(e,t){return this._chartSaver.saveChartLineTools(e,t)},e.prototype._autoSaveEnabledSettingHandler=function(e){0},e.prototype._toggleAutoSaveEnabled=function(e){0},e.prototype._enableAutoSave=function(){0},e.prototype._disableAutoSave=function(){0},e.prototype._onStateChanged=function(e){e?this._startAutosave():this._stopAutosave()},e.prototype._startAutosave=function(){var e=this;n.enabled("charts_auto_save")&&null===this._autosaveTimer&&(this._autosaveTimer=setTimeout((function(){e._autosaveTimer=null,e._chartWidgetCollection.metaInfo.id.value()&&e._doSave(void 0,void 0,void 0,!0)}),6e4))},e.prototype._stopAutosave=function(){null!==this._autosaveTimer&&(clearInterval(this._autosaveTimer),this._autosaveTimer=null)},e}()},"/DW5":function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return o}));var n=i("CLNU");function r(e){return Object(n.clean)(JSON.stringify(e))}function o(e){return JSON.parse(Object(n.clean)(e,!0))}},"/DxK":function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("p1SQ").LineToolHorzLinePriceAxisView,o=i("tc+8"),s=i("Ocx9").DefaultProperty;function a(e,t){var o=t||a.createProperties();this._priceAxisView=new r(this),n.call(this,e,o),i.e("lt-pane-views").then(function(e){var t=i("ckl+").HorzLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,n),a.prototype.state=function(e){var t=n.prototype.state.call(this,e);return t.points&&0!==t.points.length&&(t.points[0].offset=0),t},a.prototype.pointsCount=function(){return 1},a.prototype.name=function(){return"Horizontal Line"},a.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},a.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._priceAxisView.update()},a.prototype.canHasAlert=function(){return!0},a.prototype._getAlertPlots=function(){return[this.points()[0].price]},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("NEbb").HorizontalLineDefinitionsViewModel }.bind(null,i)).catch(i.oe)},a.prototype.template=function(){var e=n.prototype.template.call(this);return e.text=this.properties().childs().text.value(),e},a.prototype._applyTemplateImpl=function(e){n.prototype._applyTemplateImpl.call(this,e),this.properties().childs().text.setValue(e.text)},a.createProperties=function(e){var t=new s("linetoolhorzline",e);return a._configureProperties(t),t},a._configureProperties=function(e){n._configureProperties(e),e.hasChild("text")||e.addChild("text",new o("")),e.addExclusion("text")},t.LineToolHorzLine=a},"/G2Z":function(e,t,i){"use strict";(function(e){i("xdS3");var t=i("Eyy1").assert;i("fPdn"),i("wZIs"),i("WmDe"),JSON.parse(urlParams.disabledFeatures).forEach((function(t){e.setEnabled(t,!1)})),JSON.parse(urlParams.enabledFeatures).forEach((function(t){e.setEnabled(t,!0)}));var n=i("UlDV").RestrictedToolsetBootloader,r=i("I4UZ").HeaderToolbarBootloader,o=i("9zVu").DrawingToolbarBootloader,s=i("OiSa").isDrawingToolbarVisible,a=i("EsvI"),l=i("oiZD").setTheme,c=i("JcHK"),u=i("Ery9"),h=i("lxNp"),d=i("n0Bl").migrateShortcut,p=i("RXmj").ChartSaver,f=i("/5ju").SaveChartService,_=i("lA7n").LoadChartService,m=i("F58L").StudyTemplates,v=i("54XG").FavoriteStudyTemplateService,y=i("PT1i").linking,g=i("FQhm"),b=i("kcTO"),S=b.formatterOptions,w=b.customFormatters,P=i("JT5O").StudyMarket,C=i("FBuY").TVXWindowEvents,T=i("jofe").createDeferredPromise,x=i("FIi8").deepExtend,I=i("PoSe"),L=i("LxhU").Interval,O=i("lW/c").Root,M=i("NsVT").ChartPage,A=i("IWXC").destroyQuoteSessions,k=i("ULlu"),E=i("uDHo").TIMEFRAMETYPE,V=new M(new O(window).allocate()),D=V.allocate({areaName:"center"}),B=(V.allocate({areaName:"tradingpanel"}),window.parent[urlParams.uid].brokerFactory,Boolean(!1)),R=i("vPbs").CHART_WIDGET_COLLECTION_SERVICE,N=i("eqEH");i("Wh/T");var j=i("/Y2c"),F=i("g5Qf").createFavoriteDrawingToolbar,W=i("x5Tw").setupChartEventHint,H=i("EX27"),z=i("0YCj"),U=i("9nLJ");i("2cgs"),i("vIQA");var G=i("u5Q5").setSearchRequestDelay,Y=i("dfhE"),q=i("ocLq"),K=i("qE4g").addBrandingSource,Z=window.parent[urlParams.uid].getCustomIndicators,J=T(),X=T(),Q=e.enabled("left_toolbar");if(Promise.all([J.promise,X.promise]).then((function(){window.ChartApiInstance.start()})),"function"==typeof Z){var $=Z(q);$&&$.then?$.then((function(e){if(!Array.isArray(e))return console.warn("custom_indicators_getter should be a function that returns a Promise object which result is an array of custom indicators"),void J.resolve();JSServer.studyLibrary.push.apply(JSServer.studyLibrary,e),J.resolve(),console.log("{0} custom indicators loaded.".format(e.length))})).catch((function(e){console.warn("Error loading custom indicators "+e),J.resolve()})):(console.warn("custom_indicators_getter should be a function that returns a Promise object"),J.resolve())}else J.resolve();window.widgetReady=function(e){g.subscribe("onChartReady",e)};var ee=urlParams.theme&&urlParams.theme.toLowerCase();function te(e){window.__defaultsOverrides=window.__defaultsOverrides||{},x(window.__defaultsOverrides,e), void 0!==TradingView.defaultProperties&&void 0!==TradingView.defaultProperties.chartproperties&&(window.applyDefaultsOverrides(TradingView.defaultProperties.chartproperties),window.applyDefaultOverridesToLinetools())}!function(e){a.themes[e]&&l(e)}(ee),window.applyStudiesOverrides=function(e){e&&window.chartWidgetCollection.applyStudiesOverrides(e)},window.applyOverrides=function(e){te(e),window.chartWidgetCollection.applyOverrides(e)},window.applyTradingCustomization=function(e){for(var t in e.order)TradingView.defaultProperties.linetoolorder[t]=e.order[t];for(var t in e.position)TradingView.defaultProperties.linetoolposition[t]=e.position[t]},window.changeTheme=function(e,t){var i=a.themes[e.toLowerCase()];i&&window.tradingViewApi.themes().setStdTheme(i.name,!0,t&&t.disableUndo)},window.getTheme=function(){return window.tradingViewApi.themes().getCurrentThemeName()},window.is_authenticated=!1;JSON.parse(window.urlParams.brokerConfig);window.t("charts by TradingView"),window.t("powered by TradingView"),window.t("by TradingView");var ie=null,ne=T(),re=null,oe=function(){if(!Modernizr.canvas||!Modernizr.canvastext)throw Error("Charting library cannot be running under this browser");if(e.setEnabled("charting_library_debug_mode","true"===urlParams.debug),e.setEnabled("chart_property_page_trading",!1),e.enabled("remove_library_container_border")){var l=document.querySelector("#library-container");null!==l&&(l.style.border="0px",l.style.padding="1px")}e.enabled("no_min_chart_width")&&(window.document.body.style.minWidth="0px"),null!=urlParams.studiesOverrides&&z.setDefaultsOverrides(JSON.parse(urlParams.studiesOverrides)),t(void 0===TradingView.defaultProperties,"Default properties are inited before applying overrides"),te(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&&(S.decimalSign=urlParams.numeric_formatting.decimal_sign[0]),window.ChartApiInstance=new H(window.parent[urlParams.uid].datafeed),window.parent[urlParams.uid].customFormatters&&(window.parent[urlParams.uid].customFormatters.timeFormatter&&(w.timeFormatter=window.parent[urlParams.uid].customFormatters.timeFormatter),window.parent[urlParams.uid].customFormatters.dateFormatter&&(w.dateFormatter=window.parent[urlParams.uid].customFormatters.dateFormatter)),window.ChartApiInstance.setStudiesAccessController(window.ChartApiInstance.createStudiesAccessController(urlParams.studiesAccess));var u=urlParams.chartContent?JSON.parse(urlParams.chartContent).json:void 0,h=urlParams.chartContentExtendedData?JSON.parse(urlParams.chartContentExtendedData):u?u.extendedData:void 0,d=urlParams.interval||"D",b=function(e){var t=/(\d+)(\w+)/;return e.map((function(e){var i=t.exec(e.text),n=i[2].toLowerCase(),r=parseInt(i[1]),o="y"===n?12*r+"M":r+n,s=L.parse(e.resolution);return{text:window.t(e.title)||r+window.t(n,{context:"dates",count:r}),description:e.description||"",value:{value:o.toUpperCase(), type:E.PeriodBack},targetResolution:s.value(),requiresIntraday:s.isIntraday()}}))}(JSON.parse(urlParams.timeFrames));window.containerElement=window.parent.document.getElementById(urlParams.uid).parentElement;var T={resizerBridge:D,padding:e.enabled("border_around_the_chart")?2:0,content:u,widgetOptions:{hideIdeas:!0,addVolume:window.ChartApiInstance.studiesAccessController.isToolEnabled("Volume"),handleSessionErrors:!0,muteSessionErrors:!0,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:d,compareSymbols:urlParams.compareSymbols&&JSON.parse(urlParams.compareSymbols),defTimeframe:urlParams.timeframe,paneContextMenuEnabled:e.enabled("pane_context_menu"),paneContextMenu:{mainSeriesTrade:B},priceScaleContextMenuEnabled:e.enabled("scales_context_menu"),currencyConversionEnabled:e.enabled("pricescale_currency"),legendWidgetEnabled:e.enabled("legend_widget"),legendWidget:{contextMenu:{settings:e.enabled("show_chart_property_page"),showOpenMarketStatus:e.enabled("display_market_status")}},sourceStatusesWidget:{errorSolution:!1},marketStatusWidgetEnabled:e.enabled("display_market_status"),marketStatusWidget:{preMarketSolution:!1,postMarketSolution:!1},chartWarningWidget:{subscriptionFullInfo:!1},timeScaleWidget:{contextMenuEnabled:e.enabled("scales_context_menu"),timezoneMenuEnabled:e.enabled("timezone_menu"),priceAxisLabelsOptions:{showLabels:e.enabled("main_series_scale_menu")}},timeScale:{preserveBarSpacing:!1,lockVisibleTimeRangeOnResize:e.enabled("lock_visible_time_range_on_resize"),rightBarStaysOnScroll:e.enabled("right_bar_stays_on_scroll")},goToDateEnabled:e.enabled("go_to_date"),crossHair:{menuEnabled:e.enabled("chart_crosshair_menu")},handleScale:{mouseWheel:e.enabled("mouse_wheel_scale"),pinch:e.enabled("pinch_scale"),axisPressedMouseMove:{time:e.enabled("axis_pressed_mouse_move_scale"),price:e.enabled("axis_pressed_mouse_move_scale")}},handleScroll:{mouseWheel:e.enabled("mouse_wheel_scroll"),pressedMouseMove:e.enabled("pressed_mouse_move_scroll"),horzTouchDrag:e.enabled("horz_touch_drag_scroll"),vertTouchDrag:e.enabled("vert_touch_drag_scroll")},shiftVisibleRangeOnNewBar:e.enabled("shift_visible_range_on_new_bar"),croppedTickMarks:e.enabled("cropped_tick_marks")},seriesControlBarEnabled:e.enabled("timeframes_toolbar"),seriesControlBar:{timeFramesWidgetEnabled:!0,timeFramesWidget:{goToDateEnabled:e.enabled("go_to_date"),availableTimeFrames:function(e,t){return e?t!==Y.STATUS_DELAYED&&t!==Y.STATUS_DELAYED_STREAMING&&t!==Y.STATUS_READY?[]:b.filter((function(t){return!(t.requiresIntraday&&!e.has_intraday)&&!(e.supported_resolutions&&!e.supported_resolutions.includes(t.targetResolution))})):[]}},timeWidgetEnabled:!0,timeWidget:{timezoneMenuEnabled:e.enabled("timezone_menu")},adjustForDividendsButtonEnabled:!1,extendedHoursButtonEnabled:!1,percentageScaleButtonEnabled:!0,logScaleButtonEnabled:!0,autoScaleButtonEnabled:!0,fullscreenButtonEnabled:!0,mobileChangeLayoutEnabled:!1},globalEvents:!0,snapshotUrl:urlParams.snapshotUrl,mobileForceChartMaximizeEnabled:!1, saveChartEnabled:e.enabled("save_shortcut")};Q&&(F(),T.widgetOptions.isDrawingToolbarVisible=s),h&&(T.metaInfo={id:h.uid,name:h.name,description:h.description,uid:h.uid,username:"",tags:""});var x=window.chartWidgetCollection=new j(T);K(x),window.studyMarket=new P(x),void 0!==N&&N.registerService(R,x),x.activeChartWidget.subscribe((function(e){g.emit("activeChartChanged",x.getAll().indexOf(e))})),window.saver=new p(x);var O=new f(x,window.saver),M=new _(x);window.chartWidget=x.activeChartWidget.value(),window.pro=new TradingView.Pro;var A=function(t){if(!e.enabled("header_widget"))return null;var o=V.allocate({areaName:"top"}),s=new(0,i("htUT").ChartChangesWatcher)(t.chartWidgetCollection.undoHistory,window.saver,g),a=JSON.parse(urlParams.favorites);a.intervals=a.intervals.map((function(e){var t=""+e;return t.match(/1[DWMYdwmy]/)&&(t=t.slice(1)),t}));var l,c=null;e.enabled("study_templates")&&(c=new v(C,TVSettings),re=new m({chartWidgetCollection:t.chartWidgetCollection,favoriteStudyTemplatesService:c}));l=Modernizr.mobiletouch?["full"]:e.enabled("caption_buttons_text_if_possible")?void 0:["medium"];return new r(new n,{chartSaver:window.saver,chartApiInstance:ChartApiInstance,chartWidgetCollection:t.chartWidgetCollection,defaultFavoriteStyles:a.chartTypes,defaultFavoriteIntervals:a.intervals,hideStudyTemplates:!0,resizerBridge:o,studyMarket:window.studyMarket,studyTemplates:re,favoriteStudyTemplatesService:c,allowedModes:l,saveChartService:t.saveChartService,loadChartService:t.loadChartService,chartChangesWatcher:s,onClick:de})}({chartWidgetCollection:x,saveChartService:O,loadChartService:M});null!==A?A.load().then((function(e){ie=e.getComponent(),ne.resolve()})):(ne.promise.catch((function(){})),ne.reject("header widget is not loaded"));var k=function(e){if(Q){var t=urlParams.toolbarbg&&/^[0-9a-f]+$/i.test(urlParams.toolbarbg)?String(urlParams.toolbarbg):void 0;if(t){var i=document.createElement("style");i.textContent="body,.chart-controls-bar,#footer-chart-panel{background-color:#"+t+" !important}",document.head.appendChild(i)}return new o({bgColor:t,chartWidgetCollection:e,drawingsAccess:urlParams.drawingsAccess?JSON.parse(urlParams.drawingsAccess):void 0,resizerBridge:V.allocate({areaName:"left"}),onClick:de})}return null}(x),q=null;window.tradingViewApi=new U({chartWidgetCollection:x,chartApiInstance:window.ChartApiInstance,saveChartService:O,loadChartService:M});var Z=null;y.bindToChartWidgetCollection(x),TradingView.isNaN(urlParams.studyCountLimit)||(TradingView.STUDY_COUNT_LIMIT=Math.max(2,+urlParams.studyCountLimit)),TradingView.isNaN(urlParams.ssreqdelay)||G(Math.max(0,+urlParams.ssreqdelay)),window.ChartApiInstance.connect(),Promise.all([i.e(34),i.e(43),i.e(67),i.e(81),i.e(18),i.e(32),i.e("line-tools-icons"),i.e(39),i.e(51),i.e(60),i.e("floating-toolbars")]).then(function(e){var t=i("tPkB");window.lineToolPropertiesToolbar=new t(x)}.bind(null,i)).catch(i.oe);var J=document.querySelector(".tv-content");function $(){k&&k.load(),q&&q.load().then((function(e){window.footerWidget=e.getComponent()})), Z&&Z.load().then((function(e){window.widgetbar=e}))}null!==J&&J.addEventListener("contextmenu",(function(e){null!==e.target&&"input"!==e.target.tagName.toLowerCase()&&"textarea"!==e.target.tagName.toLowerCase()&&e.preventDefault()})),X.resolve(),x.undoHistory.undoStack().onChange().subscribe(null,I((function(){g.emit("onAutoSaveNeeded")}),1e3*(urlParams.autoSaveDelay||5),{leading:!1,trailing:!0})),chartWidget.withModel(null,(function(){if(ChartApiInstance.on("realtime_tick",(function(e){g.emit("onTick",e)})),!a.savedThemeName()&&ee){var t=a.getStdTheme(ee);t&&t.content&&void 0===u&&(x.applyTheme(t.content,!1,!1,ee,!0,!0),window.applyOverrides(window.__defaultsOverrides))}e.enabled("charting_library_debug_mode")&&g.subscribeToAll((function(){var e=Array.prototype.slice.call(arguments);console.log('Event "{0}", arguments: {1}'.format(e[0],JSON.stringify(e.slice(1))))})),W&&(W(x),W=null)})),c.isAnyChartWidgetInitialized(x)?$():c.waitAnyChartWidgetInitialized(x,$),g.subscribe("chart_load_requested",(function(e){window.tradingViewApi.loadChart({json:JSON.parse(e.content),extendedData:e})}))};window.addEventListener("unload",(function(){window.chartWidgetCollection&&(window.chartWidgetCollection.destroy(),window.chartWidgetCollection=null),window.containerElement=null,A(),window.ChartApiInstance&&(window.ChartApiInstance.destroy(),window.ChartApiInstance=null)})),e.enabled("saveload_storage_customization")&&(window.parent[urlParams.uid].saveLoadAdapter?u.setCustomAdapter(window.parent[urlParams.uid].saveLoadAdapter):void 0!==urlParams.chartsStorageUrl&&urlParams.chartsStorageUrl&&void 0!==urlParams.clientId&&urlParams.clientId?u.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl,urlParams.chartsStorageVer||"1.0"):(e.setEnabled("saveload_storage_customization",!1),e.setEnabled("header_saveload",!1)));var se,ae=T();function le(){ae.resolve()}window.parent[urlParams.uid].loadLastChart&&e.enabled("saveload_storage_customization")?u.getCharts((function(e){if(0!==e.length){var t=e.sort((function(e,t){return t.modified_iso-e.modified_iso}))[0];u.getChartContent(t,(function(e){var t=JSON.parse(e.content);t.extendedData=e,urlParams.chartContent=JSON.stringify({json:t}),le()}),le)}else le()}),le):le(),null!=(se=window.parent[window.urlParams.uid].settingsAdapter)?(TVSettings.setSettingsAdapter(se),TVSettings.sync()):e.enabled("use_localstorage_for_settings")&&TVSettings.sync();var ce,ue,he=T();function de(e){var t=TradingView.bottomWidgetBar;t&&t.turnOffMaximize()}Promise.all([he.promise,ae.promise]).then((function(){k.trigger(window,"resize");var t,i,n,r,o,s,a=document.querySelector(".loading-indicator");if(a&&(a.style.display="none"),setTimeout(oe,0),e.enabled("14851")&&Math.random()<=.02){t=window,i=document,n="script",r="ga",t.GoogleAnalyticsObject=r,t.ga=t.ga||function(){(t.ga.q=t.ga.q||[]).push(arguments)},t.ga.l=1*new Date,o=i.createElement(n),s=i.getElementsByTagName(n)[0],o.async=1,o.src="//www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s) ;var l=document.URL.match(new RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-112911840-1","auto"),ga("set","anonymizeIp",!0),ga("set",{hostname:l,page:l,referrer:l}),ga("send","pageview")}})),ce=!0,window.parent[urlParams.uid].datafeed.onReady((function(e){ce&&console.warn("`onReady` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),window.configurationData=e,he.resolve()})),ce=!1,window.getFunctionFromArguments=function(e){return window.parent[urlParams.uid][e]},window.createShortcutAction=(ue=h.createGroup({desc:"API"}),function(e,t){ue.add({hotkey:d(e),handler:t})}),window.initializationFinished=function(){window.chartWidgetCollection.undoHistory.clearStack()},window.headerReady=function(){return ne.promise},window.createButton=function(e){if(null===ie)throw new Error("Cannot create button: header widget is not ready or is not loaded - use `headerReady` to wait until header is ready");var t=(e=e||{}).align||"left";return ie.addButton(t)},window.getAllFeatures=function(){const t=e.getAllFeatures();return Object.keys(t).forEach((function(e){isNaN(parseFloat(e))||delete t[e]})),t}}).call(this,i("Kxc7"))},"/McG":function(e){ e.exports=JSON.parse('{"content":{"chartProperties":{"scalesProperties":{"textColor":"#131722","lineColor":"rgba(42, 46, 57, 0.14)","backgroundColor":"#ffffff"},"paneProperties":{"vertGridProperties":{"color":"rgba(42, 46, 57, 0.06)"},"horzGridProperties":{"color":"rgba(42, 46, 57, 0.06)"},"background":"#ffffff","backgroundGradientStartColor":"#ffffff","backgroundGradientEndColor":"#ffffff"}},"sessions":{"graphics":{"backgrounds":{"outOfSession":{"color":"#2196F3","transparency":92},"preMarket":{"color":"#FF9800","transparency":92},"postMarket":{"color":"#2196F3","transparency":92}},"vertlines":{"sessBreaks":{"color":"#4985e7","style":2,"width":1}}}},"mainSourceProperties":{"baseLineColor":"#B2B5BE","candleStyle":{"borderColor":"#378658","upColor":"#26a69a","wickColor":"#737375","wickUpColor":"#26a69a","wickDownColor":"#ef5350","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350"},"haStyle":{"borderColor":"#378658","upColor":"#26a69a","wickColor":"#737375","wickUpColor":"#26a69a","wickDownColor":"#ef5350","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350"},"barStyle":{"downColor":"#ef5350","upColor":"#26a69a"},"pnfStyle":{"downColor":"#ef5350","upColor":"#26a69a","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae"},"baselineStyle":{"baselineColor":"rgba( 117, 134, 150, 1)","topFillColor1":"rgba( 38, 166, 154, 0.28)","topFillColor2":"rgba( 38, 166, 154, 0.05)","bottomFillColor1":"rgba( 239, 83, 80, 0.05)","bottomFillColor2":"rgba( 239, 83, 80, 0.28)","topLineColor":"rgba( 38, 166, 154, 1)","bottomLineColor":"rgba( 239, 83, 80, 1)"},"areaStyle":{"transparency":100,"color1":"rgba(33, 150, 243, 0.28)","color2":"#2196f3","linecolor":"#2196f3","linewidth":2,"linestyle":0},"renkoStyle":{"upColor":"#26a69a","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","borderUpColorProjection":"#a9dcc3","borderDownColorProjection":"#f5a6ae","wickUpColor":"#26a69a","wickDownColor":"#ef5350"},"lineStyle":{"color":"#2196f3","linewidth":2,"linestyle":0},"kagiStyle":{"downColor":"#ef5350","upColor":"#26a69a","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae"},"pbStyle":{"upColor":"#26a69a","downColor":"#ef5350","borderUpColor":"#26a69a","borderDownColor":"#ef5350","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","borderUpColorProjection":"#a9dcc3","borderDownColorProjection":"#f5a6ae"},"rangeStyle":{"upColor":"#26a69a","downColor":"#ef5350","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae"}}}}')},"/ToI":function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return a}));var n=i("mrSG"),r=i("Eyy1"),o=function(e){function t(t,i,n,r){var o=e.call(this,t,i,r)||this;return o._sourcePaneRemoved=!1,o._targetPaneIndex=t.panes().indexOf(n),o}return Object(n.c)(t,e),t.prototype.redo=function(){ for(var e=this._chartModel.panes()[this._initialPaneIndex],t=this._chartModel.panes()[this._targetPaneIndex],i=e!==t,n=this._targetPriceScale(t),o=Object(r.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),s=0,a=this._chartModel.children(o,!0);s1),u.fullscreen.setValue(le===u)}else u&&r(u)}ke(),He(),function(){for(var e=G.count,t=e,i=0;i1)}(),t(),W.forEach((function(e){e.chartWidget.onZoom().subscribe(this,(function(e){me.fire(e)}))})),W.forEach((function(e){e.chartWidget.onScroll().subscribe(this,(function(){ve.fire()}))})),U.value()<1&&l>0&&W[l-1].rdState.bridge().attach()}function He(){var e=Math.min(G.count,W.length)-1;if(e<0)j.deleteValue();else{var t=H;t<0&&(t=0),t>e&&(t=e),j.setValue(W[t].chartWidget)}}function ze(){for(var e=W.length;e--;){var t=e===H;W[e].container.value().classList.toggle("active",t),W[e].container.value().classList.toggle("inactive",!t)}}function Ue(e){}this.updateLayout=ke;var Ge=new t,Ye=new y,qe=new y,Ke=null;function Ze(e){var t=e.mainSeries().properties();t.style.subscribe(null,Je),Je(t.style),e.model().onSelectedSourceChanged().subscribe(null,Xe),Xe(e.selection().allSources())}function Je(e){Ye.setValue(e.value())}function Xe(){var e=Ke.model();qe.setValue(e.selection().allSources())}function Qe(e){for(var t=!1,i=0;i=o[e].count)return e;return"s"}function st(e,t){if(J=!0,X=Boolean(t),K=[],e){e.charts||(e={layout:"s",charts:[e]});var i=new Set;e.charts.forEach((function(e){e.chartId&&i.add(e.chartId)})),e.charts.forEach((function(e){if(!e.chartId){var t=Fe((function(e){return i.has(e)}));i.add(t),e.chartId=t}})),Y=ot(e.layout||"s");for(var n=0;n1},applyIndicatorToAllCharts:function(e,t,i,n){k(xe(),e,t,i,n)},setActive:it,inlineChartsCount:U.readonly(),revertToInline:function(){Ne(null);for(var e=0;e0||e.status()===x.STATUS_INVALID_SYMBOL||e.status()===x.STATUS_NO_BARS)ht();else{var i=e.dataEvents(),n=function(){ht(),i.barReceived().unsubscribe(null,n),i.completed().unsubscribe(null,n),i.error().unsubscribe(null,n)};i.barReceived().subscribe(null,n),i.completed().subscribe(null,n),i.error().subscribe(null,n)}}))}})),a()){var dt=h.tool.setValue;h.tool.setValue=function(){M.selectedSources.value()&&M.activeChartWidget.value().model().lineBeingCreated()&&M.activeChartWidget.value().model().cancelCreatingLine(),dt.apply(h.tool,arguments)}}Promise.all(W.map((function(e){return b(e.chartWidget.modelCreated()).promise}))).then((function(){return Promise.all(W.map((function(e){return b(e.chartWidget.model().mainSeries().dataEvents().symbolResolved()).promise})))})).then((function(){window.saver&&window.is_authenticated&&V.widgetOptions.justCloned&&window.saver.saveChartSilently()})).catch(P.logError.bind(P))}}).call(this,i("aIyQ"))},"/YGI":function(e,t,i){"use strict";i.r(t);var n,r=i("mrSG"),o=i("0YCj"),s=i.n(o);!function(e){e.StudyCannotBeChild="cannot_be_child",e.StubWasRemoved="stub_was_removed",e.CannotGetMetainfo="cannot_get_metainfo",e.Cancelled="cancelled",e.Unknown="unknown"}(n||(n={}));var a=i("txPx");i.d(t,"StudyInserter",(function(){return c}));var l=Object(a.getLogger)("Chart.Studies.StudyInserter"),c=function(){function e(e,t,i){this._parentSource=void 0,this._propsState=void 0,this._preferredPriceScale=void 0,this._allowChangeCurrency=!1,this._paneSize=void 0,this._forceOverlay=!1,this._studyMetaInfoRepository=t,this._inserterImpl=i,this._studyDescriptor=e}return e.prototype.setParentSource=function(e){this._parentSource=e||void 0},e.prototype.setPaneSize=function(e){this._paneSize=e},e.prototype.setPreferredPriceScale=function(e){this._preferredPriceScale=e},e.prototype.setAllowChangeCurrency=function(e){this._allowChangeCurrency=e},e.prototype.setForceOverlay=function(e){this._forceOverlay=e},e.prototype.setPropertiesState=function(e){this._propsState=e},e.prototype.setTargetPriceScaleMode=function(e){this._targetPriceScaleMode=e},e.prototype.insert=function(e,t){return Object(r.b)(this,void 0,void 0,(function(){var i,o,s,a,c,u,h;return Object(r.d)(this,(function(d){switch(d.label){case 0:p=this._inserterImpl,i=void 0!==p.createStub&&void 0!==p.removeStub?this._inserterImpl.createStub():null,o=!0,d.label=1;case 1:return d.trys.push([1,3,4,5]),[4,this._studyMetaInfoRepository.findById(this._studyDescriptor)];case 2:return s=d.sent(),[3,5];case 3:return d.sent(),l.logWarn("Cannot get study "+JSON.stringify(this._studyDescriptor)),[2,Promise.reject(n.CannotGetMetainfo)];case 4:return null!==i&&(o=this._inserterImpl.removeStub(i)),[7];case 5: return o?void 0!==t&&t.cancelled?[2,Promise.reject(n.Cancelled)]:this._canApplyStudyToParent(s)?(a=Object(r.a)({},s.defaults.inputs),void 0===e?[3,7]:[4,e(a,s.inputs,s)]):[2,Promise.reject(n.StudyCannotBeChild)]:[2,Promise.reject(n.StubWasRemoved)];case 6:return u=d.sent(),[3,8];case 7:u={},d.label=8;case 8:return c=u,void 0!==t&&t.cancelled?[2,Promise.reject(n.Cancelled)]:null===(h=this._insertStudy(s,c))?[2,Promise.reject(n.Unknown)]:[2,h]}var p}))}))},e.prototype._insertStudy=function(e,t){return this._inserterImpl.createStudy(e,t,null,this._propsState,this._forceOverlay,this._parentSource,this._preferredPriceScale,this._allowChangeCurrency,this._paneSize,this._targetPriceScaleMode)},e.prototype._canApplyStudyToParent=function(e){return void 0===this._parentSource||s.a.canBeChild(e)},e}()},"/b+7":function(e,t){e.exports=''},"/bs+":function(e,t,i){"use strict";i.r(t),i.d(t,"barTimeToEndOfPeriod",(function(){return r})),i.d(t,"endOfPeriodToBarTime",(function(){return o}));var n=i("E6p6");function r(e,t,i,r){if(r.isDays())return i;if(e.moveTo(1e3*i),r.isIntraday()){var o=e.indexOfBar(1e3*i);if(o<0)throw new Error(i+" is out of the instrument session ");return e.endOfBar(o)/1e3}return e.startOfBar(n.SessionStage.LASTBAR_SESSION)/1e3}function o(e,t,i,n){if(n.isDays())return i;var r=1e3*i-1;if(e.moveTo(r),n.isIntraday()){var o=e.indexOfBar(r);if(o<0)throw new Error(i+" is out of the instrument session ");return e.startOfBar(o)/1e3}return i=e.startOfBar(0)/1e3}},"/hKg":function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererCandles",(function(){return a}));var n=i("Eyy1"),r=i("VdBB"),o=i("gAom"),s=i("Zp/P"),a=function(){function e(e){this._bars=[],this._barSpacing=1,this._barWidth=1,this._borderVisible=!1,this._barBorderWidth=1,this._wickVisible=!1,this._bodyVisible=!0,this._borderColor=void 0,this._wickColor=void 0,this._hittest=void 0,e&&this.setData(e)}return e.prototype.setData=function(e){this._bars=e.bars,this._barSpacing=e.barSpacing,this._borderVisible=e.borderVisible,this._bodyVisible=e.bodyVisible,this._wickVisible=e.wickVisible,this._borderColor=e.borderColor,this._wickColor=e.wickColor,this._hittest=e.hittest},e.prototype.hitTest=function(e){var t=this._bars,i=.5*this._barSpacing;if(0===t.length)return null;if(e.xt[t.length-1].time+i)return null;for(var n=null,o=0,a=t;o=2)Math.floor(i)%2!=this._barWidth%2&&this._barWidth--;this._wickVisible&&this._drawWicks(e,i),this._borderVisible&&this._drawBorder(e,i),this._bodyVisible&&this._drawCandles(e,i)}},e.prototype._drawWicks=function(e,t){var i=this._bars,r="",o=Math.min(Math.floor(t),Math.floor(this._barSpacing*t));o=Math.max(Math.floor(t),Math.min(o,this._barWidth));for(var s=Math.floor(.5*o),a=null,l=0,c=i;l2*r)Object(o.fillRectInnerBorder)(e,u,d,h-u+1,p-d+1,r);else{var f=h-u+1;e.fillRect(u,d,f,p-d+1)}s=h}}},e.prototype._drawCandles=function(e,t){for(var i="",n=this._calculateBorderWidth(t),r=0,s=this._bars;rc)continue;e.fillRect(u,l,h-u+1,c-l+1)}}}},e}()},"/jjs":function(e,t,i){"use strict";i.r(t),i.d(t,"Magnet",(function(){return s}));var n=i("Eyy1"),r=i("4o++"),o=i("zL3Q"),s=function(){function e(){}return e.prototype.align=function(e,t,i){var s=e;if(!Object(o.a)().value())return s;var a=i.mainDataSource();if(null===a)return s;var l=a.model().mainSeries();if(a!==l)return s;var c=l.priceScale(),u=l.bars();if(c.isEmpty()||!u.contains(t))return s;var h=u.valueAt(t);if(null===h)return s ;var d=[h[1],h[2],h[3],h[4]],p=Object(n.ensure)(l.firstValue()),f=d.map((function(e){return{y:c.priceToCoordinate(e,p),price:e}})),_=c.priceToCoordinate(e,p);f.sort((function(e,t){return Math.abs(e.y-_)-Math.abs(t.y-_)}));var m=f[0];return(Object(o.b)().value()===r.MagnetMode.StrongMagnet||Math.abs(m.y-_)<50)&&(s=m.price),s},e}()},"/kal":function(e,t){e.exports=''},"/tGj":function(e,t,i){"use strict";function n(e){return e.symbolSource()===e}i.r(t),i.d(t,"isSymbolSource",(function(){return n}))},"/z0S":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i("Kxc7");function r(e,t){n.enabled("saveload_requires_authentication")?window.runOrSignIn(e,t):e()}},"08i5":function(e,t,i){"use strict";var n,r;i.r(t),i.d(t,"AlertStatus",(function(){return n})),i.d(t,"Direction",(function(){return r})),function(e){e[e.Waiting=0]="Waiting",e[e.Success=1]="Success",e[e.Failure=2]="Failure"}(n||(n={})),function(e){e[e.Up=1]="Up",e[e.Down=2]="Down"}(r||(r={}))},"0F0w":function(e,t,i){"use strict";i.r(t);var n=i("mrSG"),r=i("aIyQ"),o=i.n(r),s=i("Eyy1"),a=i("hY0g"),l=i.n(a),c=i("e3/o"),u=i("txPx"),h=Object(u.getLogger)("ChartApi.AbstractSession"),d=function(){function e(e,t,i){this._isConnected=new l.a(!1),this._state=0,this._isConnectForbidden=!1,this._sessionId="",this._sessionIdChanged=new o.a,this._chartApi=e,this._sessionPrefix=t,this._shouldReconnectAfterCriticalError=i}return e.prototype.destroy=function(){this._logNormal("Destroying session"),this._isConnected.unsubscribe(),this.disconnect(),this._sessionIdChanged.destroy(),delete this._chartApi,this._logNormal("Session has been destroyed")},e.prototype.isConnected=function(){return this._isConnected},e.prototype.sessionId=function(){return this._sessionId},e.prototype.onSessionIdChanged=function(){return this._sessionIdChanged},e.prototype.connect=function(){0===this._state&&(Object(s.assert)(!this._isConnectForbidden,"Cannot call connect because it is forbidden at this moment"),this._setSessionId(this._sessionPrefix+"_"+Object(c.randomHash)()),this._logNormal("Connecting session - wait until transport stay connected"),this._state=1,this._chartApi.createSession(this._sessionId,this))},e.prototype.disconnect=function(){var e=this;0!==this._state&&(Object(s.assert)(""!==this._sessionId,"sessionId must not be invalid"),this._logNormal("Disconnecting session..."),this._forbidConnectWhile((function(){e._chartApi.connected()&&e._sendRemoveSession(),e._processDestroyingOnServer()})))},e.prototype.onMessage=function(e){switch(e.method){case"connected":return void this._onChartApiConnected();case"disconnected":return void this._onChartApiDisconnected();case"critical_error":var t=String(e.params[0]),i=String(e.params[1]) ;return void this._onCriticalError(t,i)}this._onMessage(e)},e.prototype._getChartApi=function(){return this._chartApi},e.prototype._generateLogMessage=function(e){return"["+this._sessionId+"] "+e},e.prototype._onCriticalError=function(e,t){var i=this;this._logError("Critical error. Reason="+e+", info="+t+"."),this._forbidConnectWhile((function(){i._processDestroyingOnServer()})),this._shouldReconnectAfterCriticalError?(this._logNormal("Reconnecting after critical error..."),this.connect()):this._logNormal("Reconnecting after critical error skipped")},e.prototype._onChartApiConnected=function(){Object(s.assert)(1===this._state,"Session is not registered"),this._logNormal("Transport is connected. Creating session on the server"),this._sendCreateSession(),this._state=2,this._isConnected.setValue(!0)},e.prototype._onChartApiDisconnected=function(){var e=this;this._logNormal("Transport is disconnected. Reconnecting..."),this._forbidConnectWhile((function(){e._processDestroyingOnServer()})),this.connect()},e.prototype._setSessionId=function(e){var t=this._sessionId;this._logNormal("Changing sessionId: old="+t+", new="+e),this._sessionId=e,this._sessionIdChanged.fire(e,t)},e.prototype._logNormal=function(e){h.logNormal(this._generateLogMessage(e))},e.prototype._logError=function(e){h.logError(this._generateLogMessage(e))},e.prototype._processDestroyingOnServer=function(){this._state=0,this._isConnected.setValue(!1),this._chartApi.removeSession(this._sessionId),this._setSessionId("")},e.prototype._forbidConnectWhile=function(e){this._isConnectForbidden=!0,e(),this._isConnectForbidden=!1},e}();i.d(t,"ChartSession",(function(){return p}));Object(u.getLogger)("ChartSession");var p=function(e){function t(t,i){void 0===i&&(i=!1);var n=e.call(this,t,"cs",!1)||this;return n._sessionDisabled=!1,n._handler=null,n._criticalError=new o.a,n._disableStatistics=i,n}return Object(n.c)(t,e),t.prototype.destroy=function(){this._criticalError.destroy(),this._handler=null,e.prototype.destroy.call(this)},t.prototype.serverTimeOffset=function(){return this._getChartApi().serverTimeOffset()},t.prototype.switchTimezone=function(e){return this._getChartApi().switchTimezone(this.sessionId(),e)},t.prototype.defaultResolutions=function(){return this._getChartApi().defaultResolutions()},t.prototype.availableCurrencies=function(){return this._getChartApi().availableCurrencies()},t.prototype.resolveSymbol=function(e,t,i){return this._getChartApi().resolveSymbol(this.sessionId(),e,t,i)},t.prototype.requestFirstBarTime=function(e,t,i){return this._getChartApi().requestFirstBarTime(this.sessionId(),e,t,i)},t.prototype.createSeries=function(e,t,i,n,r,o,s){return this._getChartApi().createSeries(this.sessionId(),e,t,i,n,r,o,s)},t.prototype.modifySeries=function(e,t,i,n,r,o){return this._getChartApi().modifySeries(this.sessionId(),e,t,i,n,r,o)},t.prototype.removeSeries=function(e,t){return!!this.isConnected().value()&&this._getChartApi().removeSeries(this.sessionId(),e,t)},t.prototype.requestMoreData=function(e,t,i){ return this._getChartApi().requestMoreData(this.sessionId(),e,t,i)},t.prototype.requestMoreTickmarks=function(e,t,i){return this._getChartApi().requestMoreTickmarks(this.sessionId(),e,t,i)},t.prototype.requestMetadata=function(e,t){var i=this;i._getChartApi().requestMetadata(i.sessionId(),e,t)},t.prototype.isCanCreateStudy=function(e){return this._getChartApi().isCanCreateStudy(e)},t.prototype.createStudy=function(e,t,i,n,r,o,s){return this._getChartApi().createStudy(this.sessionId(),e,t,i,n,r,o,s)},t.prototype.rebindStudy=function(e,t,i,n,r,o,s){return this._getChartApi().rebindStudy(this.sessionId(),e,t,i,n,r,o,s)},t.prototype.modifyStudy=function(e,t,i,n){return this._getChartApi().modifyStudy(this.sessionId(),e,t,i,n)},t.prototype.removeStudy=function(e,t,i){return this._getChartApi().removeStudy(this.sessionId(),e,t,i)},t.prototype.createPointset=function(e,t,i,n,r,o){return this._getChartApi().createPointset(this.sessionId(),e,t,i,n,r,o)},t.prototype.modifyPointset=function(e,t,i,n){return this._getChartApi().modifyPointset(this.sessionId(),e,t,i,n)},t.prototype.removePointset=function(e){return this._getChartApi().removePointset(this.sessionId(),e)},t.prototype.setVisibleTimeRange=function(e,t,i,n,r){this._getChartApi().setVisibleTimeRange(e,this.sessionId(),t,i,n,r)},t.prototype.criticalError=function(){return this._criticalError},t.prototype.connect=function(t){void 0===t&&(t=null),null!==t&&(this._handler=t),e.prototype.connect.call(this)},t.prototype.setHandler=function(e){this._handler=e},t.prototype.connected=function(){return this.isConnected().value()&&!this._sessionDisabled},t.prototype.disable=function(){this._sessionDisabled=!0},t.prototype.chartApi=function(){return this._getChartApi()},t.prototype._sendCreateSession=function(){var e=this;Object.keys(this).forEach((function(t){/^(s|st|symbol_)\d+$/.test(t)&&delete e[t]})),this._getChartApi().chartCreateSession(this.sessionId(),this._disableStatistics)},t.prototype._sendRemoveSession=function(){this._getChartApi().chartDeleteSession(this.sessionId())},t.prototype._onMessage=function(e){this._handler&&this._handler(e)},t.prototype._onCriticalError=function(t,i){this._criticalError.fire(t,i),e.prototype._onCriticalError.call(this,t,i)},t}(d)},"0Pxc":function(e,t,i){"use strict";var n=i("aO4+").Point,r=i("GEp6").distanceToLine,o=i("hfHJ"),s=o.rotationMatrix,a=o.scalingMatrix,l=o.translationMatrix,c=o.transformPoint,u=i("Ss5c").LineDataSource,h=i("Ocx9").DefaultProperty,d=i("j3hX").LineToolColorsProperty;function p(e,t){var n=t||p.createProperties();u.call(this,e,n),this.version=p.version,i.e("lt-pane-views").then(function(e){var t=i("dKqZ").ArcPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(p,u),p.prototype.startChanging=function(e,t){if(u.prototype.startChanging.call(this,e,t),0===e||1===e){var i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],s=this.pointToScreenPoint(this._points[2])[0];this._dist=r(i,o,s).distance ;var a=o.subtract(i),l=new n(-a.y,a.x),c=i.add(o).scaled(.5);s.subtract(c).dotProduct(l)<0&&(this._dist=-this._dist)}},p.prototype.pointsCount=function(){return 3},p.prototype.name=function(){return"Arc"},p.prototype.hasEditableCoordinates=function(){return!1},p.prototype.setPoint=function(e,t){var i=Object.assign({},t),o=this.pointToScreenPoint(this._points[0])[0],u=this.pointToScreenPoint(this._points[1])[0],h=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:o=this.pointToScreenPoint(i)[0];var d=u.subtract(o),p=o.add(u).scaled(.5);_=(_=new n(-d.y,d.x)).normalized(),h=p.add(_.scaled(this._dist)),h=this.screenPointToPoint(h),this._points[0]=i,this._points[2]=h;break;case 1:var f=r(o,u,h).distance;d=(u=this.pointToScreenPoint(i)[0]).subtract(o),p=o.add(u).scaled(.5);_=(_=new n(-d.y,d.x)).normalized(),h=p.add(_.scaled(this._dist)),h=this.screenPointToPoint(h),this._points[1]=i,this._points[2]=h;break;case 2:i=this.pointToScreenPoint(i)[0];var _;f=r(o,u,i).distance,d=u.subtract(o),p=o.add(u).scaled(.5);_=(_=new n(-d.y,d.x)).normalized(),h=p.add(_.scaled(f));var m=p.add(_.scaled(-f)),v=d.length(),y=d.x/v,g=d.y/v,b=Math.acos(y);g<0&&(b=-b);var S=l(-p.x,-p.y);i=c(S,i);var w=c(S,h);S=s(-b),i=c(S,i),w=c(S,w),S=a(1,v/(2*f)),i=c(S,i),w=c(S,w);var P=i.y*w.y>=0?new n(h.x,h.y):new n(m.x,m.y);P=this.screenPointToPoint(P),this._points[2]=P}this.normalizePoints()},p.version=2,p.prototype.migrateVersion=function(e,t,i){if(1===e&&2===this._points.length){var n=(2*this._points[0].price+3*this._points[1].price)/5;this._points.append({price:n,index:this._points[1].index})}if(1===e&&2===this._timePoint.length){var r={price:n=(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t};this._timePoint.append(r)}},p.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Zd1D").GeneralFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},p.createProperties=function(e){var t=new h("linetoolarc",e);return p._configureProperties(t),t},p._configureProperties=function(e){u._configureProperties(e),e.addChild("linesColors",new d([e.color]))},t.LineToolArc=p},"0YCj":function(e,t,i){"use strict";(function(e,t){i("Eyy1").assert;var n=i("txPx").getLogger("Chart.Study.MetaInfo"),r=i("9iCb").applyOverridesToStudyDefaults,o=null;function s(e){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}}),TradingView.merge(this,e);var t=e.fullId||e.id;TradingView.merge(this,s.parseIdString(t)),this.name=this.id}s.VERSION_STUDY_ARG_SOURCE=41,s.METAINFO_FORMAT_VERSION_SOS_V2=42,s.VERSION_PINE_PROTECT_TV_4164=43,s.CURRENT_METAINFO_FORMAT_VERSION=52,s.VERSION_NEW_STUDY_PRECISION_FORMAT=46,s.CHILD_STUDY_ALLOWED_PLOT_TYPES=["line"],s.canPlotBeSourceOfChildStudy=function(e){return s.CHILD_STUDY_ALLOWED_PLOT_TYPES.includes(e)},s.CHILD_STUDY_EXCLUDE_IDS=["CorrelationCoefficient@tv-basicstudies","Correlation - Log@tv-basicstudies-1"],s.CHILD_STUDY_PARENT_EXCLUDE_IDS=[], s.FilledArea={},s.FilledArea.TYPE_PLOTS="plot_plot",s.FilledArea.TYPE_HLINES="hline_hline",s.versionOf=function(e){var t="_metainfoVersion"in e&&isNumber(e._metainfoVersion)?e._metainfoVersion:0;return t<0&&n.logError("Metainfo format version cannot be negative: "+t),t},s.parseIdString=function(e){var t={};if(-1===e.indexOf("@"))t.shortId=e,t.packageId="tv-basicstudies",t.id=e+"@"+t.packageId,t.version=1;else{var i=e.split("@");t.shortId=i[0];var n=i[1].split("-");if(3===n.length)t.packageId=n.slice(0,2).join("-"),t.id=t.shortId+"@"+t.packageId,t.version=n[2];else if(1===n.length&&"decisionbar"===n[0])t.packageId="les-"+n[0],t.id=t.shortId+"@"+t.packageId,t.version=1;else{if(1!==n.length)throw new Error("unexpected study id:"+e);t.packageId="tv-"+n[0],t.id=t.shortId+"@"+t.packageId,t.version=1}}if(t.fullId=t.id+"-"+t.version,"tv-scripting"===t.packageId){var r=t.shortId;if(0===r.indexOf("Script$")||0===r.indexOf("StrategyScript$")){var o=r.indexOf("_");t.productId=o>=0?r.substring(0,o):t.packageId}else t.productId=t.packageId}else t.productId=t.packageId;return t},s.getPackageName=function(e){return(/^[^@]+@([^-]+-[^-]+)/.exec(e||"")||[0,"tv-basicstudies"])[1]},s.cutDollarHash=function(e){var t=e.indexOf("$"),i=e.indexOf("@");return-1===t?e:e.substr(0,t)+(i>=0?e.substr(i):"")},s.hasUserIdSuffix=function(e){return/^USER;[\d\w]+;\d+$/.test(e)},s.isStandardPine=function(e){return/^(Strategy)?Script\$STD;.*@tv-scripting$/.test(e)},s.getSourceIdByInputs=function(e,t){if(!Array.isArray(e)||!t)return null;for(var i=0;i0){var l=a.replace(/^[^\$]+/,i);n.inputs[o.id].setValue(l)}}}},s.patchChildStudyMetaInfoState=function(e){e.state&&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])}(e.state.inputs),e.state.isChildStudy=!0},s.prototype.parseValue=function(e,t){return"bool"===e?TradingView.parseBool(t):t},s.prototype.defaultInputs=function(){for(var e=[],t=0;t0?e[0].id:null},s.prototype.createDefaults=function(){if(this.defaults){var e=TradingView.clone(this.defaults);e.precision="default";var t=s.getStudyPropertyRootName(this);defaults.create(t,e)}},s.prototype.removeDefaults=function(){ defaults.remove(s.getStudyPropertyRootName(this))},s.findStudyMetaInfoByDescription=function(e,t){if(e){for(var i=0;ii&&(s=e,o=t)}for(var l=new n(e,t),c=this._pane.state(),u=r.length-1;u>=0;--u){var h=r[u],d=h.priceAxisViews(c,this._priceScale);if(d&&0!==d.length)for(var p=d.length-1;p>=0;--p){var f=d[p].renderer();if(null!==f&&void 0!==f.hitTest){var _=f.hitTest(l,this._size.w,this._isLeft?"left":"right");null!==_&&a(_,h)}}}return o},I.prototype._setCursorClassName=function(e){var t="";e&&(t="price-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._cell.classList.remove(this._currentCursorClassName),t&&this._cell.classList.add(t),this._currentCursorClassName=t)},I.prototype._mouseClickOrTapEvent=function(e){var t=this.dataSourceAtPoint(e.localX,e.localY);t&&this._pane.chart().model().selectionMacro((function(e){e.selection().isSelected(t)||(e.clearSelection(),e.addSourceToSelection(t))}))},I.prototype.mouseClickEvent=function(e){this._mouseClickOrTapEvent(e)},I.prototype.tapEvent=function(e){this._mouseClickOrTapEvent(e)},I.prototype._mouseOrTouchMoveEvent=function(e){this._priceScale&&(this.dataSourceAtPoint(e.localX,e.localY)?this._setCursorClassName("pointer"):this._setResizeCursor())},I.prototype.mouseMoveEvent=function(e){this._mouseOrTouchMoveEvent(e)},I.prototype._zoomAvailable=function(){return!this.priceScale().isEmpty()&&this._pane.chart().model().model().zoomEnabled()&&this._options.pressedMouseMoveScale},I.prototype._mouseDownOrTouchStartEvent=function(e){if(this._zoomAvailable()){var t=this._pane.chart().model(),i=this._pane.state();this._mousedown=!0,t.startScalePrice(i,this.priceScale(),e.localY)}}, I.prototype.mouseDownEvent=function(e){this._mouseDownOrTouchStartEvent(e)},I.prototype.touchStartEvent=function(e){this._mouseOrTouchMoveEvent(e),this._mouseEnterOrTouchStartEvent(e),this._mouseDownOrTouchStartEvent(e)},I.prototype._pressedMouseOrTouchMoveEvent=function(e){if(this._zoomAvailable()){var t=this._pane.chart().model(),i=this._pane.state(),n=this.priceScale();t.scalePriceTo(i,n,e.localY)}},I.prototype.pressedMouseMoveEvent=function(e){this._pressedMouseOrTouchMoveEvent(e)},I.prototype.touchMoveEvent=function(e){this._pressedMouseOrTouchMoveEvent(e)},I.prototype.mouseDownOutsideEvent=function(e){if(this._zoomAvailable()&&this._pane.hasState()){var t=this._pane.chart().model(),i=this._pane.state(),n=this.priceScale();this._mousedown&&(this._mousedown=!1,t.endScalePrice(i,n),this.restoreDefaultCursor())}},I.prototype._mouseUpOrTouchEndEvent=function(e){if(this._zoomAvailable()){var t=this._pane.chart().model(),i=this._pane.state(),n=this.priceScale();this._mousedown=!1,t.endScalePrice(i,n),this.restoreDefaultCursor()}},I.prototype.mouseUpEvent=function(e){this._mouseUpOrTouchEndEvent(e)},I.prototype.touchEndEvent=function(e){this._mouseLeaveOrTouchEndEvent(e),this._mouseUpOrTouchEndEvent(e)},I.prototype._mouseEnterOrTouchStartEvent=function(e){this._setResizeCursor()},I.prototype.mouseEnterEvent=function(e){this._mouseEnterOrTouchStartEvent(e)},I.prototype._mouseLeaveOrTouchEndEvent=function(e){this._setCursorClassName("")},I.prototype.mouseLeaveEvent=function(e){this._mouseLeaveOrTouchEndEvent(e)},I.prototype._setResizeCursor=function(){this._priceScale.isPercentage()||this._priceScale.isIndexedTo100()?this._setCursorClassName(""):this._zoomAvailable()&&this._setCursorClassName("ns-resize")},I.prototype._initActions=function(e){if(this._pane.hasState()&&null===this.actions){this.actions={};var t=this,n=this._pane.chart().model();this.actions.reset=new a({label:window.t("Reset Price Scale"),icon:i("LdoW"),shortcut:"Alt+R",shortcutHint:r.humanReadableHash(r.Modifiers.Alt+82),statName:"ResetScale",onExecute:I.prototype.reset.bind(this)}),this.actions.setAutoScale=new a({label:window.t("Auto (Fits Data To Screen)"),checkable:!0,checked:!0,statName:"ToggleAutoScale",onExecute:function(){n.togglePriceScaleAutoScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.setPercentage=new a({label:window.t("Percent",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isPercentage(),statName:"TogglePercantage",onExecute:function(){n.togglePriceScalePercentageScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.setIndexedTo100=new a({label:window.t("Indexed to 100",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isIndexedTo100(),statName:"ToggleIndexedTo100",onExecute:function(){n.togglePriceScaleIndexedTo100ScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.setLog=new a({label:window.t("Logarithmic",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isLog(),statName:"ToggleLogScale",onExecute:function(){ n.togglePriceScaleLogScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.setRegular=new a({label:window.t("Regular",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isRegular(),statName:"ToggleRegularScale",onExecute:function(){n.setPriceScaleRegularScaleMode(t.priceScale()),t._updateScalesActions()}}),this.actions.alignLabels=new a({label:window.t("No Overlapping Labels",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePreciseLabels"}),this.actions.alignLabels.binding=new g(this.actions.alignLabels,this.priceScale().properties().alignLabels,this._pane.chart().model(),"No Overlapping Labels"),this.actions.invertScale=new a({label:window.t("Invert Scale",{context:"scale_menu"}),checkable:!0,checked:this.priceScale().isInverted(),statName:"Invert Scale",onExecute:function(){n.invertPriceScale(t.priceScale()),t._updateScalesActions()}}),this._updateScalesActions()}},I.prototype._logAction=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().logSeriesScale:this.actions.setLog},I.prototype._percentageAction=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().percentSeriesScale:this.actions.setPercentage},I.prototype._indexedTo100Action=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().indexedTo100SeriesScale:this.actions.setIndexedTo100},I.prototype._autoScaleAction=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().autoSeriesScale:this.actions.setAutoScale},I.prototype._regularScaleAction=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().regularSeriesScale:this.actions.setRegular},I.prototype._lockScaleAction=function(){var e=this._pane.chart().actions().lockSeriesScale,t=O(this.priceScale(),this._pane.chart().model().model().mainSeriesScaleRatio());return e.update({hint:t}),e},I.prototype._invertAction=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().invertSeriesScale:this.actions.invertScale},I.prototype._isMainSeriesAxis=function(){return this.priceScale().hasMainSeries()},I.prototype._updateMainSeriesScalesActions=function(){this._isMainSeriesAxis()&&null!==this.actions&&this._updateScalesActions()},I.prototype._updateScalesActions=function(){var e=this.priceScale(),t=this._isMainSeriesAxis(),i=e.mainSource().properties(),n=t&&e.isLockScale(),r=t&&i.style.value()===TradingView.Series.STYLE_PNF;this.actions.setRegular.update({checked:e.isRegular(),disabled:n||r}),this.actions.setPercentage.update({checked:e.isPercentage(),disabled:n||r}),this.actions.setIndexedTo100.update({checked:e.isIndexedTo100(),disabled:n||r}),this.actions.setLog.update({checked:e.isLog(),disabled:n||r}),this.actions.setAutoScale.update({checked:e.isAutoScale(),disabled:e.properties().autoScaleDisabled.value()})},I.prototype._mouseDoubleClickOrDoubleTapEvent=function(e){var t=this.dataSourceAtPoint(e.localX,e.localY);t?this._pane.processDoubleClickOnSource(t):(this.reset(),y("GUI","Double click price scale"))},I.prototype.mouseDoubleClickEvent=function(e){ this._mouseDoubleClickOrDoubleTapEvent(e)},I.prototype.doubleTapEvent=function(e){this._mouseDoubleClickOrDoubleTapEvent(e)},I.prototype._contextMenuOrTouchContextMenuEvent=function(e){if(this._options.contextMenuEnabled){var t=this.dataSourceAtPoint(e.localX,e.localY);if(null!==t&&this._options.contextMenu.source)return void this._pane.chart().model().selectionMacro(function(i){i.selection().isSelected(t)||(i.clearSelection(),i.addSourceToSelection(t)),this._pane.showContextMenuForSelection(e)}.bind(this));this._options.contextMenu.general&&this._createContextMenu().then((function(t){t.show(e)}))}},I.prototype.contextMenuEvent=function(e){this._contextMenuOrTouchContextMenuEvent(e)},I.prototype.touchContextMenuEvent=function(e){this._contextMenuOrTouchContextMenuEvent(e)},I.prototype._createContextMenu=function(){return c.createMenu(this.getContextMenuActions(),{statName:"PriceScaleContextMenu"})},I.prototype._createMergeScalesAction=function(){var e=this._pane.chart().actions(),t=this._pane.chart().model().model().priceScaleSlotsCount();if(t.left+t.right===1)return 0===t.left?e.moveScaleToLeft:e.moveScaleToRight;var i=[];return i.push(e.mergeLeftScalesAction),i.push(e.mergeRightScalesAction),new a({label:x,subItems:i})},I.prototype.getContextMenuActions=function(){this._initActions();var e=this._pane.chart().actions(),t=[];if(t.push(this.actions.reset,new l,this._autoScaleAction()),this._isMainSeriesAxis()&&t.push(this._lockScaleAction()),t.push(e.scaleSeriesOnly,this._invertAction(),new l,this._regularScaleAction(),this._percentageAction(),this._indexedTo100Action(),this._logAction(),new l),o.any()||(t.push(this._createMergeScalesAction()),t.push(new l)),!T.enabled("fundamental_widget")){t.push(new a({label:window.t("Labels"),subItems:[e.showSymbolLabelsAction,e.showSeriesLastValue,null,null,e.showHighLowPriceLabels,e.showAverageClosePriceLabel,null,e.showStudyPlotNamesAction,e.showStudyLastValue,null,null,this.actions.alignLabels].filter(Boolean)}))}return t.push(S(this._pane.chart())),T.enabled("countdown")&&t.push(e.showCountdown),this._options.currencyConversionEnabled&&t.push(e.showCurrency),this._pane.chart().model().crossHairSource().isMenuEnabled()&&t.push(e.addPlusButton),!TradingView.onWidget()&&T.enabled("show_chart_property_page")&&T.enabled("chart_property_page_scales")&&e.scalesProperties&&t.push(new l,e.scalesProperties),t},I.prototype._sameSideSources=function(){var e=this._pane.state().sourcesByGroup();return this._isLeft?e.leftPriceScalesSources():e.rightPriceScalesSources()},I.prototype._grouppedSources=function(){var e=this._pane,t=e.chart().model(),i=this._sameSideSources().slice(),n=e.state(),r=this.priceScale(),o=new Set,s=t.lineBeingEdited()||t.lineBeingCreated();if(s&&o.add(s),t.sourcesBeingMoved().forEach((function(e){o.add(e)})),t.selection().allSources().forEach((function(e){o.add(e)})),t.hoveredSource()&&o.add(t.hoveredSource()),r===n.defaultPriceScale())for(var a=this._pane.state().dataSources(),l=0;l0&&this._hightlightBackground(e,c,this.priceScale().mainSource(),t);var u=a.model().crossHairSource();u.startMeasurePoint()&&this._hightlightBackground(e,u.measurePoints(),this.priceScale().mainSource(),t)},I.prototype.drawBorder=function(e,t){e.save(),e.fillStyle=this.lineColor();var i,n=Math.max(1,Math.floor(this.rendererOptions().borderSize*t));i=this._isLeft?Math.floor(this._size.w*t)-n:0,e.fillRect(i,0,n,Math.ceil(this._size.h*t)+1),e.restore()},I.prototype.drawTickMarks=function(e,t){var i=this.priceScale().marks();e.save(),e.setFont(this.baseFont());var n=this.rendererOptions(),r=this._isLeft?Math.floor((this._size.w-n.tickLength-n.borderSize)*t):Math.floor(n.borderSize*t),o=this._isLeft?Math.round(r-n.paddingInner*t):Math.round(r+(n.tickLength+n.paddingInner)*t),s=this._isLeft?"right":"left",a=Math.round(n.tickLength*t),l=Math.max(1,Math.floor(t)),c=Math.floor(.5*t),u=0!==i.length?this._tickmarksCache.getLabelHeight(e,i[0].label):0,h=this._isCurrencyLabelVisible()?this._currencyLabelLineHeight()+this._currencyLabel.labelTop():0,d=i.map((function(e){if(this._options.croppedTickMarks)return!0;var t=e.coord-u/2 ;return!(e.coord+u/2>this._size.h||t0&&(e=a[0].floatCoordinate())}}}u.forEach((function(e){h.add(e)})),d(n),d(this._pane.state().customSources());var p=t.filter((function(t){return t.floatCoordinate()<=e})),f=t.filter((function(t){return t.floatCoordinate()>e}));p.sort((function(e,t){return t.floatCoordinate()-e.floatCoordinate()})),p.length&&f.length&&f.push(p[0]),f.sort((function(e,t){return e.floatCoordinate()-t.floatCoordinate()}));var _=t.length;for(a=0;a<_;a++){(v=t[a]).setFixedCoordinate(v.coordinate())}var m=this.priceScale().properties();if(m.alignLabels&&m.alignLabels.value()){for(a=1;ab-y&&v.setFixedCoordinate(b-y)}for(var S=1;S=l)&&(o={value:l,view:a})}})),r.view&&n.push(r.view),o.view&&n.push(o.view),n},I.prototype._isFromSameSide=function(e){return(this._isLeft?this._pane.state().leftPriceScales():this._pane.state().rightPriceScales()).includes(e)},I.prototype._addViewsOrMaxMin=function(e,t){var i=this._pane.state(),n=this.priceScale();if(n!==i.defaultPriceScale()&&(e=e.filter(function(e){return i.isOverlay(e)||this._isFromSameSide(e.priceScale())}.bind(this))),0!==e.length)if(1===e.length){var r=e[0].priceAxisViews(i,n);r&&r.length&&t.push(r)}else t.push(this._minMaxViews(e))},I.prototype.drawCrossHairLabel=function(e,t){e.save() ;var i=this._pane.chart().model().model(),n=this._pane.state(),r=this.priceScale(),o=[],s=this._pane.state(),a=this.priceScale()===n.defaultPriceScale(),l=i.lineBeingEdited()||i.lineBeingCreated();l&&(l.priceScale()===r||a&&n.isOverlay(l))&&((u=l.priceAxisViews(s,r))&&u.length&&o.push(u));this._addViewsOrMaxMin(i.sourcesBeingMoved(),o),this._addViewsOrMaxMin(i.selection().allSources(),o);var c=i.hoveredSource();if(c){var u,h=n.customSources().includes(c)?r:c.priceScale();if(!i.selection().isSelected(c)&&(this._isFromSameSide(h)||a&&n.isOverlay(c)))(u=i.hoveredSource().priceAxisViews(s,r))&&u.length&&o.push(u)}(u=i.crossHairSource().priceAxisViews(s,r))&&u.length&&o.push(u);var d=this.rendererOptions(),p=this._isLeft?"right":"left";o.forEach((function(i){i.forEach((function(i){e.save(),i.renderer().draw(e,d,this._widthCache,this._size.w,p,t),e.restore()}),this)}),this),e.restore()},I.prototype.setAutoScale=function(e){var t=this._pane.state(),i=this.priceScale();this._pane.chart().model().setPriceAutoScale(t,i,e)},I.prototype.reset=function(){var e=this._pane.state(),t=this.priceScale();this._pane.chart().model().resetPriceScale(e,t)},I.prototype.hardResetCanvas=function(){null!==this._size&&(p(this._canvasBinding,this._size),p(this._topCanvasBinding,this._size))},I.prototype._isMainPane=function(){return this._pane.state().containsMainSeries()},I.prototype.paint=function(e){if(this._isVisible&&e!==u.None){if(e>u.Cursor){var t=d(this._canvasBinding.canvas);this._alignLabels(),this.drawBackground(t,this._canvasBinding.pixelRatio),this.drawBorder(t,this._canvasBinding.pixelRatio),this._pane.hasState()&&(this._updateCurrencyLabel(),this.drawTickMarks(t,this._canvasBinding.pixelRatio),this.drawBackLabels(t,this._canvasBinding.pixelRatio))}if(this._pane.hasState()){var i=d(this._topCanvasBinding.canvas),n=this._topCanvasBinding.pixelRatio;i.clearRect(0,0,Math.ceil(this._size.w*n)+1,Math.ceil(this._size.h*n)+1),this.drawCrossHairLabel(i,n)}}},I.prototype.restoreDefaultCursor=function(){this.setCursor("")},I.prototype.setCursor=function(e){var t="";"grabbing"!==e&&"ns-resize"!==e||(t="price-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._cell.classList.remove(this._currentCursorClassName),t&&this._cell.classList.add(t),this._currentCursorClassName=t,this._cell.style.cursor)},I.prototype.axisInfo=function(){return this._axisInfo},I.prototype.setHighlighted=function(e){this._highlighted!==e&&(this._highlighted=e)};var O=L(4);e.exports={PriceAxisWidget:I,scaleRatioForContextMenuTransformer:L}},"1Wlv":function(e,t,i){"use strict";(function(e){var n=i("Yj6H").PriceScaleBase,r=i("Ss5c").LineDataSource,o=i("7ktv").PriceDataSource,s=i("kcTO").PriceFormatter,a=i("GH0z").PercentageFormatter,l=i("Qb4w").PriceRange,c=i("e3/o").randomHash,u=i("s1Gx").sortSources,h=i("3ClC").isStudy,d=i("lTLF").PriceTickMarkBuilder,p=i("TTFo"),f=p.fromPercent,_=p.toPercent,m=p.fromIndexedTo100,v=p.toIndexedTo100,y=p.fromLog,g=p.toLog,b=new a,S=new s(100,1);function w(t,i){n.call(this,i),this._scalesProperties=t, this._priceRangeChanged=new e,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_maxPriceRange=null,this.m_minPriceRange=null,this.m_priceRangeSnapshot=null;var r=this;this._coordinateToLogicalFunc=function(e,t){return r._coordinateToLogical(e,t)},this._logicalToCoordinateFunc=function(e,t){return r._logicalToCoordinate(e,t)},this.m_markBuilder=new d(this,100,this._coordinateToLogicalFunc,this._logicalToCoordinateFunc),this._modeChanged=new e,this._properties.isInverted.listeners().subscribe(this,w.prototype._onIsInvertedChanged),this._properties.listeners().subscribe(null,(function(){if(r.mainSource()&&r.mainSource().model()){var e=r.mainSource().model().paneForSource(r.mainSource());r.mainSource().model().updatePane(e)}})),this._scalesProperties.listeners().subscribe(this,(function(){this._marksCache=null})),this.setId(c())}inherit(w,n),w.prototype.id=function(){return this._id},w.prototype.setId=function(e){this._id=e},w.prototype._convertPriceRangeFromLog=function(e){if(null===e)return null;var t=y(e.minValue()),i=y(e.maxValue());return new l(t,i)},w.prototype._convertPriceRangeToLog=function(e){if(null===e)return null;var t=g(e.minValue()),i=g(e.maxValue());return new l(t,i)},w.prototype._canConvertPriceRangeFromLog=function(e){if(null===e)return!1;var t=y(e.minValue()),i=y(e.maxValue());return isFinite(t)&&isFinite(i)},w.prototype.mode=function(){return{autoScale:this._properties.autoScale.value(),lockScale:this._properties.lockScale.value(),percentage:this._properties.percentage.value(),indexedTo100:this._properties.indexedTo100.value(),log:this._properties.log.value()}},w.prototype.setMode=function(e){var t={},i=this.mode(),n=this._properties.state(),r=null;void 0!==e.autoScale&&e.autoScale!==n.autoScale&&(t.autoScale=e.autoScale,this._setAutoScaleValueWithDependentProperties(e.autoScale)),void 0!==e.lockScale&&e.lockScale!==n.lockScale&&(t.lockScale=e.lockScale,this._setLockScaleValueWithDependentProperties(e.lockScale)),void 0!==e.percentage&&e.percentage!==n.percentage&&(t.percentage=e.percentage,this._setPercentageValueWithDependentProperties(e.percentage),this._invalidatedForRange.isValid=!1),void 0!==e.indexedTo100&&e.indexedTo100!==n.indexedTo100&&(t.indexedTo100=e.indexedTo100,this._setIndexedTo100ValueWithDependentProperties(e.indexedTo100),this._invalidatedForRange.isValid=!1),void 0!==e.log&&e.log!==n.log&&(t.log=e.log,this._setLogValueWithDependentProperties(e.log)),n.log&&!this._properties.log.value()&&(this._canConvertPriceRangeFromLog(this.m_priceRange)?null!==(r=this._convertPriceRangeFromLog(this.m_priceRange))&&this.setPriceRange(r):this.properties().autoScale.setValue(!0)),!n.log&&this._properties.log.value()&&null!==(r=this._convertPriceRangeToLog(this.m_priceRange))&&this.setPriceRange(r),n.autoScale!==this._properties.autoScale.value()&&this._properties.autoScale.listeners().fire(this._properties.autoScale),n.autoScaleDisabled!==this._properties.autoScaleDisabled.value()&&this._properties.autoScaleDisabled.listeners().fire(this._properties.autoScaleDisabled), n.lockScale!==this._properties.lockScale.value()&&this._properties.lockScale.listeners().fire(this._properties.lockScale),n.percentage!==this._properties.percentage.value()&&(this._properties.percentage.listeners().fire(this._properties.percentage),this.updateFormatter()),n.indexedTo100!==this._properties.indexedTo100.value()&&(this._properties.indexedTo100.listeners().fire(this._properties.indexedTo100),this.updateFormatter()),n.percentageDisabled!==this._properties.percentageDisabled.value()&&this._properties.percentageDisabled.listeners().fire(this._properties.percentageDisabled),n.log!==this._properties.log.value()&&this._properties.log.listeners().fire(this._properties.log),n.logDisabled!==this._properties.logDisabled.value()&&this._properties.logDisabled.listeners().fire(this._properties.logDisabled),void 0===t.log&&void 0===t.percentage&&void 0===t.lockScale&&void 0===t.autoScale&&void 0===t.indexedTo100||this._modeChanged.fire(i,this.mode())},w.prototype.modeChanged=function(){return this._modeChanged},w.prototype.fontSize=function(){return this._scalesProperties.fontSize.value()},w.prototype.priceRangeChanged=function(){return this._priceRangeChanged},w.prototype.setPriceRange=function(e,t,i){if(!(e instanceof l))throw new TypeError("incorrect price range");var n=this.m_priceRange;if(!t&&(null!==n||null===e)&&(null===n||n.equals(e)))return!1;var r=null!==this.m_maxPriceRange&&this.m_maxPriceRange.containsStrictly(e),o=null!==this.m_minPriceRange&&e.containsStrictly(this.m_minPriceRange);if(this.isLockScale()&&!t&&(r||o))return!1;this._marksCache=null,this.m_priceRange=e,i||this._priceRangeChanged.fire(n,e)},w.prototype.isEmpty=function(){return this._makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()},w.prototype.invertedCoordinate=function(e){return this.isInverted()?e:this.height()-1-e},w.prototype.priceToLogical=function(e){return this.isLog()&&e?g(e):e},w.prototype.logicalToPrice=function(e){return this.isLog()?y(e):e},w.prototype._logicalToCoordinate=function(e,t){if(this._makeSureItIsValid(),this.isEmpty())return 0;e=this.priceToLogical(e);var i=this.bottomPixelMargin()+(this.internalHeight()-1)*(e-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue());return this.invertedCoordinate(i)},w.prototype.priceToCoordinate=function(e,t){return this.isPercentage()?e=_(e,t):this.isIndexedTo100()&&(e=v(e,t)),this._logicalToCoordinate(e,t)},w.prototype.pointsArrayToCoordinates=function(e,t){this._makeSureItIsValid();var i=this.bottomPixelMargin(),n=this.priceRange().minValue(),r=this.priceRange().maxValue(),o=this.internalHeight()-1,s=this.isInverted(),a=o/(r-n);if(this.isPercentage())for(var l=0;l'},"2+aH":function(e,t,i){"use strict";(function(e){var n=i("vdSZ").CrosshairDataWindowView,r=i("Hm6r").CrosshairTimeAxisView,o=i("zZ2k").CrosshairBase,s=i("mMWL"),a=i("ogJP").isNaN;function l(t,i,a){var l=this;o.call(this,t,a),this._properties=i,this._dataWindowView=new n(t);var c=function(){return this.appliedIndex()}.bind(this),u=function(){return this._startMeasurePoint.index}.bind(this),h=function(){return this._lastMeasurePoint().index}.bind(this);this._timeAxisView=new r(t,c,!1),this._startMeasureTimeAxisView=new r(t,u,!0),this._endMeasureTimeAxisView=new r(t,h,!0),this.visible=!0,t.readOnly()?this.areLinesVisible=!0:s.cursorTool.subscribe((function(e){l.areLinesVisible="arrow"!==e}),{callWithLast:!0}),this._movedDelegate=new e,this._subscribed=!1,this._barSelectedDelegate=new e}inherit(l,o),l.prototype.index=0,l.prototype.price=NaN,l.prototype.pane=null,l.prototype.color="white",l.prototype.style="",l.prototype.model=function(){return this._model},l.prototype.properties=function(){return this._properties},l.prototype.moved=function(){return this._movedDelegate},l.prototype.originX=function(){return this._originX},l.prototype.originY=function(){return this._originY},l.prototype.saveOriginCoord=function(e,t){this._originX=e,this._originY=t},l.prototype.originCoordX=function(){return this._originX},l.prototype.originCoordY=function(){return this._originY},l.prototype.clearOriginCoord=function(){this._originX=NaN,this._originY=NaN},l.prototype.setPosition=function(e,t,i){ this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,l.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.visible=!0,this._tryToUpdateViews(e,t,i)},l.prototype.selectionPane=function(){return this._selectionPane},l.prototype.update=function(){if(this.visible){var e=this._priceScaleByPane(this.pane),t=this._originX||this.x,i=this._originY||this.y,n=this._model.timeScale().coordinateToIndex(t),r=NaN;if(null!==e){var o=this.pane.mainDataSource().firstValue();r=e.coordinateToPrice(i,o)}this._tryToUpdateViews(n,r,this.pane)}else this._setIndexToLastSeriesBarIndex()},l.prototype._priceScaleByPane=function(e){return e&&!e.defaultPriceScale().isEmpty()?e.defaultPriceScale():null},l.prototype._tryToUpdateViews=function(e,t,i){this._tryToUpdateData(e,t,i)&&(this.updateAllViews(),this._movedDelegate.fire({time:this._model.timeScale().points().roughTime(this.index),price:this.price}))},l.prototype._tryToUpdateData=function(e,t,i){var n=this.x,r=this.y,o=this.price,s=this.index,l=this.pane,c=this._priceScaleByPane(i);if(this.index=e,this.x=a(e)?NaN:this._model.timeScale().indexToCoordinate(e),null!==c){this.pane=i,this.price=t;var u=i.mainDataSource().firstValue();this.y=c.priceToCoordinate(t,u)}else this.pane=null,this.price=NaN,this.y=NaN;return n!==this.x||r!==this.y||s!==this.index||o!==this.price||l!==this.pane},l.prototype.clearPosition=function(){this.visible=!1,this._setIndexToLastSeriesBarIndex(),this.price=NaN,this.x=NaN,this.y=NaN,this.pane=null,this.clearOriginCoord()},l.prototype._setIndexToLastSeriesBarIndex=function(){var e=this._model.mainSeries().bars().lastIndex();this.index=null!==e?e:NaN},l.prototype.dataWindowView=function(){return this._dataWindowView},l.prototype.appliedIndex=function(){return isFinite(this.lockedIndex)&&this.lockedIndex||this.index},l.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x},l.prototype.selectBarMode=function(){return this._selectBarMode},l.prototype.toggleSelectBarMode=function(){this._setSelectBarModeState(!this._selectBarMode.value())},l.prototype.onBarSelected=function(){return this._barSelectedDelegate},l.prototype._setSelectBarModeState=function(e){this._selectBarMode.setValue(e),this._model.lightUpdate()},l.prototype.trySelectCurrentBar=function(){if(this._model.mainSeries().bars().contains(this.index)){var e=this._model.timeScale().indexToTimePoint(this.index);null!==e&&(this._setSelectBarModeState(!1),this._barSelectedDelegate.fire(e))}},l.prototype.handleContextMenuEvent=function(){this._selectBarMode.value()&&this._setSelectBarModeState(!1)},l.prototype.setOnHoveredChartWidget=function(e){this._isOnHoveredChartWidget=e},l.prototype.isOnHoveredChartWidget=function(){return this._isOnHoveredChartWidget},t.CrossHair=l}).call(this,i("aIyQ"))},"22xp":function(e,t,i){"use strict";i.r(t);var n=i("mrSG"),r=i("Eyy1"),o=(i("YFKU"),i("9uLv")),s=i("txPx"),a=i("//lZ"),l=i("aIyQ"),c=i.n(l),u=i("Kxc7"),h=i("Hr11"),d=i("ogJP"),p=i("ZJKN"),f=function(){function e(e,t){ Object(r.assert)(e<=t,"The left value should be greater than or equal to the right value"),this._left=e,this._right=t}return e.prototype.left=function(){return this._left},e.prototype.right=function(){return this._right},e.prototype.length=function(){return this._right-this._left+1},e.prototype.contains=function(e){return this._left<=e&&e<=this._right},e.prototype.equals=function(e){return this._left===e.left()&&this._right===e.right()},e.compare=function(e,t){return null===e||null===t?e===t:e.equals(t)},e}(),_=Object(s.getLogger)("Chart.TimePoints"),m=function(){function e(){this._zoffset=0,this._items=[]}return e.prototype.clear=function(){this._zoffset=0,this._items=[]},e.prototype.size=function(){return this._items.length},e.prototype.firstIndex=function(){return this._offsetToIndex(0)},e.prototype.lastIndex=function(){return this._offsetToIndex(this._items.length-1)},e.prototype.merge=function(e,t,i){if(0===i.length)return _.logError("merge: 'values' does not contain any time points"),[];if(t>this._zoffset&&e+t>0)return _.logError("merge: when the first time point index is updated, we should fill the time points starting from the first one"),[];if(0===this._items.length)return this._items=i,this._zoffset=t,[{change:"rebuild",index:this._validOffsetToIndex(0)}];var n=e+this._zoffset;if(n<0){var r=Math.abs(n);if(i.lengththis._items.length){r=l-this._items.length;for(var c=a;cthis._items[this._items.length-1])return t?this._validOffsetToIndex(this._items.length-1):null;for(var i=0;is?(u=e-s)<500&&null!=t?t(l,u):l+u*c:null},e.prototype.roughIndex=function(e,t){void 0===t&&(t=null);var i=this._items;if(!i.length||i.length<2)return null;var n=i.length-1,r=this._validOffsetToIndex(0),o=this._validOffsetToIndex(n),s=i[0],a=i[n];if(e>=s&&e<=a)return this.closestIndexLeft(e);var l=(a-s)/(o-r);if(ea){var u;c=e-a;if((u=Math.trunc(c/l))<500&&null!==t){var h=t(a,e);h.success&&(u=h.result)}return o+u}return null},e.prototype.closestIndexLeft=function(e){var t=this._items;if(!t.length)return null;if(Number.isNaN(e))return null;var i=t.length-1;if(e>=t[i])return this._validOffsetToIndex(i);var n=0,r=t[n];if(en+1;){var o=n+i>>1,s=t[o];if(s>e)i=o;else{if(!(s0&&this._points.merge(e,t,i),this._tickMarks.merge(n),this._correctOffset()},e.prototype.addTail=function(e,t,i){this._tickMarks.removeTail(t);for(var n=e.params,o=Object(r.ensureDefined)(this._tickMarks.maxIndex)+(i?0:1),s=0;s0&&(i*=this._width/e.width)),this._tryToUpdateBarSpacing(this._barSpacing,i),this._correctOffset()}else A.logDebug("restoreState: invalid state");else A.logDebug("restoreState: invalid state")},e.prototype.marks=function(){if(this.isEmpty())return null ;for(var e=this._barSpacing,t=5*((this._scalesProperties.childs().fontSize.value()||0)+4),i=Math.round(t/e),n=Object(r.ensureNotNull)(this.visibleBarsStrictRange()),o=Math.max(n.firstBar(),n.firstBar()-i),s=Math.max(n.lastBar(),n.lastBar()-i),a=[],l=0,c=this._tickMarks.build(e,t);l=P.DAY_SPAN})}}return a},e.prototype.visibleBarsStrictRange=function(){return this._visibleBarsInvalidated&&(this._visibleBarsInvalidated=!1,this._updateVisibleBars()),this._visibleBars.strictRange()},e.prototype.visibleBarsStrictRangeChanged=function(){return this._visibleBarsChanged},e.prototype.logicalRangeChanged=function(){return this._logicalRangeChanged},e.prototype.tickMarks=function(){return this._tickMarks},e.prototype.points=function(){return this._points},e.prototype.width=function(){return this._width},e.prototype.setWidth=function(e){if(!Number.isFinite(e)||e<=0)A.logWarn("setWidth: invalid argument: "+e);else if(this._width!==e){if(this._visibleBarsInvalidated=!0,this._options.lockVisibleTimeRangeOnResize&&this._width){var t=this._barSpacing*e/this._width;this._tryToUpdateBarSpacing(this._barSpacing,t)}if(null!==this._leftEdgeIndex)if(Object(r.ensureNotNull)(this.visibleBarsStrictRange()).firstBar()<=this._leftEdgeIndex){var i=this._width-e;this._rightOffset-=Math.round(i/this._barSpacing)+1}this._width=e,this._widthChanged.fire(e),this._correctOffset()}},e.prototype.setLeftEdgeFix=function(e){this._leftEdgeIndex=e;var t=this.visibleBarsStrictRange();if(null!==t){var i=t.firstBar()-e;if(i<0){var n=this._rightOffset-i-1;this.scrollToOffsetAnimated(n,500)}}},e.prototype.indexToCoordinate=function(e){if(this.isEmpty())return 0;if(!Object(d.isInteger)(e))return 0;var t=this.baseIndex()+this._rightOffset-e;return this._width-(t+.5)*this._barSpacing},e.prototype.indexToUserTime=function(e){return this._tickMarks.indexToTime(e)},e.prototype.timePointToIndex=function(e){return this._points.indexOf(e,!0)},e.prototype.indexToTimePoint=function(e){return this._points.valueAt(e)},e.prototype.timeToCoordinate=function(e){var t=this._points.closestIndexLeft(e);if(null===t)return null;var i=Object(r.ensureNotNull)(this._points.valueAt(t)),n=this.indexToCoordinate(t);if(n<=0||n>=this._width)return null;var o=this.barSpacing(),s=this.baseIndex(),a=n+(e-i)/(Object(r.ensureNotNull)(this._points.valueAt(s))-Object(r.ensureNotNull)(this._points.valueAt(s-1)))*o+1;return a<=0||a>=this._width?null:a},e.prototype.barIndexesToCoordinates=function(e){for(var t=this.baseIndex(),i=0,n=e;i0&&n>s&&(n=s);var l=this._model;Object(a.doAnimate)({from:r,to:n,duration:1e3,easing:o.easingFunc.easeInOutQuint,onComplete:t,onStep:function(e,t){i._visibleBarsInvalidated=!0,i._rightOffset=t,i._correctOffset(),l.recalculateAllPanes(),l.lightUpdate(),l.recalcVisibleRangeStudies()}})}else this._visibleBarsInvalidated=!0,this._rightOffset=n,this._correctOffset(),void 0!==t&&t()},e.prototype.scrollToOffsetAnimated=function(e,t){var i=this;if(!isFinite(e))throw new RangeError("offset is required and must be finite number");var n=void 0===t?400:t;if(!isFinite(n)||n<=0)throw new RangeError("animationDuration (optional) must be finite positive number");var r=this._rightOffset,o=Date.now(),s=function(){i._visibleBarsInvalidated=!0;var t=(Date.now()-o)/n;if(t>=1)return i._rightOffset=e,i._correctOffset(),i._visibleBarsInvalidated=!0,i._model.recalculateAllPanes(),void i._model.lightUpdate();i._rightOffset=r+(e-r)*t,i._correctOffset(),i._model.recalculateAllPanes(),setTimeout(s,20)};s()},e.prototype.defaultRightOffsetProperty=function(){return this._defaultRightOffsetProperty},e.prototype.rightOffsetDefaultValue=function(){return 10},e.prototype.barSpacing=function(){return this._barSpacing},e.prototype.setBarSpacing=function(e){Number.isFinite(e)?(e=this.getValidBarSpacing(e),this._tryToUpdateBarSpacing(this._barSpacing,e)&&(this._correctOffset(),this._options.preserveBarSpacing&&(Object(S.saveDefaultProperties)(!0),this._scalesProperties.childs().barSpacing.setValue(this._barSpacing),Object(S.saveDefaultProperties)(!1)))):A.logWarn("setBarSpacing: invalid argument: "+e)},e.prototype.barSpacingChanged=function(){return this._barSpacingChanged},e.prototype.getValidBarSpacing=function(e){return null==e&&(e=this.barSpacing()),ethis.maxBarSpacing()?this.maxBarSpacing():e},e.prototype.isValidBarSpacing=function(e){return e>=this.minBarSpacing()&&e<=this.maxBarSpacing()},e.prototype.preserveBarSpacing=function(){return this._options.preserveBarSpacing},e.prototype.normalizeBarIndex=function(e){var t=0,i=0,n=this.baseIndex(),o=Object(r.ensureNotNull)(this._points.firstIndex());return en?(t=Object(r.ensureNotNull)(this._points.valueAt(n)),i=e-n):(t=Object(r.ensureNotNull)(this._points.valueAt(e)),i=0),{time_t:t,offset:i}},e.prototype.denormalizeTimePoint=function(e){var t=this._points.indexOf(e.time_t,!1);if(null!==t)return t+e.offset},e.prototype.rightOffset=function(){return this._rightOffset},e.prototype.minRightOffset=function(){var e=this.points().firstIndex(),t=this._baseIndex;if(null===e||null===t)return null;if(null!==this._leftEdgeIndex){var i=this.width()/this._barSpacing ;return this._leftEdgeIndex-t+i-1}return e-t-1+M},e.prototype.maxRightOffset=function(){return this.width()/this._barSpacing-M},e.prototype.maxRightOffsetChanged=function(){return this._maxRightOffsetChanged},e.prototype.onReset=function(){return this._resetDelegate},e.prototype.scrollStartPoint=function(){return this._scrollStartPoint},e.prototype.baseIndex=function(){return this._baseIndex||0},e.prototype.zoom=function(e,t,i){if(Number.isFinite(e)&&Number.isFinite(t)){var n=this.coordinateToIndex(e),r=this.barSpacing(),o=r+t*(r/10);this.setBarSpacing(o),(void 0!==i?!i:this._options.rightBarStaysOnScroll)||this.setRightOffset(this.rightOffset()-.5+(n-this._coordinateToFloatIndex(e)))}else A.logWarn("zoom: invalid arguments: "+e+", "+t+", "+i)},e.prototype.zoomToBarsRange=function(e,t){if(!(t<=e)){var i=this.baseIndex();this._rightOffset=t-i;var n=k.get(this._model.mainSeries().style())||.6,r=Math.max(t-e+n,M);this.setBarSpacing(this.width()/r),this._visibleBarsInvalidated=!0}},e.prototype.coordinateToIndex=function(e){return Math.ceil(this._coordinateToFloatIndex(e))},e.prototype.canZoomIn=function(){return this.barSpacing()O},e.prototype.minBarSpacing=function(){return O},e.prototype.maxBarSpacing=function(){return L?this.width():50},e.prototype.resetRightOffset=function(){this.setRightOffset(this._defaultRightOffsetProperty.value())},e.prototype.reset=function(){this._visibleBarsInvalidated=!0,this._points=new m,this._scrollStartPoint=null,this._scaleStartPoint=null,this._clearCommonTransitionsStartState(),this._tickMarks.reset(),this._leftEdgeIndex=null,this._resetDelegate.fire()},e.prototype.setBaseIndex=function(e){Number.isFinite(e)?(this._visibleBarsInvalidated=!0,this._baseIndex=e,this._correctOffset()):A.logDebug("setBaseIndex: invalid argument: "+e)},e.prototype.setRightOffset=function(e){Number.isFinite(e)?(this._visibleBarsInvalidated=!0,this._rightOffset=e,this._correctOffset()):A.logWarn("setRightOffset: invalid argument: "+e)},e.prototype.correctBarSpacing=function(){this.isEmpty()||this.points().size()e&&(this._rightOffset=e,this._visibleBarsInvalidated=!0);var t=this.minRightOffset();null!==t&&this._rightOffsett[t.length-1].time+i)return null;for(var o=null,s=0,a=t;s=2)&&(Math.max(1,Math.floor(i))%2!=this._barWidth%2&&this._barWidth--);this._barLineWidth=this._thinBars?Math.min(this._barWidth,Math.floor(i)):this._barWidth;for(var n=null,r=this._barLineWidth<=this._barWidth&&this._barSpacing>=Math.floor(1.5*t.pixelRatio),o=0,s=this._bars;o_+v-1&&(w=(P=_+v-1)-h+1),e.fillRect(g,w,S,P-w+1)}var C=Math.max(_,Math.round(a.close*i)-l),T=C+h-1;T>_+v-1&&(C=(T=_+v-1)-h+1),e.fillRect(d+1,C,S,T-C+1)}}e.restore()},e.prototype._calcBarWidth=function(e){var t=Math.floor(e);return Math.max(t,Math.floor(Object(r.optimalBarWidth)(this._barSpacing,e)))},e}()},"2EnG":function(e,t,i){"use strict";i.r(t),i.d(t,"StandardPivotPointsImageCache",(function(){return o}));var n=i("ikwP"),r=i("Eyy1"),o=function(){function e(e,t,i,r){this._priceAxisFontSize=11,this._prices=[],this._labelWidth=0,this._paneRenderParams=e,this._recreateCanvasAndContext(new n.Size(0,0)),this.reset({font:t,fontSize:i,backColors:r})}return e.prototype.destroy=function(){delete this._canvas,delete this._cache},e.prototype.canvas=function(){return this._canvas},e.prototype.reset=function(e){var t=this;this._renderParams=e,this._prices=[],this._cache.font=e.fontSize+"px "+e.font,this._labelWidth=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5","/"].reduce((function(e,i){var n=t._cache.measureText(i).width;return Math.max(n,e)}),0)},e.prototype.rowHeight=function(){return this._priceAxisFontSize+4},e.prototype.labelRectByIndex=function(e){return{left:0,top:Math.round(this._topByIndex(e)),width:Math.round(this._labelWidth+4),height:Math.round(this._renderParams.fontSize+8)}}, e.prototype.setPrices=function(e){var t,i,o,s,a=this,l=!1;if(e.length!==this._prices.length)l=!0;else for(var c=0;c0?(!function(e){return"index"===e.type&&h.includes(e.listed_exchange)}(e)?n.push("DelayToRealtime"):n.push("DelayNoRealtime"),n):function(e,t){return u.a.hasEodSymbols(e.full_name)||t===l.STATUS_EOD}(e,t)?(n.push("EOD"),n):n}var v=function(){function e(e,t,i){this._dataUpdatedModeStatus=new s.a(null),this._symbolInfo=Object(a.a)(e.getter,e.onChange),this._status=Object(a.a)(t.getter,t.onChange),this._symbolInfo.subscribe(this._update.bind(this)),this._status.subscribe(this._update.bind(this)),this._resetSubscription=i,this._resetSubscription.subscribe(this,this._resetStatus)}return e.prototype.destroy=function(){this._symbolInfo.destroy(),this._status.destroy(),this._resetSubscription.unsubscribeAll(this)},e.prototype.status=function(){return this._dataUpdatedModeStatus.readonly()},e.prototype.symbolName=function(){var e=this._symbolInfo.value();return null!==e?e.name:""},e.prototype.time=function(){ var e=this._symbolInfo.value(),t=null!==e&&e.delay&&e.delay>0?e.delay:900;return Math.round(t/60)},e.prototype.listedExchange=function(){var e=this._symbolInfo.value();return null!==e?e.listed_exchange:""},e.prototype.description=function(){return Object(n.b)(this,void 0,void 0,(function(){var e,t,i,o;return Object(n.d)(this,(function(n){switch(n.label){case 0:if(null===(e=this._symbolInfo.value()))return[2,""];t={},n.label=1;case 1:return n.trys.push([1,3,,4]),i=r.ensureNotNull,[4,d(e)];case 2:return t=i.apply(void 0,[n.sent()]),[3,4];case 3:return o=n.sent(),_.logWarn("Cannot get exchange "+Object(f.a)(o)),[3,4];case 4:return[2,t.description||e.listed_exchange]}}))}))},e.prototype.exchange=function(){var e=this._symbolInfo.value();return null!==e?e.exchange:""},e.prototype._resetStatus=function(){this._dataUpdatedModeStatus.setValue(null)},e.prototype._update=function(){var e=this._symbolInfo.value();if(null!==e){var t=this._status.value();if("string"!=typeof t){if(t!==l.STATUS_LOADING&&t!==l.STATUS_RESOLVING){var i=m(e,t);0!==i.length?this._dataUpdatedModeStatus.setValue(i):this._dataUpdatedModeStatus.setValue(null)}}else this._dataUpdatedModeStatus.setValue(null)}else this._dataUpdatedModeStatus.setValue(null)},e}()},"2WC2":function(e,t,i){"use strict";var n=i("mrSG"),r=i("Eyy1"),o=i("aO4+"),s=i("f6yo"),a=i("VdBB");function l(e,t,i){var n=e.get(t);return void 0!==n?n:(e.set(t,i),i)}function c(e,t,i,n){var r=l(e,t,new Map);return l(r,i,n)}function u(e,t,i,n,r){var o=l(e,t,new Map),s=l(o,i,new Map);return l(s,n,r)}var h=function(){function e(){this._map=new Map,this._size=0}return e.prototype.size=function(){return this._size},e.prototype.clear=function(){this._map.clear(),this._size=0},e}(),d=(function(e){function t(){return e.call(this)||this}Object(n.c)(t,e),t.prototype._add=function(e,t){l(this._map,e,[]).push(t),++this._size},t.prototype._get=function(e){return l(this._map,e,[])},t.prototype._forEach=function(e){this._map.forEach((function(t,i){e(i,t)}))}}(h),function(e){function t(){return e.call(this)||this}Object(n.c)(t,e),t.prototype._add=function(e,t,i){c(this._map,e,t,[]).push(i),++this._size},t.prototype._get=function(e,t){return c(this._map,e,t,[])},t.prototype._forEach=function(e){this._map.forEach((function(t,i){t.forEach((function(t,n){e(i,n,t)}))}))}}(h),function(e){function t(){return e.call(this)||this}Object(n.c)(t,e),t.prototype._add=function(e,t,i,n){u(this._map,e,t,i,[]).push(n),++this._size},t.prototype._get=function(e,t,i){return u(this._map,e,t,i,[])},t.prototype._forEach=function(e){this._map.forEach((function(t,i){t.forEach((function(t,n){t.forEach((function(t,r){e(i,n,r,t)}))}))}))}}(h),i("gBDZ")),p=function(e){function t(t){var i=e.call(this)||this;return i._maxSize=t,i._keysQueue=[],i}return Object(n.c)(t,e),t.prototype.get=function(e){if(!e.text||!e.fontSize||!e.align)return null;var t=e.fontSize,i=e.text,n=e.align,r=c(this._map,t,n,new Map),o=r.get(i);return void 0!==o||(this._size>=this._maxSize?this._deleteFirstKey():++this._size,this._keysQueue.push([t,i,n]), o=new d.b(e.text,e.bold,e.italic,e.font,e.fontSize,e.align),r.set(i,o)),o},t.prototype._deleteFirstKey=function(){var e=this._keysQueue.shift(),t=e[0],i=e[1],n=this._map.get(t);n.delete(i),0===n.size&&this._map.delete(t)},t}(h),f=i("zDbI"),_=i("ikwP");i.d(t,"b",(function(){return m})),i.d(t,"c",(function(){return v})),i.d(t,"a",(function(){return y}));var m=function(){function e(e,t){void 0===t&&(t={skipRenderingOptimizations:!1}),this._height=void 0!==e.height?e.height:e.width,this._width=void 0!==e.width?e.width:e.height,this._items=[],this._barSpacing=0,this._textCache=t.textCache||new p(5e3),this._drawOperation=t.skipRenderingOptimizations?this._drawWithoutOptimizations.bind(this):this._drawWithOptimizations.bind(this),this._color=e.color,this._borderColor=e.borderColor,this._vertOffset=e.vertOffset||0,e.text&&(this._text=e.text,this._fontSize=e.fontSize,this._textColor=e.textColor,this._textAlign=e.textAlign||"center"),void 0!==e.items&&void 0!==e.barSpacing&&this.setData(e.items,e.barSpacing)}return e.prototype.draw=function(e,t){this._preDrawInit(),this._drawOperation(e,t)},e.prototype.hitTest=function(e){for(var t=a.HitTestResult.REGULAR,i=null,n=0,r=this._items;n0?0:-r,c=t>0?r:0,u=new o.Point(e.x-s,a+l),h=new o.Point(e.x+s,a+c);return Object(o.box)(u,h)}},e.prototype._unionBox=function(e,t){var i=Math.min(e.min.x,t.min.x),n=Math.max(e.max.x,t.max.x),r=Math.min(e.min.y,t.min.y),s=Math.max(e.max.y,t.max.y),a=new o.Point(i,r),l=new o.Point(n,s);return Object(o.box)(a,l)},e.prototype._getTooltip=function(e,t){if(e.tooltip)return{content:{type:"text",data:e.tooltip},tooltipDelay:200,extendMargin:!0,rect:{x:t.min.x,y:t.min.y,w:Math.abs(t.max.x-t.min.x),h:Math.abs(t.max.y-t.min.y)}}},e.prototype._setBaseData=function(e,t){this._items.length=0,this._barSpacing=t;for(var i=0,o=e;i0?l:-l;this._items.push(Object(n.a)({width:a,height:l,vertOffset:c,textVertOffset:u,shapeWidth:0,shapeHeight:0,stepX:0,stepY:0},s))}},e.prototype._drawItemText=function(e,t,i){var n=this._getTextCache(i);if(null!==n){var r,o=i.x,s=i.vertOffset,a=i.y+s+i.textVertOffset;r=i.style&&void 0!==i.style.textColor?i.style.textColor:this._textColor,n.paintTo(e,t,r,o,a,d.a.Center,s>0?d.c.Top:d.c.Bottom)}},e.prototype._drawWithOptimizations=function(e,t){for(var i,n,r=null,o=!1,s=0,a=this._items;sthis.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[];for(var _=r;_<=f;_++){var m=this._model.mainSeries().data().valueAt(_);this._pattern.push(TradingView.clone(m))}if(this._pattern.length>0){var v=this.patternPriceDiff();this._points[1].price=this._points[0].price+v,this._points[1].index=this._points[0].index+(f-r),this.normalizePoints(),this.createServerPoints()}}return h},l.prototype.setPoint=function(e,t,i){1===e&&t.index<=this._points[0].index&&(t.index=this._points[0].index+1),0===e&&t.index>=this._points[1].index&&(t.index=this._points[1].index-1),n.prototype.setPoint.call(this,e,t,i)},l.prototype.migrateVersion=function(e,t,i){if(1===e&&this._pattern.length>0){var n=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+n),2===this._points.length&&(this._points[1].price=this._points[0].price+n)}},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("8ioM").BarsPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l.createProperties=function(e){var t=new o("linetoolbarspattern",e);return l._configureProperties(t),t},l._configureProperties=function(e){n._configureProperties(e),e.addExclusion("mirrored"),e.addExclusion("flipped")},t.LineToolBarsPattern=l},"2cgs":function(e,t,i){"use strict";var n=i("ocLq");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:0,visible:!0,color:"#2196F3"}},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(e,t,i,r){return n.Std.or(n.Std.and(n.Std.eq(e,t),n.Std.eq(e,i)),n.Std.eq(t,i))?0:(2*e-i-t)/(t-i)*r},this.main=function(e,t){ this._context=e,this._input=t;var i=this.f_0(n.Std.close(this._context),n.Std.high(this._context),n.Std.low(this._context),n.Std.volume(this._context));return[n.Std.cum(i,this._context)]}}},{name:"Accumulative Swing 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:0,visible:!0,color:"#2196F3"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ASI",histogramBase:0,joinPoints:!1}},description:"Accumulative Swing Index",shortDescription:"ASI",is_price_study:!1,inputs:[{id:"in_0",name:"Limit Move Value",defval:10,type:"float",min:.1,max:1e5}],id:"Accumulative Swing Index@tv-basicstudies-1",scriptIdPart:"",name:"Accumulative Swing Index"},constructor:function(){this.f_0=function(e,t){var i=t.new_var(n.Std.open(t)),r=t.new_var(n.Std.high(t)),o=t.new_var(n.Std.low(t)),s=t.new_var(n.Std.close(t)),a=n.Std.abs(r-s.get(1)),l=n.Std.abs(o-s.get(1)),c=n.Std.abs(r-o),u=n.Std.abs(s.get(1)-i.get(1)),h=n.Std.max(a,l),d=n.Std.iff(a>=n.Std.max(l,c),a-.5*l+.25*u,n.Std.iff(l>=n.Std.max(a,c),l-.5*a+.25*u,c+.25*u));return n.Std.iff(0===d,0,(s-s.get(1)+.5*(s-i)+.25*(s.get(1)-i.get(1)))/d*h/e*50)},this.f_1=function(e,t){var i=this.f_0(e,t);return n.Std.cum(i,t)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0);return[this.f_1(i,this._context)]}}},{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:0,visible:!0,color:"#2196F3"}},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(e,t){return n.Std.gt(e,t)},this.f_1=function(e,t){return n.Std.lt(e,t)},this.f_2=function(e,t){return 0===t?e:e/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this.f_0(n.Std.close(this._context),n.Std.open(this._context)),o=this._context.new_var(r),s=n.Std.sum(o,i,this._context),a=this.f_1(n.Std.close(this._context),n.Std.open(this._context)),l=this._context.new_var(a),c=n.Std.sum(l,i,this._context);return[this.f_2(s,c)]}}},{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:0,visible:!0,color:"#2196F3"}},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(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._input(0),o=this._input(1),s=this._input(2),a=this._context.new_var(i);return[n.Std.alma(a,r,o,s)]}}},{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:0,visible:!0,color:"#FB8C00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},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(e,t){return 100*(e+t)/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.high(this._context),o=i+1,s=this._context.new_var(r),a=n.Std.highestbars(s,o,this._context),l=this.f_0(a,i),c=n.Std.low(this._context),u=this._context.new_var(c),h=n.Std.lowestbars(u,o,this._context);return[l,this.f_0(h,i)]}}},{name:"Average Price",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"AveragePrice@tv-basicstudies-1",scriptIdPart:"",name:"Average Price",description:"Average Price",shortDescription:"Average Price",is_price_study:!0,plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},precision:4,inputs:{}},styles:{plot_0:{title:"Plot"}},inputs:[]},constructor:function(){this.main=function(e,t){return this._context=e,this._input=t,[n.Std.ohlc4(this._context)]}}},{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:0,visible:!0,color:"#FF5252"}},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(e){ var t=this._context.new_var(n.Std.high(this._context)),i=n.Std.change(t),r=this._context.new_var(n.Std.low(this._context)),o=-n.Std.change(r),s=this._context.new_var(n.Std.tr(void 0,this._context)),a=n.Std.rma(s,e,this._context),l=this._context.new_var(n.Std.and(n.Std.gt(i,o),n.Std.gt(i,0))?i:0),c=n.Std.fixnan(100*n.Std.rma(l,e,this._context)/a,this._context),u=this._context.new_var(n.Std.and(n.Std.gt(o,i),n.Std.gt(o,0))?o:0);return[c,n.Std.fixnan(100*n.Std.rma(u,e,this._context)/a,this._context)]},this.f_1=function(e,t){var i=this.f_0(e),r=i[0],o=i[1],s=r+o,a=this._context.new_var(n.Std.abs(r-o)/(n.Std.eq(s,0)?1:s));return[100*n.Std.rma(a,t,this._context)]},this.main=function(e,t){return this._context=e,this._input=t,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:0,visible:!0,color:"#B71C1C"}},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(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.tr(this._context),o=this._context.new_var(r);return[n.Std.rma(o,i,this._context)]}}},{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:0,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#F44336",width:1,style:0},1:{color:"#009688",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(e,t){return e-t},this.f_1=function(e){return n.Std.le(e,0)?0:1},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.hl2(this._context),r=this._context.new_var(i),o=n.Std.sma(r,5,this._context),s=this._context.new_var(i),a=n.Std.sma(s,34,this._context),l=this.f_0(o,a),c=l,u=this._context.new_var(l),h=n.Std.change(u);return[c,this.f_1(h)]}}},{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:0,visible:!0,color:"#FF5252"}},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(e,t,i,n){return(e-t)/(i-n)},this.main=function(e,t){return this._context=e,this._input=t,[this.f_0(n.Std.close(this._context),n.Std.open(this._context),n.Std.high(this._context),n.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:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},precision:4,filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,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(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._input(0),o=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,r,this._context),l=this._context.new_var(i),c=n.Std.stdev(l,r,this._context),u=this.f_0(o,c);return[a,this.f_1(a,u),this.f_2(a,u)]}}},{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:0,visible:!0,color:"#26A69A"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:1},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],filledAreasStyle:{fill_0:{color:"#26A69A",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(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/(i-t)},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._input(0),o=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,r,this._context),l=this._context.new_var(i),c=n.Std.stdev(l,r,this._context),u=this.f_0(o,c),h=this.f_1(a,u),d=this.f_2(a,u);return[this.f_3(i,d,h)]}}},{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:0,visible:!0,color:"#FF6D00"}},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(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/i},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._input(0),o=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,r,this._context),l=this._context.new_var(i),c=n.Std.stdev(l,r,this._context),u=this.f_0(o,c),h=this.f_1(a,u),d=this.f_2(a,u);return[this.f_3(h,d,a)]}}},{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:0,visible:!0,color:"#43A047"}},precision:4,bands:[{color:"#787B86",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(e,t,i,r){return n.Std.or(n.Std.and(n.Std.eq(e,t),n.Std.eq(e,i)),n.Std.eq(t,i))?0:(2*e-i-t)/(t-i)*r},this.f_1=function(e,t){return e/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this.f_0(n.Std.close(this._context),n.Std.high(this._context),n.Std.low(this._context),n.Std.volume(this._context)),o=this._context.new_var(r),s=n.Std.sum(o,i,this._context),a=n.Std.volume(this._context),l=this._context.new_var(a),c=n.Std.sum(l,i,this._context);return[this.f_1(s,c)]}}},{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:0,visible:!0,color:"#EC407A"}}, precision:4,bands:[{color:"#787B86",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(e,t){return e-t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=n.Std.accdist(this._context),s=this._context.new_var(o),a=n.Std.ema(s,i,this._context),l=this._context.new_var(o),c=n.Std.ema(l,r,this._context);return[this.f_0(a,c)]}}},{name:"Chaikin Volatility",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Chaikin Volatility@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Volatility",description:"Chaikin Volatility",shortDescription:"Chaikin Volatility",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#AB47BC"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{periods:10,rocLookback:10}},styles:{plot_0:{title:"Plot"}},bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"periods",type:"integer",name:"Periods"},{id:"rocLookback",type:"integer",name:"Rate of Change Lookback"}]},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.rocLookback=this._input(1)},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.Std.high(this._context)-n.Std.low(this._context)),r=this._context.new_var(n.Std.ema(i,this.period,this._context));return[n.Std.roc(r,this.rocLookback)]}}},{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:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},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(e,t,i){return e-t*i},this.f_1=function(e,t,i){return e+t*i},this.main=function(e,t){this._context=e,this._input=t ;var i=this._input(0),r=this._input(1),o=this._input(2),s=n.Std.high(this._context),a=this._context.new_var(s),l=n.Std.highest(a,i,this._context),c=n.Std.atr(i,this._context),u=this.f_0(l,r,c),h=this._context.new_var(s),d=n.Std.lowest(h,i,this._context),p=this.f_1(d,r,c),f=this._context.new_var(u),_=n.Std.highest(f,o,this._context),m=this._context.new_var(p);return[n.Std.lowest(m,o,this._context),_]}}},{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:0,visible:!0,color:"#2196F3"}},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(e){return n.Std.ge(e,0)?e:0},this.f_1=function(e){return n.Std.ge(e,0)?0:-e},this.f_2=function(e,t){return 100*e/t},this.f_3=function(e,t){return this.f_2(e-t,e+t)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.close(this._context),o=this._context.new_var(r),s=n.Std.change(o),a=this.f_0(s),l=this.f_1(s),c=this._context.new_var(a),u=n.Std.sum(c,i,this._context),h=this._context.new_var(l),d=n.Std.sum(h,i,this._context);return[this.f_3(u,d)]}}},{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:0,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#26C6DA",width:1,style:0},1:{color:"#43A047",width:1,style:0},2:{color:"#A5D6A7",width:1,style:0},3:{color:"#009688",width:1,style:0},4:{color:"#D50000",width:1,style:0},5:{color:"#E91E63",width:1,style:0},6:{color:"#FF6D00",width:1,style:0},7:{color:"#FFB74D",width:1,style:0},8:{color:"#FDD835",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 e=n.Std.close(this._context),t=n.Std.hlc3(this._context),i=this._context.new_var(n.Std.high(this._context)),r=n.Std.highest(i,30,this._context),o=n.Std.lowest(i,30,this._context),s=25/(r-o)*o,a=this._context.new_var(e),l=this._context.new_var(n.Std.ema(a,34,this._context)),c=(l.get(1)-l.get(0))/t*s,u=n.Std.sqrt(1+c*c),h=n.Std.round(180*n.Std.acos(1/u)/3.141592653589793),d=n.Std.iff(n.Std.gt(c,0),-h,h),p=n.Std.and(n.Std.gt(d,-2.14),n.Std.le(d,-.71))?7:8,f=n.Std.and(n.Std.gt(d,-3.57),n.Std.le(d,-2.14))?6:p,_=n.Std.and(n.Std.gt(d,-5),n.Std.le(d,-3.57))?5:f,m=n.Std.le(d,-5)?4:_,v=n.Std.and(n.Std.lt(d,2.14),n.Std.ge(d,.71))?3:m,y=n.Std.and(n.Std.lt(d,3.57),n.Std.ge(d,2.14))?2:v,g=n.Std.and(n.Std.lt(d,5),n.Std.ge(d,3.57))?1:y;return[1,n.Std.ge(d,5)?0:g]},this.main=function(e,t){return this._context=e,this._input=t,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:0,visible:!0,color:"#2196F3"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:61.8},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:38.2}],filledAreasStyle:{fill_0:{color:"#2196F3",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(e,t,i,r){return 100*n.Std.log10(e/(t-i))/r},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.atr(1,this._context),o=this._context.new_var(r),s=n.Std.sum(o,i,this._context),a=n.Std.high(this._context),l=this._context.new_var(a),c=n.Std.highest(l,i,this._context),u=n.Std.low(this._context),h=this._context.new_var(u),d=n.Std.lowest(h,i,this._context),p=n.Std.log10(i);return[this.f_0(s,c,d,p)]}}},{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:0,visible:!0,color:"#2196F3"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:100},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-100}],filledAreasStyle:{fill_0:{color:"#2196F3",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(e,t,i){return(e-t)/(.015*i)},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.hlc3(this._context),r=this._input(0),o=this._context.new_var(i),s=n.Std.sma(o,r,this._context),a=this._context.new_var(i),l=n.Std.dev(a,r,this._context);return[this.f_0(i,s,l)]}}},{name:"Connors 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:0,visible:!0,color:"#2196F3"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:3,in_1:2,in_2:100}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"CRSI",histogramBase:0,joinPoints:!1}},description:"Connors RSI",shortDescription:"CRSI",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:"RSI Length",defval:3,type:"integer",min:1},{id:"in_1",name:"UpDown Length",defval:2,type:"integer",min:1},{id:"in_2",name:"ROC Length",defval:100,type:"integer",min:1}],id:"Connors RSI@tv-basicstudies-1",scriptIdPart:"",name:"Connors RSI"},constructor:function(){var e;this.f_1=function(e,t,i){var r=i.new_var(n.Std.max(n.Std.change(e),0));return n.Std.rma(r,t,i)},this.f_2=function(e,t,i){var r=i.new_var(-n.Std.min(n.Std.change(e),0));return n.Std.rma(r,t,i)},this.f_3=(e=0,function(t){var i=t.get(0),r=t.get(1);return e=i===r?0:i>r?n.Std.nz(e)<=0?1:n.Std.nz(e)+1:n.Std.nz(e)>=0?-1:n.Std.nz(e)-1,this._context.new_var(e)}),this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._context.new_var(i),o=this._input(0),s=this._input(1),a=this._input(2),l=n.Std.rsi(this.f_1(r,o,this._context),this.f_2(r,o,this._context)),c=this.f_3(r),u=n.Std.rsi(this.f_1(c,s,this._context),this.f_2(c,s,this._context)),h=this._context.new_var(n.Std.roc(r,1)),d=n.Std.percentrank(h,a);return[n.Std.avg(l,u,d)]}}},{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:0,visible:!0,color:"#2196F3"}},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(e,t){return e+t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=this._input(2),s=n.Std.close(this._context),a=this._context.new_var(s),l=n.Std.roc(a,r),c=this._context.new_var(s),u=n.Std.roc(c,o),h=this.f_0(l,u),d=this._context.new_var(h);return[n.Std.wma(d,i,this._context)]}}},{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:0,visible:!0,color:"#2196F3"}},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 Coefficient",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(e,t){this._context=e,this._input=t,this._context.new_sym(this._input(0),n.Std.period(this._context))},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_unlimited_var(this._context.symbol.time),r=(this._input(0),n.Std.period(this._context),n.Std.close(this._context)),o=this._input(1);this._context.select_sym(1);var s=this._context.new_unlimited_var(this._context.symbol.time),a=n.Std.close(this._context),l=this._context.new_unlimited_var(a);this._context.select_sym(0);var c=l.adopt(s,i,0),u=this._context.new_var(r),h=this._context.new_var(c);return[n.Std.correlation(u,h,o,this._context)]}}},{name:"Correlation - Log",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Correlation - Log@tv-basicstudies-1",scriptIdPart:"",name:"Correlation - Log",description:"Correlation - Log",shortDescription:"Correlation - Log",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},precision:4,inputs:{instrument:"INTC",instrument2:"AMZN",periods:25}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"instrument",name:"Instrument 1",type:"symbol",defval:"INTC"},{id:"instrument2",name:"Instrument 2",type:"symbol",defval:"AMZN"},{id:"periods",name:"Periods",type:"integer",defval:25}]},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this._context.new_sym(this._input(0),n.Std.period(this._context)),this._context.new_sym(this._input(1),n.Std.period(this._context)),this.period=this._input(2)},this.correlationLog=function(e,t,i,r){var o=n.Std.sma(e,i,r),s=n.Std.sma(t,i,r),a=r.new_var(e.get()*t.get());return(n.Std.sma(a,i,r)-o*s)/Math.sqrt(n.Std.variance2(e,o,i)*n.Std.variance2(t,s,i))},this.main=function(e,t){this._context=e,this._input=t,this._context.select_sym(1);var i=this._context.new_var(this._context.symbol.time) ;this._context.select_sym(2);var r=this._context.new_var(n.Std.close(this._context)),o=this._context.new_var(n.Std.log(r.get()/r.get(1))),s=this._context.new_var(this._context.symbol.time);this._context.select_sym(1);var a=this._context.new_var(n.Std.close(this._context)),l=this._context.new_var(n.Std.log(a.get()/a.get(1))),c=this._context.new_var(o.adopt(s,i,0));return[this.correlationLog(l,c,this.period,this._context)]}}},{name:"Detrended Price Oscillator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},precision:4,bands:[{color:"#787B86",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 e=this._input(0),t=this._input(1),i=Math.floor(e/2+1),r=this._context.new_var(n.Std.close(this._context)),o=this._context.new_var(n.Std.sma(r,e,this._context)),s=this._context.new_var(n.Std.close(this._context)).get(i)-o,a=n.Std.close(this._context)-o.get(i);return[t?s:a,t?-i:0]},this.main=function(e,t){this._context=e,this._input=t;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:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F50057"}},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",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(e){return-e},this.f_1=function(e,t){return n.Std.and(n.Std.gt(e,t),n.Std.gt(e,0))?e:0},this.f_2=function(e,t){return 100*e/t},this.f_3=function(e,t){return e+t},this.f_4=function(e,t,i){return n.Std.abs(e-t)/(n.Std.eq(i,0)?1:i)},this.f_5=function(e){return 100*e},this.main=function(e,t){this._context=e,this._input=t ;var i=this._input(0),r=this._input(1),o=n.Std.high(this._context),s=this._context.new_var(o),a=n.Std.change(s),l=n.Std.low(this._context),c=this._context.new_var(l),u=n.Std.change(c),h=this.f_0(u),d=n.Std.tr(this._context),p=this._context.new_var(d),f=n.Std.rma(p,i,this._context),_=this.f_1(a,h),m=this._context.new_var(_),v=n.Std.rma(m,i,this._context),y=this.f_2(v,f),g=n.Std.fixnan(y,this._context),b=this.f_1(h,a),S=this._context.new_var(b),w=n.Std.rma(S,i,this._context),P=this.f_2(w,f),C=n.Std.fixnan(P,this._context),T=this.f_3(g,C),x=this.f_4(g,C,T),I=this._context.new_var(x),L=n.Std.rma(I,r,this._context);return[g,C,this.f_5(L)]}}},{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:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},precision:4,filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,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(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.low(this._context),o=this._context.new_var(r),s=n.Std.lowest(o,i,this._context),a=n.Std.high(this._context),l=this._context.new_var(a),c=n.Std.highest(l,i,this._context);return[s,c,n.Std.avg(c,s)]}}},{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:0,visible:!0,color:"#43A047"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double EMA",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(e,t){return 2*e-t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.close(this._context),o=this._context.new_var(r),s=n.Std.ema(o,i,this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context);return[this.f_0(s,l)]}}},{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:0,visible:!0,color:"#43A047"}},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(e,t,i,n,r){return e*t*(i-n)/r},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=n.Std.hl2(this._context),s=this._context.new_var(o),a=n.Std.change(s),l=this.f_0(i,a,n.Std.high(this._context),n.Std.low(this._context),n.Std.volume(this._context)),c=this._context.new_var(l);return[n.Std.sma(c,r,this._context)]}}},{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:0,visible:!0,color:"#F44336"}},precision:4,bands:[{color:"#787B86",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:"Elder's 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(e,t){return e*t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.close(this._context),o=this._context.new_var(r),s=n.Std.change(o),a=this.f_0(s,n.Std.volume(this._context)),l=this._context.new_var(a);return[n.Std.ema(l,i,this._context)]}}},{name:"EMA 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:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},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:"EMA Cross",shortDescription:"EMA 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:"EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"EMA Cross"},constructor:function(){this.f_0=function(e,t){return e?t:n.Std.na()},this.main=function(e,t){ this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=n.Std.close(this._context),s=this._context.new_var(o),a=n.Std.ema(s,i,this._context),l=this._context.new_var(o),c=n.Std.ema(l,r,this._context),u=a,h=c,d=n.Std.cross(a,c,this._context);return[u,h,this.f_0(d,a)]}}},{name:"Envelopes",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},precision:4,filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,visible:!0}},inputs:{in_0:20,in_1:10,in_2:10,in_3:"Simple",in_4:"close"}},plots:[{id:"plot_1",type:"line"},{id:"plot_0",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Average",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Envelopes",shortDescription:"Envelopes",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:"Upper Percentage",defval:2,type:"float",min:0},{id:"in_2",name:"Lower Percentage",defval:2,type:"float",min:0},{id:"in_3",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]},{id:"in_4",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"Envelope@tv-basicstudies-1",scriptIdPart:"",name:"Envelopes"},constructor:function(){this.f_0=function(e,t){return e*(1+t)},this.f_1=function(e,t){return e*(1-t)},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.Std[this._input(4)](this._context)),r=n.Std.sma(i,this._input(0),this._context);return"Exponential"===this._input(3)?r=n.Std.ema(i,this._input(0),this._context):"Weighted"===this._input(3)&&(r=n.Std.wma(i,this._input(0),this._context)),[this.f_0(r,this._input(1)/100),r,this.f_1(r,this._input(2)/100)]}}},{name:"Standard Error",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Standard Error@tv-basicstudies-1",scriptIdPart:"",name:"Standard Error",description:"Standard Error",shortDescription:"Standard Error",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"}},precision:4,inputs:{length:14}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"length",type:"integer",name:"Length"}]},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0)},this.main=function(e,t){this._context=e,this._input=t;for(var i,r,o=this._context.new_var(n.Std.close(this._context)),s=0,a=0,l=0;l0?1:3,i=n.Std.change(this._context.new_var(e));return t-(n.Std.le(i,0)?0:1)},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std[this._input(2)](this._context),r=this._input(0),o=this._input(1),s=this._input(3),a=this._context.new_var(i),l=n.Std.ema(a,r,this._context),c=this._context.new_var(i),u=n.Std.ema(c,o,this._context),h=this.f_0(l,u),d=this._context.new_var(h),p=n.Std.ema(d,s,this._context),f=this.f_0(h,p);return[f,h,p,this.f_1(f)]}}},{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:0,visible:!0,color:"#2196F3"}},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(e,t){this._context=e,this._input=t;var i=n.Std[this._input(1)](this._context),r=this._input(0),o=this._input(2),s=this._context.new_var(i);return[{value:n.Std.ema(s,r,this._context),offset:o}]}}},{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:0,visible:!0,color:"#2196F3"}},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(e,t){this._context=e,this._input=t;var i=n.Std[this._input(1)](this._context),r=this._input(0),o=this._input(2),s=this._context.new_var(i);return[{value:n.Std.wma(s,r,this._context),offset:o}]}}},{name:"Moving Average Double",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"Moving Average Double@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Double",description:"Moving Average Double",shortDescription:"Moving Average Double",is_price_study:!0,plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"},plot_1:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},precision:4,inputs:{firstPeriods:14,secondPeriods:21,method:"Simple"}},styles:{plot_0:{title:"Plot 1"},plot_1:{title:"Plot 2"}},inputs:[{id:"firstPeriods",name:"1st Period",type:"integer",defval:14,min:1,max:1e4},{id:"secondPeriods",name:"2nd Period",type:"integer",defval:21,min:1,max:1e4},{id:"method",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]}]},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i,r,o=this._context.new_var(n.Std.close(this._context));return"Exponential"===this._input(2)?(i=n.Std.ema(o,this._input(0),this._context),r=n.Std.ema(o,this._input(1),this._context)):"Weighted"===this._input(2)?(i=n.Std.wma(o,this._input(0),this._context),r=n.Std.wma(o,this._input(1),this._context)):(i=n.Std.sma(o,this._input(0),this._context),r=n.Std.sma(o,this._input(1),this._context)),[i,r]}}},{name:"Moving Average Triple",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Triple@tv-basicstudies-1", scriptIdPart:"",name:"Moving Average Triple",description:"Moving Average Triple",shortDescription:"Moving Average Triple",plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#FF6D00"},plot_1:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#2196F3"},plot_2:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#26C6DA"}},precision:4,inputs:{firstPeriods:14,secondPeriods:21,thirdPeriods:35,method:"Simple"}},styles:{plot_0:{title:"Plot 1"},plot_1:{title:"Plot 2"},plot_2:{title:"Plot 3"}},inputs:[{id:"firstPeriods",name:"1st Period",type:"integer",defval:14,min:1,max:1e4},{id:"secondPeriods",name:"2nd Period",type:"integer",defval:21,min:1,max:1e4},{id:"thirdPeriods",name:"3rd Period",type:"integer",defval:35,min:1,max:1e4},{id:"method",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]}]},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i,r,o,s=this._context.new_var(n.Std.close(this._context));return"Exponential"===this._input(3)?(i=n.Std.ema(s,this._input(0),this._context),r=n.Std.ema(s,this._input(1),this._context),o=n.Std.ema(s,this._input(2),this._context)):"Weighted"===this._input(3)?(i=n.Std.wma(s,this._input(0),this._context),r=n.Std.wma(s,this._input(1),this._context),o=n.Std.wma(s,this._input(2),this._context)):(i=n.Std.sma(s,this._input(0),this._context),r=n.Std.sma(s,this._input(1),this._context),o=n.Std.sma(s,this._input(2),this._context)),[i,r,o]}}},{name:"Moving Average Modified",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Modified@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Modified",description:"Moving Average Modified",shortDescription:"Moving Average Modified",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#FF6D00"}},precision:4,inputs:{periods:10}},styles:{plot_0:{title:"Plot 1"}},inputs:[{id:"periods",name:"Period",type:"integer",defval:10,min:1,max:1e4}]},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.periods=this._input(0),this.mmaPrev=NaN},this.mma=function(e){var t=this.periods,i=NaN;return i=isNaN(this.mmaPrev)?n.Std.sma(e,t,this._context):(this.mmaPrev*(t-1)+e.get())/t,this.mmaPrev=i,i},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.Std.close(this._context));return[this.mma(i,0),this.mma(i,1),this.mma(i,2)]}}},{name:"Moving Average Adaptive",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Adaptive@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Adaptive",description:"Moving Average Adaptive",shortDescription:"Moving Average Adaptive",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{ linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#AB47BC"}},precision:4,inputs:{periods:10}},styles:{plot_0:{title:"Plot 1"}},inputs:[{id:"periods",name:"Period",type:"integer",defval:10,min:1,max:1e4}]},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.periods=this._input(0),this.amaPrev=NaN},this.ama=function(e,t){var i=this.periods,r=e.get(),o=n.Std.stdev(t,i,this._context),s=n.Std.log(r/e.get(i))/(o*Math.sqrt(i)),a=.1*Math.abs(s),l=(r-this.amaPrev)*a+this.amaPrev;return this.amaPrev=isNaN(l)?r:l,l},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.Std.close(this._context)),r=this._context.new_var(n.Std.log(i.get()/i.get(1)));return[this.ama(i,r)]}}},{name:"Moving Average Hamming",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Hamming@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Hamming",description:"Moving Average Hamming",shortDescription:"Moving Average Hamming",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#4CAF50"}},precision:4,inputs:{periods:10}},styles:{plot_0:{title:"Plot 1"}},inputs:[{id:"periods",name:"Period",type:"integer",defval:10,min:1,max:1e4}]},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.periods=this._input(0);for(var i=[],n=0,r=1;r<=this.periods;++r){var o=Math.sin((1+r)/this.periods*Math.PI/2);i.unshift(o),n+=o}this.hmaFactors=i,this.hmaFactorsSum=n},this.hma=function(e){for(var t=this.periods,i=0,n=0;nthis._context.new_var(r).get(1)?1:0,[100*n.Std.sma(this._context.new_var(i),this.rollingPeriod,this._context)]}}},{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:0,visible:!0,color:"#2196F3"}},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(e,t,i){return n.Std.gt(e,0)?t:n.Std.lt(i,0)?-t:0*t},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._context.new_var(i),o=n.Std.change(r);return[this.f_0(o,n.Std.volume(this._context),o)]}}},{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:0,visible:!0,color:"#2196F3"}},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(e,t,i){return n.Std.gt(e,0)?t:n.Std.lt(i,0)?-t:0*t},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._context.new_var(i),o=n.Std.change(r),s=this.f_0(o,n.Std.volume(this._context),o);return[n.Std.cum(s,this._context)]}}},{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:0,visible:!0,color:"#2196F3"}},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(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=this._input(2);return[n.Std.sar(i,r,o,this._context)]}}},{name:"Price Channel",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F50057"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F50057"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},precision:4,inputs:{in_0:20,in_1:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Highprice Line",histogramBase:0,joinPoints:!1},plot_1:{title:"Lowprice Line",histogramBase:0,joinPoints:!1},plot_2:{title:"Centerprice Line",histogramBase:0,joinPoints:!1}},description:"Price Channel",shortDescription:"PC",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"Offset Length",defval:0,type:"integer",min:1,max:2e3}], id:"Price Channel@tv-basicstudies-1",scriptIdPart:"",name:"Price Channel"},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.high(this._context),r=this._context.new_var(i),o=n.Std.low(this._context),s=this._context.new_var(o),a=this._input(0),l=this._input(1),c=n.Std.highest(r,a,this._context),u=n.Std.lowest(s,a,this._context);return[{value:c,offset:l},{value:u,offset:l},{value:n.Std.avg(c,u),offset:l}]}}},{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:0,visible:!0,color:"#009688"}},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(e,t){return(e-t)/t*100},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._input(0),o=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,r,this._context),l=this._context.new_var(i),c=n.Std.sma(l,o,this._context);return[this.f_0(a,c)]}}},{name:"Price Volume Trend",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},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 e=this._context.new_var(n.Std.close(this._context));return[n.Std.cum(n.Std.change(e)/e.get(1)*n.Std.volume(this._context),this._context)]},this.main=function(e,t){return this._context=e,this._input=t,[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:0,visible:!0,color:"#2196F3"}},precision:4,bands:[{color:"#787B86",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(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.Std.close(this._context)),r=this._input(0) ;return[100*(i.get(0)-i.get(r))/i.get(r)]}}},{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:0,visible:!0,color:"#7E57C2"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#7E57C2",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(e){return n.Std.max(e,0)},this.f_1=function(e){return-n.Std.min(e,0)},this.f_2=function(e,t){return n.Std.eq(e,0)?100:n.Std.eq(t,0)?0:100-100/(1+t/e)},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._input(0),o=this._context.new_var(i),s=n.Std.change(o),a=this.f_0(s),l=this._context.new_var(a),c=n.Std.rma(l,r,this._context),u=this.f_1(s),h=this._context.new_var(u),d=n.Std.rma(h,r,this._context);return[this.f_2(d,c)]}}},{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:0,visible:!0,color:"#009688"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F44336"}},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(e,t){return e-t},this.f_1=function(e,t){return e/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this.f_0(n.Std.close(this._context),n.Std.open(this._context)),o=this._context.new_var(r),s=n.Std.swma(o,this._context),a=this._context.new_var(s),l=n.Std.sum(a,i,this._context),c=this.f_0(n.Std.high(this._context),n.Std.low(this._context)),u=this._context.new_var(c),h=n.Std.swma(u,this._context),d=this._context.new_var(h),p=n.Std.sum(d,i,this._context),f=this.f_1(l,p),_=this._context.new_var(f);return[f,n.Std.swma(_,this._context)]}}},{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:0,visible:!0,color:"#7E57C2"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#7E57C2",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(e,t){return n.Std.le(e,0)?0:t},this.f_1=function(e,t){return n.Std.gt(e,0)?0:t},this.f_2=function(e,t){return e/(e+t)*100},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.close(this._context),o=this._context.new_var(r),s=n.Std.stdev(o,i,this._context),a=this._context.new_var(r),l=n.Std.change(a),c=this.f_0(l,s),u=this._context.new_var(c),h=n.Std.ema(u,14,this._context),d=this.f_1(l,s),p=this._context.new_var(d),f=n.Std.ema(p,14,this._context);return[this.f_2(h,f)]}}},{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:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_2:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:0,visible:!0,color:"#FF5252"}},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(e,t){return e-t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=this._input(2),s=n.Std.close(this._context),a=this._context.new_var(s),l=n.Std.tsi(a,i,r,this._context),c=this._context.new_var(l),u=n.Std.ema(c,o,this._context);return[l,u,this.f_0(l,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:0,visible:!0,color:"#673AB7"}},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 e=this._input(0),t=n.Std[this._input(1)](this._context),i=this._context.new_var(t),r=n.Std.sma(i,e,this._context),o=this._context.new_var(),s=(o.get(1)*(e-1)+t)/e;return o.set(n.Std.na(o.get(1))?r:s),[o.get(0)]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Standard Deviation",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"Standard Deviation@tv-basicstudies-1",scriptIdPart:"",name:"Standard Deviation",description:"Standard Deviation",shortDescription:"Standard Deviation",is_price_study:!1,plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#009688"}},precision:4,inputs:{periods:5,deviations:1}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",name:"Periods",type:"integer"},{id:"deviations",name:"Deviations",type:"float"}]},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=this._context.new_var(n.Std.close(this._context));return[n.Std.stdev(o,i,this._context)*r]}}},{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:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,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:"K",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"D",defval:1,type:"integer",min:1,max:1e4},{id:"in_2",name:"smooth",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic"},constructor:function(){this.main=function(e,t){this._context=e,this._input=t ;var i=this._input(0),r=this._input(1),o=this._input(2),s=n.Std.close(this._context),a=n.Std.high(this._context),l=n.Std.low(this._context),c=this._context.new_var(s),u=this._context.new_var(a),h=this._context.new_var(l),d=n.Std.stoch(c,u,h,i,this._context),p=this._context.new_var(d),f=n.Std.sma(p,r,this._context),_=this._context.new_var(f);return[f,n.Std.sma(_,o,this._context)]}}},{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:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,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.f_1=function(e,t,i){var r=i.new_var(n.Std.max(n.Std.change(e),0));return n.Std.rma(r,t,i)},this.f_2=function(e,t,i){var r=i.new_var(-n.Std.min(n.Std.change(e),0));return n.Std.rma(r,t,i)},this.main=function(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._input(0),o=this._input(1),s=this._input(2),a=this._input(3),l=this._context.new_var(i),c=n.Std.rsi(this.f_1(l,r,this._context),this.f_2(l,r,this._context)),u=this._context.new_var(c),h=this._context.new_var(c),d=this._context.new_var(c),p=n.Std.stoch(u,h,d,o,this._context),f=this._context.new_var(p),_=n.Std.sma(f,s,this._context),m=this._context.new_var(_);return[_,n.Std.sma(m,a,this._context)]}}},{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:0,visible:!0,color:"#F44336"}},precision:4,bands:[{color:"#787B86",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(e){return n.Std.log(e)},this.f_1=function(e){return 1e4*e},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this.f_0(n.Std.close(this._context)),o=this._context.new_var(r),s=n.Std.ema(o,i,this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this._context.new_var(l),u=n.Std.ema(c,i,this._context),h=this._context.new_var(u),d=n.Std.change(h);return[this.f_1(d)]}}},{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:0,visible:!0,color:"#2196F3"}},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(e,t,i){return 3*(e-t)+i},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.close(this._context),o=this._context.new_var(r),s=n.Std.ema(o,i,this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this._context.new_var(l),u=n.Std.ema(c,i,this._context);return[this.f_0(s,l,u)]}}},{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:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#E91E63"}},precision:4,bands:[{color:"#787B86",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(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=this._input(2),s=n.Std.close(this._context),a=this._context.new_var(s),l=n.Std.tsi(a,r,i,this._context),c=this._context.new_var(l);return[l,n.Std.ema(c,o,this._context)]}}},{name:"Trend Strength Index",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Trend Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Trend Strength Index",description:"Trend Strength Index",shortDescription:"Trend Strength Index",plots:[{id:"plot_0", type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF5252"}},precision:4,inputs:{periods:14}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",type:"integer",name:"Periods"}]},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.invertedPeriod=1/this.period,this.sumX=(this.period-1)*this.period/2,this.sumXX=(this.period-1)*this.period*(2*this.period-1)/6,this.invertedPeriodSumXSumX=this.invertedPeriod*this.sumX*this.sumX},this.trendStrengthIndex=function(){for(var e=this._context.new_var(n.Std.close(this._context)),t=n.Std.sum(e,this.period,this._context),i=0,r=0,o=0;o0?1:-1:a/(l=Math.sqrt(l))},this.main=function(e,t){return this._context=e,this._input=t,[this.trendStrengthIndex()]}}},{name:"Typical Price",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"TypicalPrice@tv-basicstudies-1",scriptIdPart:"",name:"Typical Price",description:"Typical Price",shortDescription:"Typical Price",is_price_study:!0,plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"}},precision:3,inputs:{}},styles:{plot_0:{title:"Plot"}},inputs:[]},constructor:function(){this.main=function(e,t){return this._context=e,this._input=t,[n.Std.hlc3(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:0,visible:!0,color:"#F44336"}},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(e,t,i){var r=this._context.new_var(e),o=this._context.new_var(t);return[n.Std.sum(r,i,this._context)/n.Std.sum(o,i,this._context)]},this.f_1=function(){var e=this._input(0),t=this._input(1),i=this._input(2),r=this._context.new_var(n.Std.close(this._context)),o=n.Std.max(n.Std.high(this._context),r.get(1)),s=this._context.new_var(n.Std.close(this._context)),a=n.Std.min(n.Std.low(this._context),s.get(1)),l=n.Std.close(this._context)-a,c=o-a,u=this.f_0(l,c,e),h=this.f_0(l,c,t),d=this.f_0(l,c,i);return[100*(4*u[0]+2*h[0]+d[0])/7]},this.main=function(e,t){return this._context=e,this._input=t,this.f_1()}}},{name:"Volatility Close-to-Close",metainfo:{_metainfoVersion:41, isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Volatility Close-to-Close@tv-basicstudies-1",scriptIdPart:"",name:"Volatility Close-to-Close",description:"Volatility Close-to-Close",shortDescription:"Volatility Close-to-Close",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},precision:4,inputs:{periods:10,daysPerYear:252}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",name:"Periods",type:"integer",defval:10},{id:"daysPerYear",name:"Days Per Year",type:"integer",defval:252}]},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.daysPerYear=this._input(1)},this.stdev=function(e,t,i){var r=this.variance(e,t,i);return n.Std.sqrt(r)},this.variance=function(e,t,i){var r=n.Std.sma(e,t,i);return this.variance2(e,r,t)},this.variance2=function(e,t,i){var n,r,o=0;for(n=0;n0&&(a=.12*this.square(e.get()-r.get(1))/this.marketClosedPercentage+.88*a/(1-this.marketClosedPercentage)),a/=s,a*=this.secondsPerYear;var l=this._context.new_var(a);return 100*Math.sqrt(n.Std.sum(l,this.period,this._context)/this.period)},this.main=function(e,t){return this._context=e,this._input=t,[this.volatilityOHLC()]}}},{name:"Volatility Index",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Volatility Index",description:"Volatility Index",shortDescription:"Volatility Index",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF5252"}},precision:3,inputs:{periods:10,atrMult:3,method:"Wilder Smoothing"}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",name:"Periods",type:"integer"},{id:"atrMult",name:"ATR Mult",type:"float"},{id:"method",name:"Method",type:"text",defval:"Exponential",options:["Exponential","Wilder Smoothing"]}]},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.atrMult=this._input(1),this.maMethod=this._input(2),this.nextsar=null,this.position=null,this.sic=null,this.bars=[],this.count=0,this.lastSar=null},this.highest=function(e,t){for(var i=this.bars.length-this.period,n=this.bars[i],r=i+1;rn&&(n=this.bars[r]);return n},this.computeATR=function(){var e=n.Std.high(this._context)-n.Std.low(this._context),t=n.Std.high(this._context)-this.bars[this.bars.length-2],i=this.bars[this.bars.length-2]-n.Std.low(this._context);return this.tr=Math.max(e,t,i), "Exponential"===this.maMethod?this.atr=n.Std.ema(this._context.new_var(this.tr),this.period,this._context):this.atr=this.tr/this.period+(1-1/this.period)*this.atr,this.atr*this.atrMult},this.calculateVolatility=function(){if(n.Std.close(this._context)===this.bars[this.bars.length-1])return this.lastSar;if(this.bars.push(n.Std.close(this._context)),1===this.count)this.atr=n.Std.high(this._context)-n.Std.low(this._context),this.sic=n.Std.close(this._context);else if(this.countthis.sic&&(this.sic=n.Std.close(this._context))}else if(this.count===this.period){e=n.Std.high(this._context)-n.Std.low(this._context),t=n.Std.high(this._context)-this.bars[this.bars.length-2],i=this.bars[this.bars.length-2]-n.Std.low(this._context);this.atr+=Math.max(e,t,i),this.atr*=1/this.period,n.Std.close(this._context)>this.sic&&(this.sic=n.Std.close(this._context)),this.position="LONG",this.nextsar=this.sic-this.atr*this.atrMult}else{var r=this.nextsar;"LONG"===this.position?n.Std.close(this._context)r?(this.position="LONG",this.sic=n.Std.close(this._context),this.nextsar=this.sic-this.computeATR()):(this.position="SHORT",this.sic=Math.min(n.Std.close(this._context),this.sic),this.nextsar=this.sic+this.computeATR())),this.lastSar=r}return this.count++,r},this.main=function(e,t){return this._context=e,this._input=t,this._context.select_sym(0),[this.calculateVolatility()]}}},{name:"VWAP",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:0,transparency:0,visible:!0,color:"#2196F3"}},precision:4},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"VWAP",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"VWAP",shortDescription:"VWAP",is_price_study:!0,inputs:[],id:"VWAP@tv-basicstudies-1",scriptIdPart:"",name:"VWAP"},constructor:function(){this.f_1=function(e){e.hist=null,e.add_hist()},this.init=function(e,t){this._isNewSession=null},this.main=function(e,t){this._context=e,this._input=t;var i=e.new_var(),r=e.new_var(),o=this._context.symbol.time;return o&&(null===this._isNewSession&&(this._isNewSession=n.Std.createNewSessionCheck(e)),this._isNewSession(o)&&(this.f_1(i),this.f_1(r))),i.set(n.Std.nz(i.get(1))+n.Std.hlc3(this._context)*n.Std.volume(this._context)),r.set(n.Std.nz(r.get(1))+n.Std.volume(this._context)),[i.get(0)/r.get(0)]}}},{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:0,visible:!0, color:"#2196F3"}},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(e,t){this._context=e,this._input=t;var i=n.Std.close(this._context),r=this._input(0),o=this._context.new_var(i);return[n.Std.vwma(o,r,this._context)]}}},{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:0,visible:!0,color:"#2196F3"}},precision:4,bands:[{color:"#787B86",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(e,t){return 100*(e-t)/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=n.Std.volume(this._context),s=this._context.new_var(o),a=n.Std.ema(s,i,this._context),l=this._context.new_var(o),c=n.Std.ema(l,r,this._context);return[this.f_0(a,c)]}}},{name:"Vortex Indicator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#E91E63"}},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 e=this._input(0),t=this._context.new_var(n.Std.low(this._context)),i=this._context.new_var(n.Std.abs(n.Std.high(this._context)-t.get(1))),r=n.Std.sum(i,e,this._context),o=this._context.new_var(n.Std.high(this._context)),s=this._context.new_var(n.Std.abs(n.Std.low(this._context)-o.get(1))),a=n.Std.sum(s,e,this._context),l=this._context.new_var(n.Std.atr(1,this._context)),c=n.Std.sum(l,e,this._context);return[r/c,a/c]},this.main=function(e,t){return this._context=e,this._input=t,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:0,visible:!0,color:"#7E57C2"}},precision:4,bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-20},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-80}],filledAreasStyle:{fill_0:{color:"#7E57C2",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Williams %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(e,t,i){return 100*(e-t)/(t-i)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),r=n.Std.high(this._context),o=this._context.new_var(r),s=n.Std.highest(o,i,this._context),a=n.Std.low(this._context),l=this._context.new_var(a),c=n.Std.lowest(l,i,this._context);return[this.f_0(n.Std.close(this._context),s,c)]}}},{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:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#E91E63"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#66BB6A"}},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(e,t){this._context=e,this._input=t;var i=this._input(0),r=this._input(1),o=this._input(2),s=n.Std.hl2(this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this._context.new_var(s),u=n.Std.ema(c,r,this._context),h=this._context.new_var(s);return[{value:l,offset:8},{value:u,offset:5},{value:n.Std.ema(h,o,this._context),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:"#F44336"},plot_1:{plottype:"shape_triangle_up",visible:!0,location:"AboveBar",transparency:0,color:"#009688"}},precision:0,inputs:{in_0:2}},plots:[{id:"plot_0",type:"shapes"},{ id:"plot_1",type:"shapes"}],styles:{plot_0:{title:"Down fractals",isHidden:!1},plot_1:{title:"Up fractals",isHidden:!1}},description:"Williams Fractal",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(){for(var e=this._input(0),t=this._context.new_var(n.Std.high(this._context)),i=!0,r=!0,o=!0,s=!0,a=!0,l=!0,c=1;c<=e;c++)i=n.Std.and(i,n.Std.lt(t.get(e-c),t.get(e))),r=n.Std.and(r,n.Std.lt(t.get(e+c),t.get(e))),o=n.Std.and(o,n.Std.and(n.Std.le(t.get(e+1),t.get(e)),n.Std.lt(t.get(e+c+1),t.get(e)))),s=n.Std.and(s,n.Std.and(n.Std.le(t.get(e+1),t.get(e)),n.Std.and(n.Std.le(t.get(e+2),t.get(e)),n.Std.lt(t.get(e+c+2),t.get(e))))),a=n.Std.and(a,n.Std.and(n.Std.le(t.get(e+1),t.get(e)),n.Std.and(n.Std.le(t.get(e+2),t.get(e)),n.Std.and(n.Std.le(t.get(e+3),t.get(e)),n.Std.lt(t.get(e+c+3),t.get(e)))))),l=n.Std.and(l,n.Std.and(n.Std.le(t.get(e+1),t.get(e)),n.Std.and(n.Std.le(t.get(e+2),t.get(e)),n.Std.and(n.Std.le(t.get(e+3),t.get(e)),n.Std.and(n.Std.le(t.get(e+4),t.get(e)),n.Std.lt(t.get(e+c+4),t.get(e)))))));var u=n.Std.or(r,n.Std.or(o,n.Std.or(s,n.Std.or(a,l)))),h=n.Std.and(i,u),d=this._context.new_var(n.Std.low(this._context)),p=1,f=1,_=1,m=1,v=1,y=1;for(c=1;c<=e;c++)p=n.Std.and(p,n.Std.gt(d.get(e-c),d.get(e))),f=n.Std.and(f,n.Std.gt(d.get(e+c),d.get(e))),_=n.Std.and(_,n.Std.and(n.Std.ge(d.get(e+1),d.get(e)),n.Std.gt(d.get(e+c+1),d.get(e)))),m=n.Std.and(m,n.Std.and(n.Std.ge(d.get(e+1),d.get(e)),n.Std.and(n.Std.ge(d.get(e+2),d.get(e)),n.Std.gt(d.get(e+c+2),d.get(e))))),v=n.Std.and(v,n.Std.and(n.Std.ge(d.get(e+1),d.get(e)),n.Std.and(n.Std.ge(d.get(e+2),d.get(e)),n.Std.and(n.Std.ge(d.get(e+3),d.get(e)),n.Std.gt(d.get(e+c+3),d.get(e)))))),y=n.Std.and(y,n.Std.and(n.Std.ge(d.get(e+1),d.get(e)),n.Std.and(n.Std.ge(d.get(e+2),d.get(e)),n.Std.and(n.Std.ge(d.get(e+3),d.get(e)),n.Std.and(n.Std.ge(d.get(e+4),d.get(e)),n.Std.gt(d.get(e+c+4),d.get(e)))))));var g=n.Std.or(f,n.Std.or(_,n.Std.or(m,n.Std.or(v,y))));return[n.Std.and(p,g),h]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[{value:i[0],offset:-this._input(0)},{value:i[1],offset:-this._input(0)}]}}},{name:"Guppy Multiple Moving Average",metainfo:{isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,description:"Guppy Multiple Moving Average",shortDescription:"GMMA",is_price_study:!0,id:"Guppy Multiple Moving Average@tv-basicstudies-1",_metainfoVersion:52,format:{type:"inherit"},defaults:{inputs:{traderEMA1Length:3,traderEMA2Length:5,traderEMA3Length:8,traderEMA4Length:10,traderEMA5Length:12,traderEMA6Length:15,investorEMA1Length:30,investorEMA2Length:35,investorEMA3Length:40,investorEMA4Length:45,investorEMA5Length:50,investorEMA6Length:60},styles:{traderEMA1:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:15,visible:!0},traderEMA2:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0, trackPrice:!1,transparency:12,visible:!0},traderEMA5:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:3,visible:!0},investorEMA6:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0},traderEMA3:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:9,visible:!0},traderEMA4:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:6,visible:!0},traderEMA5:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:3,visible:!0},traderEMA6:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0},investorEMA1:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:15,visible:!0},investorEMA2:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:12,visible:!0},investorEMA3:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:9,visible:!0},investorEMA4:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:6,visible:!0}}},inputs:[{defval:3,id:"traderEMA1Length",max:1e3,min:1,name:"Trader EMA 1 length",type:"integer"},{defval:5,id:"traderEMA2Length",max:1e3,min:1,name:"Trader EMA 2 length",type:"integer"},{defval:8,id:"traderEMA3Length",max:1e3,min:1,name:"Trader EMA 3 length",type:"integer"},{defval:10,id:"traderEMA4Length",max:1e3,min:1,name:"Trader EMA 4 length",type:"integer"},{defval:12,id:"traderEMA5Length",max:1e3,min:1,name:"Trader EMA 5 length",type:"integer"},{defval:15,id:"traderEMA6Length",max:1e3,min:1,name:"Trader EMA 6 length",type:"integer"},{defval:30,id:"investorEMA1Length",max:1e3,min:1,name:"Investor EMA 1 length",type:"integer"},{defval:35,id:"investorEMA2Length",max:1e3,min:1,name:"Investor EMA 2 length",type:"integer"},{defval:40,id:"investorEMA3Length",max:1e3,min:1,name:"Investor EMA 3 length",type:"integer"},{defval:45,id:"investorEMA4Length",max:1e3,min:1,name:"Investor EMA 4 length",type:"integer"},{defval:50,id:"investorEMA5Length",max:1e3,min:1,name:"Investor EMA 5 length",type:"integer"},{defval:60,id:"investorEMA6Length",max:1e3,min:1,name:"Investor EMA 6 length",type:"integer"}],plots:[{id:"traderEMA1",type:"line"},{id:"traderEMA2",type:"line"},{id:"traderEMA3",type:"line"},{id:"traderEMA4",type:"line"},{id:"traderEMA5",type:"line"},{id:"traderEMA6",type:"line"},{id:"investorEMA1",type:"line"},{id:"investorEMA2",type:"line"},{id:"investorEMA3",type:"line"},{id:"investorEMA4",type:"line"},{id:"traderEMA5",type:"line"},{id:"investorEMA6",type:"line"}],styles:{traderEMA1:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 1"},traderEMA2:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 2"},traderEMA3:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 3"},traderEMA4:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 4"},traderEMA5:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 5"},traderEMA6:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 6"},investorEMA1:{ histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 1"},investorEMA2:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 2"},investorEMA3:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 3"},investorEMA4:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 4"},investorEMA5:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 5"},investorEMA6:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 6"}}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.Std.close(this._context)),r=this._input(0),o=this._input(1),s=this._input(2),a=this._input(3),l=this._input(4),c=this._input(5),u=n.Std.ema(i,r,this._context),h=n.Std.ema(i,o,this._context),d=n.Std.ema(i,s,this._context),p=n.Std.ema(i,a,this._context),f=n.Std.ema(i,l,this._context),_=n.Std.ema(i,c,this._context),m=this._input(6),v=this._input(7),y=this._input(8),g=this._input(9),b=this._input(10),S=this._input(11);return[u,h,d,p,f,_,n.Std.ema(i,m,this._context),n.Std.ema(i,v,this._context),n.Std.ema(i,y,this._context),n.Std.ema(i,g,this._context),n.Std.ema(i,b,this._context),n.Std.ema(i,S,this._context)]}}}]},"2h0C":function(e,t,i){var n=i("txPx").getLogger("Chart.PropertyPage.Binding");function r(e,t,i,r,o,s){e?(this._control=e,this._property=t,this._applyOnFly=i,this._undoModel=r,this._undoText=o,this._doesNotAffectSave=!1,t&&(this._formatters=[],this._changed=!1,this.setValue(t.value()),t.subscribe(this,this.propertyChanged))):n.logDebug("Missing control")}r.prototype.addFormatter=function(e){this._formatters.push(e),this.setValue(this._property.value())},r.prototype._formatValue=function(e){return this._formatters.reduce((function(e,t){return t(e)}),e)},r.prototype._setValueToProperty=function(e){this._setter?this._setter.call(this,e):this.setValueToProperty(e)},r.prototype._attachToControl=function(e,t){var i=this;t?e.on("keyup change input",(function(e){var t=i.value();i._setValueToProperty(t),i.setValue(t)})):(e.keypress((function(e){if(i._changed=!0,13===e.which){var t=i.value();i._setValueToProperty(t),i.setValue(t)}})),e.focusout((function(e){var t=i.value();i.changed()&&(i._setValueToProperty(t),i.setValue(t))})),e.change((function(e){var t=i.value();$(e.target).is(".ticker")?(void 0!==i._changeTimerId&&clearTimeout(i._changeTimerId),i._changeTimerId=setTimeout((function(){i._setValueToProperty(t)}),250)):i._setValueToProperty(t),i.setValue(t)})))},r.prototype.control=function(){return this._control},r.prototype.changed=function(){return this._changed},r.prototype.setValueToProperty=function(e){this._undoModel.setProperty(this._property,e,this._undoText,this._doesNotAffectSave),this._changed=!1},r.prototype.property=function(){return this._property},r.prototype.propertyChanged=function(e){this.setValue(e.value())},r.prototype.destroy=function(){this._property&&this._property.unsubscribe(this,this.propertyChanged)},r.prototype.disableAffectingSave=function(){this._doesNotAffectSave=!0},t.Binding=r},"2ijp":function(e,t,i){"use strict" ;i.d(t,"a",(function(){return o}));var n=i("l4sv"),r=i("8Uy/"),o=function(){function e(){this._lineRendererData={y:0,color:"rgba(0, 0, 0, 0)",linewidth:1,linestyle:r.LINESTYLE_SOLID,visible:!1},this._lineRenderer=new n.HorizontalLineRenderer,this._invalidated=!0,this._lineRenderer.setData(this._lineRendererData)}return e.prototype.update=function(){this._invalidated=!0},e.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._lineRenderer},e}()},"2jXJ":function(e,t,i){"use strict";i.r(t),i.d(t,"supportedLineTools",(function(){return n}));var n={cursor:{name:"cursor",onlySelectable:!0},dot:{name:"dot",onlySelectable:!0},arrow_cursor:{name:"arrow",onlySelectable:!0},eraser:{name:"eraser",onlySelectable:!0},measure:{name:"measure",onlySelectable:!0},zoom:{name:"zoom",onlySelectable:!0},brush:{name:"LineToolBrush"},highlighter:{name:"LineToolHighlighter"},text:{name:"LineToolText"},anchored_text:{name:"LineToolTextAbsolute"},note:{name:"LineToolNote"},anchored_note:{name:"LineToolNoteAbsolute"},signpost:{name:"LineToolSignpost"},callout:{name:"LineToolCallout"},balloon:{name:"LineToolBalloon"},arrow_up:{name:"LineToolArrowMarkUp"},arrow_down:{name:"LineToolArrowMarkDown"},arrow_left:{name:"LineToolArrowMarkLeft"},arrow_right:{name:"LineToolArrowMarkRight"},price_label:{name:"LineToolPriceLabel"},price_note:{name:"LineToolPriceNote"},arrow_marker:{name:"LineToolArrowMarker"},flag:{name:"LineToolFlagMark"},vertical_line:{name:"LineToolVertLine"},horizontal_line:{name:"LineToolHorzLine"},cross_line:{name:"LineToolCrossLine"},horizontal_ray:{name:"LineToolHorzRay"},trend_line:{name:"LineToolTrendLine"},info_line:{name:"LineToolInfoLine"},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_fixed:{name:"LineToolGannFixed"},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"},path:{name:"LineToolPath"},curve:{name:"LineToolBezierQuadro"},double_curve:{name:"LineToolBezierCubic"},arc:{name:"LineToolArc"},icon:{name:"LineToolIcon"}}},"2kV1":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyStatusView",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t){return e.call(this,t.statusProvider({}))||this}return Object(n.c)(t,e),t.prototype.color=function(){return this._statusProvider.color()},t.prototype.getSplitTitle=function(){return this._statusProvider.getSplitTitle()},t.prototype.update=function(){this._text=this._statusProvider.text()},t}(i("nBJD").a)},"2uTr":function(e,t,i){"use strict";function n(e){return e+"…"}i.r(t),i.d(t,"appendEllipsis",(function(){return n}))},"3/8U":function(e,t,i){"use strict";function n(e){return"dark"===e?"rgba(30,136,229,0.25)":"rgba(33,150,243,0.25)"}i.r(t),i.d(t,"axesHighlightColor",(function(){return n}))},"33fJ":function(e,t,i){"use strict";i.r(t),i.d(t,"TimeScaleBuilder",(function(){return l}));var n=i("Eyy1"),r=i("Y7w9"),o=i("IiTo"),s=i("IDnv");function a(e,t){return e.length>t}var l=function(){function e(e,t,i){void 0===i&&(i=2e5),this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._projectionFirstIndex=1/0,this._barsTimes=[],this._minFutureBarsCount=0,this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._extrapolateLimit=i,this._barBuilder=Object(o.newBarBuilder)(t,new o.SessionInfo(e.timezone,e.session,e.holidays,e.corrections),null)}return e.prototype.destroy=function(){this.clear()},e.prototype.clear=function(){this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._barsTimes=[],this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._minFutureBarsCount=0,this._projectionFirstIndex=1/0},e.prototype.firstFutureBarIndex=function(){return this._barsTimes.length},e.prototype.futureBars=function(){return this._futureBarsCache},e.prototype.setBarsTimes=function(e,t){void 0===t&&(t=e.length);var i=this._barsTimes;if(this._barsTimes=e,this._projectionFirstIndex=0===this._barsTimes.length?1/0:t, 0===e.length)return this._historyBarsCache=[],this._futureBarsCache=[],this._firstRealBarTimeMs=null,void(this._lastRealBarTimeMs=null);if(0===i.length||i[i.length-1]!==e[e.length-1]){this._lastRealBarTimeMs=e[e.length-1];var n=this._futureBarsCache.length,r=this._futureBarsCache.indexOf(this._lastRealBarTimeMs);this._futureBarsCache=-1!==r?this._futureBarsCache.slice(r+1):[],this._ensureExtrapolatedToFutureBar(Math.max(n,this._minFutureBarsCount))}0!==i.length&&i[0]===e[0]||(this._historyBarsCache=[],this._firstRealBarTimeMs=e[0])},e.prototype.extrapolateTimeWithOffsetToTime=function(e,t){if(0===t)return{timeMs:e,exact:!0};0===this._barsTimes.length&&(t<0?null===this._firstRealBarTimeMs?this._firstRealBarTimeMs=e:(this._extendHistoryCacheToTimeFromRight(Math.min(e,null!==this._lastRealBarTimeMs?this._lastRealBarTimeMs:1/0)),this._ensureExtrapolatedToHistoryTime(e)):null===this._lastRealBarTimeMs?this._lastRealBarTimeMs=e:(this._extendFutureCacheToTimeFromLeft(Math.max(e,null!==this._firstRealBarTimeMs?this._firstRealBarTimeMs:1/0)),this._ensureExtrapolatedToFutureTime(e)));var i=this.indexOfTime(e);if(null===i)return null;var n=this._timeOfBarIndex(i+t);return null===n?null:((i<0||this._projectionFirstIndex<=i)&&(n.exact=!1),n)},e.prototype.indexOfTime=function(e){if(null!==this._firstRealBarTimeMs&&ethis._lastRealBarTimeMs){this._ensureExtrapolatedToFutureTime(e);var i=Object(r.lowerbound_int)(this._futureBarsCache,e);return i===this._futureBarsCache.length?null:(this._futureBarsCache[i]!==e&&(i-=1),Math.max(1,this._barsTimes.length)+i)}if(0===this._barsTimes.length)return null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||null!==this._lastRealBarTimeMs&&e<=this._lastRealBarTimeMs?0:null;var n=Object(r.lowerbound_int)(this._barsTimes,e);return this._barsTimes[n]!==e&&(n-=1),n},e.prototype.setMinFutureBarsCount=function(e){return this._minFutureBarsCount=e,0!==this._barsTimes.length&&this._ensureExtrapolatedToFutureBar(e)},e.prototype._timeOfBarIndex=function(e){if(e<0){var t=Math.abs(e);this._ensureExtrapolatedToHistoryBar(t);var i=this._historyBarsCache.length-t;return i<0?null:{timeMs:this._historyBarsCache[i],exact:!1}}if(0===e&&0===this._barsTimes.length)return{timeMs:Object(n.ensureNotNull)(this._lastRealBarTimeMs),exact:!1};if(e>=this._barsTimes.length){t=e-Math.max(1,this._barsTimes.length);return this._ensureExtrapolatedToFutureBar(t+1),t>=this._futureBarsCache.length?null:{timeMs:this._futureBarsCache[t],exact:!1}}return{timeMs:this._barsTimes[e],exact:e=e)&&(Object(n.assert)(0===this._barsTimes.length,"bars should be empty"),this._firstRealBarTimeMs=e,0!==this._historyBarsCache.length)){var t=Object(s.extrapolateBarsFrontToTime)(this._barBuilder,this._historyBarsCache[this._historyBarsCache.length-1],e-1,this._extrapolateLimit,!0).times;this._historyBarsCache=this._historyBarsCache.concat(t)}},e.prototype._ensureExtrapolatedToFutureBar=function(e){var t=this;return!(this._futureBarsCache.length>=e||a(this._futureBarsCache,this._extrapolateLimit))&&this._extendFutureCacheFromRight((function(i,n){return Object(s.extrapolateBarsFrontByCount)(t._barBuilder,i,e-n,!0).times}))},e.prototype._ensureExtrapolatedToFutureTime=function(e){var t=this;null!==this._lastRealBarTimeMs&&this._lastRealBarTimeMs>=e||a(this._futureBarsCache,this._extrapolateLimit)||0!==this._futureBarsCache.length&&this._futureBarsCache[this._futureBarsCache.length-1]>=e||(this._extendFutureCacheFromRight((function(i,n){return Object(s.extrapolateBarsFrontToTime)(t._barBuilder,i,e,t._extrapolateLimit,!0).times})),this._futureBarsCache[this._futureBarsCache.length-1]=e||a(this._historyBarsCache,this._extrapolateLimit)||this._extendHistoryCacheFromLeft((function(i,n){return Object(s.extrapolateBarsFrontByCount)(t._barBuilder,i,-(e-n),!0).times.reverse()}))},e.prototype._ensureExtrapolatedToHistoryTime=function(e){var t=this;null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||a(this._historyBarsCache,this._extrapolateLimit)||0!==this._historyBarsCache.length&&this._historyBarsCache[0]<=e||(this._extendHistoryCacheFromLeft((function(i,n){return Object(s.extrapolateBarsFrontToTime)(t._barBuilder,i-1,e-1,t._extrapolateLimit,!0).times})),this._historyBarsCache[0]>e&&this._ensureExtrapolatedToHistoryBar(this._historyBarsCache.length+1))},e}()},"38az":function(e,t,i){"use strict";var n=i("k9/m").PlotRowSearchMode;function r(){this.backColorers=[]}function o(e){r.call(this),this._series=e}function s(e,t){r.call(this),this._study=e,this._plotIndex=t} r.prototype.barStyle=function(e,t,i){for(var n={},r=this.backColorers.length-1;r>=0;r--)this.backColorers[r].applyBarStyle(e,t,n,i);return this.applyBarStyle(e,t,n,i),n},r.prototype.pushBackBarColorer=function(e){this.backColorers.push(e)},r.prototype.applyBarStyle=function(e,t,i){throw new Error("This function is supposed to be reimplemented in a subclass")},inherit(o,r),o.upColor=function(e,t){switch(e.style.value()){case TradingView.Series.STYLE_LINE:return e.lineStyle.color.value();case TradingView.Series.STYLE_AREA:return e.areaStyle.linecolor.value();case TradingView.Series.STYLE_BARS:return e.barStyle.upColor.value();case TradingView.Series.STYLE_CANDLES:return e.candleStyle.upColor.value();case TradingView.Series.STYLE_HOLLOW_CANDLES:return e.hollowCandleStyle.upColor.value();case TradingView.Series.STYLE_HEIKEN_ASHI:return e.haStyle.upColor.value();case TradingView.Series.STYLE_BASELINE:return e.baselineStyle.topLineColor.value();case TradingView.Series.STYLE_HILO:return e.hiloStyle.color.value()}throw new Error("Unknown series style")},o.downColor=function(e,t){switch(e.style.value()){case TradingView.Series.STYLE_LINE:return e.lineStyle.color.value();case TradingView.Series.STYLE_AREA:return e.areaStyle.linecolor.value();case TradingView.Series.STYLE_BARS:return e.barStyle.downColor.value();case TradingView.Series.STYLE_CANDLES:return e.candleStyle.downColor.value();case TradingView.Series.STYLE_HOLLOW_CANDLES:return e.hollowCandleStyle.downColor.value();case TradingView.Series.STYLE_HEIKEN_ASHI:return e.haStyle.downColor.value();case TradingView.Series.STYLE_BASELINE:return e.baselineStyle.bottomLineColor.value();case TradingView.Series.STYLE_HILO:return e.hiloStyle.color.value()}throw new Error("Unknown series style")},o.prototype._applyLineStyle=function(e,t,i,n,r){i.barColor=o.upColor(r)},o.prototype._applyAreaStyle=function(e,t,i,n,r){i.barColor=o.upColor(r)},o.prototype._applyBarStyle=function(e,t,i,n,r){var s=o.upColor(r),a=o.downColor(r),l=this.findBar(e,!1,n);if(r.barStyle.barColorsOnPrevClose.value()){var c=this.findPrevBar(e,!1,n);i.barColor=c[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]?s:a,i.barBorderColor=c[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]?s:a}else i.barColor=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?s:a,i.barBorderColor=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?s:a},o.prototype._applyCandleStyle=function(e,t,i,n,r){var s,a=o.upColor(r,t),l=o.downColor(r,t),c=r.candleStyle.borderUpColor?r.candleStyle.borderUpColor.value():r.candleStyle.borderColor.value(),u=r.candleStyle.borderDownColor?r.candleStyle.borderDownColor.value():r.candleStyle.borderColor.value(),h=r.candleStyle.wickUpColor?r.candleStyle.wickUpColor.value():r.candleStyle.wickColor.value(),d=r.candleStyle.wickDownColor?r.candleStyle.wickDownColor.value():r.candleStyle.wickColor.value(),p=this.findBar(e,!1,n);r.candleStyle.barColorsOnPrevClose.value()?s=this.findPrevBar(e,!1,n)[TradingView.CLOSE_PLOT]<=p[TradingView.CLOSE_PLOT]:s=p[TradingView.OPEN_PLOT]<=p[TradingView.CLOSE_PLOT] ;i.barColor=s?a:l,i.barBorderColor=s?c:u,i.barWickColor=s?h:d},o.prototype._applyHollowCandleStyle=function(e,t,i,n,r){var s=o.upColor(r,t),a=o.downColor(r,t),l=r.hollowCandleStyle.borderUpColor?r.hollowCandleStyle.borderUpColor.value():r.hollowCandleStyle.borderColor.value(),c=r.hollowCandleStyle.borderDownColor?r.hollowCandleStyle.borderDownColor.value():r.hollowCandleStyle.borderColor.value(),u=r.hollowCandleStyle.wickUpColor?r.hollowCandleStyle.wickUpColor.value():r.hollowCandleStyle.wickColor.value(),h=r.hollowCandleStyle.wickDownColor?r.hollowCandleStyle.wickDownColor.value():r.hollowCandleStyle.wickColor.value(),d=this.findBar(e,!1,n);this.findPrevBar(e,!1,n)[TradingView.CLOSE_PLOT]<=d[TradingView.CLOSE_PLOT]?(i.barColor=s,i.barBorderColor=l,i.barWickColor=u):(i.barColor=a,i.barBorderColor=c,i.barWickColor=h),i.isBarHollow=d[TradingView.OPEN_PLOT]<=d[TradingView.CLOSE_PLOT]},o.prototype._applyHAStyle=function(e,t,i,n,r){var s,a=o.upColor(r,t),l=o.downColor(r,t),c=r.haStyle.borderUpColor.value(),u=r.haStyle.borderDownColor.value(),h=r.haStyle.wickUpColor.value(),d=r.haStyle.wickDownColor.value(),p=this.findBar(e,t,n);r.haStyle.barColorsOnPrevClose.value()?s=this.findPrevBar(e,t,n)[TradingView.CLOSE_PLOT]<=p[TradingView.CLOSE_PLOT]:s=p[TradingView.OPEN_PLOT]<=p[TradingView.CLOSE_PLOT];i.barColor=s?a:l,i.barBorderColor=s?c:u,i.barWickColor=s?h:d},o.prototype._applyBaseLineStyle=function(e,t,i,n,r){var s=this.findBar(e,t,n),a=r.baselineStyle,l=this._series.priceScale(),c=Math.round(l.height()*(Math.abs(100-a.baseLevelPercentage.value())/100)),u=this._series.firstValue(),h=l.coordinateToPrice(c,u);s[TradingView.CLOSE_PLOT]>h?i.barColor=o.upColor(r,t):i.barColor=o.downColor(r,t)},o.prototype._applyHiLoStyle=function(e,t,i,n,r){i.barColor=o.upColor(r,t),i.barBorderColor=r.hiloStyle.borderColor.value()},o.prototype.applyBarStyle=function(e,t,i,n){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,i.isMergedBar=null;var r=this._series.properties();switch(r.style.value()){case TradingView.Series.STYLE_LINE:this._applyLineStyle(e,t,i,n,r);break;case TradingView.Series.STYLE_AREA:this._applyAreaStyle(e,t,i,n,r);break;case TradingView.Series.STYLE_BARS:this._applyBarStyle(e,t,i,n,r);break;case TradingView.Series.STYLE_CANDLES:this._applyCandleStyle(e,t,i,n,r);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._applyHollowCandleStyle(e,t,i,n,r);break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._applyHAStyle(e,t,i,n,r);break;case TradingView.Series.STYLE_BASELINE:this._applyBaseLineStyle(e,t,i,n,r);break;case TradingView.Series.STYLE_HILO:this._applyHiLoStyle(e,t,i,n,r)}return i},o.prototype.getSeriesBars=function(e){return e?this._series.nsBars():this._series.bars()},o.prototype._findBarFieldValue=function(e,t,i){var n=this.getSeriesBars(i).valueAt(e);if(null!==n)return n[t]},o.prototype.findBar=function(e,t,i){return i?i.value:this.getSeriesBars(t).valueAt(e)||[]},o.prototype.findPrevBar=function(e,t,i){ if(i&&i.previousValue)return i.previousValue;var r=this._series.bars().search(e-1,n.NearestLeft,TradingView.CLOSE_PLOT);return null!==r?r.value:[]},inherit(s,r),s.prototype.getBars=function(){return this._study.series().bars()},s.prototype.firstColoredBar=function(e){for(var t=e,i=0;ie+a)return i;var l=n.styles[s.id];if(l.visible&&!l.visible.value())return i;var c=o.valueAt(e-a);if(null===c)return i;var u=c[this._plotIndex+1];if(null==u)return i;u=Math.round(u);var h=r.plots[this._plotIndex].palette,d=n.palettes[h],p=r.palettes[h].valToIndex?r.palettes[h].valToIndex[u]:u,f=d.colors[p].color.value();return i.barColor=f,i.upColor=f.color,i.downColor=f.color,i},t.SeriesBarColorer=o,t.StudyBarColorer=s},"39QR":function(e,t,i){"use strict";i.r(t),i.d(t,"LineDataSourcePointPriceProperty",(function(){return s}));var n=i("mrSG"),r=i("Eyy1"),o=i("tc+8"),s=function(e){function t(t,i){var n=e.call(this)||this;return n._lineSource=t,n._pointIndex=i,t.pointAdded().subscribe(n,(function(e){n._pointIndex===e&&n._listeners.fire(n)})),t.pointChanged().subscribe(n,(function(e){n._pointIndex===e&&n._listeners.fire(n)})),n}return Object(n.c)(t,e),t.prototype.value=function(){var e=this._lineSource.points()[this._pointIndex].price,t=Object(r.ensureNotNull)(this._lineSource.ownerSource()).formatter();if(t.parse){var i=t.format(e),n=t.parse(i);return n.res?n.value:e}return e},t.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.price=parseFloat(""+e),this._lineSource.startChanging(this._pointIndex,t),this._lineSource.setPoint(this._pointIndex,t),this._lineSource.model().updateSource(this._lineSource),this._listeners.fire(this);var i=this._lineSource.endChanging(!0,!1);this._lineSource.syncMultichartState(i),this._lineSource.properties().lastUpdateTime.setValue((new Date).valueOf())},t}(i.n(o).a)},"3ClC":function(e,t,i){"use strict";i.r(t);var n=i("0YCj"),r=i.n(n),o=i("GVHu"),s=i("PL0c"),a=i("cKqi"),l=i("YzC7"),c=i("TMWk"),u=i("8sOK"),h=i("mrSG"),d=function(e){function t(t,i,n,r){var o=e.call(this,t,i,n,r)||this;return o.properties().styles.vol_ma.visible.listeners().subscribe(o,(function(){return o.invalidateTitleCache()})),o}return Object(h.c)(t,e),t.prototype.base=function(){return 1},t.prototype.destroy=function(){this.properties().styles.vol_ma.visible.listeners().unsubscribeAll(this),e.prototype.destroy.call(this)},t.prototype._titleInputs=function(){var e={symbolsForDisplay:!0, skipHiddenInputs:!0,fakeInputsForDisplay:!0,asObject:!1};return this.properties().styles.vol_ma.visible.value()?this.inputs(e):this.inputs(Object(h.a)(Object(h.a)({},e),{skippedInputs:["length"]}))},t}(o.Study),p=i("Eyy1"),f=i("Qb4w");var _=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.c)(t,e),t.prototype.priceRange=function(e,t){var i=this,n=!1;this.graphics().hhists().forEach((function(e,t){n=n||i.properties().child("graphics").child("hhists").child(t).child("showValues").value()}));var r=function(e,t,i,n){var r=null;return e.forEach((function(e,n){e.forEach((function(e){e.firstBarTime<=i&&e.lastBarTime>=t&&(null===r?r={low:{l:e.priceLow,h:e.priceHigh},high:{h:e.priceHigh}}:(e.priceLowt&&(Object(r.assert)(l(this._source.toolname)),e=e.slice(0,t)),this._pointsConverter.dataSourcePointsToPriced(e)},e.prototype.setPoints=function(e){if(!this._source.isFixed()){var t=a(this._source);if(t!==e.length)throw new Error("Wrong points count. Required: "+t+", provided: "+e.length);var i=this._pointsConverter.apiPointsToDataSource(e);this._model.startChangingLinetool(this._source),this._model.changeLinePoints(this._source,i),this._model.endChangingLinetool(!0),this._source.createServerPoints()}},e.prototype.changePoint=function(e,t){if(!this._source.isFixed()){var i=this._pointsConverter.apiPointsToDataSource([e])[0];this._model.startChangingLinetool(this._source,Object(n.a)({},i),t),this._model.changeLinePoint(Object(n.a)({},i)),this._model.endChangingLinetool(!1),this._source.createServerPoints()}},e.prototype.isHidden=function(){return this._source.isSourceHidden()},e.prototype.getRawPoints=function(){return this._source.points()},e.prototype.setRawPoint=function(e,t){this._model.startChangingLinetool(this._source,Object(n.a)({},t),e),this._model.changeLinePoint(Object(n.a)({},t)),this._model.endChangingLinetool(!1)},e.prototype.move=function(e,t){this._model.startMovingSources([this._source],{logical:e},null,new Map),this._model.moveSources({logical:t},new Map),this._model.endMovingSources(!1)},e.prototype._setProps=function(e,t,i){for(var n in t)if(t.hasOwnProperty(n)){var r=0===i.length?n:i+"."+n;if(e.hasOwnProperty(n)){var s=t[n];Object(o.isHashObject)(s)?this._setProps(e[n],s,r):e[n].setValue(s)}else console.warn('Unknown property "'+r+'"')}},e}()},"5VQP":function(e,t,i){"use strict";i.r(t),i.d(t,"ContextMenuManager",(function(){return n}));var n,r=i("mrSG"),o=i("tWVy");!function(e){var t=[];function n(){Object(o.b)()}e.createMenu=function(e,o,s){return void 0===o&&(o={}),Object(r.b)(this,void 0,void 0,(function(){var a,l;return Object(r.d)(this,(function(r){switch(r.label){case 0:return[4,Promise.all([i.e("react"),i.e(6),i.e(16),i.e(20),i.e(21),i.e(64),i.e(83),i.e(0),i.e(3),i.e("context-menu-renderer")]).then(i.bind(null,"cbq4"))];case 1:return a=r.sent(),l=new a.ContextMenuRenderer(e,o,(function(){var e=t.indexOf(l);-1!==e&&t.splice(e,1),void 0!==s&&s()}),n),t.push(l),[2,l]}}))}))},e.hideAll=n,e.getShown=function(){for(var e=0;e=48&&e<=57}var c=function(){function e(){this.entries=[],this.firstDayOfWeek=n.MONDAY,this.weekEndsCount=-1}return e.prototype.parseSessions=function(t,i){if(this._clear(),this.timezone=t,"24x7"===(i=this._parseFirstDayOfWeek(i)).toLowerCase())for(var n=0,r=h;n2)return a.logError("Only one `first day` specification expected @ session "+e),e;if(1===t.length)return e;var i=1,r=t[0].indexOf("-")>=0?NaN:parseInt(t[0]);return isNaN(r)&&(i=0,r=parseInt(t[1])),rn.SATURDAY?(a.logError("Unexpected day index @ session: "+e+"; day index "+r),e):(this.firstDayOfWeek=r,t[i])},e._parseDay=function(e){var t=parseInt(e.substring(0,4)),i=parseInt(e.substring(4,6)),n=parseInt(e.substring(6,8));return new s.a(t,i,n)},e._parseSessionEntry=function(t,i){var n=i.split("-");2!==n.length&&(a.logError("Bad sessions entry: "+i),n=["0000","0000"]);var r=0,o=n[0];if(o.includes("F")){ var s=o.split("F");o=s[0],r=""!==s[1]?parseInt(s[1]):1}var l=0,c=n[1];if(c.includes("F")){s=c.split("F");c=s[0],l=""!==s[1]?parseInt(s[1]):1}if(!this._isCorrectSession(o)||!this._isCorrectSession(c))throw new Error("Incorrect entry syntax: "+i);var u=o,h=c;return this._createSessionEntry(t,e._minutesFromHHMM(u),e._minutesFromHHMM(h),r,l)},e._isCorrectSession=function(e){return 4===e.length&&l(e.charCodeAt(0))&&l(e.charCodeAt(1))&&l(e.charCodeAt(2))&&l(e.charCodeAt(3))},e._parseWorkingDays=function(e){for(var t=[],i=0;i0&&(t-=r*n.minutesPerDay),o>0&&(i-=o*n.minutesPerDay),new f(e,t,i-t)},e}();i.d(t,"workingDays",(function(){return u})),i.d(t,"workingDaysAndWeekEnds",(function(){return h})),i.d(t,"compareSessionEntries",(function(){return p})),i.d(t,"SessionEntry",(function(){return f})),i.d(t,"EntryIndex",(function(){return _})),i.d(t,"SessionSpec",(function(){return v}));var u=[n.MONDAY,n.TUESDAY,n.WEDNESDAY,n.THURSDAY,n.FRIDAY],h=[n.SUNDAY,n.MONDAY,n.TUESDAY,n.WEDNESDAY,n.THURSDAY,n.FRIDAY,n.SATURDAY];function d(e,t){return e.compareTo(t)<0}function p(e,t){return e.compareTo(t)}var f=function(){function e(e,t,i){this._dayOfWeek=e,this._start=t,this._length=i}return e.prototype.start=function(){return this._start+n.minutesPerDay*this.sessionStartDaysOffset()},e.prototype.startOffset=function(){return this._start},e.prototype.sessionStartDaysOffset=function(){return this._start>=0?0:this._start%n.minutesPerDay==0?-Math.ceil(this._start/n.minutesPerDay):-Math.floor(this._start/n.minutesPerDay)},e.prototype.isOvernight=function(){return this._start<0},e.prototype.dayOfWeek=function(){return this._dayOfWeek},e.prototype.sessionStartDayOfWeek=function(){var e=this._dayOfWeek-this.sessionStartDaysOffset();return en?1:-1},e.prototype.contains=function(e){var t=60*n.get_hours(e)+n.get_minutes(e),i=n.get_day_of_week(e)-this._dayOfWeek;i>0&&(i-=7);var r=i*n.minutesPerDay+t;return r>=this._start&&r0&&(t-=r*n.minutesPerDay),o>0&&(i-=o*n.minutesPerDay);var s=i-t;this._entries.push(new f(e,t,s))},e.prototype.longestSessionLength=function(){for(var e=0,t=0,i=0,n=this._holidaySessions;ithis._entries.length-1||this._entries[t].dayOfWeek()!==e},e.prototype.isCalWeekEnd=function(e){var t=n.get_day_of_week(e);if(!this._isThereCorrections)return this.isWeekEnd(t);var i=s.a.fromCalendar(e),r=this._holidayAndCorrectionMap.get(i.toString());return void 0===r?this.isWeekEnd(t):0===r.length},e.prototype.hasWeekEnds=function(){return this.weekEndsCount()>0},e.prototype.weekEndsCount=function(){return this._weekEndsCount},e.prototype.holidaysFromYearStart=function(e){if(!this._isThereCorrections)return 0;for(var t=n.get_timezone(this._timezone),i=new s.a(n.get_year(e),n.JANUARY,1),r=s.a.fromCalendar(e),o=0,a=this._selectHolidays(i,r),l=0;l0?1:-1;;){var c=s+l;if(c<0||c>=o.length||o[c].dayOfWeek()!==a)break;s=c}return new _(r.weekIndex,s,o)},e.prototype.getWeekIndex=function(e){if(!this._isThereCorrections)return 0;var t=n.get_day_of_week(e)-n.SUNDAY,i=n.get_timezone("Etc/UTC"),r=n.get_cal(i,n.get_year(e),n.get_month(e),n.get_day_of_month(e)-t) ;return Math.floor((r.getTime()+621672192e5)/1e3/86400/7)},e.prototype.correctTradingDay=function(e){var t=n.get_day_of_week(e),i=60*n.get_hours(e)+n.get_minutes(e),r=this.getWeekIndex(e),o=this.findSession(r,t,i,0),s=o.getEntry().dayOfWeek()-t+7*(o.weekIndex-r);return 0!==s&&n.add_date(e,s),e},e.prototype.alignToSessionStart=function(e,t){void 0===t&&(t=0);var i=n.get_day_of_week(e),r=60*n.get_hours(e)+n.get_minutes(e),o=this.getWeekIndex(e),s=this.findSession(o,i,r,t),a=s.getEntry(),l=a.dayOfWeek()-i+7*(s.weekIndex-o);0!==l&&n.add_date(e,l);var c=a.startOffset();return n.set_hms(e,c/60,c%60,0,0,n.get_timezone(this._timezone)),a.length()},e.prototype.businessDaysToCalendarDays=function(e,t){for(var i=this.getWeekIndex(e),r=n.get_day_of_week(e),o=0,s=0;sc);)a[l].dayOfWeek()=t)return o}i++,r=n.SUNDAY}return o},e.prototype.calendarDaysToBusinessDays=function(e,t){for(var i=this.getWeekIndex(e),r=n.get_day_of_week(e),o=0,s=0;oc);)a[l].dayOfWeek()=t)return s}i++,r=n.SUNDAY}return s},e.prototype.alignToNearestSessionStart=function(e,t){return this._alignToNearestSessionValue(e,t,this._entrySessionStart.bind(this))},e.prototype.alignToNearestSessionEnd=function(e,t){return this._alignToNearestSessionValue(e,t,this._entrySessionEnd.bind(this))},e.prototype.leftBorderOfDailyBar=function(e){var t=this._getEntriesForDay(e);return 0===t.length?null:(t.sort(p),this._getLeftEntryBorder(e,t[0]))},e.prototype.bordersOfDailyBar=function(e){var t=this._getEntriesForDay(e);if(0===t.length)return null;t.sort(p);var i=this._getLeftEntryBorder(e,t[0]),r=t[t.length-1],o=n.clone(e),s=60*(r.startOffset()+r.length())-1,a=Math.floor(s/3600);return s-=3600*a,n.set_hms(o,a,s/60,s%60,0,n.get_timezone(this._timezone)),{from:i,to:o}},e.prototype._getEntriesForWeek=function(e){var t=this._entriesHash.get(e);if(void 0===t)return this._entries;if(null!==t)return t;var i=n.get_timezone(this._timezone);t=this._entries.slice();for(var r=this._weekIndexToCalendar(e),o=this._weekIndexToCalendar(e+1),a=s.a.fromCalendar(r),l=s.a.fromCalendar(o),c=function(e){var r=e.day.toCalendar(i),o=n.get_day_of_week(r);t=(t=t.filter((function(e){return e.dayOfWeek()!==o}))).concat(e.sessions)},u=0,h=this._selectHolidays(a,l);u0&&i>=0||c<0&&i<0)&&n.add_date(t,7*c),!s.contains(t)){var h=a-o;u&&i<0&&(h=-(7-a+o)),n.add_date(t,h),o=n.get_day_of_week(t)}s.isOvernight()&&o===s.dayOfWeek()&&n.add_date(t,-s.sessionStartDaysOffset());var d=r(s),p=Math.floor(d/3600);return d-=3600*p,n.set_hms(t,p,d/60,d%60,0,n.get_timezone(this._timezone)),t},e.prototype._getEntriesForDay=function(e){var t=n.get_day_of_week(e);return this._getEntriesForWeek(this.getWeekIndex(e)).filter((function(e){return e.dayOfWeek()===t}))},e.prototype._getLeftEntryBorder=function(e,t){var i=n.clone(e),r=t.startOffset();return n.set_hms(i,r/60,r%60,0,0,n.get_timezone(this._timezone)),i},e}()},"5rJj":function(e,t,i){"use strict";(function(t){var n=i("ogJP").isSameType,r=i("Ocx9").DefaultProperty;function o(e,t,i,n){this._map=Object.assign({},this._map,n),t&&(t=this.unpackLevels(t)),r.call(this,e,t,i)}inherit(o,r),o.prototype.state=function(e,i){e=e||[];var n=t.prototype.state.call(this,e);return i?n:this.packLevels(n)},o.prototype.clone=function(){for(var e=this.state(),t=new o(this._defaultName,e),i=0;i=0?_.SeriesBarColorer.upColor(this._series.properties()):_.SeriesBarColorer.downColor(this._series.properties());else{var O=this._series.barColorer().barStyle(d,!1);L=w(f,null!=O.barBorderColor?O.barBorderColor:O.barColor)}L=Object(c.resetTransparency)(w(f,L));for(var M=0,A=t;M'},"6et/":function(e,t,i){"use strict";i.r(t),i.d(t,"listen",(function(){return l})),i.d(t,"registerListener",(function(){return c})),i.d(t,"removeListener",(function(){return u})),i.d(t,"pushBackListener",(function(){return h})),i.d(t,"disable",(function(){return d})),i.d(t,"enable",(function(){return p}));var n=i("e3/o"),r=[],o=null;function s(e){for(var t=0;t=0&&!0!==r[t].func(e);t--);}function l(e){e.addEventListener("keypress",a,!1)}function c(e,t){var i={name:e,func:t},n=s(i.name);n>-1?r[n]=i:r.push(i)}function u(e){r.forEach((function(t,i){t.name===e&&r.splice(i,1)}))}function h(e,t){var i={name:e,func:t},n=s(i.name);n>-1&&r.splice(n,1),r.unshift(i)}function d(){return o?null:o=Object(n.randomHashN)(4)}function p(e){if(e!==o)throw Error("Lock id is outdated");o=null}l(window)},"6ptY":function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererSquare",(function(){return s}));var n=i("mrSG"),r=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._drawItemShape=function(e,t,i){var n=t.pixelRatio,r=Math.max(1,Math.floor(n))%2?.5:0,o=this._lineWidth(t)%2?.5:0,s=Math.round(i.height/2*n);(r+s)%1!=o%1&&(s+=.5);var a=Math.round(i.x*n)+r,l=Math.round((i.y+i.vertOffset)*n)+r,c=a-s,u=l-s,h=a+s,d=l+s;e.rect(c,u,h-c,d-u)},t.prototype._calcBoundingBox=function(t){var i=t.height,n=Math.round(i/2),r=t.x-n,s=t.vertOffset,a=t.y+s-n,l=r,c=r+i,u=a,h=a+i,d=new o.Point(l,u),p=new o.Point(c,h),f=Object(o.box)(d,p),_=e.prototype._calcBoundingBox.call(this,t);return _&&(f=this._unionBox(f,_)),f},t}(r.a)},"6sst":function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayStudyPriceLineAxisView",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t){var i=e.call(this)||this;return i._study=t,i}return Object(n.c)(t,e),t.prototype._value=function(){return this._study.lastValueData("",!0)},t.prototype._priceLineColor=function(e){return e},t.prototype._lineWidth=function(){return 1},t.prototype._isVisible=function(){var e=this._study.model().properties().scalesProperties.showSeriesLastValue.value();return this._study.properties().childs().showPriceLine.value()&&e},t}(i("TmNs").PriceLineAxisView)},"6xeX":function(e,t,i){ "use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tooltip=void 0;var n=function(){function e(e,t){for(var i=0;i2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.hasOwnProperty("text")){var s=n&&(0,r.forceLTRStr)(e.text)||e.text;if(e.hasOwnProperty("color")&&i){var a=document.createElement("span");a.style.cssText="color: "+e.color,o.html(a,s),t.appendChild(a)}else o.html(t,s)}else{var l=n&&(0,r.forceLTRStr)(e)||e;o.html(t,l)}return t}function p(e,t){if(Array.isArray(e)&&2===e.length){var i=document.createElement("dl");i.appendChild(d(e[0],document.createElement("dt"))),i.appendChild(d(e[1],document.createElement("dd"),!0,!0)),t.appendChild(i)}else if(e.hasOwnProperty("br")&&e.br)t.appendChild(document.createElement("br"));else{var n=document.createElement("dl");n.appendChild(d(e,document.createElement("dt"))),t.appendChild(n),e.hasOwnProperty("listItem")&&n.classList.add("list-item")}}function f(e,t){var i=(0,r.forceLTRStr)(e.text);e.attr=e.attr||{};var n=document.createElement("a");o.attr(n,"href",e.href),o.addClass(n,e.class),o.attr(n,e.attr.name,e.attr.value),o.html(n,i),t.appendChild(n)}function _(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("string"==typeof e){var n=(0,r.forceLTRStr)(e),s=document.createElement("h2");o.html(s,n),t.appendChild(s)}else if(e.hasOwnProperty("lines"))for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},i=t.direction,n=void 0===i?"top":i,r=t.clickable,o=void 0!==r&&r,s=t.width;l(this,e),this._direction=n,this._tooltipShown=!1,this._tooltipX=void 0,this._tooltipY=void 0,this._tooltipItems=null,this._width=void 0!==s?s:200,this._tooltip=document.createElement("div"),this._tooltip.classList.add("tv-chart-events-source__tooltip"),this._tooltip.style.position="absolute",this._tooltip.style.width=this._width+"px",this._tooltipContent=document.createElement("div"),this._tooltipContent.classList.add("tv-chart-events-source__tooltip__content"),this._tooltip.appendChild(this._tooltipContent),o&&this._tooltip.classList.add("tv-chart-events-source__tooltip--clickable")}return n(e,[{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.items,i=void 0===t?[]:t,n=e.x,r=void 0===n?0:n,s=e.y,a=void 0===s?0:s,l=e.wrapElement,c=void 0===l?null:l,u=e.timeOffset,d=void 0===u?"":u,p=e.leftBorderColor,f=void 0===p?null:p;if(c&&!h(i)){var m=o.contentWidth(c),v=o.contentHeight(c),y=!1,g=!1;if(this._tooltipShown||(c.appendChild(this._tooltip),this._tooltipShown=!0,y=!0,g=!0),r===this._tooltipX&&a===this._tooltipY||(y=!0),y){var b=Math.max(Math.min(r-this._width/2,m-this._width-10),0);this._tooltip.style.left=Math.round(b)+"px",this._tooltip.style.bottom=Math.round(v-a+10)+"px"}if(this._tooltipItems||(g=!0),!g)for(var S=i.length;S--;)if(this._tooltipItems[S]!==i[S]){g=!0;break}if(g){var w=void 0;if(i.length<=1)w=i;else{for(var P={},C=i.length;C--;){var T=i[C].importance;null==T&&(T=-1),P[T]||(P[T]=[]),P[T].push(i[C])}var x=Object.keys(P).sort((function(e,t){return e-t}));if(x.length<=1)w=P[x[0]];else{w=[];for(var I=x.length;I--;)for(var L=P[x[I]],O=L.length;O--;)w.push(L[O])}}this._tooltipContent.innerHTML="";for(var M=w.length;M--;){var A=w[M],k="";A.hasOwnProperty("importance")?("string"==typeof A.importance&&("earnings"===A.importance?k="--importance-earnings":"splits"===A.importance?k="--importance-splits":"dividends"===A.importance?k="--importance-dividends":"list"===A.importance&&(k="--importance-list")),0===A.importance?k="--importance-normal":A.importance>0&&(k="--importance-high")):f||(k="--importance-none") ;var E="tv-chart-events-source__tooltip__item";k&&(E+=" "+E+k);var V=document.createElement("div");o.attr(V,"class",E),f&&(V.style.borderLeftColor=f),_(A,V,d),this._tooltipContent.appendChild(V)}this._tooltipItems=i}"bottom"===this._direction&&(this._tooltip.style.bottom=Math.round(v-a-o.contentHeight(this._tooltipContent)+10)+"px")}}},{key:"hide",value:function(){this._tooltipShown&&(this._tooltip.parentElement&&this._tooltip.parentElement.removeChild(this._tooltip),this._tooltipShown=!1)}},{key:"isOpened",value:function(){return this._tooltipShown}},{key:"getElem",value:function(){return this._tooltip}}]),e}()},"704P":function(e,t,i){"use strict";(function(e){var n=i("Ss5c").LineDataSource,r=i("jkoZ"),o=i("Ocx9").DefaultProperty,s=i("k9/m").PlotRowSearchMode,a=i("s1Gx").sortSourcesPreOrdered.LineToolExecution;function l(e,t){this._pane=e,this._timeScale=t}function c(e){this._line=e}function u(e,t){this._adapter=new c(this);var r=t||u.createProperties();this.customization={forcePriceAxisLabel:!1,disableErasing:!0},n.call(this,e,r),this.setSelectionEnabled(!1),i.e("lt-pane-views").then(function(e){var t=i("tjxb").ExecutionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}l.prototype._cachedByBarIndexOrderedExecutions={},l.recreateOrderedByBarsSourcesCache=function(e){l.clearOrderedByBarsSourcesCache();for(var t=l.prototype,i=e.sourcesByGroup().all(),n=0;nf.lastBar()||i=0;--m){var v=_[m];if(v instanceof u&&v._adapter._index===i&&v._adapter.getDirection()===r){if(v===e._line)break;var y=v._adapter._height();n=o?n+y:n-y}}return{x:t.indexToCoordinate(i),y:n}},c.prototype._height=function(){var e=this.getArrowHeight(),t=this.getArrowSpacing();this.getText()&&r.fontHeight(this.getFont());return e+t+0+10},c.prototype.getIndex=function(){return this._line._model.timeScale().baseIndex()-this._line.points()[0].index},c.prototype.setIndex=function(e){var t=this._line._model.timeScale().baseIndex()-Math.abs(e);this._line.startMoving({logical:this._line.points()[0]});var i=TradingView.merge({},this._line.points()[0]);return i.index=t,this._line.move({logical:i}),this._line.endMoving(),this}, c.prototype.getTime=function(){return this._unixtime},c.prototype.setTime=function(e){return this._unixtime=e,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),this._line.createServerPoints(),this},c.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},c.prototype.setPrice=function(e){return this._line.points().length>0&&(this._line.points()[0].price=e),this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},c.prototype.getText=function(){return this._line.properties().text.value()},c.prototype.setText=function(e){return this._line.properties().text.setValue(e||""),this._line.updateAllViewsAndRedraw(),this},c.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()},c.prototype.setArrowHeight=function(e){return this._line.properties().arrowHeight.setValue(e||5),this},c.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()},c.prototype.setArrowSpacing=function(e){return this._line.properties().arrowSpacing.setValue(e||1),this},c.prototype.getDirection=function(){return this._line.properties().direction.value()},c.prototype.setDirection=function(e){return this._line.properties().direction.setValue(e||"buy"),this},c.prototype.getArrowColor=function(){var e=this._line.properties();return"buy"===this.getDirection()?e.arrowBuyColor.value():e.arrowSellColor.value()},c.prototype.setArrowColor=function(e){return"buy"===this.getDirection()?this.setArrowBuyColor(e):this.setArrowSellColor(e),this},c.prototype.setArrowBuyColor=function(e){return this._line.properties().arrowBuyColor.setValue(e),this},c.prototype.setArrowSellColor=function(e){return this._line.properties().arrowSellColor.setValue(e),this},c.prototype.getTextColor=function(){return r.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)},c.prototype.setTextColor=function(e){return r.setColorToProperties(e,this._line.properties().textColor,this._line.properties().textTransparency),this},c.prototype.getFont=function(){return r.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)},c.prototype.setFont=function(e){return r.setFontToProperties(e,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic),this},c.prototype.setTooltip=function(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this},c.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},c.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},c.prototype.getPoints=function(){return this._line.points()},inherit(u,n),u.prototype.zorder=function(){return a},u.POINTS_COUNT=1,u.prototype.pointsCount=function(){return u.POINTS_COUNT},u.prototype.name=function(){return"Execution"}, u.prototype.hasContextMenu=function(){return!1},u.prototype.state=function(){return null},u.prototype.updateAllViews=function(){return this._isVisible()?n.prototype.updateAllViews.call(this):null},u.prototype.priceAxisViews=function(e,t){return this._isVisible()?n.prototype.priceAxisViews.call(this,e,t):null},u.prototype._isVisible=function(){return this._model.properties().tradingProperties.showExecutions.value()},u.prototype.paneViews=function(){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showExecutions.value()?n.prototype.paneViews.call(this):null},u.prototype.userEditEnabled=function(){return!1},u.prototype.showInObjectTree=function(){return!1},u.prototype.cloneable=function(){return!1},u.prototype.copiable=function(){return!1},u.prototype.isSynchronizable=function(){return!1},u.createProperties=function(e){var t=new o("linetoolexecution",e,!1,!1);return u._configureProperties(t),t},u._configureProperties=function(e){n._configureProperties(e)},t.ExecutionsPositionController=l,t.LineToolExecution=u}).call(this,i("Kxc7"))},"7ETO":function(e,t,i){"use strict";i.r(t);var n=i("ocLq"),r=function(){function e(){}return e.prototype.main=function(e){var t=e.new_var(n.Std.open(e)),i=e.new_var(n.Std.close(e)),r=t.get(1),o=i.get(1),s=n.Std.ohlc4(e),a=n.Std.na(t.get(1))?(n.Std.open(e)+n.Std.close(e))/2:(r+o)/2;t.set(a),i.set(s);var l=n.Std.max(n.Std.high(e),n.Std.max(a,s)),c=n.Std.min(n.Std.low(e),n.Std.min(a,s)),u=n.Std.volume(e),h=e.symbol;return[h.time,a,l,c,s,u,h.updatetime,h.isBarClosed]},e}();function o(e){if(0===e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-"))return new r;var t="unknown builder type: "+e.type;throw console.error(t),new Error(t)}i.d(t,"getChartStyleStudy",(function(){return o}))},"7Fue":function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return s}));var n=i("mrSG"),r=["horizlines","vertlines","lines","hlines","textmarks","shapemarks","backgrounds","polygons","trendchannels","hhists","dwglabels","dwglines","dwgtables","dwgcells"];function o(e){return!r.some((function(t){return e[t]().size>0}))}function s(e){var t=new Map;return e.forEach((function(e,i){e.forEach((function(e){var r=Object(n.a)(Object(n.a)({},e),{styleId:i}),o=e.firstBarTime,s=t.get(o);void 0===s&&(s=new Set,t.set(o,s)),s.add(r)}))})),t}},"7KDR":function(e,t,i){"use strict";i.r(t),i.d(t,"Action",(function(){return c})),i.d(t,"ActionAsync",(function(){return u})),i.d(t,"Separator",(function(){return h}));var n=i("mrSG"),r=i("zRdu"),o=i("aIyQ"),s=i.n(o),a=i("/3z9"),l=i("e3/o"),c=function(){function e(e,t){void 0===t&&(t=l.guid()),this.type=r.a.Action,this._destroyed=!1,this._binding=null,this.id=t,this._onUpdate=new s.a,this._options=e,this.update(e)}return e.prototype.execute=function(){this._options.checkable&&this.update({checked:!this._options.checked}),this._options.onExecute&&this._options.onExecute(this)},e.prototype.getLabel=function(){return this._options.label||""},e.prototype.getSubItems=function(){ return this._options.subItems||[]},e.prototype.isDisabled=function(){return!0===this._options.disabled},e.prototype.isActive=function(){return!0===this._options.active},e.prototype.isCheckable=function(){return!0===this._options.checkable},e.prototype.isChecked=function(){return!0===this._options.checked},e.prototype.getPayload=function(){return this._options.payload},e.prototype.update=function(e){this._destroyed||(this._unbindShortcut(),e.hotkeyHash&&(this._options.shortcutHint=Object(a.humanReadableHash)(e.hotkeyHash)),this._options=Object.assign(this._options,e),this._bindShortcut(),this._onUpdate.fire(this))},e.prototype.onUpdate=function(){return this._onUpdate},e.prototype.getState=function(){return{label:this.getLabel(),disabled:this.isDisabled(),active:this.isActive(),subItems:this.getSubItems(),checkable:this.isCheckable(),checked:this.isChecked(),doNotCloseOnClick:this._options.doNotCloseOnClick||!1,shortcutHint:this._options.shortcutHint,hint:this._options.hint,icon:this._options.icon,iconChecked:this._options.iconChecked,toolbox:this._options.toolbox,showToolboxOnHover:this._options.showToolboxOnHover||!1,statName:this._options.statName,name:this._options.name,fullWidthLabel:this._options.fullWidthLabel}},e.prototype.getBinding=function(){return this._binding},e.prototype.setBinding=function(e){this._binding=e},e.prototype.destroy=function(){this._destroyed=!0,this._onUpdate.destroy(),null!==this._binding&&this._binding.destroy(),this._unbindShortcut()},e.prototype._bindShortcut=function(){var e=this;if(this._options.hotkeyGroup&&this._options.hotkeyHash){var t="string"==typeof this._options.label?this._options.label:this._options.name;this._hotkeyAction=this._options.hotkeyGroup.add({hotkey:this._options.hotkeyHash,desc:t,handler:function(){return e.execute()},isDisabled:function(){return e.isDisabled()}})}},e.prototype._unbindShortcut=function(){this._hotkeyAction&&(this._hotkeyAction.destroy(),delete this._hotkeyAction)},e}(),u=function(e){function t(t,i){var n=e.call(this,{},i)||this;return n.type=r.a.ActionAsync,n._loader=t,n._loaded=!1,n}return Object(n.c)(t,e),t.prototype.loadOptions=function(){var e=this;return this._loadingPromise||(this._loadingPromise=this._loader().then((function(t){e.update(t),e._loaded=!0}))),this._loadingPromise},t.prototype.isLoaded=function(){return this._loaded},t}(c),h=function(){function e(e,t){void 0===t&&(t=l.guid()),this.type=r.a.Separator,this.id=t,this._hint=e}return e.prototype.getHint=function(){return this._hint},e}()},"7MZv":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showTooManyStudiesNotice=function(e){"number"!=typeof e&&(e=TradingView.STUDY_COUNT_LIMIT);(0,n.showNoticeDialog)({title:window.t("Warning"),content:window.t("Studies limit exceeded: {0} studies per layout.\nPlease, remove some studies.").format(e)})};var n=i("brCa")},"7RN7":function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return r}));var n=52,r=5},"7dm8":function(e,t,i){"use strict";i.d(t,"a",(function(){return r})), i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return s})),i.d(t,"d",(function(){return a})),i.d(t,"e",(function(){return l}));var n=i("ocLq"),r=function(){function e(){}return e.prototype.init=function(e,t){e.new_sym(t(1),n.Std.period(e)),this._source=t(0),this._scaleFactor1=1,this._scaleFactor2=1},e.prototype.main=function(e,t){var i=e.symbol.time,r=n.Std[this._source](e);e.select_sym(1);var o=n.Std[this._source](e),s=e.new_unlimited_var(o),a=e.new_unlimited_var(e.symbol.time);if(e.select_sym(0),isNaN(i))return null;var l=a.indexOf(i);-1!==l&&a.get(l)!==i&&(l=-1);var c=l<0?NaN:s.get(l);return[this._doCalculation(this._scaleFactor1,r,this._scaleFactor2,c)]},e}(),o={styles:{plot1:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:2,inputs:{source:"close",symbol2:""}},s=[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol2",name:"Symbol",type:"symbol",confirm:!0}],a=[{id:"plot1",type:"line"}],l={plot1:{title:"Plot",histogramBase:0}}},"7ktv":function(e,t,i){"use strict";i.r(t),i.d(t,"PriceDataSource",(function(){return l}));var n=i("mrSG"),r=i("fgLi"),o=i("aIyQ"),s=i.n(o),a=i("/tGj"),l=function(e){function t(t){var i=e.call(this)||this;return i._formatterChanged=new s.a,i._priceStepChanged=new s.a,i._currencyChanged=new s.a,i._priceRangeReadyChanged=new s.a,i._metaInfo=null,i._priceStep=null,i._priceRangeReady=!0,i._model=t,i}return Object(n.c)(t,e),t.prototype.firstValue=function(){return null},t.prototype.barColorer=function(){return null},t.prototype.base=function(){return 0},t.prototype.model=function(){return this._model},t.prototype.currencyChanged=function(){return this._currencyChanged},t.prototype.isCurrencySource=function(){return!0},t.prototype.priceRange=function(e,t){return null},t.prototype.isDraggable=function(){return!this._metaInfo||!this._metaInfo.linkedToSeries},t.prototype.priceLineColor=function(e){return e},t.prototype.formatterChanged=function(){return this._formatterChanged},t.prototype.priceStep=function(e){return this._priceStep},t.prototype.priceStepChanged=function(){return this._priceStepChanged},t.prototype.hasStateForAlert=function(){return!1},t.prototype.isIncludedInAutoScale=function(){return!0},t.prototype.correctScaleMargins=function(e){return e},t.prototype.priceRangeReady=function(){return this._priceRangeReady},t.prototype.priceRangeReadyChanged=function(){return this._priceRangeReadyChanged},t.prototype.disablePriceRangeReady=function(){var e=this.priceScale();null===e||e.isAutoScale()||e.mainSource()!==this||(this._priceRangeReady=!1,e.recalculatePriceRangeOnce()),this._priceRangeReadyChanged.fire(!1)},t.prototype._enablePriceRangeReady=function(){this._priceRangeReady=!0,this._priceRangeReadyChanged.fire(!0)},t.prototype._onSourceCurrencyChanged=function(){Object(a.isSymbolSource)(this)||this._currencyChanged.fire()},t.prototype._onSourcePriceRangeReadyChanged=function(e){Object(a.isSymbolSource)(this)||e||this.disablePriceRangeReady()},t }(r.DataSource)},"7nsU":function(e,t,i){"use strict";i.r(t),i.d(t,"showConfirmInputsDialog",(function(){return n}));i("YFKU");function n(e,t,n,r,o){void 0===o&&(o="default"),Promise.all([i.e("react"),i.e(1),i.e(2),i.e(5),i.e(6),i.e(7),i.e(9),i.e(10),i.e(11),i.e(12),i.e(15),i.e(19),i.e(25),i.e(26),i.e(28),i.e(31),i.e(58),i.e(100),i.e(0),i.e(4),i.e(3),i.e(8),i.e(17),i.e(23),i.e(30),i.e(52),i.e("new-confirm-inputs-dialog")]).then(i.bind(null,"iqv3")).then((function(i){var s=new i.ConfirmInputsDialogRenderer(function(e){if("symbol"===e)return window.t("Add Symbol");return window.t("Confirm Inputs")}(o),e,t,o,n,r);return s.show(),s}))}},"7qI1":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolRectangle",(function(){return u}));var n=i("mrSG"),r=i("aO4+"),o=i("Ocx9"),s=i("tc+8"),a=i.n(s),l=i("Ss5c"),c=i("j3hX"),u=function(e){function t(n,r){var o=this,s=r||t.createProperties();return o=e.call(this,n,s)||this,i.e("lt-pane-views").then(function(e){var t=[new(0,i("GW0y").RectanglePaneView)(o,n)];o._setPaneViews(t)}.bind(null,i)).catch(void 0),o}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.textColorsProperty=function(){return this.properties().childs().showLabel.value()?e.prototype.textColorsProperty.call(this):null},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.prototype.name=function(){return"Rectangle"},t.prototype.setPoint=function(t,i,n){if(t<2&&e.prototype.setPoint.call(this,t,i,n),n&&n.shift()&&this.properties().childs().snapTo45Degrees){var r=this._getAnchorPointForIndex(t);if(t>=4)return this._correctMiddlePoints(t,i,r),void this.normalizePoints();this._snapPoint45Degree(i,r)}switch(t){case 2:this._points[1].price=i.price,this._points[0].index=i.index;break;case 3:this._points[0].price=i.price,this._points[1].index=i.index;break;case 4:this._points[0].index=i.index;break;case 5:this._points[1].index=i.index;break;case 6:this._points[0].price=i.price;break;case 7:this._points[1].price=i.price}this.normalizePoints()},t.prototype.getPoint=function(t){return t<2?e.prototype.getPoint.call(this,t):this._getAnchorPointForIndex(t)},t.prototype.template=function(){var t=e.prototype.template.call(this);return t.text=this.properties().childs().text.value(),t},t.createProperties=function(e){var i=new o.DefaultProperty("linetoolrectangle",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"K4wI")).then((function(e){return e.RectangleDefinitionsViewModel}))},t.prototype._applyTemplateImpl=function(t){e.prototype._applyTemplateImpl.call(this,t),this.properties().childs().text.setValue(t.text)},t.prototype._snapPoint45Degree=function(e,t,i){var n=this.m_priceScale,r=this.ownerSource();if(null!==n&&null!==r){var o=r.firstValue();if(null!==o){ var s=this._model.timeScale(),a=this.pointToScreenPoint(e)[0],l=this.pointToScreenPoint(t)[0],c=a.x-l.x,u=a.y-l.y,h=c<0?-1:1,d=u<0?-1:1,p=Math.max(Math.abs(c),Math.abs(u)),f=Math.round(s.coordinateToIndex(l.x+p*h)),_=Math.abs(s.indexToCoordinate(f)-l.x),m=n.coordinateToPrice(l.y+_*d,o);e.index=f,e.price=m}}},t.prototype._correctMiddlePoints=function(e,t,i){e<6?this._correctRightLeftMiddlePoint(e,t,i):this._correctTopBottomMiddlePoint(e,t,i)},t.prototype._correctRightLeftMiddlePoint=function(e,t,i){var n=this.pointToScreenPoint(t)[0],o=this.pointToScreenPoint(i)[0],s=this.pointToScreenPoint(this._points[0])[0],a=this.pointToScreenPoint(this._points[1])[0],l=n.x-o.x;if(0!==l){var c=s.x=0;s--){var a=Number(o[s]);if(r%a==0)return a+i.letter()}u("Misconfiguration error: it is trying to request "+i.value()+" but we cannot build it from lower resolution")}return i.value()};var h=n.parse("1M").inMilliseconds(0);c.prototype.createItem=function(e,t,i,l,c,_,m){var v=new f,y=s(e),g="string"!=typeof y.symbol?y.symbol:y;t=g["currency-id"]||t ;var b=g.symbol,S=g.session&&"extended"!==g.session;if("type"in y)return new p(v,b,t,i,o(y),l,c,_);m&&!r()&&u("Internal error: rebuilding is requested but it is disabled."),!m&&l.has_empty_bars&&u('Misconfiguration error: attempt to request data for symbol with "has_empty_bars" flag, but "disable_resolution_rebuild" featureset is enabled');var w,P,C=this.rebuildFrom(i,l);if(!n.isTicks(i)&&(!n.isEqual(i,C)||m)){r()||u('Misconfiguration error: remove "disable_resolution_rebuild" featureset or provide '+i+" data by yourself");var T=l.has_empty_bars,x=Object.assign({},l);l.has_empty_bars&&(x.has_empty_bars=!1);var I=Math.ceil((w=n.parse(i),P=n.parse(C),w.kind()===P.kind()?w.multiplier()/P.multiplier():(w.isMonths()?w.multiplier()*h:w.inMilliseconds())/(P.isMonths()?P.multiplier()*h:P.inMilliseconds())));return c=Object.assign({},c,{countBack:c.countBack*I}),new p(v,b,t,C,new a(i,T),x,c,_)}return new d(v,b,{currency:t},i,S,this.host,l,c)};var d=function(e,t,i,n,r,o,s,a){this.listeners=e,this.host=o;var l=this;this.host.resolve(t,i,(function(e){r&&e.regular_session&&(e.session=e.regular_session),l.subs=l.host.subscribe(e,n,a,(function(e){l.listeners.fire(e)}),(function(e){l.listeners.onError(e)}))}),(function(e){l.listeners.onError(e)}))};d.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)};var p=function(e,i,n,r,o,s,a,l){this.listeners=e,this.isRecalculated=!1,this.symbolInfo=s;var c=this;this.engine=new t({tickerid:i,currencyCode:n,period:r,body:o,sessionId:l,symbolInfo:s,dataRange:a,forceAlignBars:!1,recalc:function(e,t){c._recalc(t)},out:function(e,t){c._out(e,t)},nonseriesOut:function(e,t){c._nonseriesOut(e,t)},setNoMoreData:function(){c.barset&&(c.barset.endOfData=!0)},onErrorCallback:function(e){c.listeners.onError(e)}})};p.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},p.prototype._recalc=function(e){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new l(this.symbolInfo)),e&&(this.barset.firstLoadedTime=e.firstLoadedTime,this.barset.endOfData=e.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},p.prototype._nonseriesOut=function(e,t){var i=Object.assign({},t);i.nonseries=!0,i.data=t.bars,delete i.bars,i.barsetSize=this.barset?this.barset.count():0,i.lastBar=this.barset?this.barset.bar(this.barset.count()-1):null,this.listeners.fire(i,!0)},p.prototype._out=function(e,t){var i=t[0];if(!isNaN(i)){var n={time:i,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],updatetime:t[6]},r=t[7];this.barset||(this.barset=new l(e.info));var o=t[8];if(o instanceof Array)for(var s=0;s=1;--t){var n=this._ticker.slice(0,t);if(e(n)){this._root=n,this._contract=this._ticker.slice(t);break}}},m.prototype.exchange=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null==e?delete this._exchange:this._exchange=e+""},m.prototype.ticker=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null==e?delete this._ticker:this._ticker=e+"",delete this._root,delete this._contract},m.prototype.root=function(e){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null==e?delete this._root:(this._root=e+"",this._root&&(this._ticker=this._root+(this._contract||"")))},m.prototype.contract=function(e){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null==e?delete this._contract:(this._contract=e+"",this._root&&(this._ticker=this._root+this._contract))},n(v,r),v.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},v.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},y.prototype.toString=function(){return this.value},n(g,m),g.prototype.isIncomplete=!0, g.prototype.incompleteSuggest=function(){if("'"!==this.value)return String("'")},n(b,v),b.prototype.isIncomplete=!0;var S=new RegExp(e.map((function(e){return"("+("string"==typeof e.pattern?e.pattern.replace(/[\^$()[\]{}*+?|\\]/g,"\\$&"):e.pattern.source)+")"})).concat(".").join("|"),"g");function w(t,i){var n,r=[];e:for(;n=S.exec(t);){for(var s=e.length;s--;)if(n[s+1]){if(e[s].ctor){var a=new e[s].ctor(n[s+1]);a._offset=n.index,r.push(a)}continue e}var l=new y(n[0]);l._offset=n.index,r.push(l)}if(i&&i.recover){var c;for(s=r.length;s--;){var u=r[s];if(u instanceof v||u instanceof m){if(void 0!==c){var h=new m(""),d=r.splice(s,c-s+1,h);h.value=d.map((function(e){return e.value})).join("")}c=s}else u instanceof o||(c=void 0)}}return r}function P(e){for(var t=[],i=0;io.precedence&&(n[n.length-1].minPrecedence=o.precedence);else if(o instanceof s)n.push(t={minPrecedence:1/0,openBraceIndex:r});else if(o instanceof a){var c=e[(t=n.pop()).openBraceIndex-1],u=e[r+1];u instanceof l&&!(u.precedence<=t.minPrecedence)||!(!(c instanceof l)||c.precedencet.minPrecedence&&(n[n.length-1].minPrecedence=t.minPrecedence))}}for(r=i.length;r--;)e.splice(i[r],1);return e}function T(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return(e=w(e)).filter((function(e){return e instanceof m})).map((function(e){return e.exchange()})).filter((function(e){return e}))}function x(e){return 1!==(e=T(e)).length?null:e[0]}function I(e,t){return(e=T(e)).some((function(e){return t.includes((e||"").toUpperCase())}))}function L(e){return e.join("")}return{tokenize:w,validate:function(e){if(t.enabled("charting_library_base"))return{currentState:"var"};for(var i="init",n={warnings:[],errors:[],isEmpty:!0},r=[],c=0;ct[t.length-1].time+i)return null;var n=t[Object(a.lowerbound)(t,e.x-i,(function(e,t){return e.timen.time+i)return null;var r=Object(l.selectionTolerance)(this._barWidth),o=Math.min(n.high,n.low),s=Math.max(n.high,n.low),u=this._data.fontSize;return o-r-u<=e.y&&e.y<=o+r||s-r<=e.y&&e.y<=s+r+u?new c.HitTestResult(c.HitTestResult.REGULAR):null},t.prototype._drawImpl=function(e){if(null!==this._data&&null!==this._barWidth){e.save(),e.translate(.5,.5),e.textAlign="center",e.fillStyle=this._data.labelColor,e.font=Object(o.makeFont)(this._data.fontSize,this._data.font);for(var t=this._data.bars,i=this._data.inverted,n=0;n5},t.prototype._getLabelWidth=function(e){return this._widthsCache.measureText(this._context,e)},t}(s.SeriesBarCandlesPaneView)},"9QkW":function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("5rJj"),o=i("j3hX"),s=o.LineToolWidthsProperty,a=o.LineToolColorsProperty;function l(e,t){var r=t||l.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("1SUO").FibWedgePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(l,n),l.LevelsCount=11,l.prototype.isSynchronizable=function(){return!1},l.prototype.levelsCount=function(){return l.LevelsCount},l.prototype.pointsCount=function(){return 3},l.prototype.name=function(){return"Fib Wedge"},l.prototype.hasEditableCoordinates=function(){return!1},l.prototype.setPoint=function(e,t){if(n.prototype.setPoint.call(this,e,t),!this._recursiveGuard){if(this._recursiveGuard=!0,2===e){var i=this.pointToScreenPoint(this._points[0])[0],r=this.pointToScreenPoint(this._points[1])[0],o=(l=this.pointToScreenPoint(this._points[2])[0]).subtract(i).length(),s=r.subtract(i).normalized();r=i.add(s.scaled(o));var a=this.screenPointToPoint(r);this._properties.points[1].price.setValue(a.price),this._properties.points[1].bar.setValue(a.index)}else{i=this.pointToScreenPoint(this._points[0])[0],r=this.pointToScreenPoint(this._points[1])[0];var l=this.pointToScreenPoint(this._points[2])[0],c=r.subtract(i).length();s=l.subtract(i).normalized();l=i.add(s.scaled(c));a=this.screenPointToPoint(l);this._properties.points[2].price.setValue(a.price),this._properties.points[2].bar.setValue(a.index)}this._recursiveGuard=!1}},l.prototype.addPoint=function(e){if(2===this._points.length){var t=this.pointToScreenPoint(this._points[0])[0],i=this.pointToScreenPoint(this._points[1])[0],r=this.pointToScreenPoint(e)[0],o=i.subtract(t).length(),s=r.subtract(t).normalized();r=t.add(s.scaled(o));var a=this.ownerSource().firstValue(),l=this.priceScale().coordinateToPrice(r.y,a);e={index:Math.round(this._model.timeScale().coordinateToIndex(r.x)),price:l}}return n.prototype.addPoint.call(this,e)},l.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible ;e.setProperty(n,!1,"Erase level line")},l.createProperties=function(e){var t=new r("linetoolfibwedge",e,!1,{range:[1,11]});return l._configureProperties(t),t},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("6mGk").FibWedgeDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l._configureProperties=function(e){n._configureProperties(e);for(var t=[e.child("trendline").child("linewidth")],i=[e.child("trendline").child("color")],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new s(t))},t.LineToolFibWedge=l},"9dnG":function(e,t){e.exports=''},"9iCb":function(e,t,i){"use strict";i.r(t),i.d(t,"applyOverridesToStudy",(function(){return u})),i.d(t,"applyOverridesToStudyDefaults",(function(){return h}));var n,r,o=i("Eyy1"),s=i("23IT"),a=i("txPx"),l=Object(a.getLogger)("Chart.Model.StudyPropertiesOverrider");function c(e,t,i,o){var s=i.split(".");if(0!==s.length&&0!==s[0].length){var a,c,u=(a=s[0],{name:(c=a.split(":"))[0],type:2===c.length?c[1]:null}),h=u.name,d=u.type,p=null!==d,f=!p||"band"===d,_=!p||"area"===d,m=!p||"input"===d,v=!p||"plot"===d?r.getPlotIdByTitle(e,h):null,y=f?r.getBandIndexByName(e,h):null,g=_?r.getFilledAreaIdByTitle(e,h):null,b=m?r.getInputByName(e,h):null,S=t.hasOwnProperty(h);if((null!==v?1:0)+(null!==y?1:0)+(null!==g?1:0)+(null!==b?1:0)+(S?1:0)>1)l.logWarn("Study '"+e.description+"' has ambiguous identifier '"+h+"'");else{var w=s[1];if(null!==v){if(1===s.length)return void l.logWarn("Path of sub-property of '"+h+"' plot for study '"+e.description+"' must be not empty");var P=s.slice(1);n.applyPlotProperty(e,t,v,P,o)}else if(null!==b)n.applyInputValue(t,b,o);else if(null!==y){if(void 0===w)return void l.logWarn("Property name of '"+h+"' band for study '"+e.description+"' must be set");n.applyBandProperty(t,y,w,o)}else if(null!==g){if(void 0===w)return void l.logWarn("Property name of '"+h+"' area for study '"+e.description+"' must be set");n.applyFilledAreaProperty(t,g,w,o)}else S?n.setRootProperty(t,s,o):l.logWarn("Study '"+e.description+"' has no plot or input '"+h+"'")}}}function u(e,t){var i=e.properties(),n=i.state();for(var r in t)t.hasOwnProperty(r)&&c(e.metaInfo(),n,r,t[r]);i.mergeAndFire(n)}function h(e,t,i){for(var n in e)if(e.hasOwnProperty(n)){var o=n.indexOf(".");if(-1!==o){var s=n.substr(0,o),a=r.getMetaInfoByDescription(t,s);if(null!==a){var u=i(a);null!==u?c(a,u,n.substr(o+1),e[n]):l.logWarn("Cannot apply overrides for study "+s)}else l.logWarn("There is no such study "+s)}}}!function(e){var t={line:s.LineStudyPlotStyle.Line,histogram:s.LineStudyPlotStyle.Histogram,cross:s.LineStudyPlotStyle.Cross,area:s.LineStudyPlotStyle.Area, columns:s.LineStudyPlotStyle.Columns,circles:s.LineStudyPlotStyle.Circles,line_with_breaks:s.LineStudyPlotStyle.LineWithBreaks,area_with_breaks:s.LineStudyPlotStyle.AreaWithBreaks};e.applyPlotProperty=function(e,i,n,r,a){if(void 0!==i.styles){var c=r[0];if("color"!==c){var u=i.styles[n];if(void 0!==u&&u.hasOwnProperty(c)){if("plottype"===c){var h=t[String(a)];if(void 0===h)return void l.logWarn("Unsupported plot type for plot: "+a);a=h}u[c]=a}else l.logWarn("Study plot does not have property '"+c+"'")}else{!function(e,t,i,n,r){if(void 0!==e.styles)if(null===t&&!isNaN(n)&&n>0)l.logWarn("Study plot does not have color #"+n);else{if(0===n||isNaN(n))Object(o.ensureDefined)(e.styles[i]).color=String(r),n=0;null!==t&&(Object(o.ensureDefined)(t.colors[n]).color=String(r))}else l.logWarn("Study does not have styles")}(i,function(e,t,i){if(void 0===e.plots)return null;for(var n=0,r=e.plots;n1?parseInt(r[1]):NaN,a)}}else l.logWarn("Study does not have styles")},e.applyBandProperty=function(e,i,n,r){if(void 0!==e.bands){var o=e.bands[i];if(void 0!==o&&o.hasOwnProperty(n)){if("plottype"===n){var s=t[String(r)];if(void 0===s)return void l.logWarn("Unsupported plot type for band: "+r);r=s}o[n]=r}else l.logWarn("Study band does not have property '"+n+"'")}else l.logWarn("Study does not have bands")},e.applyFilledAreaProperty=function(e,t,i,n){if(void 0!==e.filledAreasStyle){var r=e.filledAreasStyle[t];void 0!==r&&r.hasOwnProperty(i)?r[i]=n:l.logWarn("Study area does not have property '"+i+"'")}else l.logWarn("Study does not have areas")},e.applyInputValue=function(e,t,i){void 0!==e.inputs&&e.inputs.hasOwnProperty(t)?e.inputs[t]=i:l.logWarn("Study does not have input '"+t+"'")},e.setRootProperty=function(e,t,i){if(0!==t.length){for(var n=e,r=0,o=t.slice(0,-1);r=this.chartsCount())throw Error("Incorrect index: "+e);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[e])},P.prototype.getSymbolInterval=function(e){var t={symbol:r.symbol.value(),interval:r.interval.value()};return e&&e(t),t},P.prototype.saveChart=function(e){var t=this;this._saveChartService.whenReadyToSave((function(){var i=t._saveChartService.saveToJSON();return e&&e(JSON.parse(i.content))}))},P.prototype.loadChart=function(e){this._chartApiInstance.disconnect(),this._chartWidgetCollection.loadContent(e.json),this._chartWidgetCollection.purgeUnusedWidgets(),e.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(e.extendedData.name)),this._chartApiInstance.connect(),r.symbol.setValue(this.activeChart().symbol()),a.emit("chart_loaded")},P.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter((function(e){return!e.is_hidden_study})).map((function(e){return e.description}))},P.prototype.getSavedCharts=function(e){h.getCharts(e)},P.prototype.loadChartFromServer=function(e){h.loadChart(e)},P.prototype.saveChartToServer=function(e,t,i){this._saveChartService.saveChartSilently(e,t,i)},P.prototype.removeChartFromServer=function(e,t){h.removeChart(e,t)},P.prototype.getIntervals=function(){var e=[],t=u.getCustomResolutions();return null!==this._chartApiInstance&&(e=this._chartApiInstance.defaultResolutions()),u.mergeResolutions(e,t)},P.prototype.closePopupsAndDialogs=function(){for(var e=document.querySelectorAll("._tv-dialog-title-close"),t=0;t0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},c.prototype.setPrice=function(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},c.prototype.getText=function(){return this._data.bodyText},c.prototype.setText=function(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this},c.prototype.setTooltip=function(e){return this._line.properties().tooltip.setValue(u(e)),this},c.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},c.prototype.setModifyTooltip=function(e){return this._line.properties().modifyTooltip.setValue(u(e)),this},c.prototype.getModifyTooltip=function(){return this._line.properties().modifyTooltip.value()},c.prototype.setCancelTooltip=function(e){return this._line.properties().cancelTooltip.setValue(u(e)),this},c.prototype.getCancelTooltip=function(){return this._line.properties().cancelTooltip.value()},c.prototype.getQuantity=function(){return this._data.quantityText},c.prototype.setQuantity=function(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this},c.prototype.getExtendLeft=function(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e},c.prototype.setExtendLeft=function(e){return this._line.properties().extendLeft.setValue(e),this},c.prototype.getLineLength=function(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e},c.prototype.setLineLength=function(e){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this},c.prototype.getLineColor=function(){var e=this._line.properties();return"buy"===this._direction?this._active?e.lineActiveBuyColor.value():e.lineInactiveBuyColor.value():this._active?e.lineActiveSellColor.value():e.lineInactiveSellColor.value()},c.prototype.setLineColor=function(e){return"buy"===this._direction?this._active?this.setLineActiveBuyColor(e):this.setLineInactiveBuyColor(e):this._active?this.setLineActiveSellColor(e):this.setLineInactiveSellColor(e),this},c.prototype.setLineActiveBuyColor=function(e){return this._line.properties().lineActiveBuyColor.setValue(e),this},c.prototype.setLineInactiveBuyColor=function(e){return this._line.properties().lineInactiveBuyColor.setValue(e),this},c.prototype.setLineActiveSellColor=function(e){return this._line.properties().lineActiveSellColor.setValue(e),this},c.prototype.setLineInactiveSellColor=function(e){return this._line.properties().lineInactiveSellColor.setValue(e),this},c.prototype.getLineStyle=function(){var e=this._line.properties().lineStyle.value() ;return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e},c.prototype.setLineStyle=function(e){return this._line.properties().lineStyle.setValue(e),this},c.prototype.getLineWidth=function(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e},c.prototype.setLineWidth=function(e){return this._line.properties().lineWidth.setValue(e),this},c.prototype.getBodyBorderColor=function(){var e=this._line.properties();return"buy"===this._direction?this._active?e.bodyBorderActiveBuyColor.value():e.bodyBorderInactiveBuyColor.value():this._active?e.bodyBorderActiveSellColor.value():e.bodyBorderInactiveSellColor.value()},c.prototype.setBodyBorderColor=function(e){return"buy"===this._direction?this._active?this.setBodyBorderActiveBuyColor(e):this.setBodyBorderInactiveBuyColor(e):this._active?this.setBodyBorderActiveSellColor(e):this.setBodyBorderInactiveSellColor(e),this},c.prototype.setBodyBorderActiveBuyColor=function(e){return this._line.properties().bodyBorderActiveBuyColor.setValue(e),this},c.prototype.setBodyBorderInactiveBuyColor=function(e){return this._line.properties().bodyBorderInactiveBuyColor.setValue(e),this},c.prototype.setBodyBorderActiveSellColor=function(e){return this._line.properties().bodyBorderActiveSellColor.setValue(e),this},c.prototype.setBodyBorderInactiveSellColor=function(e){return this._line.properties().bodyBorderInactiveSellColor.setValue(e),this},c.prototype.getBodyBackgroundColor=function(){return o.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},c.prototype.setBodyBackgroundColor=function(e){return o.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},c.prototype.getBodyTextColor=function(){var e=this._line.properties();return"limit"===this._mode?this._active?e.bodyTextActiveLimitColor.value():e.bodyTextInactiveLimitColor.value():"stop"===this._mode?this._active?e.bodyTextActiveStopColor.value():e.bodyTextInactiveStopColor.value():"buy"===this._direction?this._active?e.bodyTextActiveBuyColor.value():e.bodyTextInactiveBuyColor.value():this._active?e.bodyTextActiveSellColor.value():e.bodyTextInactiveSellColor.value()},c.prototype.setBodyTextColor=function(e){return"limit"===this._mode?this._active?this.setBodyTextActiveLimitColor(e):this.setBodyTextInactiveLimitColor(e):"stop"===this._mode?this._active?this.setBodyTextActiveStopColor(e):this.setBodyTextInactiveStopColor(e):"buy"===this._direction?this._active?this.setBodyTextActiveBuyColor(e):this.setBodyTextInactiveBuyColor(e):this._active?this.setBodyTextActiveSellColor(e):this.setBodyTextInactiveSellColor(e),this},c.prototype.setBodyTextInactiveLimitColor=function(e){return this._line.properties().bodyTextInactiveLimitColor.setValue(e),this},c.prototype.setBodyTextActiveLimitColor=function(e){return this._line.properties().bodyTextActiveLimitColor.setValue(e),this}, c.prototype.setBodyTextInactiveStopColor=function(e){return this._line.properties().bodyTextInactiveStopColor.setValue(e),this},c.prototype.setBodyTextActiveStopColor=function(e){return this._line.properties().bodyTextActiveStopColor.setValue(e),this},c.prototype.setBodyTextInactiveBuyColor=function(e){return this._line.properties().bodyTextInactiveBuyColor.setValue(e),this},c.prototype.setBodyTextActiveBuyColor=function(e){return this._line.properties().bodyTextActiveBuyColor.setValue(e),this},c.prototype.setBodyTextInactiveSellColor=function(e){return this._line.properties().bodyTextInactiveSellColor.setValue(e),this},c.prototype.setBodyTextActiveSellColor=function(e){return this._line.properties().bodyTextActiveSellColor.setValue(e),this},c.prototype.getBodyFont=function(){return o.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},c.prototype.setBodyFont=function(e){return o.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},c.prototype.getQuantityBorderColor=function(){var e=this._line.properties();return"buy"===this._direction?this._active?e.quantityBorderActiveBuyColor.value():e.quantityBorderInactiveBuyColor.value():this._active?e.quantityBorderActiveSellColor.value():e.quantityBorderInactiveSellColor.value()},c.prototype.setQuantityBorderColor=function(e){return"buy"===this._direction?this._active?this.setQuantityBorderActiveBuyColor(e):this.setQuantityBorderInactiveBuyColor(e):this._active?this.setQuantityBorderActiveSellColor(e):this.setQuantityBorderInactiveSellColor(e),this},c.prototype.setQuantityBorderActiveBuyColor=function(e){return this._line.properties().quantityBorderActiveBuyColor.setValue(e),this},c.prototype.setQuantityBorderInactiveBuyColor=function(e){return this._line.properties().quantityBorderInactiveBuyColor.setValue(e),this},c.prototype.setQuantityBorderActiveSellColor=function(e){return this._line.properties().quantityBorderActiveSellColor.setValue(e),this},c.prototype.setQuantityBorderInactiveSellColor=function(e){return this._line.properties().quantityBorderInactiveSellColor.setValue(e),this},c.prototype.getQuantityBackgroundColor=function(){var e=this._line.properties();return"buy"===this._direction?this._active?e.quantityBackgroundActiveBuyColor.value():e.quantityBackgroundInactiveBuyColor.value():this._active?e.quantityBackgroundActiveSellColor.value():e.quantityBackgroundInactiveSellColor.value()},c.prototype.setQuantityBackgroundColor=function(e){return"buy"===this._direction?this._active?this.setQuantityBackgroundActiveBuyColor(e):this.setQuantityBackgroundInactiveBuyColor(e):this._active?this.setQuantityBackgroundActiveSellColor(e):this.setQuantityBackgroundInactiveSellColor(e),this},c.prototype.setQuantityBackgroundActiveBuyColor=function(e){return this._line.properties().quantityBackgroundActiveBuyColor.setValue(e),this}, c.prototype.setQuantityBackgroundInactiveBuyColor=function(e){return this._line.properties().quantityBackgroundInactiveBuyColor.setValue(e),this},c.prototype.setQuantityBackgroundActiveSellColor=function(e){return this._line.properties().quantityBackgroundActiveSellColor.setValue(e),this},c.prototype.setQuantityBackgroundInactiveSellColor=function(e){return this._line.properties().quantityBackgroundInactiveSellColor.setValue(e),this},c.prototype.getQuantityTextColor=function(){return o.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},c.prototype.setQuantityTextColor=function(e){return o.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},c.prototype.getQuantityFont=function(){return o.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},c.prototype.setQuantityFont=function(e){return o.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},c.prototype.getCancelButtonBorderColor=function(){var e=this._line.properties();return"buy"===this._direction?this._active?e.cancelButtonBorderActiveBuyColor.value():e.cancelButtonBorderInactiveBuyColor.value():this._active?e.cancelButtonBorderActiveSellColor.value():e.cancelButtonBorderInactiveSellColor.value()},c.prototype.setCancelButtonBorderColor=function(e){return"buy"===this._direction?this._active?this.setCancelButtonBorderActiveBuyColor(e):this.setCancelButtonBorderInactiveBuyColor(e):this._active?this.setCancelButtonBorderActiveSellColor(e):this.setCancelButtonBorderInactiveSellColor(e),this},c.prototype.setCancelButtonBorderActiveBuyColor=function(e){return this._line.properties().cancelButtonBorderActiveBuyColor.setValue(e),this},c.prototype.setCancelButtonBorderInactiveBuyColor=function(e){return this._line.properties().cancelButtonBorderInactiveBuyColor.setValue(e),this},c.prototype.setCancelButtonBorderActiveSellColor=function(e){return this._line.properties().cancelButtonBorderActiveSellColor.setValue(e),this},c.prototype.setCancelButtonBorderInactiveSellColor=function(e){return this._line.properties().cancelButtonBorderInactiveSellColor.setValue(e),this},c.prototype.getCancelButtonBackgroundColor=function(){return o.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)},c.prototype.setCancelButtonBackgroundColor=function(e){return o.setColorToProperties(e,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency),this},c.prototype.getCancelButtonIconColor=function(){var e=this._line.properties() ;return"buy"===this._direction?this._active?e.cancelButtonIconActiveBuyColor.value():e.cancelButtonIconInactiveBuyColor.value():this._active?e.cancelButtonIconActiveSellColor.value():e.cancelButtonIconInactiveSellColor.value()},c.prototype.setCancelButtonIconColor=function(e){return"buy"===this._direction?this._active?this.setCancelButtonIconActiveBuyColor(e):this.setCancelButtonIconInactiveBuyColor(e):this._active?this.setCancelButtonIconActiveSellColor(e):this.setCancelButtonIconInactiveSellColor(e),this},c.prototype.setCancelButtonIconActiveBuyColor=function(e){return this._line.properties().cancelButtonIconActiveBuyColor.setValue(e),this},c.prototype.setCancelButtonIconInactiveBuyColor=function(e){return this._line.properties().cancelButtonIconInactiveBuyColor.setValue(e),this},c.prototype.setCancelButtonIconActiveSellColor=function(e){return this._line.properties().cancelButtonIconActiveSellColor.setValue(e),this},c.prototype.setCancelButtonIconInactiveSellColor=function(e){return this._line.properties().cancelButtonIconInactiveSellColor.setValue(e),this},c.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},c.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},c.prototype.getBlocked=function(){return this._blocked},c.prototype.isFunction=function(e){return"function"==typeof e},c.prototype.onCancel=function(e,t){return t?this.isFunction(t)&&(this._onCancelData=e,this._onCancelCallback=t):this.isFunction(e)&&(this._onCancelCallback=e),this},c.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)},c.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)},c.prototype.onModify=function(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this},c.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},c.prototype.onMove=function(e,t){return t?this.isFunction(t)&&(this._onMoveData=e,this._onMoveCallback=t):this.isFunction(e)&&(this._onMoveCallback=e),this},c.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)},c.prototype.onContextMenu=function(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this},c.prototype.shouldShowContextMenu=function(){return this.isFunction(this._onContextMenuCallback)},c.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},c.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(h,n),h.prototype.zorder=function(){return l},h.prototype.setPoint=function(e,t,i){this._points[e]=t,this.normalizePoints()},h.prototype.addPoint=function(e,t){return this._points.push(e), this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},h.prototype.name=function(){return"Order"},h.prototype.endMoving=function(e){var t=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.logical.price!==this._currentMovingPoint.logical.price;n.prototype.endMoving.call(this),!e&&t&&this._adapter.callOnMove()},h.prototype.createPriceAxisView=function(e){var t={pointIndex:e,backgroundPropertyGetter:this._adapter.getLineColor.bind(this._adapter)};return this._priceAxisView=new r(this,t),this._priceAxisView},h.prototype.paneViews=function(){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?s.prototype.paneViews.call(this):null},h.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?s.prototype.priceAxisViews.call(this,t,i):null},h.prototype.adapter=function(){return this._adapter},h.prototype.hasContextMenu=function(){return this._adapter.shouldShowContextMenu()},h.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},h.prototype.onlyYMoving=function(){return!0},h.prototype.movable=function(){return Boolean(this._adapter._onMoveCallback)},h.createProperties=function(e){var t=new a("linetoolorder",e,!1,!1);return h._configureProperties(t),t},h._configureProperties=function(e){n._configureProperties(e)},t.LineToolOrder=h}).call(this,i("Kxc7"))},BBCR:function(e,t){e.exports=''},BHQF:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetch=function(e,t){return window.fetch(e,t)};(0,i("txPx").getLogger)("Fetch")},BOPY:function(e,t,i){"use strict";var n=i("aO4+").Point,r=i("f6yo").pointInCircle,o=i("VdBB").HitTestResult,s=i("zDbI").CHART_FONT_FAMILY,a=i("cPgM").ScaledPaneRenderer;function l(e,t){this.source=e,this._rendererFactory=t}function c(e,t){a.call(this),this._barWidth=e.barWidth,this._plates=e.plates,this._tooltip=e.tooltip,this._model=t}l.prototype.update=function(){},l.prototype.renderer=function(e,t){return this._rendererFactory(this.source)},inherit(c,a),c.prototype._drawImpl=function(e){e.save();for(var t=0;t6&&(e.textAlign="center",e.textBaseline="middle",e.font="bold "+t.labelFontSize+"px "+s,e.fillStyle=t.labelFontColor,e.fillText(t.label,t.x,t.y))},c.prototype.hitTest=function(e){for(var t,i=this._plates.length-1;i>=0;--i)if(t=this._hitTestDot(this._plates[i],e))return t;return null},c.prototype._hitTestDot=function(e,t){var i=this._dotTransform(e),s=new n(i.x,i.y);return r(t,s,Math.max(i.radius,8))?new o(o.REGULAR,e):null},t.BarsMarksContainerPaneView=l,t.BarsMarksContainerRenderer=c},Bt3k:function(e,t,i){"use strict";function n(e,t){this.tooltips={},this.tooltipFactory=e,this.source=t}function r(e,t){this.renderer=e,this._tooltip=t,this.visible=!1}n.prototype.findOrCreateTooltip=function(e){var t=this.tooltips[e.id];return null==t&&(e.hovered||e.pinned)&&(t=this._createTooltip(),this.tooltips[e.id]=t),t},n.prototype.showPlate=function(e,t){var i=this.findOrCreateTooltip(e);null!=i&&(i._drawPlate(e,t),i.plateData=e)},n.prototype.draw=function(e,t){this.hoveredId=null;for(var i=0;i15&&(a=15),a<10&&(a=10),this._updatePlate(e);var l=t.canvas.getBoundingClientRect(),c=e.x-o.offsetWidth]+)>)/gi,""):e},TradingView.encodeSpread=function(e){return encodeURIComponent(e)},TradingView.clean=function(e,t,i){var n=[["&","&"],["<","<"],[">",">"],['"',"""],["'","'"],["'","'"]],r=e;if(!e||!e.replace)return r;for(var o=0;o0){var r=this._points[this._points.length-1],o=this.pointToScreenPoint(r)[1];if(this.pointToScreenPoint(t)[1].subtract(o).length()<2)return this._finished}return e.prototype.addPoint.call(this,t),this._finished},t.prototype.restorePoints=function(t,i,n){e.prototype.restorePoints.call(this,t,i,n),this._finished=!0},t}(r.LineDataSource)},DYI2:function(e,t){e.exports=''},Daqx:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=["Z","Y","X","W","V","U","T","S"],r=["A","B","C","D","E","F","G","H"],o=function(){function e(e){this.label=e}return e.prototype.equals=function(e){return null!==e&&this.label===e.label},e}();function s(e,t){var i="left"===e?n:r;return new o(t=0&&e.setLastBarClosed(!1)}n(e)}}(e,i,r),o)},unsubscribe:function(e){return t._cachedDatafeed.unsubscribe(e)}})};function C(e,t,i){return e+","+t.full_name+","+i}P.prototype._removeTimeScaleBuilder=function(e,t,i){var n=this._timeScaleBuilders[C(e,t,i)];delete this._timeScaleBuilders[C(e,t,i)],void 0!==n&&n.destroy()},P.prototype._getTimeScaleBuilder=function(e,t,i){var n=u.normalize(i),r=C(e,t,n),o=this._timeScaleBuilders[r];return void 0===o&&(o=new s(t,n),this._timeScaleBuilders[r]=o),o},P.prototype._barsCoefficients=function(e,t){if(void 0===g(e).type)return{};var i=e+t ;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},P.prototype.destroy=function(){this._cachedDatafeed.destroy(),this._externalDatafeed=null,Object.keys(this._pointsetsManagers).forEach((function(e){this._pointsetsManagers[e].destroy()}),this),this._pointsetsManagers={}},P.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={},this._sessionsLastDataCache={},this._studiesCache={},Object.keys(this._pointsetsManagers).forEach((function(e){this._pointsetsManagers[e].destroy()}),this),this._pointsetsManagers={},Object.keys(this._timeScaleBuilders).forEach((function(e){this._timeScaleBuilders[e].destroy()}),this),this._timeScaleBuilders={}},P.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},P.prototype._logMessage=function(e){S.enabled("charting_library_debug_mode")&&console.log(e)},P.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},P.prototype._fireEvent=function(e,t,i){if(this._callbacks.hasOwnProperty(e)){for(var n=this._callbacks[e],r=0;r_[a].value[0];l?_.push({index:f(n),value:[n].concat(r)}):_[a].value=[n].concat(r),d||h.onRealtimeCallback([_[_.length-1]],l,_.length,v,i)}(e,t,l)},nonseriesOut:function(e,t){h.onNonSeriesDataUpdate(t,l)},setNoMoreData:function(){g=!0},recalc:function(e,i){d=!1,_.endOfData=g,t.error&&null!==t.error()||h.onDataReadyCallback(_,y>0?v:void 0,l,i)}});if(!b._studiesCache[e]||!b._studiesCache[e][o])throw Error("This should never happen");b._studiesCache[e][o].engine=w}catch(P){if(!P.studyError)throw P;h.onErrorCallback(P.message)}}else h.onErrorCallback("Unsupported resolution. Did you forget to set has_intraday to true?")},P=function(e){h.onErrorCallback(e)},C=function(){return b._studiesCache[e]&&b._studiesCache[e][o]&&b._studiesCache[e][o].activeResolve===p};b._studiesCache[e][o].activeResolve=p,this.resolveSymbol(i,(function(){C()&&w.apply(b,arguments)}),(function(){C()&&P.apply(b,arguments)}))},P.prototype._createStudy=function(e,t,i,n,r,o,s){var a=this;function l(e,t,i){e=w(e),TradingView.ChartapiMessagerInstances[n].onDataUpdate(r,o,a._convertBarsTimeToUnix(e),t,i),TradingView.ChartapiMessagerInstances[n].onStudyCompleted(r,o)}s=function(e){if(Array.isArray(e))return e;for(var t=[],i=a._studiesCache[n][r].metainfo.inputs,o=0;o=n?e[o]=t[n-1].index:e[o]=t[r].index}}(n,t),e.indexes=n}}(i={data:e.data,indexes:[]},a._sessionsLastDataCache[n]),l([],i,t);break;default:console.warn("unsupported non-series data type for study "+e.type)}}.bind(this)})},P.prototype.stopSources=function(e){for(var t in this._studiesCache[e]){var i=this._studiesCache[e][t];i&&(i.engine&&i.engine.stop(),i.activeResolve=-1)}o.unsubscribeUnused()},P.prototype.recreateSources=function(e,t,i,n,r){for(var o in this.stopSources(i),this._studiesCache[i]){(s=this._studiesCache[i][o])&&"series"===s.type&&this.createSeries(e,t,i,o,s.turnaround,n,r)}for(var o in this._studiesCache[i]){var s;(s=this._studiesCache[i][o])&&"study"===s.type&&(s.requestedSymbol=e,s.resolution=t,this._createStudy(e,t,s.studyObject,i,o,s.turnaround,s.inputs))}},P.prototype.removeStudy=function(e,t){this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].engine&&(this._studiesCache[e][t].engine.stop(),o.unsubscribeUnused()),this._studiesCache[e][t]=null},P.prototype.removeSeries=function(e,t){this.removeStudy(e,t)},P.prototype.recomputeStudy=function(e,t,i,n){var r=this._studiesCache[i][e];if(!r)throw Error("This should never happen");r.inputs=t,r.turnaround=n,r.engine&&(r.engine.stop(),o.unsubscribeUnused()),this._createStudy(r.requestedSymbol,r.resolution,r.studyObject,i,e,n,t)},P.prototype._convertBarsTimeToUnix=function(e){for(var t=[],i=0;i=n[0].value[0]},P.prototype.ensureExtendedTo=function(e,t,i){var n=this._studiesCache[t][e];if(!n)throw Error("This should never happen");var r=this;setTimeout((function(){r.recreateSources(n.requestedSymbol,n.resolution,t,{to:1e3*i})}),0)},P.prototype.extendSeriesRange=function(e,t,i){var n=this._studiesCache[t][e];if(!n)throw Error("This should never happen");if(this._isEndOfData(t,e,n.turnaround)){var r=n.engine.runner.host.symbolInfo.data_status;setTimeout((function(){TradingView.ChartapiMessagerInstances[t].onSeriesCompleted(e,n.turnaround,r)}),0)}else{var o=this,s=this._barsCoefficients(n.requestedSymbol,n.resolution),a=s.barsCoefficient||1;if(!s.barsCoefficient){var l=this._sessionsLastDataCache[t]||null;null!==l&&(s.expectedBarsCount=l.length+i)}setTimeout((function(){o.recreateSources(n.requestedSymbol,n.resolution,t,{countBack:(i+2)*a})}),0)}},P.prototype._updateProjectionData=function(e,t,i,n){var r=n.barsetSize?this._convertBarsTimeToUnix([{index:n.barsetSize-1,exTime:n.lastBar?n.lastBar[0]/1e3:0,value:n.lastBar}]):null;TradingView.ChartapiMessagerInstances[e].onProjectionUpdate(t,i,n,r)},P.prototype.updateSeriesTurnaround=function(e,t,i){this._studiesCache[e]||(this._studiesCache[e]={}),this._studiesCache[e][t]||(this._studiesCache[e][t]={}),this._studiesCache[e][t].type="series",this._studiesCache[e][t].turnaround=i},P.prototype.seriesTurnaround=function(e,t){return this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].turnaround},P.prototype._seriesDataRange=function(e){for(var t in this._studiesCache[e]){var i=this._studiesCache[e][t];if("series"===i.type)return null!==i.firstLoadedTime?{to:i.firstLoadedTime,countBack:0}:i.dataRange}throw new Error("cannot find series range")},P.prototype.createSeries=function(e,t,i,n,o,s,a){this._setEndOfData(i,n,o,!1);var l=new r.OHLCV;this._studiesCache[i]=this._studiesCache[i]||{};var c=this._sessionsLastDataCache[i]||null;this._sessionsLastDataCache[i]=null;var h=this._studiesCache[i][n];!h||u.isEqual(h.resolution,t)&&h.requestedSymbol===e?(void 0!==s.countBack&&null!==c&&0!==c.length&&(s.to=c[0].value[0]),h&&null!=h.firstLoadedTime&&(s.to=void 0!==s.to?Math.min(h.firstLoadedTime,s.to):h.firstLoadedTime)):void 0!==s.countBack&&null!==c&&(s.countBack+=c.length),void 0===s.countBack&&(s.countBack=0),void 0===s.to&&0===s.countBack&&(s.countBack=100),this._studiesCache[i][n]={requestedSymbol:e,resolution:t,studyObject:l,guid:n,type:"series",turnaround:o,dataRange:s,firstLoadedTime:null,symbolInfo:null},TradingView.ChartapiMessagerInstances[i].onSeriesLoading(n,o);var d=this;function p(e,n){var r=d._sessionsLastDataCache[i];if(null!==r&&(0!==r.length||0!==n.length)){var s=d._getTimeScaleBuilder(i,e,t),a=r.map((function(e){return e.value[0]})).concat(n);s.setBarsTimes(a,r.length),TradingView.ChartapiMessagerInstances[i].onTickmarksUpdated(s.firstFutureBarIndex(),s.futureBars(),e,t),Promise.resolve().then((function(){ d._pointsetsManagers[i].getUpdatesForSymbol(e.full_name,t,s).forEach((function(t,n){TradingView.ChartapiMessagerInstances[i].onPointsetDataUpdate(n,o,t,e)}))}))}}this._computeStudy(i,l,e,t,n,[],s,(function(){return-1/0}),{onDataReadyCallback:function(r,s,l,c){var u=d._studiesCache[i][n];if(!u)throw Error("This should never happen");d._sessionsLastDataCache[i]=r,u.symbolInfo=l,u.firstLoadedTime=c.firstLoadedTime,a&&d._pointsetsManagers[i].invalidatePointsetsForSymbol(l.full_name,t);var h=d._convertBarsTimeToUnix(r);if(0!==h.length){var f=d._barsCoefficients(e,t);f.expectedBarsCount&&f.barsCount&&(f.barsCoefficient=Math.min(Math.max(f.barsCoefficient||1,parseInt(f.expectedBarsCount/(h.length-f.barsCount)+.5)),100)),f.barsCount=h.length,TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n,o),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n,o,h,l,0),p(l,[])}else c.endOfData||setTimeout((function(){d.recreateSources(u.requestedSymbol,u.resolution,i,{countBack:10})}),0);c.endOfData&&(d._logMessage("Series has no more data on server: {0}".format(l.full_name)),d._setEndOfData(i,n,o,!0)),0===h.length&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n,o),TradingView.ChartapiMessagerInstances[i].onSeriesCompleted(n,o,l.data_status)},onRealtimeCallback:function(e,t,r,s,a){var l=d._convertBarsTimeToUnix(e),c=l[l.length-1];if(t){if(!d._studiesCache[i][n])throw Error("This should never happen");var u=r-1;d._logMessage("New bar arrived: symbol {0}, bar {1}".format(a.full_name,JSON.stringify(c))),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n,o,[c],a,u),p(a,[])}else d._logMessage("Last bar update: symbol {0}, bar {1}".format(a.full_name,JSON.stringify(c))),TradingView.ChartapiMessagerInstances[i].onDataUpdate(n,o,l,null,a);d._fireEvent("realtime_tick",e[e.length-1],!0)},onErrorCallback:function(e){d._logMessage("Series error: {0}".format(e)),TradingView.ChartapiMessagerInstances[i].onSeriesError(n,e),S.enabled("clear_bars_on_series_error")&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n,o)},onNonSeriesDataUpdate:function(e,t){if("projection"!==e.type)throw new Error("unexpected non-series data type for series "+e.type);var r=e.projectionTime/1e3,s=-1;(e.data||[]).forEach((function(e){s=Math.max(s,e[0]||0)})),s=Math.min(s,100);var a=e.barsetSize,l=[];if(r&&s>=0&&a&&e.lastBar){for(var c=[],u=0;u<=s;u++){var h=r+.001*u;c.push(h),l.push(1e3*h)}var f=e.lastBar.slice(0);f[0]=f[0]/1e3,TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n,o,[{index:a-1,value:f}],t,a-1,c)}p(t,l),d._updateProjectionData(i,n,o,e)}})},P.prototype.onMoreTickmarksRequested=function(e,t,i,n){var r=this._getTimeScaleBuilder(e,t,i);r.setMinFutureBarsCount(n)&&TradingView.ChartapiMessagerInstances[e].onTickmarksUpdated(r.firstFutureBarIndex(),r.futureBars(),t,i)},P.prototype.chartCreateSession=function(e){this._pointsetsManagers[e]=new a},P.prototype.chartDeleteSession=function(e){this._pointsetsManagers[e].destroy(),delete this._pointsetsManagers[e]},P.prototype.removePointset=function(e,t){ this._pointsetsManagers[e].removePointset(t)},P.prototype.createPointset=function(e,t,i,n,r){var o=this._getTimeScaleBuilder(e,i,n);if(this._pointsetsManagers[e].createPointset(t,i.full_name,n,r,o),null===this._refreshPointsetsTimerId){var s=this;this._refreshPointsetsTimerId=setTimeout((function(){s._refreshPointsetsTimerId=null,s._refreshPointsets(s._invalidatedPointsetSessions),s._invalidatedPointsetSessions.clear()}),0)}this._invalidatedPointsetSessions.add(e)},P.prototype._refreshPointsets=function(e){var t=this;e.forEach((function(e){var i=t._studiesCache[e];if(null!=i){var n=null;for(var r in i){var o=i[r];if("series"===o.type){n=o;break}}if(null!==n&&null!=n.symbolInfo){var s=t._getTimeScaleBuilder(e,n.symbolInfo,n.resolution);t._pointsetsManagers[e].getUpdatesForSymbol(n.symbolInfo.full_name,n.resolution,s).forEach((function(t,i){TradingView.ChartapiMessagerInstances[e].onPointsetDataUpdate(i,null,t,n.symbolInfo)}))}}}))},P.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map((function(e){return e.metainfo})),this._metainfoCache.push({palettes:{},inputs:[],plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"},{id:"volume",type:"line"}],graphics:{},_metainfoVersion:48,description:"Unnamed Study",format:{type:"inherit"},is_hidden_study:!0,is_price_study:!1,shortDescription:"Unnamed Study",description_localized:"Unnamed Study",id:"BarSetHeikenAshi@tv-prostudies",shortId:"BarSetHeikenAshi",packageId:"tv-basicstudies",version:"13",fullId:"BarSetHeikenAshi@tv-basicstudies-13",productId:"tv-basicstudies",name:"BarSetHeikenAshi@tv-basicstudies"})),this._metainfoCache},P.prototype.searchSymbols=function(e,t,i,n){this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(e,t,i));var r=this;this._externalDatafeed.searchSymbols(e,t,i,(function(e){r._logMessage("Symbol search response: {0}".format(JSON.stringify(e))),n(e)}))},P.prototype.resolveSymbol=function(e,t,i){y(e)||console.error("Expect to get symbol encoded string, but got the following instead: "+e);var n=g(e),r="string"==typeof n.symbol?n:n.symbol,o=r.symbol,s=r["currency-id"];this._resolveSymbolByName(o,{currency:s},t,i)},P.prototype._resolveSymbolByName=function(e,t,i,n){var r,o=t&&t.currency,s=e+(o?"_#_"+o:"");this._resolveRequests[s]?r=this._resolveRequests[s]:(r=this._resolveSymbolInternal(e,o||void 0),this._resolveRequests[s]=r),r.then(i).catch(n)},P.prototype._resolveSymbolInternal=function(e,t){var i=this;return new Promise(function(n,r){this._logMessage("Symbol resolve requested: `{0}` ".format(e));var o=!0;this._externalDatafeed.resolveSymbol(e,(function(t){o&&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(e,JSON.stringify(t))),function(e){if(e.base_name||(e.base_name=[e.name]),e.legs||(e.legs=[e.name]), e.exchange||(e.exchange=e["exchange-listed"]),e.full_name||(e.full_name=e.symbol||(e.exchange?e.exchange+":"+e.name:e.name)),e.pro_name||(e.pro_name=e.full_name),e.data_status||(e.data_status="streaming"),e.ticker||(e.ticker=e.symbol||e.name),!e.session&&e["session-regular"]&&(e.session=e["session-regular"]),!e.minmov&&e.minmovement&&(e.minmov=e.minmovement),e.currency_code&&(e.currency_id=e.currency_code),e.original_currency_code&&(e.original_currency_id=e.original_currency_code),e.supported_resolutions)for(var t=0;ta)){var u=0,h=i.valueAt(a)[TradingView.TIME_PLOT];if(hL?c.PlotRowSearchMode.NearestLeft:c.PlotRowSearchMode.Exact,M=this._study.nearestIndex(I,O);if(void 0!==M){var A=b[C];if(void 0===A&&(A=this._study.getMinFirstBarIndexForPlot(C),Number.isFinite(A)&&(b[C]=A)),!(A>M)){var k=this._study.data().last(),E=this._study.data().valueAt(M)||(null!==k?k.value:null);if(null!==E){var V=E[x+1];if(Object(r.isNumber)(V)){P.value=g.format(V);var D=this._study.properties().styles[C].color.value();y=h[x];Object(d.isOhlcPlot)(y)&&(C=y.target||C,D=this._study.properties().ohlcPlots[C].color.value());var B=D;if(p[C]&&E.length>p[C].index+1){var R=E[p[C].index+1],N=p[C].palette;if(null!=R&&void 0!==N){var j=p[C].paletterProps,F=N.valToIndex?N.valToIndex[R]:R;B=j.colors[void 0!==F?F:R].color.value()}}B=Object(a.resetTransparency)(B),P.color=B}}}}}}return t},e.prototype._hideValues=function(){return p&&(null===this._model.crossHairSource().pane||Object(u.isLineToolName)(h.tool.value())||null!==this._model.lineBeingEdited())},e}()},Ecpn:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n={PivotPointsStandard:!0,VbPVisible:!0};function r(e){return e in n}},EqoR:function(e,t,i){"use strict";var n=i("5rJj"),r=i("aDyP").LineToolPitchfork;function o(e,t){var i=t||o.createProperties();r.call(this,e,i)}inherit(o,r),o.prototype.name=function(){return"Inside Pitchfork"},o.createProperties=function(e){var t=new n("linetoolinsidepitchfork",e,!1,{range:[0,8]});return o._configureProperties(t),t},o._configureProperties=function(e){r._configureProperties(e)},t.LineToolInsidePitchfork=o},Ery9:function(e,t,i){"use strict";i.r(t),i.d(t,"setCustomAdapter",(function(){return m})),i.d(t,"initialize",(function(){return v})),i.d(t,"updateUser",(function(){return y})),i.d(t,"getChartsCount",(function(){return g})),i.d(t,"getCharts",(function(){return b})),i.d(t,"removeChart",(function(){return S})),i.d(t,"saveChart",(function(){return w})),i.d(t,"getChartContent",(function(){return P})),i.d(t,"loadChart",(function(){return C})),i.d(t,"removeStudyTemplate",(function(){return T})),i.d(t,"getStudyTemplateContent",(function(){return x})),i.d(t,"saveStudyTemplate",(function(){return I})),i.d(t,"getStudyTemplatesList",(function(){return L})),i.d(t,"invalidateStudyTemplatesList",(function(){return O})),i.d(t,"getStudyTemplateContentById",(function(){return M})),i.d(t,"getStandardStudyTemplateContentById",(function(){return A})),i.d(t,"removeStudyTemplateById",(function(){return k})),i.d(t,"renameStudyTemplate",(function(){return E})),i.d(t,"replaceStudyTemplate",(function(){return V})),i.d(t,"getDrawingTemplates",(function(){return D})),i.d(t,"loadDrawingTemplate",(function(){return B})),i.d(t,"removeDrawingTemplate",(function(){return R})),i.d(t,"saveDrawingTemplate",(function(){return N}));var n,r,o,s,a=i("mrSG"),l=i("FQhm"),c=i("ogJP"),u=i("txPx"),h=i("Cf1E"),d=Object(u.getLogger)("Chart.SaveloadAdapter.Library"),p=null,f=null ;function _(e){return o+"/"+encodeURIComponent(s)+"/"+e+"?client="+encodeURIComponent(n)+"&user="+encodeURIComponent(r)}function m(e){p=e}function v(e,t,i,a){n=e,r=t,o=i,s=a}function y(e){r=e}function g(e,t){throw new Error("Not implemented")}function b(e,t){void 0===t&&(t=function(){});var i=function(t){e(t.map((function(e){return{id:e.id,name:e.name,image_url:String(e.id),modified_iso:e.timestamp,short_symbol:e.symbol,interval:e.resolution}})))};if(!p)return $.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(o,encodeURIComponent(s),encodeURIComponent(n),encodeURIComponent(r)),type:"GET",crossDomain:!0}).done((function(e){var n=Object(c.parseJSONorNot)(e);if("ok"!==n.status)return d.logWarn("Charts list request failed: "+n.message),void t();i(n.data)})).fail(t);p.getAllCharts().then(i).catch(t)}function S(e,t){p?p.removeChart(e).then(t):$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(o,encodeURIComponent(s),encodeURIComponent(n),encodeURIComponent(r),encodeURIComponent(e)),type:"DELETE",crossDomain:!0}).done((function(e){var i=Object(c.parseJSONorNot)(e);"ok"!==i.status&&d.logWarn("Chart delete request failed: "+i.message),t()}))}function w(e,t,i,l,u,h,f){var _=u.id.value(),m={name:e,content:JSON.stringify(l),symbol:t,resolution:i};if(p)p.saveChart(Object(a.a)(Object(a.a)({},m),{id:_})).then(h).catch(f);else{var v="{0}/{1}/charts?client={2}&user={3}".format(o,encodeURIComponent(s),encodeURIComponent(n),encodeURIComponent(r));null!=_&&(v+="&chart="+encodeURIComponent(_)),$.ajax({url:v,data:m,type:"POST",crossDomain:!0}).done((function(e){var t=Object(c.parseJSONorNot)(e);if("ok"!==t.status)return d.logWarn("Chart save request failed: "+t.message),void f();h(t.id)})).fail((function(){f()}))}}function P(e,t,i){var a=function(t){var i=JSON.parse(t);return i.uid=e.id,i};p?p.getChartContent(e.id).then((function(e){var i=a(e);t(i)})).catch(i):$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(o,encodeURIComponent(s),encodeURIComponent(n),encodeURIComponent(r),encodeURIComponent(e.id)),type:"GET",crossDomain:!0}).done((function(e){var i=Object(c.parseJSONorNot)(e);if("ok"===i.status){var n=a(i.data.content);t(n)}else d.logWarn("Chart load request failed: "+i.message)})).fail((function(){i&&i()}))}function C(e){P(e,(function(e){l.emit("chart_load_requested",e)}),(function(){d.logWarn("Error loading chart")}))}function T(e){return Object(a.b)(this,void 0,void 0,(function(){var t,i,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),p?[2,p.removeStudyTemplate({name:e})]:[4,fetch(_("study_templates")+"&template="+encodeURIComponent(e),{method:"DELETE",credentials:"same-origin"})];case 1:if(!(t=r.sent()).ok)throw new Error("Remove study template response was not OK. Status: "+t.status+".");return[4,t.json()];case 2:if("ok"!==(i=r.sent()).status)throw new Error("Remove study template request failed: "+i.message);return[3,4];case 3:throw n=r.sent(),d.logWarn(Object(h.a)(n)),n;case 4:return[2]}}))}))}function x(e){ return Object(a.b)(this,void 0,void 0,(function(){var t,i,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),p?[4,p.getStudyTemplateContent({name:e})]:[3,2];case 1:return[2,{content:r.sent()}];case 2:return[4,fetch(_("study_templates")+"&template="+encodeURIComponent(e),{credentials:"same-origin"})];case 3:if(!(t=r.sent()).ok)throw new Error("Get study template response was not OK. Status: "+t.status+".");return[4,t.json()];case 4:if("ok"!==(i=r.sent()).status)throw new Error("Get study template request failed: "+i.message);return[2,i.data];case 5:throw n=r.sent(),d.logWarn(Object(h.a)(n)),n;case 6:return[2]}}))}))}function I(e){return Object(a.b)(this,void 0,void 0,(function(){var t,i,n,r;return Object(a.d)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),p?[2,p.saveStudyTemplate(e).then((function(){return{error:""}})).catch((function(e){return{error:null!=e?Object(h.a)(e):"error"}}))]:((t=new FormData).append("name",e.name),t.append("content",e.content),[4,fetch(_("study_templates"),{method:"POST",body:t,credentials:"same-origin"})]);case 1:if(!(i=o.sent()).ok)throw new Error("Save study template response was not OK. Status: "+i.status+".");return[4,i.json()];case 2:return[2,{error:"ok"===(n=o.sent()).status?"":n.status}];case 3:throw r=o.sent(),d.logWarn(Object(h.a)(r)),r;case 4:return[2]}}))}))}function L(){return Object(a.b)(this,void 0,void 0,(function(){var e,t,i,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),f?[2,f]:(f=[],e=function(e){return f=e.map((function(e){return{is_default:!1,name:e.name}}))},p?[2,p.getAllStudyTemplates().then(e)]:[4,fetch(_("study_templates"),{method:"GET",credentials:"same-origin"})]);case 1:if(!(t=r.sent()).ok)throw new Error("Study templates list response was not OK. Status: "+t.status+".");return[4,t.json()];case 2:if("ok"!==(i=r.sent()).status)throw new Error("Study templates list request failed: "+i.message);return[2,e(i.data)];case 3:throw n=r.sent(),d.logWarn(Object(h.a)(n)),n;case 4:return[2]}}))}))}function O(){f=null}function M(e,t){throw new Error("Not implemented")}function A(e,t){throw new Error("Not implemented")}function k(e,t){throw new Error("Not implemented")}function E(e,t,i){throw new Error("Not implemented")}function V(e,t,i){throw new Error("Not implemented")}function D(e){return Object(a.b)(this,void 0,void 0,(function(){var t,i,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:throw new Error("Not implemented");case 1:return r.trys.push([1,4,,5]),p?[2,p.getDrawingTemplates(e)]:[4,fetch(_("drawing_templates")+"&tool="+encodeURIComponent(e),{credentials:"same-origin"})];case 2:if(!(t=r.sent()).ok)throw new Error("Get drawing templates response was not OK. Status: "+t.status+".");return[4,t.json()];case 3:if("ok"!==(i=r.sent()).status)throw new Error("Drawing templates request failed: "+i.message);return[2,i.data];case 4:throw n=r.sent(),d.logWarn(Object(h.a)(n)),n;case 5:return[2]}}))}))}function B(e,t){ return Object(a.b)(this,void 0,void 0,(function(){var i,n,r;return Object(a.d)(this,(function(o){switch(o.label){case 0:throw new Error("Not implemented");case 1:return o.trys.push([1,4,,5]),p?[2,p.loadDrawingTemplate(e,t).then((function(e){return JSON.parse(e)}))]:[4,fetch(_("drawing_templates")+"&tool="+encodeURIComponent(e)+"&name="+encodeURIComponent(t),{credentials:"same-origin"})];case 2:if(!(i=o.sent()).ok)throw new Error("Load drawing template response was not OK. Status: "+i.status+".");return[4,i.json()];case 3:if("ok"!==(n=o.sent()).status)throw new Error("Drawing template request failed: "+n.message);return[2,JSON.parse(n.data.content)];case 4:throw r=o.sent(),d.logWarn(Object(h.a)(r)),r;case 5:return[2]}}))}))}function R(e,t){return Object(a.b)(this,void 0,void 0,(function(){var i,n,r;return Object(a.d)(this,(function(o){switch(o.label){case 0:throw new Error("Not implemented");case 1:return o.trys.push([1,4,,5]),p?[2,p.removeDrawingTemplate(e,t)]:[4,fetch(_("drawing_templates")+"&tool="+encodeURIComponent(e)+"&name="+encodeURIComponent(t),{method:"DELETE",credentials:"same-origin"})];case 2:if(!(i=o.sent()).ok)throw new Error("Remove drawing template response was not OK. Status: "+i.status+".");return[4,i.json()];case 3:if("ok"!==(n=o.sent()).status)throw new Error("Remove drawing template request failed: "+n.message);return[3,5];case 4:throw r=o.sent(),d.logWarn(Object(h.a)(r)),r;case 5:return[2]}}))}))}function N(e,t,i){return Object(a.b)(this,void 0,void 0,(function(){var n,r,o,s;return Object(a.d)(this,(function(a){switch(a.label){case 0:throw new Error("Not implemented");case 1:return a.trys.push([1,4,,5]),p?[2,p.saveDrawingTemplate(e,t,i)]:((n=new FormData).append("content",i),[4,fetch(_("drawing_templates")+"&tool="+encodeURIComponent(e)+"&name="+encodeURIComponent(t),{method:"POST",body:n,credentials:"same-origin"})]);case 2:if(!(r=a.sent()).ok)throw new Error("Save drawing template response was not OK. Status: "+r.status+".");return[4,r.json()];case 3:if("ok"!==(o=a.sent()).status)throw new Error("Save drawing template request failed: "+o.message);return[3,5];case 4:throw s=a.sent(),d.logWarn(Object(h.a)(s)),s;case 5:return[2]}}))}))}},EsvI:function(e,t,i){"use strict";i.r(t);i("bSeV");var n=i("eJTA"),r=i("wZIs"),o=i("Vdly"),s=i("BHQF"),a=i("txPx"),l=Object(a.getLogger)("Themes.Provider"),c=null;function u(e){return Object(s.fetch)("/theme/?themeName="+encodeURIComponent(e),{credentials:"include",method:"GET"}).then((function(e){return e.json()})).then((function(e){var t={};return e.content&&(t.content=JSON.parse(e.content)),t}))}var h,d=i("zM7N"),p=i("oiZD"),f=i("YFKU"),_=i("IMMp"),m=i("HGP3"),v=((h={})[d.a.Light]={name:d.a.Light,label:function(){return Object(f.t)("Light",{context:"colorThemeName"})},order:2,getThemedColor:function(e){return Object(m.b)(e)}},h[d.a.Dark]={name:d.a.Dark,label:function(){return Object(f.t)("Dark",{context:"colorThemeName"})},order:1,getThemedColor:function(e){var t=_[e]||e;return Object(m.b)(t)}},h);function y(e){return!e.isPrivate}function g(){ return v[p.watchedTheme.value()]||v.light}function b(e){return g().getThemedColor(e)}function S(e,t,i,n,o,s,a){void 0===o&&(o=!0),void 0===s&&(s=!1),void 0===a&&(a=!1);var l=t?Promise.resolve(O(e)):T(e);return l.then((function(l){if(void 0!==l.content){var c=!t;a&&(void 0!==(u=l.content).chartProperties&&Object(r.applyDefaultsOverrides)(u.chartProperties),void 0!==u.mainSourceProperties&&Object(r.applyDefaultsOverrides)(u.mainSourceProperties,void 0,!0,"mainSeriesProperties")),n.applyTheme(l.content,c,i,e,t,o,s)}var u})),l}i.d(t,"isPublicTheme",(function(){return y})),i.d(t,"getCurrentTheme",(function(){return g})),i.d(t,"getThemedColor",(function(){return b})),i.d(t,"loadTheme",(function(){return S})),i.d(t,"restoreTheme",(function(){return w})),i.d(t,"savedThemeName",(function(){return P})),i.d(t,"syncTheme",(function(){return C})),i.d(t,"getTheme",(function(){return T})),i.d(t,"getThemeNames",(function(){return x})),i.d(t,"getStdThemeNames",(function(){return I})),i.d(t,"isStdThemeName",(function(){return L})),i.d(t,"getStdTheme",(function(){return O})),i.d(t,"getStdThemedValue",(function(){return M})),i.d(t,"isStdThemedDefaultValue",(function(){return A})),i.d(t,"saveTheme",(function(){return k})),i.d(t,"removeTheme",(function(){return E})),i.d(t,"isThemeExist",(function(){return V})),i.d(t,"translateStdThemeName",(function(){return D})),i.d(t,"isStdTheme",(function(){return B})),i.d(t,"extractThemeFromModel",(function(){return R})),i.d(t,"DEFAULT_THEME",(function(){return"light"})),i.d(t,"themes",(function(){return v}));function w(){Object(p.setTheme)(Object(o.getValue)("current_theme.name")||"light")}function P(){return Object(o.getValue)("current_theme.name")||null}function C(){Object(o.setValue)("current_theme.name",g().name,{forceFlush:!0})}function T(e){return u(e)}function x(){return c||Object(s.fetch)("/themes/",{credentials:"include",method:"GET"}).then((function(e){return c=e.json()}))}function I(){return d.c()}function L(e){return I().includes(e)}function O(e){return d.b(e)||{content:void 0}}function M(e,t){var i=t||g().name,n=d.b(i),r=0!==e.length&&e.split(".");return n&&n.content&&r?r.reduce((function(e,t){return e[t]}),n.content):null}function A(e,t,i){var r=M(e,i);return null!==r&&Object(n.areEqualRgba)(Object(n.parseRgba)(r),Object(n.parseRgba)(String(t)))}function k(e,t){return function(e,t){var i=new FormData;return i.append("content",JSON.stringify(t)),i.append("name",e),c=null,Object(s.fetch)("/save-theme/",{credentials:"include",method:"POST",body:i}).then((function(e){return e.json()}),(function(e){return l.logError(e)}))}(e,t)}function E(e){return function(e){var t=new FormData;return t.append("name",e),c=null,Object(s.fetch)("/remove-theme/",{credentials:"include",method:"POST",body:t}).then((function(e){return e.json()}),(function(e){return l.logError(e)}))}(e)}function V(e){return function(e){return u(e).then((function(e){return Boolean(e.content)}))}(e)}function D(e){return d.e(e)}function B(e){return d.d(e)}function R(e){return{content:{chartProperties:{ paneProperties:e.model().properties().paneProperties.state(),scalesProperties:e.model().properties().scalesProperties.state()},sessions:e.model().sessions().properties().state(),mainSourceProperties:e.model().mainSeries().properties().state()}}}},EyEd:function(e,t,i){"use strict";var n=i("lCO3").Version,r=i("txPx").getLogger("Chart.StudyMigration");function o(e){this._studyId=e,this._maxToVers=n.ZERO,this._maxFromVers=n.ZERO,this._migrs=[]}o.prototype.addMigration=function(e,t,i){var r=n.parse(e),o=n.parse(t);r.isGreater(this._maxFromVers)&&(this._maxFromVers=r),o.isGreater(this._maxToVers)&&(this._maxToVers=o),this._migrs.push({fromVers:r,toVers:o,rules:i})},o.prototype.updateInputs=function(e,t,i){if(!i)return i;for(var n=TradingView.clone(i),o=e;o.isLess(t);){var s=this._findMigration(o);if(null==s)break;if(r.logNormal("Migrating study inputs from "+s.fromVers+" to "+s.toVers+" version, studyId: "+this._studyId+", migration: "+JSON.stringify(s)+", inputs: "+JSON.stringify(i)),n=this._applyMigration(n,s),!o.isLess(s.toVers))throw new Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");o=s.toVers}return o>e&&r.logNormal("Study inputs migration is done, studyId: "+this._studyId+", inputs: "+JSON.stringify(n)),n},o.prototype._findMigration=function(e){for(var t=-1,i=this._maxFromVers,n=0;n=0||t.indexOf(e)>=0},o._applyInputChangedMinMaxRule=function(e,t){if("adjustValIfNeeded"!==t.action)throw new Error("Unknown action "+t.action+" for rule with type "+t.type);var i=e[t.inputId];return it.maxVal&&(e[t.inputId]=t.maxVal),r.logNormal("Input "+t.inputId+"="+i+" adjusted to value "+e[t.inputId]),e},o._applyInputChangedOptionsRule=function(e,t){if(!(["text"].indexOf(t.inputType)>=0&&"resetToDefValIfNeeded"===t.action))throw new Error("Unexpected rule.inputType="+t.inputType+" in rule.action="+t.action);var i=e[t.inputId];return t.options.indexOf(i)<0&&(e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal)),e},e.exports=o},Eyy1:function(e,t,i){"use strict";function n(e){if(void 0===e)throw new Error("Value is undefined");return e}function r(e){if(null===e)throw new Error("Value is null");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.ensureNever=t.ensure=t.ensureNotNull=t.ensureDefined=t.assert=void 0,t.assert=function(e,t){if(!e)throw new Error("Assertion failed"+(t?": "+t:""))},t.ensureDefined=n,t.ensureNotNull=r,t.ensure=function(e){return r(n(e))},t.ensureNever=function(e){}},F58L:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyTemplates",(function(){return p}));var n=i("zUrt"),r=i("JWMC"),o=i("aIyQ"),s=i.n(o),a=i("hY0g"),l=i.n(a),c=i("fZEr"),u=i("txPx"),h=Object(u.getLogger)("Platform.StudyTemplates"),d={confirmDelete:window.t("Do you really want to delete Study Template '{0}' ?")},p=function(){function e(e){var t=this;this._chartWidgetCollection=e.chartWidgetCollection,this._favoriteStudyTemplatesService=e.favoriteStudyTemplatesService,window.loginStateChange.subscribe(null,n.backend.invalidateStudyTemplatesList),this._list=new l.a([]),this._onChange=new s.a,this._list.subscribe((function(){return t._onChange.fire()}))}return e.prototype.findRecordByName=function(e){return this._list.value().find((function(t){return t.name===e}))||null},e.prototype.showSaveAsDialog=function(){var e=this,t=this._chartWidgetCollection.activeChartWidget.value().model();Promise.all([i.e("react"),i.e(1),i.e(2),i.e(5),i.e(7),i.e(9),i.e(10),i.e(12),i.e(15),i.e(16),i.e(19),i.e(25),i.e(36),i.e(84),i.e(0),i.e(4),i.e(8),i.e(17),i.e("study-template-dialog")]).then(i.bind(null,"IDfV")).then((function(i){new i.StudyTemplateSaver({controller:t,onSave:function(t){e._list.setValue(t)}}).show()}))},e.prototype.applyTemplate=function(e){var t=this,i=this.findRecordByName(e);null!==i?window.runOrSignIn((function(){var e=t._chartWidgetCollection.activeChartWidget.value(),o=function(t){Object(r.trackEvent)("GUI","Load Study Template"),e.model().applyStudyTemplate(JSON.parse(t.content),i.name)};void 0!==i.id?i.is_default?n.backend.getStandardStudyTemplateContentById(i.id,o):n.backend.getStudyTemplateContentById(i.id,o):n.backend.getStudyTemplateContent(i.name).then(o)}),{source:"Study templates apply"}):h.logNormal("Template "+e+" not found in cache")},e.prototype.deleteStudyTemplate=function(e){var t=this.findRecordByName(e) ;null!==t?this._removeTemplate(t):h.logNormal("Template "+e+" not found in cache")},e.prototype.list=function(){return this._list.value()},e.prototype.getOnChange=function(){return this._onChange},e.prototype.refreshStudyTemplateList=function(e){var t=this;n.backend.getStudyTemplatesList().then((function(i){t._list.setValue(i),void 0!==e&&e()}))},e.prototype.invalidate=function(){n.backend.invalidateStudyTemplatesList()},e.prototype._removeTemplate=function(e){var t=this;window.runOrSignIn((function(){Object(c.a)({text:d.confirmDelete.format(e.name),onConfirm:function(i){var r=i.dialogClose;return new Promise((function(i){var o=function(){t.refreshStudyTemplateList((function(){var n=t.list();t._list.setValue(n.filter((function(t){return t!==e}))),t._favoriteStudyTemplatesService&&t._favoriteStudyTemplatesService.remove(e.name),i(),r()}))};n.backend.invalidateStudyTemplatesList(),void 0!==e.id?n.backend.removeStudyTemplateById(e.id,o):n.backend.removeStudyTemplate(e.name).then(o)}))}})}),{source:"Study templates delete"})},e}()},FBsw:function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayPriceAxisView",(function(){return a}));var n=i("mrSG"),r=i("KcY8"),o=i("n5al"),s=i("oXaB"),a=function(e){function t(t){var i=e.call(this)||this;return i._source=t,i}return Object(n.c)(t,e),t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var n=this._source.lastValueData("close",!1);if(!n.noData){var r=this._source.model(),o=this._source.priceScale();if(null!==o&&r.isPriceScaleVisible(o)){i.background=n.color,i.color=this.generateTextColor(n.color),i.coordinate=n.coordinate,i.floatCoordinate=n.floatCoordinate;var a=this._source.model().properties().scalesProperties;a.showSeriesLastValue.value()&&(e.text=this._text(n),e.visible=!0),t.text="",(a.showSymbolLabels.value()||a.seriesLastValueMode.value()===s.PriceAxisLastValueMode.LastPriceAndPercentageValue)&&(t.text=this._paneText(n),t.visible=t.text.length>0)}}},t.prototype._paneText=function(e){var t="",i=this._source.model().properties().scalesProperties;if(i.showSymbolLabels.value()){var n=this._source.symbolInfo();t+=(n&&Object(o.symbolCurrentContract)(n)||this._source.symbol())+" "}var r=this._source.priceScale();return null!==r&&i.showSeriesLastValue.value()&&i.seriesLastValueMode.value()===s.PriceAxisLastValueMode.LastPriceAndPercentageValue&&(t+=r.isPercentage()?e.formattedPriceAbsolute:e.formattedPricePercentage),t.trim()},t.prototype._text=function(e){var t=this._source.model().properties().scalesProperties,i=this._source.priceScale();return t.seriesLastValueMode.value()!==s.PriceAxisLastValueMode.LastPriceAndPercentageValue||null===i?e.text:i.isPercentage()?e.formattedPricePercentage:e.formattedPriceAbsolute},t}(r.a)},FBuY:function(e,t,i){"use strict";i.r(t),i.d(t,"TVXWindowEvents",(function(){return n}));i("HbRj");var n,r=i("txPx"),o=i("VVxS"),s=Object(r.getLogger)("XWindowEvents");!function(e){var t,i="tvxwevents.",n={};window.BroadcastChannel?((t=new BroadcastChannel("tvxwevents")).addEventListener("message",(function(e){var t=e.data,i=t.event,r=t.value ;n[i]&&n[i].forEach((function(e){e(r)}))})),function(){for(var e=[],t=performance.now(),n=0;n0&&(a+=o(c+11)/2),a+=o(c)/2}e.restore()},e.prototype.hitTest=function(e){for(var t=0,i=this._drawRects;t=r.left&&e.x<=r.left+r.width&&e.y>=r.top&&e.y<=r.top+r.height)return new n.HitTestResult(n.HitTestResult.REGULAR)}return null},e}()},Fixu:function(e,t,i){"use strict";i.d(t,"c",(function(){return r})),i.d(t,"d",(function(){return o})),i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return a}));i("Eyy1"),i("dfhE");function n(e,t){0}function r(e){n()}function o(e){n()}function s(e){n()}function a(e){0}},FsE7:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("5rJj"),o=i("j3hX"),s=o.LineToolWidthsProperty,a=o.LineToolColorsProperty;function l(e,t){var r=t||l.createProperties();n.call(this,e,r),this.version=l.version,i.e("lt-pane-views").then(function(e){var t=i("wgWl").FibTimeZonePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(l,n),l.version=2,l.LevelsCount=11,l.prototype.levelsCount=function(){return l.LevelsCount},l.prototype.migrateVersion=function(e,t,i){if(1===e){i.properties.level1.color.setValue(i.properties.baselinecolor.value());for(var n=2;n<=11;n++)i.properties["level"+n].color.setValue(i.properties.linecolor.value());for(n=1;n<=11;n++)i.properties["level"+n].linewidth.setValue(i.properties.linewidth.value()),i.properties["level"+n].linestyle.setValue(i.properties.linestyle.value())}},l.prototype.pointsCount=function(){return 2},l.prototype.name=function(){return"Fib Time Zone"},l.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},l.prototype._getPropertyDefinitionsViewModelClass=function(){ return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("SMr9").FibTimezoneDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l.createProperties=function(e){var t=new r("linetoolfibtimezone",e,!1,{range:[1,11]});return l._configureProperties(t),t},l._configureProperties=function(e){n._configureProperties(e);for(var t=[],i=[],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));for(t=[],i=[],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new s(t))},t.LineToolFibTimeZone=l},G3Rl:function(e,t,i){"use strict";function n(e,t){var i=new Map;return function(){for(var n=[],r=0;r-1,L=I&&navigator.userAgent.toLowerCase().indexOf("windows")>-1,O=navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("edge"),M=window.urlParams||{};window.initData;function A(e,t,i){var n=(0,f.createDisconnectedBoundCanvas)(document,new f.Size(t,i));return(0,f.getPrescaledContext2D)(n.canvas).drawImage(e,0,0,t,i),n}function k(e){return!b||e>500}M.no_referral_id&&enable(M.referral_id||"","aggressive");var E=function(){function e(t){var i=t.layout,n=void 0===i?"site_branding":i,r=t.symbol,o=void 0===r?"":r,s=t.model,l=t.onReadyCallback;m(this,e),this._model=s,this._image=null,this._imageReady=!1,this._needDisplayImage=!1,this._imageWidth=22,this._imageHeight=13,this._layout=n,this._symbol=o,this.showAnimatedBranding=a.enabled("show_animated_logo")||"widget_branding"===this._layout,this.show=!0,this.width=100,this.height=14,this._bottomShift=0,this._brandCircleSize=32,this._animatedWidth=this._brandCircleSize,this._animatedOpacity=0,this.width=this.showAnimatedBranding?this._brandCircleSize:100,this.height=14,this._fillColor=u.color.brandNew,this._colorOldBlue=u.color.brandNew2,this._colorOldGray=u.color.black30,this._strokeColor=u.color.black255,this._brandCircleShadowColor=u.color.black0,this._strokeWidth=4,this._fontSize=this.showAnimatedBranding?11:14,this._font="px "+g,this._txt="TradingView",this._onReadyCallback=l,this._upscaleRatio=O?1:2,this._verticalTextShift=I?this.showAnimatedBranding?2:4:0,this._strokeCanv=null,this._fillCanv=null,this._init()}return r(e,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this.showAnimatedBranding?(this._loadImage(y,"tvLogo"),this._createFillText()):this._loadImage(y,"tvLogo"),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var e=(0, h.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,e>.2?(this._brandCircleColor=u.color.black255,this._animatedColorBg=u.color.black255,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.8):(this._brandCircleColor=u.color.black27,this._animatedColorBg=u.color.black27,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.1)}},{key:"_loadImage",value:function(e,t){var i=this;if(this._needDisplayImage){this._image={canvas:new Image},this.showAnimatedBranding&&(this._imageWhite={canvas:new Image});var n=e.replace(/fill="#[\da-f]{6}"/i,'fill="#FFFFFF"');this._image.canvas.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e),this.showAnimatedBranding&&(this._imageWhite.canvas.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n)),this._image.canvas.addEventListener("load",(function(){L&&(i._image=A(i._image.canvas,i._imageWidth,i._imageHeight)),i._imageReady=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()}))}}},{key:"_checkLayout",value:function(){switch(this._layout){case"widget_branding":case"widget_referral_branding":case"widget_custom_branding":case"fundamental_branding":case"fundamental_custom_branding":case"library_custom_branding":case"library_branding":case"site_branding":this.show=!0;break;case"widget_custom_no_powered_branding":case"fundamental_custom_no_powered_branding":case"library_custom_no_powered_branding":this.show=!1}switch(this._layout){case"library_branding":this._needDisplayImage=!0,this._txt=window.t(P);break;case"library_custom_branding":this._txt=window.t(x)}}},{key:"_drawTextStroke",value:function(e){if(!this._strokeCanv){this._strokeCanv=(0,f.createDisconnectedBoundCanvas)(document,new f.Size(0,0));var t=(0,f.getPretransformedContext2D)(this._strokeCanv),i=Math.round(this._strokeWidth*this._upscaleRatio);t.font=this._fontSize*this._upscaleRatio+this._font,this._textWidth=t.measureText(this._txt).width+2;var n=this._textWidth+2*i,r=(this._fontSize+2*i)*this._upscaleRatio;n%2==0&&(n+=1,r+=1),this._strokeCanv.resizeCanvas({width:n,height:r}),(t=(0,f.getPretransformedContext2D)(this._strokeCanv)).textBaseline="top",t.textAlign="start",t.font=this._fontSize*this._upscaleRatio+this._font,t.strokeStyle=this._strokeColor,t.lineWidth=this._strokeWidth*this._upscaleRatio,t.lineJoin="round",t.strokeText(this._txt,i,this._verticalTextShift)}e.save(),e.globalAlpha=this._strokeOpacity,e.drawImage(this._strokeCanv.canvas,0,0,this._strokeCanv.canvas.width,this._strokeCanv.canvas.height,0,0,this._strokeCanv.canvas.width/this._upscaleRatio/this._strokeCanv.pixelRatio,this._strokeCanv.canvas.height/this._upscaleRatio/this._strokeCanv.pixelRatio),e.restore()}},{key:"_drawTextFill",value:function(e){this._createFillText(),e.save(),e.drawImage(this._fillCanv.canvas,0,0,this._fillCanv.canvas.width,this._fillCanv.canvas.height,0,0,this._fillCanv.canvas.width/this._upscaleRatio/this._fillCanv.pixelRatio,this._fillCanv.canvas.height/this._upscaleRatio/this._fillCanv.pixelRatio),e.restore()}},{key:"_createFillText", value:function(){if(null===this._fillCanv){this._fillCanv=(0,f.createDisconnectedBoundCanvas)(document,new f.Size(0,0));var e=(0,f.getPretransformedContext2D)(this._fillCanv),t=Math.round(this._strokeWidth*this._upscaleRatio);e.font=this._fontSize*this._upscaleRatio+this._font,void 0===this._textWidth&&(this._textWidth=Math.round(e.measureText(this._txt).width)+2),this._setSizeFillTextCanvas(t),(e=(0,f.getPretransformedContext2D)(this._fillCanv)).textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.fillStyle=this._fillColor,e.fillText(this._txt,t,this._verticalTextShift)}}},{key:"_updateFillTextWithColor",value:function(e){var t=Math.round(this._strokeWidth*this._upscaleRatio);this._setSizeFillTextCanvas(t);var i=(0,f.getPretransformedContext2D)(this._fillCanv);i.clearRect(0,0,this._fillCanv.canvas.width,this._fillCanv.canvas.height),i.textBaseline="top",i.textAlign="start",i.font=this._fontSize*this._upscaleRatio+this._font,i.fillStyle=e,i.fillText(this._txt,t,this._verticalTextShift)}},{key:"_setSizeFillTextCanvas",value:function(e){var t=this._textWidth+2*e,i=(this._fontSize+2*e)*this._upscaleRatio;t%2==0&&(t+=1,i+=1),this._fillCanv.resizeCanvas({width:t,height:i})}},{key:"_drawFillTextCropWidth",value:function(e,t,i){this._fillCanv?this._updateFillTextWithColor(i):this._createFillText(),e.save(),e.drawImage(this._fillCanv.canvas,0,0,t*this._upscaleRatio*this._fillCanv.pixelRatio,this._fillCanv.canvas.height,0,0,t,this._fillCanv.canvas.height/this._upscaleRatio/this._fillCanv.pixelRatio),e.restore()}},{key:"_drawBgCircle",value:function(e){e.save(),e.beginPath(),e.fillStyle=this._brandCircleShadowColor,e.globalAlpha=this._brandCircleShadowOpacity,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2+1,0,2*Math.PI),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.fillStyle=this._brandCircleColor,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore()}},{key:"_drawFillRectWithRoundedCorner",value:function(e,t,i,n,r,o,s){e.save(),(0,p.drawRoundRect)(e,t-1,i-1,n+2,r+2,o),e.globalAlpha=this._brandCircleShadowOpacity,e.fillStyle=this._brandCircleShadowColor,e.fill(),e.closePath(),e.restore(),e.save(),(0,p.drawRoundRect)(e,t,i,n,r,o),e.fillStyle=s,e.fill(),e.closePath(),e.restore()}},{key:"_drawImageWithColor",value:function(e){e.save(),e.globalAlpha=this._animatedOpacity,e.drawImage(this._imageWhite.canvas,0,-.5,this._imageWidth,this._imageHeight),e.restore(),e.save(),e.globalAlpha=1-this._animatedOpacity,e.drawImage(this._image.canvas,0,-.5,this._imageWidth,this._imageHeight),e.restore()}},{key:"destroy",value:function(){this._model.properties().paneProperties.background.unsubscribeAll(this),this._model.onChartThemeLoaded().unsubscribeAll(this)}},{key:"bottomShift",value:function(){return this._bottomShift}},{key:"hasAnimation",value:function(){return this.showAnimatedBranding}},{key:"minimizedAnimationWidth",value:function(){return this._brandCircleSize}},{key:"maximizedAnimationWidth", value:function(){return this._createFillText(),this._fillCanv.canvas.width/this._upscaleRatio/this._fillCanv.pixelRatio+this._brandCircleSize-3}},{key:"animatedDrawStep",value:function(e,t){this._animatedWidth=t;var i=this._animatedWidtho&&(e.translate(this._imageWidth/2+r,.5),this._drawFillTextCropWidth(e,this._animatedWidth-o,this._animatedColorText)),e.restore(),this.width=this._animatedWidth,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight}}else if("widget_custom_branding"===this._layout||"fundamental_custom_branding"===this._layout){var s="12px "+g;e.font=s;var a=e.measureText(this._txt).width+2;this.width=a+e.measureText("TradingView").width+2,e.save(),e.globalAlpha=.7,e.fillStyle=this._colorOldGray,e.fillText(this._txt,0,12),e.fillStyle=this._colorOldBlue,e.fillText("TradingView",a,12),e.restore()}else if(function(e){return!S||e>480}(t))if(this._needDisplayImage&&this._imageReady){e.save();var l=(this._brandCircleSize-this._imageWidth)/2;e.translate(l,0),this._drawBgCircle(e),e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight);var c=12+(O?-.5:0);e.translate(this._imageWidth+c,-.5);var u=k(t);u&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),this.width=this._imageWidth+l,this.width+=u?c+this._strokeCanv.canvas.width/this._upscaleRatio/this._strokeCanv.pixelRatio:l,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight}else{e.save(),e.translate(O?-.5:0,-.5);var h=k(t);h&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),h&&(this.width=this._strokeCanv.canvas.width/this._upscaleRatio/this._strokeCanv.pixelRatio)}}}]),e}(),V=function(){function e(t){var i=t.layout,n=void 0===i?"site_branding":i,r=t.src,o=t.onReadyCallback;m(this,e),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=n,this._src=r,this._onReadyCallback=o,this._init()}return r(e,[{key:"_init",value:function(){var e=this;this._checkLayout(), this.show&&(this._img.src=this._src,this._img.addEventListener("load",(function(){e.width=Math.round(e._img.width),e.height=Math.round(e._img.height),L&&(e._img=A(e._img,e.width,e.height).canvas),e._ready=!0,"function"==typeof e._onReadyCallback&&e._onReadyCallback()})))}},{key:"_checkLayout",value:function(){switch(this._layout){case"widget_custom_branding":case"widget_custom_no_powered_branding":case"fundamental_custom_branding":case"fundamental_custom_no_powered_branding":case"library_custom_branding":case"library_custom_no_powered_branding":this.show=!0;break;case"site_branding":case"widget_branding":case"widget_referral_branding":case"fundamental_branding":case"library_branding":this.show=!1}}},{key:"draw",value:function(e){this._ready&&e.drawImage(this._img,0,0,this.width,this.height)}}]),e}();t.Branding=function(e){function t(e,i,n,r){m(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));o._mainSeries=o._model.mainSeries(),o._canvasWidth=0,o._showAllowance=n,o._showForPro=r,o._paneHeight=0,o._left=13,o._bottom=16,o._layout="site_branding",o._needToShow=!0,o._customLogoSrc="",o._customLogoLink="",o._checkLayout(),"widget_custom_branding"!==o._layout&&"fundamental_custom_branding"!==o._layout||(o._left=8,o._bottom=5);var s=function(){o._needToShow?o._showBranding=!0:o._showBranding=!1};return o._resizeHandlerDelayed=v(s,200),s(),window.addEventListener("resize",o._resizeHandlerDelayed),o._monitorCanvas=(0,f.createDisconnectedBoundCanvas)(document,new f.Size(0,0)),o._monitorCanvas.subscribeCanvasConfigured((function(){o._init()})),o._model.isSnapshot()?o._init():(o._mainSeries.dataEvents().symbolResolved().subscribe(o,o._init),null!==o._mainSeries.symbolInfo()&&o._init()),o._cubicBezier=new u.CubicBezier(.4,.01,.22,1),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"destroy",value:function(){window.removeEventListener("resize",this._resizeHandlerDelayed),this._mainSeries.dataEvents().symbolResolved().unsubscribeAll(this),this._powBy&&this._powBy.destroy()}},{key:"_init",value:function(){var e=this,t=this._mainSeries.symbolInfo()||{};this._powBy&&this._powBy.destroy(),this._powBy=new E({layout:this._layout,symbol:t.name,model:this._model,onReadyCallback:function(){return e._model.fullUpdate()}}),this._custom=new V({layout:this._layout,src:this._customLogoSrc,onReadyCallback:function(){return e._model.fullUpdate()}}),this._openAnimation=null,this._closeAnimation=null}},{key:"_checkLayout",value:function(){if(a.enabled("widget"));else if(a.enabled("charting_library")||a.enabled("trading_terminal")){var e=JSON.parse(M.logo)||{} ;e.image?(this._customLogoSrc=e.image,this._customLogoLink=e.link,this._needToShow=a.enabled("widget_logo"),a.enabled("link_to_tradingview")?this._layout="library_custom_branding":this._layout="library_custom_no_powered_branding"):(this._layout="library_branding",this._needToShow=a.enabled("widget_logo"))}else this._layout="site_branding"}},{key:"_startOpenAnimation",value:function(){null===this._openAnimation&&(null!==this._closeAnimation&&(this._closeAnimation.stop(),this._closeAnimation=null),this._openAnimation=(0,d.doAnimate)({from:this._currentStateForAnimation(),to:this._openedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_openLink",value:function(){return"site_branding"!==this._layout&&(window.open(this.tvUrl(),"_blank").opener=null,!0)}},{key:"_toggleOpenAnimatedOrOpenLink",value:function(){null!==this._openAnimation&&this._openAnimation.completed()?this._openLink()||this._startCloseAnimation():this._startOpenAnimation()}},{key:"_startCloseAnimation",value:function(){null===this._closeAnimation&&(null!==this._openAnimation&&(this._openAnimation.stop(),this._openAnimation=null),this._closeAnimation=(0,d.doAnimate)({from:this._currentStateForAnimation(),to:this._closedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"onClickOutside",value:function(){this._hasAnimation()&&this._startCloseAnimation()}},{key:"_currentStateForAnimation",value:function(){return this._powBy.width}},{key:"_closedStateForAnimation",value:function(){return this._powBy.minimizedAnimationWidth()}},{key:"_openedStateForAnimation",value:function(){return this._powBy.maximizedAnimationWidth()}},{key:"_animatedDrawStep",value:function(e,t){this._powBy.animatedDrawStep(e,t),this._model.lightUpdate()}},{key:"_hasAnimation",value:function(){return this._powBy.hasAnimation()}},{key:"updateAllViews",value:function(){}},{key:"updateViewsForPane",value:function(e){}},{key:"priceScale",value:function(){return null}},{key:"priceAxisViews",value:function(){return[]}},{key:"hasContextMenu",value:function(){return!1}},{key:"hitTest",value:function(e){var t=this;return!this._showBranding||a.enabled("logo_without_link")?null:this._powBy&&"widget_custom_no_powered_branding"!==this._layout&&"fundamental_custom_no_powered_branding"!==this._layout&&(0,s.pointInBox)(e,(0,o.box)(new o.Point(this._left,this._paneHeight-Math.max(this._powBy.height,void 0!==this._custom?this._custom.height:0)-this._bottom),new o.Point(this._left+Math.max(this._powBy.width,void 0!==this._custom?this._custom.width:0),this._paneHeight-this._bottom)))?new c.HitTestResult(c.HitTestResult.CUSTOM,{hideCrosshairLinesOnHover:!0,clickHandler:function(){t._openLink()},tapHandler:function(){t._hasAnimation()?t._toggleOpenAnimatedOrOpenLink():t._openLink()},mouseEnterHandler:function(){t._hasAnimation()&&t._startOpenAnimation()},mouseLeaveHandler:function(){t._hasAnimation()&&t._startCloseAnimation()}}):null}},{key:"tvUrl",value:function(){ var e="https://www.tradingview.com/";if(this._customLogoLink)return this._customLogoLink;if("library_branding"===this._layout||"library_custom_branding"===this._layout){var t=void 0;switch(!0){case a.enabled("charting_library"):t="library";break;case a.enabled("trading_terminal"):t="trading-terminal"}return e+="/"===e[e.length-1]?"?":"&",e+="utm_source="+window.location.origin+"&utm_medium=library"+(t?"&utm_campaign="+t:"")}return e}},{key:"draw",value:function(e,t){var i=this;if(this._showBranding){var n=0;M.utm=!0,(0,f.drawScaled)(e,t.pixelRatio,(function(){e.translate(-.5,-.5),i._powBy&&i._powBy.show&&(n=i._powBy.height-i._powBy.bottomShift(),e.save(),e.translate(i._left,i._paneHeight-i._bottom-n),i._powBy.draw(e,t,i._canvasWidth),e.restore()),i._custom&&i._custom.show&&(e.save(),e.translate(i._left,i._paneHeight-i._bottom-n-i._custom.height),i._custom.draw(e,t),e.restore())}))}}},{key:"renderer",value:function(e,t){return this._paneHeight=e,this._canvasWidth=t,{draw:this.draw.bind(this),hitTest:this.hitTest.bind(this)}}},{key:"paneViews",value:function(e){if(TradingView.printing)return[];if(!this._showAllowance())return[];if("site_branding"===this._layout&&!this._showForPro&&window.user&&window.user.is_pro)return[];var t=a.enabled("move_logo_to_main_pane");return t&&e.isMainPane()||!t&&e.isLast()||e.isMaximized()?[{renderer:this.renderer.bind(this)}]:[]}},{key:"labelPaneViews",value:function(e){return[]}}]),t}(l.CustomSourceBase)},GUQs:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"c",(function(){return o})),i.d(t,"b",(function(){return s}));var n=i("qFKp");function r(e){e.cancelable&&e.preventDefault()}function o(e){return function(t){r(t),e()}}function s(e){n.isChrome&&e.addEventListener("mousedown",(function(e){if(1===e.button)return e.preventDefault(),!1}))}},GVHu:function(e,t,i){"use strict";(function(e,n,r){var o=i("Eyy1"),s=o.assert,a=o.ensureNotNull,l=i("hsV8").unpackNonSeriesData,c=i("38az").StudyBarColorer,u=i("bGI9").StudyTrackPricePaneView,h=i("AXy7"),d=h.BandPaneView,p=h.BandBackgroundPaneView,f=h.HlineFillPaneView,_=i("hezA").StudyPriceAxisView,m=i("KtbP").PanePriceAxisView,v=i("I9zs"),y=v.StudyPaneView,g=v.StudyBackgroundPaneView,b=v.StudyPlotShapesPaneView,S=v.StudyPlotCharsPaneView,w=v.StudyPlotArrowsPaneView,P=v.StudyPlotBarsPaneView,C=v.StudyPlotCandlesPaneView,T=i("x40+"),x=T.PlotFillPaneView,I=T.AreaBackgroundPaneView,L=i("it7y").StudyDataWindowView,O=i("8qoI").StudyLegendView,M=i("TG9i").HHistDataWindowView,A=i("Kdr6").HHistLegendView,k=i("2kV1").StudyStatusView,E=i("jenN"),V=E.emptyStudyGraphics,D=E.loadStudyGraphics,B=E.saveStudyGraphics,R=E.LiveStudyGraphics,N=E.createGraphicsPaneViews,j=E.createGraphicsPriceAxisViews,F=i("XzZr").ChartApiInterface,W=i("Ocx9").DefaultProperty,H=i("kcTO").PriceFormatter,z=i("nEwK").VolumeFormatter,U=i("zXvd").NumericFormatter,G=i("GH0z").PercentageFormatter,Y=i("k9/m"),q=Y.PlotList,K=Y.PlotRowSearchMode,Z=Y.mergeMinMax,J=i("972a").MarkLocation,X=i("0YCj"),Q=(i("cBZt").extractStudyId,i("TcSq").extractPineId, i("FQhm")),$=i("23IT"),ee=$.LineStudyPlotStyle,te=i("hayr").propertyPages,ie=i("TmNs").StudyPriceLineAxisView,ne=i("w4Ji").studyPlotFunctionMap,re=i("w4Ji").studyEmptyPlotValuePredicate,oe=i("jy4L").makeNextStudyId,se=i("Kxc7"),ae=i("IcDj").StudyBase,le=i("txPx").getLogger("Chart.Study"),ce=(Number(window.TELEMETRY_SERVER_TIME_DIFF_THRESHOLD),se.enabled("datasource_copypaste")),ue=window.t("loading...");function he(e,t,i){var n=new W(t,i,!0);n.addExclusion("visible"),n.addExclusion("precision"),n.addExclusion("minTick");for(var r=0;rg+1){var T=m[g+1];if(null!=T){var x=b.valToIndex?b.valToIndex[T]:T;y.color=v.colors[x].color.value()}else y.color=C}else y.color=C;return y.floatCoordinate=this.priceScale().priceToCoordinate(w,P),y.coordinate=y.floatCoordinate,y.item=m,y},pe.prototype.isFailed=function(){return this._failed},pe.prototype.isLoading=function(){return this._loading},pe.prototype.series=function(){return this._series},pe.prototype.model=function(){return this._model},pe.prototype.currency=function(){var e=this.metaInfo();return Boolean(e)&&e.is_price_study?this.parentSource().currency():null},pe.prototype._invalidateLastNonEmptyPlotRowCache=function(){ this._lastNonEmptyPlotRowCache={}},pe.prototype.clearData=function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.clear(),this._graphics.clear&&this._graphics.clear(),this._plotOffsets={}},pe.prototype.onTagsChanged=function(){return this._tagsChanged},pe.prototype.properties=function(){return this._properties},pe.prototype.state=function(e,t){var i={type:TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),zorder:this.zorder()};this.metaInfo()instanceof X?i.metaInfo=TradingView.clone(this.metaInfo().state()):(i.metaInfo=TradingView.clone(this.metaInfo()),i.metaInfo.id=X.parseIdString(i.metaInfo.id+(i.metaInfo.version?"-"+i.metaInfo.version:"")).fullId),e&&(i.data=this.data().state(),i.data.symbols=this._resolvedSymbols,i.data.graphics=B(this.graphics()),i.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(i.ownerSource=this.ownerSource().id());for(var n=0;n=0?s:0}}return this._isChildStudy&&X.patchChildStudyMetaInfoState(i),i},pe.prototype._plotsForAlert=function(){var e=this,t=this._metaInfo,i=[$.isLinePlot,$.isShapesPlot,$.isCharsPlot,$.isArrowsPlot,$.isOhlcPlot,$.isAlertConditionPlot];return t.plots.map((function(e,t){return e.pinePlotIndex=t,e})).filter((function(e){return i.some((function(t){return t(e)}))})).map((function(i){var n={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:e.offset(i.id)};return t.styles&&void 0!==t.styles[i.id]&&(n.title=t.styles[i.id].title||"",n.text=t.styles[i.id].text||""),i.target&&t.ohlcPlots&&t.ohlcPlots[i.target]&&(n.ohlcTitle=t.ohlcPlots[i.target].title),n}))},pe.prototype._collectDepsForAlert=function(){throw new Error("Not implemented")},pe.prototype.idForAlert=function(){return ae.prototype.idForAlert.call(this)},pe.prototype.dependenciesForAlerts=function(){throw new Error("Not implemented")},pe.prototype._hasAvailableAlertPlots=function(){return!1},pe.prototype._hasAlertablePlots=function(){return(this.metaInfo().plots||[]).some((function(e){return"line"===e.type}))},pe.prototype._hasAlertConditions=function(){if(this.metaInfo().plots.some($.isAlertConditionPlot))return!0;var e=this.stateForAlert();return Boolean(e.alerts&&e.alerts.conditions)},pe.prototype._hasAlertFunction=function(){const e=this.metaInfo();return Boolean(e.hasAlertFunction)},pe.prototype._isAlertFeatureEnabled=function(){return!1},pe.prototype.hasStateForAlert=function(){return this._isAlertFeatureEnabled()&&!this.isFailed()&&(this.metaInfo().isTVScript?this._hasAlertConditions()||this._hasAvailableAlertPlots()||this._hasAlertFunction():this._hasAlertablePlots())},pe.prototype.stateForAlert=function(){throw new Error("Not implemented")},pe.prototype.isSavedInStudyTemplates=function(){for(var e=0;e0)return!0;for(var e in this._metaInfo.graphics)for(var t in this._metaInfo.graphics[e]){var i=this.properties().graphics[e][t];if(!i.visible||i.visible.value())return!0}return!(!this._metaInfo.isTVScriptStrategy&&!this._metaInfo.hasAlertFunction)}, pe.prototype.start=function(e,t){var i=this._model.mainSeries();if(i.isStarted()){this._isChildStudy&&this._source.isHibernated()&&this._source.start();var n=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible();!this._chartApi||!this._chartApi.connected()||n&&!0!==t||this._allSymbolsAreResolved().then(function(){this._startAfterSymbolsResolved(e,t)}.bind(this)).catch(function(e){le.logError("ERROR: "+this._debugId()+" start failed, "+e),delete this._restarting}.bind(this))}else i.dataEvents().completed().subscribe(this,(function(){this.start(e,t)}),!0)},pe.prototype._getStudyIdWithLatestVersion=function(){var e=X.cutDollarHash(this._metaInfo.id),t=e;return e.indexOf("@tv-scripting")>=0?t+="-101!":t+="-"+this._metaInfo.version,t},pe.prototype._startAfterSymbolsResolved=function(e,t){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);X.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=oe(),delete this._restarting,this._allInputsAreValid()){this._inputs=this.inputs({keepOptionalSymbolsEmpty:!0});var i=this._getStudyIdWithLatestVersion();if(this._incrementTurnaround(),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(),!0===e&&this._children)for(var n=0;n=e){var i=a(this._series.bars().lastIndex())-e;t=a(this._series.bars().valueAt(i))[TradingView.TIME_PLOT]}return t},pe.prototype._titleInputs=function(e,t){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1,skippedGroups:[],noExchanges:e,noResolution:t,skipColorInputs:!0,skipTimeInputs:!0})},pe.prototype.inputsForAlert=function(){var e=this.offset(),t=this.inputs();return e&&t.push(e),t},pe.prototype.inputs=function(e){var t={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,skipBooleanInputs:se.enabled("dont_show_boolean_study_arguments"),asObject:!0,skippedGroups:[],skippedInputs:[],noExchanges:!1,noResolution:!1,keepOptionalSymbolsEmpty:!1,skipColorInputs:!1,skipTimeInputs:!1};return TradingView.merge(t,e),this._buildInputs(t)},pe.prototype.inputsForAlertState=function(){return this.inputs()},pe.prototype._buildInputs=function(e){s(!!e,"options not set");var t={};try{t=this._prepareInputs(e)}catch(n){le.logWarn("Failed to prepare study inputs: "+n)}if(e.asObject){var i={};return Object.keys(t).forEach((function(e){null!=t[e]&&(i[e]=t[e])})),i}i=[];return Object.keys(t).forEach((function(e){null!=t[e]&&i.push(t[e])})),i},pe.prototype._prepareInputs=function(e){s(!!e,"options not set") ;for(var t={},i=0;i=0?a:s}return s}return this._metaInfo.isTVScript||this._metaInfo.pine?"text"===i?this._metaInfo.defaults.inputs.text:"pineId"===i?this._metaInfo.scriptIdPart:"pineVersion"===i?this._metaInfo.pine?this._metaInfo.pine.version:"-1":this._properties.inputs[i].value():this._properties.inputs[i].value()},pe.prototype._rebindToSource=function(e,t){var i=this.parentSource();if(this._isChildStudy){var n;this._source.unsetChild(this),delete this._nonPriceParent;var r=null;if(e===this._model.mainSeries())delete this._source,delete this._isChildStudy,delete this._ownerSource,n=this._series._seriesId,r=F.REBIND_STUDY_CHILD_TO_STANDALONE;else{if(!(e instanceof pe))return le.logError("Unable to rebind study to source of this type"),!1;this._ownerSource=e,this._source=e,n=this._source.sourceId(),this._source.setChild(this),this._source.isHibernated()&&this._source.start()}this._incrementTurnaround(),this.disablePriceRangeReady(),this._chartApi.rebindStudy(this._studyId,this._turnaround,n,this._studyName,t,this._handler,r)}else{if(!(e instanceof pe))return le.logError("Unable to rebind study to source of this type"),!1;var o=e.isHibernated();o&&e.start();var s=!1;if(this._canCreateStudyWithRebindType(F.REBIND_STUDY_STANDALONE_TO_CHILD)&&(this._incrementTurnaround(),this.disablePriceRangeReady(),s=this._chartApi.rebindStudy(this._studyId,this._turnaround,e.sourceId(),this._studyName,t,this._handler,F.REBIND_STUDY_STANDALONE_TO_CHILD)),!s)return o&&e.stop(),!1;this._isChildStudy=!0,this._ownerSource=e,this._source=e,this._source.setChild(this),this._childStudyByRebind.fire()}var a=this.m_priceScale,l=e.priceScale();if(a!==l){var c=this._model.paneForSource(this),u=this._model.paneForSource(e) ;c===u&&u.move(this,l,!0)}const h=this.parentSource();return i.formatterChanged().unsubscribe(this,this._onSourceFormatterChanged),h.formatterChanged().subscribe(this,this._onSourceFormatterChanged),i.priceStepChanged().unsubscribe(this,this._onSourcePriceStepChanged),h.priceStepChanged().subscribe(this,this._onSourcePriceStepChanged),i.currencyChanged().unsubscribeAll(this),h.currencyChanged().subscribe(this,this._onSourceCurrencyChanged),i.priceRangeReadyChanged().unsubscribeAll(this),h.priceRangeReadyChanged().subscribe(this,this._onSourcePriceRangeReadyChanged),this._recreatePriceFormattingDependencies(),!0},pe.prototype.childStudyByRebind=function(){return this._childStudyByRebind},pe.prototype._changeInputsImpl=function(e,t){var i=this.source(),n=this._properties.inputs&&this._properties.inputs.state(),r=X.getSourceIdByInputs(this._metaInfo.inputs,n),o=!0;if(r)if("high"===r||"open"===r||"low"===r||"close"===r||"hl2"===r||"ohl3"===r||"ohlc4"===r)i=this._model.mainSeries();else for(var s=this._model.dataSources(),a=0;a0?" ("+t+")":"")},pe.prototype._titleInParts=function(e,t,i,n){var r="";r=e?this._metaInfo.shortDescription||this._properties.shortDescription&&this._properties.shortDescription.value()||"Study":this._metaInfo.description||this._properties.description&&this._properties.description.value()||"Study",t=t||{};var o=[window.t(r)],s=[];if(!i){var a=this._getMTFResolutionInputTitle();if(null!==a&&a.length>0&&o.push(a), (s=this._titleInputs(n,!0)||[]).length>0){var l={};if(this._isChildStudy)for(var c=0;c=0&&this._source){var p=this._source.metaInfo(),f=this._source.title(e,null,!0,n);if(1===p.plots.length)l[d]=f;else{var _=d.split("$")[1],m=p.plots[_].id,v=p.styles&&p.styles[m]&&p.styles[m].title||m;l[d]=f+": "+v}}break}}var y=this;s=s.map((function(e){var i=isNumber(e)?y._numericFormatter.format(e):l&&l[e]||e;return t[i]&&(i=t[i]),i}))}}return[o.join(" · "),s]},pe.prototype._getMTFResolutionInputTitle=function(){for(var e=0;e0?window.t(t):""},pe.prototype._handleStudyError=function(e){delete this._loadingStartTime,this._failed=!0,this._loading=!1,this.clearData();e.params[2];this._setStatus(this._getStatusTextOnStudyError(e.params[2])),this._statusView.update(),this._model.updateSource(this)},pe.prototype.onData=function(e){switch(e.method){case"study_loading":this._failed=!1,this._loading=!0,this._setStatus(ue),this._statusView.update(),this._model.updateSource(this),this._loadingStartTime=(new Date).getTime();break;case"study_error":this._handleStudyError(e),this._enablePriceRangeReady();break;case"study_completed":if(!this._checkTurnaround(e.params[1]))return;this._studyModified&&(this.clearData(),this._studyModified=!1);var t="chartSession:"+this._chartApi.sessionId(),i=(new Date).getTime()-this._loadingStartTime;le.logDebug(t+", Study "+this._metaInfo.description+" loading took "+i+" ms"),delete this._loadingStartTime,this._loading=!1,this._setStatus(""),this._statusView.update();var n=this._model.paneForSource(this);this._model.recalculatePane(n),this._updateSources(),this._model.fullUpdate();break;case"study_deleted":break;case"data_update":if(e.params.customId!==this.sourceId()||!this._checkTurnaround(e.params.turnaround))return;s(!!e.params.nonseries,"data.params.nonseries is missing"),this._onDataUpdate(e.params.plots,e.params.nonseries)}},pe.prototype._onDataUpdate=function(e,t){this._studyModified&&(this.clearData(),this._studyModified=!1);var i=l(t.d);return this._ongoingDataUpdate=this._ongoingDataUpdate.then((function(){return i}),(function(){return i})).then(this._onDataUnpacked.bind(this,e,t.indexes)), this._ongoingDataUpdate},pe.prototype._onDataUnpacked=function(e,t,i){this._isDestroyed||(this._processPlotOffsets(i),this.transformData(e),this._mergeData(e),null!==i&&(i.indexes_replace?(s("nochange"!==t),this._graphics.replaceIndexesTo(t)):("nochange"!==t&&this._graphics.replaceIndexesTo(t),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds,this._metaInfo.graphics))),this._onDataUpdated(e,i,t),this.priceRangeReady()||this._enablePriceRangeReady())},pe.prototype._onDataUpdated=function(e,t,i){if(this.hasBarColorer()&&e.length>0){var n=this.barColorer().firstColoredBar(e[0].index);this._model.mainSeries().invalidateBarStylesCache(n)}null!==t&&this._postProcessGraphics();var r=this._model.paneForSource(this);this._model.recalculatePane(r),this._updateSources()},pe.prototype.transformData=function(e){},pe.prototype.moveData=function(e){this._ongoingDataUpdate=this._ongoingDataUpdate.then(function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.move(e)}.bind(this))},pe.prototype.replaceData=function(e,t,i){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.remove(e+1),this.m_data.addTail(i,t)},pe.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},pe.processPlotOffsets=function(e,t){t&&t.indexes_replace||(e._plotOffsets=t&&t.offsets||{})},pe.prototype._processPlotOffsets=function(e){pe.processPlotOffsets(this,e)},pe.prototype._mergeData=function(e){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.merge(e)},pe.prototype._postProcessGraphics=function(){this._graphicsPriceAxisViews=j(this),this._concatPriceAxisViews()},pe.prototype._getNonPriceParent=function(){if(this._nonPriceParent)return this._nonPriceParent;for(var e=this.source();e instanceof pe;){var t=e.metaInfo();if(!t.is_price_study||"Compare@tv-basicstudies"===t.id)return this._nonPriceParent=e,e;e=e.source()}},pe.prototype.firstValue=function(e){if(!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study){var t=this._model.timeScale().visibleBarsStrictRange();if(null===t)return null;var i=t.firstBar(),n=t.lastBar(),r=null,o=this,s=o._metaInfo.plots;return null===r&&this.data().range(i,n).each((function(t,i){for(var n=0;n=0){var m=this.properties().styles[h].histogramBase.value(),v=this.m_data.minMaxOnRangeCached(e,t,[f]);isNumber(m)&&null!==v&&(l=Z(l,{min:m,max:m}),l=Z(l,v))}else a.push(f)}}}var y=this.m_data.minMaxOnRangeCached(e,t,a);if(y=Z(l,y),i){a=[{name:"low",offset:0},{name:"high",offset:0}];var g=this.series().data().bars().minMaxOnRangeCached(e,t,a);y=Z(y,g)}if(null!==y&&(o=new r(y.min,y.max)),s.bands)for(c=0;c=0&&(e="_v"+this._metaInfo.pine.version),{symbol:this.series().actualSymbol(),resolution:this.series().interval(),study:this._metaInfo.shortId+e}},pe.prototype._sendTelemetryReport=function(e,t,i){ void 0===i&&(i=this._getTelemetryAdditionalData());var n=Object.assign(t,{additional:i});(void 0).sendChartReport(e,n)},pe.prototype._sendTelemetryCounter=function(e,t){this._sendTelemetryReport(e,{count:1},t)},pe.prototype._sendTelemetryTiming=function(e,t,i){this._sendTelemetryReport(e,{value:t},i)},pe.prototype.destroy=function(){this._isDestroyed=!0,this._legendView&&this._legendView.destroy(),null!==this._definitionsViewModel&&(this._definitionsViewModel.destroy(),this._definitionsViewModel=null),this._properties.listeners().unsubscribe(this,this.changeStyles),this._properties.visible.listeners().unsubscribe(this,this.visibleChanged),this._properties.visible.listeners().unsubscribe(this,this.processHibernate);for(var e=0;e= 1") ;var l=TradingView.clone(defaults("study"));de(l,t);var c=X.getStudyPropertyRootName(t),u=TradingView.clone(defaults(c,o));t.isTVScript&&t.TVScriptSourceCode!==u.TVScriptSourceCode&&(u=TradingView.clone(TradingView.factoryDefaults(c,o)));TradingView.merge(l,u),n&&(s(!(n instanceof e),"propsState should not be an instance of Property"),TradingView.merge(l,n));var h=TradingView.clone(t),d={};a.mergeInputsObjPart(d,h.defaults.inputs),a.mergeInputsObjPart(d,l.inputs),l.inputs=d,delete h.inputs,delete h.defaults.inputs;var p={};if(TradingView.merge(p,h.defaults),TradingView.merge(p,TradingView.factoryDefaults(c)),TradingView.merge(p,l),TradingView.merge(p,h),delete p.defaults,l=p,null!==r){var f=r.model().studiesColorRotatorFactory().getColorRotator(t);null!==f&&("Overlay@tv-basicstudies"===t.id?l.lineStyle.color=f.getColor(l.lineStyle.color,t):TradingView.merge(l,function(e,t){for(var i in e.styles){var n=e.styles[i].color;n&&(e.styles[i].color=t.getColor(n))}return e}(l,f)))}n&&TradingView.merge(l.styles,n.styles);return l}(t,n,r,o),u=X.getSourceInputIds(t);if(u.length>0){var h=u[0];l instanceof pe?c.inputs[h]="{pid}$0":void 0!==c.inputs[h]&&-1!==c.inputs[h].indexOf("$")&&(c.inputs[h]="close")}return he(t,a,c)}(t,n,r,o,X.getStudyPropertyRootName(t),a)},t.prepareStudyPropertiesForLoadChart=function(e,t,n,r,o,s){return function(e,t,n,r,o,s,a){var l=function(e,t,n,r,o){var s=i("K4L1");e.version&&n.version&&e.version!==n.version&&le.logWarn("Serialized metaInfo version "+e.version+" is not equal to the saved state version "+n.version);var a=TradingView.clone(defaults("study"));TradingView.merge(a,TradingView.factoryDefaults(X.getStudyPropertyRootName(e))),de(a,e),TradingView.merge(a,n),a=o.updateStudyState(a,e,t);var l=TradingView.clone(t||e);if(l&&X.versionOf(l)>=1){var c={};s.mergeInputsObjPart(c,(l.defaults||{}).inputs),s.mergeInputsObjPart(c,a.inputs),a.inputs=c,delete l.inputs,l.defaults&&delete l.defaults.inputs;var u={};TradingView.merge(u,l.defaults),TradingView.merge(u,TradingView.factoryDefaults(X.getStudyPropertyRootName(l))),TradingView.merge(u,a),delete l.defaults,TradingView.merge(u,l),a=u}return a}(e,t,n,0,o);return he(t||e,s,l)}(e,t,n,0,o,X.getStudyPropertyRootName(e))}}).call(this,i("tc+8"),i("aIyQ"),i("Qb4w").PriceRange)},GVQo:function(e,t,i){"use strict";i.r(t),i.d(t,"clipboardDataForSources",(function(){return l})),i.d(t,"get",(function(){return c})),i.d(t,"set",(function(){return u}));var n=i("mrSG"),r=i("Eyy1"),o=i("VVxS"),s=i("3ClC"),a=i("CW80");function l(e,t){if(1===t.length&&Object(s.isStudy)(t[0])){var i=t[0];return{title:i.title(),sources:[{source:Object(r.ensureNotNull)(i.state()),type:"study"}]}}var o={sources:[],title:""};return o.sources=t.filter((function(e){return e.copiable()&&Object(a.isLineTool)(e)})).filter(a.isLineTool).map((function(t){var i={type:"drawing",geometry:t.geometry(),source:Object(n.a)(Object(n.a)({},t.state(!1)),{points:t.normalizedPoints()}),modelId:e};return delete i.source.alertId,i})), 0===o.sources.length?null:(o.sources.length&&(1===o.sources.length?o.title=t[0].title&&t[0].title():o.title="Drawings"),o)}function c(){try{return JSON.parse(o.TVLocalStorage.getItem("application-clipboard"))}catch(e){return null}}function u(e){try{o.TVLocalStorage.setItem("application-clipboard",JSON.stringify(e))}catch(t){}}},GhVi:function(e,t,i){"use strict";(function(t){function i(){this._marksByIndex={},this._marksBySpan=[],this.changed=new t}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(e){for(var t=this._marksBySpan,i={},n=0;n=o||(this.maxIndex=o),t[s]||(t[s]=[]),t[s].push(r),i[s]=!0}for(s=t.length;s--;)t[s]&&(t[s].length||delete t[s],i[s]&&t[s].sort(this._sortByIndexAsc));delete this._cache,this.changed.fire()},i.prototype._removeTickmark=function(e){var t=e.index;if(this._marksByIndex[t]===e){delete this._marksByIndex[t],t<=this.minIndex&&this.minIndex++,t>=this.maxIndex&&this.maxIndex--,this.maxIndex2;){if(1e3*this._marksByIndex[t].time===e)return t;if(1e3*this._marksByIndex[i].time===e)return i;var n=Math.round((t+i)/2);1e3*this._marksByIndex[n].time>e?i=n:t=n}return t},i.prototype.build=function(e,t){var i=Math.ceil(t/e);if(this._maxbar===i&&this._cache)return this._cache;this._maxbar=i;for(var n=[],r=this._marksBySpan.length;r--;)if(this._marksBySpan[r]){var o=n;n=[];for(var s=o.length,a=0,l=this._marksBySpan[r],c=l.length,u=1/0,h=-1/0,d=0;d=i&&f-h>=i&&(n.push(p),h=f)}for(;a0&&t.forEach((function(e){e>i&&(i=e)})),i},e.prototype.merge=function(e){var t=this;this._invalidationLevel=Math.max(this._invalidationLevel,e._invalidationLevel),this._paneInvalidationLevel=Math.max(this._paneInvalidationLevel,e._paneInvalidationLevel),e._leftPriceScalesInvalidationMap.forEach((function(e,i){var n=t._leftPriceScalesInvalidationMap.get(i)||a;t._leftPriceScalesInvalidationMap.set(i,Math.max(n,e))})),e._rightPriceScalesInvalidationMap.forEach((function(e,i){var n=t._rightPriceScalesInvalidationMap.get(i)||a;t._rightPriceScalesInvalidationMap.set(i,Math.max(n,e))}))},e}();i.d(t,"InvalidationLevel",(function(){return n})),i.d(t,"defaultInvalidationLevel",(function(){return a})),i.d(t,"InvalidationMask",(function(){return l})),function(e){e[e.None=0]="None", e[e.Cursor=1]="Cursor",e[e.Light=2]="Light",e[e.Full=3]="Full"}(n||(n={}));var a=n.None,l=function(){function e(e){void 0===e&&(e=a),this._panesOrderChanged=!1,this._timeAxisInvalidationLevel=a,this._invalidatedPanes=new Map,this._invalidationLevel=e}return e.prototype.invalidateAll=function(e){var t=this;this._invalidationLevel!==e&&(this._invalidationLevel=Math.max(this._invalidationLevel,e),this._invalidatedPanes.forEach((function(e){e.invalidateAll(t._invalidationLevel)})))},e.prototype.invalidateAllPane=function(e,t){this._invalidatedPanes.has(e)||this._invalidatedPanes.set(e,new s(this._invalidationLevel)),Object(o.ensureDefined)(this._invalidatedPanes.get(e)).invalidateAll(t)},e.prototype.invalidatePriceScale=function(e,t,i,n){this._invalidatedPanes.has(e)||this._invalidatedPanes.set(e,new s(this._invalidationLevel)),Object(o.ensureDefined)(this._invalidatedPanes.get(e)).invalidatePriceScale(t,i,n)},e.prototype.invalidateTimeScale=function(e){this._timeAxisInvalidationLevel=Math.max(this._timeAxisInvalidationLevel,e)},e.prototype.invalidatePanesOrder=function(){this._panesOrderChanged=!0},e.prototype.fullInvalidation=function(){return this._invalidationLevel},e.prototype.maxPaneInvalidation=function(){var e=[];return this._invalidatedPanes.forEach((function(t){e.push(t.fullInvalidation())})),Math.max.apply(Math,Object(r.f)(e,[this._invalidationLevel]))},e.prototype.invalidateForPane=function(e){return this._invalidatedPanes.get(e)||new s(this._invalidationLevel)},e.prototype.invalidateForTimeScale=function(){return Math.max(this._timeAxisInvalidationLevel,this._invalidationLevel)},e.prototype.merge=function(e){var t=this;this._invalidationLevel=Math.max(this._invalidationLevel,e._invalidationLevel),this._panesOrderChanged=this._panesOrderChanged||e._panesOrderChanged,this._invalidatedPanes.forEach((function(e){e.invalidateAll(t._invalidationLevel)})),e._invalidatedPanes.forEach((function(e,i){t._invalidatedPanes.has(i)||t._invalidatedPanes.set(i,new s(t._invalidationLevel)),Object(o.ensureDefined)(t._invalidatedPanes.get(i)).merge(e)})),this._timeAxisInvalidationLevel=Math.max(this._timeAxisInvalidationLevel,e._timeAxisInvalidationLevel)},e.prototype.panesOrderInvalidated=function(){return this._panesOrderChanged},e.cursor=function(){return new e(n.Cursor)},e.light=function(){return new e(n.Light)},e.full=function(){return new e(n.Full)},e.panesOrder=function(){var t=e.full();return t.invalidatePanesOrder(),t},e}()},HGP3:function(e,t,i){"use strict";var n=i("W3MX"),r=i("f+Sq");const o={},s=Object.keys(n).length,a=/^#[0-9A-F]{6}$/i;Object.keys(n).forEach(e=>{const t=function e(t,i=[]){const r=n[t];if(!r)return null;if(a.test(r))return r;const o=r;return i.push(t),-1!==i.indexOf(o)?(console.warn("Colors definitions cycled"),r):i.length>s?(console.warn("Too many variables-link in HEX-color search: "+i[0]),null):e(o,i)}(e);o[e]=Object(r.ensureNotNull)(t)});const l=o;function c(e){const t=l[e];if(!t)throw new Error("No such color "+e);return t}i.d(t,"a",(function(){return l})),i.d(t,"b",(function(){return c}))}, HGup:function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"c",(function(){return a})),i.d(t,"b",(function(){return l}));var n=i("mrSG"),r=i("Eyy1"),o=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.c)(t,e),t.prototype.redo=function(){var e=this,t=Object(r.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),i=Object(r.ensureNotNull)(this._chartModel.paneForSource(t)),n=this._chartModel.children(t,!0);i.bulkActionMacro((function(){n.forEach((function(t){return e._chartModel.detachSource(t)})),e._chartModel.detachSource(t)}));var o=this._chartModel.createPane(this.targetPaneIndex()),s=o.findSuitableScale(t);o.bulkActionMacro((function(){o.addDataSource(t,s,!1),n.forEach((function(e){return o.addDataSource(e,s,!1)}))})),Object(r.ensureNotNull)(t.priceScale()).restoreState(this._newPriceScaleState(o.isOverlay(t))),this._chartModel.fullUpdate(),this._chartModel.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){var e=this,t=Object(r.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),i=Object(r.ensureNotNull)(this._chartModel.paneForSource(t)),n=this._chartModel.children(t,!0);i.bulkActionMacro((function(){n.forEach((function(t){return e._chartModel.detachSource(t)}));var i=e._chartModel.detachSource(t);Object(r.assert)(i,"Undo of detaching must remove pane")}));var o=this._chartModel.panes()[this._initialPaneIndex],s=o.getPriceScaleById(this._initialPriceScaleId);null===s&&(s=o.createPriceScaleAtPosition(this._initialPriceScalePosition,this._initialPriceScaleIndex)),o.bulkActionMacro((function(){o.addDataSource(t,s,!0),n.forEach((function(e){return o.addDataSource(e,s,!1)}))})),Object(r.ensureNotNull)(t.priceScale()).restoreState(this._originalPriceScaleState()),this._chartModel.fullUpdate()},t}(i("3u3j").a),s=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.c)(t,e),t.prototype.targetPaneIndex=function(){return this._initialPaneIndex+1},t}(o),a=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.c)(t,e),t.prototype.targetPaneIndex=function(){return this._initialPaneIndex},t}(o),l=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.c)(t,e),t.prototype.targetPaneIndex=function(){return this._chartModel.panes().length},t}(o)},HLXm:function(e,t,i){"use strict";function n(e){"LineToolGannComplex"!==e.type||void 0!==e.version&&1!==e.version||(e.type="LineToolGannFixed")}i.r(t),i.d(t,"migrateState",(function(){return n}))},"HV/F":function(e,t,i){"use strict";function n(e){var t={};return{promise:new Promise((function(i,n){e.subscribe(t,i,!0)})),destroy:function(){e.unsubscribeAll(t)}}}i.r(t),i.d(t,"delegateToPromise",(function(){return n}))},HY7u:function(e,t,i){},HZKX:function(e,t,i){"use strict";i.r(t),i.d(t,"createActionAddAlert",(function(){return Pe})),i.d(t,"createActionTrade",(function(){return Ce})),i.d(t,"createActionOrder",(function(){return Te})),i.d(t,"createMTPredictorActions",(function(){return xe})),i.d(t,"createLinesAction",(function(){return Ie})), i.d(t,"ActionsProvider",(function(){return Oe}));var n=i("mrSG"),r=i("Eyy1"),o=i("txPx"),s=i("ogJP"),a=i("Kxc7"),l=i("7KDR"),c=i("YmeR"),u=i("Daqx"),h=i("3ClC"),d=i("QloM"),p=i("Qq0B"),f=i("z61+"),_=i("/3z9"),m=i("L/Ed"),v=i("cKqi"),y=i("YzC7"),g=i("pvsv"),b=i("GVQo"),S=i("CW80"),w=i("/tGj"),P=i("2uTr"),C=Object(o.getLogger)("Chart.ActionsProvider"),T=(window.t("Add Alert"),window.t("Add Alert on {series}"),window.t("Add Alert on {drawing}"),Object(P.appendEllipsis)(window.t("Edit {0} Alert"))),x=window.t("Extend Alert Lines"),I=window.t("Show alert label lines"),L=window.t("Hide alert label lines"),O=(window.t("Trade"),Object(P.appendEllipsis)(window.t("Create Limit Order")),window.t("Show")),M=window.t("Hide"),A=(window.t("MTPredictor"),window.t("Apply Manual Risk/Reward"),window.t("Apply Manual Decision Point"),window.t("Analyze Trade Setup"),window.t("Apply Elliott Wave"),window.t("Apply Elliott Wave Intermediate"),window.t("Apply Elliott Wave Major"),window.t("Apply Elliott Wave Minor"),window.t("Apply WPT Up Wave"),window.t("Up Wave 1 or A"),window.t("Up Wave 2 or B"),window.t("Up Wave C"),window.t("Up Wave 3"),window.t("Up Wave 4"),window.t("Up Wave 5"),window.t("Apply WPT Down Wave"),window.t("Down Wave 1 or A"),window.t("Down Wave 2 or B"),window.t("Down Wave C"),window.t("Down Wave 3"),window.t("Down Wave 4"),window.t("Down Wave 5"),window.t("Pinned To Scale {label} (Hidden)")),k=window.t("Pinned To Right Scale (Hidden)"),E=window.t("Pin To Scale {label} (Hidden)"),V=window.t("Pin To Right Scale (Hidden)"),D=window.t("Pinned To Scale {label}"),B=window.t("Pinned To Right Scale"),R=window.t("Pin To Scale {label}"),N=window.t("Pin To Right Scale"),j=window.t("Pinned To Left Scale (Hidden)"),F=window.t("Pin To Left Scale (Hidden)"),W=window.t("Pinned To Left Scale"),H=window.t("Pin To Left Scale"),z=window.t("Pin To New Left Scale"),U=window.t("Pin To New Right Scale"),G=window.t("Pin To Scale (Now {label})"),Y=window.t("Pin To Scale (Now No Scale)"),q=window.t("Pin To Scale (Now Left)"),K=window.t("Pin To Scale (Now Right)"),Z=window.t("No Scale (Fullscreen)"),J=window.t("Move To"),X=window.t("Existing Pane Above"),Q=window.t("New Pane Above"),$=window.t("Existing Pane Below"),ee=window.t("New Pane Below"),te=window.t("Bring to Front"),ie=window.t("Send to Back"),ne=window.t("Bring Forward"),re=window.t("Send Backward"),oe=window.t("Visual Order"),se=window.t("Lines"),ae=Object(P.appendEllipsis)(window.t("Add Indicator/Strategy on {studyTitle}")),le=(Object(P.appendEllipsis)(window.t("Add Financial metric for {instrumentName}")),Object(P.appendEllipsis)(window.t("Settings"))),ce=window.t("Apply Default"),ue=Object(P.appendEllipsis)(window.t("Save As")),he=window.t("Copy"),de=window.t("Clone"),pe=window.t("Template"),fe=(window.t("Sync To All Charts"),window.t("Unlock")),_e=window.t("Lock"),me=(window.t("Show Earnings"),window.t("Show Dividends"),window.t("Show Splits"), window.t("Show All Ideas")),ve=window.t("Show Ideas of Followed Users"),ye=window.t("Show My Ideas Only"),ge=Object(P.appendEllipsis)(window.t("Settings")),be=window.t("Hide Events on Chart"),Se=window.t("Add this Symbol to Entire Layout"),we=window.t("Add this Indicator to Entire Layout");window.t("Add this Strategy to Entire Layout"),window.t("Add this Financial Metric to Entire Layout");function Pe(e,t){return null}function Ce(e,t,i){return null}function Te(e){throw new Error("not supported")}function xe(e,t,i,n){return null}function Ie(e){var t=e.actions(),i=[t.showPriceLine];return i.push(t.showHighLowPriceLines),i.push(t.showAverageClosePriceLine),new l.Action({label:se,statName:"Lines",subItems:i})}function Le(e,t){return void 0===e||e[t]}var Oe=function(){function e(e,t){this._chartWidget=e,this._options=t}return e.prototype.contextMenuActionsForSources=function(e){return Object(n.b)(this,void 0,void 0,(function(){var t,i,r;return Object(n.d)(this,(function(n){return t=e[0],i=this._options,t===this._chartWidget.model().mainSeries()&&Le(i,"mainSeries")?[2,this._contextMenuActionsForSeries(t)]:Object(h.isStudy)(t)&&Le(i,"studies")?[2,this._contextMenuActionsForStudy(t)]:Object(S.isLineTool)(t)&&Le(i,"lineTools")?(r=e.filter(S.isLineTool),[2,this._contextMenuActionsForLineTool(r)]):[2,[]]}))}))},e.prototype._isReadOnly=function(){return this._chartWidget.readOnly()},e.prototype._createActionHide=function(e){return new l.Action({label:M,icon:i("DYI2"),statName:"HideSelectedObject",onExecute:this._chartWidget.hideDataSources.bind(this._chartWidget,[e])})},e.prototype._createActionShow=function(e){var t=new l.Action({checkable:!0,label:O,icon:i("6ctS"),statName:"ToggleShow"}),n=new c.ActionBinder(t,e.properties().visible,this._chartWidget.model(),O);return t.setBinding(n),n.setValue(e.properties().visible.value()),t},e.prototype._createActionScale=function(e){var t=Object(r.ensureNotNull)(e.priceScale()),n=this._chartWidget.model().model(),o=Object(r.ensureNotNull)(n.paneForSource(e)),s=o.priceScalePosition(t),a=("left"===s?o.leftPriceScales():o.rightPriceScales()).indexOf(t),c=n.priceScaleSlotsCount().totallySlots<2?"dontneedname":"needname",h="overlay"===s?"":Object(u.a)(s,a).label,d=G.format({label:h}),p={"left-needname":d,"left-dontneedname":q,"right-needname":d,"right-dontneedname":K,"overlay-needname":Y,"overlay-dontneedname":Y}[s+"-"+c];return new l.Action({label:p,icon:i("/kal"),subItems:this._createActionScaleItems(e)})},e.prototype._createActionScaleDetach=function(e,t,i,n){var o=this._chartWidget.model().model(),s=Object(r.ensureNotNull)(o.paneForSource(e));if(!s.canCreateNewPriceScale())return null;var a=Object(r.ensureNotNull)(e.priceScale()),c=a.canDetachSource(e),h=s.priceScalePosition(a),d=c||h!==t;if(!d)return null;var p=o.priceScaleSlotsCount(),f={left:{labelled:R,sided:z},right:{labelled:R,sided:U}},_="left"===t?s.leftPriceScales().length:s.rightPriceScales().length,m=p[t]>_?"labelled":"sided",v=Object(u.a)(t,_).label,y=f[t][m].format({label:v});return new l.Action({checkable:!1,disabled:!d, label:y,statName:n,payload:e,onExecute:i})},e.prototype._onDetachLeft=function(e){var t=e.getPayload(),i=this._chartWidget.model().model(),n=Object(r.ensureNotNull)(i.paneForSource(t));this._chartWidget.model().detachToLeft(t,n)},e.prototype._onDetachRight=function(e){var t=e.getPayload(),i=this._chartWidget.model().model(),n=Object(r.ensureNotNull)(i.paneForSource(t));this._chartWidget.model().detachToRight(t,n)},e.prototype._createActionScaleDetachLeft=function(e){return this._createActionScaleDetach(e,"left",this._onDetachLeft.bind(this),"ToggleScaleLeft")},e.prototype._createActionScaleDetachRight=function(e){return this._createActionScaleDetach(e,"right",this._onDetachRight.bind(this),"ToggleScaleRight")},e.prototype._onMoveToScale=function(e){var t=e.getPayload();if(t.datasource.priceScale()!==t.priceScale){var i=this._chartWidget.model().model(),n=Object(r.ensureNotNull)(i.paneForSource(t.datasource));this._chartWidget.model().moveToScale(t.datasource,n,t.priceScale,t.undoText)}},e.prototype._createMoveToScaleAction=function(e,t,i,n){var r=e.priceScale()===t;return new l.Action({checkable:!0,checked:r,label:i,statName:"ToggleScale",payload:{datasource:e,priceScale:t,undoText:n},onExecute:this._onMoveToScale.bind(this)})},e.prototype._onNoScale=function(e){var t=e.getPayload().datasource,i=this._chartWidget.model().model(),n=Object(r.ensureNotNull)(i.paneForSource(t));n.isOverlay(t)||this._chartWidget.model().detachNoScale(t,n)},e.prototype._createActionNoScale=function(e){var t=this._chartWidget.model().model(),i=Object(r.ensureNotNull)(t.paneForSource(e)),n=i.actionNoScaleIsEnabled(e);return new l.Action({checkable:!0,checked:i.isOverlay(e),label:Z,disabled:!n,statName:"ToggleNoScale",payload:{datasource:e},onExecute:this._onNoScale.bind(this)})},e.prototype._createActionScaleItems=function(e){var t=this,i=[],n=this._chartWidget.model().model(),o=Object(r.ensureNotNull)(n.paneForSource(e)),s=n.priceScaleSlotsCount().totallySlots>1,a=o.rightPriceScales(),c=o.leftPriceScales(),h=this._createActionScaleDetachRight(e),d=this._createActionScaleDetachLeft(e),p=a.length+c.length+(null===h?0:1)+(null===d?0:1)>2,f={right:{hidden:{checked:{labelled:A,sided:k},unchecked:{labelled:E,sided:V}},visible:{checked:{labelled:D,sided:B},unchecked:{labelled:R,sided:N}}},left:{hidden:{checked:{labelled:A,sided:j},unchecked:{labelled:E,sided:F}},visible:{checked:{labelled:D,sided:W},unchecked:{labelled:R,sided:H}}}},_={left:o.visibleLeftPriceScales(),right:o.visibleRightPriceScales()},m=function(t,i){var n=("right"===i?a:c)[t],r=_[i].includes(n)?"visible":"hidden",o=e.priceScale()===n?"checked":"unchecked",l=s?"labelled":"sided",h=f[i],d={labelled:h.visible.unchecked.labelled,sided:h.visible.unchecked.sided},p=Object(u.a)(i,t).label;return{actionText:h[r][o][l].format({label:p}),undoText:d[l].format({label:p})}};return i.push.apply(i,a.map((function(i,n){var r=m(n,"right");return t._createMoveToScaleAction(e,i,r.actionText,r.undoText)}))),null!==h&&i.push(h),p&&(a.length>0||null!==h)&&i.push(new l.Separator), i.push.apply(i,c.map((function(i,n){var r=m(n,"left");return t._createMoveToScaleAction(e,i,r.actionText,r.undoText)}))),null!==d&&i.push(d),p&&(c.length>0||null!==d)&&i.push(new l.Separator),i.push(this._createActionNoScale(e)),i},e.prototype._createVisualOrderAction=function(e){var t=this._chartWidget.model(),n=t.availableZOrderOperations(e),r=[new l.Action({label:te,statName:"BringToFront",disabled:!n.bringToFrontEnabled,onExecute:function(){return t.bringToFront(e)}}),new l.Action({label:ie,statName:"SendToBack",disabled:!n.sendToBackEnabled,onExecute:function(){return t.sendToBack(e)}}),new l.Action({label:ne,statName:"BringForward",disabled:!n.bringForwardEnabled,onExecute:function(){return t.bringForward(e)}}),new l.Action({label:re,statName:"SendBackward",disabled:!n.sendBackwardEnabled,onExecute:function(){return t.sendBackward(e)}})];return new l.Action({label:oe,icon:i("9dnG"),statName:"VisualOrder",subItems:r})},e.prototype._createActionMergeUp=function(e){var t=this._chartWidget.model();return t.model().isMergeUpAvailableForSource(e)?new l.Action({label:X,statName:"MergeUp",onExecute:function(){return t.mergeSourceUp(e)}}):null},e.prototype._createActionUnmergeUp=function(e){var t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new l.Action({label:Q,statName:"UnmergeUp",onExecute:function(){return t.unmergeSourceUp(e)}}):null},e.prototype._createActionMergeDown=function(e){var t=this._chartWidget.model();return t.model().isMergeDownAvailableForSource(e)?new l.Action({label:$,statName:"MergeDown",onExecute:function(){return t.mergeSourceDown(e)}}):null},e.prototype._createActionUnmergeDown=function(e){var t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new l.Action({label:ee,statName:"UnmergeDown",onExecute:function(){return t.unmergeSourceDown(e)}}):null},e.prototype._mergeContentMenuItems=function(e){return[this._createActionMergeUp(e),this._createActionUnmergeUp(e),this._createActionMergeDown(e),this._createActionUnmergeDown(e)].filter(s.notNull)},e.prototype._createActionMove=function(e){var t=this._mergeContentMenuItems(e);return t.length>0?new l.Action({label:J,icon:i("BBCR"),subItems:t}):null},e.prototype._contextMenuActionsForSeries=function(e){var t=[],i=e.properties().visible.value(),n=this._chartWidget.model().model(),o=(Object(r.ensureNotNull)(n.paneForSource(e)),this._chartWidget.actions());if(this._isReadOnly())t.push(i?this._createActionHide(e):this._createActionShow(e)),t.push(new l.Separator),t.push(this._createActionScale(e));else{0,t.length>0&&!(t[t.length-1]instanceof l.Separator)&&t.push(new l.Separator),a.enabled("symbol_info")&&t.push(o.showSymbolInfoDialog);n.mainSeries().symbolInfo();0,t.length>0&&!(t[t.length-1]instanceof l.Separator)&&t.push(new l.Separator),t.push(this._createVisualOrderAction([e]));var s=this._createActionMove(e);null!==s&&t.push(s),t.push(this._createActionScale(e)),t.push(i?this._createActionHide(e):this._createActionShow(e)),t.push(new l.Separator),t.push(Ie(this._chartWidget)),t.push(new l.Separator), window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist)&&o.addToWatchlist&&t.push(o.addToWatchlist),a.enabled("text_notes")&&t.push(o.addToTextNotes),t[t.length-1]instanceof l.Separator||t.push(new l.Separator),t[t.length-1]instanceof l.Separator&&t.pop()}return t},e.prototype._createActionAddChildStudy=function(e){var t=this,n=this._chartWidget.model().model();return new l.Action({label:ae.format({studyTitle:e.title(!0)}),icon:i("CwKc"),statName:"ApplyIndicator",onExecute:function(){var i=t._chartWidget.showIndicators(Object(h.isStudy)(e)?e:void 0);if(i&&Object(h.isStudy)(e)){var r=function(){trackEvent("SOS","Apply SOS","Apply by RC menu")},o=n.studyInserted();o.subscribe(t,r),i.visible().subscribe((function(e){e||o.unsubscribe(t,r)}),{once:!0})}}})},e.prototype._createActionAddFundamentals=function(e){return null},e.prototype._createActionShowSymbolInfoDialog=function(e){return new l.Action({label:Object(P.appendEllipsis)(window.t("Symbol Info")),icon:i("1pHB"),checkable:!1,statName:"SymbolInfo",onExecute:function(){var t=e.symbol(),i=e.symbolInfo();Object(g.showSymbolInfoDialog)(t,{symbolInfo:i})}})},e.prototype._createActionShowProperties=function(e){var t=this;return new l.Action({label:le,icon:i("MXV9"),statName:"EditSelectedObject",onExecute:function(){return t._chartWidget.showSourceProperties(e)}})},e.prototype._contextMenuActionsForStudy=function(e){var t=this,i=this._chartWidget.actions(),n=e.properties().visible.value(),r=[];if(!e.userEditEnabled())return r;if(this._chartWidget.readOnly())r.push(n?this._createActionHide(e):this._createActionShow(e)),r.push(new l.Separator),e.constructor instanceof p.NonSeriesStudy||r.push(this._createActionScale(e));else{a.enabled("study_on_study")&&e.canHaveChildren()&&r.push(this._createActionAddChildStudy(e));var o=this._createApplyToEntireLayoutCommand(e);if(null!==o&&r.push(o),r.length>0&&!(r[r.length-1]instanceof l.Separator)&&r.push(new l.Separator),a.enabled("symbol_info")&&(e instanceof y.a||e instanceof v.study_Overlay)&&null!==e.symbolInfo()&&(r.push(this._createActionShowSymbolInfoDialog(e)),r.push(new l.Separator)),r.push(this._createVisualOrderAction([e])),!(e.constructor instanceof p.NonSeriesStudy)){var s=this._createActionMove(e);null!==s&&r.push(s),r.push(this._createActionScale(e))}r.push(new l.Separator);var c=e.metaInfo();if(r[r.length-1]instanceof l.Separator||r.push(new l.Separator),e.copiable()){var u=new l.Action({label:he,shortcutHint:Object(_.humanReadableHash)(_.Modifiers.Mod+67),statName:"Copy",onExecute:function(){t._chartWidget.onAppClipboardCopy([e])}});r.push(u)}r.push(n?this._createActionHide(e):this._createActionShow(e)),r.push(i.studyRemove),r.push(new l.Separator),a.enabled("property_pages")&&new f.a(c).hasUserEditableOptions()&&r.push(this._createActionShowProperties(e)),r[r.length-1]instanceof l.Separator&&r.pop()}return r},e.prototype._createEditAlertDrawingAction=function(e){return new l.Action({label:T.format(e.title()),icon:TbbiEditAlertSvg,statName:"EditAlert",onExecute:function(){ window.runOrSignIn((function(){e.editAlert("pane_context_menu_edit_alert")}),{source:"Alert edit from pane context menu"})}})},e.prototype._createLineToolTemplateAction=function(e){var t=this;if(!window.lineToolPropertiesToolbar)return null;var i=window.lineToolPropertiesToolbar.templatesList();return void 0===i?null:new l.ActionAsync((function(){var n=[],r=new l.Action({label:ue,statName:"SaveAs",onExecute:function(){i.showSaveDialog((function(t){var n=JSON.stringify(e.template());i.saveTemplate(t,n)}))}});n.push(r);var o=new l.Action({label:ce,statName:"ApplyDefault",onExecute:function(){t._chartWidget.model().restorePropertiesForSource(e),window.lineToolPropertiesToolbar.onSourceChanged(e)}});return n.push(o),new Promise((function(e){i.templatesLoaded().then((function(){var e=i.getData();e.length>0&&n.push(new l.Separator),e.forEach((function(e,t){var r=new l.Action({label:e,statName:"ApplyTemplate",onExecute:function(){return i.loadTemplate(e)},toolbox:{type:m.ToolboxType.Delete,action:function(){i.deleteAction(e)}},showToolboxOnHover:!0});n.push(r)}))}),(function(e){C.logWarn(e)})).then((function(){e({label:pe,statName:"Template",subItems:n})}))}))}))},e.prototype._createActionToggleLockObject=function(e){var t=this,n=e.properties().frozen.value();return new l.Action({label:n?fe:_e,statName:"ToggleLockSelectedObject",checkable:!0,icon:i(n?"fs3R":"qckB"),onExecute:function(){return t._chartWidget.toggleLockSelectedObject()}})},e.prototype._contextMenuActionsForLineTool=function(e){return Object(n.b)(this,void 0,void 0,(function(){var t,r,o,s,c,u,h,d,p,f,m,v=this;return Object(n.d)(this,(function(n){switch(n.label){case 0:return t=[],r=this._chartWidget.actions(),this._chartWidget.model().model(),o=function(){t.push(v._createVisualOrderAction(e))},s=function(){var n=e.filter((function(e){return e.cloneable()}));if(n.length>0){var r=new l.Action({label:de,icon:i("K8V9"),shortcutHint:Object(_.humanReadableModifiers)(_.Modifiers.Mod)+"Drag",doNotBindShortcut:!0,statName:"Clone",onExecute:function(){return v._chartWidget.model().cloneLineTools(n,!1)}},"Clone");t.push(r)}return!!n.length},c=function(){var i=e.filter((function(e){return e.copiable()}));if(i.length>0){var n=new l.Action({label:he,shortcutHint:Object(_.humanReadableHash)(_.Modifiers.Mod+67),statName:"Copy",onExecute:function(){return v._chartWidget.onAppClipboardCopy(i)}},"Copy");t.push(n)}return!!i.length},u=function(){return!1},function(e){},1!==e.length?[3,4]:(h=e[0],this._chartWidget.readOnly()?(t.push(r.lineHide),[3,3]):[3,1]);case 1:return h.userEditEnabled()?(a.enabled("alerts")&&!this._chartWidget.onWidget()&&h.hasAlert&&h.hasAlert.value()&&(t.push(this._createEditAlertDrawingAction(h)),t.push(new l.Separator)),a.enabled("charting_library_base")||null!==(d=this._createLineToolTemplateAction(h))&&t.push(d),o(),Le(this._options,"objectTree")&&r.paneObjectTree&&t.push(r.paneObjectTree),t.push(new l.Separator),p=s(),p=c()||p,(p=u()||p)&&t.push(new l.Separator),t.push(this._createActionToggleLockObject(h)),t.push(r.lineHide),t.push(r.lineRemove), t.push(new l.Separator),[4,this._chartWidget.propertiesDefinitionsForSource(h)]):[3,3];case 2:f=n.sent(),a.enabled("property_pages")&&(null!==f||Object(S.isMTPredictionTool)(h))&&t.push(r.format),h.additionalActions&&(t.push(new l.Separator),m=h.additionalActions(this._chartWidget.model()),t.push.apply(t,m)),n.label=3;case 3:return[3,5];case 4:Le(this._options,"objectTree")&&r.paneObjectTree&&t.push(r.paneObjectTree),o(),t.push(new l.Separator),s(),c(),u(),t.push(new l.Separator),t.push(r.lineHide),t.push(r.lineRemove),n.label=5;case 5:return[2,t]}}))}))},e.prototype._createEarningsShow=function(){return null},e.prototype._createDividendsShow=function(){return null},e.prototype._createSplitsShow=function(){return null},e.prototype._contextMenuActionsForESD=function(){return[]},e.prototype._contextMenuActionsForPublishedTimeline=function(e){var t=this,i=this._chartWidget.actions(),n=[];if(n.push(i.lineHide),window.is_authenticated){var r=e.properties().filter,o=new l.Action({checked:r.value()===PublishedChartsFilter.None,checkable:!0,label:me,statName:"ToggleAllIdeas",onExecute:function(){return t._chartWidget.model().setProperty(r,PublishedChartsFilter.None,me)}}),s=new l.Action({checked:r.value()===PublishedChartsFilter.Following,checkable:!0,label:ve,statName:"ToggleIdeasOfPeopleAndUser",onExecute:function(){return t._chartWidget.model().setProperty(r,PublishedChartsFilter.Following,ve)}}),a=new l.Action({checked:r.value()===PublishedChartsFilter.Private,checkable:!0,label:ye,statName:"ToggleUserIdeas",onExecute:function(){return t._chartWidget.model().setProperty(r,PublishedChartsFilter.Private,ye)}});n.push(new l.Separator,o,s,a)}return n},e.prototype._contextMenuActionsForTradingDrawings=function(e){return e.contextMenuItems()},e.prototype._createAlertToggleHorzLineLabelAction=function(e){var t=this,i=getGlobalAlertSettingsProperty().childs().line.childs().visible,n=i.value()?L:I;return new l.Action({checkable:!0,label:x,checked:i.value(),statName:"ToggleExtendAlertLine",onExecute:function(){return t._chartWidget.model().setProperty(i,!i.value(),n)}})},e.prototype._contextMenuActionsForAlertLabel=function(e){var t=e.alert(),i=[];return t.get("active")?i.push(AlertActionCreator.stopAlert(t)):i.push(AlertActionCreator.restartAlert(t,"alert_label_context_menu_restart")),i.push(AlertActionCreator.editAlert(t,"alert_label_context_menu_edit")),i.push(AlertActionCreator.deleteAlert(t)),i.push(new l.Separator),i.push(this._createAlertToggleHorzLineLabelAction(e)),i},e.prototype._contextMenuActionsForChartEvents=function(e){var t=this,i=[];if(a.enabled("property_pages")){var n=new l.Action({label:ge,statName:"Format",onExecute:function(){return t._chartWidget.showGeneralChartProperties(d.TabNames.eventsAndAlerts)}});i.push(n)}var r=new l.Action({label:be,statName:"HideEvents",onExecute:function(){return t._chartWidget.model().setProperty(e.properties().visible,!1,be)}});return i.push(r),i},e.prototype._createApplyToEntireLayoutCommand=function(e){var t=this ;if(!this._chartWidget.chartWidgetCollection().applyIndicatorsToAllChartsAvailable())return null;var i=this._chartWidget.model().model();if(e.parentSource()!==i.mainSeries())return null;var n=Object(r.ensureNotNull)(i.paneForSource(e)),o=i.paneForSource(i.mainSeries())===n,s=e instanceof y.a&&e.priceScale()===i.mainSeries().priceScale()&&Object(r.ensureNotNull)(e.priceScale()).isPercentage(),a=o?void 0:i.panes().indexOf(n),c=we,u="AddStudyToEntireLayout";return Object(w.isSymbolSource)(e)&&(c=Se,u="AddSymbolToEntireLayout"),new l.Action({label:c,statName:u,onExecute:function(){var n=Object(r.ensureNotNull)(Object(b.clipboardDataForSources)(i.id(),[e])),l=t._chartWidget.chartWidgetCollection(),u={isOnMainPane:o,asCompare:s,paneIndex:a};l.applyIndicatorToAllCharts(t._chartWidget,n,u,c)}},"applyStudyToEntireLayout")},e}()},Hm6r:function(e,t,i){"use strict";i.r(t),i.d(t,"CrosshairTimeAxisView",(function(){return o}));var n=i("mrSG"),r=i("cgFQ"),o=function(e){function t(t,i,n){void 0===n&&(n=!1);var r=e.call(this,t)||this;return r._indexProvider=i,r._highlighted=n,r}return Object(n.c)(t,e),t.prototype._getBgColor=function(){return this._highlighted?this._model.isDark()?"#1E88E5":"#2196F3":"#4c525e"},t.prototype._getIndex=function(){return this._model.crossHairSource().visible?this._indexProvider():null},t}(r.a)},Hr11:function(e,t,i){"use strict";function n(e,t){return e<=t}function r(e,t){return e>=t}function o(e,t,i){return Math.min(Math.max(e,t),i)}function s(e){return e<0?-1:e>0?1:0}function a(e){if(e<0)return!1;for(var t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}function l(e,t,i){return t-e<=i}function c(e,t,i){return Math.abs(e-t)t?1:0}function d(e,t){if(void 0===t&&(t=h),e.length<1)throw Error("array is empty");for(var i=e[0],n=0;n0&&(i=e[n]);return i}function f(e){var t=Math.ceil(e);return t%2!=0?t-1:t}function _(e){return e>0?Math.floor(e):Math.ceil(e)}i.r(t),i.d(t,"lessThan",(function(){return n})),i.d(t,"greaterThan",(function(){return r})),i.d(t,"clamp",(function(){return o})),i.d(t,"sign",(function(){return s})),i.d(t,"isBaseDecimal",(function(){return a})),i.d(t,"greaterOrEqual",(function(){return l})),i.d(t,"equal",(function(){return c})),i.d(t,"log10",(function(){return u})),i.d(t,"defComparator",(function(){return h})),i.d(t,"min",(function(){return d})),i.d(t,"max",(function(){return p})),i.d(t,"ceiledEven",(function(){return f})),i.d(t,"toInt",(function(){return _}))},HySD:function(e,t,i){"use strict";i.r(t),i.d(t,"ResizerDetacherState",(function(){return s}));var n=i("Eyy1"),r=i("hY0g"),o=i.n(r),s=function(){function e(e){var t=this;this._alive=new o.a,this._container=new o.a,this._width=new o.a,this._height=new o.a,this._fullscreen=new o.a,this._detachable=new o.a,this._fullscreenable=new o.a,this._visible=new o.a,this._availWidth=new o.a, this._availHeight=new o.a,this._owner=new o.a,this._ownersStack=[],this.owner=this._owner.readonly(),this._bridge={alive:this._alive.readonly(),container:this._container.readonly(),width:this._width.readonly(),height:this._height.readonly(),fullscreen:this._fullscreen.readonly(),detachable:this._detachable.readonly(),fullscreenable:this._fullscreenable.readonly(),visible:this._visible.readonly(),availWidth:this._availWidth.readonly(),availHeight:this._availHeight.readonly(),remove:function(){var e=t._owner.value();e&&e.remove&&e.remove()},negotiateWidth:function(e){var i=t._owner.value();i&&i.negotiateWidth&&i.negotiateWidth(e)},negotiateHeight:function(e){var i=t._owner.value();i&&i.negotiateHeight&&i.negotiateHeight(e)},requestFullscreen:function(){var e=t._owner.value();e&&e.requestFullscreen&&e.requestFullscreen()},exitFullscreen:function(){var e=t._owner.value();e&&e.exitFullscreen&&e.exitFullscreen()},detach:function(e){var i=t._owner.value();i&&i.detach&&i.detach(e)},attach:function(){var e=t._owner.value();e&&e.attach&&e.attach()}},e&&this.pushOwner(e)}return e.prototype.bridge=function(){return this._bridge},e.prototype.pushOwner=function(e){if(e.alive.value()){for(var t=0,i=this._ownersStack;t=t;i--)this._unsubscribeOwner(this._ownersStack[i],!0);this._ownersStack.length=t,t>0?this._subscribeOwner(this._ownersStack[t-1]):(this._alive.setValue(!1),this._owner.deleteValue())},e}()},I4UZ:function(e,t,i){"use strict";i.r(t),i.d(t,"HeaderToolbarBootloader",(function(){return s}));var n=i("mrSG"),r=i("yMne"),o=i("YuHv"),s=function(e){function t(t,i){var n=e.call(this)||this;return n._toolsBootloader=t,n._headerProps=i,n._headerProps.resizerBridge.negotiateHeight(r.HEADER_TOOLBAR_HEIGHT_EXPANDED),n._headerProps.resizerBridge.container.value().appendChild(Object(o.a)()),n}return Object(n.c)(t,e), t.prototype._startLoading=function(){var e=this;return Promise.all([this._toolsBootloader.load(),this._loadHeaderToolbar()]).then((function(t){var i=t[0];return new(0,t[1])(e._headerProps.resizerBridge.container.value(),Object(n.a)(Object(n.a)({},e._headerProps),{tools:i}))}))},t.prototype._loadHeaderToolbar=function(){return Promise.all([i.e("react"),i.e(35),i.e(47),i.e(79),i.e(13),i.e(14),i.e(42),i.e("header-toolbar")]).then(i.bind(null,"KMbc")).then((function(e){return e.HeaderToolbarRenderer}))},t}(i("cZRT").a)},I9zs:function(e,t,i){"use strict";var n=i("Eyy1").assert,r=i("aO4+").Point,o=i("eJTA"),s=o.rgbToHsl,a=o.hslToRgb,l=o.rgbToHexString,c=o.parseRgb,u=o.parseRgba,h=i("VdBB").HitTestResult,d=i("vq8G").SelectionRenderer,p=i("29fS").PaneRendererBars,f=i("cO0S").PaneRendererHistogram,_=i("Ndyb").PaneRendererColumns,m=i("gyZD").PaneRendererLine,v=i("u0yd").PaneRendererArea,y=i("/hKg").PaneRendererCandles,g=i("dBsn").PaneRendererCross,b=i("OYox").PaneRendererCircles,S=i("6Fc/").PaneRendererArrowsUpDownItem,w=i("6Fc/").PaneRendererArrowsUpDown,P=i("gTEF").SelectionRendererArrowsUpDown,C=i("f3xO").PaneRendererUnicodeChar,T=i("gVWb").PaneRendererBackground,x=i("Zp8I").PaneRendererStepLine,I=i("Zy3/").CompositeRenderer,L=i("o2pV").SelectionIndexes,O=i("Hr11").clamp,M=i("Nu4p"),A=i("23IT"),k=A.LineStudyPlotStyle,E=A.PlotSymbolSize,V=i("972a").MarkLocation,D=i("G3Rl").memoize,B=i("Tmoa"),R=i("k9/m").PlotRowSearchMode,N=i("Kxc7"),j=i("Zp/P"),F=i("Kmdw"),W=i("akof"),H=i("+q2u"),z=i("fxzW"),U=i("P+Pi"),G=i("IOzl"),Y=i("6ptY"),q=i("PF2b"),K=i("V0al");function Z(e,t,i,n){this.m_study=e,this.m_series=t,this.m_model=i,this._plotName=n,this.m_items=[],this._invalidated=!0,this._isMarkersEnabled=N.enabled("source_selection_markers"),this._selectionIndexer=new L(i.timeScale());var r=this.m_study.metaInfo().plots;this._colorer=null,this._palette=null,this._paletterProps=null,this._plotIndex=0;for(var o=0;o=0&&e0?(t-=n,i+=n):(t+=n,i-=n) ;var o=this.m_study.getMinFirstBarIndexForPlot(this._plotName);if(!(o>i)){t=Math.max(o,t);var s=this.m_study.properties().styles[this._plotName],a=s.plottype.value(),l=[k.Line,k.Area,k.Circles,k.Cross].indexOf(a)>=0,c=this.m_study.data(),u=this.m_study.firstValue();if(l&&c._length()>0){for(var d=c.search(t);Z.isIndexValid(d,c)&&void 0===c._valueAt(d)[this._plotIndex+1];)d-=1;t=Z.isIndexValid(d,c)?c._indexAt(d):t;for(var p=c.search(i);Z.isIndexValid(p,c)&&void 0===c._valueAt(p)[this._plotIndex+1];)p+=1;i=Z.isIndexValid(p,c)?c._indexAt(p):i}var f=c.range(t,i),_=this.m_study.priceScale(),m=O(this._getTranspValue(),0,100),v={},y=function(e,t){var i=e+"@"+t;return v[i]||(this._plotName&&"vol"===this._plotName?v[i]=B.generateColor(e,t):v[i]=B.generateColor(e,t,!0)),v[i]}.bind(this);if(f.each(function(e,t){e+=n,e=Math.floor(e);var i=null==(h=t[this._plotIndex+1]);if(l&&i)return!1;var o=new r(e,h=i?NaN:h);o.timePointIndex=e;var a=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor;if(this._colorer&&a){var c,u,h=t[this._colorer+1];if(o.style={},null!=h){c=this._palette.valToIndex?this._palette.valToIndex[h]:h;var d=(u=this._paletterProps.colors[c]).color.value();o.style.color=B.isHexColor(d)?y(d,m):d}else{d=s.color.value();o.style.color=y(d,100)}var p=void 0!==c?u.width.value():s.linewidth.value(),f=void 0!==c?u.style.value():s.linestyle.value();o.style.width=p,o.style.style=f}return this.m_items.push(o),!1}.bind(this)),_.pointsArrayToCoordinates(this.m_items,u),this.m_model.timeScale().indexesToCoordinates(this.m_items),s.histogramBase&&(this._histogramBase=this.m_study.priceScale().priceToCoordinate(s.histogramBase.value(),u)),this.m_model.selection().isSelected(this.m_study)){var g=this._selectionIndexer.indexes(t,i);this._selectionData={points:[],bgColors:[],visible:!0};var b=this.m_model.paneForSource(this.m_study).height();this._selectionData.hittestResult=h.REGULAR;for(var S=0;S0?(a-=c,l+=c):(a+=c,l-=c);var u=this._study.getMinFirstBarIndexForPlot(this._plotName);if(!(u>l))a=Math.max(u,a),this._study.data().range(a,l).each(function(e,t){e+=c;var n=t[this._plotIndex+1],a=new r(Math.floor(e)-.5),l=isNumber(s)?s:50;l=Math.min(l,100),l=Math.max(l,0);if(null!=n){var u=o.valToIndex?o.valToIndex[n]:n;a.color=B.generateColor(i[u].color.value(),l)}else a.color=null;return a.index=e,this._items.push(a),!1}.bind(this)),this._model.timeScale().indexesToCoordinates(this._items)}},J.prototype.renderer=function(){if(this._study.properties().styles[this._plotName].visible&&this._study.properties().styles[this._plotName].visible.value()&&this._scalesReady()){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var e={items:this._items,y:0, h:this._study.priceScale().height(),w:this._model.timeScale().barSpacing()},t=new I;return t.append(new T(e)),t}},X.prototype.items=function(){return this.m_items},X.prototype.update=function(){this.m_invalidated=!0},X.prototype._scalesReady=function(){var e=this.m_model.timeScale(),t=this.m_study.priceScale();return e&&t&&!e.isEmpty()&&!t.isEmpty()},X.prototype._updateImpl=function(){if(this.m_items=[],this._scalesReady()){var e=this.m_model.timeScale(),t=this.m_study.priceScale(),i=e.visibleBarsStrictRange();if(null!==i){var n=this.m_series.nearestIndex(i.firstBar(),R.NearestRight),r=this.m_series.nearestIndex(i.lastBar(),R.NearestLeft),o=this.m_study.offset(this.m_plotName);o>0?(n-=o,r+=o):(n+=o,r-=o);var s=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName);if(!(s>r)){n=Math.max(s,n);var a=this.m_study.data(),l=this.m_study.firstValue(),c=a.range(n,r),u=this._getTranspValue(),d=[],p=this.m_model.selection().isSelected(this.m_study);p?(d=this._selectionIndexer.indexes(n,r),this.m_selectionData={points:[],hittestResult:h.REGULAR,vertOffset:0,isDark:this.m_model.isDark(),bgColors:[],visible:!0}):(this._selectionIndexer.clear(),this.m_selectionData=null);var f,_,m=this.m_series.properties().style.value(),v=m===TradingView.Series.STYLE_LINE?"lineStyle":m===TradingView.Series.STYLE_AREA?"areaStyle":null;v?(f=this.m_series.properties()[v].priceSource.value(),_=f):(f="high",_="low");var y=this.m_study.priceScale().isInverted(),g=t.coordinateToPrice(t.height()*t.topMargin(),l),b=t.coordinateToPrice(t.height()*(1-t.bottomMargin()),l);this._topCoord=y?b:g,this._bottomCoord=y?g:b;var S=this.m_model.paneForSource(this.m_study).height();c.each(function(e,t){var i=Math.floor(e+o);if(null==(l=t[this.m_plotIndex+1]))return!1;var n=this._createItem(i,l,f,_);if(null!=n){var r=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor;if(this._colorer&&r){var s,a,l=t[this._colorer+1];if(n.style={},null!=l){var c=this._palette.valToIndex?this._palette.valToIndex[l]:l;s=this._paletterProps.colors[c].color.value(),a=u>9?u-10:0,n.style.color=B.generateColor(s,u)}else s=this.m_study.properties().styles[this.m_plotName].color.value(),a=100,n.style.color=B.generateColor(s,100);n.style.borderColor=B.generateColor(s,a)}var h=void 0!==t[this._textColorer+1]||this._textPalette&&this._textPalette.addDefaultColor;if(this._textColorer&&h){var m;l=t[this._textColorer+1];if(n.style||(n.style={}),null!=l){c=this._textPalette.valToIndex?this._textPalette.valToIndex[l]:l;m=this._textPaletterProps.colors[c].color.value(),n.style.textColor=B.generateColor(m,u)}else m=this.m_study.properties().styles[this.m_plotName].textColor.value(),n.style.textColor=B.generateColor(m,100)}return p&&-1!==d.indexOf(e)&&(this.m_selectionData.points.push(n),this.m_selectionData.bgColors.push(this.m_model.backgroundColorAtYPercentFromTop(n.y/S))),this.m_items.push(n),!1}}.bind(this)),this._convertItemsToCoordinates()}}}},X.prototype._updateRenderer=function(){this._updateImpl() ;var e=this.m_model.timeScale(),t={},i=this._getTranspValue(),n=e.barSpacing(),r=this._calculateShapeHeight(n),o=this.m_study.properties().styles[this.m_plotName].location.value(),s=this._calculateVerticalOffset(o,r+r/2);t.barSpacing=n,t.items=this.m_items,t.color=B.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),i),t.height=r,t.vertOffset=s;var a=this.m_study.properties().styles[this.m_plotName].plottype.value(),l=M.plotShapesData[a],c=new I;l&&c.append(new TradingView[l.paneRendererClass](t)),this.m_model.selection().isSelected(this.m_study)&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=s,c.append(new d(this.m_selectionData))),this.m_renderer=c},X.prototype._getSeriesVal=function(e,t){e=e||"close";var i=null;try{i=this.m_series[e](t)}catch(n){}return i},X.prototype._getTranspValue=function(){var e=0;this.m_study.properties().transparency&&(e=this.m_study.properties().transparency.value(),e=isNumber(e)?e:50);var t=this.m_study.properties().styles[this.m_plotName];return t.transparency&&(e=t.transparency.value(),e=isNumber(e)?e:50),O(e,0,100)},X.prototype._createItem=function(e,t,i,n){var o=this.m_study.properties().styles[this.m_plotName].location.value();if(!t&&o!==V.Absolute)return null;switch(o){case V.AboveBar:var s=this._getSeriesVal(i,e);if(void 0===s||null==s)return null;var a=s;break;case V.BelowBar:var l=this._getSeriesVal(n,e);if(void 0===l||null==l)return null;a=l;break;case V.Top:a=this._topCoord;break;case V.Bottom:a=this._bottomCoord;break;case V.Absolute:a=t;break;default:throw new Error("Bad value: "+o)}return new r(e,a)},X.prototype._convertItemsToCoordinates=function(){var e=this.m_model.timeScale(),t=this.m_study.priceScale();e.indexesToCoordinates(this.m_items),t.pointsArrayToCoordinates(this.m_items,this.m_study.firstValue())},X.prototype._calculateVerticalOffset=function(e,t){var i=0;switch(e){case V.AboveBar:case V.Bottom:i=-t;break;case V.BelowBar:case V.Top:i=t}return this.m_study.priceScale().isInverted()&&(i*=-1),i},X.prototype._calculateShapeHeight=function(e,t){var i=e;switch(t){case E.Tiny:i=.3*e;break;case E.Small:i=.6*e;break;case E.Normal:i=e;break;case E.Large:i=1.5*e;break;case E.Huge:i=2*e}return i},X.prototype.renderer=function(){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._updateRenderer(),this.m_invalidated=!1),this.m_renderer},inherit(Q,X),Q.prototype._updateRenderer=function(e){this._updateImpl();var t,i=this.m_model.timeScale(),n={},r=this._getTranspValue(),o=i.barSpacing();if(e.size){var s=e.size.value();t=this._calculateShapeHeight(25,s)}else t=Math.round(o/2);var a=e.location.value(),l=B.generateColor(e.color.value(),r),c=r>19?r-10:0,u=this._calculateVerticalOffset(a,Math.round(1.5*t));n.barSpacing=o,n.items=this.items(),n.color=l,n.borderColor=B.generateColor(e.color.value(),c),n.height=t,n.vertOffset=u ;var h=e.plottype.value(),p=M.plotShapesData[h],f=new I,_=e.text?e.text.value():void 0;if(void 0!==_&&""!==_.trim()){var m=_.trim().replace(/\\n/gm,"\n");m=TradingView.cleanButAmpersand(m,!0),n.text=m,n.fontSize=12;var v=e.textColor?e.textColor.value():void 0;n.textColor=v?B.generateColor(v,r):l}null!=p&&f.append(new TradingView[p.paneRendererClass](n)),this.m_model.selection().isSelected(this.m_study)&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=u,f.append(new d(this.m_selectionData))),this.m_renderer=f},Q.prototype.renderer=function(){var e=this.m_study.properties().styles[this.m_plotName];if(e.visible&&e.visible.value()&&this._scalesReady())return this.m_invalidated&&(this._updateRenderer(e),this.m_invalidated=!1),this.m_renderer},inherit($,Q),$.prototype.renderer=function(){var e=this.m_study.properties().styles[this.m_plotName];if(e.visible&&e.visible.value()&&this._scalesReady()){var t=this.m_model.timeScale();this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var i,n={},r=this._getTranspValue(),o=t.barSpacing();if(e.size){var s=e.size.value();i=this._calculateShapeHeight(50,s)}else i=Math.round(o);var a=e.location.value(),l=B.generateColor(e.color.value(),r),c=this._calculateVerticalOffset(a,i);n.items=this.items(),n.barSpacing=o,n.char=e.char.value(),n.height=i,n.vertOffset=c,n.color=l;var u=new I,h=e.text?e.text.value():void 0;if(void 0!==h&&""!==h.trim()){var p=h.trim().replace(/\\n/gm,"\n");p=TradingView.cleanButAmpersand(p,!0),n.text=p,n.fontSize=12;var f=e.textColor?e.textColor.value():void 0;n.textColor=f?B.generateColor(f,r):l}return u.append(new C(n)),this.m_model.selection().isSelected(this.m_study)&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=c,u.append(new d(this.m_selectionData))),u}},inherit(ee,X),ee.prototype.renderer=function(){if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady()){this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var e={},t=O(this._getTranspValue(),0,100),i=this.m_model.timeScale().barSpacing();e.items=this.m_items,e.barSpacing=i,e.colorup=B.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),t),e.colordown=B.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),t);var n=u(e.colorup),r=n?100*(1-n[3]):0,o=u(e.colordown),s=o?100*(1-o[3]):0;e.colorBorderUp=B.generateColor("#000000",r),e.colorBorderDown=B.generateColor("#000000",s),e.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value(),e.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value();var a=new I;if(a.append(new w(e)),this.m_model.selection().isSelected(this.m_study)&&null!==this.m_selectionData){var l=this.m_selectionData;l.barSpacing=i,a.append(new P(l))}return a}},ee.prototype._createItem=function(e,t,i,n){if(0!==t){Math.abs(t)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(t));var r,o=t>0;if(o){ var s=this._getSeriesVal(n,e);if(void 0===s||null==s)return null;r=s}else{var a=this._getSeriesVal(i,e);if(void 0===a||null==a)return null;r=a}return new S(e,r,t,o)}},ee.prototype._convertItemsToCoordinates=function(){var e=this.m_model.timeScale(),t=this.m_study.priceScale();e.indexesToCoordinates(this.m_items),t.pointsArrayToCoordinates(this.m_items,this.m_study.firstValue());var i=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value()),n=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value());if(i>n){var r=i;i=n,n=r}for(var o=(n-i)/this._maxAbsValue,s=this.m_items,a=0;ai)){t=Math.max(n,t);var o=this.m_study.data(),s=this.m_study.firstValue(),a=o.range(t,i),l=this.m_study.properties().ohlcPlots[this.m_plotName],c={};if(a.each(function(e,t){e=Math.floor(e);for(var i=!0,n={},r=TradingView.OPEN_PLOT;r<=TradingView.CLOSE_PLOT;++r){var o=t[this._ohlcPlotIndexes[r]+1];if(null==o){i=!1;break}n[r]=o}if(!i)return!1;var s=n[TradingView.OPEN_PLOT],a=n[TradingView.CLOSE_PLOT],u=Math.max(s,n[TradingView.HIGH_PLOT],n[TradingView.LOW_PLOT],a),h=Math.min(s,n[TradingView.HIGH_PLOT],n[TradingView.LOW_PLOT],a),d={};d.time=Math.round(e),d.open=s,d.high=u,d.low=h,d.close=a;var p=this._colorer?null!=t[this._colorer+1]?this._plotValueToPaletteColor(t[this._colorer+1]):"rgba(0, 0, 0, 0)":l.color.value();return d.color=function(e,t){var i=e+"@"+t;return c[i]||(c[i]=B.generateColor(e,t)),c[i]}(p,0),d.hollow=null,this.m_bars.push(d),!1}.bind(this)),this.m_study.priceScale().barPricesToCoordinates(this.m_bars,s),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_model.selection().isSelected(this.m_study)){var u=this._selectionIndexer.indexes(t,i);this._selectionData={points:[],bgColors:[],visible:!0},this._selectionData={points:[],hittestResult:h.REGULAR,isDark:this.m_model.isDark(),bgColors:[],visible:!0};for(var d=this.m_model.paneForSource(this.m_study).height(),p=0;pi){var s=r(e,i,t,n,o);return s.count=-s.count,s}return a(e,t,1,(function(e,t){return t>i||0!==n&&e>n}),o)}function o(e,t,i,n){void 0===n&&(n=!1);var r=i<0?-1:1;return a(e,t,r,(function(e,t){return e>=i*r}),n)}function s(e,t,i){var n=i<0?-1:1;return a(e,t,n,(function(e,t){return e>=i*n}),!0).times}function a(e,t,i,r,o){var s=0,a=t;e.moveTo(a);for(var l=0,c=Number.MAX_VALUE,u=!1,h=t,d=[];!r(s,a);){if(l>15)throw new Error("Internal error 0x10 while extrapolating.");var p=e.indexOfBar(a);if(p===n.SessionStage.PRE_SESSION&&1===i)a=e.startOfBar(0),e.moveTo(a);else if(p===n.SessionStage.PRE_SESSION&&-1===i)a=e.startOfBar(n.SessionStage.PRE_SESSION)-1,e.moveTo(a);else if(p===n.SessionStage.POST_SESSION&&1===i)a=e.startOfBar(n.SessionStage.POST_SESSION),e.moveTo(a);else{if(p===n.SessionStage.POST_SESSION&&-1===i)throw new Error("Internal error 0x12 while extrapolating.");var f=e.startOfBar(p);if(f>t&&i>0||t>f&&i<0){if(u&&c===f)throw new Error("Internal error 0x11 while extrapolating.");u=!0,c=f,l=0,s++,h=f,o&&d.push(h)}if(0===p&&-1===i)a=f-1;else{a=e.startOfBar(p+i);var _=e.startOfBar(n.SessionStage.POST_SESSION);a>_&&(e.moveTo(_),a=e.startOfBar(0))}}l++}return{time:h,times:d,count:s}}},IMMp:function(e){ e.exports=JSON.parse('{"color-bg-primary":"color-cold-gray-850","color-bg-primary-hover":"color-cold-gray-800","color-bg-secondary":"color-cold-gray-900","color-bg-highlight":"color-cold-gray-900","color-bg-scroll-buttons":"color-cold-gray-800","color-legacy-bg-scroll-buttons":"color-cold-gray-550","color-legacy-bg-widget":"color-cold-gray-900","color-text-primary":"color-cold-gray-200","color-text-secondary":"color-cold-gray-500","color-text-tertiary":"color-cold-gray-400","color-text-disabled":"color-cold-gray-650","color-divider":"color-cold-gray-700","color-divider-hover":"color-cold-gray-800","color-box-shadow":"color-black","color-active-hover-text":"color-gull-gray","color-alert-text":"color-loblolly","color-border":"color-bright-gray","color-border-chat-fields":"color-bright-gray","color-border-hover":"color-trout-1","color-border-table":"color-cold-gray-800","color-brand":"color-tv-blue-700","color-brand-active":"color-tv-blue-600","color-brand-hover":"color-tv-blue-600","color-button-hover-bg":"color-mirage-3","color-chart-page-bg":"color-cold-gray-800","color-common-tooltip-bg":"color-cold-gray-650","color-danger":"color-ripe-red-600","color-depthrenderer-fill-style":"color-catskill-white","color-depthrenderer-stroke-style":"color-trout-1","color-disabled-border-and-color":"color-ebony-clay","color-disabled-input":"color-bright-gray","color-empty-container-message":"color-slate-gray","color-highlight-new":"color-dark-slate-blue","color-icons":"color-slate-gray","color-input-bg":"color-charade","color-input-textarea-readonly":"color-trout-1","color-input-placeholder-text":"color-cold-gray-700","color-input-publish-bg":"color-mirage-1","color-item-active-blue":"color-blue-dianne","color-item-hover-active-bg":"color-charade","color-item-hover-bg":"color-ebony-clay","color-item-hover-blue":"color-blue-dianne","color-item-selected-blue":"color-blue-dianne","color-item-active-text":"color-cold-gray-200","color-item-active-bg":"color-tv-blue-700","color-link":"color-tv-blue-700","color-link-hover":"color-tv-blue-600","color-link-active":"color-tv-blue-800","color-list-item":"color-slate-gray","color-list-nth-child-bg":"color-mirage-3","color-news-highlight":"color-charade","color-pane-bg":"color-mirage-1","color-pane-secondary-bg":"color-cold-gray-850","color-placeholder":"color-trout-2","color-popup-menu-item-hover-bg":"color-cold-gray-800","color-popup-menu-separator":"color-cold-gray-700","color-row-hover-active-bg":"color-ebony-clay","color-sb-scrollbar-body-bg":"color-trout-2","color-screener-description":"color-loblolly","color-section-separator-border":"color-bright-gray","color-separator-table-chat":"color-bright-gray","color-success":"color-minty-green-700","color-success-hover":"color-minty-green-600","color-success-active":"color-minty-green-500","color-tag-active-bg":"color-bright-gray","color-tag-hover-bg":"color-charade","color-text-regular":"color-loblolly","color-toolbar-button-text":"color-cold-gray-500","color-toolbar-button-text-hover":"color-cold-gray-450","color-toolbar-button-text-active":"color-tv-blue-700","color-toolbar-button-text-active-hover":"color-tv-blue-600","color-toolbar-button-background-hover":"color-cold-gray-800","color-toolbar-button-background-secondary-hover":"color-cold-gray-750","color-toolbar-toggle-button-background-active":"color-tv-blue-700","color-toolbar-toggle-button-background-active-hover":"color-tv-blue-600","color-toolbar-interactive-element-text-normal":"color-cold-gray-300","color-toolbar-interactive-element-text-hover":"color-cold-gray-250","color-toolbar-opened-element-bg":"color-cold-gray-800","color-tooltip-bg":"color-bright-gray","color-tv-button-checked":"color-slate-gray","color-tv-dialog-caption":"color-athens-gray-2","color-tv-dropdown-item-hover-bg":"color-charade","color-underlined-text":"color-gull-gray","color-widget-pages-bg":"color-cold-gray-900","color-warning":"color-tan-orange-700","color-forex-icon":"color-white","color-list-item-active-bg":"color-medium-blue","color-list-item-hover-bg":"color-ebony-clay","color-list-item-text":"color-loblolly","color-price-axis-label-back":"color-cold-gray-800","color-price-axis-label-text":"color-cold-gray-500","color-price-axis-gear":"color-cold-gray-500","color-price-axis-gear-hover":"color-cold-gray-400","color-price-axis-highlight":"color-cold-gray-800","color-bid":"color-tv-blue-700","color-scroll-bg":"color-cold-gray-750","color-scroll-border":"color-cold-gray-850","color-widget-border":"color-cold-gray-800","color-scroll-buttons-arrow":"color-white","color-control-intent-default":"color-cold-gray-650","color-control-intent-success":"color-minty-green-600","color-control-intent-primary":"color-tv-blue-700","color-control-intent-warning":"color-tan-orange-500","color-control-intent-danger":"color-ripe-red-700","color-growing":"color-minty-green-600","color-falling":"color-ripe-red-600","color-pre-market":"color-tan-orange-600","color-pre-market-bg":"color-tan-orange-400","color-post-market":"color-tv-blue-500","color-post-market-bg":"color-tv-blue-400","color-market-open":"color-minty-green-500","color-market-open-bg":"color-minty-green-400","color-market-closed":"color-cold-gray-400","color-market-holiday":"color-cold-gray-400","color-invalid-symbol":"color-ripe-red-400","color-invalid-symbol-hover":"color-ripe-red-500","color-replay-mode":"color-tv-blue-700","color-replay-mode-icon":"color-tv-blue-50","color-replay-mode-hover":"color-tv-blue-600","color-notaccurate-mode":"color-berry-pink-700","color-notaccurate-mode-bg":"color-berry-pink-400","color-delay-mode":"color-tan-orange-700","color-delay-mode-bg":"color-tan-orange-400","color-eod-mode":"color-grapes-purple-700","color-eod-mode-bg":"color-grapes-purple-400","color-data-problem":"color-ripe-red-600","color-data-problem-bg":"color-ripe-red-400","color-data-problem-hover":"color-ripe-red-500","color-list-item-bg-highlighted":"color-tv-blue-a900","color-list-item-bg-selected":"color-tv-blue-a800","color-list-item-bg-highlighted-hover":"color-tv-blue-a800","color-list-item-bg-selected-hover":"color-tv-blue-a700","color-screener-header-bg":"color-cold-gray-850","color-screener-header-bg-hover":"color-cold-gray-800"}') },IOzl:function(e,t,i){"use strict";i.r(t);var n,r=i("mrSG"),o=i("aO4+"),s=i("Eyy1"),a=i("2WC2"),l=i("gBDZ"),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.c)(t,e),t.prototype.setData=function(e,t){this._setBaseData(e,t);for(var i=0,n=this._items;i=0?e.vertOffset:e.vertOffset-e.shapeHeight},t}(c),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.c)(t,e),t.prototype._calcBoundingBox=function(e){var t=e.x-e.shapeWidth/2,i=e.x+e.shapeWidth/2,n=e.y-e.shapeHeight+e.vertOffset,r=e.y+e.vertOffset,s=new o.Point(t,n),a=new o.Point(i,r);return Object(o.box)(s,a)},t.prototype._drawItemShape=function(e,t,i){var r=t.pixelRatio,o=this._lineWidth(t)%2?.5:0,s=Math.max(1,Math.floor(r))%2?.5:0,a=this._getArrowSize(i),l=Math.round(a*r);(s+l)%1!=o%1&&(l+=.5);var c=Math.round(i.shapeWidth/2*r);(s+c)%1!=o%1&&(c+=.5);var u=Math.round(i.x*r)+s,h=Math.round((i.y+i.vertOffset)*r)+o,d=u+l,p=Math.round((i.y+i.vertOffset-a)*r)+o,f=u-l,_=u+c,m=Math.round((i.y+i.vertOffset-i.shapeHeight)*r)+o,v=u-c;e.moveTo(d,p),e.lineTo(u,h),e.lineTo(f,p),i.shapeWidth<=2*a?(e.lineTo(v,p),this._drawCorner(e,v,m,n.leftUp,r),this._drawCorner(e,_,m,n.rightUp,r),e.lineTo(_,p)):(this._drawCorner(e,v,p,n.leftDown,r),this._drawCorner(e,v,m,n.leftUp,r),this._drawCorner(e,_,m,n.rightUp,r),this._drawCorner(e,_,p,n.rightDown,r)),e.lineTo(d,p)},t.prototype._getVerticalTextOffset=function(e){return-e.shapeHeight/2-this._getArrowSize(e)/2},t.prototype._calcVertOffset=function(e){return Math.sign(e.vertOffset)<=0?e.vertOffset:e.vertOffset+e.shapeHeight},t}(c),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.c)(t,e),t.prototype._calcBoundingBox=function(e){var t=e.x,i=e.x+e.shapeWidth,n=e.y-e.shapeHeight/2+e.vertOffset,r=e.y+e.shapeHeight/2+e.vertOffset,s=new o.Point(t,n),a=new o.Point(i,r);return Object(o.box)(s,a)},t.prototype._drawItemShape=function(e,t,i){var r=t.pixelRatio,o=this._lineWidth(t)%2?.5:0,s=this._getArrowSize(i),a=this._hasText(i),l=a?i.shapeHeight/2:s,c=Math.round(i.x*r)+o,u=Math.round((i.y+i.vertOffset)*r)+o,h=Math.round((i.x+s)*r)+o,d=Math.round((i.y+i.vertOffset+s)*r)+o,p=Math.round((i.y+i.vertOffset-s)*r)+o,f=Math.round((i.y+i.vertOffset-l)*r)+o,_=Math.round((i.x+i.shapeWidth)*r)+o,m=Math.round((i.y+i.vertOffset+l)*r)+o;e.moveTo(h,d),e.lineTo(c,u),e.lineTo(h,p),a?this._drawCorner(e,h,f,n.leftUp,r):e.lineTo(h,f),this._drawCorner(e,_,f,n.rightUp,r),this._drawCorner(e,_,m,n.rightDown,r),a?this._drawCorner(e,h,m,n.leftDown,r):e.lineTo(h,m),e.lineTo(h,d)},t.prototype._getHorizontalTextOffset=function(e){return e.shapeWidth/2+this._getArrowSize(e)/2},t}(c),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.c)(t,e),t.prototype._calcBoundingBox=function(e){var t=e.x-e.shapeWidth,i=e.x,n=e.y-e.shapeHeight/2+e.vertOffset,r=e.y+e.shapeHeight/2+e.vertOffset,s=new o.Point(t,n),a=new o.Point(i,r);return Object(o.box)(s,a)},t.prototype._drawItemShape=function(e,t,i){ var r=t.pixelRatio,o=this._lineWidth(t)%2?.5:0,s=this._getArrowSize(i),a=this._hasText(i),l=a?i.shapeHeight/2:s,c=Math.round(i.x*r)+o,u=Math.round((i.y+i.vertOffset)*r)+o,h=Math.round((i.x-s)*r)+o,d=Math.round((i.y+i.vertOffset-s)*r)+o,p=Math.round((i.y+i.vertOffset+s)*r)+o,f=Math.round((i.y+i.vertOffset-l)*r)+o,_=Math.round((i.x-i.shapeWidth)*r)+o,m=Math.round((i.y+i.vertOffset+l)*r)+o;e.moveTo(h,d),e.lineTo(c,u),e.lineTo(h,p),a?this._drawCorner(e,h,m,n.rightDown,r):e.lineTo(h,m),this._drawCorner(e,_,m,n.leftDown,r),this._drawCorner(e,_,f,n.leftUp,r),a?this._drawCorner(e,h,f,n.rightUp,r):e.lineTo(h,f),e.lineTo(h,d)},t.prototype._getHorizontalTextOffset=function(e){return-e.shapeWidth/2-this._getArrowSize(e)/2},t}(c),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.c)(t,e),t.prototype._calcBoundingBox=function(e){var t=e.x-e.shapeWidth/2,i=e.x+e.shapeWidth/2,n=e.y-e.shapeHeight/2+e.vertOffset,r=e.y+e.shapeHeight/2+e.vertOffset,s=new o.Point(t,n),a=new o.Point(i,r);return Object(o.box)(s,a)},t.prototype._drawItemShape=function(e,t,i){var r=t.pixelRatio,o=this._lineWidth(t)%2?.5:0,s=i.shapeHeight/2,a=i.shapeWidth/2,l=Math.round(i.x*r)+o,c=Math.round((i.x-a)*r)+o,u=Math.round((i.x+a)*r)+o,h=Math.round((i.y+i.vertOffset-s)*r)+o,d=Math.round((i.y+i.vertOffset+s)*r)+o;e.moveTo(l,h),this._drawCorner(e,u,h,n.rightUp,r),this._drawCorner(e,u,d,n.rightDown,r),this._drawCorner(e,c,d,n.leftDown,r),this._drawCorner(e,c,h,n.leftUp,r),e.lineTo(l,h)},t}(c)},IVMC:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.reduce((function(e,t,i){return~e.indexOf(t)||e.push(t),e}),[])},e.exports=t.default},IWXC:function(e,t,i){"use strict";i.r(t),i.d(t,"getQuoteSessionInstance",(function(){return s})),i.d(t,"setQuoteSessionInstance",(function(){return a})),i.d(t,"getQuoteSessionNoEnsure",(function(){return l})),i.d(t,"destroyQuoteSessions",(function(){return c}));var n=i("hGf4"),r=i.n(n),o={};function s(e){return void 0===e&&(e="full"),o[e]||a(e,new r.a(e)),o[e]}function a(e,t){void 0===e&&(e="full"),o[e]=t}function l(e){return void 0===e&&(e="full"),o[e]}function c(){for(var e in o)if(o.hasOwnProperty(e)){var t=o[e];void 0!==t&&t.destroy(),delete o[e]}}},Ialn:function(e,t,i){"use strict";i.r(t),i.d(t,"isRtl",(function(){return r})),i.d(t,"stripLTRMarks",(function(){return s})),i.d(t,"startWithLTR",(function(){return a})),i.d(t,"forceLTRStr",(function(){return l})),i.d(t,"forceLTRStrSsr",(function(){return c})),i.d(t,"forceRTLStr",(function(){return u})),i.d(t,"getLTRScrollLeft",(function(){return h})),i.d(t,"getLTRScrollLeftOffset",(function(){return d})),i.d(t,"detectAutoDirection",(function(){return _}));var n=i("oYVD"),r=function(){return"rtl"===window.document.dir},o=new RegExp("‎|‪|‫|‬","g");function s(e){return""!==e&&r()&&null!=e?e.replace(o,""):e}function a(e){return""!==e&&r()&&null!=e?"‎"+e:e}function l(e){return""!==e&&r()&&null!=e?"‪"+e+"‬":e}function c(e){return"‪"+e+"‬"}function u(e){return""!==e&&r()&&null!=e?"‫"+e+"‬":e} function h(e){return Object(n.getNormalizedScrollLeft)(e,"rtl")}function d(e,t){var i=Object(n.detectScrollType)();if("indeterminate"===i)return 0;switch(i){case"negative":t=e.clientWidth-e.scrollWidth+t;break;case"reverse":t=e.scrollWidth-e.clientWidth-t}return t}var p=/[^\u0000-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u02B9-\u02FF\u2000-\u200E\u2010-\u2029\u202C\u202F-\u2BFF]/,f=/[\u0590-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]/;function _(e){var t=p.exec(e);return t?f.test(t[0])?"rtl":"ltr":""}},IcDj:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyBase",(function(){return _}));var n=i("mrSG"),r=i("Eyy1"),o=i("aIyQ"),s=i.n(o),a=i("7ktv"),l=i("mMWL"),c=i("5fI3"),u=i("jy4L"),h=i("YWnQ"),d=i("e1Hy"),p=i("W+6j"),f=window.t("Invalid Symbol"),_=function(e){function t(i,n,r,o){var a=e.call(this,i)||this;a.onStart=new s.a,a._symbolsResolved=new s.a,a._statusChanged=new s.a,a._paneViews=[],a._priceAxisViews=[],a._resolvedSymbols={},a._isChildStudy=!1,a._loading=!0,a._failed=!1,a._status="",a._studyId=null,a._chartApi=i.chartApi(),a._properties=n,a._metaInfo=o,a._series=a._model.mainSeries(),r instanceof t&&(a._source=r,a._isChildStudy=!0,a._source.setChild(a));var l=a.parentSource();return l.currencyChanged().subscribe(a,a._onSourceCurrencyChanged),l.priceRangeReadyChanged().subscribe(a,a._onSourcePriceRangeReadyChanged),l.formatterChanged().subscribe(a,a._onSourceFormatterChanged),l.priceStepChanged().subscribe(a,a._onSourcePriceStepChanged),a}return Object(n.c)(t,e),t.prototype.destroy=function(){var e=this.parentSource();e.currencyChanged().unsubscribeAll(this),e.priceRangeReadyChanged().unsubscribeAll(this),e.formatterChanged().unsubscribeAll(this),e.priceStepChanged().unsubscribeAll(this)},t.prototype.isSymbolInvalid=function(){return this._status===f},t.prototype.getSymbolString=function(e){return Object(c.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getSymbolObject(e))},t.prototype.onStatusChanged=function(){return this._statusChanged},t.prototype.symbolsResolved=function(){return this._symbolsResolved},t.prototype.valuesProvider=function(){return new d.a(this,this.model())},t.prototype.statusProvider=function(e){return new p.a(this,this._model.properties().scalesProperties.textColor)},t.prototype.correctScaleMargins=function(e){if("Volume"===this.metaInfo().shortId){var t=this.model().paneForSource(this);return null!==t&&t.isOverlay(this)&&t.containsMainSeries()?{top:.75,bottom:0}:{top:e.top,bottom:0}}return e},t.prototype.canBeHiddenByGlobalFlag=function(){return!0},t.prototype.isSourceHidden=function(){return!this.isVisible()||this.canBeHiddenByGlobalFlag()&&l.hideAllIndicators().value()},t.prototype._allSymbolsAreResolved=function(){for(var e=this,t=[],i=this.metaInfo(),n=0;n=this._sessionEndMs?l.SessionStage.POST_SESSION:Object(s.toInt)(n.time_seconds_diff(e,this._sessionStartMs)/this._periodSec)},t.prototype.startOfBar=function(e){if(e===l.SessionStage.PRE_SESSION){var t=n.get_cal_from_unix_timestamp_ms(this._session.timezone,this._sessionStartMs-1),i=this._session.spec.alignToNearestSessionEnd(t,-1);return n.cal_to_utc(this._session.timezone,i)}if(e===l.SessionStage.POST_SESSION)return this._sessionEndMs;if(e<0)throw new Error("Negative offset is not supported");return this._sessionStartMs+n.time_seconds(this._periodSec*e)},t.prototype.endOfBar=function(e){if(e<0)throw new Error("Index cannot be negative");var t=this.startOfBar(e)+1e3*this._periodSec;return t>this._sessionEndMs?this._sessionEndMs:t},t.prototype.isLastBar=function(e,t){return t>=this._sessionStartMs+n.time_seconds(this._periodSec*(e+1)-1)},t.prototype.moveTo=function(e){ var t=this._session.timezone,i=n.utc_to_cal(t,e),r=this._session.spec.alignToSessionStart(i);this._sessionStartMs=n.cal_to_utc(t,i),n.add_minutes(i,r),this._sessionEndMs=n.cal_to_utc(t,i)},t.prototype.indexOfLastBarInSession=function(){return Object(s.toInt)((this._sessionEndMs-1-this._sessionStartMs)/1e3/this._periodSec)},t.prototype.moveNext=function(){this.moveTo(this._sessionEndMs)},t}(a.a),u=i("OBgQ");function h(e,t){var i=n.clone(t),r=e.businessDaysToCalendarDays(i,1);r>1&&n.add_date(i,r-1);var o=e.leftBorderOfDailyBar(i);if(null===o)throw new Error("Cannot calculate left border of daily bar");return n.cal_to_utc(n.get_timezone(e.timezone()),o)}var d=function(e){function t(t,i,n,r,o){void 0===o&&(o=!1);var s=e.call(this)||this;return s._periodStart=-Number.MAX_VALUE,s._periodEnd=-Number.MAX_VALUE,s._periodLastBarStart=-Number.MAX_VALUE,s._periodStartDay=new u.a(0,0,0),s._periodEndDay=new u.a(0,0,0),s._period=n,s._sessionTgt=t,s._builder=r,s._useBusinessDays=o,s._sessionSrc=o?new a.b("Etc/UTC","24x7"):i||t,s}return Object(o.c)(t,e),t.prototype.builder=function(){return this._builder},t.prototype.alignTimeIfPossible=function(e){return this.tradingDayToSessionStart(e)},t.prototype.tradingDayToSessionStart=function(e){return this.moveTo(e),this.startOfBar(0)},t.prototype.indexOfBar=function(e){if(this._useBusinessDays){var t=u.a.fromCalendar(n.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e));return t.before(this._periodStartDay)?l.SessionStage.PRE_SESSION:this._periodEndDay.before(t)?l.SessionStage.POST_SESSION:0}return e=this._periodEnd?l.SessionStage.POST_SESSION:0},t.prototype.startOfBar=function(e){if(e===l.SessionStage.PRE_SESSION){var t=n.get_cal_from_unix_timestamp_ms(this._sessionTgt.timezone,this._periodStart-1),i=this._sessionTgt.spec.alignToNearestSessionEnd(t,-1);return n.cal_to_utc(this._sessionTgt.timezone,i)-1}return e===l.SessionStage.POST_SESSION||e>0?this._periodEnd:e===l.SessionStage.LASTBAR_SESSION?this._periodLastBarStart:this._periodStart},t.prototype.moveTo=function(e){var t=n.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e);this._sessionSrc.spec.correctTradingDay(t);var i=n.get_year(t),r=this._indexOfPeriodInYear(t),o=r+this._period,s=this._sessionTgt.spec,a=this._sessionTgt.timezone,l=this._builder.startOfPeriod(a,r,i);this._periodStart=h(s,l);var c=n.clone(l),d=s.businessDaysToCalendarDays(c,1);d>1&&n.add_date(c,d-1),this._periodStartDay=u.a.fromCalendar(c);var p=this._builder.startOfPeriod(a,o,i);this._periodEnd=h(s,p);var f=n.clone(p);for(n.add_date(f,-1);s.isCalWeekEnd(f);)n.add_date(f,-1);this._periodEndDay=u.a.fromCalendar(f),n.add_date(p,-1),function(e,t){for(;e.isCalWeekEnd(t);)n.add_date(t,-1)}(this._sessionTgt.spec,p),this._periodLastBarStart=h(s,p),(this._periodLastBarStart=this._periodLastBarStart},t.prototype.currentRange=function(){return{from:this._periodStartDay,to:this._periodEndDay}},t.prototype.indexOfBarInYear=function(e){var t=n.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e),i=n.get_year(t),r=this._builder.indexOfPeriod(t),o=this._sessionTgt.timezone,a=this._builder.startOfPeriod(o,r,i),l=h(this._sessionTgt.spec,a);return a=n.get_cal_from_unix_timestamp_ms(n.get_timezone("Etc/UTC"),l),i=0&&(r-=7),Object(s.toInt)((r+i)/7))}var _=function(){function e(){}return e.prototype.indexOfPeriod=function(e){return n.get_day_of_year(e)-1},e.prototype.startOfPeriod=function(e,t,i){var r=n.days_per_year(i);return n.get_cal(n.get_timezone("Etc/UTC"),i,n.JANUARY,1+Math.min(t,r))},e}(),m=function(e){function t(t){var i=e.call(this)||this;return i._sessionsSpec=t,i}return Object(o.c)(t,e),t.prototype.indexOfPeriod=function(t){return e.prototype.indexOfPeriod.call(this,t)-function(e,t){var i=f(e,t),r=n.get_cal(n.get_timezone("Etc/UTC"),n.get_year(t),n.JANUARY,1);n.add_date(r,7*i);var o=i*e.weekEndsCount()+e.holidaysFromYearStart(r),s=n.get_day_of_year(t)-n.get_day_of_year(r);return o+s-e.calendarDaysToBusinessDays(r,s)}(this._sessionsSpec,t)},t.prototype.startOfPeriod=function(t,i,r){var o=7-this._sessionsSpec.weekEndsCount(),a=Math.max(0,Object(s.toInt)(i/o)-1),l=n.get_cal(n.get_timezone("Etc/UTC"),r,n.JANUARY,1),c=n.get_days_per_year(l);if(n.add_date(l,7*a),(i-=o*a-this._sessionsSpec.holidaysFromYearStart(l))>0){var u=this._sessionsSpec.businessDaysToCalendarDays(l,i);n.add_date(l,u)}var h=n.get_day_of_year(l)-1;return rn.get_days_per_year(c)?this.startOfPeriod(e,0,i+1):(n.add_date(c,h),c)},e}(),g=function(){function e(){}return e.prototype.indexOfPeriod=function(e){return n.get_month(e)},e.prototype.startOfPeriod=function(e,t,i){if(t<0){var r=Object(s.toInt)((11-t)/12);i-=r,t+=12*r}else t>n.DECEMBER&&(i++,t=n.JANUARY);return n.get_cal(n.get_timezone("Etc/UTC"),i,t,1)},e}();function b(e,t,i,n){void 0===n&&(n=!1);var o=r.Interval.parse(e),s=o.multiplier();return o.isMinutes()?new c(60*s,t):o.isSeconds()?new c(s,t):o.isTicks()?new c(1,t):o.isRange()?new c(60*s,t):new d(t,i,s,function(e,t){switch(e){case r.ResolutionKind.Days:return new v(t);case r.ResolutionKind.Weeks:return new y(t);case r.ResolutionKind.Months:return new g}throw new Error("Unknown dwm resolution: "+e)}(o.kind(),t),n)}function S(e,t,i,n,o,s,l){var c=r.Interval.parse(o+n);if(c.isMonths()){var u=new Date(l);u.setUTCDate(1);var h=u.getUTCMonth()-s*c.multiplier();return u.setUTCMonth(h),u.getTime()}var d,p=new a.b("Etc/UTC",e,t,i),f=c.inMilliseconds(),_=c.isDWM(),m=(_?864e5:60*p.spec.findSession(0,0,0).getEntry().length()*1e3)/f,v=(c.isWeeks()?7:7-p.spec.weekEndsCount())*m;s=v&&(y=_/6048e5*v),Math.ceil(y)}function P(e,t){var i=n.clone(t);return e.alignToSessionStart(i),n.cal_to_utc(n.get_timezone(e.timezone()),i)}function C(e,t){var i=n.utc_to_cal(t.timezone,+e),r=n.get_day_of_week(i),o=n.get_minutes_from_midnight(i),s=t.spec.findSession(t.spec.getWeekIndex(i),r,o).getEntry();return s.isOvernight()&&o>s.startOffset()+s.length()&&r===s.dayOfWeek()-1&&(r++,o-=1440),r===s.dayOfWeek()&&o>=s.startOffset()&&o0&&(e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=i,Object(c.setLineStyle)(e,u.LINESTYLE_SOLID),this._extendAndDrawLineSegment(e,s,l,t),this._extendAndDrawLineSegment(e,h,a,t),Object(c.drawLine)(e,s.x,s.y,h.x,h.y),Object(c.drawLine)(e,l.x,l.y,a.x,a.y)),e.restore()}},e.prototype._getPointsInPhysicalSpace=function(e,t){void 0===t&&(t=0);var i=Object(n.ensureNotNull)(this._data).points,o=i[0],s=i[1],a=e.pixelRatio,l=Math.round(o.x*a)+t,c=Math.round(s.x*a)+t,u=Math.round(o.y*a)+t,h=Math.round(s.y*a)+t;return[new r.Point(l,u),new r.Point(c,h)]},e.prototype._extendAndHitTestLineSegment=function(e,t,i,n){var r=this._extendAndClipLineSegment(t,i,n);if(null!==r&&Object(s.distanceToSegment)(r[0],r[1],e).distance<=3)return this._hitTestResult;return null},e.prototype._extendAndDrawLineSegment=function(e,t,i,n){var r=this._extendAndClipLineSegment(t,i,n);null!==r&&Object(c.drawLine)(e,r[0].x,r[0].y,r[1].x,r[1].y)},e.prototype._extendAndClipLineSegment=function(e,t,i){var o=Object(n.ensureNotNull)(this._data);if(Object(r.equalPoints)(e,t))return null;var s=i.physicalWidth,a=Math.min(e.x,t.x),l=Math.max(e.x,t.x),c=o.extendLeft?0:Math.max(a,0),u=o.extendRight?s:Math.min(l,s);return c>u||u<=0||c>=s?null:[new r.Point(c,e.y),new r.Point(u,t.y)]},e.prototype._drawBackground=function(e,t,i,n){if(!(n.cssWidth<=0||n.cssHeight<=0)){var r=this._extendAndClipLineSegment(t,i,n);if(null!==r){var o=r[0],s=r[1];e.beginPath(),e.moveTo(o.x,o.y),e.lineTo(s.x,o.y),e.lineTo(s.x,s.y),e.lineTo(o.x,s.y),e.lineTo(o.x,o.y),e.fillStyle=this.getColor(),e.fill()}}},e.prototype._hitTestBackground=function(e,t,i,n){var s=this._extendAndClipLineSegment(t,i,n);return null!==s&&Object(o.pointInBox)(e,Object(r.box)(s[0],s[1]))?this._backHitTestResult:null},e}()},InMJ:function(e,t,i){ "use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;function o(e,t){var r=t||o.createProperties();n.call(this,e,r),this.version=o.version,i.e("lt-pane-views").then(function(e){var t=i("gr7S").FlatBottomPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(o,n),o.version=1,o.prototype.pointsCount=function(){return 3},o.prototype.name=function(){return"Flat Bottom"},o.prototype.hasEditableCoordinates=function(){return!1},o.prototype.addPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),n.prototype.addPoint.call(this,e)},o.prototype.setLastPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),n.prototype.setLastPoint.call(this,e)},o.prototype.setPoint=function(e,t,i){if(i&&i.shift()&&1===e){this._snapPoint45Degree(t,this.points()[0])}if(2===e)this._points[1].index=t.index;else if(3===e)return this._points[0].index=t.index,this._points[2].price=t.price,void this.normalizePoints();n.prototype.setPoint.call(this,e,t)},o.prototype.getPoint=function(e){return e<3?n.prototype.getPoint.call(this,e):3===e?{index:this._points[0].index,price:this._points[2].price}:void 0},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){var e=this._points[0],t=this._points[1],i=[];e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e));var n=this._points[2];n.time=t.time,n.index=t.index;var r,o,s,a,l={price:n.price,time:e.time,index:e.index},c=[];n.index<=l.index?(c.push(n),c.push(l)):(c.push(l),c.push(n)),i[0].price>c[0].price?(r=i,o=c):c[0].price>i[0].price||c[1].price>i[1].price?(r=c,o=i):(r=i,o=c);var u=this.properties().extendLeft.value(),h=this.properties().extendRight.value();return e.index<=t.index?(s=u,a=h):(s=h,a=u),[this._linePointsToAlertPlot(r,"Upper",s,a),this._linePointsToAlertPlot(o,"Lower",u,a)]},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("vm8R").GeneralTrendFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o.createProperties=function(e){var t=new r("linetoolflatbottom",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},t.LineToolFlatBottom=o},J2xC:function(e,t,i){e.exports={"css-value-header-toolbar-height":"38px"}},JOqt:function(e,t,i){"use strict";i.r(t),i.d(t,"debounce",(function(){return n}));var n=function(e,t){var i,n,r=0;function o(){e.apply(n,i)}return function(){n=this,i=arguments,clearTimeout(r),r=setTimeout(o,t)}}},JT5O:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyMarket",(function(){return o}));var n=i("hY0g"),r=i.n(n),o=function(){function e(e,t){this._visibility=new r.a(!1),this._dialogPromise=null,this._dialog=null,this._chartWidgetCollection=e,this._options=t}return e.prototype.visible=function(){return this._visibility.readonly()},e.prototype.show=function(e){var t ;null===this._dialog&&this._requestDialog(e),null===(t=this._dialog)||void 0===t||t.open(e)},e.prototype.hide=function(){var e;null===(e=this._dialog)||void 0===e||e.hide()},e.prototype.onCustomScriptModified=function(){var e;null===(e=this._dialog)||void 0===e||e.updateUserStudies()},e.prototype.resetAllPages=function(){var e;null===(e=this._dialog)||void 0===e||e.resetAllStudies()},e.prototype._requestDialog=function(e){var t=this;if(null===this._dialogPromise){var n=void 0;n=Promise.all([i.e("react"),i.e(1),i.e(2),i.e(5),i.e(7),i.e(10),i.e(12),i.e(15),i.e(27),i.e(69),i.e(70),i.e(77),i.e(0),i.e(4),i.e("study-market")]).then(i.bind(null,"zbLM")).then((function(e){return new e.IndicatorsLibraryContainer(t._chartWidgetCollection,t._options)})),this._dialogPromise=n.then((function(i){t._dialog=i,t._dialog.visible().subscribe((function(e){t._visibility.setValue(e)})),t._dialog.open(e)}))}return this._dialogPromise},e}()},JWMC:function(e,t,i){"use strict";i.r(t),i.d(t,"trackEvent",(function(){return l}));i("bSeV");var n=i("FQhm"),r=i("Kxc7"),o=i("txPx"),s=Object(o.getLogger)("Common.TrackEvent"),a=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/],l=function(e,t,i){if(r.enabled("charting_library_base"))!function(e,t,i){t=t||e||i||"";for(var r="",o=0;o=22)return t;for(var i={},n=0,r=0;;){var o=t[r];if(void 0===o)break;var s=t[o.id];o.isFake&&(o.id="in_"+n++),i[r]=o,i[o.id]=s,r++}return i}]}u.prototype.updateMetaInfo=function(e){if(!e)return e;n(!e.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync");for(var t=null,i=this._studiesMetainfo,r=0;r=12&&l<=26){var c={};for(s=0;s=12&&c<=26){var h=r.columns;r.columns=[];for(var d=0;dt&&o.logWarn("Bad integer input max value in metaInfo id="+e.id+" title="+e.description))}},u._fixInputsMaxValue=function(e,t){if(!TradingView.isAbsent(t)){var i=u.INPUT_MAX_VALUE;if(t.inputs)for(var n=0;ni&&(a.max=i))}if(e&&e.inputs){var r=u.splitInputs(e.inputs),o=r.arr;for(var s in o){var a;"integer"===(a=o[s]).type&&(a.max&&a.max>i&&(a.max=i))}e.inputs=TradingView.merge(r.obj,r.arr)}}},u.prototype.patchPropsStateAndMetaInfo=function(e,t,i){"Script$BOOKER"!==t.productId||t.alerts||delete e.alerts,u._fixInputsOrder(e,t),u._fixInputsMaxValue(e,t);var n=u.splitInputs(e.inputs);e.inputs=n.obj;var r=a.versionOf(t);ri&&(i=r))}e[i+1]=t},u.splitInputs=function(e){var t={},i={};for(var n in e)isNumber(parseInt(n,10))?t[n]=e[n]:i[n]=e[n];return{arr:t,obj:i}},u.findInputKeyById=function(e,t){var i=null;for(var n in e)if(isNumber(parseInt(n,10))&&e[n].id===t){i=n;break}return i},u.getInputKeyById=function(e,t){var i=u.findInputKeyById(e,t);if(!i)throw new Error("Cannot find input with id: "+t);return i},e.exports=u},K8V9:function(e,t){e.exports=''},K9GE:function(e,t,i){"use strict";i.d(t,"c",(function(){return n})),i.d(t,"d",(function(){return r})),i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return s}));const n=350,r={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1+--e*e*e*e*e,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e};class o{ constructor(e,t,i,n){this._mX1=e,this._mY1=t,this._mX2=i,this._mY2=n}easingFunc(e){return this._mX1===this._mY1&&this._mX2===this._mY2?e:this._calcBezier(this._getTForX(e))}_a(e,t){return 1-3*t+3*e}_b(e,t){return 3*t-6*e}_c(e){return 3*e}_calcBezier(e){return((this._a(this._mY1,this._mY2)*e+this._b(this._mY1,this._mY2))*e+this._c(this._mY1))*e}_getSlope(e){return 3*this._a(this._mX1,this._mX2)*e*e+2*this._b(this._mX1,this._mX2)*e+this._c(this._mX1)}_getTForX(e){let t=e;for(let i=0;i<4;++i){const i=this._getSlope(t);if(0===i)return t;t-=(this._calcBezier(t)-e)/i}return t}}const s={black0:"#000",black20:"#2b2d36",black25:"#2b2e37",black27:"#2f3241",black30:"#212121",black70:"#4A4A4A",black80:"#535353",black100:"#646464",black110:"#757575",black140:"#8A8A8A",black170:"#ADAEB0",black180:"#b4b4b4",black200:"#C8C8C8",black220:"#DADDE0",black230:"#ECECEC",black240:"#F2F2F2",black248:"#F8F8F8",black255:"#FFF",brand:"#3BB3E4",brandHover:"#3BABD8",brandActive:"#3898C2",brandDown:"#049DDC",brand220:"#3BB3E0",brand255:"#3BB3FF",brandNew:"#37A6EF",brandNew2:"#2196F3",spinner:"#00A2E2",brandMedium80:"#3C4650",brandMedium90:"#465a6e",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",growing:"#37bc9b",falling:"#ff4a68"}},"KG+6":function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return a}));i("mrSG");var n,r,o=i("Eyy1"),s=i("tqok");i("hsV8");function a(e,t){if(e.firstBarTime>=t.length||e.lastBarTime>=t.length)return null;var i=t[e.firstBarTime],n=t[e.lastBarTime];return i===s.a||n===s.a?null:(Object(o.assert)(i<=n,"firstBarTime should not exceed lastBarTime"),Object(o.assert)(e.priceLow<=e.priceHigh,"priceLow should not exceed priceHigh"),{firstBarTime:i,lastBarTime:n,rate:e.rate,priceHigh:e.priceHigh,priceLow:e.priceLow})}!function(e){e.LeftToRight="left_to_right",e.RightToLeft="right_to_left"}(n||(n={})),function(e){e.Relative="relative",e.Absolute="absolute"}(r||(r={}))},KUek:function(e,t,i){"use strict";i.r(t);var n,r,o=i("mrSG"),s=i("Eyy1"),a=i("aIyQ"),l=i.n(a),c=i("k9/m"),u=i("hsV8"),h=i("jy4L"),d=i("w4Ji"),p=i("jenN"),f=i("txPx"),_=Object(f.getLogger)("Chart.StudyDataSource");!function(e){e[e.Undefined=0]="Undefined",e[e.Loading=1]="Loading",e[e.Completed=2]="Completed",e[e.Error=3]="Error"}(n||(n={})),function(e){e[e.Idle=0]="Idle",e[e.AwaitingConnection=1]="AwaitingConnection",e[e.AwaitingParent=2]="AwaitingParent",e[e.AwaitingFirstDataUpdate=3]="AwaitingFirstDataUpdate",e[e.Active=4]="Active"}(r||(r={}));var m=function(){function e(e,t,i,o){this._inputs=null,this._status=r.Idle,this._studyId=null,this._turnaroundCounter=1,this._studyStatus={ type:n.Undefined},this._studyStatusChanged=new l.a,this._graphics=new p.LiveStudyGraphics,this._dataCleared=new l.a,this._dataUpdated=new l.a,this._boundOnGatewayIsConnectedChanged=this._onGatewayIsConnectedChanged.bind(this),this._ongoingDataUpdate=Promise.resolve(),this._gateway=e,this._metaInfo=o,this._series=t,this._turnaroundPrefix=i,this._plots=new c.PlotList(Object(d.studyPlotFunctionMap)(o),d.studyEmptyPlotValuePredicate),this._gateway.isConnected().subscribe(this._boundOnGatewayIsConnectedChanged)}return e.prototype.destroy=function(){this.stop(),this._gateway.isConnected().unsubscribe(this._boundOnGatewayIsConnectedChanged),this._dataUpdated.destroy(),this._dataCleared.destroy(),this._studyStatusChanged.destroy()},e.prototype.metaInfo=function(){return this._metaInfo},e.prototype.inputs=function(){return this._inputs},e.prototype.setInputs=function(e){this._inputs=e,null!==this._studyId&&(this._turnaroundCounter++,this._onStudyStatusChangedTo({type:n.Undefined}),this._gateway.modifyStudy(this._studyId,this._turnaround(),e,this._onMessage.bind(this)),this._status===r.Active&&this._changeStatusTo(r.AwaitingFirstDataUpdate))},e.prototype.isStarted=function(){return this._status!==r.Idle},e.prototype.isActive=function(){return this._status===r.Active},e.prototype.start=function(){this.isStarted()?_.logNormal("start: data source is already started, nothing to do"):(Object(s.assert)(null!==this._inputs,"Inputs should be defined when starting a study data source"),this._gateway.isConnected().value()?this._createStudy():this._changeStatusTo(r.AwaitingConnection))},e.prototype.stop=function(){this.isStarted()?(null!==this._studyId&&(this._gateway.removeStudy(this._studyId),this._studyId=null,this._onStudyStatusChangedTo({type:n.Undefined})),this._changeStatusTo(r.Idle)):_.logNormal("stop: data source is already stopped, nothing to do")},e.prototype.studyId=function(){return this._studyId},e.prototype.studyStatus=function(){return this._studyStatus},e.prototype.studyStatusChanged=function(){return this._studyStatusChanged},e.prototype.plots=function(){return this._plots},e.prototype.graphics=function(){return this._graphics},e.prototype.clearData=function(){this._plots.clear(),this._graphics.clear(),this._dataCleared.fire()},e.prototype.stopAndStealData=function(){Object(s.assert)(this._status===r.Active,"Couldn't steal data from non-active data source"),this.stop();var e=this._plots,t=this._graphics.extract();return this._plots=new c.PlotList(Object(d.studyPlotFunctionMap)(this._metaInfo),d.studyEmptyPlotValuePredicate),{plots:e,graphics:t}},e.prototype.dataCleared=function(){return this._dataCleared},e.prototype.dataUpdated=function(){return this._dataUpdated},e.prototype._changeStatusTo=function(e){Object(s.assert)(this._status!==e,"Source and destination status should be distinct"),_.logNormal("Status changed from "+r[this._status]+" to "+r[e]),this._status=e},e.prototype._createStudy=function(){var e=this._series.seriesId();null!=e?this._createStudyUsingParentId(e):(this._changeStatusTo(r.AwaitingParent), this._series.dataEvents().completed().subscribe(this,this._onSeriesCompleted,!0))},e.prototype._createStudyUsingParentId=function(e){Object(s.assert)(this._status!==r.Active,'Status should not be "Active" when creating a study'),Object(s.assert)(this._studyStatus.type===n.Undefined,'Study status should be "Undefined" when creating a study'),Object(s.assert)(null===this._studyId,"Study id should be empty when creating a study"),this._studyId=Object(h.makeNextStudyId)(),this._gateway.createStudy(this._studyId,this._turnaround(),e,this._metaInfo.fullId+"!",Object(s.ensureNotNull)(this._inputs),this._onMessage.bind(this)),this._changeStatusTo(r.AwaitingFirstDataUpdate)},e.prototype._onGatewayIsConnectedChanged=function(e){e?this._onGatewayConnected():this._onGatewayDisconnected()},e.prototype._onGatewayConnected=function(){this._status===r.AwaitingConnection&&this._createStudy()},e.prototype._onGatewayDisconnected=function(){this._status!==r.Idle&&this._status!==r.AwaitingConnection&&(this._studyId=null,this._changeStatusTo(r.AwaitingConnection),this._studyStatus.type!==n.Undefined&&this._onStudyStatusChangedTo({type:n.Undefined})),this._turnaroundCounter=1},e.prototype._onSeriesCompleted=function(){this._status===r.AwaitingParent&&this._createStudyUsingParentId(Object(s.ensure)(this._series.seriesId()))},e.prototype._onStudyStatusChangedTo=function(e){var t=this._studyStatus;this._studyStatus=e,_.logNormal("Study status type changed from "+n[t.type]+" to "+n[e.type]),this._studyStatusChanged.fire(t,e)},e.prototype._onMessage=function(e){if("data_update"===e.method){var t=e.params,i=t.customId,n=t.turnaround,r=t.plots,o=t.nonseries;i===this._studyId&&this._checkTurnaround(n)&&this._onDataUpdate(r,o)}else if("study_loading"===e.method){var s=e.params,a=(i=s[0],n=s[1],s[2]);i===this._studyId&&this._checkTurnaround(n)&&this._onStudyLoading(a)}else if("study_completed"===e.method){var l=e.params;i=l[0],n=l[1],a=l[2];i===this._studyId&&this._checkTurnaround(n)&&this._onStudyCompleted(a)}else if("study_error"===e.method){var c=e.params,u=(i=c[0],n=c[1],c[2]),h=c[3];a=c[4];i===this._studyId&&this._checkTurnaround(n)&&this._onStudyError(u,h,a)}},e.prototype._onDataUpdate=function(e,t){var i=Object(u.unpackNonSeriesData)(t.d);return this._ongoingDataUpdate=this._ongoingDataUpdate.then((function(){return i}),(function(){return i})).then(this._onDataUnpacked.bind(this,e,t.indexes)),this._ongoingDataUpdate},e.prototype._onDataUnpacked=function(e,t,i){this._status!==r.Idle&&(this._status===r.AwaitingFirstDataUpdate&&(this._changeStatusTo(r.Active),this.clearData()),this._mergePlots(e),null!==i&&(i.indexes_replace?(Object(s.assert)("nochange"!==t),this._graphics.replaceIndexesTo(t)):("nochange"!==t&&this._graphics.replaceIndexesTo(t),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds,this._metaInfo.graphics))),this._dataUpdated.fire(e,i,t))},e.prototype._onStudyLoading=function(e){this._onStudyStatusChangedTo({type:n.Loading,startTime:Date.now()})},e.prototype._onStudyError=function(e,t,i){this.clearData(), this._onStudyStatusChangedTo({type:n.Error,reason:e})},e.prototype._onStudyCompleted=function(e){this._onStudyStatusChangedTo({type:n.Completed})},e.prototype._mergePlots=function(e){this._plots.merge(e)},e.prototype._turnaround=function(){return""+this._turnaroundPrefix+this._turnaroundCounter},e.prototype._checkTurnaround=function(e){var t=this._turnaround();return e===t||e===this._series.turnaround()||e===this._series.turnaround()+"_"+t},e}(),v=i("kcTO"),y=i("Ocx9"),g=i("oV8k"),b=i("Kxc7");i.d(t,"sessionsPreferencesDefault",(function(){return w})),i.d(t,"Sessions",(function(){return P}));var S=new v.PriceFormatter,w={graphics:{backgrounds:{outOfSession:{color:"#2196F3",transparency:92,visible:!1},preMarket:{color:"#FF9800",transparency:92,visible:!1},postMarket:{color:"#2196F3",transparency:92,visible:!1}},vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}}},P=function(e){function t(t,i,n){var r=e.call(this,t,i)||this;r._studySource=null,r._paneViews=[],r._metaInfo=null,r._destroyed=!1,r._isStarted=!1,r._loadedGraphics=null,r._doubleClickHandler=n;var o=i.mainSeries();return r._properties=new y.DefaultProperty("sessions"),r._removeDuplicateProperties(),r._properties.subscribe(r,r._onPropertiesChanged),i.studyMetaInfoRepository().findById({type:"java",studyId:"Sessions@tv-basicstudies"}).then((function(e){r._destroyed||null===r._loadedGraphics&&(r._setMetaInfo(e),null!==r._metaInfo&&(r._studySource=new m(i.chartApi(),o,"sessions_",r._metaInfo),r._createPaneViews(),r._studySource.dataCleared().subscribe(r,r.updateAllViews),r._studySource.dataUpdated().subscribe(r,r.updateAllViews),r._studySource.setInputs({}),r._processHibernate()))})),i.timeScale().onReset().subscribe(r,r._clearData),i.timeScale().logicalRangeChanged().subscribe(r,r.updateAllViews),i.mainSeries().properties().extendedHours.subscribe(r,r._updateVisibleOfPreAndPostMarketBackground),i.mainSeries().properties().interval.subscribe(r,r._processHibernate),r._updateVisibleOfPreAndPostMarketBackground(i.mainSeries().properties().extendedHours),r}return Object(o.c)(t,e),t.prototype.start=function(){this._isStarted=!0,this._processHibernate()},t.prototype.restart=function(){this._clearData(),b.enabled("stop_study_on_restart")&&this.stop(),this.start()},t.prototype.isStarted=function(){return this._isStarted},t.prototype.stop=function(){this._isStarted=!1,null!==this._studySource&&this._studySource.stop()},t.prototype.isHoveredEnabled=function(){return!1},t.prototype.paneViews=function(e){return this._paneViews},t.prototype.updateAllViews=function(){this._paneViews.forEach((function(e){return e.update()}))},t.prototype.updateViewsForPane=function(e){this.updateAllViews()},t.prototype.destroy=function(){this._destroyed=!0,null!==this._studySource&&(this._studySource.dataCleared().unsubscribe(this,this.updateAllViews),this._studySource.dataUpdated().unsubscribe(this,this.updateAllViews),this._studySource.destroy(),this._studySource=null),this._model.timeScale().logicalRangeChanged().unsubscribe(this,this.updateAllViews), this._model.timeScale().onReset().unsubscribe(this,this._clearData),this._model.mainSeries().properties().extendedHours.unsubscribe(this,this._updateVisibleOfPreAndPostMarketBackground),this._model.mainSeries().properties().interval.unsubscribe(this,this._processHibernate),this._properties.unsubscribe(this,this._onPropertiesChanged)},t.prototype.series=function(){return this._model.mainSeries()},t.prototype.priceScale=function(){return this.series().priceScale()},t.prototype.graphics=function(){return this._loadedGraphics||Object(s.ensureNotNull)(this._studySource).graphics()},t.prototype.properties=function(){return this._properties},t.prototype.graphicsInfo=function(){return Object(s.ensureNotNull)(this._metaInfo).graphics},t.prototype.firstValue=function(e){return this._model.mainSeries().firstValue()},t.prototype.formatter=function(){return S},t.prototype.state=function(e){var t={properties:this._properties.state()};return e&&null!==this._metaInfo&&(t.data={graphics:Object(p.saveStudyGraphics)(this.graphics()),metaInfo:this._metaInfo}),t},t.prototype.restoreState=function(e,t){var i=e.properties;this._migrateOutOfSessionProperty(i),this._properties.mergeAndFire(i),this._removeDuplicateProperties(),this._updateVisibleOfPreAndPostMarketBackground(this._model.mainSeries().properties().extendedHours),void 0!==e.data&&t&&(this._loadStudyGraphics(e.data.graphics),this._setMetaInfo(e.data.metaInfo),this._createPaneViews())},t.prototype.restoreOldState=function(e,t){var i={properties:{graphics:e.state.graphics}};void 0!==e.data&&void 0!==e.metaInfo&&t&&(i.data={metaInfo:e.metaInfo,graphics:e.data.graphics}),this.restoreState(i,t)},t.prototype.applyPreferences=function(e){this._properties.mergePreferences(e)},t.prototype.metaInfo=function(){return Object(s.ensureNotNull)(this._metaInfo)},t.prototype._loadStudyGraphics=function(e){var t=e.backgrounds;if(void 0!==t){var i=t.findIndex((function(e){return"inSession"===e.styleId}));-1!==i&&t.splice(i,1)}this._loadedGraphics=Object(p.loadStudyGraphics)(e)},t.prototype._setMetaInfo=function(e){var t=e.graphics.backgrounds;void 0!==t&&void 0!==t.inSession&&delete t.inSession,this._metaInfo=e},t.prototype._updateVisibleOfPreAndPostMarketBackground=function(e){var t=e.value();this._outOfSessionVisibilityProperty().setValue(t),this._preMarketVisibilityProperty().setValue(t),this._postMarketVisibilityProperty().setValue(t)},t.prototype._clearData=function(){null!==this._studySource&&this._studySource.clearData()},t.prototype._createPaneViews=function(){var e=this,t={doubleClickHandler:this._doubleClickHandler};Object(p.createGraphicsPaneViews)(this,this._model,t).then((function(t){e._paneViews=t,e._model.lightUpdate()}))},t.prototype._onPropertiesChanged=function(){this._processHibernate(),this.updateAllViews()},t.prototype._processHibernate=function(){if(null!==this._studySource){var e=this._canBeHibernated(),t=this._isHibernated(),i=this._studySource.isStarted();!t&&e&&i?this._studySource.stop():!t||e||i||this._studySource.start()}},t.prototype._canBeHibernated=function(){ var e=this._model.mainSeries(),t=this._preMarketVisibilityProperty().value()&&this._postMarketVisibilityProperty().value()&&this._outOfSessionVisibilityProperty().value();return e.isDWM()||!t&&!this._vertLinesVisibleProperty().value()},t.prototype._isHibernated=function(){return this._isStarted&&(null===this._studySource||!this._studySource.isStarted())},t.prototype._outOfSessionVisibilityProperty=function(){return this._properties.childs().graphics.childs().backgrounds.childs().outOfSession.childs().visible},t.prototype._preMarketVisibilityProperty=function(){return this._properties.childs().graphics.childs().backgrounds.childs().preMarket.childs().visible},t.prototype._postMarketVisibilityProperty=function(){return this._properties.childs().graphics.childs().backgrounds.childs().postMarket.childs().visible},t.prototype._vertLinesVisibleProperty=function(){return this._properties.childs().graphics.childs().vertlines.childs().sessBreaks.childs().visible},t.prototype._removeDuplicateProperties=function(){this._properties.hasChild("properties")&&(this._properties.removeProperty("properties"),Object(y.saveDefaultProperties)(!0),this._properties.childChanged("",null),Object(y.saveDefaultProperties)(!1))},t.prototype._migrateOutOfSessionProperty=function(e){var t=e.graphics.backgrounds;if(void 0!==t){var i=t.outOfSession;i.color===Object(s.ensureDefined)(w.graphics.backgrounds).outOfSession.color||"postMarket"in t||(e.graphics.backgrounds=Object(o.a)(Object(o.a)({},t),{postMarket:{color:i.color,transparency:i.transparency,visible:i.visible},preMarket:{color:i.color,transparency:i.transparency,visible:i.visible}}))}},t}(g.CustomSourceBase)},KcY8:function(e,t,i){"use strict";var n=i("mrSG"),r=i("aO4+"),o=i("f6yo"),s=i("VaSN"),a=i("Tmoa"),l=i("Ialn"),c=i("8Uy/"),u=i("jFln"),h=i("ikwP"),d=i("VdBB"),p=function(){function e(e,t){this.setData(e,t)}return e.prototype.setData=function(e,t){this._data=Object(n.a)({},e),this._commonData=Object(n.a)({},t)},e.prototype.draw=function(e,t,i,n,r,o){if(this._data.visible){e.font=t.font;var s,d=Math.floor((this._data.tickVisible?t.tickLength:0)*o),p=Math.floor((this._data.borderVisible?t.borderSize:0)*o),f=Math.floor(t.paddingTop*o),_=Math.floor(t.paddingBottom*o),m=Math.floor(t.paddingInner*o),v=Math.floor(t.paddingOuter*o),y=this._data.text,g=Math.round(t.baselineOffset*o),b=void 0!==this._data.labelIcon,S=Math.max(1,Math.floor(o)),w=Math.floor(t.fontSize*o)+f+_;if(w%2!=S%2&&(w+=1),b)s=w;else{var P=Math.ceil(i.measureText(e,y));s=Math.round(P*o)+d+p+m+v}var C=this._commonData.coordinate;this._commonData.fixedCoordinate&&(C=this._commonData.fixedCoordinate);var T,x,I="right"===r,L=this._getOffsetScaled(I,n,o),O=Math.ceil(n*o),M=I?O:0,A=M;e.fillStyle=Object(a.resetTransparency)(this._commonData.background),e.lineWidth=1,Object(u.setLineStyle)(e,c.LINESTYLE_SOLID),e.lineCap="butt";var k=Math.round(C*o)-Math.floor(.5*o),E=Math.floor(k+S/2-w/2),V=E+w;if(y||b){if(I?(T=M-d,x=(A=M-s)+v):(A=M+s,T=M+d,x=M+p+d+m),M+=L,A+=L,T+=L,e.beginPath(),e.moveTo(M,E),e.lineTo(A,E),e.lineTo(A,V),e.lineTo(M,V), e.fill(),0!==L&&this._data.fillOffset){e.fillStyle=t.paneBackgroundColor;var D=I?Math.ceil(n*o)+1:0;e.beginPath(),e.moveTo(M,E),e.lineTo(D,E),e.lineTo(D,V),e.lineTo(M,V),e.fill()}if(b){switch(this._data.labelIcon){case 0:this._drawPlusIcon(e,M,A,E,k,V,S)}return}this._data.tickVisible&&(e.fillStyle=this._commonData.color,e.fillRect(M,k,T-M,S)),e.textAlign="left",e.fillStyle=this._commonData.color,Object(h.drawScaled)(e,o,(function(){e.fillText(y,(x+L)/o,(V-_-g)/o)}))}if(this._data.secondLine){var B=Math.ceil(i.measureText(e,this._data.secondLine)*o)+m+v;e.fillStyle=Object(a.resetTransparency)(this._commonData.background),this._data.text&&(E+=w+S,V+=w+S),I?(M=(A=Math.min(A,O-B))+B,x=A+v):(A=(M=Math.max(A-B,p))+B,x=M+m),M+=L,A+=L,e.beginPath(),e.moveTo(M,E),e.lineTo(A,E),e.lineTo(A,V),e.lineTo(M,V),e.fill(),e.textAlign="left",e.fillStyle=this._commonData.color;var R=this._data.secondLine;Object(h.drawScaled)(e,o,(function(){e.fillText(Object(l.startWithLTR)(R),(x+L)/o,(V-_-g)/o)}))}}},e.prototype.height=function(e,t){if(!this._data.visible)return 0;var i=e.fontSize+e.paddingTop+e.paddingBottom;return this._data.secondLine&&t?2*i+1:i},e.prototype.hitTest=function(e){var t=this._data.hitTestData;if(void 0===t||!this._data.visible)return null;var i=this._data.offset,n=Object(s.lastEventIsTouch)()?10:0,a=Object(r.box)(new r.Point(t.xl+i-n,t.y-n),new r.Point(t.xl+i+t.containerWidth+n,t.y+t.containerHeight+n)),l=t.left&&Object(o.pointInBox)(e,a),c=Object(r.box)(new r.Point(t.xr-i-n,t.y-n),new r.Point(t.xr-i+t.containerWidth+n,t.y+t.containerHeight+n)),u=t.right&&Object(o.pointInBox)(e,c);if(l||u){var h=l?"left":"right";return new d.HitTestResult(d.HitTestResult.CUSTOM,{clickHandler:void 0===t.clickHandler?void 0:t.clickHandler.bind(this,e,h),tapHandler:void 0===t.clickHandler?void 0:t.clickHandler.bind(this,e,h),tooltip:t.tooltip})}return null},e.prototype._getOffsetScaled=function(e,t,i){var n=e?-1:1,r=0===this._data.offset?0:n*this._data.offset,o=0===r?0:n*Math.max(1,Math.round(Math.abs(r)*i));return e&&t*i%1!=0&&(o=n*(Math.abs(o)+1)),o},e.prototype._drawPlusIcon=function(e,t,i,n,r,o,s){e.fillStyle=this._commonData.color;var a=Math.abs(t-i),l=Math.round(.5*a);l%2!=s%2&&(l+=1);var c=Math.floor((a-l)/2),u=Math.min(t,i),h=u+Math.floor(a/2-s/2);e.fillRect(u+c,r,l,s),e.fillRect(h,n+c,s,l)},e}();i.d(t,"a",(function(){return f}));var f=function(){function e(e){this._commonRendererData={coordinate:0,color:"#FFF",background:"#000"},this._axisRendererData={text:"",visible:!1,tickVisible:!0,borderVisible:!0,offset:0},this._paneRendererData={text:"",visible:!1,tickVisible:!1,borderVisible:!1,offset:1,fillOffset:!0},this._invalidated=!0,this._axisRenderer=new(e||p)(this._axisRendererData,this._commonRendererData),this._paneRenderer=new(e||p)(this._paneRendererData,this._commonRendererData)}return e.prototype.text=function(){return this._axisRendererData.text},e.prototype.secondLineText=function(){return this._axisRendererData.secondLine},e.prototype.background=function(){return this._commonRendererData.background}, e.prototype.color=function(){return this.generateTextColor(this.background())},e.prototype.generateTextColor=function(e){return Object(a.colorFromBackground)(e)},e.prototype.coordinate=function(){return this._updateRendererDataIfNeeded(),this._commonRendererData.coordinate},e.prototype.floatCoordinate=function(){return this._updateRendererDataIfNeeded(),this._commonRendererData.floatCoordinate||this._commonRendererData.coordinate},e.prototype.update=function(){this._invalidated=!0},e.prototype.height=function(e,t){return void 0===t&&(t=!1),this._updateRendererDataIfNeeded(),Math.max(this._axisRenderer.height(e,t),this._paneRenderer.height(e,t))},e.prototype.getFixedCoordinate=function(){return this._commonRendererData.fixedCoordinate||0},e.prototype.setFixedCoordinate=function(e){this._commonRendererData.fixedCoordinate=e},e.prototype.isVisible=function(){return this._updateRendererDataIfNeeded(),this._axisRendererData.visible||this._paneRendererData.visible},e.prototype.isAxisLabelVisible=function(){return this._updateRendererDataIfNeeded(),this._axisRendererData.visible},e.prototype.isPaneLabelVisible=function(){return this._updateRendererDataIfNeeded(),this._paneRendererData.visible},e.prototype.renderer=function(){return this._updateRendererDataIfNeeded(),this._axisRenderer},e.prototype.paneRenderer=function(){return this._updateRendererDataIfNeeded(),this._paneRenderer},e.prototype.setPaneRendererLabelIcon=function(e){this._paneRendererData.labelIcon=e},e.prototype.setPaneLabelVisible=function(e){this._paneRendererData.visible=e,this._invalidated=!0},e.prototype._updateRendererDataIfNeeded=function(){this._invalidated&&(this._updateRendererData(this._axisRendererData,this._paneRendererData,this._commonRendererData),this._invalidated=!1),this._axisRenderer.setData(this._axisRendererData,this._commonRendererData),this._paneRenderer.setData(this._paneRendererData,this._commonRendererData)},e}()},Kdr6:function(e,t,i){"use strict";i.r(t),i.d(t,"HHistLegendView",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._showStudyValues=i.properties().paneProperties.legendProperties.showStudyValues,n}return Object(n.c)(t,e),t.prototype.isValuesVisible=function(){return this._showStudyValues.value()},t.prototype.additional=function(){return null},t.prototype.destroy=function(){},t}(i("TG9i").HHistDataWindowView)},Kmdw:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererArrowUp",(function(){return l})),i.d(t,"PaneRendererArrowDown",(function(){return c}));var n=i("mrSG"),r=i("2WC2"),o=i("aO4+"),s=i("Hr11"),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._sign=0,t._thinArrow=!1,t._thinArrowLineWidth=0,t._headHeight=0,t._arrowWidth=0,t}return Object(n.c)(t,e),t.prototype.setData=function(e,t){this._setBaseData(e,t)},t.prototype._drawItemShape=function(e,t,i){ var n=t.pixelRatio,r=this._lineWidth(t)%2?.5:0,o=this._sign,a=this._arrowWidth,l=this._headHeight,c=Math.abs(i.height),u=Math.round(i.x*n)+r,h=i.vertOffset,d=Math.round((i.y+h+o*c/2)*n)+r,p=Object(s.ceiledEven)(a*n),f=p/2,_=Math.round(c*n),m=Math.round(l*n);e.translate(u,d),this._thinArrow?(e.moveTo(0,0),e.lineTo(-f,-f*o),e.moveTo(0,0),e.lineTo(f,-f*o),e.moveTo(0,0),e.lineTo(0,-_*o),e.moveTo(-f,-_*o),e.lineTo(f,-_*o)):(e.moveTo(0,0),_0&&(this._kind=e,this._multiplier=t)}return e.prototype.kind=function(){return this._kind},e.prototype.multiplier=function(){return this._multiplier},e.prototype.isValid=function(){return this.kind()!==n.Invalid&&this.multiplier()>0},e.prototype.isDWM=function(){return this.isValid()&&!this.isRange()&&!this.isIntraday()&&!this.isTicks()},e.prototype.isIntraday=function(){var e=c.has(this.kind());return this.isValid()&&e},e.prototype.isSeconds=function(){return this.kind()===n.Seconds},e.prototype.isMinutes=function(){return this.kind()===n.Minutes},e.prototype.isMinuteHours=function(){return this.kind()===n.Minutes&&d(this.multiplier())},e.prototype.isDays=function(){return this.kind()===n.Days},e.prototype.isWeeks=function(){return this.kind()===n.Weeks},e.prototype.isMonths=function(){return this.kind()===n.Months},e.prototype.isRange=function(){return this.kind()===n.Range},e.prototype.isTicks=function(){return this.kind()===n.Ticks},e.prototype.isTimeBased=function(){return!this.isRange()},e.prototype.letter=function(){return this.isValid()&&this.kind()!==n.Minutes?this.kind()[0].toUpperCase():""},e.prototype.value=function(){return this.isValid()?this.kind()===n.Minutes?this.multiplier()+"":this.multiplier()+this.letter():""},e.prototype.isEqualTo=function(t){if(!(t instanceof e))throw new Error("Argument is not an Interval");return!(!this.isValid()||!t.isValid())&&(this.kind()===t.kind()&&this.multiplier()===t.multiplier())},e.prototype.inMilliseconds=function(e){if(void 0===e&&(e=Date.now()),!this.isValid()||this.isRange())return NaN;if(this.isMonths()){var t=new Date(e);return t.setUTCMonth(t.getUTCMonth()+(this.multiplier()||1)),+t-e}var i=this.multiplier();return a[this.kind()]*i},e.isEqual=function(t,i){return e.parse(t).isEqualTo(e.parse(i))},e.parse=function(t){t=(t+"").toUpperCase().split(",")[0];var i=o.exec(t) ;return null!==i?"H"===i[2]?new e(n.Minutes,60*h(i[1])):new e(l[i[2]],h(i[1])):null!==(i=s.exec(t))?new e(n.Minutes,h(i[1])):new e(n.Invalid,0)},e.kind=function(t){return e.parse(t).kind()},e.isValid=function(t){return e.parse(t).isValid()},e.isDWM=function(t){return e.parse(t).isDWM()},e.isIntraday=function(t){return e.parse(t).isIntraday()},e.isSeconds=function(t){return e.parse(t).isSeconds()},e.isMinutes=function(t){return e.parse(t).isMinutes()},e.isMinuteHours=function(t){return e.parse(t).isMinuteHours()},e.isDays=function(t){return e.parse(t).isDays()},e.isWeeks=function(t){return e.parse(t).isWeeks()},e.isMonths=function(t){return e.parse(t).isMonths()},e.isRange=function(t){return e.parse(t).isRange()},e.isTicks=function(t){return e.parse(t).isTicks()},e.isTimeBased=function(t){return e.parse(t).isTimeBased()},e.normalize=function(t){var i=e.parse(t);return i.isValid()?i.value():null},e}();function h(e){return 0===e.length?1:parseInt(e,10)}function d(e){return e>=60&&!(e%60)}},"M/W+":function(e,t,i){"use strict";i.r(t),i.d(t,"replaceGraphicsTimesToSeriesIndexes",(function(){return s}));var n=i("Y7w9"),r=new Map([["horizlines",function(e){return[e.startIndex,e.endIndex]}],["hhists",function(e){return[e.firstBarTime,e.firstBarTime]}],["vertlines",function(e){return[e.index]}]]),o=new Map([["horizlines",function(e,t){var i=e;i.startIndex=t.get(i.startIndex),i.endIndex=t.get(i.endIndex)}],["hhists",function(e,t){var i=e;i.firstBarTime=t.get(i.firstBarTime),i.lastBarTime=t.get(i.lastBarTime)}],["vertlines",function(e,t){var i=e;i.index=t.get(i.index)}]]);function s(e,t){var i=e.data&&e.data.graphicsCmds&&e.data.graphicsCmds.create;if(null!==t&&0!==t.length&&i){var s=new Map,a=new Set;r.forEach((function(e,t){var n=i[t];if(n)for(var r=0,o=n;r0&&(!function(e,t){for(var i=e.length,r=t.length,o=Object(n.lowerbound)(t,e[0],(function(e,t){return e.value[0]=r?e[s]=t[r-1].index:e[s]=t[o].index}}(l,t),e.indexes=l)}}},"M7/j":function(e,t,i){"use strict";i.r(t),i.d(t,"itemsRangeIsValid",(function(){return h})),i.d(t,"splitItems",(function(){return d})),i.d(t,"PaneRendererBaseline",(function(){return p}));var n=i("mrSG"),r=i("aO4+"),o=i("hBTJ"),s=i("GEp6"),a=i("Zp/P"),l=i("Y7w9"),c=i("cPgM"),u=i("VdBB");function h(e){if(0===e.length)return!1;var t=e.findIndex((function(e){return Object(a.coordinateIsValid)(e.y)}));if(-1===t)return!1;for(var i=e.length-1;i>t&&!Object(a.coordinateIsValid)(e[i].y);)i--;return!(t>=i)}function d(e,t){for(var i=[],n=[],s=null,l=0;l=t&&n.push(c),s=c;else{if(null===s)continue;c=s} if(Object(a.coordinateIsValid)(u.y)&&(c.y>t&&u.yt))if(Math.abs(c.x-u.x)<1){var h=new r.Point(c.x,t);i.push(h),n.push(h)}else{var d=Object(o.intersectLineSegments)(c,u,new r.Point(c.x,t),new r.Point(u.x,t));if(null!==d){h=c.add(u.subtract(c).scaled(d));i.push(h),n.push(h)}}}return{topItems:i,bottomItems:n}}var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._data=null,t}return Object(n.c)(t,e),t.prototype.setData=function(e){this._data=e},t.prototype.hitTest=function(e){if(null===this._data)return null;for(var t=this._data,i=t.items,n=t.topLineWidth,o=t.bottomLineWidth,c=Object(a.selectionTolerance)((n+o)/2),h=Object(l.lowerbound)(i,e,(function(e,t){return e.x<=t.x})),d=Math.max(1,h-1),p=Math.min(i.length-1,h+1),f=d;f<=p;++f){var _=i[f-1],m=i[f];if(Object(s.distanceToSegment)(new r.Point(_.x,_.y),new r.Point(m.x,m.y),new r.Point(e.x,e.y)).distance<=c)return new u.HitTestResult(u.HitTestResult.REGULAR)}return null},t.prototype._drawImpl=function(e){if(null!==this._data){var t=this._data,i=t.items,n=t.baseLevelCoordinate,r=t.bottom,o=t.bottomFillColor1,s=t.bottomFillColor2,a=t.topFillColor1,l=t.topFillColor2,c=t.topLineColor,u=t.bottomLineColor,p=t.topLineWidth,f=t.bottomLineWidth;if(h(i)){var _=d(i,n),m=_.topItems,v=_.bottomItems;e.lineCap="round",e.lineJoin="round",0!==m.length&&(e.beginPath(),e.moveTo(m[0].x,n),this._makeLine(e,m,!0,0),e.closePath(),e.fillStyle=this._makeLinearGradient(e,a,l,n-r,n),e.fill(),e.beginPath(),this._makeLine(e,m,!1,0),e.lineWidth=p,e.strokeStyle=c,e.stroke()),0!==v.length&&(e.beginPath(),e.moveTo(v[0].x,n),this._makeLine(e,v,!0,1),e.closePath(),e.fillStyle=this._makeLinearGradient(e,o,s,n,n+r),e.fill(),e.beginPath(),this._makeLine(e,v,!1,1),e.lineWidth=f,e.strokeStyle=u,e.stroke())}}},t.prototype._makeLine=function(e,t,i,n){if(null!==this._data){var r=t.findIndex((function(e){return Object(a.coordinateIsValid)(e.y)}));if(-1!==r)for(var o,s=this._data,l=s.barSpacing,c=s.baseLevelCoordinate,u=.25*l,h=t.length,d=r;d=c&&p.y>=c){e.moveTo(p.x,p.y);continue}}else if(o&&o.y<=c&&p.y<=c){e.moveTo(p.x,p.y);continue}if(o&&Object(a.coordinateIsValid)(o.y))e.lineTo(p.x,p.y),i&&!Object(a.coordinateIsValid)(f.y)&&e.lineTo(p.x,c);else if(f&&Object(a.coordinateIsValid)(f.y))i?(d!==r&&e.lineTo(p.x,c),e.lineTo(p.x,p.y)):e.moveTo(p.x,p.y);else if(i){if(0===d)continue;d!==r&&e.lineTo(p.x-u,c),e.lineTo(p.x-u,p.y),e.lineTo(p.x+u,p.y),e.lineTo(p.x+u,c)}else e.moveTo(p.x-u,p.y),e.lineTo(p.x+u,p.y);o=p}}}},t.prototype._makeLinearGradient=function(e,t,i,n,r){var o=e.createLinearGradient(0,n,0,r);return o.addColorStop(0,t),o.addColorStop(1,i),o},t}(c.ScaledPaneRenderer)},MA5A:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolCrossLine",(function(){return l}));var n=i("mrSG"),r=i("Ocx9"),o=i("p1SQ"),s=i("GmZZ"),a=i("Ss5c"),l=function(e){function t(n,r){var a=e.call(this,n,r||t.createProperties())||this;return a._priceAxisView=new o.LineToolHorzLinePriceAxisView(a), a._timeAxisView=new s.a(a),i.e("lt-pane-views").then(function(e){var t=i("amUF").CrossLinePaneView;a._setPaneViews([new t(a,a._model)])}.bind(null,i)).catch(void 0),a}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 1},t.prototype.name=function(){return"Cross Line"},t.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},t.prototype.timeAxisViews=function(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null},t.prototype.updateAllViews=function(){e.prototype.updateAllViews.call(this),this._priceAxisView.update(),this._timeAxisView.update()},t.prototype.canHasAlert=function(){return!1},t.prototype.lineColor=function(){return this.properties().linecolor.value()},t.prototype.lineWidth=function(){return this.properties().linewidth.value()},t.prototype.lineStyle=function(){return this.properties().linestyle.value()},t.createProperties=function(e){var i=new r.DefaultProperty("linetoolcrossline",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"xrdl")).then((function(e){return e.CrossLineDefinitionsViewModel}))},t._configureProperties=function(e){a.LineDataSource._configureProperties(e)},t}(a.LineDataSource)},MROS:function(e,t,i){"use strict";i.r(t),i.d(t,"ModelSelection",(function(){return s}));var n=i("Y7w9"),r=i("GxN8"),o=i("CW80"),s=function(){function e(){this._items=[],this._set=new Set}return e.prototype.isEmpty=function(){return 0===this._items.length},e.prototype.add=function(e){if(this._items.length>0&&!Object(o.isLineTool)(this._items[0])&&this.clear(),Object(o.isLineTool)(e)){var t=Object(n.lowerbound)(this._items,e,(function(e,t){return e.zorder()i&&this._priceScaleIsPrice(e.rightPriceScales()[i],t))return e.rightPriceScales()[i];if(e.leftPriceScales().length>i&&this._priceScaleIsPrice(e.leftPriceScales()[i],t))return e.leftPriceScales()[i]}return null},e.prototype._targetPriceScaleIndex=function(e,t){if(e.mainSource()===t.mainSeries())return 0},e.prototype._tryToGetDesiredPriceScale=function(e,t,i,n){switch(i){case"left":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("left"):e.createPriceScaleAtPosition("overlay");case"right":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("right"):e.createPriceScaleAtPosition("overlay");case"as-series":return void 0!==n?Object(r.ensureNotNull)(n.priceScale()):e.isMainPane()?Object(r.ensureNotNull)(Object(r.ensureNotNull)(e.mainDataSource()).priceScale()):this.createNewPriceScaleIfPossible(e);case"overlay":return e.createPriceScaleAtPosition("overlay")}},e}(),a=function(e){function t(t){return e.call(this,t)||this}return Object(n.c)(t,e),t.prototype.apply=function(e){if(e.containsMainSeries()){ var t=Object(r.ensureNotNull)(Object(r.ensureNotNull)(e.mainDataSource()).priceScale());e.movePriceScale(t,"right",0)}for(var i=e.model();e.leftPriceScales().length>e.rightPriceScales().length;){t=e.leftPriceScales()[e.leftPriceScales().length-1];e.movePriceScale(t,"right",this._targetPriceScaleIndex(t,i))}for(;e.rightPriceScales().length-e.leftPriceScales().length>1;){t=e.rightPriceScales()[e.rightPriceScales().length-1];e.movePriceScale(t,"left",this._targetPriceScaleIndex(t,i))}},t.prototype.createNewPriceScaleIfPossible=function(e){if(!this.canCreateNewPriceScale(e))return e.createPriceScaleAtPosition("overlay");var t=e.leftPriceScales().length=0;--a)if(Math.floor(o/r[a].divisor)!==Math.floor(s/r[a].divisor))return r[a].span},TradingView.ChartapiMessagerInstances=[],e.exports=c}).call(this,i("jCNj"))},"N+BX":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolBezierCubic",(function(){return s}));var n=i("mrSG"),r=i("Ocx9"),o=i("Ss5c"),s=function(e){function t(n,r){var o=this,s=r||t.createProperties();return(o=e.call(this,n,s)||this)._controlPoints=null,i.e("lt-pane-views").then(i.bind(null,"a6on")).then((function(e){o._setPaneViews([new e.BezierCubicPaneView(o,n)])})),o}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.name=function(){return"Double Curve"},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.prototype.setLastPoint=function(t,i){e.prototype.setLastPoint.call(this,t,i),this._controlPoints=this._calculateControlPoints()},t.prototype.addPoint=function(t,i,n){var r=e.prototype.addPoint.call(this,t,i,n);if(r){var o=this._calculateControlPoints();this._controlPoints=null,this._points.push(o[0]),this._points.push(o[1]),n||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)}return r},t.prototype.restorePoints=function(t,i,n){e.prototype.restorePoints.call(this,t,i,n),this._createPointProperty(2),this._createPointProperty(3)},t.prototype.controlPoints=function(){return this._controlPoints}, t.createProperties=function(e){var i=new r.DefaultProperty("linetoolbeziercubic",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"b4fl")).then((function(e){return e.GeneralBezierDefinitionsViewModel}))},t._configureProperties=function(e){o.LineDataSource._configureProperties(e)},t.prototype._calculateControlPoints=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5).transposed().scaled(.3),n=e.add(t).scaled(.33),r=e.add(t).scaled(.67),o=n.add(i),s=r.subtract(i);return[this.screenPointToPoint(o),this.screenPointToPoint(s)]},t}(o.LineDataSource)},N1UO:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyApi",(function(){return d}));var n=i("mrSG"),r=(i("YFKU"),i("Eyy1")),o=i("9iCb"),s=i("xo8u"),a=i("gaBL"),l=i("HGup"),c=i("jRfx"),u=i("/ToI"),h=i("HZKX"),d=function(){function e(e,t){this._study=e,this._chartWidget=t,this._undoModel=this._chartWidget.model(),this._model=this._undoModel.model()}return e.prototype.isUserEditEnabled=function(){return this._study.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._study.setUserEditEnabled(e)},e.prototype.getInputsInfo=function(){return this._study.metaInfo().inputs.map((function(e){return Object(n.a)(Object(n.a)({},e),{localizedName:void 0!==e.name?window.t(e.name,{context:"input"}):""})}))},e.prototype.getInputValues=function(){var e=this._study.inputs({symbolsForChartApi:!1});return Object.keys(e).map((function(t){return{id:t,value:e[t]}}))},e.prototype.setInputValues=function(e){for(var t=this.getInputValues(),i=function(e){void 0!==t.find((function(t){return t.id===e.id}))?n._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},n=this,r=0,o=e;r0&&(i.drawImage(a.leftAxis.canvas,l,n),l+=a.leftAxis.canvas.width),i.drawImage(a.canvas,l,n),l+=a.canvas.width,a.rightAxis.contentWidth>0&&i.drawImage(a.rightAxis.canvas,l,n),"pane"===a.type&&(i.fillStyle=e.colors.text,this._drawLegend(a,i,new r.Point(c,h),u)),n+=a.canvas.height}if(void 0!==e.timeAxis){l=0;e.timeAxis.lhsStub.contentWidth>0&&(i.drawImage(e.timeAxis.lhsStub.canvas,l,n),l+=e.timeAxis.lhsStub.canvas.width),i.drawImage(e.timeAxis.canvas,l,n),l+=e.timeAxis.canvas.width,e.timeAxis.rhsStub.contentWidth>0&&i.drawImage(e.timeAxis.rhsStub.canvas,l,n)}i.restore()},e.prototype._drawLegend=function(e,t,i,n){var o=!0,s=Math.ceil(1.4*this._options.fontSize*this._pixelRatio),a=i.x,l=i.y;if(e.mainSeriesText&&l+si}));return{text:(t=t.slice(0,l)).trim(),elided:!0}}(e,d,i-p,this._pixelRatio);if(f.elided&&!s)return null;for(var _=[],m=0,v=0,y=l;vf.text.length)break;_.push(P.text),m+=P.text.length}var b=_.join("").trim().length;m=0;for(var S=0,w=l;Sb)break;P.color&&(e.save(),e.fillStyle=P.color),p+=g(e,new r.Point(p,t.y),P.text,this._pixelRatio),P.color&&e.restore(),m+=P.text.length}return f.elided&&(p+=g(e,new r.Point(p,t.y),"...",this._pixelRatio)),p},e}();function w(e,t){return Object(n.b)(this,void 0,void 0,(function(){return Object(n.d)(this,(function(i){return[2,new S(e,t).getImage()]}))}))}},Ndyb:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererColumns",(function(){return r}));var n=i("VdBB"),r=function(){function e(e){this._data=null,this._precalculatedCache=[],this.setData(e)}return e.prototype.setData=function(e){this._data=e,this._precalculatedCache=[]},e.prototype.draw=function(e,t){if(null!==this._data&&0!==this._data.items.length){var i=t.pixelRatio;this._precalculatedCache.length||this._fillPrecalculatedCache(i);for(var n=Math.max(1,Math.floor(i)),r=Math.round(this._data.histogramBase*i)-Math.floor(n/2),o=r+n,s=this._data.lineColor,a=0;a=i&&l<=r){var c=a.y;if(e.y>=Math.min(c,this._data.histogramBase)&&e.y<=Math.max(c,this._data.histogramBase))return new n.HitTestResult(n.HitTestResult.REGULAR)}}return null},e.prototype._fillPrecalculatedCache=function(e){if(null!==this._data&&0!==this._data.items.length){var t=Math.ceil(this._data.barSpacing*e)<=1?0:Math.max(1,Math.floor(e)),i=Math.round(this._data.barSpacing*e)-t;this._precalculatedCache=new Array(this._data.items.length);for(var n=0;nu.center?u.right=c.left-t-1:c.left=u.right+t+1))}var h=Math.ceil(this._data.barSpacing*e);for(n=0;n0&&h<4)for(n=0;nh&&(c.roundedCenter>c.center?c.right-=1:c.left+=1)}}else this._precalculatedCache=[]},e}()},NhkU:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("5rJj"),o=i("j3hX"),s=o.LineToolWidthsProperty,a=o.LineToolColorsProperty;function l(e,t){var r=t||l.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("l5Au").PitchfanLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(l,n),l.LevelsCount=8,l.prototype.levelsCount=function(){return l.LevelsCount},l.prototype.pointsCount=function(){return 3},l.prototype.name=function(){return"Pitchfan"},l.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("D+Nk").PitchBaseDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l.createProperties=function(e){var t=new r("linetoolpitchfan",e,!1,{range:[0,8]});return l._configureProperties(t),t},l._configureProperties=function(e){n._configureProperties(e);for(var t=[e.child("median").child("linewidth")],i=[e.child("median").child("color")],r=0;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new s(t))},t.LineToolPitchfan=l},NsVT:function(e,t,i){"use strict";i.r(t);var n=i("hY0g"),r=i.n(n),o=i("HySD");function s(e,t){for(var i=0,n=0,r=t;n0&&t.push({min:o,max:s})}return t.sort((function(e,t){return e.min-t.min||e.max-t.max})),t}function l(e,t){if(e.length!==t.length)return!1;for(var i=e.length;i--;){if(e[i].min!==t[i].min)return!1;if(e[i].max!==t[i].max)return!1}return!0}var c=i("+GxX"),u=i("Kxc7");i.d(t,"ChartPage",(function(){return d}));var h=u.enabled("no_min_chart_width"),d=function(){function e(e){var t=this;this._processVisibility=function(e){var i=e.container.value();return t._affectsLayout(e.name)?(i&&i.classList.toggle("js-hidden",!1),!0):(i&&i.classList.toggle("js-hidden",!0),!1)},this._setWidth=function(e,i){var n=i;t._fullscreenArea!==e.name&&(e.availWidth.setValue(i), e.canNegotiate.width&&(n=s(i,e.negotiations.width)));var r=e.container.value();return r&&(r.style.width=n+"px"),e.width.setValue(n),n},this._setHeight=function(e,i){var n=i;t._fullscreenArea!==e.name&&(e.availHeight.setValue(i),e.canNegotiate.height&&(n=s(i,e.negotiations.height)));var r=e.container.value();return r&&(r.style.height=n+"px"),e.height.setValue(n),n};var i=e.container.value();if(!i)throw new Error("bridge.container.value() must be an element");this._container=i,this._availableAreas=["left","tradingpanel","right","top","bottom","center","topleft","extratop"],this._areas={},this._bridge=e,this._width=e.width,this._height=e.height,this._width.subscribe((function(){return t.recalculate()})),this._height.subscribe((function(){return t.recalculate()})),this._bridge.visible.subscribe((function(){return t._updateVisibility()})),this._bridge.fullscreen.subscribe((function(){return t._onParentFullscreenChange()})),this.recalculate()}return e.prototype.allocate=function(e){var t=this,i=e&&e.areaName;if(-1===this._availableAreas.indexOf(i))throw new Error("unknown options.areaName");this.free(i);var n=this._createDOM(i),s={name:i,canNegotiate:{width:"left"===i||"right"===i||"tradingpanel"===i||"topleft"===i,height:"top"===i||"bottom"===i||"topleft"===i||"extratop"===i},negotiations:{width:[],height:[]},remove:function(){for(var e in t._areas)t._areas[e]===s&&t.free(e)},negotiateWidth:function(e){if(s.canNegotiate.width){var i=a(e);l(s.negotiations.width,i)||(s.negotiations.width=i,t.recalculate())}},negotiateHeight:function(e){if(s.canNegotiate.height){var i=a(e);l(s.negotiations.height,i)||(s.negotiations.height=i,t.recalculate())}},requestFullscreen:function(){t._fullscreenArea||("right"!==i&&"center"!==i||(t._fullscreenArea=i),"center"===i&&t._bridge.requestFullscreen(),t._updateFullscreen())},exitFullscreen:function(){i===t._fullscreenArea&&(t._fullscreenArea=void 0,"center"===i&&t._bridge.exitFullscreen(),t._updateFullscreen())},width:new r.a,height:new r.a,availWidth:new r.a,availHeight:new r.a,alive:new r.a(!0),container:new r.a(n),visible:new r.a(!0),fullscreen:new r.a(!0),rdState:new o.ResizerDetacherState};return s.rdState.pushOwner(s),this._areas[i]=s,s.rdState.owner.subscribe((function(e){var n=s.container.value();if(e!==s)n&&(n.innerHTML="",n.parentElement&&n.parentElement.removeChild(n));else{for(var r=null,o=t._availableAreas.indexOf(i);o--;){var a=t._availableAreas[o];if(t._affectsLayout(a)){r=t._areas[a].container.value();break}}n&&(r&&n.parentElement?n.insertAdjacentElement("afterend",r):t._container.appendChild(n))}t.recalculate()}),{callWithLast:!0}),s.rdState.bridge()},e.prototype.free=function(e){var t=this._areas[e];if(t){this._areas[e]=void 0;var i=t.container.value();i&&i.parentElement&&i.parentElement.removeChild(i),t.alive.setValue(!1)}},e.prototype.recalculate=function(){var e={};this._recalcSingleRunToken=e ;var t=this._areas.topleft,i=this._areas.left,n=this._areas.tradingpanel,r=this._areas.right,o=this._areas.top,s=this._areas.bottom,a=this._areas.center,l=this._areas.extratop,c=this._width.value(),u=this._height.value(),d=0,p=0,f=0,_=0,m=0,v=0,y=0,g=0;(e===this._recalcSingleRunToken&&l&&this._processVisibility(l)&&(g=this._setHeight(l,u),this._setWidth(l,c)),e===this._recalcSingleRunToken&&t&&this._processVisibility(t))&&(y=this._setHeight(t,u),(v=this._setWidth(t,c))&&(v+=4),(I=t.container.value())&&(I.style.top=g+"px"));e===this._recalcSingleRunToken&&i&&this._processVisibility(i)&&((I=i.container.value())&&(I.style.top=y+g+"px"),this._setHeight(i,u-y-g),(f=this._setWidth(i,c))&&(f+=4));if(e===this._recalcSingleRunToken&&n&&this._processVisibility(n)){this._setHeight(n,u);var b=c-f;h||(b-=300),m=this._setWidth(n,b)}if(e===this._recalcSingleRunToken&&r&&this._processVisibility(r)){this._setHeight(r,u-g);b=c-f-m;h||(b-=300),_=this._setWidth(r,b),(I=r.container.value())&&(I.style.top=g+"px")}var S=m+_,w=S?4:0;if(e===this._recalcSingleRunToken&&o&&this._processVisibility(o)){var P=Math.max(v,f);(I=o.container.value())&&(I.style.left=P+"px",I.style.top=g+"px");b=c-P-m-_-w;this._setWidth(o,b),d=this._setHeight(o,u)}var C=0,T=c-f-m-_-w;if(e===this._recalcSingleRunToken&&s&&this._processVisibility(s)){(I=s.container.value())&&(I.style.left=f+"px",I.classList.toggle("no-border-top-left-radius",!f),I.classList.toggle("no-border-top-right-radius",!S)),this._setWidth(s,T);var x=u-d-g;C=Math.min(300,x-0),p=this._setHeight(s,x)+4}if(e===this._recalcSingleRunToken&&a&&this._processVisibility(a)){var I;(I=a.container.value())&&(I.style.left=f+"px",I.style.top=d+g+"px",I.classList.toggle("no-border-bottom-left-radius",!p||!f),I.classList.toggle("no-border-bottom-right-radius",!S||!p)),this._setWidth(a,T);x=u-d-p-g;this._setHeight(a,Math.max(x,C))}e===this._recalcSingleRunToken&&n&&this._affectsLayout("tradingpanel")&&((I=n.container.value())&&(I.style.right=_+"px",I.style.top=g+"px"));e===this._recalcSingleRunToken&&this._updateVisibility()},e.prototype._affectsLayout=function(e){var t=this._areas[e];if(!t)return!1;if(t.rdState.owner.value()!==t)return!1;if(this._fullscreenArea&&this._fullscreenArea!==e)return p(e);if(this._width.value()<=567||this._height.value()<=445){var i=["center","top","left","topleft","extratop"];if(Object(c.isFeatureEnabled)("mobile_show_bottom_panel")&&i.push("bottom"),!i.includes(e))return!1}return!0},e.prototype._updateVisibility=function(){for(var e=this._bridge.visible.value(),t=0;te.year||this.year===e.year&&this.month>e.month||this.year===e.year&&this.month===e.month&&this.day>e.day?1:this.year===e.year&&this.month===e.month&&this.day===e.day?0:-1},e.prototype.before=function(e){return-1===this.compareTo(e)},e.prototype.toCalendar=function(e){return n.get_cal(n.get_timezone("Etc/UTC"),this.year,this.month-1,this.day)}, e.prototype.addDays=function(t){var i=this.toCalendar(n.get_timezone("Etc/UTC"));return n.add_date(i,t),e.fromCalendar(i)},e.fromCalendar=function(t){return new e(n.get_year(t),n.get_month(t)+1,n.get_day_of_month(t))},e}()},OH2X:function(e,t,i){"use strict";t.LineToolFibRetracement=i("t2ex").LineToolFibRetracement,t.LineToolFibChannel=i("xnA2").LineToolFibChannel,t.LineToolFibSpeedResistanceArcs=i("Yjuu").LineToolFibSpeedResistanceArcs,t.LineToolProjection=i("68at").LineToolProjection,t.LineToolTrendBasedFibExtension=i("ZtA1").LineToolTrendBasedFibExtension,t.LineToolElliott=i("xz+e").LineToolElliott,t.LineToolFibCircles=i("4bfY").LineToolFibCircles,t.LineToolVertLine=i("n40Z").LineToolVertLine,t.LineToolCrossLine=i("MA5A").LineToolCrossLine,t.LineToolBarsPattern=i("2bPF").LineToolBarsPattern,t.LineToolTrendBasedFibTime=i("yUly").LineToolTrendBasedFibTime,t.LineToolFibTimeZone=i("FsE7").LineToolFibTimeZone,t.LineToolCircleLines=i("tG6Q").LineToolCircleLines,t.LineToolDateRange=i("WkYF").LineToolDateRange,t.LineToolPriceRange=i("RDDl").LineToolPriceRange,t.LineToolDateAndPriceRange=i("UCMi").LineToolDateAndPriceRange,t.LineToolParallelChannel=i("qcGP").LineToolParallelChannel,t.LineToolTrendAngle=i("nW7S").LineToolTrendAngle,t.LineToolTrendLine=i("WPQD").LineToolTrendLine,t.LineToolInfoLine=i("yi8X").LineToolInfoLine,t.LineToolArrowMark=i("TohL").LineToolArrowMark,t.LineToolImage=i("8Blv").LineToolImage,t.LineToolExecution=i("704P").LineToolExecution,t.LineToolPitchfan=i("NhkU").LineToolPitchfan,t.LineToolGannSquare=i("Z0Sh").LineToolGannSquare,t.LineToolFibSpeedResistanceFan=i("zZ5f").LineToolFibSpeedResistanceFan,t.LineToolGannComplex=i("nd9+").LineToolGannComplex,t.LineToolGannFixed=i("TBaH").LineToolGannFixed,t.LineToolGannFan=i("4u8j").LineToolGannFan,t.LineToolFibWedge=i("9QkW").LineToolFibWedge,t.LineToolPitchfork=i("aDyP").LineToolPitchfork,t.LineToolDisjointAngle=i("oIoN").LineToolDisjointChannel,t.LineToolFlatBottom=i("InMJ").LineToolFlatBottom,t.LineToolIcon=i("icPo").LineToolIcon,t.LineToolRotatedRectangle=i("Az04").LineToolRotatedRectangle,t.LineToolFibSpiral=i("i80N").LineToolFibSpiral,t.LineToolHeadAndShoulders=i("aILO").LineToolHeadAndShoulders,t.LineToolTriangle=i("isVH").LineToolTriangle,t.LineToolTrianglePattern=i("lNN+").LineToolTrianglePattern,t.LineTool5PointsPattern=i("NJRZ").LineTool5PointsPattern,t.LineToolThreeDrivers=i("PYn8").LineToolThreeDrivers,t.LineToolABCD=i("pKDv").LineToolABCD,t.LineToolPolyline=i("hP9j").LineToolPolyline,t.LineToolPath=i("YdVo").LineToolPath,t.LineToolPrediction=i("Wh6B").LineToolPrediction,t.LineToolPriceLabel=i("zqZp").LineToolPriceLabel,t.LineToolArrowMarker=i("wiuq").LineToolArrowMarker,t.LineToolNote=i("gLxC").LineToolNote,t.LineToolNoteAbsolute=i("gLxC").LineToolNoteAbsolute,t.LineToolSignpost=i("gASG").LineToolSignpost,t.LineToolBrush=i("+hLl").LineToolBrush,t.LineToolArc=i("0Pxc").LineToolArc,t.LineToolCallout=i("odCa").LineToolCallout,t.LineToolBalloon=i("me8f").LineToolBalloon,t.LineToolText=i("V3Oj").LineToolText, t.LineToolHorzLine=i("/DxK").LineToolHorzLine,t.LineToolHorzRay=i("CJIV").LineToolHorzRay,t.LineToolRectangle=i("7qI1").LineToolRectangle,t.LineToolEllipse=i("V086").LineToolEllipse,t.LineToolTimeCycles=i("kIXa").LineToolTimeCycles,t.LineToolSineLine=i("bv/X").LineToolSineLine,t.LineToolGhostFeed=i("XUCF").LineToolGhostFeed,t.LineToolBezierQuadro=i("Xyly").LineToolBezierQuadro,t.LineToolBezierCubic=i("N+BX").LineToolBezierCubic,t.LineToolArrow=i("QQu0").LineToolArrow,t.LineToolRay=i("5ZUI").LineToolRay,t.LineToolExtended=i("CHw2").LineToolExtended,t.LineToolSchiffPitchfork=i("v5F8").LineToolSchiffPitchfork,t.LineToolSchiffPitchfork2=i("XFad").LineToolSchiffPitchfork2,t.LineToolInsidePitchfork=i("EqoR").LineToolInsidePitchfork,t.LineToolTextAbsolute=i("V3Oj").LineToolTextAbsolute,t.LineToolArrowMarkLeft=i("TohL").LineToolArrowMarkLeft,t.LineToolArrowMarkRight=i("TohL").LineToolArrowMarkRight,t.LineToolArrowMarkUp=i("TohL").LineToolArrowMarkUp,t.LineToolArrowMarkDown=i("TohL").LineToolArrowMarkDown,t.LineToolFlagMark=i("aIha").LineToolFlagMark,t.LineToolCypherPattern=i("bTqm").LineToolCypherPattern,t.LineToolElliottImpulse=i("xz+e").LineToolElliottImpulse,t.LineToolElliottTriangle=i("xz+e").LineToolElliottTriangle,t.LineToolElliottTripleCombo=i("xz+e").LineToolElliottTripleCombo,t.LineToolElliottCorrection=i("xz+e").LineToolElliottCorrection,t.LineToolElliottDoubleCombo=i("xz+e").LineToolElliottDoubleCombo,t.LineToolRiskRewardLong=i("tDUI").LineToolRiskRewardLong,t.LineToolRiskRewardShort=i("tDUI").LineToolRiskRewardShort,t.LineToolPosition=i("ziJ5").LineToolPosition,t.LineToolOrder=i("B4/o").LineToolOrder,t.LineToolHighlighter=i("SMvR").LineToolHighlighter,t.LineToolPriceNote=i("Zl0W").LineToolPriceNote},"OK+B":function(e,t,i){"use strict";var n=i("Eyy1").assert,r=i("eJTA"),o=r.rgba,s=r.rgbaToString,a=r.parseRgb,l=i("+GxX").isFeatureEnabled,c=i("cWHH"),u=i("1Wlv").PriceScale,h=i("8sOK").StudyStub,d=i("CW80"),p=d.createLineTool,f=d.createLineToolProperties,_=d.createStudyLineToolProperties,m=d.isLineToolName,v=d.isStudyLineToolName,y=i("Ss5c").LineDataSource,g=i("OH2X").LineToolBarsPattern,b=i("OH2X").LineToolCallout,S=i("OH2X").LineToolImage,w=i("CW80").isLineTool,P=i("HLXm"),C=i("GVHu"),T=C.Study,x=C.prepareStudyPropertiesForLoadChart,I=i("3ClC").createStudy,L=i("qJq3").Series,O=i("dfhE"),M=i("n5al"),A=i("0YCj"),k=i("Kxc7"),E=i("txPx").getLogger("Chart.Serialization"),V=i("OH2X").LineToolParallelChannel,D=i("OH2X").LineToolTrendAngle,B=i("OH2X").LineToolGhostFeed,R=i("OH2X").LineToolElliott,N=i("7ktv").PriceDataSource,j=i("iDOr").Pane,F=i("Tmoa"),W=i("jofe").createDeferredPromise,H=i("ApcL").preferencesByWhiteList,z=(E=i("txPx").getLogger("Chart.Serialization"),i("mPvX").LineToolsGroupModel);c.version=2,c.prototype.state=function(e,t,i,n){for(var r={panes:[]},o=0;o1&&r.push(l)),s=(s+1)%t.length}return r},c.prototype.restoreState=function(e,t,i){new U(this).reset();var n={};if(e.panes)if(Array.isArray(e.panes)){if(!(e.panes.length<1)){if(this._shouldBeSavedEvenIfHidden=void 0===e.shouldBeSavedEvenIfHidden||e.shouldBeSavedEvenIfHidden,e.chartProperties&&!e.chartProperties.timezone&&(e.chartProperties.timezone=e.timezone),e.chartProperties){var r=TradingView.factoryDefaults("chartproperties").scalesProperties;TradingView.merge(r,e.chartProperties.scalesProperties),!("showLastValue"in r)||"showSeriesLastValue"in r||"showStudyLastValue"in r||(r.showSeriesLastValueProperty=r.showLastValue,r.showStudyLastValueProperty=r.showLastValue),"showSeriesLastValue"in r&&(n.showSeriesLastValueProperty=!0),"showStudyLastValue"in r&&(n.showStudyLastValueProperty=!0),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),"backgroundType"in e.chartProperties.paneProperties||(e.chartProperties.paneProperties.backgroundType="solid"),this._properties.paneProperties.mergeAndFire(e.chartProperties.paneProperties),this._properties.scalesProperties.mergeAndFire(r),e.chartProperties.timezone&&this._properties.timezone.setValue(e.chartProperties.timezone),e.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.mergeAndFire(e.chartProperties.chartEventsSourceProperties), this._timeScale.restoreState(e.timeScale,t),this._updateDateTimeFormatter()}if(e.timeScale&&this._timeScale.restoreState(e.timeScale,t),!this.readOnly()){var o=this._getExceedingChildStudies(e.panes);if(o.length){for(var s=e.panes.length-1;s>=0;--s){for(var a=(h=e.panes[s]).sources.length-1;a>=0;--a){var l=h.sources[a];~o.indexOf(l)&&h.sources.splice(a,1)}h.sources.length||e.panes.splice(s,1)}0}}var c=e.panes;this.panes()[0].restoreState(c[0],t,e.version,n,i,!0);var u=1;for(s=1;sm&&f%100==0?{lines_limit_exceeded:!0,line_tools_count:f}:(this.panes().forEach(function(e){this._dataSourceCollectionChanged.fire(e)}.bind(this)),this._lineToolsGroupModel.fireChangedAll(),{})}E.logDebug("ChartModel.restoreState: invalid state")}else E.logDebug("ChartModel.restoreState: invalid state");else E.logDebug("ChartModel.restoreState: invalid state")},j.prototype.state=function(e,t,i,n,r,o){var s={},a=new Map;function l(e){if(a.has(e))return a.get(e);var s=null,l=i&&!e.isSavedInStudyTemplates()||!e.state||w(e)&&o||!(s=e.state(t,r))||!e.isSavedInChart(t)||n&&e.isActualSymbol&&!e.isActualSymbol()||e.isPhantom()?null:s;return a.set(e,l),l}if(e){s.sources=[];for(var c=0;c1e200){var v=h-1;E.logWarn("Datasource zorder has bad value: "+f.zorder+" Resetting it to "+v),f.zorder=v}else if(!this.isZOrderAvailable(f.zorder)){l&&"MainSeries"===_&&this._model.mainSeries().zorder()===f.zorder||(f.zorder=d+1)}var g=f.id;null===this._model.dataSourceForId(f.id)||"MainSeries"===_?(s[g]=f.ownerSource,_&&("MainSeries"===_?this._restoreMainSeries(f,t,l,n,r,o):_.toLowerCase().startsWith("study")?this.restoreStudy(f,t,n,o):TradingView.isInherited(TradingView[_],y)?this.restoreLineTool(f,t,void 0,o):TradingView[_]&&TradingView[_].createFromState&&this._restoreSpecialSource(f,t,o)),h=Math.min(h,f.zorder),d=Math.max(d,f.zorder)):E.logError("Duplicate id while restoring pane: "+f.type+","+f.id)}}}var b,S,w=new Set,P=this;function C(e){var t=defaults("chartproperties").paneProperties.axisProperties,i=new u(P.model().properties().scalesProperties,t);return i.restoreState(e.state),e.sources.forEach((function(e){var n=P.dataSourceForId(e);n&&function(e,t,i){w.add(e), void 0!==i.m_showSymbolLabels&&e instanceof L&&P.model().properties().scalesProperties.showSymbolLabels.setValue(i.m_showSymbolLabels),e.setPriceScale(t),t.addDataSource(e)}(n,i,t)})),0===i.dataSources().length?null:i}if(e.leftAxisesState)b=e.leftAxisesState.map(C).filter((function(e){return null!==e}));else{var x=C({state:e.leftAxisState,sources:e.leftAxisSources});b=null!==x?[x]:[]}if(this._leftPriceScales.slice().forEach(function(e){this.removePriceScale(e)}.bind(this)),this._leftPriceScales=[],b.forEach((function(e){P._placePriceScale(e,"left")})),e.rightAxisesState)S=e.rightAxisesState.map(C).filter((function(e){return null!==e}));else{var I=C({state:e.rightAxisState,sources:e.rightAxisSources});S=null!==I?[I]:[]}this._rightPriceScales.forEach(function(e){this.removePriceScale(e)}.bind(this)),this._rightPriceScales=[],S.forEach((function(e){P._placePriceScale(e,"right")})),this._currentPriceScaleRatio=e.priceScaleRatio||e.leftPriceScaleRatio||e.rightPriceScaleRatio||null;for(p=0;p=a||_)){this._visiblePivots.add(l[d]), this._prices=[];for(var m=0;ms)){var h={},d=this._source.properties().levelsStyle.visibility;d.P.value()&&this.mergeLabel(h,e[l].p,"P"),d["S1/R1"].value()&&(this.mergeLabel(h,e[l].s1,"S1"),this.mergeLabel(h,e[l].r1,"R1")),d["S2/R2"].value()&&(this.mergeLabel(h,e[l].s2,"S2"),this.mergeLabel(h,e[l].r2,"R2")),d["S3/R3"].value()&&(this.mergeLabel(h,e[l].s3,"S3"),this.mergeLabel(h,e[l].r3,"R3")),d["S4/R4"].value()&&(this.mergeLabel(h,e[l].s4,"S4"),this.mergeLabel(h,e[l].r4,"R4")),d["S5/R5"].value()&&(this.mergeLabel(h,e[l].s5,"S5"),this.mergeLabel(h,e[l].r5,"R5"));var p=i.indexToCoordinate(c),f=i.indexToCoordinate(u) ;for(var _ in h){var m=parseFloat(_),v=n.priceToCoordinate(m,a);this._pivots.push({x1:p,x2:f,y:v,label:h[_].text,labelIds:h[_].ids,src:e[l]})}}}}}},m.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);for(var e=new u,t=this._source.properties().levelsStyle.colors,i=this._source.properties().levelsStyle.widths,r=this._source.visiblePivots(),o=0;oi)){var l=[],c=this._properties.levelsStyle.visibility;c.P.value()&&l.push(n[s].p),c["S1/R1"].value()&&l.push(n[s].s1,n[s].r1),c["S2/R2"].value()&&l.push(n[s].s2,n[s].r2),c["S3/R3"].value()&&l.push(n[s].s3,n[s].r3),c["S4/R4"].value()&&l.push(n[s].s4,n[s].r4),c["S5/R5"].value()&&l.push(n[s].s5,n[s].r5);for(var u=0;ut?(s&&(clearTimeout(s),s=null),a=c,o=e.apply(n,r),s||(n=r=null)):s||!1===i.trailing||(s=setTimeout(l,u)),o}},e.exports=t.default},Q19o:function(e,t,i){"use strict";var n=i("Eyy1").ensureNotNull,r=i("jA0t"),o=i("9iCb").applyOverridesToStudy,s=i("0YCj"),a=i("5JMW"),l=a.LineDataSourceApi,c=a.isLineToolRiskReward,u=i("N1UO").StudyApi,h=i("ltKl").SeriesApi,d=i("QrSB").SelectionApi,p=i("mf9N").PaneApi,f=i("OLhd").createDwmAligner,_=i("LxhU").Interval,m=i("2jXJ").supportedLineTools,v=i("7MZv").showTooManyStudiesNotice,y=i("ogJP").isNumber,g=i("ogJP").inherit,b=i("vu5c").onSeriesCompletedOrErrorReceived,S=i("CW80").createLineToolProperties,w=i("96Yh"),P=w.lineToolEntityInfo,C=w.studyEntityInfo,T=i("lReN").LineToolsGroupControllerApi,x=i("ocrj").RemoveSourcesCommand,I=i("e92V").isLineDrawnWithPressedButton,L=i("FDyI").ChartWidgetApiBase,O=i("mMWL"),M=function(e,t){L.call(this,e),this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap,this._activateChart=t,this._selectionApi=null,this._chartWidget.onAboutToBeDestroyed().subscribe(this,this._destroy,!0),this._chartWidget.withModel(this,(function(){this._chartWidget.model().timeScale().visibleBarsStrictRangeChanged().subscribe(this,this._onVisibleBarsChanged)}))};function A(e,t){return t.map((function(t){return e.dataSourceForId(t)}))}g(M,L),M.prototype.id=function(){return this._chartWidget.id()},M.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new p(e,this._chartWidget),this._panes.set(e,t)),t},M.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new u(e,this._chartWidget),this._studies.set(e,t)),t},M.prototype._getLineDataSourceApi=function(e){var t=this._lineDataSources.get(e) ;return void 0===t&&(t=new l(e,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(e){var t=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return e.map((function(e){var n=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(n.time_t,n.offset)}}))}.bind(this)}),this._lineDataSources.set(e,t)),t},M.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},M.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},M.prototype.setZoomEnabled=function(e){this._chartWidget.model().model().setZoomEnabled(e)},M.prototype.setScrollEnabled=function(e){this._chartWidget.model().model().setScrollEnabled(e)},M.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},M.prototype.clearMarks=function(){this._chartWidget.clearMarks()},M.prototype.symbol=function(){return this._chartWidget.getSymbol()},M.prototype.symbolExt=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name,exchange:e.exchange,description:e.description,type:e.type,pro_name:e.pro_name}:null},M.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},M.prototype.setSymbol=function(e,t){if(e!==this.symbol()){var i=this._chartWidget.model().mainSeries().dataEvents();t&&b(i,(function(e){e||t()})),this._activateChart(),this._chartWidget.setSymbol(e)}},M.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},M.prototype.setResolution=function(e,t){var i=_.normalize(e);if(null!==i&&i!==this.resolution()){var n=this._chartWidget.model().mainSeries().dataEvents();t&&b(n,(function(e){e||t()})),this._activateChart(),this._chartWidget.setResolution(i)}},M.prototype.setEntityVisibility=function(e,t){console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead");var i=this._chartWidget.model().model().dataSourceForId(e);if(i){var n=i.properties();n&&n.visible&&n.visible.setValue(t)}},M.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(C)},M.prototype.availableZOrderOperations=function(e){var t=A(this._chartWidget.model().model(),e);return this._chartWidget.model().availableZOrderOperations(t)},M.prototype.sendToBack=function(e){var t=A(this._chartWidget.model().model(),e);this._chartWidget.model().sendToBack(t)},M.prototype.bringToFront=function(e){var t=A(this._chartWidget.model().model(),e);this._chartWidget.model().bringToFront(t)},M.prototype.insertAfter=function(e,t){var i=this._chartWidget.model().model(),n=A(i,e),r=i.dataSourceForId(t);this._chartWidget.model().insertAfter(n,r)},M.prototype.insertBefore=function(e,t){var i=this._chartWidget.model().model(),n=A(i,e),r=i.dataSourceForId(t);this._chartWidget.model().insertBefore(n,r)},M.prototype.bringForward=function(e){var t=A(this._chartWidget.model().model(),e);this._chartWidget.model().bringForward(t) },M.prototype.sendBackward=function(e){var t=A(this._chartWidget.model().model(),e);this._chartWidget.model().sendBackward(t)},M.prototype.showPropertiesDialog=function(e){var t=this._chartWidget.model().model().dataSourceForId(e);if(null===t)throw new Error("Study or shape "+e+" does not exist");this._chartWidget.showChartPropertiesForSource(t)},M.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(P).filter((function(e){return null!==e.name}))},M.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},M.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},M.prototype.removeEntity=function(e,t){var i=this._chartWidget.model().chartModel().dataSourceForId(e);i?t&&t.disableUndo?new x(this._chartWidget.model().chartModel(),[i],"").redo():this._chartWidget.model().removeSource(i,!0,!0):console.warn("Can't find a source with id: "+e)},M.prototype.removeEntityWithUndo=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);this._chartWidget.model().removeSource(t,!1)},M.prototype.selection=function(){return null===this._selectionApi&&(this._selectionApi=new d(this._chartWidget.model().model())),this._selectionApi},M.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveSymbol,e.saveInterval)},M.prototype.drawOnAllCharts=function(e){O.drawOnAllCharts.setValue(e)},M.prototype.applyStudyTemplate=function(e){this._chartWidget.model().applyStudyTemplate(e,""+1e3*Math.random())},M.prototype.setVisibleRange=function(e,t){if(void 0!==e&&!isNaN(e.from)&&!isNaN(e.to)){var i=void 0!==t&&"function"==typeof t,n=new Promise(function(n){this._chartWidget.setVisibleTimeRange(parseInt(e.from),parseInt(e.to),i?{}:t,n)}.bind(this));return i&&(console.warn("setVisibleRange now returns a Promise object and don't accept callback as the last argument"),n.then(t)),n}console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.')},M.prototype.getVisibleRange=function(){var e={from:0,to:0},t=this._chartWidget.model().timeScale(),i=t.visibleBarsStrictRange();if(null===i)return e;var r=this._chartWidget.model().mainSeries(),o=r.syncModel();if(null===o)return e;var s=n(r.data().last()),a=i.lastBar()-s.index,l=a<=0?t.indexToTimePoint(i.lastBar()):o.projectTime(s.value[TradingView.TIME_PLOT],a);if(e.from=+t.indexToTimePoint(Math.max(0,i.firstBar()))||0,e.to=+l||0,_.isDWM(r.interval())){var c=f(r.interval(),r.symbolInfo());null!==c&&(e.from=c.timeToExchangeTradingDay(1e3*e.from)/1e3,e.to=c.timeToExchangeTradingDay(1e3*e.to)/1e3)}return e},M.prototype.getVisiblePriceRange=function(){return console.warn("`getVisiblePriceRange` is deprecated. Use Price Scale API instead"),this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},M.prototype.scrollPosition=function(){return this._chartWidget.model().timeScale().rightOffset()},M.prototype.defaultScrollPosition=function(){ return this._chartWidget.model().timeScale().defaultRightOffsetProperty().value()},M.prototype._createTradingPrimitive=function(e,t){var i=this;var r,o,s=this._chartWidget.model().model(),a=s.paneForSource(s.mainSeries());return(t?s:this._chartWidget.model()).createLineTool(a,(r=TradingView.CLOSE_PLOT,{index:(o=n(i._chartWidget.model().mainSeries().bars().last())).index,price:o.value[r]}),e)._adapter},M.prototype.createOrderLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},M.prototype.createPositionLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},M.prototype.createExecutionShape=function(e){e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},M.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},M.prototype._alignPoints=function(e){var t=this._chartWidget.model().model(),i=t.mainSeries(),n=i.interval();if(t.timeScale().isEmpty()||!_.isDWM(n))return e;var r=f(n,i.symbolInfo());return null===r?e:e.map((function(e){return r.timeToSessionStart(1e3*e)/1e3}))},M.prototype._convertUserPointsToDataSource=function(e){var t=this._chartWidget.model().model(),i=t.mainSeries(),n=t.timeScale().points(),r=i.data();if(t.timeScale().isEmpty())return null;var o=e.map((function(e){return e.time||0})),s=this._alignPoints(o);function a(e,t,o){var s=n.closestIndexLeft(e)||0,a={index:s},l=n.valueAt(s);if(e>l&&s===n.lastIndex()){var c=i.syncModel().distance(l,e);c.success&&(a.index=a.index+c.result)}if(y(t))a.price=t;else{var u=o?["open","high","low","close"].indexOf(o)+1:1;u<=0&&(u=1),a.price=r.valueAt(s)[u]}return a}for(var l=[],c=0;c2)throw new Error("Wrong points count for "+t.shape+". Required 1 or 2");2===l.length&&(p.startChanging(1,l[1]),p.setPoint(1,l[1]),p.endChanging())}else{var f=p.pointsCount() ;if(f!==l.length&&-1!==f)throw new Error("Wrong points count for "+t.shape+". Required "+f);for(var _=I(u.name),v=1;vthis._minValue&&e.maxValue()1)n._touchMouseMoveWithDownInfo(u(e),n._tapPosition).manhattanDistance<30&&!n._cancelTap&&n._processTouchEvent(t,n._handler.doubleTapEvent),n._resetTapTimeout()}else{t=n._makeCompatEvent(e);if(++n._clickCount,n._clickTimeoutId&&n._clickCount>1)n._touchMouseMoveWithDownInfo(u(e),n._clickPosition).manhattanDistance<5&&!n._cancelClick&&n._processMouseEvent(t,n._handler.mouseDoubleClickEvent),n._resetClickTimeout()}},this._target=e,this._handler=t,this._options=i,this._init()}return e.prototype.destroy=function(){null!==this._unsubscribeOutsideMouseEvents&&(this._unsubscribeOutsideMouseEvents(),this._unsubscribeOutsideMouseEvents=null),null!==this._unsubscribeOutsideTouchEvents&&(this._unsubscribeOutsideTouchEvents(),this._unsubscribeOutsideTouchEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null),null!==this._unsubscribeMobileSafariEvents&&(this._unsubscribeMobileSafariEvents(),this._unsubscribeMobileSafariEvents=null),this._clearLongTapTimeout(),this._resetClickTimeout()},e.prototype._mouseEnterHandler=function(e){var t=this;this._unsubscribeMousemove&&this._unsubscribeMousemove();var i=this._mouseMoveHandler.bind(this);if(this._unsubscribeMousemove=function(){t._target.removeEventListener("mousemove",i)}, this._target.addEventListener("mousemove",i),!this._firesTouchEvents(e)){var n=this._makeCompatEvent(e);this._processMouseEvent(n,this._handler.mouseEnterEvent)}},e.prototype._resetClickTimeout=function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null,this._clickPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}},e.prototype._resetTapTimeout=function(){null!==this._tapTimeoutId&&clearTimeout(this._tapTimeoutId),this._tapCount=0,this._tapTimeoutId=null,this._tapPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}},e.prototype._mouseMoveHandler=function(e){if(!this._mousePressed&&null===this._touchMoveStartPosition&&!this._firesTouchEvents(e)){var t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handler.mouseMoveEvent)}},e.prototype._touchMoveHandler=function(e){if(this._lastTouchEventTimeStamp=d(e),null===this._startPinchMiddlePoint&&!this._preventTouchDragProcess){this._pinchPrevented=!0;var t=this._touchMouseMoveWithDownInfo(u(e),Object(r.ensureNotNull)(this._touchMoveStartPosition)),i=t.xOffset,n=t.yOffset,s=t.manhattanDistance;if(this._touchMoveExceededManhattanDistance||!(s<5)){if(!this._touchMoveExceededManhattanDistance){var a=.5*i,l=n>=a&&!this._options.treatVertTouchDragAsPageScroll,c=a>n&&!this._options.treatHorzTouchDragAsPageScroll;l||c||(this._preventTouchDragProcess=!0),this._touchMoveExceededManhattanDistance=!0,this._cancelTap=!0,this._clearLongTapTimeout(),this._resetTapTimeout()}if(!this._preventTouchDragProcess){var h=this._makeCompatEvent(e);this._processTouchEvent(h,this._handler.touchMoveEvent),Object(o.a)(e)}}}},e.prototype._mouseMoveWithDownHandler=function(e){if(0===e.button&&(this._touchMouseMoveWithDownInfo(u(e),Object(r.ensureNotNull)(this._mouseMoveStartPosition)).manhattanDistance>=5&&(this._cancelClick=!0,this._resetClickTimeout()),this._cancelClick)){var t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handler.pressedMouseMoveEvent)}},e.prototype._touchMouseMoveWithDownInfo=function(e,t){var i=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y);return{xOffset:i,yOffset:n,manhattanDistance:i+n}},e.prototype._touchEndHandler=function(e){this._lastTouchEventTimeStamp=d(e),this._clearLongTapTimeout(),this._touchMoveStartPosition=null,this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);var t=this._makeCompatEvent(e);(this._processTouchEvent(t,this._handler.touchEndEvent),++this._tapCount,this._tapTimeoutId&&this._tapCount>1)?(this._touchMouseMoveWithDownInfo(u(e),this._tapPosition).manhattanDistance<30&&!this._cancelTap&&this._processTouchEvent(t,this._handler.doubleTapEvent),this._resetTapTimeout()):this._cancelTap||this._processTouchEvent(t,this._handler.tapEvent);0===this._tapCount&&Object(o.a)(e),0===e.touches.length&&this._longTapActive&&(this._longTapActive=!1,Object(o.a)(e))},e.prototype._mouseUpHandler=function(e){if(0===e.button){var t=this._makeCompatEvent(e);if(this._mouseMoveStartPosition=null,this._mousePressed=!1, this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),n.isFF)this._target.ownerDocument.documentElement.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp);if(!this._firesTouchEvents(e))if(this._processMouseEvent(t,this._handler.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1)this._touchMouseMoveWithDownInfo(u(e),this._clickPosition).manhattanDistance<5&&!this._cancelClick&&this._processMouseEvent(t,this._handler.mouseDoubleClickEvent),this._resetClickTimeout();else this._cancelClick||this._processMouseEvent(t,this._handler.mouseClickEvent)}},e.prototype._clearLongTapTimeout=function(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)},e.prototype._touchStartHandler=function(e){this._lastTouchEventTimeStamp=d(e);var t=this._target.ownerDocument.documentElement;this._cancelTap=!1,this._touchMoveExceededManhattanDistance=!1,this._preventTouchDragProcess=!1,this._touchMoveStartPosition=u(e),this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);var i=this._touchMoveHandler.bind(this),n=this._touchEndHandler.bind(this);this._unsubscribeRootTouchEvents=function(){t.removeEventListener("touchmove",i),t.removeEventListener("touchend",n)},t.addEventListener("touchmove",i,{passive:!1}),t.addEventListener("touchend",n,{passive:!1}),this._clearLongTapTimeout(),this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,e),240);var r=this._makeCompatEvent(e);this._processTouchEvent(r,this._handler.touchStartEvent),this._tapTimeoutId||(this._tapCount=0,this._tapTimeoutId=setTimeout(this._resetTapTimeout.bind(this),500),this._tapPosition=u(e))},e.prototype._wheelClickHandler=function(e){if(1===e.button&&!this._firesTouchEvents(e)){var t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handler.wheelClickEvent)}},e.prototype._mouseDownHandler=function(e){if(0===e.button){var t=this._target.ownerDocument.documentElement;n.isFF&&t.addEventListener("mouseleave",this._onFirefoxOutsideMouseUp),this._cancelClick=!1,this._mouseMoveStartPosition=u(e),this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null);var i=this._mouseMoveWithDownHandler.bind(this),r=this._mouseUpHandler.bind(this);if(this._unsubscribeRootMouseEvents=function(){t.removeEventListener("mousemove",i),t.removeEventListener("mouseup",r)},t.addEventListener("mousemove",i),t.addEventListener("mouseup",r),this._mousePressed=!0,!this._firesTouchEvents(e)){var o=this._makeCompatEvent(e);this._processMouseEvent(o,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500),this._clickPosition=u(e))}}},e.prototype._init=function(){var e=this;this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._clearLongTapTimeout.bind(this)) ;var t=this._target.ownerDocument,i=function(t){e._handler.mouseDownOutsideEvent&&(t.target&&e._target.contains(t.target)||e._handler.mouseDownOutsideEvent())};this._unsubscribeOutsideTouchEvents=function(){t.removeEventListener("touchstart",i)},this._unsubscribeOutsideMouseEvents=function(){t.removeEventListener("mousedown",i)},t.addEventListener("mousedown",i),t.addEventListener("touchstart",i,{passive:!0}),n.CheckMobile.iOS()&&(this._unsubscribeMobileSafariEvents=function(){e._target.removeEventListener("dblclick",e._onMobileSafariDoubleClick)},this._target.addEventListener("dblclick",this._onMobileSafariDoubleClick)),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("contextmenu",this._contextMenuHandler.bind(this)),this._target.addEventListener("touchstart",this._touchStartHandler.bind(this),{passive:!0}),Object(o.b)(this._target),this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._target.addEventListener(a,this._wheelClickHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",(function(){}),{passive:!1})},e.prototype._initPinch=function(){var e=this;void 0===this._handler.pinchStartEvent&&void 0===this._handler.pinchEvent&&void 0===this._handler.pinchEndEvent||(this._target.addEventListener("touchstart",(function(t){return e._checkPinchState(t.touches)}),{passive:!0}),this._target.addEventListener("touchmove",(function(t){if(2===t.touches.length&&null!==e._startPinchMiddlePoint&&void 0!==e._handler.pinchEvent){var i=h(t.touches[0],t.touches[1])/e._startPinchDistance;e._handler.pinchEvent(e._startPinchMiddlePoint,i),Object(o.a)(t)}}),{passive:!1}),this._target.addEventListener("touchend",(function(t){e._checkPinchState(t.touches)})))},e.prototype._checkPinchState=function(e){1===e.length&&(this._pinchPrevented=!1),2!==e.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(e)},e.prototype._startPinch=function(e){var t=this._target.getBoundingClientRect()||{left:0,top:0};this._startPinchMiddlePoint={x:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,y:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this._startPinchDistance=h(e[0],e[1]),void 0!==this._handler.pinchStartEvent&&this._handler.pinchStartEvent(),this._clearLongTapTimeout()},e.prototype._stopPinch=function(){null!==this._startPinchMiddlePoint&&(this._startPinchMiddlePoint=null,void 0!==this._handler.pinchEndEvent&&this._handler.pinchEndEvent())},e.prototype._mouseLeaveHandler=function(e){if(this._unsubscribeMousemove&&this._unsubscribeMousemove(),!this._firesTouchEvents(e)){var t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handler.mouseLeaveEvent)}},e.prototype._longTapHandler=function(e){var t=this._makeCompatEvent(e);this._processTouchEvent(t,this._handler.longTapEvent),this._processTouchEvent(t,this._handler.touchContextMenuEvent),this._cancelTap=!0,this._longTapActive=!0},e.prototype._contextMenuHandler=function(e){if(Object(o.a)(e),null===this._touchMoveStartPosition&&!this._firesTouchEvents(e)){ var t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handler.contextMenuEvent),this._cancelClick=!0}},e.prototype._firesTouchEvents=function(e){return e.sourceCapabilities&&void 0!==e.sourceCapabilities.firesTouchEvents?e.sourceCapabilities.firesTouchEvents:d(e)=r.targetMetaInfoVersion()||(r.migrateMetaInfo(e),void 0!==t&&r.migratePropState(t),Object(n.assert)(e._metainfoVersion===r.targetMetaInfoVersion()))}))}u.sort((function(e,t){return e.targetMetaInfoVersion()-t.targetMetaInfoVersion()}))},SqfW:function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return a}));var n=i("mrSG"),r=i("tqok"),o=i("hsV8");function s(e,t){if(e.index>=t.length)return null;var i=t[e.index];return i===r.a?null:{startPrice:e.startPrice,endPrice:e.endPrice,index:i,extendTop:e.extendTop,extendBottom:e.extendBottom}}function a(e,t,i){var r=Object(o.ensureTimePointIndexIndex)(i.indexOf(e.index));return Object(n.a)(Object(n.a)({id:t},e),{index:r})}},Ss5c:function(e,t,i){"use strict";var n=i("Eyy1").ensureDefined,r=i("aO4+").Point,o=i("dOnf").deepCopy,s=i("4TVt").LineToolPriceAxisView,a=i("fJhV").LineDataSourceTimeAxisView,l=i("mMWL"),c=i("LxhU").Interval,u=i("pPtI").getServerInterval,h=i("txPx").getLogger("Chart.LineDataSource"),d=i("FQhm"),p=i("aIyQ"),f=i("tc+8"),_=i("hayr").propertyPages,m=i("WkOR").areEqualSymbols,v=i("Kxc7"),y=i("n5al").symbolCurrency,g=i("n5al").symbolOriginalCurrency,b=i("0qMc").lineToolsLocalizedNames,S=v.enabled("datasource_copypaste"),w=i("ng+v").LineDataSourceBase;function P(e,t){w.call(this,e,t),this._onTemplateApplying=new p,this._onTemplateApplied=new p,this._onIsActualIntervalChange=new p,this._properties.hasChild("symbol")||this._properties.addChild("symbol",new f(e.mainSeries().symbol())),this._properties.hasChild("interval")||this._properties.addChild("interval",new f(e.mainSeries().interval())),this._sourceHiddenPrevValue=!1,this._sourceHiddenChangedTimeoutId=null,this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,P.prototype.calcIsActualSymbol);var i=this;if(this._properties.listeners().subscribe(this,(function(){i.propertiesChanged()})),this._createPointsProperties(),this.pointsCount()>0)for(var n=0;n=i.multiplier()&&(t=e.key)})),t},P.prototype.calcIsActualSymbol=function(){var e=this._properties.symbol,t=this._model.mainSeries(),i=e.value();if(this._isActualSymbol=t.symbolSameAsCurrent(i),this._isActualSymbol){var n=t.symbol();m(i,n)||(h.logWarn('Possible drawing "migrating" detected from "'+i+'" to "'+n+'"'),h.logWarn("Series symbolInfo: "+JSON.stringify(t.symbolInfo())),h.logWarn((new Error).stack)),e.setValue(n)}this.calcIsActualInterval(),this.calcIsActualCurrency(),this._onSourceHiddenMayChange()},P.prototype.calcIsActualCurrency=function(){var e=this.ownerSource();if(null!==e){var t=this._properties.currencyId.value();if(null!==t)this._isActualCurrency=t===this.ownerSource().symbolSource().currency();else{var i=e.symbolSource().symbolInfo();this._isActualCurrency=null!==i&&y(i)===g(i)}this._onSourceHiddenMayChange()}else this._isActualCurrency=!1},P.prototype.calcIsActualInterval=function(){var e=this._isActualInterval,t=this._properties,i=this._model.mainSeries(),n=c.parse(i.interval()),r=t.intervalsVisibilities;if(this._isActualInterval=!1,n.isTicks()&&(this._isActualInterval=r.ticks.value()),n.isSeconds()&&n.multiplier()<60){var o=r.seconds.value(),s=r.secondsFrom.value(),a=r.secondsTo.value();this._isActualInterval=o&&n.multiplier()>=s&&n.multiplier()<=a}if(n.isSeconds()&&n.multiplier()>=60){var l=Math.floor(n.multiplier()/60);o=r.minutes.value(),s=r.minutesFrom.value(),a=r.minutesTo.value();this._isActualInterval=o&&l>=s&&l<=a}if(n.isMinutes()&&n.multiplier()<60){o=r.minutes.value(),s=r.minutesFrom.value(),a=r.minutesTo.value() ;this._isActualInterval=o&&n.multiplier()>=s&&n.multiplier()<=a}if(n.isMinutes()&&n.multiplier()>=60){var u=Math.floor(n.multiplier()/60);o=r.hours.value(),s=r.hoursFrom.value(),a=r.hoursTo.value();this._isActualInterval=o&&u>=s&&u<=a}if(n.isDays()){o=r.days.value(),s=r.daysFrom.value(),a=r.daysTo.value();this._isActualInterval=o&&n.multiplier()>=s&&n.multiplier()<=a}if(n.isWeeks()&&(this._isActualInterval=r.weeks.value()),n.isMonths()&&(this._isActualInterval=r.months.value()),n.isRange()&&(this._isActualInterval=r.ranges.value()),!this._isActualInterval&&this._model.selection().isSelected(this)){var h=this;this._model.selectionMacro((function(e){e.removeSourceFromSelection(h)}))}this._isActualInterval!==e&&this._onIsActualIntervalChange.fire(),this._onSourceHiddenMayChange()},P.prototype.priceScale=function(){return this._ownerSource?this._ownerSource.m_priceScale:null},P.prototype.symbol=function(){return this._properties.symbol.value()},P.prototype.properties=function(){return this._properties},P.prototype.isSavedInStudyTemplates=function(){return!1},P.prototype.state=function(e){var t={type:TradingView.className(this.constructor),id:this.id(),state:this.properties().state(this._propertiesStateExclusions()),points:o(this._timePoint),zorder:this.zorder(),linkKey:this.linkKey};return delete t.state.points,e&&(t.indexes=this._points),this.ownerSource()&&(t.ownerSource=this.ownerSource().id()),this.isFixed()&&(t.positionPercents=this._positionPercents||this.calcPositionPercents()),"version"in this&&1!==this.version&&(t.version=this.version),this.hasAlert.value()&&(t.alertId=this._alertId),t},P.prototype._propertiesStateExclusions=function(){return null},P.prototype.template=function(){return this.properties().preferences()},P.prototype.applyTemplate=function(e){this._onTemplateApplying.fire(e),this._applyTemplateImpl(e),this.calcIsActualSymbol(),this.updateAllViews(),this.model().lightUpdate(),this._onTemplateApplied.fire()},P.prototype._applyTemplateImpl=function(e){var t=this.properties();t.mergePreferences(e),t.saveDefaults(),this.propertiesChanged()},P.prototype.clearData=function(){this._points=[]},P.prototype.denormalizeTimePoints=function(){for(var e=[],t=0;t0&&(this._points=e)},P.prototype.restorePoints=function(e,t,i){this._timePoint=o(e),this._points=t,i||this.denormalizeTimePoints()},P.prototype.restoreExternalState=function(e){this.properties().mergeAndFire(e)},P.prototype.restorePositionPercents=function(e){this._positionPercents=e},P.prototype.getLinkKey=function(){return this.linkKey||null},P.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},P.prototype.propertiesChanged=function(e){this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),e||this._syncLineStyleIfNeeded()},P.prototype._syncLineStyleIfNeeded=function(){if(!this._syncLineStyleMuted&&this.linkKey){ var e=this.properties().state(this._syncStateExclusions);delete e.interval,l.changeLineStyle({linkKey:this.linkKey,state:e,model:this._model})}},P.prototype._muteSyncLineStyle=function(){this._syncLineStyleMuted=!0},P.prototype._unmuteSyncLineStyleWithoutApplyingChanges=function(){this.propertiesChanged(),this._syncLineStyleMuted=!1},P.prototype.points=function(){for(var e=[],t=0;t=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),i},P.prototype.addPoint=function(e,t,i){var n=this._preparePoint(e,t);return this._addPointIntenal(n,t,i)},P.prototype._addPointIntenal=function(e,t,i){this._points.push(e);var n=this._points.length===this.pointsCount();return n?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=e,this._pointAdded.fire(this._points.length-1),n},P.prototype.addFixedPoint=function(e){this._fixedPoints.push(e);var t=this._fixedPoints.length===this.pointsCount();return t&&this.calcPositionPercents(),t},P.prototype.calcPositionPercents=function(){if(!this.priceScale()||this.priceScale().isEmpty())return[];this._positionPercents=[];for(var e=0;e0&&this.normalizePoints(),0!==this._timePoint.length))){this._currentPointsetId=++P._pointSetId;for(var e=this._model.mainSeries().symbolId(),t=[],i=0;i0&&(o=-o),o},t.prototype._reversePoints=function(){var e=this._points,t=e[0],i=e[1];this._points[0]=i,this._points[1]=t,this.normalizePoints(),this.restart()},t}(o.LineDataSource)},TG9i:function(e,t,i){"use strict";i.r(t),i.d(t,"HHistDataWindowView",(function(){return p}));var n=i("mrSG"),r=i("Eyy1"),o=i("ivNn"),s=i("4miz"),a=i("nEwK"),l=i("qFKp"),c=i("e92V"),u=i("mMWL"),h=l.CheckMobile.any(),d=window.t("n/a"),p=function(e){function t(t,i){var n=e.call(this)||this;n._invalidated=!0,n._study=t,n._model=i,n._header=n._study.title(!0);var o=n._study.metaInfo().graphics.hhists;if(void 0===o)return n;var a=0;for(var l in o)if(o.hasOwnProperty(l)){var c=Object(r.ensureDefined)(o[l]);c.titles.length>a&&(a=c.titles.length)}a>1&&a++ ;for(var u=n._na(),h=0;hi)&&(i=n)})),i}(e,t);if(null===n)return null;var r=e.get(n);if(!r||0===r.size)return null;return o=r,s=i,a=null,o.forEach((function(e){e.priceLow<=s&&s1&&t===u.colors.childCount()){var r=s.rate.reduce((function(e,t){return e+t}),0);return e.setValue(h.format(r)),void e.setColor(u.valuesColor.value())}e.setValue("")}}))}}}}},t}(s.b)},TMWk:function(e,t,i){"use strict";var n=i("Eyy1").assert,r=i("ogJP").clone,o=i("GVHu").Study,s=i("k9/m").PlotList,a=i("w4Ji").studyPlotFunctionMap,l=i("w4Ji").studyEmptyPlotValuePredicate;function c(e,t,i,n){o.call(this,e,t,i,n),this._underlyingData=new s(a(n),l)}inherit(c,o),c.prototype.clearData=function(){o.prototype.clearData.call(this),this._underlyingData.clear()},c.prototype._mergeData=function(e){this._invalidateLastNonEmptyPlotRowCache();var t=this._underlyingData.firstIndex();this._underlyingData.merge(e),t!==this._underlyingData.firstIndex()&&(this.m_data=new s(a(this._metaInfo),l));var i=this.m_data.lastIndex();this._underlyingData.range(i,this._underlyingData.lastIndex()).each(function(e,t){return this.m_data.add(e,r(t)),!1}.bind(this)),this._plotsForStrategyProcessing().forEach((function(e){this._createStrategy(e.strategy,e.strategyIndex,e.targetIndex,i).rebuildData(this.m_data)}),this)},c.prototype._plotsForStrategyProcessing=function(){ var e=["dataoffset"],t=[];return this._metaInfo.plots.forEach((function(i,r){if(e.indexOf(i.type)>-1){var o=null;this._metaInfo.plots.forEach((function(e,t){e.id===i.target&&(o=t)})),n(o>=0,"target plot not found for strategy plot "+i.id);var s={strategy:i.type,strategyIndex:r,targetIndex:o};t.push(s)}}),this),t},c.prototype._createStrategy=function(e,t,i,n){return new c["Strategy_"+e](t,i,n)},c.Strategy_dataoffset=function(e,t,i){this._strategyPlotIndex=e,this._targetPlotIndex=t,this._startIndex=i},c.Strategy_dataoffset.prototype.rebuildData=function(e){var t=this._targetPlotIndex+1,i=this._strategyPlotIndex+1,n=null,r=null;e.range(this._startIndex||e.firstIndex(),e.lastIndex()).each((function(o,s){var a=s[t],l=s[i]?Math.round(s[i]):null;if(s[t]=null,s[i]=null,!l||l>0)return!1;var c=o+l,u={pointIndex:c,value:a};if(r){if(r.pointIndex!==u.pointIndex){c>=0&&(e.valueAt(c)[t]=a);var h=!1;n&&(h=n.value<=r.value&&r.value<=a||n.value>=r.value&&r.value>=a),h?r.pointIndex>=0&&(e.valueAt(r.pointIndex)[t]=null):n=r,r=u}}else r=u;return!1}))},t.study_ScriptWithDataOffset=c},TTFo:function(e,t,i){"use strict";i.r(t),i.d(t,"fromPercent",(function(){return o})),i.d(t,"toPercent",(function(){return s})),i.d(t,"toPercentRange",(function(){return a})),i.d(t,"fromIndexedTo100",(function(){return l})),i.d(t,"toIndexedTo100",(function(){return c})),i.d(t,"toIndexedTo100Range",(function(){return u})),i.d(t,"toLog",(function(){return h})),i.d(t,"fromLog",(function(){return d}));var n=i("Qb4w"),r=i("Hr11");function o(e,t){return t<0&&(e=-e),e/100*t+t}function s(e,t){var i=100*(e-t)/t;return t<0?-i:i}function a(e,t){var i=s(e.minValue(),t),r=s(e.maxValue(),t);return new n.PriceRange(i,r)}function l(e,t){return t<0&&(e=-e),(e-=100)/100*t+t}function c(e,t){var i=100*(e-t)/t+100;return t<0?-i:i}function u(e,t){var i=c(e.minValue(),t),r=c(e.maxValue(),t);return new n.PriceRange(i,r)}function h(e){var t=Math.abs(e);if(t<1e-8)return 0;var i=Object(r.log10)(t+1e-4)+4;return e<0?-i:i}function d(e){var t=Math.abs(e);if(t<1e-8)return 0;var i=Math.pow(10,t-4)-1e-4;return e<0?-i:i}},TcSq:function(e,t,i){"use strict";function n(e){return e===r(e)}function r(e){var t=e.indexOf("$"),i=e.indexOf("@");return t<0&&i>=0?null:e.substring(Math.max(t+1,0),i>=0?i:e.length)}function o(e){return e.startsWith("PUB;")}function s(e){return e.startsWith("USER;")}function a(e){return e.startsWith("STD;")}function l(e){return e.includes("Candlestick%1Pattern%1")}i.r(t),i.d(t,"isPineIdString",(function(){return n})),i.d(t,"extractPineId",(function(){return r})),i.d(t,"isPublishedPineId",(function(){return o})),i.d(t,"isCustomPineId",(function(){return s})),i.d(t,"isStandardPineId",(function(){return a})),i.d(t,"isCandleStickId",(function(){return l}))},TlGQ:function(e,t,i){"use strict";i.r(t),i.d(t,"visitObject",(function(){return o}));var n=i("ogJP");function r(e,t,i){return Object(n.isArray)(e)?function(e,t,i){return e.map((function(e){var n=r(e,t,i),o=t(n);return void 0!==o?o:n})) }(e,t,i):Object(n.isObject)(e)&&(Object(n.isHashObject)(e)||i&&i.visitInstances)?function(e,t,i){var n={};return Object.keys(e).forEach((function(o){var s=r(e[o],t,i),a=t(s);n[o]=void 0!==a?a:s})),n}(e,t,i):e}function o(e,t,i){var n=r(e,t,i),o=t(n);return void 0!==o?o:n}},TmNs:function(e,t,i){"use strict";i.r(t);var n=i("mrSG"),r=i("KcY8"),o=i("Eyy1"),s=i("jFln"),a=i("8Uy/"),l=i("gAom"),c=function(){function e(e,t){this.setData(e,t)}return e.prototype.setData=function(e,t){this._data=e,this._commonData=t},e.prototype.draw=function(e,t,i,n,r,c){if(this._data.visible){var u=this._commonData.coordinate;void 0!==this._commonData.fixedCoordinate&&(u=this._commonData.fixedCoordinate),e.lineWidth=Math.max(1,Math.floor(Object(o.ensureDefined)(this._data.linewidth)*c)),e.lineCap="butt",Object(s.setLineStyle)(e,void 0===this._data.linestyle?a.LINESTYLE_DOTTED:this._data.linestyle),e.strokeStyle=this._commonData.color,Object(l.drawHorizontalLine)(e,Math.round(u*c),0,Math.ceil(n*c))}},e.prototype.height=function(e,t){return 0},e}();i.d(t,"PriceLineAxisView",(function(){return u})),i.d(t,"SeriesPriceLineAxisView",(function(){return h})),i.d(t,"StudyPriceLineAxisView",(function(){return d}));var u=function(e){function t(){return e.call(this,c)||this}return Object(n.c)(t,e),t.prototype._updateRendererData=function(e,t,i){if(t.visible=!1,e.visible=!1,this._isVisible()){var n=this._value();n.noData||(i.background="",i.color=this._priceLineColor(n.color),i.coordinate=n.coordinate,i.floatCoordinate=n.floatCoordinate,e.linewidth=this._lineWidth(),e.linestyle=this._lineStyle(),e.visible=!0)}},t.prototype._lineStyle=function(){return a.LINESTYLE_DOTTED},t}(r.a),h=function(e){function t(t){var i=e.call(this)||this;return i._series=t,i}return Object(n.c)(t,e),t.prototype._value=function(){return this._series.lastValueData(void 0,!0)},t.prototype._priceLineColor=function(e){return this._series.priceLineColor(e)},t.prototype._lineWidth=function(){return this._series.properties().priceLineWidth.value()},t.prototype._isVisible=function(){var e=this._series.model().properties().scalesProperties.showSeriesLastValue.value();return this._series.properties().showPriceLine.value()&&e},t}(u),d=function(e){function t(t,i){var n=e.call(this)||this;return n._study=t,n._plotname=i,n}return Object(n.c)(t,e),t.prototype._value=function(){return this._study.lastValueData(this._plotname,!0)},t.prototype._lineWidth=function(){return this._study.properties().styles[this._plotname].linewidth.value()},t.prototype._lineStyle=function(){return a.LINESTYLE_DOTTED},t.prototype._priceLineColor=function(e){return e},t.prototype._isVisible=function(){var e=this._study.model().properties().scalesProperties.showStudyLastValue.value();return this._study.properties().styles[this._plotname].trackPrice.value()&&e},t}(u)},Tmoa:function(e,t,i){"use strict";i.r(t),i.d(t,"generateColor",(function(){return r})),i.d(t,"alphaToTransparency",(function(){return o})),i.d(t,"transparencyToAlpha",(function(){return s})),i.d(t,"resetTransparency",(function(){return a})), i.d(t,"getLuminance",(function(){return l})),i.d(t,"isHexColor",(function(){return c})),i.d(t,"colorFromBackground",(function(){return u})),i.d(t,"gradientColorAtPercent",(function(){return h})),i.d(t,"isColorDark",(function(){return d}));var n=i("eJTA");function r(e,t,i){if(t=t||0,!c(e))return i?Object(n.rgbaToString)(Object(n.rgba)(Object(n.parseRgb)(e),Object(n.normalizeAlphaComponent)(s(t)))):e;var r=Object(n.parseRgb)(e),o=r[0],a=r[1],l=r[2],u=Object(n.normalizeAlphaComponent)(s(t));return Object(n.rgbaToString)([o,a,l,u])}function o(e){return 100*(1-e)}function s(e){if(e<0||e>100)throw new Error("invalid transparency");return 1-e/100}function a(e){return c(e)?e:Object(n.rgbaToString)(Object(n.rgba)(Object(n.parseRgb)(e),Object(n.normalizeAlphaComponent)(1)))}function l(e){var t=Object(n.parseRgb)(e).map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}));return Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e){return 0===e.indexOf("#")}function u(e){return"black"===Object(n.rgbToBlackWhiteString)(Object(n.parseRgb)(e),150)?"white":"black"}function h(e,t,i){var r=Object(n.parseRgba)(e),o=r[0],s=r[1],a=r[2],l=r[3],c=Object(n.parseRgba)(t),u=c[0],h=c[1],d=c[2],p=c[3],f=Object(n.rgba)(Math.round(o+i*(u-o)),Math.round(s+i*(h-s)),Math.round(a+i*(d-a)),l+i*(p-l));return Object(n.rgbaToString)(f)}function d(e){return l(a(e))<.5}},TohL:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolArrowMark",(function(){return c})),i.d(t,"LineToolArrowMarkLeft",(function(){return u})),i.d(t,"LineToolArrowMarkUp",(function(){return h})),i.d(t,"LineToolArrowMarkRight",(function(){return d})),i.d(t,"LineToolArrowMarkDown",(function(){return p}));var n=i("mrSG"),r=i("Ocx9"),o=i("Ss5c"),s=i("tc+8"),a=i.n(s),l=i("j3hX"),c=function(e){function t(n,r,o){var s=this,a=r||t.createProperties(null,o);return(s=e.call(this,n,a)||this)._textPaneView=null,i.e("lt-pane-views").then(function(e){var t=[new(0,i("ct+2").ArrowMarkPaneView)(s,n)];s._setPaneViews(t)}.bind(null,i)).catch(void 0),s}return Object(n.c)(t,e),t.prototype.paneViews=function(t){var i=e.prototype.paneViews.call(this);return null!==i&&this._textPaneView&&i.push(this._textPaneView),i},t.prototype.pointsCount=function(){return 1},t.prototype.template=function(){var t=e.prototype.template.call(this);return t.text=this.properties().childs().text.value(),t},t.createProperties=function(e,i){var n=new r.DefaultProperty(i,e);return t._configureProperties(n),n},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"5sLb")).then((function(e){return e.ArrowMarkDefinitionsViewModel}))},t.prototype._applyTemplateImpl=function(t){e.prototype._applyTemplateImpl.call(this,t),this.properties().childs().text.setValue(t.text)},t._configureProperties=function(e){o.LineDataSource._configureProperties(e),e.addChild("linesColors",new l.LineToolColorsProperty([e.childs().arrowColor])),e.addChild("textsColors",new l.LineToolColorsProperty([e.childs().color])), e.hasChild("text")||e.addChild("text",new a.a("")),e.addExclusion("text")},t.version=2,t}(o.LineDataSource),u=function(e){function t(t,i){return e.call(this,t,i,"linetoolarrowmarkleft")||this}return Object(n.c)(t,e),t.prototype.direction=function(){return"left"},t.prototype.name=function(){return"Arrow Mark Left"},t.prototype.textAlignParams=function(){return{horzAlign:"left",vertAlign:"middle",offsetX:22,offsetY:3}},t.createProperties=function(e){return c.createProperties(e,"linetoolarrowmarkleft")},t}(c),h=function(e){function t(t,i){return e.call(this,t,i,"linetoolarrowmarkup")||this}return Object(n.c)(t,e),t.prototype.direction=function(){return"up"},t.prototype.name=function(){return"Arrow Mark Up"},t.prototype.textAlignParams=function(){return{horzAlign:"center",vertAlign:"top",offsetX:0,offsetY:20}},t.createProperties=function(e){return c.createProperties(e,"linetoolarrowmarkup")},t}(c),d=function(e){function t(t,i){return e.call(this,t,i,"linetoolarrowmarkright")||this}return Object(n.c)(t,e),t.prototype.direction=function(){return"right"},t.prototype.name=function(){return"Arrow Mark Right"},t.prototype.textAlignParams=function(){return{horzAlign:"right",vertAlign:"middle",offsetX:22,offsetY:3,forceTextAlign:!0}},t.createProperties=function(e){return c.createProperties(e,"linetoolarrowmarkright")},t}(c),p=function(e){function t(t,i){return e.call(this,t,i,"linetoolarrowmarkdown")||this}return Object(n.c)(t,e),t.prototype.direction=function(){return"down"},t.prototype.name=function(){return"Arrow Mark Down"},t.prototype.textAlignParams=function(){return{horzAlign:"center",vertAlign:"bottom",offsetX:0,offsetY:20}},t.createProperties=function(e){return c.createProperties(e,"linetoolarrowmarkdown")},t}(c)},"U0+/":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyMetaInfoRepository",(function(){return u}));i("YFKU");var n=i("Eyy1"),r=i("0YCj"),o=i.n(r),s=i("Si3H"),a=i("lCO3"),l=i("txPx"),c=Object(l.getLogger)("Chart.Studies.StudyMetaInfoRepository",{color:"#606"}),u=function(){function e(e){this._nextRequestNumber=1,this._rawStudiesMetaInfo=[],this._isReady=!1,this._metaInfoQueryQueue=[],this._javaMetaInfoQueryQueue=[],this._javaStudiesMetaInfo=[],this._pineMetaInfoCache=[],this._studiesMigrations=[],this._gateway=e}return e.prototype.requestMetaInfo=function(){var e=this;this._requestStarted();var t=this._makeNextRequestId();return c.logNormal("Requesting metainfo #"+t),new Promise((function(i){c.logNormal("Requesting studies metadata #"+t),e._gateway.requestMetadata(t,(function(n){c.logNormal("Requesting studies metadata #"+t+" finished");var r=n.params[1].metainfo.slice();e._processLibraryMetaInfo(r),e._requestFinished(),i()}))}))},e.prototype.findById=function(e){if(!this._isReady)return this._enqueueMetaInfoQuery(e);var t=this._findStudyMetaInfo(e);return null!==t?Promise.resolve(t):"pine"===e.type?this._compilePine(e):Promise.reject("unexpected study id="+e.studyId+" with type="+e.type)},e.prototype.findByIdSync=function(e){return this._findStudyMetaInfo(e)},e.prototype.isReady=function(){return this._isReady },e.prototype.findAllJavaStudies=function(){return this._isReady?Promise.resolve(this._javaStudiesMetaInfo):this._enqueueJavaMetaInfoQuery()},e.prototype.getInternalMetaInfoArray=function(){return this._javaStudiesMetaInfo},e.prototype.getMigrations=function(){return this._studiesMigrations},e.prototype.addPineMetaInfo=function(e){return d(this._pineMetaInfoCache,e)},e.prototype._processMigrations=function(e){throw new Error("not implemented")},e.prototype._processSiteMetaInfo=function(e,t){throw new Error("not implemented")},e.prototype._processLibraryMetaInfo=function(e){for(var t=0,i=e;tn?1:i50)){var i=0,n=T(this._position1,this._position2,this._maxSpeed),r=C(this._position1,this._position2),o=[n],s=[r];if(i+=r,null!==this._position3){var a=T(this._position2,this._position3,this._maxSpeed);if(Math.sign(a)===Math.sign(n)){var l=C(this._position2,this._position3);if(o.push(a),s.push(l),i+=l,null!==this._position4){var c=T(this._position3,this._position4,this._maxSpeed);if(Math.sign(c)===Math.sign(n)){var u=C(this._position3,this._position4);o.push(c),s.push(u),i+=u}}}}for(var h,d,p,f=0,_=0;_=0&&e.h>=0,"Try to set invalid size to PaneWidget "+JSON.stringify(e)),this._size.equals(e)||(this._size=e,this._canvasBinding.resizeCanvas({width:e.w,height:e.h}),this._topCanvasBinding.resizeCanvas({width:e.w,height:e.h}),this._paneCell.style.width=e.w+"px",this._paneCell.style.height=e.h+"px",this._div.style.width=e.w+"px",this._div.style.height=e.h+"px",this._rowElement.classList.toggle("js-hidden",0===e.h),null!==this._legendWidget&&this._legendWidget.updateWidgetModeBySize(e),null!==this._paneControls&&this._paneControls.updateWidgetModeByWidth(e.w))},e.prototype.width=function(){return this._size.w},e.prototype.height=function(){return this._size.h},e.prototype.backgroundColor=function(){return this._chartModel().backgroundColor().value()},e.prototype.processDoubleClickOnSource=function(e,t){e.id()!==this._lastFinishedToolId&&this._showEditDialogForSource(e,t)},e.prototype.setCursorForTool=function(e,t,i){var n=v.tool.value();if(t&&t.control()&&e)this._setCursorClassName("pointer");else if(void 0===i){if(Object(v.toolIsCursor)(n)){if(this._chart.draggingSource||this._isScrolling||this._chartUndoModel()&&this._chartUndoModel().model().sourcesBeingMoved().length)return void this._setCursorClassName("grabbing");if(e&&this._options.sourceSelectionEnabled)return void this._setCursorClassName("pointer")}if("eraser"!==n)if("zoom"!==n){var r=v.cursorTool.value();"dot"!==r?"arrow"!==r?this._setCursorClassName(""):this._setCursorClassName("default"):this._setCursorClassName("dot")}else this._setCursorClassName("zoom-in");else this._setCursorClassName("eraser")}else switch(i){case j.PaneCursorType.VerticalResize:this._setCursorClassName("ns-resize");break;case j.PaneCursorType.HorizontalResize:this._setCursorClassName("ew-resize");break;case j.PaneCursorType.DiagonalNeSwResize:this._setCursorClassName("nesw-resize");break;case j.PaneCursorType.DiagonalNwSeResize:this._setCursorClassName("nwse-resize");break;case j.PaneCursorType.Default:this._setCursorClassName("default");break;case j.PaneCursorType.Pointer:this._setCursorClassName("pointer")}},e.prototype.showContextMenuForSelection=function(e){var t=this._chartUndoModel().selection();if(!t.isEmpty()){var i=t.dataSources().filter((function(e){return e.hasContextMenu()}));this.showContextMenuForSources(i,e)}},e.prototype.showContextMenuForSources=function(e,t,i){return Object(n.b)(this,void 0,void 0,(function(){var r,o,s,a;return Object(n.d)(this,(function(n){switch(n.label){case 0:return e.length?(r=e[0],o=Object(c.merge)(Object(c.clone)(this._options.contextMenu),i||{}),s=new k.ActionsProvider(this._chart,o),r!==this._chartUndoModel().crossHairSource()?[3,1]:(r.handleContextMenuEvent(t), [2,Promise.resolve(null)])):[2,Promise.resolve(null)];case 1:return[4,s.contextMenuActionsForSources(e)];case 2:return 0===(a=n.sent()).length?[2,Promise.resolve(null)]:[2,E.ContextMenuManager.createMenu(a).then((function(e){return e.show(t),e}))];case 3:return[2]}}))}))},e.prototype.leftPriceAxisesContainer=function(){return this._lhsPriceAxisesContainer},e.prototype.rightPriceAxisesContainer=function(){return this._rhsPriceAxisesContainer},e.prototype.setPriceAxisSizes=function(e,t,i){this._priceAxisesContainer(e).setSizes(t,i)},e.prototype.state=function(){return Object(r.ensureNotNull)(this._state)},e.prototype.hasState=function(){return null!==this._state},e.prototype.setState=function(e){this._state!==e&&(this.hasState()&&(this.state().onDestroyed().unsubscribeAll(this),this.state().dataSourcesCollectionChanged().unsubscribeAll(this)),this._state=e,this.hasState()&&(this.state().onDestroyed().subscribe(this,this._onStateDestroyed,!0),this.state().dataSourcesCollectionChanged().subscribe(this,this._onDataSourcesCollectionChanged),this.updatePriceAxisWidgets()))},e.prototype.getScreenshotData=function(e){var t,i=[],n=[],r=[],o=this.state().sourcesByGroup().allExceptSpecialSources().slice().reverse(),s=this._chart.properties().childs().paneProperties.childs().legendProperties.childs();if(s.showLegend.value()||(null==e?void 0:e.showCollapsedLegend))for(var a=0,l=o;aG.InvalidationLevel.Cursor||e.priceScaleSideMaxLevel("right")>G.InvalidationLevel.Cursor)&&this.recalculatePriceScale(),this._lhsPriceAxisesContainer.paint(e.getterForPriceScaleInvalidationLevelBySide("left")),this._rhsPriceAxisesContainer.paint(e.getterForPriceScaleInvalidationLevelBySide("right"));var i=e.fullInvalidation();if(i!==G.InvalidationLevel.None){if(i>G.InvalidationLevel.Cursor){var n=Object(r.ensureNotNull)(this._canvasBinding.canvas.getContext("2d"));n.setTransform(1,0,0,1,0,0);var o=this._canvasRenderParams();this._drawBackground(n,o),this._state&&(this._drawSources(n,o),this._drawBarsMarks(n,o,t))}if(this._state){var s=Object(r.ensureNotNull)(this._topCanvasBinding.canvas.getContext("2d"));s.setTransform(1,0,0,1,0,0) ;o=this._topCanvasRenderParams();s.clearRect(0,0,Math.ceil(this._size.w*o.pixelRatio),Math.ceil(this._size.h*o.pixelRatio)),this._drawCrossHair(s,o),this._drawActiveLineTools(s,o)}}}},e.prototype.pasteImageAsLineTool=function(e){var t,i=this._chartModel().timeScale(),n=i.width(),o=Object(r.ensureNotNull)(this._state).height(),s=Object(r.ensureNotNull)(this._state).defaultPriceScale(),a=Object(r.ensureNotNull)(Object(r.ensureNotNull)(s.mainSource()).firstValue()),l={price:s.coordinateToPrice(o/2,a),index:i.coordinateToIndex(n/2)},c=Object(m.createLineToolProperties)("LineToolImage");null===(t=c.child("url"))||void 0===t||t.setValue(e),this._chartUndoModel().createLineTool(Object(r.ensureNotNull)(this._state),l,"LineToolImage",c)},e.prototype.cancelCreatingLineTool=function(){var e=this._chartUndoModel(),t=this._chartUndoModel().lineBeingCreated();if(t)if(t.pointsCount()<=0){var i=t.points();if(i.length>2){var n=i[i.length-2];e.continueCreatingLine(n),this._finishTool(t)}else e.cancelCreatingLine()}else e.cancelCreatingLine();null!==this._firstZoomPoint&&this.cancelZoom(),this.setCursorForTool()},e.prototype.cancelMeasuring=function(){this._chartUndoModel().crossHairSource().clearMeasure(),this.setCursorForTool()},e.prototype._topCanvasRenderParams=function(){return{pixelRatio:this._topCanvasBinding.pixelRatio,physicalWidth:this._topCanvasBinding.canvas.width,physicalHeight:this._topCanvasBinding.canvas.height,cssWidth:this._chartModel().timeScale().width(),cssHeight:this.height()}},e.prototype._canvasRenderParams=function(){return{pixelRatio:this._canvasBinding.pixelRatio,physicalWidth:this._canvasBinding.canvas.width,physicalHeight:this._canvasBinding.canvas.height,cssWidth:this._chartModel().timeScale().width(),cssHeight:this.height()}},e.prototype._tryExitTrackingMode=function(){this._exitTrackingModeOnNextTry&&(this._startTrackPoint=null,this._clearCursorPosition())},e.prototype._tryStartMeasure=function(e,t,i,n,r){return!(!Object(v.toolIsMeasure)(v.tool.value())||t.startMeasurePoint())&&(e.isTouch||this._preventCrossHairMove()||this._setCursorPosition(e.localX,e.localY,i),n=this._chartModel().magnet().align(n,r,this.state()),t.startMeasuring({price:n,index:r},this.state()),!0)},e.prototype._tryFinishMeasure=function(e,t){if(t.startMeasurePoint()&&!t.endMeasurePoint()){var i=t.price,n=t.index;return i=this._chartModel().magnet().align(i,n,this.state()),t.finishMeasure({price:i,index:n}),Object(v.resetToCursor)(),this._preventCrossHairMove()&&this._clearCursorPosition(),!0}return!1},e.prototype._tryStartZoom=function(e,t,i,n){var r=this._chart.model().model().zoomEnabled();if("zoom"===v.tool.value()&&r){var o=this._chartUndoModel(),s=o.timeScale().indexToCoordinate(i)-.5*o.timeScale().barSpacing();return this._firstZoomPoint={price:t,index:i,x:s,y:e.localY},this._preventCrossHairMove()||this._setCursorPosition(e.localX,e.localY,n),this._chartModel().crossHairSource().startSelection(this.state()),!0}return!1},e.prototype._tryFinishZoom=function(e){return null!==this._firstZoomPoint&&(this._finishZoom(e),!0)}, e.prototype._tryHandleEraserMouseDown=function(e,t){if(e.source&&"eraser"===v.tool.value()&&!e.isCustom&&(!(r=e.source)||!r.customization||!r.customization.disableErasing)){var i=this._chartUndoModel();if(null!==e.hittest&&(Object(m.isLineTool)(e.source)||Object(f.isStudy)(e.source))){var n=e.hittest.eraseMarker();return t.control()&&void 0!==n&&e.source.processErase?e.source.processErase(i,n):i.removeSource(e.source,!1),!0}}var r;return!1},e.prototype._tryStartChangingLineTool=function(e,t,i,n){var o,s;if(e.isTouch&&null!==this._startTrackPoint)return!1;if((!e.isTouch||!this._preventSourceChange)&&t.hittest&&Object(m.isLineTool)(t.source)&&t.hittest.result()===h.HitTestResult.CHANGEPOINT){var a=this._chartUndoModel(),l=Object(r.ensure)(null===(o=this.state().mainDataSource())||void 0===o?void 0:o.firstValue()),c=Object(r.ensureNotNull)(t.source.priceScale()).coordinateToPrice(e.localY,l);a.selectionMacro((function(e){e.clearSelection(),e.addSourceToSelection(t.source)}));var u=a.model().magnet().align(c,n,this.state()),d=null===(s=t.hittest.data())||void 0===s?void 0:s.pointIndex;return this._startChangeLineToolParams={source:t.source,startPoint:{index:n,price:u},screenPoint:{x:e.localX,y:e.localY},pointIndex:d,envState:i},!0}return this._startChangeLineToolParams=null,!1},e.prototype._tryStartCloning=function(e,t,i,n){if(i.control()){var r=this._chartUndoModel().selection().dataSources().filter((function(e){return e.cloneable()}));if(n&&n.cloneable()&&r.push(n),r.length>0)return this._clonningAtMoveLineTools=r.map((function(e){return e.id()})),this._startCloningPoint=new o.Point(e.localX,e.localY),!0}return!1},e.prototype._tryFinishClonning=function(e,t){var i=this._chartUndoModel(),n=this._chartModel();if(t.control()&&this._clonningAtMoveLineTools){for(var s=new o.Point(e.localX,e.localY),a=Object(r.ensureNotNull)(this._startCloningPoint).subtract(s).length(),l=[],c=0,u=this._clonningAtMoveLineTools;c8){var p=this.cloneLineTools(l,!0).map((function(e){return Object(r.ensureNotNull)(i.model().dataSourceForId(e))}));i.selectionMacro((function(e){e.clearSelection(),p.forEach((function(t){e.addSourceToSelection(t)}))}));var f=new o.Point(e.localX,e.localY),_=Object(r.ensureNotNull)(p[0].priceScale()),m=Object(r.ensureNotNull)(this.state().mainDataSource()).firstValue(),v={index:i.timeScale().coordinateToIndex(e.localX),price:_.coordinateToPrice(e.localY,Object(r.ensureNotNull)(m))};i.startMovingSources(p,{logical:v,screen:f},null,t),this._clonningAtMoveLineTools=null,this._startCloningPoint=null}return!0}return!1},e.prototype._mouseDownEventForLineTool=function(e,t,i,n){var s,a;if(this.hasState()){var l=this._chartUndoModel(),c=!1,u=null,h=v.tool.value();Object(v.hideAllDrawings)().setValue(!1),Object(v.lockDrawings)().setValue(!1),e.isTouch&&(Object(m.isLineToolName)(h)&&!Object(B.isLineDrawnWithPressedButton)(h)||l.lineBeingCreated())&&this._initToolCreationModeParams(e);var d=l.lineBeingCreated() ;if(d&&!Object(B.isLineDrawnWithPressedButton)(d.toolname)){var p=Object(r.ensure)(null===(s=d.ownerSource())||void 0===s?void 0:s.firstValue());if(e.isTouch){if(!this._startTouchPoint){this._startTouchPoint=new o.Point(e.pageX,e.pageY);var f=d.points(),_=f[f.length-1],y=l.timeScale().indexToCoordinate(_.index),g=Object(r.ensureNotNull)(d.priceScale()).priceToCoordinate(_.price,p);return void(this._initCrossHairPosition=new o.Point(y,g))}}else{u=d;var b=l.model().paneForSource(d);if(b!==this._state&&null!==b){var S=this._externalPaneXCoord(b,e.localX),w=this._externalPaneYCoord(b,e.localY);c=l.continueCreatingLine({index:Math.round(l.timeScale().coordinateToIndex(S)),price:Object(r.ensure)(null===(a=d.priceScale())||void 0===a?void 0:a.coordinateToPrice(w,p))},t)}else{var P=l.model().magnet().align(n,i,this.state());c=l.continueCreatingLine({index:i,price:P},t)}}}else if(!e.isTouch||Object(B.isLineDrawnWithPressedButton)(h)){var C={index:i,price:P=l.model().magnet().align(n,i,this.state())};u=l.createLineTool(this.state(),C,h),l.lineBeingCreated()||(c=!0)}u&&l.selectionMacro((function(e){return e.addSourceToSelection(Object(r.ensureNotNull)(u))})),c&&u&&(this._finishTool(u),e.preventDefault())}},e.prototype._handleSelectionMouseDownAndGetJustDeselectedSource=function(e,t,i){var n=this._chartUndoModel(),r=null;if(null===t.source||t.source.isSelectionEnabled()){var o=e.isTouch?Boolean(t.hittest&&t.hittest.result()>=h.HitTestResult.MOVEPOINT_BACKGROUND):Boolean(t.hittest&&t.hittest.result()>h.HitTestResult.MOVEPOINT_BACKGROUND);this._preventSourceChange&&(o=!1),n.selectionMacro((function(e){var n;o&&t.source?(i.control()||e.selection().isSelected(t.source)||e.clearSelection(),i.control()&&e.selection().isSelected(t.source)?(r=t.source,e.removeSourceFromSelection(t.source)):e.addSourceToSelection(t.source,(null===(n=null==t?void 0:t.hittest)||void 0===n?void 0:n.data())||void 0),e.selection().allSources().length>1&&Object(F.trackEvent)("GUI","Multiselect","Click Select")):i.control()||e.clearSelection()}))}return r},e.prototype._processMouseMoveWhileZoom=function(e,t){this._preventCrossHairMove()||this._setCursorPosition(e.localX,e.localY,t)},e.prototype._setCursorPositionOnExternalPane=function(e,t,i,n){t=this._externalPaneXCoord(e,t),i=this._externalPaneYCoord(e,i),this._chart.paneByState(e)._setCursorPosition(t,i,n)},e.prototype._setCursorPosition=function(e,t,i){this._chartModel().setAndSaveCurrentPosition(this._correctXCoord(e),this._correctYCoord(t),this.state(),i)},e.prototype._setCursorClassName=function(e){var t="";e&&(t="pane--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._paneCell.classList.remove(this._currentCursorClassName),t&&this._paneCell.classList.add(t),this._currentCursorClassName=t,this._paneCell.style.cursor)},e.prototype._processMouseUpForCustomHandler=function(e){var t=Object(r.ensureNotNull)(this._dataSourceAtPoint(e.localX,e.localY));if(t.hittest&&t.hittest.result()===h.HitTestResult.CUSTOM){var i=t.hittest.data() ;Object(h.tryCallCustomHandler)(e,null==i?void 0:i.mouseUpHandler,null==i?void 0:i.touchEndHandler)}},e.prototype._crossHairShouldBeVisible=function(){var e=this._chartModel().crossHairSource();return Object(m.isLineToolName)(v.tool.value())||Object(v.toolIsMeasure)(v.tool.value())||e.startMeasurePoint()&&!e.endMeasurePoint()||null!==this._firstZoomPoint||null!==this._chartModel().lineBeingEdited()||null!==this._chartModel().lineBeingCreated()},e.prototype._clearCursorPosition=function(){this._chartModel().clearCurrentPosition()},e.prototype._dataSourceAtPoint=function(e,t){var i=null,r=null,s=null;if(!this.hasState())return null;var a=this.state(),l=a.height(),c=a.width(),u=!1,h=function(e,t,n,o){var a=s?s.result():0;e.result()>a&&(s=e,i=t,r=n,u=o)},p=this._canvasRenderParams(),f=new o.Point(e,t),_=this._chartUndoModel();this._hitTestChartSources(p,[_.crossHairSource()],f,h),this._hitTestCustomSources(p,a.customSources(d.a.Topmost),f,h);var m=a.sourcesByGroup();this._hitTestChartSources(p,m.tradingSources(),f,h),this._hitTestCustomSources(p,a.customSources(d.a.Foreground),f,h);var v=Object(n.f)(this._chartModel().multiPaneSources(a),m.hitTestSources());if(this._hitTestChartSources(p,v,f,h),this.containsMainSeries()){for(var y=_.barsMarksSources(),g=0;g=0;--l){var c=t[l],u=c.paneViews(o);if(0!==u.length)for(var h=u.length-1;h>=0;--h){var d=u[h].renderer(s,a);if(null!==d){var p=d.hitTest(i,e);null!==p&&n(p,c,d,!0)}}}},e.prototype._hitTestChartSources=function(e,t,i,n){for(var o=Object(r.ensureNotNull)(this._state),s=o.height(),a=o.width(),l=t.length;0=0;f--)ie[f].createDrawingsCaches();this._drawSourceImpl(e,t,Q,X,r.gridSource()),this._drawWatermark(e,t);for(var v=0,y=u;v=0;f--)ie[f].clearDrawingCaches()},e.prototype._drawSourceImpl=function(e,t,i,n,r,o){if(!o||!o.has(r.id())){var s=this.state(),a=s.height(),l=s.width(),c=i(r,this.state()) ;if(c)for(var u=0,h=c;u=0&&e.localXh.HitTestResult.MOVEPOINT_BACKGROUND||Object(a.lastEventIsTouch)())&&c.selectionMacro((function(e){e.clearSelection(),e.addSourceToSelection(Object(r.ensureNotNull)(q.source))}))}e.isTouch&&(this._touchMove=!1)}else{var K=c.lineBeingCreated();if(null!==K&&(Object(D.c)(K),K.finish()),(w=this.state().defaultPriceScale()).isEmpty())return;if(!K)return;var Z=Object(r.ensure)(null===(i=K.ownerSource())||void 0===i?void 0:i.firstValue()),J=w.coordinateToPrice(e.localY,Z);C={index:Math.round(c.timeScale().coordinateToIndex(e.localX)),price:J};c.continueCreatingLine(C)}}}},e.prototype._mouseOrTouchMoveEvent=function(e){if(this.hasState()){var t=Object(r.ensureNotNull)(this._dataSourceAtPoint(e.localX,e.localY));this._processMouseMoveForCustomHandler(t,e);var i=this._chartUndoModel();if(i){var n=i.crossHairSource();null!==this._initialCrosshairPositionBeforeAlign&&(this._initialCrosshairPositionBeforeAlign=new o.Point(n.originX(),n.originY()));var s=e.localX,a=e.localY,l=new p.EnvironmentState(e);if(null===this._firstZoomPoint){var c=!1;if(!(this._chart.readOnly()||this._editDialog&&this._editDialog.isVisible())){var u=v.tool.value(),d=null;if(!this._processing&&(Object(v.toolIsCursor)(u)||"eraser"===u||l.control()||!i.lineBeingCreated())){var f=t&&t.source,_=t&&t.hittest&&t.hittest.data();c=Boolean(_&&_.hideCrosshairLinesOnHover)||!!f&&Object(m.isLineTool)(f)&&-1!==K.indexOf(f.toolname),t.hittest&&t.hittest.result()>h.HitTestResult.MOVEPOINT_BACKGROUND?(d=t.source,t.source&&t.source.isHoveredEnabled()&&("eraser"!==u||t.source!==i.mainSeries())?i.model().setHoveredSource(t.source,t.hittest.data()):i.model().setHoveredSource(null,null)):i.model().setHoveredSource(null,null)}if(this._options.sourceSelectionEnabled)if(this._isSelectBarModeEnabled())this._setCursorClassName("pointer");else{var y,g=(y=t.hittest&&t.hittest.data())&&y.cursorType;this.setCursorForTool(d,l,null===g?void 0:g)}if(this._updateCommonTooltip(t),null!==t.hittest&&t.hittest.result()===h.HitTestResult.CUSTOM_MOVE)switch(g=(y=t.hittest.data()||{}).cursorType){case j.PaneCursorType.VerticalResize:this._setCursorClassName("ns-resize");break;case j.PaneCursorType.HorizontalResize:this._setCursorClassName("we-resize");break;case j.PaneCursorType.DiagonalNeSwResize: this._setCursorClassName("nesw-resize");break;case j.PaneCursorType.DiagonalNwSeResize:this._setCursorClassName("nwse-resize")}}if(this._preventCrossHairMove()&&this._clearCursorPosition(),n.setLinesShouldBeHidden(c),this._chart.readOnly()&&this._options.sourceSelectionEnabled&&(t.source&&t.source.isHoveredEnabled()?i.model().setHoveredSource(t.source,t.hittest&&t.hittest.data()):i.model().setHoveredSource(null,null)),!e.isTouch&&i.lineBeingCreated()){var b=i.lineBeingCreated(),S=null===b?null:i.model().paneForSource(b);if(null!==S&&S!==this._state)return void this._setCursorPositionOnExternalPane(S,s,a,l)}e.isTouch||this._setCursorPosition(s,a,l)}else this._processMouseMoveWhileZoom(e,l)}}},e.prototype._pressedMouseOrTouchMoveEvent=function(e){var t;if(this.hasState()&&!this._pinching){this._startChangeOrMoveLineToolIfNeeded(),e.isTouch&&(this._touchMove=!0,this._preventSourceChange=!1);var i=new p.EnvironmentState(e),n=this._chartUndoModel(),s=n.crossHairSource(),a=e.localX,l=e.localY;if(null!==this._initialCrosshairPositionBeforeAlign&&(this._initialCrosshairPositionBeforeAlign=new o.Point(s.originX(),s.originY())),null!==this._firstZoomPoint)return this._processMouseMoveWhileZoom(e),void(this._firstZoomPoint.draggingMode=!0);var c=v.tool.value();if(!(e.isTouch&&this._startTouchPoint&&Object(m.isLineToolName)(c))||Object(B.isLineDrawnWithPressedButton)(c)||n.lineBeingCreated()||this._isSelectBarModeEnabled()){var u=s.measurePane();if(e.isTouch&&this._startTouchPoint&&(Object(v.toolIsMeasure)(c)||null!==u))this._updateCrosshairPositionInToolCreationMode(e,u||this.state());else{var d=n.lineBeingCreated();if(e.isTouch&&d&&!Object(B.isLineDrawnWithPressedButton)(d.toolname)){if(this._startTouchPoint){var f=Object(r.ensureNotNull)(n.lineBeingCreated()),_=Object(r.ensureNotNull)(n.model().paneForSource(f));this._updateCrosshairPositionInToolCreationMode(e,_)}}else{if(e.isTouch&&null!==this._startTrackPoint){this._exitTrackingModeOnNextTry=!1;var y=Object(r.ensureNotNull)(this._initCrossHairPosition),g=new o.Point(a,l).subtract(this._startTrackPoint),b=y.add(g);this._setCursorPosition(b.x,b.y,i)}else e.isTouch&&this._preventCrossHairMove()||this._setCursorPosition(a,l,i);var S=this._isSelectBarModeEnabled();if(!Object(m.isLineToolName)(c)||Object(B.isLineDrawnWithPressedButton)(c)||S||i.control()){if(Object(B.isLineDrawnWithPressedButton)(c)&&!S){var w=this.state().defaultPriceScale();if(w.isEmpty())return;var P=n.lineBeingCreated();if(!P)return;var C=new o.Point(e.localX,e.localY),T=Object(r.ensure)(null===(t=P.ownerSource())||void 0===t?void 0:t.firstValue());return C.price=w.coordinateToPrice(e.localY,T),C.index=Math.round(n.timeScale().coordinateToIndex(e.localX)),void n.continueCreatingLine(C)}if(this._chart.draggingSource){var x=e.target,I=this._chart.paneByCanvas(x);I&&(I!==this?I.setDragToAnotherPaneCursor():I.setCursorForTool());var L=this._chart.timeAxisByCanvas(x);L&&L.setCursor("grabbing")}if(!n.timeScale().isEmpty()){var O=this._options.handleScroll ;if(O.pressedMouseMove&&!e.isTouch||(O.horzTouchDrag||O.vertTouchDrag)&&e.isTouch)if(n.customMoveBeingProcessed())n.processCustomMove(e);else{var M=n.model().customSourceMovingHitTestData();if(null===M||(n.model().processingCustomSourceMove(),Object(h.tryCallCustomHandler)(e,M.pressedMouseMoveHandler,M.touchMoveHandler),Object(h.shouldDefaultActionBeExecuted)(e,M,"pressedMouseMoveHandler","touchMoveHandler"))){if(n.model().lineBeingEdited())return n.changeLinePoint(new o.Point(a,l),i),void this.setCursorForTool();if(n.model().sourcesBeingMoved().length)this._alignSourcesThatBeingMoved(n.model().sourcesBeingMoved(),e.localX,e.localY,i);else if(!this._tryFinishClonning(e,new p.EnvironmentState(e))){var A=Object(v.toolIsMeasure)(c)||s.startMeasurePoint()&&s.endMeasurePoint();this._chart.readOnly()||!i.control()||Object(m.isLineToolName)(c)||A?(this._processScroll(e),this._preventScroll()&&!this._preventCrossHairMove()&&null===this._startTrackPoint&&this._setCursorPosition(e.localX,e.localY,new p.EnvironmentState(e))):this._isSelecting||(s.startSelection(this.state()),this._isSelecting=!0)}}}}}}}}else this._updateCrosshairPositionInToolCreationMode(e,this.state())}},e.prototype._mouseOrTouchLeaveEvent=function(e){if(this.hasState()){var t=this._chartUndoModel();if(t){if(e.isTouch||null!==t.crossHairSource().measurePane()||this._clearCursorPosition(),t.model().setHoveredSource(null,null),null!==this._prevHoveredHittest){var i=this._prevHoveredHittest.hittest&&this._prevHoveredHittest.hittest.data();Object(h.tryCallCustomHandler)(e,null==i?void 0:i.mouseLeaveHandler),this._prevHoveredHittest=null}this._updateCommonTooltip(null),this._chart.unsetActivePaneWidget()}}},e.prototype._mouseDoubleClickOrDoubleTapEvent=function(e){if(this.hasState()){var t=!this._chart.readOnly()&&!Object(m.isLineToolName)(v.tool.value())&&Object(r.ensureNotNull)(this._dataSourceAtPoint(e.localX,e.localY))||null;if(null!==t)if(t.isCustom){if(t.hittest&&t.hittest.result()===h.HitTestResult.CUSTOM){var i=t.hittest.data();Object(h.tryCallCustomHandler)(e,null==i?void 0:i.doubleClickHandler,null==i?void 0:i.doubleTapHandler)}}else{var n=t.hittest&&t.source||null;n&&t.hittest&&t.hittest.result()<=h.HitTestResult.MOVEPOINT_BACKGROUND&&!e.isTouch&&(n=null),n&&!n.isSelectionEnabled()&&(n=null),n?this.processDoubleClickOnSource(n,t.hittest?t.hittest:void 0):this._chart.readOnly()||Object(m.isLineToolName)(v.tool.value())||this._chartUndoModel().lineBeingCreated()||!this._chartUndoModel().selection().isEmpty()||this._chart.toggleMaximizePane(this)}}},e.prototype._contextMenuEvent=function(e){var t,i=this,n=this._chartUndoModel();if(!n.crossHairSource().startMeasurePoint()||this._trackCrosshairOnlyAfterLongTap){if(!this._pinching&&(null===this._firstZoomPoint||this._trackCrosshairOnlyAfterLongTap||this.cancelZoom(),!this.hideInplaceEditor())){if(!Object(v.toolIsCursor)(v.tool.value())||this._isSelectBarModeEnabled()){if(e.isTouch)return;return Object(v.resetToCursor)(!0),this.setCursorForTool(),void(n.lineBeingCreated()&&n.cancelCreatingLine())} if(this._options.contextMenuEnabled){var r=this._dataSourceAtPoint(e.localX,e.localY),o=r?r.source:null;if(e.isTouch&&null!==this._startTrackPoint){if(this._preventSourceChange)return;this._clearCursorPosition()}e.isTouch&&(this._contextMenuOpenedOnLastTap=!0,this._startTrackPoint=null),this._contextMenuX=e.localX,this._contextMenuY=e.localY;var s=r&&r.hittest?r.hittest.result():0,a=s>=h.HitTestResult.REGULAR||s>=h.HitTestResult.MOVEPOINT_BACKGROUND&&e.isTouch;if(this._chart.updateActions(),n.selectionMacro((function(t){null!==o&&a?t.selection().isSelected(o)||(t.clearSelection(),t.addSourceToSelection(o)):(i._options.contextMenu.general&&i._contextMenu(e).then((function(t){t.show(e)})),t.clearSelection())})),r&&a&&null!==o)if(Object(_.a)(o)&&o.hasContextMenu())o.isSelectionEnabled()?this.showContextMenuForSelection(e):this.showContextMenuForSources([o],e);else if((null===(t=r.hittest)||void 0===t?void 0:t.result())===h.HitTestResult.CUSTOM){var l=r.hittest.data();Object(h.tryCallCustomHandler)(e,null==l?void 0:l.contextMenuHandler,null==l?void 0:l.touchContextMenuHandler)}}}}else n.crossHairSource().clearMeasure()},e.prototype._onMouseEvent=function(){this._preventSourceChange=!1,this._startTrackPoint=null,this._trackCrosshairOnlyAfterLongTap=!1},e.prototype._onTouchEvent=function(){this._trackCrosshairOnlyAfterLongTap=!0},e.prototype._switchTrackingModeFromAnotherPaneIfNeeded=function(e){var t=this._chart.trackingModePaneWidget();if(null!==t&&t!==this){var i=this._chartModel().crossHairSource().currentPoint();this._chart.exitTrackingMode(),this.startTrackingMode(new o.Point(e.localX,e.localY),new o.Point(i.x,e.localY),new p.EnvironmentState(e))}},e.prototype._contextMenu=function(e){var t=function(e){return e instanceof W.Separator},i=this._customActions(),n=this._initActions(e).filter((function(e){return null!==e}));i.remove.forEach((function(e){for(var t=0;t0;o--)t(r[o])&&t(r[o-1])&&r.splice(o,1);return r.length&&t(r[0])&&r.splice(0,1),r.length&&t(r[r.length-1])&&r.splice(r.length-1,1),E.ContextMenuManager.createMenu(r,{statName:"ChartContextMenu"})},e.prototype._loadAndCreateLegendWidget=function(){var e=this;Promise.all([i.e(74),i.e(13),i.e("chart-widget-gui")]).then(i.bind(null,"sAH5")).then((function(t){if(!e._isDestroyed){var i=t.LegendWidget,n=Object(u.deepExtend)({},e._options.legendWidget);n.canShowSourceCode=!e._chart.onWidget()&&!s.CheckMobile.any(),n.readOnlyMode=n.readOnlyMode||e._chart.readOnly(),n.statusesWidgets={sourceStatusesEnabled:e._options.sourceStatusesWidgetEnabled,sourceStatuses:e._options.sourceStatusesWidget||{},marketStatusEnabled:e._options.marketStatusWidgetEnabled,marketStatus:e._options.marketStatusWidget||{},dataUpdateModeEnabled:e._options.chartWarningWidgetEnabled,dataUpdateMode:e._options.chartWarningWidget||{},dataProblemEnabled:e._options.dataProblemWidgetEnabled};var o=new L.a(e._getHideNotMainSourcesValue()) ;e._hideNotMainSourcesInLegendSpawn=Object(O.a)((function(){return{}}),e._chart.chartWidgetCollection().activeChartWidget,e._chart.chartWidgetCollection().lock.crosshair),e._hideNotMainSourcesInLegendSpawn.subscribe((function(){o.setValue(e._getHideNotMainSourcesValue())})),e._legendWidget=new i(e._chartUndoModel(),e,e._chart.backgroundTopTheme(),o,n,{showContextMenuForSelection:e.showContextMenuForSelection.bind(e),showContextMenuForSources:e.showContextMenuForSources.bind(e),updateActions:e._chart.updateActions.bind(e._chart),showChartPropertiesForSource:e._chart.showChartPropertiesForSource.bind(e._chart),showGeneralChartProperties:e._chart.showGeneralChartProperties.bind(e._chart),showObjectsTreeDialog:e._chart.showObjectsTreeDialog.bind(e._chart)}),e._div.appendChild(e._legendWidget.getElement()),e._legendWidget.updateLayout(),e._legendWidget.updateWidgetModeBySize(e._size),e._legendWidget.updateThemedColors(e._themedTopColor);for(var a=0,l=Array.from(e._customLegendWidgetsFactoryMap.keys());a0&&this._lineTools[0].isActualSymbol()&&this._lineTools[0].isActualCurrency()},e.prototype.symbol=function(){return this._lineTools[0].symbol()},e.prototype.containsLineTool=function(e){return this._lineToolsSet.has(e)},e.prototype.addLineTools=function(e){var t=this;this._doAndFireOnChange((function(i){var n;e.forEach((function(n){t._lineToolsSet.add(n),i.push.apply(i,e.map((function(e){return e.id()})))})),(n=t._lineTools).push.apply(n,e)}))},e.prototype.excludeLineTool=function(e){var t=this ;this._doAndFireOnChange((function(i){t._lineToolsSet.delete(e);var n=t._lineTools.indexOf(e);t._lineTools.splice(n,1),i.push(e.id())}))},e.prototype.excludeLineTools=function(e){var t=this;this._doAndFireOnChange((function(i){var n=new Set(e);e.forEach((function(e){return t._lineToolsSet.delete(e)})),t._lineTools=t._lineTools.filter((function(e){return!n.has(e)})),i.push.apply(i,e.map((function(e){return e.id()})))}))},e.prototype.state=function(){return{id:this.id,name:this._name,tools:this._lineTools.map((function(e){return e.id()}))}},e.prototype.visibility=function(){var e=this._lineTools.some(a),t=this._lineTools.some(l);return e&&!t?"Visible":t&&!e?"Invisible":"Partial"},e.prototype.locked=function(){var e=this._lineTools.some((function(e){return e.properties().frozen.value()})),t=this._lineTools.some((function(e){return!e.properties().frozen.value()}));return e&&!t?"Locked":t&&!e?"Unlocked":"Partial"},e.prototype.isActualInterval=function(){var e=this._lineTools.some((function(e){return e.isActualInterval()})),t=this._lineTools.some((function(e){return!e.isActualInterval()}));return e&&!t?"IsActualInterval":t&&!e?"IsNotActualInterval":"Partial"},e.prototype.onChanged=function(){return this._onChanged},e.fromState=function(t,i){for(var n=[],r=0,o=i.tools;r0?new e(n,i.name,i.id):null},e.prototype._doAndFireOnChange=function(e){var t=[],i=this.visibility(),n=this.locked(),r=this.name(),o=this.isActualInterval();e(t);var s={affectedLineTools:t,visibilityChanged:this.visibility()!==i,lockedChanged:n!==this.locked(),titleChanged:r!==this.name(),isActualIntervalChanged:o!==this.isActualInterval()};this._onChanged.fire(s)},e}()},V086:function(e,t,i){"use strict";var n=i("aO4+").Point,r=i("GEp6").distanceToLine,o=i("Ss5c").LineDataSource,s=i("Ocx9").DefaultProperty,a=i("j3hX").LineToolColorsProperty;function l(e,t){var n=t||l.createProperties();o.call(this,e,n),this.version=l.version,i.e("lt-pane-views").then(function(e){var t=i("obU/").EllipsePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(l,o),l.prototype.startChanging=function(e,t){if(o.prototype.startChanging.call(this,e,t),0===e||1===e){var i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],s=this.pointToScreenPoint(this._points[2])[0];this._dist=r(i,n,s).distance||0}},l.prototype._preparePoint=function(e,t){var i=this._preparePointInternal(e,t,!1);return t&&t.shift()&&this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],i),i},l.prototype._preparePointInternal=function(e,t,i){var r=Object.assign({},e);if(t&&t.shift()){var s=this.points().length;if(!this._fakePointAdded&&3===s&&!i)return r;if(this._fakePointAdded||2===s||i){this._snapPoint45Degree(e,this._points[0]),this._fakePointAdded?this._points[1]=e:i||(this._fakePointAdded=!0,o.prototype._addPointIntenal.call(this,e)) ;var a=this.pointToScreenPoint(this._points[0])[0],l=this.pointToScreenPoint(this._points[1])[0],c=l.x-a.x,u=l.y-a.y,h=Math.sqrt(c*c+u*u)/2,d=l.subtract(a),p=a.add(l).scaled(.5),f=new n(-d.y,d.x);f=f.normalized();var _=p.add(f.scaled(h));r=this.screenPointToPoint(_),(TradingView.isNaN(r.price)||TradingView.isNaN(r.index))&&(r=this.screenPointToPoint(p))}}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return r},l.prototype._fixVerticalDiameterPoints=function(e,t,i){var n=this.pointToScreenPoint(e)[0],r=this.pointToScreenPoint(t)[0],o=this._model.timeScale(),s=o.indexToCoordinate(e.index),a=o.indexToCoordinate(i.index),l=2*Math.abs(s-a);l*=t.price>e.price?1:-1,e.price=this.screenPointToPoint({x:n.x,y:r.y+l}).price},l.prototype.addPoint=function(e,t,i){var n=o.prototype.addPoint.call(this,e,t,i);return n&&(this._fakePointAdded=!1),n},l.prototype.setPoint=function(e,t,i){var o=Object.assign({},t),s=this.pointToScreenPoint(this._points[0])[0],a=this.pointToScreenPoint(this._points[1])[0],l=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:if(i&&i.shift()){this._snapPoint45Degree(o,this._points[1]),this._points[0]=o,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}s=this.pointToScreenPoint(o)[0];var c=a.subtract(s),u=s.add(a).scaled(.5);d=(d=new n(-c.y,c.x)).normalized(),l=u.add(d.scaled(this._dist)),l=this.screenPointToPoint(l),this._points[0]=o,this._points[2]=l;break;case 1:if(i&&i.shift()){this._snapPoint45Degree(o,this._points[0]),this._points[1]=o,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=(a=this.pointToScreenPoint(o)[0]).subtract(s),u=s.add(a).scaled(.5);d=(d=new n(-c.y,c.x)).normalized(),l=u.add(d.scaled(this._dist)),l=this.screenPointToPoint(l),this._points[1]=o,this._points[2]=l;break;case 2:o=this.pointToScreenPoint(o)[0];var h=r(s,a,o).distance;c=a.subtract(s),u=s.add(a).scaled(.5);d=(d=new n(-c.y,c.x)).normalized(),l=u.add(d.scaled(h)),l=this.screenPointToPoint(l),this._points[2]=l;break;case 3:o=this.pointToScreenPoint(o)[0];var d;h=r(s,a,o).distance,c=a.subtract(s),u=s.add(a).scaled(.5);d=(d=new n(-c.y,c.x)).normalized(),l=u.add(d.scaled(h)),l=this.screenPointToPoint(l),this._points[2]=l}this.normalizePoints()},l.prototype.pointsCount=function(){return 3},l.prototype.name=function(){return"Ellipse"},l.prototype.hasEditableCoordinates=function(){return!1},l.version=2,l.prototype.migrateVersion=function(e,t,i){if(1===e&&2===this._points.length){var n=this._points[0].price,r=.5*(this._points[0].price+this._points[1].price);this._points[0]={price:r,index:this._points[0].index},this._points[1]={price:r,index:this._points[1].index},this._points.push({price:n,index:this._points[0].index})}if(1===e&&2===this._timePoint.length){n=this._timePoint[0].price, r=.5*(this._timePoint[0].price+this._timePoint[1].price);this._timePoint[0].price=r,this._timePoint[1].price=r;var o={price:n,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t};this._timePoint.push(o)}},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Zd1D").GeneralFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l.createProperties=function(e){var t=new s("linetoolellipse",e);return l._configureProperties(t),t},l._configureProperties=function(e){o._configureProperties(e),e.addChild("linesColors",new a([e.childs().color]))},t.LineToolEllipse=l},V0al:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererXCross",(function(){return s}));var n=i("mrSG"),r=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._drawItemShapeUsingCSSPixels=function(e,t){var i=t.width,n=t.height,r=t.x-i/2,o=t.vertOffset,s=t.y-n/2+o;e.moveTo(r,s),e.lineTo(r+i,s+n),e.moveTo(r,s+n),e.lineTo(r+i,s)},t.prototype._calcBoundingBox=function(t){var i=t.width,n=t.height,r=t.x-i/2,s=t.vertOffset,a=t.y-n/2+s,l=r,c=r+i,u=a,h=a+n,d=new o.Point(l,u),p=new o.Point(c,h),f=Object(o.box)(d,p),_=e.prototype._calcBoundingBox.call(this,t);return _&&(f=this._unionBox(f,_)),f},t}(r.c)},V3Oj:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolText",(function(){return u})),i.d(t,"LineToolTextAbsolute",(function(){return h}));var n=i("mrSG"),r=i("Eyy1"),o=i("Ss5c"),s=i("tc+8"),a=i.n(s),l=i("Ocx9"),c=i("j3hX"),u=function(e){function t(n,r){var o=this,s=r||t.createProperties();return(o=e.call(this,n,s)||this)._barSpacing=n.timeScale().barSpacing(),i.e("lt-pane-views").then(function(e){var t=i("mr3a").TextPaneView;o._setPaneViews([new t(o,n)])}.bind(null,i)).catch(void 0),o}return Object(n.c)(t,e),t.prototype.setPoint=function(e,t,i){var n,r=this.properties().childs();if(0===e&&r.wordWrapWidth.value()){var o=this.model().timeScale();n=this.isFixed()?this.fixedPoints()[0].x:o.indexToCoordinate(this.points()[0].index);var s=o.indexToCoordinate(t.index)-n-~~(r.fontsize.value()/6);if(!isFinite(s))return;r.wordWrapWidth.setValue(Math.max(100,s))}},t.prototype.pointsCount=function(){return 1},t.prototype.name=function(){return"Text"},t.prototype.setPriceScale=function(t){e.prototype.setPriceScale.call(this,t),t&&t.priceRange()&&(this._priceDencity=t.height()/Object(r.ensureNotNull)(t.priceRange()).length(),this._isPriceDencityLog=t.isLog())},t.prototype.restoreSize=function(){var e=Object(r.ensureNotNull)(this.priceScale());this._barSpacing=this.model().timeScale().barSpacing(),this._priceDencity=e.height()/Object(r.ensureNotNull)(e.priceRange()).length(),this.updateAllViews(),this._model.updateSource(this)},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.prototype.template=function(){var t=e.prototype.template.call(this);return t.text=this.properties().childs().text.value(),t},t.prototype.state=function(t){ var i=e.prototype.state.call(this,t);return t&&(i.state.fixedSize=!1),i},t.prototype.barSpacing=function(){return this._barSpacing},t.prototype.priceDencity=function(){return this._priceDencity},t.prototype.isPriceDencityLog=function(){return this._isPriceDencityLog},t.prototype.hasEditableCoordinates=function(){return!1},t.createProperties=function(e){var i=new l.DefaultProperty("linetooltext",e);return t._configureProperties(i),i},t.prototype._applyTemplateImpl=function(t){e.prototype._applyTemplateImpl.call(this,t),this.properties().childs().text.setValue(t.text)},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"QWxu")).then((function(e){return e.TextDefinitionsViewModel}))},t._configureProperties=function(e){o.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new a.a(window.t("Text"))),e.addExclusion("text"),e.addChild("linesColors",new c.LineToolColorsProperty([e.childs().borderColor])),e.addChild("textsColors",new c.LineToolColorsProperty([e.childs().color])),e.addExclusion("linesColors"),e.addExclusion("textsColors")},t}(o.LineDataSource),h=function(e){function t(i,n){var r=n||t.createProperties();return e.call(this,i,r)||this}return Object(n.c)(t,e),t.prototype.name=function(){return"Anchored Text"},t.prototype.hasEditableCoordinates=function(){return!1},t.prototype.isFixed=function(){return!0},t.createProperties=function(e){var i=new l.DefaultProperty("linetooltextabsolute",e);return t._configureProperties(i),i},t._configureProperties=function(e){u._configureProperties(e)},t}(u)},VNzU:function(e,t,i){"use strict";i.r(t);var n=i("mrSG");i("Dq3s");i.d(t,"layouts",(function(){return s})),i.d(t,"isSingleLayout",(function(){return a})),i.d(t,"isMultipleLayout",(function(){return l}));var r,o={s:{title:"1 chart",count:1,sizer:function(e,t){if(0!==t)throw new RangeError("invalid index");return e}}};r={};var s=Object(n.a)(Object(n.a)({},o),r);function a(e){return"s"===e}function l(e){return!a(e)}},VVxS:function(e,t,i){"use strict";const{getLogger:n}=i("txPx"),r=n("TVLocalStorage");var o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(e){delete this.isAvailable,delete this.localStorage}this._updateLength();try{this._report()}catch(e){}};o.prototype._report=function(){if(this.isAvailable){const t=10,i=[];for(let e=0;et.length-e.length);const n=i.slice(0,t);i.sort((e,t)=>t.key.length-e.key.length);const o=i.slice(0,t);r.logNormal("Total amount of keys in Local Storage: "+this.length),r.logNormal(`Top ${t} keys with longest values: ${JSON.stringify(n)}`),r.logNormal(`Top ${t} longest key names: ${JSON.stringify(o)}`);try{navigator.storage.estimate().then(e=>{r.logNormal("Storage estimate: "+JSON.stringify(e))})}catch(e){}}},o.prototype.length=0,o.prototype.isAvailable=!1, o.prototype.localStorage={"tvlocalstorage.available":"false"},o.prototype._updateLength=function(){if(this.isAvailable)this.length=this.localStorage.length;else{var e,t=0;for(e in this.localStorage)this.localStorage.hasOwnProperty(e)&&t++;this.length=t}},o.prototype.key=function(e){return this.isAvailable?this.localStorage.key(e):Object.keys(this.localStorage)[e]},o.prototype.getItem=function(e){return this.isAvailable?this.localStorage.getItem(e):void 0===this.localStorage[e]?null:this.localStorage[e]},o.prototype.setItem=function(e,t){this.isAvailable?this.localStorage.setItem(e,t):this.localStorage[e]=t,this._updateLength()},o.prototype.removeItem=function(e){this.isAvailable?this.localStorage.removeItem(e):delete this.localStorage[e],this._updateLength()},o.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()};var s=function(e){this.storage=e};s.prototype.getItem=function(e){return Promise.resolve(this.storage.getItem(e))},s.prototype.setItem=function(e,t){return Promise.resolve(this.storage.setItem(e,t))},window.TVLocalStorage=new o,window.TVLocalStorageAsync=new s(window.TVLocalStorage),e.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},VaSN:function(e,t,i){"use strict";i.r(t),i.d(t,"lastEventIsTouch",(function(){return o})),i.d(t,"lastEventIsMouse",(function(){return s})),i.d(t,"setLastEventIsTouch",(function(){return a}));var n=i("qFKp"),r=Object(n.supportTouch)();function o(){return r}function s(){return r}function a(e){r=e}},VdBB:function(e,t,i){"use strict";function n(e,t,i){if(e.isTouch){if(void 0!==i)return!0}else if(void 0!==t)return!0;return!1}function r(e,t,i){if(e.isTouch){if(void 0!==i)return i(e),!0}else if(void 0!==t)return t(e),!0;return!1}function o(e,t,i,n){return void 0!==t.executeDefaultAction&&(e.isTouch?Boolean(t.executeDefaultAction[n]):Boolean(t.executeDefaultAction[i]))}i.r(t),i.d(t,"hasMouseOrTouchCustomHandler",(function(){return n})),i.d(t,"tryCallCustomHandler",(function(){return r})),i.d(t,"shouldDefaultActionBeExecuted",(function(){return o})),i.d(t,"HitTestResult",(function(){return s}));var s=function(){function e(e,t,i){this._result=e,this._data=t||null,this._eraseMarker=i}return e.prototype.result=function(){return this._result},e.prototype.data=function(){return this._data},e.prototype.eraseMarker=function(){return this._eraseMarker},e.MOVEPOINT_BACKGROUND=1,e.REGULAR=2,e.MOVEPOINT=3,e.CHANGEPOINT=4,e.CUSTOM=5,e.CUSTOM_MOVE=6,e}()},Vdly:function(e,t,i){"use strict";(function(e){i("qFKp");i("BHQF").fetch;var t=i("dTSQ").regExpEscape,n=i("FBuY").TVXWindowEvents,r=i("VVxS").TVLocalStorage,o=i("aIyQ"),s=i("Kxc7"),a=["s.tradingview.com","betacdn.tradingview.com"],l=s.enabled("use_localstorage_for_settings"),c=window.TVSettings=function(){var e=!1,i=null;function u(){return!i&&l}try{e=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(L){}if(e){var h={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0 },d=function(e,t,i){var n=h[e];return null==n?t:n},p=function(){};return{loaded:!1,loadedModel:!1,getValue:d,getJSON:d,getBool:d,getFloat:d,getInt:d,setValue:p,setJSON:p,remove:p,keys:function(){return Object.keys(h)},keysMask:function(){return[]},sync:p,onSync:{subscribe:function(){}}}}window.environment;var f,_=TradingView.onWidget()?"tradingview-widget":"tradingview",m={},v=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^domepanel.visible$/,/^orderpanel.visible$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^loadChartDialog.favorites$/,/^ChartFavoriteDrawingToolbarWidget\.visible/,/^trading\.chart\.proterty$/,/^trading_floating_toolbar\.position$/,/^trading\.orderWidgetMode\./,/^symbolWatermark$/,/^pinereference\.size$/,/^pinereference\.position$/,/^hint\.+/];function y(e){return _+"."+e}function g(e,t){var i=m[e];return null==i?t:i}function b(e,t,i){i=i||{};var n=""+t;return m[e]!==n&&(m[e]=n,w(e)),i.forceFlush&&!f&&(f=setTimeout((function(){f=void 0,P()}),10)),c}function S(e,t){return t=t||{},null!=m[e]&&(delete m[e],w(e)),t.forceFlush&&P(),c}function w(e){if(i)null==m[e]?i.removeValue(e):i.setValue(e,m[e]);else if(u())try{null==m[e]?r.removeItem(y(e)):r.setItem(y(e),m[e])}catch(L){}else 0;n.emit("settings",JSON.stringify({key:e,value:m[e]}))}function P(e){}function C(){return Object.keys(m)}function T(e){for(var t=0;t=0;o--)e.test(n[o])&&r.push(n[o]),e.lastIndex=0;return r},sync:function(e){i?x(i.initialSettings||{}):u()?(function(){if(TradingView.onWidget()&&a.includes(window.location.host))for(var e=r.length;e--;){var t=r.key(e);if(0===t.indexOf("tradingview.")){ var i=t.replace("tradingview.",_+".");r.setItem(i,r.getItem(t)),r.removeItem(t)}}}(),function(){m={};for(var e=_+".",t=!s.enabled("save_chart_properties_to_local_storage"),i=r.length;i--;){var n=r.key(i);if(n&&n.substring(0,e.length)===e){var o=n.substring(e.length);t&&!T(o)||(m[o]=r.getItem(n))}}}()):x(e||{}),I.fire()},onSync:I,setSettingsAdapter:function(e){i=e}}}();e&&e.exports&&(e.exports=c)}).call(this,i("YuTi")(e))},VgjZ:function(e,t,i){"use strict";i.r(t),i.d(t,"PriceAxisRendererOptionsProvider",(function(){return o}));var n=i("XlJ7"),r=i("zDbI"),o=function(){function e(e){this._rendererOptions={borderSize:1,tickLength:4,offsetSize:1,fontSize:NaN,font:"",color:"",paneBackgroundColor:"",paddingBottom:0,paddingInner:0,paddingOuter:0,paddingTop:0,baselineOffset:0},this._chartModel=e}return e.prototype.options=function(){var e=this._rendererOptions,t=this._chartModel.properties(),i=t.scalesProperties.fontSize.value();return e.fontSize!==i&&(e.fontSize=i,e.font=Object(n.makeFont)(i,r.CHART_FONT_FAMILY,""),e.paddingTop=Math.floor(i/3.5),e.paddingBottom=e.paddingTop,e.paddingInner=Math.max(Math.ceil(i/2-e.tickLength/2),0),e.paddingOuter=Math.ceil(i/2+e.tickLength/2),e.baselineOffset=Math.round(i/5)),e.color=t.scalesProperties.textColor.value(),e.paneBackgroundColor=t.paneProperties.background.value(),this._rendererOptions},e}()},"W+6j":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i("mrSG"),r=i("ww0J"),o=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._study=t,n}return Object(n.c)(t,e),t.prototype.color=function(){return this._study.isFailed()||this._study.metaInfo&&this._study.metaInfo().isTVScriptStub?"#ff0000":e.prototype.color.call(this)},t}(r.a)},W3MX:function(e){ e.exports=JSON.parse('{"color-aqua-spring":"#ebf9f5","color-army-green":"#3d2c12","color-army-green-2":"#31230d","color-athens-gray-1":"#f2f3f5","color-athens-gray-2":"#f7f8fa","color-athens-gray-3":"#eceff2","color-black":"#000000","color-blue-dianne":"#21384d","color-bluish":"#2185cc","color-bright-gray":"#363c4e","color-brownish-grey":"#8d6e63","color-carnation":"#f04561","color-catskill-white":"#e1ecf2","color-charade":"#2f3241","color-charcoal-grey":"#323337","color-curious-blue":"#299dcd","color-dark-blue-grey":"#123440","color-darkness-blue-grey":"#12213b","color-dark-grey":"#292a2d","color-dark-grey-blue":"#28415a","color-dark-sky-blue":"#37a6ef","color-dark-slate-blue":"#194453","color-deep-sea-blue":"#016087","color-duck-egg-blue":"#e1eff9","color-ebony-clay":"#262b3e","color-foam":"#d7f0fb","color-gull-gray":"#9db2bd","color-humming-bird":"#d3eef9","color-keppel-1":"#37bc9b","color-keppel-2":"#34b293","color-lavender-blush":"#ffedf0","color-lightish-purple":"#a75ee8","color-loblolly":"#c5cbce","color-manatee":"#878ca8","color-mandy":"#eb4d5c","color-medium-blue":"#2e7bb2","color-milk-chocolate":"#6f2626","color-mirage-1":"#131722","color-mirage-2":"#171b29","color-mirage-3":"#1c2030","color-mischka":"#d6d8e0","color-morning-glory":"#9addcc","color-oslo-gray":"#8b8e95","color-pale":"#fff2cf","color-pale-grey-1":"#f9fafb","color-pale-grey-2":"#e7ebee","color-pale-sky":"#6b7988","color-picton-blue-1":"#3bb3e4","color-picton-blue-2":"#41bef1","color-puerto-rico":"#3bc2a1","color-purple-brown":"#4e2934","color-purple-brown-2":"#3d2028","color-radical-red":"#ff4a68","color-regent-gray":"#8797a5","color-scooter":"#38acdb","color-silver-tree":"#53b987","color-slate-gray":"#758696","color-sundown":"#ffa4b3","color-sunglow":"#ffca3b","color-tan-hide":"#ff9850","color-trout-1":"#4c525e","color-trout-2":"#4f5966","color-violet-1":"#332738","color-violet-2":"#271d2b","color-water-blue":"#1592e6","color-white":"#ffffff","color-white-ice":"#ebf7fc","color-wild-watermelon":"#ff5773","color-bg-primary":"color-white","color-bg-primary-hover":"color-cold-gray-100","color-bg-secondary":"color-white","color-bg-highlight":"color-cold-gray-50","color-bg-scroll-buttons":"color-cold-gray-100","color-legacy-bg-scroll-buttons":"color-cold-gray-850","color-legacy-bg-widget":"color-white","color-text-primary":"color-cold-gray-900","color-text-secondary":"color-cold-gray-500","color-text-tertiary":"color-cold-gray-400","color-text-disabled":"color-cold-gray-300","color-box-shadow":"color-cold-gray-300","color-divider":"color-cold-gray-150","color-divider-hover":"color-cold-gray-100","color-active-hover-text":"color-black","color-alert-text":"color-black","color-border-table":"color-cold-gray-100","color-brand":"color-tv-blue-500","color-brand-active":"color-tv-blue-600","color-brand-hover":"color-tv-blue-600","color-brand-light":"color-picton-blue-2","color-chart-page-bg":"color-cold-gray-150","color-common-tooltip-bg":"color-cold-gray-800","color-common-tooltip-text":"color-cold-gray-100","color-danger":"color-radical-red","color-depthrenderer-stroke-style":"color-athens-gray-1","color-highlight-new":"color-pale","color-input-bg":"color-white","color-input-publish-bg":"color-white","color-link":"color-tv-blue-500","color-link-hover":"color-tv-blue-600","color-link-active":"color-tv-blue-700","color-list-nth-child-bg":"color-athens-gray-2","color-pane-bg":"color-white","color-pane-secondary-bg":"color-cold-gray-100","color-popup-menu-item-hover-bg":"color-cold-gray-100","color-popup-menu-separator":"color-cold-gray-150","color-replay-data-mode":"color-radical-red","color-screener-description":"color-trout-2","color-legacy-success":"color-keppel-1","color-success":"color-minty-green-500","color-success-hover":"color-minty-green-600","color-success-active":"color-minty-green-700","color-toolbar-button-text":"color-cold-gray-900","color-toolbar-button-text-hover":"color-black","color-toolbar-button-text-active":"color-tv-blue-500","color-toolbar-button-text-active-hover":"color-tv-blue-600","color-toolbar-button-background-hover":"color-cold-gray-100","color-toolbar-button-background-secondary-hover":"color-cold-gray-150","color-toolbar-toggle-button-background-active":"color-tv-blue-500","color-toolbar-toggle-button-background-active-hover":"color-tv-blue-600","color-toolbar-interactive-element-text-normal":"color-cold-gray-900","color-toolbar-interactive-element-text-hover":"color-black","color-toolbar-opened-element-bg":"color-cold-gray-100","color-tooltip-bg":"color-ebony-clay","color-tv-dialog-caption":"color-trout-2","color-tv-dropdown-item-hover-bg":"color-athens-gray-1","color-underlined-text":"color-slate-gray","color-widget-pages-bg":"color-white","color-warning":"color-tan-orange-500","color-growing":"color-minty-green-400","color-falling":"color-ripe-red-400","color-collapse-tabs-border":"color-athens-gray-3","color-forex-icon":"color-bright-gray","color-list-item-active-bg":"color-dark-sky-blue","color-list-item-hover-bg":"color-white-ice","color-list-item-text":"color-ebony-clay","color-site-widget-hover":"color-athens-gray-1","color-attention":"color-sunglow","color-price-axis-label-back":"color-cold-gray-150","color-price-axis-label-text":"color-cold-gray-650","color-price-axis-gear":"color-cold-gray-900","color-price-axis-gear-hover":"#000000","color-price-axis-highlight":"color-cold-gray-150","color-marker-flagged":"color-ripe-red-400","color-marker-flagged-hovered":"color-ripe-red-600","color-bid":"color-tv-blue-500","color-ask":"color-ripe-red-400","color-sell":"color-ripe-red-400","color-buy":"color-tv-blue-500","color-neutral":"color-cold-gray-500","color-border":"#dadde0","color-border-chat-fields":"#c9cbcd","color-border-hover":"#c8c8c8","color-button-hover-bg":"#f2f2f2","color-depthrenderer-fill-style":"#555555","color-disabled-border-and-color":"#ececec","color-disabled-input":"#ececec","color-readonly-input":"#b4b4b4","color-empty-container-message":"#8a8a8a","color-icons":"#7d7d7d","color-input-textarea-readonly":"#555555","color-input-placeholder-text":"color-cold-gray-350","color-item-active-blue":"#eff9ff","color-item-hover-active-bg":"#f1f3f6","color-item-hover-bg":"#edf1f2","color-item-hover-blue":"#c6e9f8","color-item-selected-blue":"#eafafe","color-item-active-text":"color-white","color-item-active-bg":"color-tv-blue-500","color-list-item":"#888989","color-news-highlight":"#f2f5f8","color-placeholder":"#adaeb0","color-row-hover-active-bg":"#f1f3f6","color-sb-scrollbar-body-bg":"#d8d8d8","color-section-separator-border":"#b5b7b9","color-separator-table-chat":"#eaecef","color-tag-active-bg":"#cfdce3","color-tag-hover-bg":"#dce6ea","color-text-regular":"#4a4a4a","color-tv-button-checked":"#757575","color-brand-dark":"#2a2c39","color-scroll-bg":"color-cold-gray-400","color-scroll-border":"color-item-hover-active-bg","color-widget-border":"color-cold-gray-100","color-scroll-buttons-arrow":"color-white","color-control-intent-default":"color-cold-gray-200","color-control-intent-success":"color-minty-green-600","color-control-intent-primary":"color-tv-blue-500","color-control-intent-warning":"color-tan-orange-500","color-control-intent-danger":"color-ripe-red-500","color-seeking-alpha-brand":"#ff7200","color-pro":"color-minty-green-400","color-pro-hover":"color-minty-green-600","color-pro-plus":"color-tv-blue-500","color-pro-plus-hover":"color-tv-blue-600","color-pro-premium":"color-tan-orange-500","color-pro-premium-hover":"color-tan-orange-700","color-trial":"color-cold-gray-500","color-trial-hover":"color-cold-gray-600","color-mod":"color-ripe-red-400","color-mod-hover":"color-ripe-red-600","color-top":"color-banana-yellow-700","color-top-hover":"color-banana-yellow-800","color-ad":"color-banana-yellow-a700","color-broker-featured":"color-minty-green-400","color-broker-featured-hover":"color-minty-green-600","color-alert-status-active":"color-minty-green-400","color-alert-status-stopped":"color-ripe-red-500","color-alert-status-triggered":"color-tan-orange-500","color-covid19-confirmed":"color-ripe-red-500","color-covid19-recovered":"color-minty-green-500","color-covid19-deaths":"color-cold-gray-450","color-blue-gray-950":"#0C0E15","color-cold-gray-50":"#F8F9FD","color-cold-gray-100":"#F0F3FA","color-cold-gray-150":"#E0E3EB","color-cold-gray-200":"#D1D4DC","color-cold-gray-250":"#C1C4CD","color-cold-gray-300":"#B2B5BE","color-cold-gray-350":"#A3A6AF","color-cold-gray-400":"#9598A1","color-cold-gray-450":"#868993","color-cold-gray-500":"#787B86","color-cold-gray-550":"#6A6D78","color-cold-gray-600":"#5D606B","color-cold-gray-650":"#50535E","color-cold-gray-700":"#434651","color-cold-gray-750":"#363A45","color-cold-gray-800":"#2A2E39","color-cold-gray-850":"#1E222D","color-cold-gray-900":"#131722","color-cold-gray-950":"#0C0E15","color-ripe-red-50":"#FFEBEE","color-ripe-red-100":"#FFCDD2","color-ripe-red-200":"#ef9a9a","color-ripe-red-300":"#E57373","color-ripe-red-400":"#EF5350","color-ripe-red-500":"#F44336","color-ripe-red-600":"#E53935","color-ripe-red-700":"#D32F2F","color-ripe-red-800":"#C62828","color-ripe-red-900":"#B71C1C","color-ripe-red-a200":"#FF5252","color-ripe-red-a800":"#5B1E24","color-ripe-red-a900":"#351E25","color-tan-orange-50":"#FFF3E0","color-tan-orange-100":"#FFE0B2","color-tan-orange-200":"#FFCC80","color-tan-orange-300":"#ffb74d","color-tan-orange-400":"#FFA726","color-tan-orange-500":"#FF9800","color-tan-orange-600":"#FB8C00","color-tan-orange-700":"#F57C00","color-tan-orange-800":"#EF6C00","color-tan-orange-900":"#e65100","color-tan-orange-a200":"#ffab40","color-tan-orange-a400":"#ff9100","color-tan-orange-a700":"#FF6D00","color-iguana-green-100":"#C8E6C9","color-iguana-green-200":"#A5D6A7","color-iguana-green-300":"#81c784","color-iguana-green-400":"#66BB6A","color-iguana-green-500":"#4caf50","color-iguana-green-600":"#43a047","color-iguana-green-700":"#388e3c","color-iguana-green-800":"#2E7D32","color-iguana-green-900":"#1B5E20","color-iguana-green-a700":"#00c853","color-banana-yellow-100":"#FFF9C4","color-banana-yellow-200":"#FFF59D","color-banana-yellow-300":"#FFF176","color-banana-yellow-400":"#ffee58","color-banana-yellow-500":"#ffeb3b","color-banana-yellow-600":"#fdd835","color-banana-yellow-700":"#fbc02d","color-banana-yellow-800":"#f9a825","color-banana-yellow-900":"#F57F17","color-banana-yellow-a400":"#ffea00","color-banana-yellow-a700":"#ffd600","color-tv-blue-50":"#E3F2FD","color-tv-blue-100":"#BBDEFB","color-tv-blue-200":"#90CAF9","color-tv-blue-300":"#64B5F6","color-tv-blue-400":"#42A5F5","color-tv-blue-500":"#2196F3","color-tv-blue-600":"#1E88E5","color-tv-blue-700":"#1976D2","color-tv-blue-800":"#1565C0","color-tv-blue-900":"#0d47a1","color-tv-blue-a100":"#82b1ff","color-tv-blue-a200":"#448aff","color-tv-blue-a400":"#2979ff","color-tv-blue-a600":"#2962FF","color-tv-blue-a700":"#144987","color-tv-blue-a800":"#143661","color-tv-blue-a900":"#132742","color-deep-blue-100":"#D1C4E9","color-deep-blue-200":"#B39DDB","color-deep-blue-300":"#9575cd","color-deep-blue-400":"#7e57c2","color-deep-blue-500":"#673ab7","color-deep-blue-700":"#512da8","color-deep-blue-800":"#4527A0","color-deep-blue-900":"#311B92","color-deep-blue-a100":"#b388ff","color-deep-blue-a700":"#6200EA","color-minty-green-50":"#E0F2F1","color-minty-green-100":"#B2DFDB","color-minty-green-200":"#80cbc4","color-minty-green-300":"#4db6ac","color-minty-green-400":"#26a69a","color-minty-green-500":"#009688","color-minty-green-600":"#00897b","color-minty-green-700":"#00796b","color-minty-green-800":"#00695C","color-minty-green-900":"#004D40","color-minty-green-a400":"#1de9b6","color-minty-green-a700":"#00BFA5","color-grapes-purple-100":"#E1BEE7","color-grapes-purple-200":"#CE93D8","color-grapes-purple-300":"#ba68c8","color-grapes-purple-400":"#ab47bc","color-grapes-purple-500":"#9c27b0","color-grapes-purple-600":"#8e24aa","color-grapes-purple-700":"#7b1fa2","color-grapes-purple-800":"#6A1B9A","color-grapes-purple-900":"#4A148C","color-grapes-purple-a700":"#aa00ff","color-berry-pink-100":"#F8BBD0","color-berry-pink-200":"#f48fb1","color-berry-pink-300":"#f06292","color-berry-pink-400":"#ec407a","color-berry-pink-500":"#e91e63","color-berry-pink-600":"#D81B60","color-berry-pink-700":"#C2185B","color-berry-pink-800":"#AD1457","color-berry-pink-900":"#880E4F","color-berry-pink-a200":"#ff4081","color-sky-blue-100":"#B2EBF2","color-sky-blue-200":"#80DEEA","color-sky-blue-300":"#4dd0e1","color-sky-blue-400":"#26c6da","color-sky-blue-500":"#00bcd4","color-sky-blue-600":"#00acc1","color-sky-blue-700":"#0097A7","color-sky-blue-800":"#00838F","color-sky-blue-900":"#006064","color-sky-blue-a400":"#00e5ff","color-sky-blue-a700":"#00B8D4","color-deep-blue-600":"#5E35B1","color-facebook":"#1877F2","color-deep-facebook":"#1564CA","color-twitter":"#1DA1F2","color-deep-twitter":"#188CD3","color-youtube":"#FF0000","color-linkedin":"#007BB5","color-pre-market":"color-tan-orange-600","color-pre-market-bg":"color-tan-orange-400","color-post-market":"color-tv-blue-500","color-post-market-bg":"color-tv-blue-400","color-market-open":"color-minty-green-500","color-market-open-bg":"color-minty-green-400","color-market-closed":"color-cold-gray-400","color-market-holiday":"color-cold-gray-400","color-invalid-symbol":"color-ripe-red-400","color-invalid-symbol-hover":"color-ripe-red-700","color-replay-mode":"color-tv-blue-500","color-replay-mode-icon":"color-white","color-replay-mode-hover":"color-tv-blue-600","color-notaccurate-mode":"color-berry-pink-700","color-notaccurate-mode-bg":"color-berry-pink-400","color-delay-mode":"color-tan-orange-700","color-delay-mode-bg":"color-tan-orange-400","color-eod-mode":"color-grapes-purple-700","color-eod-mode-bg":"color-grapes-purple-400","color-data-problem":"color-ripe-red-600","color-data-problem-bg":"color-ripe-red-400","color-data-problem-hover":"color-ripe-red-700","color-list-item-bg-highlighted":"color-tv-blue-50","color-list-item-bg-selected":"color-tv-blue-100","color-list-item-bg-highlighted-hover":"color-tv-blue-100","color-list-item-bg-selected-hover":"color-tv-blue-200","color-screener-header-bg":"color-white","color-screener-header-bg-hover":"color-cold-gray-100"}') },W5mg:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=["first_visible_bar_time","last_visible_bar_time"];function r(e){return!e.groupId&&!e.isHidden&&!n.includes(e.id)}},WIS0:function(e,t,i){"use strict";i.r(t),i.d(t,"DatafeedRequestsCachedProcessor",(function(){return _}));var n=i("mrSG"),r=i("Eyy1"),o=i("LxhU"),s=i("Y7w9"),a=i("ocLq"),l=i("Kxc7"),c=i("IiTo"),u=i("OLhd"),h=i("5mo2");i("HbRj");function d(e,t){return e.ticker+(e.currency_code?"_#_"+e.currency_code:"")+"_#_"+t}function p(e){return new Date(e).toISOString()}var f=function(){function e(e,t,i,n,r,s){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._nextTime=null,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._destroyed=!1,this._emptyResponsesCount=0,this._datafeed=e,this._symbolInfo=t,this._interval=o.Interval.parse(i),this._resolution=this._interval.value(),this._dwmAligner=r,this._serverTimeOffsetGetter=n,this._resetCacheTimePeriod=void 0===s?1e4:s,this._sessionSpec=new h.SessionSpec(t.timezone,t.session,t.holidays,t.corrections),this._updateDatesFromExpirationDate()}return e.prototype.destroy=function(){0!==this._subscribers.length&&console.warn("Destroying with not-empty state"),this._clearResetCacheTimeout(),this._unsubscribeRealtime(),this._purgeCache(),delete this._datafeed,this._destroyed=!0},e.prototype.addSubscription=function(e,t,i){var n=this,r=this._getNextSubscriptionId();this._pendingSubscribers.push({key:r,range:e,onHistoryCallback:t,onErrorCallback:i}),o.Interval.isDWM(this._resolution)&&void 0!==e.to&&null!==this._dwmAligner&&e.to%864e5&&console.warn("Internal error: invalid date for DWM resolution "+p(e.to)+", expected time without a time part"),this._clearResetCacheTimeout();return setTimeout((function(){n._destroyed||n._processPendingSubscribers()}),0),r},e.prototype.removeSubscription=function(e){var t=this,i=this._pendingSubscribers.find((function(t){return t.key===e}));if(i)this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(i),1);else{var n=this._subscribers.find((function(t){return t.key===e}));if(n)return this._subscribers.splice(this._subscribers.indexOf(n),1),void(this._subscribers.length||(this._resetCacheTimeout=setTimeout((function(){t._resetCacheTimeout=null,t._purgeCache(),t._unsubscribeRealtime()}),this._resetCacheTimePeriod)));console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,e))}},e.prototype._logMessage=function(e,t){if(l.enabled("charting_library_debug_mode")||t){var i=this._symbolInfo.currency_code;console.log("FEED ["+this._symbolInfo.name+"|"+this._resolution+(i?"|"+i:"")+"]: "+e)}},e.prototype._clearResetCacheTimeout=function(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)},e.prototype._purgeCache=function(){this._logMessage("Reset cache"),this._cache={bars:[]},this._errorMessage=null,this._leftDate=null, this._endOfData=!1,this._updateDatesFromExpirationDate()},e.prototype._updateDatesFromExpirationDate=function(){void 0!==this._symbolInfo.expiration_date&&(this._nextTime=1e3*this._symbolInfo.expiration_date,this._leftDate=1e3*(this._symbolInfo.expiration_date+1))},e.prototype._dealignTime=function(e){return null===this._dwmAligner?e:this._dwmAligner.timeToExchangeTradingDay(e)},e.prototype._normalizeRange=function(e){var t=void 0!==e.to?e.to:this._dealignTime(this._now());if(0===this._cache.bars.length||void 0!==e.to&&t<=Object(r.ensureNotNull)(this._leftDate))return{countBack:e.countBack,to:t};var i=null!==this._dwmAligner?this._dwmAligner.timeToSessionStart(t):t,n=Object(s.lowerbound)(this._cache.bars,i,(function(e,t){return e.timen.countBack)&&(n=s)}this._logMessage("Leftmost subscriber requires "+n.countBack+" bars prior "+p(n.to)),!(null===this._leftDate||n.to0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(e.key,n.count(),p(n.bars[0].time),p(n.bars[n.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(e.key)),t.barset=n,this._endOfData&&null!==this._leftDate&&i.to<=this._leftDate&&(n.endOfData=!0),e.onHistoryCallback(n)},e.prototype._createBarsetForRange=function(e){var t=null!==this._dwmAligner?this._dwmAligner.timeToSessionStart(e.to):e.to,i=Object(s.lowerbound)(this._cache.bars,t,(function(e,t){return e.time0){var i=" ["+p(e[0].time)+" ... "+p(e[e.length-1].time)+"]";n._logMessage("Receiving bars: total "+e.length+" bars in "+i+", requested range: "+h) }else n._logMessage("Receiving bars: barset is empty, requested range: "+h);n._requesting=!1,n._processBars(e,t)}}),(function(e){n._destroyed||(d?n._logMessage("getBars callback is already called before",!0):(d=!0,n._requesting=!1,n._errorMessage=e||null,n._processPendingSubscribers()))}))}},e.prototype._processBars=function(e,t){this._checkBars(e),this._alignBarsTime(e),e.length>0?(this._emptyResponsesCount=0,this._processFullBarset(e,t)):(this._emptyResponsesCount+=1,this._processEmptyBarset(t)),this._processPendingSubscribers()},e.prototype._processEmptyBarset=function(e){e&&e.nextTime?(this._logMessage("Next time received: `{0}`".format(p(1e3*e.nextTime))),this._nextTime=1e3*e.nextTime):e&&e.noData?(this._logMessage("EOD received"),this._setEndOfData()):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned"),50===this._emptyResponsesCount&&(this._logMessage("EOD detected due 50 empty responses in a row"),this._setEndOfData())},e.prototype._setEndOfData=function(){this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._dealignTime(this._cache.bars[0].time))},e.prototype._processFullBarset=function(e,t){this._putToCache(e)?null!==this._leftDate&&0!==this._cache.bars.length&&(this._interval.isTicks()?this._leftDate=this._dealignTime(this._cache.bars[0].time):this._leftDate=Math.min(this._leftDate,this._dealignTime(this._cache.bars[0].time))):this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.",!0),t&&t.nextTime?console.warn("nextTime should be set when there is no data in the requested period only"):t&&t.noData&&console.warn("noData should be set when there is no data in the requested period and earlier only")},e.prototype._getNextSubscriptionId=function(){return this._nextSubscriptionId++},e.prototype._checkBars=function(e,t){if(void 0===t&&(t=!1),l.enabled("charting_library_debug_mode"))for(var i=function(i){if(e[i].time<=e[i-1].time){var r="Wrong bars time: time {0} of bar {1} should be more than time {2} of bar {3}".format(e[i].time,i,e[i-1].time,i-1);t&&null!==n._dwmAligner&&(r+="\nCheck that you provide DWM bars without time part, i.e. 00:00 GMT"),console.error(r)}["high","low","open","close","time"].some((function(t){return"number"!=typeof e[i][t]||!isFinite(e[i][t])}))&&console.error("Wrong bars values: all OHLC values should be numbers")},n=this,r=1;r=this._cache.bars[0].time){var t=this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time;if(this._cache.bars=[],!t)return this._leftDate=null,!1 ;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return this._cache.bars=Object(n.f)(e,this._cache.bars),this._checkBars(this._cache.bars,!0),!0},e.prototype._putToCacheNewBar=function(e){var t=this._cache.bars.length,i=e.time,n=0===t?NaN:this._cache.bars[t-1].time;0===t||n=0&&!function(){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(e){return!1}}()&&setTimeout((function(){try{var e=function(){var e=0;return JSON.parse(urlParams.logo).image&&(e="C",n.enabled("link_to_tradingview")||(e="D")),e}();window.ga&&(0!==e&&window.ga("send","event","s",e),urlParams.utm||window.ga("send","event","l"))}catch(t){}}),3e4)}},Wh6B:function(e,t,i){"use strict";var n=i("Eyy1").ensureNotNull,r=i("Ss5c").LineDataSource,o=i("Ocx9").DefaultProperty,s=i("08i5");function a(e,t){var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("Ay2m").PredictionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.isSynchronizable=function(){return!1},a.prototype.status=function(){return this._properties.status.value()},a.prototype.setStatus=function(e){return this._properties.status.setValue(e)},a.prototype.pointsCount=function(){return 2},a.prototype.name=function(){return"Forecast"},a.prototype.restorePoints=function(e,t,i){r.prototype.restorePoints.call(this,e,t,i),this.checkAlert()},a.prototype.checkAlert=function(){if(!(this._points.length<2||this._model.mainSeries().bars().isEmpty())){var e=this._points[1];if(this.status())e.index>this._model.timeScale().baseIndex()&&this.setStatus(s.AlertStatus.Waiting);else{var t=this._model.mainSeries().bars().valueAt(e.index);if(null!==t){var i=this.direction();if(i===s.Direction.Up&&t[TradingView.HIGH_PLOT]>=e.price)this.setStatus(s.AlertStatus.Success);else if(i===s.Direction.Down&&t[TradingView.LOW_PLOT]<=e.price)this.setStatus(s.AlertStatus.Success);else{var r=n(this._model.mainSeries().bars().lastIndex());e.index!==r&&this.setStatus(s.AlertStatus.Failure)}}}}},a.prototype.addPoint=function(e){var t=r.prototype.addPoint.call(this,e);return t&&this.checkAlert(),t},a.prototype.endChanging=function(){r.prototype.endChanging.call(this),this.setStatus(s.AlertStatus.Waiting),this.checkAlert()},a.prototype.onData=function(e){r.prototype.onData.call(this,e),this.checkAlert()},a.prototype.endMoving=function(){r.prototype.endMoving.call(this),this.setStatus(s.AlertStatus.Waiting),this.checkAlert()},a.prototype.direction=function(){if(this.points().length<2)return s.Direction.Up;var e=this.points()[0];return this.points()[1].price>e.price?s.Direction.Up:s.Direction.Down},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){ return i("Pwwq").PredictionDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.prototype.cloneable=function(){return!1},a.createProperties=function(e){var t=new o("linetoolprediction",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e),e.merge({status:s.AlertStatus.Waiting})},t.LineToolPrediction=a},WkOR:function(e,t,i){"use strict";i.r(t),i.d(t,"areEqualSymbols",(function(){return o})),i.d(t,"includesEqualSymbol",(function(){return s}));var n=i("Kxc7"),r=n.enabled("uppercase_instrument_names");function o(e,t){return void 0===e?void 0===t:void 0!==t&&(r?e.toUpperCase()===t.toUpperCase():e===t)}function s(e,t){return e.some((function(e){return o(t,e)}))}},WkYF:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;function o(e,t){var r=t||o.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("3xLB").DateRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.name=function(){return"Date Range"},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Ax76").GeneralDatePriceRangeDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o.createProperties=function(e){var t=new r("linetooldaterange",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},t.LineToolDateRange=o},WmDe:function(e,t,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.isPaidPro=function(){return!1},TradingView.Pro.prototype.hasActivePackages=function(){return!1},TradingView.Pro.prototype.isSupportAvailable=function(){return!1},TradingView.Pro.prototype.getStudies=function(){return[]},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]},TradingView.AlertLabel=function(){},TradingView.getDataVendorString=function(){},TradingView.study_VbPVisible=function(){},TradingView.study_VbPSessions=function(){},TradingView.study_ESD$TV_DIVIDENDS=function(){},TradingView.study_ESD$TV_SPLITS=function(){},TradingView.study_ESD$TV_EARNINGS=function(){},TradingView.MockupRequestedCache=function(e){e&&e([])},TradingView.MockupRequestedCache.invalidate=function(){},TradingView.LinetoolTemplatesList=function(){}},Wo0S:function(e,t,i){e.exports={"common-tooltip":"common-tooltip-s2GEoMlT","common-tooltip--hidden":"common-tooltip--hidden-Z0EAvXgv", "common-tooltip--horizontal":"common-tooltip--horizontal-13imOC5w","common-tooltip--farther":"common-tooltip--farther-2yXMAkHF","common-tooltip--vertical":"common-tooltip--vertical-mcRoucek","common-tooltip-farther":"common-tooltip-farther-XoKytD99","common-tooltip--no-pointer-events":"common-tooltip--no-pointer-events-3nL0Vygu","common-tooltip--direction_normal":"common-tooltip--direction_normal-3u9ejKM2","common-tooltip__body":"common-tooltip__body-356XFpBj","common-tooltip__button-container":"common-tooltip__button-container-3EjyKV3s","common-tooltip__body--no-buttons":"common-tooltip__body--no-buttons-3quqi1Sv","common-tooltip__button":"common-tooltip__button-1rnQgujz","common-tooltip--direction_reversed":"common-tooltip--direction_reversed-XN-JUTdr","common-tooltip__ear-holder":"common-tooltip__ear-holder-yIJjpvgu","common-tooltip__ear-holder--below":"common-tooltip__ear-holder--below-1rmzWejA","common-tooltip__ear-holder--above":"common-tooltip__ear-holder--above-1D8FkNkw","common-tooltip__ear-holder--before":"common-tooltip__ear-holder--before-oXq5sFXr","common-tooltip__ear-holder--after":"common-tooltip__ear-holder--after-BnAcuW1N","common-tooltip__body--with-hotkey":"common-tooltip__body--with-hotkey-2wXRtgYZ","common-tooltip__body--width_wide":"common-tooltip__body--width_wide-3oG604Li","common-tooltip__body--width_narrow":"common-tooltip__body--width_narrow-34hrFTFo","common-tooltip__body--no-padding":"common-tooltip__body--no-padding-2vVe6Xco","common-tooltip__hotkey-block":"common-tooltip__hotkey-block-2gS_uAOl","common-tooltip__hotkey-block--divider":"common-tooltip__hotkey-block--divider-rQ38KmpQ","common-tooltip__hotkey-text":"common-tooltip__hotkey-text-1eb7dyCg","common-tooltip__hotkey-button":"common-tooltip__hotkey-button-1XJ40e4D","common-tooltip__plus-sign":"common-tooltip__plus-sign-3CKSupKp"}},Wt0y:function(e,t,i){"use strict";function n(e){void 0===e&&(e=location.host);return-1!==["i18n.tradingview.com","partial.tradingview.com","www.tradingview.com","wwwcn.tradingview.com"].indexOf(e)||-1!==["d33t3vvu2t2yu5.cloudfront.net","dwq4do82y8xi7.cloudfront.net","s.tradingview.com","s3.tradingview.com"].indexOf(e)||e.match(/^[a-z]{2}\.tradingview\.com/)||e.match(/prod-[^.]+.tradingview.com/)?"battle":e.includes("tradingview.com")||e.includes("staging")?"staging":e.match(/webcharts/)?"staging_local":(e.match(/^localhost(:\d+)?$/),"local")}function r(){return"local"===n()}function o(){return"battle"===n()}function s(){return!o()}i.r(t),i.d(t,"environment",(function(){return n})),i.d(t,"isLocal",(function(){return r})),i.d(t,"isProd",(function(){return o})),i.d(t,"isDebug",(function(){return s}))},X0WL:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var n=function(){function e(e){this._colorProperty=e}return e.prototype.size=function(){return"13px"},e.prototype.bold=function(){return!1},e.prototype.color=function(){return this._colorProperty.value()},e}()},XAms:function(e,t,i){"use strict";function n(e){e.preventDefault()}i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return o})) ;var r=["input:not([type])",'input[type="text"]','input[type="email"]','input[type="password"]','input[type="search"]','input[type="number"]','input[type="url"]',"textarea","a[href]",'*[contenteditable="true"]',"[data-allow-context-menu]"];function o(e){var t=e.target;t&&!t.closest(r.join(", "))&&e.preventDefault()}},XFad:function(e,t,i){"use strict";var n=i("5rJj"),r=i("aDyP").LineToolPitchfork;function o(e,t){var i=t||o.createProperties();r.call(this,e,i)}inherit(o,r),o.prototype.name=function(){return"Schiff Pitchfork"},o.createProperties=function(e){var t=new n("linetoolschiffpitchfork2",e,!1,{range:[0,8]});return o._configureProperties(t),t},o._configureProperties=function(e){r._configureProperties(e)},t.LineToolSchiffPitchfork2=o},XPit:function(e,t,i){"use strict";i.r(t),i.d(t,"TimePointIndexSearchMode",(function(){return n})),i.d(t,"seriesPlotFunctionMap",(function(){return l})),i.d(t,"barFunction",(function(){return c})),i.d(t,"SeriesData",(function(){return h}));var n,r=i("Eyy1"),o=i("k9/m");!function(e){e[e.FromLeft=-1]="FromLeft",e[e.FromRight=1]="FromRight"}(n||(n={}));var s={open:function(e){return e[1]},high:function(e){return e[2]},low:function(e){return e[3]},close:function(e){return e[4]},hl2:function(e){return(e[2]+e[3])/2},hlc3:function(e){return(e[2]+e[3]+e[4])/3},ohlc4:function(e){return(e[1]+e[2]+e[3]+e[4])/4}},a=["open","high","low","close","hl2","hlc3","ohlc4"];function l(){var e=new Map;return a.forEach((function(t,i){e.set(t,c(t))})),e}function c(e){return s[e]}function u(e,t){return null==e[t]}var h=function(){function e(){this.m_bars=new o.PlotList(l(),u),this.m_nsBars=new o.PlotList(l(),u)}return e.prototype.bars=function(){return this.m_bars},e.prototype.nsBars=function(){return this.m_nsBars},e.prototype.size=function(){return this.m_bars.size()+this.m_nsBars.size()},e.prototype.each=function(e){this.m_bars.each(e),this.m_nsBars.each(e)},e.prototype.clear=function(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0},e.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()},e.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()},e.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()},e.prototype.search=function(e,t){return this.nsBars().isEmpty()?this.bars().search(e,t):this.bars().isEmpty()||Object(r.ensureNotNull)(this.nsBars().firstIndex())<=e?this.nsBars().search(e,t):this.bars().search(e,t)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.plotValueToTimePointIndex=function(e,t,i){if(i===n.FromRight){var r=function(i,n){var r=n[t];return null!=r&&e>=r};return null!==(o=this.m_bars.findLast(r))?o.index:null!==(s=this.m_nsBars.findLast(r))?s.index:this.m_bars.firstIndex()}if(i===n.FromLeft){var o,s,a=function(i,n){var r=n[t];return null!=r&&e<=r};return null!==(o=this.m_bars.findFirst(a))?o.index:null!==(s=this.m_nsBars.findFirst(a))?s.index:this.m_bars.lastIndex()} throw new Error("plotValueToTimePointIndex: unsupported search mode")},e}()},XUCF:function(e,t,i){"use strict";var n=i("Hr11").sign,r=i("Ss5c").LineDataSource,o=i("Ocx9").DefaultProperty;function s(e,t,i){this._source=e,this._index=t,this._bars=i||[]}function a(e,t,n){var o=t||a.createProperties();if(o._source=this,!n){var s=Math.round(this.calculateATR(e));o.averageHL.setValue(s)}r.call(this,e,o),this._segments=[],o.averageHL.listeners().subscribe(this,a.prototype.regenerate),o.variance.listeners().subscribe(this,a.prototype.regenerate),o.points||o.addProperty("points"),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._currentInterval=e.mainSeries().interval(),this.properties().onRestoreFactoryDefaults().subscribe(this,this._handleRestoringFactoryDefaults),i.e("lt-pane-views").then(function(e){var t=i("dMkl").GhostFeedPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}s.prototype.setBars=function(e){this._bars=e||[]},s.prototype.clone=function(e){return new s(e,this._index,TradingView.clone(this._bars))},s.prototype.createBar=function(){var e=this._source.properties().averageHL.value(),t=this._source.properties().variance.value()/100,i=this._source._model.mainSeries().base(),n=Math.random(),r=e*(1-2*n)*t,o=e*(1+(.5-(n=Math.random()))*t),s=r-o/2,a=s+o;return{o:(s+Math.random()*o)/i,h:a/i,l:s/i,c:(s+Math.random()*o)/i}},s.prototype.generate=function(){this._bars=[];var e=this._source.points(),t=e[this._index],i=e[this._index+1];if(t&&i&&t.index!==i.index){this._avgHL=this._source.properties().averageHL.value(),this._variance=this._source.properties().variance.value()/100;for(var r=this._index?t.index+1:t.index,o=n(i.index-t.index),s=r;s!==i.index;s+=o)this._bars.push(this.createBar())}},s.prototype.bars=function(){return this._bars},s.prototype.setSize=function(e){if(e0&&this._points[this._points.length-1].index===e.index){this._lastPoint=null,this.normalizePoints(),this.createServerPoints();for(var t=0;t1&&this.generateBars(this._points.length-2),i||this._finished},a.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},a.prototype.setPoint=function(e,t,i){if(r.prototype.setPoint.call(this,e,t,i),e>0){var n=this.points()[e-1],o=t.index-n.index;this._segments[e-1].setSize(Math.abs(o))}if(e>1,a=n+s;i(e[a],t)?(n=a+1,o-=s+1):o=s}return n}function s(e,t,i,n){return void 0===i&&(i=0),void 0===n&&(n=e.length),o(e,t,r,i,n)}function a(e,t,i,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var o=r-n;0>1,a=n+s;i(t,e[a])?o=s:(n=a+1,o-=s+1)}return n}function l(e,t,i,n){return void 0===i&&(i=0),void 0===n&&(n=e.length),a(e,t,r,i,n)}function c(e,t){return e.filter((function(e){return!t.includes(e)}))}function u(e,t){var i=e.indexOf(t);return i<0?e.slice():[t].concat(e.slice(0,i)).concat(e.slice(i+1))}function h(e,t,i){var r=new Set(t),o=[],a=[];return e.forEach((function(e,t){r.has(e)||(o.push(e),a.push(t))})),i0){var d=this._points[this._points.length-1],p=this._model.timeScale().indexToCoordinate(d.index),f=d.price,_=a.priceToCoordinate(f,u);if(new o.Point(l,h).subtract(new o.Point(p,_)).length()<5)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return e.prototype.addPoint.call(this,t,i,n)},t.createProperties=function(e){var i=new s.DefaultProperty("linetoolpath",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"WW+G")).then((function(e){return e.PathDefinitionsViewModel}))},t._configureProperties=function(e){a.LineDataSource._configureProperties(e),e.addChild("linesColors",new l.LineToolColorsProperty([e.childs().lineColor]))},t}(a.LineDataSource)},"Ye2/":function(e,t,i){"use strict";var n;i.r(t),i.d(t,"LineToolBarsPatternMode",(function(){return n})),function(e){e[e.Bars=0]="Bars",e[e.Line=1]="Line",e[e.OpenClose=2]="OpenClose",e[e.LineOpen=3]="LineOpen",e[e.LineHigh=4]="LineHigh",e[e.LineLow=5]="LineLow",e[e.LineHL2=6]="LineHL2"}(n||(n={}))},Yj6H:function(e,t,i){"use strict";i.r(t),i.d(t,"PriceScaleBase",(function(){return v}));var n=i("Eyy1"),r=i("ogJP"),o=i("aIyQ"),s=i.n(o),a=i("Qb4w"),l=i("TTFo"),c=i("qJq3"),u=i("7ktv"),h=i("tc+8"),d=i.n(h),p=i("3ClC"),f=i("/tGj"),_=i("n5al"),m={autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0,isInverted:!1,indexedTo100:!1},v=function(){function e(e){this._marksCache=null,this._onMarksChanged=new s.a,this.m_dataSources=[],this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._hasSeries=!1,this._seriesLikeSources=[],this._seriesLikeSourcesSet=new Set,this._priceDataSources=[],this._mainSource=null,this._lastSourceRemoved=new s.a,this._scaleSeriesOnly=!1,this._invalidatedForRange={isValid:!0,visibleBars:null},this.m_priceRange=null,this.m_height=0,this._margins={top:0,bottom:0},this._correctedMarginsCache=null,this._topPixelMargin=0,this._bottomPixelMargin=0,this._internalHeightCache=null,this._internalHeightChanged=new s.a,this._currencyCache=null,this._recalculatePriceRangeOnce=!1,e=Object.assign({},m,e),this._properties=new d.a(e)}return e.prototype.isLog=function(){return this._properties.childs().log.value()},e.prototype.isPercentage=function(){return this._properties.childs().percentage.value()},e.prototype.isInverted=function(){return this._properties.childs().isInverted.value()},e.prototype.isIndexedTo100=function(){return this._properties.childs().indexedTo100.value()},e.prototype.isAutoScale=function(){return this._properties.childs().autoScale.value()&&!this.isLockScale()},e.prototype.isLockScale=function(){return this._properties.childs().lockScale.value()}, e.prototype.isRegular=function(){return!this.isPercentage()&&!this.isLog()&&!this.isIndexedTo100()},e.prototype.properties=function(){return this._properties},e.prototype.height=function(){return this.m_height},e.prototype.setHeight=function(e){this.m_height!==e&&(this.m_height=e,this._invalidateInternalHeightCache(),this._marksCache=null)},e.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var e=this.height()-this.topPixelMargin()-this.bottomPixelMargin();return this._internalHeightCache=e,e},e.prototype.priceRange=function(){return this._makeSureItIsValid(),this.m_priceRange},e.prototype.recalculatePriceRangeOnce=function(){this._recalculatePriceRangeOnce=!0},e.prototype.priceRangeShouldBeRecalculatedOnce=function(){if(!this._recalculatePriceRangeOnce||this.isLockScale())return!1;var e=this.mainSource();return null!==e&&e.priceRangeReady()},e.prototype.mainSource=function(){if(null!==this._mainSource)return this._mainSource;for(var e,t=0,i=this.m_dataSources;t0)i=null;else if(void 0===i)i=P;else if(null!==i&&i!==P){i=null;break}l=!0;break}}}}if(void 0===t)if(0===u&&0===h)t=null;else{var x=i||null;t={readOnly:l,selectedCurrency:x,currencies:s,originalCurrencies:r,baseCurrencies:o,symbolSourceCount:u,allCurrenciesAreOriginal:c,displayedValues:a}}return this._currencyCache={value:t,availableCurrenciesCount:e.size()},t},e.prototype.setMargins=function(e){if(!Object(r.isNumber)(e.top)||!Object(r.isNumber)(e.bottom))throw new TypeError("invalid margin");if(e.top<0||e.top>30||e.bottom<0||e.bottom>30)throw new RangeError("invalid margin");this._margins.top===e.top&&this._margins.bottom===e.bottom||(this._margins=e,this._correctedMarginsCache=null,this._invalidateInternalHeightCache(),this._marksCache=null)},e.prototype.topMargin=function(){return this._correctedMargins().top},e.prototype.bottomMargin=function(){return this._correctedMargins().bottom},e.prototype.invalidateMargins=function(){this._correctedMarginsCache=null},e.prototype.topPixelMargin=function(){return this.isInverted()?this.bottomMargin()*this.height()+this._bottomPixelMargin:this.topMargin()*this.height()+this._topPixelMargin},e.prototype.bottomPixelMargin=function(){return this.isInverted()?this.topMargin()*this.height()+this._topPixelMargin:this.bottomMargin()*this.height()+this._bottomPixelMargin},e.prototype.onMarksChanged=function(){return this._onMarksChanged},e.prototype.priceRangeInPrice=function(){if(this.isEmpty())return null ;var e=this.mainSource();if(null===e)return null;var t=Object(n.ensureNotNull)(e.firstValue()),i=this.height();return{from:this.coordinateToPrice(i-1,t),to:this.coordinateToPrice(0,t)}},e.prototype.setPriceRangeInPrice=function(e){if(!this.isPercentage()&&!this.isIndexedTo100()){var t=this.isInverted(),i=t?this.bottomMargin():this.topMargin(),n=t?this.topMargin():this.bottomMargin(),r=this.isLog(),o=r?Object(l.toLog)(e.from):e.from,s=r?Object(l.toLog)(e.to):e.to,c=s-o;o+=n*c,s-=i*c,this.setMode({autoScale:!1}),this.setPriceRange(new a.PriceRange(o,s)),this._marksCache=null,this._onMarksChanged.fire()}},e.prototype.hasMainSeries=function(){return this._hasSeries},e.prototype.getStudies=function(){return this.dataSources().filter(p.isStudy)},e.prototype.lastSourceRemoved=function(){return this._lastSourceRemoved},e.prototype.sourcesForAutoscale=function(){return this._mainSource&&this._scaleSeriesOnly!==this._scalesProperties.childs().scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null),this._sourcesForAutoscale||(this._sourcesForAutoscale=this._recalculateSourcesForAutoscale()),this._sourcesForAutoscale},e.prototype.recalculatePriceRange=function(e){this._invalidatedForRange={visibleBars:e,isValid:!1}},e.prototype.internalHeightChanged=function(){return this._internalHeightChanged},e.prototype._recalculateSourcesForAutoscale=function(){this._mainSource&&(this._scaleSeriesOnly=this._scalesProperties.childs().scaleSeriesOnly.value());var e=this._scaleSeriesOnly&&this._hasSeries;return this.m_dataSources.filter((function(t){return!!(t.properties().visible.value()||t instanceof c.Series)&&(e?t instanceof c.Series:t.isIncludedInAutoScale())}))},e.prototype._updateAutoScaleDisabledProperty=function(e){var t=this._properties.childs(),i=t.indexedTo100.value()||t.percentage.value()||t.lockScale.value();e?t.autoScaleDisabled.setValueSilently(i):t.autoScaleDisabled.setValue(i)},e.prototype._setAutoScaleValueWithDependentProperties=function(e){var t=this._properties.childs();t.autoScale.setValueSilently(e),e&&(t.percentage.setValueSilently(!1),t.indexedTo100.setValueSilently(!1),t.lockScale.setValueSilently(!1),t.logDisabled.setValueSilently(!1)),this._updateAutoScaleDisabledProperty(!0)},e.prototype._setLockScaleValueWithDependentProperties=function(e){var t=this._properties.childs();t.lockScale.setValueSilently(e),e&&(t.autoScale.setValueSilently(!1),t.percentage.setValueSilently(!1),t.indexedTo100.setValueSilently(!1),t.log.setValueSilently(!1)),t.percentageDisabled.setValueSilently(e),t.logDisabled.setValueSilently(e),this._updateAutoScaleDisabledProperty(!0)},e.prototype._setPercentageValueWithDependentProperties=function(e){var t=this._properties.childs();t.percentage.setValueSilently(e),e&&(t.autoScale.setValueSilently(!0),t.log.setValueSilently(!1),t.lockScale.setValueSilently(!1),t.indexedTo100.setValueSilently(!1)),this._updateAutoScaleDisabledProperty(!0)},e.prototype._setIndexedTo100ValueWithDependentProperties=function(e){var t=this._properties.childs();t.indexedTo100.setValueSilently(e), e&&(t.autoScale.setValueSilently(!0),t.log.setValueSilently(!1),t.lockScale.setValueSilently(!1),t.percentage.setValueSilently(!1)),this._updateAutoScaleDisabledProperty(!0)},e.prototype._setLogValueWithDependentProperties=function(e){var t=this._properties.childs();t.log.setValueSilently(e),e&&(t.lockScale.setValueSilently(!1),t.percentage.setValueSilently(!1),t.indexedTo100.setValueSilently(!1)),this._updateAutoScaleDisabledProperty(!0)},e.prototype._recalculatePriceRangeImpl=function(){var e=this._invalidatedForRange.visibleBars;if(null!==e){for(var t=null,i=this.sourcesForAutoscale(),n=this.isPercentage(),r=this.isIndexedTo100(),o=0,s=0,c=0,u=i;c0||Math.abs(s-this._bottomPixelMargin)>0)&&(this._bottomPixelMargin=s,this._topPixelMargin=o,this._marksCache=null,this._invalidateInternalHeightCache()),t?(t.minValue()===t.maxValue()&&(t=new a.PriceRange(t.minValue()-.5,t.maxValue()+.5)),this.setPriceRange(t)):this.m_priceRange||this.setPriceRange(new a.PriceRange(-.5,.5)),this._invalidatedForRange.isValid=!0;var v=this.mainSource();null!==v&&this._recalculatePriceRangeOnce&&(this._recalculatePriceRangeOnce=!v.priceRangeReady())}},e.prototype._makeSureItIsValid=function(){this._invalidatedForRange.isValid||(this._invalidatedForRange.isValid=!0,this._recalculatePriceRangeImpl())},e.prototype._invalidateInternalHeightCache=function(){this._internalHeightCache=null,this._internalHeightChanged.fire()},e.prototype._initScaleProperties=function(){var e=this.isLockScale(),t=this.properties().childs();e&&(t.percentage.setValue(!1),t.indexedTo100.setValue(!1),t.log.setValue(!1),t.autoScale.setValue(!1)),t.percentageDisabled.setValue(e),t.logDisabled.setValue(e),this._updateAutoScaleDisabledProperty(!1),t.percentage.value()&&(t.log.setValue(!1),t.indexedTo100.setValue(!1)),t.indexedTo100.value()&&(t.log.setValue(!1),t.percentage.setValue(!1))},e.prototype._correctedMargins=function(){if(null===this._correctedMarginsCache){var e=this.mainSource();this._correctedMarginsCache=null!==e?e.correctScaleMargins(this._margins):this._margins}return this._correctedMarginsCache},e}()},Yjuu:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("5rJj"),o=i("j3hX"),s=o.LineToolWidthsProperty,a=o.LineToolColorsProperty;function l(e,t){var r=t||l.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("bcXK").FibSpeedResistanceArcsPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(l,n),l.LevelsCount=11,l.prototype.levelsCount=function(){return l.LevelsCount},l.prototype.pointsCount=function(){return 2},l.prototype.name=function(){ return"Fib Speed Resistance Arcs"},l.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},l.createProperties=function(e){var t=new r("linetoolfibspeedresistancearcs",e,!1,{range:[1,11]});return l._configureProperties(t),t},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("pdv6").FibSpeedResistanceArcsDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l._configureProperties=function(e){n._configureProperties(e);for(var t=[e.child("trendline").child("linewidth")],i=[e.child("trendline").child("color")],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new s(t))},t.LineToolFibSpeedResistanceArcs=l},YlKu:function(e,t,i){"use strict";i.r(t),i.d(t,"ApplyLineToolTemplateUndoCommand",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t,i,n){var r=e.call(this,n)||this;return r._source=t,r._newState=i,r._oldState=t.properties().state(),r}return Object(n.c)(t,e),t.prototype.redo=function(){this._source.applyTemplate(this._newState)},t.prototype.undo=function(){this._source.applyTemplate(this._oldState)},t}(i("RDU5").UndoCommand)},YmeR:function(e,t,i){"use strict";i.r(t),i.d(t,"ActionBinder",(function(){return o}));var n=i("mrSG"),r=i("2h0C"),o=function(e){function t(t,i,n,r,o){void 0===o&&(o=null);var s=e.call(this,t,i,!0,n,r)||this;return null!==o?t.update({onExecute:o.bind(s)}):t.update({onExecute:s._onActionCallback.bind(s)}),s}return Object(n.c)(t,e),t.prototype.action=function(){return this.control()},t.prototype.value=function(){return this.action().isChecked()},t.prototype.setValue=function(e){this.action().update({checked:Boolean(e)})},t.prototype._onActionCallback=function(){this._undoModel.setProperty(this._property,this.value(),this._undoText)},t}(r.Binding)},YuHv:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i("AWC/");function r(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);var i=document.createElement("div"),r=document.createElement("div");return i.appendChild(r),i.classList.add(n.container),r.classList.add(n.inner),e.forEach((function(e){i.classList.add(n[e])})),t.forEach((function(e){i.classList.add(n[e])})),i}},YzC7:function(e,t,i){"use strict";var n=i("mrSG"),r=i("GVHu"),o=i("n5al"),s=i("tc+8"),a=i.n(s),l=i("Kxc7"),c=i("oXaB"),u=function(e){function t(t,i){var n=e.call(this)||this;return n._studyCompare=t,n._data=i,n}return Object(n.c)(t,e),t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var n=this._studyCompare.lastValueData(this._data.plotIndex,!1);if(!n.noData){i.background=n.color,i.color=this.generateTextColor(n.color),i.coordinate=n.coordinate,i.floatCoordinate=n.floatCoordinate;var r=this._studyCompare.model().properties().scalesProperties;r.showSeriesLastValue.value()&&(e.text=this._axisText(n),e.visible=!0),t.text="", (r.showSymbolLabels.value()||r.seriesLastValueMode.value()===c.PriceAxisLastValueMode.LastPriceAndPercentageValue)&&(t.text=this._paneText(n),t.visible=t.text.length>0)}},t.prototype._paneText=function(e){var t="",i=this._studyCompare.model().properties().scalesProperties;if(i.showSymbolLabels.value()){var n=this._studyCompare.symbolInfo();t+=(n&&Object(o.symbolCurrentContract)(n)||this._studyCompare.symbol())+" "}var r=this._studyCompare.priceScale();return null!==r&&i.showSeriesLastValue.value()&&i.seriesLastValueMode.value()===c.PriceAxisLastValueMode.LastPriceAndPercentageValue&&(t+=r.isPercentage()?e.formattedPriceAbsolute:e.formattedPricePercentage),t.trim()},t.prototype._axisText=function(e){var t=this._studyCompare.model().properties().scalesProperties,i=this._studyCompare.priceScale();return t.seriesLastValueMode.value()!==c.PriceAxisLastValueMode.LastPriceAndPercentageValue||null===i?e.text:i.isPercentage()?e.formattedPricePercentage:e.formattedPriceAbsolute},t}(i("KcY8").a),h=i("it7y"),d=i("e92V"),p=i("mMWL"),f=i("qFKp"),_=i("ogJP"),m=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._emptyValues[0].title=t.guiPlotName(""),n}return Object(n.c)(t,e),t.prototype._hideValues=function(){return!1},t}(i("EYFt").a),v=f.CheckMobile.any(),y=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._studyCompare=t,n}return Object(n.c)(t,e),t.prototype._hideValues=function(){return!1},t.prototype._createValuesProvider=function(e,t){return new m(e,t)},t.prototype._currentIndex=function(){var e,t=this._model.crossHairSource().lockedIndex;return v&&(null===this._model.crossHairSource().pane&&void 0===t||Object(d.isLineToolName)(p.tool.value())||null!==this._model.lineBeingEdited())?e=this._study.data().lastIndex():(e=this._model.crossHairSource().appliedIndex(),Object(_.isNumber)(e)||(e=this._study.data().lastIndex())),e},t}(h.StudyDataWindowView),g=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._additional=null,n._showStudyValues=i.properties().paneProperties.legendProperties.showStudyValues,n._showStudyValues.subscribe(n,n.update),n}return Object(n.c)(t,e),t.prototype.isValuesVisible=function(){return this._showStudyValues.value()},t.prototype.destroy=function(){this._showStudyValues.unsubscribeAll(this)},t.prototype.additional=function(){return this._additional},t.prototype._updateImpl=function(){e.prototype._updateImpl.call(this)},t}(y),b=i("2kV1"),S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype.getSplitTitle=function(){return this._source.titleInParts(!0,void 0,!1,!1)},t.prototype.text=function(){return this._source.isFailed()?this._source.title(!0,void 0,!1,!1)+": "+this._source.status():this._source.title(!0,void 0,!1,!1)+" "+this._source.status()},t}(i("W+6j").a);i.d(t,"a",(function(){return x}));var w=l.enabled("study_overlay_compare_legend_option"),P=l.enabled("force_exchange_as_title"),C=l.enabled("uppercase_instrument_names"),T=!l.enabled("hide_study_compare_legend_item"),x=function(e){ function t(t,i,n,r){var o=this;return i.hasChild("currencyId")||i.addChild("currencyId",new a.a(null)),(o=e.call(this,t,i,n,r)||this).properties().minTick.subscribe(null,(function(){return o._recreatePriceFormattingDependencies()})),o.properties().minTick.subscribe(null,(function(){return o._model.fullUpdate()})),o.properties().currencyId.subscribe(o,o._onCurrencyChanged),o.properties().merge({skipHistogramBaseOnAutoScale:!0}),o}return Object(n.c)(t,e),t.prototype.createPriceAxisView=function(e){return new u(this,{plotIndex:"compare"})},t.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this.symbolInfo(),n=i&&i.exchange&&0!==i.exchange.length;return e=P&&n&&i?i.exchange:i?i.name:t,C?e.toUpperCase():e},t.prototype.setSymbol=function(e){this._properties.inputs.symbol.setValue(e)},t.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var e=this._properties.inputs.symbol.value();return e&&this._resolvedSymbols[this._resolvedSymbolKey(e)]||null},t.prototype.symbolResolved=function(){return this.symbolsResolved()},t.prototype.currency=function(){return this._properties.currencyId.value()||null},t.prototype.setCurrency=function(e){this._properties.currencyId.setValue(e)},t.prototype.isConvertedToOtherCurrency=function(){return Object(o.isConvertedToOtherCurrency)(this.symbolInfo())},t.prototype.symbolSource=function(){return this},t.prototype.state=function(t,i){var n=e.prototype.state.call(this,t,i);return n},t.prototype.titleInParts=function(e,t,i,n){var r=this._titleInParts(e,t,i,n).join(", ");return[C?r.toUpperCase():r]},t.prototype.tags=function(){var e=this.symbol();return e?[e]:[]},t.prototype.statusView=function(){return T?e.prototype.statusView.call(this):null},t.prototype.guiPlotName=function(e){return this.properties().inputs.symbol.value()},t.prototype.canOverrideMinTick=function(){return!0},t.prototype.canBeHiddenByGlobalFlag=function(){return!1},t.prototype.valuesProvider=function(){return new m(this,this.model())},t.prototype.statusProvider=function(e){return new S(this,this._model.properties().scalesProperties.textColor)},t.prototype.createViews=function(){this._legendView||(this._legendView=new g(this,this._model)),this._dataWindowView||(this._dataWindowView=new y(this,this._model)),this._statusView||(this._statusView=new b.StudyStatusView(this)),e.prototype.createViews.call(this)},t.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},t.prototype._onCurrencyChanged=function(){this.isStarted()&&this._tryChangeInputs(),this._currencyChanged.fire()},t.prototype._getSymbolObject=function(t){var i=e.prototype._getSymbolObject.call(this,t),n=this.currency();return null!==n&&(i["currency-id"]=n),i},t.prototype._onSymbolResolved=function(t){e.prototype._onSymbolResolved.call(this,t),this._recreatePriceFormattingDependencies();var i=this.symbolInfo();i&&this.setCurrency(Object(o.symbolCurrency)(i))},t.prototype._tryCreateFormatter=function(){var e=this.symbolInfo() ;return Object(o.createSeriesFormatter)(e,this.properties().minTick.value())},t.prototype._resolvedSymbolKey=function(e){var t=this.currency();return e+(null===t?"":"_#_"+t)},t.prototype._titleInParts=function(e,t,i,n){var r,o=this.properties().inputs.symbol.value(),s=this.symbolInfo(),a=s&&s.exchange&&0!==s.exchange.length;if(P&&a&&s)r=s.exchange;else if(s){if(w)r="description"===this._model.mainSeries().properties().statusViewStyle.symbolTextSource.value()?s.description:s.name;else r=s.name;if(a&&!n)return[r,[s.exchange]]}else r=o;return[r]},t}(r.Study)},Z0Sh:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("5rJj"),o=i("j3hX").LineToolColorsProperty;function s(e,t){var r=t||s.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("eg8N").GannSquarePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,n),s.HLevelsCount=7,s.VLevelsCount=7,s.prototype.hLevelsCount=function(){return s.HLevelsCount},s.prototype.vLevelsCount=function(){return s.VLevelsCount},s.prototype.pointsCount=function(){return 2},s.prototype.name=function(){return"Gann Box"};var a=[4.5,9,11.25,18,22.5,36,45],l=function(){for(var e=[],t=a.length-1,i=1,n=0,r=0;r<1e10;)r=a[n]*i,e.push(Math.round(r)),e.push(Math.ceil(-r)),n===t-1&&(i*=10),n=(n+1)%t;return e.sort((function(e,t){return et?1:0})),e}();s.prototype._alignPriceOnPattern=function(e,t){var i=Math.round(1e6*(e.price-t.price))/1e6;if(0===i)return t.price;for(var n=a[0],r=a[a.length-1],o=1,s=Math.abs(i);s=0&&!(a[c]*o=0?l:-l),e},s.prototype._alignTimeOnPattern=function(e,t){var i=e.index-t.index;if(0===i)return 0;for(var n=l.length-2;n>=0&&!(l[n]0?1:0,e.index=t.index+l[n],e},s.prototype._alignPointsFixedIncrement=function(e,t){return this._alignTimeOnPattern(e,t),this._alignPriceOnPattern(e,t),e},s.prototype._preparePoint=function(e,t){return t&&t.shift()&&0!==this._points.length&&this._alignPointsFixedIncrement(e,this._points[0]),n.prototype._preparePoint.call(this,e,t)},s.prototype.setPoint=function(e,t,i){if(i&&i.shift()){var r=0===e?this._points[1]:this._points[0];this._alignPointsFixedIncrement(t,r)}n.prototype.setPoint.call(this,e,t,i)},s.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("2liL").GannSquareDefinitionsViewModel}.bind(null,i)).catch(i.oe)},s.createProperties=function(e){var t=new r("linetoolgannsquare",e,!1,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]});return s._configureProperties(t),t},s._configureProperties=function(e){n._configureProperties(e);for(var t=[e.child("color"),e.child("fans").child("color")],i=1;i<=s.HLevelsCount;i++)t.push(e.child("hlevel"+i).child("color"));for(i=1;i<=s.VLevelsCount;i++)t.push(e.child("vlevel"+i).child("color"));e.addChild("linesColors",new o(t)),e.addExclusion("linesColors")}, t.LineToolGannSquare=s},Z8aO:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesPriceLinePaneView",(function(){return s}));var n=i("mrSG"),r=i("k4w6"),o=i("8Uy/"),s=function(e){function t(t){var i=e.call(this,t)||this;return i._lineRendererData.linestyle=o.LINESTYLE_DOTTED,i}return Object(n.c)(t,e),t.prototype._updateImpl=function(){if(this._lineRendererData.visible=!1,this._series.properties().showPriceLine.value()&&12!==this._series.properties().style.value()){var e=this._series.lastValueData(void 0,!0);e.noData||(this._lineRendererData.visible=!0,this._lineRendererData.y=e.coordinate,this._lineRendererData.color=this._series.priceLineColor(e.color),this._lineRendererData.linewidth=this._series.properties().priceLineWidth.value())}},t}(r.a)},ZAbA:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesDataEvents",(function(){return o}));var n=i("aIyQ"),r=i.n(n),o=function(){function e(){this._completed=new r.a,this._error=new r.a,this._symbolError=new r.a,this._symbolResolved=new r.a,this._seriesError=new r.a,this._symbolNotPermitted=new r.a,this._symbolGroupNotPermitted=new r.a,this._extendedHoursNotPermitted=new r.a,this._chartTypeNotPermitted=new r.a,this._intradaySpreadNotPermitted=new r.a,this._intradayExchangeNotPermitted=new r.a,this._customIntervalNotPermitted=new r.a,this._secondsIntervalNotPermitted=new r.a,this._tickMarksRangeChanged=new r.a,this._barReceived=new r.a,this._messageReceived=new r.a}return e.prototype.completed=function(){return this._completed},e.prototype.error=function(){return this._error},e.prototype.symbolError=function(){return this._symbolError},e.prototype.symbolResolved=function(){return this._symbolResolved},e.prototype.seriesError=function(){return this._seriesError},e.prototype.symbolNotPermitted=function(){return this._symbolNotPermitted},e.prototype.symbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},e.prototype.extendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},e.prototype.chartTypeNotPermitted=function(){return this._chartTypeNotPermitted},e.prototype.intradaySpreadNotPermitted=function(){return this._intradaySpreadNotPermitted},e.prototype.intradayExchangeNotPermitted=function(){return this._intradayExchangeNotPermitted},e.prototype.customIntervalNotPermitted=function(){return this._customIntervalNotPermitted},e.prototype.secondsIntervalNotPermitted=function(){return this._secondsIntervalNotPermitted},e.prototype.tickMarksRangeChanged=function(){return this._tickMarksRangeChanged},e.prototype.barReceived=function(){return this._barReceived},e.prototype.messageReceived=function(){return this._messageReceived},e.prototype.fireCompleted=function(){this._completed.fire()},e.prototype.fireError=function(){this._error.fire()},e.prototype.fireSymbolError=function(e){this._symbolError.fire(e),this.fireError()},e.prototype.fireSymbolResolved=function(e){this._symbolResolved.fire(e)},e.prototype.fireSeriesError=function(e){this._seriesError.fire(e),this.fireError()},e.prototype.fireSymbolNotPermitted=function(e){this._symbolNotPermitted.fire(e), this.fireError()},e.prototype.fireSymbolGroupNotPermitted=function(e){this._symbolGroupNotPermitted.fire(e),this.fireError()},e.prototype.fireExtendedHoursNotPermitted=function(){this._extendedHoursNotPermitted.fire(),this.fireError()},e.prototype.fireChartTypeNotPermitted=function(e){this._chartTypeNotPermitted.fire(e),this.fireError()},e.prototype.fireIntradaySpreadNotPermitted=function(){this._intradaySpreadNotPermitted.fire(),this.fireError()},e.prototype.fireIntradayExchangeNotPermitted=function(){this._intradayExchangeNotPermitted.fire(),this.fireError()},e.prototype.fireCustomIntervalNotPermitted=function(){this._customIntervalNotPermitted.fire(),this.fireError()},e.prototype.fireSecondsIntervalNotPermitted=function(){this._secondsIntervalNotPermitted.fire(),this.fireError()},e.prototype.fireTickMarksRangeChanged=function(e){this._tickMarksRangeChanged.fire(e)},e.prototype.fireBarReceived=function(e){this._barReceived.fire(e)},e.prototype.fireMessageReceived=function(e){this._messageReceived.fire(e)},e}()},ZBiT:function(e,t,i){e.exports={"css-value-pane-controls-padding-left":"1px","css-value-pane-controls-padding-right":"5px"}},ZJKN:function(e,t,i){"use strict";i.r(t),i.d(t,"BarsRange",(function(){return r}));var n=i("Eyy1"),r=function(){function e(e,t){Object(n.assert)(e<=t,"The last bar in the bars range should be greater than or equal to the first bar"),this._firstBar=e,this._lastBar=t}return e.prototype.firstBar=function(){return this._firstBar},e.prototype.lastBar=function(){return this._lastBar},e.prototype.count=function(){return this._lastBar-this._firstBar+1},e.prototype.contains=function(e){return this._firstBar<=e&&e<=this._lastBar},e.prototype.equals=function(e){return this._firstBar===e.firstBar()&&this._lastBar===e.lastBar()},e.compare=function(e,t){return null===e||null===t?e===t:e.equals(t)},e}()},ZZnO:function(e,t,i){"use strict";i.r(t),i.d(t,"dateFormatProperty",(function(){return a})),i.d(t,"restoreDateFormatSettingsValue",(function(){return l}));var n=i("Vdly"),r=i("m/cY"),o=i("e1ZQ");function s(){return n.getValue("date_format",Object(o.c)())}var a=Object(r.a)(s());function l(){a.setValue(Object(o.c)()),n.remove("date_format")}n.onSync.subscribe(null,(function(){return a.setValue(s())})),a.listeners().subscribe(null,(function(){return n.setValue("date_format",a.value())}))},ZjKI:function(e,t,i){"use strict";i.r(t),i.d(t,"CLOSE_POPUPS_AND_DIALOGS_COMMAND",(function(){return n}));var n="CLOSE_POPUPS_AND_DIALOGS_COMMAND"},Zl0W:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolPriceNote",(function(){return c}));var n=i("mrSG"),r=i("Eyy1"),o=i("Ocx9"),s=i("tc+8"),a=i.n(s),l=i("Ss5c"),c=function(e){function t(n,r){var o=e.call(this,n,r||t.createProperties())||this;return o._labelMovingDelta=null,i.e("lt-pane-views").then(i.bind(null,"0s1X")).then((function(e){o._setPaneViews([new e.PriceNotePaneView(o,n)])})),o}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.prototype.name=function(){ return"Price Note"},t.prototype.template=function(){var t=e.prototype.template.call(this);return t.text=this.properties().childs().text.value(),t},t.prototype.startMoving=function(t,i,n){if(e.prototype.startMoving.call(this,t,i,n),1===i){var o=Object(r.ensureDefined)(Object(r.ensureNotNull)(this.startMovingPoint()).logical),s=this.points()[1];this._labelMovingDelta={index:s.index-o.index,price:s.price-o.price}}else this._labelMovingDelta=null},t.prototype.move=function(t,i,n){if(null!==this._labelMovingDelta){var o=Object(r.ensureDefined)(t.logical),s={index:o.index+this._labelMovingDelta.index,price:o.price+this._labelMovingDelta.price};this.setPoint(1,s,n)}else e.prototype.move.call(this,t,i,n)},t.prototype.endMoving=function(t){return this._labelMovingDelta=null,e.prototype.endMoving.call(this,t)},t.createProperties=function(e){var i=new o.DefaultProperty("linetoolpricenote",e);return t._configureProperties(i),i},t.prototype._applyTemplateImpl=function(t){e.prototype._applyTemplateImpl.call(this,t),this.properties().childs().text.setValue(t.text)},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"ernH")).then((function(e){return e.PriceNoteDefinitionsViewModel}))},t._configureProperties=function(e){l.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new a.a("")),e.addExclusion("text"),e.hasChild("backgroundsColors")&&e.removeProperty("backgroundsColors"),e.hasChild("textsColors")&&e.removeProperty("textsColors")},t}(l.LineDataSource)},ZmuQ:function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return a}));var n=i("jCNj"),r=i("E6p6"),o=i("5mo2"),s=function(){function e(e,t,i,n){this.init(e,t,i,n)}return e.prototype.init=function(e,t,i,r){this.timezone=n.get_timezone(e),this.spec=new o.SessionSpec(e,t,i,r)},e}(),a=function(){function e(){}return e.prototype.alignTime=function(e){if(isNaN(e))return NaN;var t=this.indexOfBar(e);return t===r.SessionStage.POST_SESSION&&(this.moveTo(e),t=this.indexOfBar(e)),t<0?NaN:this.startOfBar(t)},e}()},"Zo2/":function(e,t,i){"use strict";(function(t){i("YCFM"),i("YFKU");var n=i("Eyy1").assert,r=i("Y7w9").moveToHead,o=i("uPb3").TimeAxisWidget,s=i("fTGZ").BarsMarksContainer,a=i("qJq3").Series,l=i("Kxc7"),c=i("YmeR").ActionBinder,u=i("mKT+").resolveAndShowEditObjectDialog,h=i("Vdly"),d=h.getValue,p=h.setValue,f=i("QloM").TabNames,_=i("cdbK").showGoToDateDialog,m=i("/3z9"),v=i("lxNp"),y=i("7nsU").showConfirmInputsDialog,g=i("ikwP").disableSelection,b=i("GVHu").Study,S=i("8sOK").StudyStub,w=i("3ClC").isStudy,P=i("Ss5c").LineDataSource,C=i("CW80"),T=C.isLineTool,x=C.isStudyLineTool,I=i("7KDR"),L=I.Action,O=I.Separator,M=(i("L/Ed").ToolboxType, i("mMWL")),A=i("LxhU").Interval,k=i("pPtI").setLastUsedResolution,E=i("n5al"),V=E.getDefaultStyle,D=i("pvsv").showSymbolInfoDialog,B=i("H0vP").InvalidationMask,R=i("H0vP").InvalidationLevel,N=i("PT1i").linking,j=i("mYjs").showChangeIntervalDialog,F=i("u5Q5").showDialog,W=i("u5Q5").activateKeyPressHandler,H=i("Ocx9").DefaultProperty,z=i("+6ja"),U=z.availableTimezones,G=z.timezoneIsAvailable,Y=i("0F0w").ChartSession,q=i("0YCj"),K=i("c2JX").Spinner,Z=i("JWMC").trackEvent,J=i("VaSN").lastEventIsTouch,X=i("vaqD").LoadingScreen,Q=i("wZIs"),$=i("txPx").getLogger("ChartWidget",{color:"#606"}),ee=i("2uTr").appendEllipsis,te=i("U0+/").StudyMetaInfoRepository,ie=i("VNzU").isMultipleLayout,ne=i("b1GK").addPerfMark,re=i("KnF9").EnvironmentState,oe=i("FQhm"),se=i("wjVR").ChartWidgetBase,ae=i("qFKp").CheckMobile.any(),le=i("uDHo").TIMEFRAMETYPE,ce=i("GDWD").addPlusButtonProperty,ue=window.t("On The Left"),he=window.t("On The Right"),de=window.t("Move Scale To Left"),pe=window.t("Move Scale To Right");function fe(e,i,n){se.call(this,e,i,n),this._options.timeScaleWidget&&(this._options.timeScaleWidget.pressedMouseMoveScale=this._options.handleScale.axisPressedMouseMove.time);var r=this;this._startSpinner(this._options.container.value());var o=this._options.content,s=this._options.readOnly;this._removeMaximizeHotkey=null,r._hotkeys=v.createGroup({desc:"Chart actions",isDisabled:function(){return!r._isActive}});var a=this._options.containsData,l=this._options.onWidget,c=this._options.onCmeWidget;c&&$.logWarn("[ChartWidget] 'onCmeWidget' option is depricated");var u=this._options.widgetCustomer,h=this._options.timezone,d=this._options.hideSymbolSearch,p=this._options.defSymbol,f=A.isValid(this._options.defInterval)?this._options.defInterval:void 0,_=parseInt(this._options.defStyle),m=E.isValidStyle(_)?_:void 0,y=this._options.defExtendedHours,g=void 0!==this._options.defTimeframe?{value:this._options.defTimeframe.toUpperCase(),type:le.PeriodBack}:void 0;this._chartWidgetCollection=this._options.chartWidgetCollection,this._content=o,this._initialLoading=this._options.initialLoading,this._readOnly=s,this._containsData=a,this._showChartEvents=!a&&this._options.chartEventsEnabled,this._defSymbol=p,this._defInterval=f,this._defTimeframe=g,this._defStyle=m,this._onWidget=!!l,this._compareSymbols=this._options.compareSymbols,this._onWidget&&(c?this._widgetCustomer="cme":u&&(this._widgetCustomer=u)),this._hideSymbolSearch=d,this._frameTime=30,this._model=null,this._metaInfo={},this._drawRafId=0,this._compareDialog=null;var b=this._contentSeriesProperties();b&&(p=b.symbol,f=b.interval),void 0===this._options.useUserChartPreferences&&(this._options.useUserChartPreferences=!0),this._properties=new H("chartproperties",void 0,void 0,this._options.useUserChartPreferences);var S=this._options.useUserChartPreferences?Q.defaults("chartproperties.mainSeriesProperties"):Q.factoryDefaults("chartproperties.mainSeriesProperties");this._properties.mainSeriesProperties.merge(S),f=f||S.interval||"D", E.isValidStyle(m)||(m=E.isValidStyle(S.style)?S.style:V(A.isRange(f))),this._properties.mainSeriesProperties.merge({visible:!0,symbol:p||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:f,currencyId:null,style:m,extendedHours:y,lineStyle:{styleType:Q.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),h&&G(h)&&this._properties.timezone.setValue(h),this._tagsChanged=new t,this._disconnected=new t,this._reconnectBailout=new t,this._connected=new t,this._redraw=new t,this._onScroll=new t,this.chartWidgetInitialized=new t,this._chartSession=new Y(ChartApiInstance),this._metaInfoRepository=new te(this._chartSession),this._timingsMeter=null,this._isActive=this._options.isActive,this._options.container.subscribe((function(e){r._setElement(e)}),{callWithLast:!0});var w=function(){r.resize()};this._options.width.subscribe(w),this._options.height.subscribe(w),this._options.visible.subscribe(this._updateTimingsMeterState.bind(this)),this._aboutToBeDestroyed=new t,this._actions=null,this._definitionsViewModel=null,this._backgroundTopColorSpawn=null,this._backgroundBottomColorSpawn=null,this._onZoom=new t}inherit(fe,se),fe.prototype.onZoom=function(){return this._onZoom},fe.prototype.isInitialized=function(){return Boolean(this._inited)},fe.prototype.compareSymbols=function(){return this._compareSymbols},fe.prototype._getChartPropertyDefinitionsViewModel=function(){if(null===this._definitionsViewModel){var e=this;return new Promise((function(t,n){Promise.all([i.e(24),i.e(56),i.e("general-property-page")]).then(function(r){if(e._isDestroyed)n("Chart widget already destroyed");else{var o=i("5lPo").ChartPropertyDefinitionsViewModel;e.withModel(e,(function(){null===e._definitionsViewModel&&(e._definitionsViewModel=new o(e.model(),e.properties(),e._options)),t(e._definitionsViewModel)}))}}.bind(null,i)).catch(i.oe)}))}return Promise.resolve(this._definitionsViewModel)},fe.prototype._initMaximizeHotkey=function(e){var t=this;function i(e){e.defaultPrevented||m.modifiersFromEvent(e)===m.Modifiers.Alt&&e.stopPropagation()}function n(e){e.defaultPrevented||m.modifiersFromEvent(e)===m.Modifiers.Alt&&(e.preventDefault(),e.stopPropagation(),t.toggleFullscreen())}return e.addEventListener("mousedown",i,!0),e.addEventListener("click",n,!0),function(){e.removeEventListener("mousedown",i,!0),e.removeEventListener("click",n,!0)}},fe.prototype.toggleFullscreen=function(){var e=this.getResizerDetacher();e.fullscreenable.value()&&(e.fullscreen.value()?e.exitFullscreen():e.requestFullscreen())},fe.prototype._beginRequestActive=function(){var e=this._chartWidgetCollection.activeChartWidget.value()!==this;this._chartWidgetCollection.activeChartWidget.setValue(this),e&&(J()&&this._isLineToolModeExceptBrush()&&this.updateCrossHairPositionIfNeeded(),this._justActivated=!0)},fe.prototype._endRequestActive=function(){var e=this;this._justActivated&&setTimeout((function(){e._justActivated=!1}),0)}, fe.prototype._requestActive=function(){this._beginRequestActive(),this._endRequestActive()},fe.prototype.justActivated=function(){return this._justActivated},fe.prototype._onMousewheel=function(e){if(this.model().model().zoomEnabled()&&(TradingView.onWidget()||!parent||parent===window||!parent.IS_DEMO_PAGE)&&this.model()&&!this.noScroll&&!this.model().timeScale().isEmpty()){var t=this._mouseWheelHelper.processWheel(e),i=t.deltaX/100,n=-t.deltaY/100;if(0!==i&&this._options.handleScroll.mouseWheel||0!==n&&this._options.handleScale.mouseWheel){switch(e.cancelable&&e.preventDefault(),e.deltaMode){case e.DOM_DELTA_PAGE:i*=120,n*=120;break;case e.DOM_DELTA_LINE:i*=32,n*=32}if(0!==n&&this._options.handleScale.mouseWheel){var r=Math.sign(n)*Math.min(1,Math.abs(n)),o=this._mainDiv.getBoundingClientRect(),s=e.clientX-this._lhsAxesWidth-o.left;if(!Number.isFinite(s)||!Number.isFinite(r))return void $.logWarn("Incorrect mouse wheel processing: scrollPosition: "+s+", zoomScale: "+r);var a=new re(e).control();this.model().model().zoomTime(s,r,!!a||void 0),this._onZoom.fire(a)}0!==i&&this._options.handleScroll.mouseWheel&&this.model().scrollChart(-80*i)}}},fe.prototype.setTimezone=function(e){e&&G(e)?this._properties.timezone.setValue(e):console.warn("Incorrect timezone: "+JSON.stringify(e))},fe.prototype.getTimezone=function(){return this._properties.timezone.value()},fe.prototype.refreshMarks=function(){this.model().barsMarksSources().forEach((function(e){e.refreshData()}))},fe.prototype.clearMarks=function(){this.model().barsMarksSources().forEach((function(e){e.clearMarks()}))},fe.prototype.metaInfoRepository=function(){return this._metaInfoRepository},fe.prototype._init=function(){var e=this;this.model()&&this.model().mainSeries().clearData(),this.initColors(),this._makeDefaultGui();var t=function(){e._checkObsoleteTimezone(),e._chartSession&&e._chartSession.connected()&&this._model.restart(),this._content&&(this.initColors(),this._updateGui(),this.update()),this._resizeHandler=function(){this.adjustSize(),this._model&&this._model.mainSeries().requestMoreData(),this.paint()}.bind(this),this._resizeHandler(),this._parent.appendChild(this._mainDiv),this._spinner&&(this._spinner.stop(),delete this._spinner),this._keydownEventListener=function(e){27===e.which&&e.preventDefault()},window.addEventListener("keydown:chart_"+this._id,this._keydownEventListener),this._initBarsMarksSources(),this._activateSymbolSearchHotkeys(),this.model().timeScale().onScroll().subscribe(this,(function(){this._onScroll.fire()})),this._inited=!0}.bind(this),i=this._makeDefaultModel();void 0===i?t():i.then(t)},fe.prototype._activateSymbolSearchHotkeys=function(){this.readOnly()||this._hideSymbolSearch||W()},fe.prototype._checkObsoleteTimezone=function(){var e=this._properties.timezone.value();G(e)||this._properties.timezone.setValue({UTC:"Etc/UTC",EST:"America/New_York",CST:"America/Chicago",PST:"America/Los_Angeles"}[e]||"exchange")},fe.prototype._initBarsMarksSources=function(){var e=this;this.withModel(this,(function(){ this.model().barsMarksSources().forEach((function(t){t.onNeedRepaint.subscribe(e,(function(){e.model().model().lightUpdate()}))}))}))},fe.prototype.initColors=function(){this._properties.scalesProperties.lineColor.listeners().subscribe(this,fe.prototype.setScaleLineColor),this._properties.scalesProperties.textColor.listeners().subscribe(this,fe.prototype.setScaleTextColor)},fe.prototype._initBackgroundColor=function(){null===this._backgroundTopColorSpawn&&(this._backgroundTopColorSpawn=this._model.model().backgroundTopColor().spawn(),this._backgroundTopColorSpawn.subscribe(this._onBackgroundColorChanged.bind(this))),null===this._backgroundBottomColorSpawn&&(this._backgroundBottomColorSpawn=this._model.model().backgroundColor().spawn(),this._backgroundBottomColorSpawn.subscribe(this._onBackgroundColorChanged.bind(this)))},fe.prototype.paneWidgets=function(){return this._paneWidgets},fe.prototype.paneByCanvas=function(e){for(var t=0;t{if(window.widgetbar){for(var e,i=window.widgetbar.setPage("base"),n=0;nR.Cursor&&this._timeAxisWidget.update(),this._dataWindowWidget){var i=e.maxPaneInvalidation();i===R.Full?this._dataWindowWidget.fullUpdate():i>R.None&&this._dataWindowWidget.update()} for(var n=0;n0;)for(var t=this._content.panes[e].sources,i=t.length;i-- >0;)if("MainSeries"===t[i].type)return t[i].state},fe.prototype.updateUndoRedo=function(){this._model&&(this.actions().undo.update({disabled:this._model.undoHistory().undoStack().isEmpty()}),this.actions().redo.update({disabled:this._model.undoHistory().redoStack().isEmpty()}))},fe.prototype.createSessionBreaksActions=function(e){var t=new L({label:window.t("Session Breaks"),checkable:!0,statName:"ToggleSessionBreaks"});t.binder=new c(t,this._model.chartModel().sessions().properties().graphics.vertlines.sessBreaks.visible,this.model(),"Session Breaks"),this._actions.sessionBreaks=t},fe.prototype.updateActionForIntradayOnly=function(e){e&&e instanceof L&&e.update({disabled:this.model().mainSeries().isDWM()})},fe.prototype.containsVolume=function(){return this.model().dataSources().some((function(e){return e instanceof b&&"Volume"===e.metaInfo().shortId}))},fe.prototype.containsStudyByPredicate=function(e){return!!this._model&&this._model.dataSources().some((function(t){if(!(t instanceof b))return!1;var i=t.metaInfo();return e(i)}))},fe.prototype.containsStudy=function(e){return this.containsStudyByPredicate((function(t){return t.id===e||t.fullId===e}))},fe.prototype.isSmall=function(){return this._width()<550||this._height()<300},fe.prototype.onWidget=function(){return this._onWidget},fe.prototype.onCmeWidget=function(){return"cme"===this.widgetCustomer()},fe.prototype.widgetCustomer=function(){return this._widgetCustomer},fe.prototype.resize=function(){var e=this._height()+"px",t=this._width()+"px";this._mainDiv.style.height=e,this._mainDiv.style.width=t,this._elMainTable.style.height=e,this._elMainTable.style.width=t,this._resizeHandler&&this._mainDiv&&this._resizeHandler()},fe.prototype.chartSession=function(){return this._chartSession},fe.prototype.GUIResetScales=function(){Z("GUI","Reset Scales");var e=this.model();e&&e.resetScales()},fe.prototype.onLineCancelled=function(){M.resetToCursor()},fe.prototype._startSpinner=function(e){this._spinner||e&&(this._spinner=(new K).spin(e))},fe.prototype.isJustClonedChart=function(){return!!(this._options||{}).justCloned},fe.prototype.setDataWindowWidget=function(e){this._dataWindowWidget=e},fe.prototype.removeDataWindowWidget=function(){this._dataWindowWidget=null},l.enabled("datasource_copypaste")&&(fe.prototype.onAppClipboardPaste=function(e){$.logDebug("[[paste]]"),this._model&&this._model.pasteSourceFromClip(e)},fe.prototype.onAppClipboardCopy=function(e){e||(e=this._model.selection().dataSources()),e.filter((function(e){return e instanceof b&&e.isChildStudy()})).length?$.logDebug("Can not copy child study"):($.logDebug("[[copy]]"),this._model&&this._model.copySourcesToClip(e))},fe.prototype.onAppClipboardCut=function(e){$.logDebug("[[cut]]"),this._model&&this._model.cutSourcesToClip(e||this._model.selection().dataSources())}), fe.prototype.applyOverrides=function(e){var t={};for(var i in e)i.startsWith("mainSeriesProperties.priceAxisProperties")||(t[i]=e[i]);applyPropertiesOverrides(this.properties(),null,!1,t,null),this._model&&(applyPropertiesOverrides(this._model.model().properties(),null,!1,t),applyPropertiesOverrides(this._model.mainSeries().properties(),null,!1,t,"mainSeriesProperties"))},fe.prototype.applyStudiesOverrides=function(e){q.setDefaultsOverrides(e),this._applyStudiesOverrides()},fe.prototype.setActive=function(e){this._isActive=e,J()&&(e&&this.selectBarMode().value()?this.startTrackingMode():this.exitTrackingMode()),this._paneWidgets.forEach((function(e){e.update()})),e||this.model().selectionMacro((function(e){e.clearSelection()}))},fe.prototype.isActive=function(){return this._isActive},fe.prototype.trackTime=function(){return this._chartWidgetCollection.lock.trackTime},fe.prototype.crossHairSyncEnabled=function(){return this._chartWidgetCollection.lock.crosshair.value()},fe.prototype.isMultipleLayout=function(){return ie(this._chartWidgetCollection.layout.value())},fe.prototype.selectBarMode=function(){return this._model.model().selectBarMode()},fe.prototype.toggleSelectBarMode=function(){this.selectBarMode().value()||(M.resetToCursor(!0),this._model.lineBeingCreated()&&this._model.cancelCreatingLine()),this._model.model().toggleSelectBarMode(),this.selectBarMode().value()&&this.startTrackingMode()},fe.prototype.onBarSelected=function(){return this._model.model().onBarSelected()},fe.prototype.trySetChartStyle=function(e){var t=this.model();return!!t&&(t.mainSeries().properties().style.value()===e||!!l.enabled("charting_library_base")&&(this._setChartStyle(e),!0))},fe.prototype._setChartStyle=function(e){var t=this.model(),i=t.mainSeries().properties().style;t.setChartStyleProperty(i,e,"Change Series Style")},fe.prototype.showReplayOrderConfirmationDialog=function(){if(!this.model().isInReplay())return Promise.resolve()},fe.prototype._addPerfMark=function(e){ne("ChartWidget."+this._id+"."+e)},fe.prototype.requestFullscreen=function(){this._options.requestFullscreen()},fe.prototype.getResizerDetacher=function(){return this._options},e.exports.ChartWidget=fe,e.exports.trackingModeIsAvailable=ae}).call(this,i("aIyQ"))},"Zp/P":function(e,t,i){"use strict";i.r(t),i.d(t,"extendAndClipLineSegment",(function(){return l})),i.d(t,"getArrowPoints",(function(){return c})),i.d(t,"optimalBarWidth",(function(){return u})),i.d(t,"optimalCandlestickWidth",(function(){return h})),i.d(t,"optimalHiLoWidth",(function(){return d})),i.d(t,"selectionTolerance",(function(){return p})),i.d(t,"coordinateIsValid",(function(){return f})),i.d(t,"setValidLineStyle",(function(){return _}));var n=i("aO4+"),r=i("hBTJ"),o=i("VaSN"),s=i("ogJP"),a=i("jFln");function l(e,t,i,o,s,a){if(Object(n.equalPoints)(e,t))return null;var l=new n.Point(0,0),c=new n.Point(i,o);if(s){if(a){var u=Object(r.intersectLineAndBox)(Object(n.lineThroughPoints)(e,t),Object(n.box)(l,c));return Array.isArray(u)?u:null}var h ;return null===(h=Object(r.intersectRayAndBox)(t,e,Object(n.box)(l,c)))||Object(n.equalPoints)(t,h)?null:Object(n.lineSegment)(t,h)}if(a)return null===(h=Object(r.intersectRayAndBox)(e,t,Object(n.box)(l,c)))||Object(n.equalPoints)(e,h)?null:Object(n.lineSegment)(e,h);u=Object(r.intersectLineSegmentAndBox)(Object(n.lineSegment)(e,t),Object(n.box)(l,c));return Array.isArray(u)?u:null}function c(e,t,i,n){var r=.5*i,o=Math.sqrt(2),s=t.subtract(e),a=s.normalized(),l=5*i;n&&(l=Math.min(l,.35*s.length()));var c=1*r;if(l*o*.2<=c)return[];var u=a.scaled(l),h=t.subtract(u),d=a.transposed(),p=1*l,f=d.scaled(p),_=h.add(f),m=h.subtract(f),v=_.subtract(t).normalized().scaled(c),y=m.subtract(t).normalized().scaled(c),g=t.add(v),b=t.add(y),S=r*(o-1),w=d.scaled(S),P=Math.min(l-1*r/o,r*o*1),C=a.scaled(P),T=t.subtract(w),x=t.add(w),I=t.subtract(C);return[[_,g],[m,b],[T,I.subtract(w)],[x,I.add(w)]]}function u(e,t){return t=t||1,Math.floor(.3*e*t)}function h(e,t){if(e>=2.5&&e<=4)return Math.floor(3*t);var i=1-.2*Math.atan(Math.max(4,e)-4)/(.5*Math.PI),n=Math.floor(e*i*t),r=Math.floor(e*t),o=Math.min(n,r);return Math.max(Math.floor(t),o)}function d(e){return.4*e}function p(e){return(Object(o.lastEventIsTouch)()?12:2)+.5*e}function f(e){return null!=e&&!Object(s.isNaN)(e)}function _(e,t){void 0!==t&&Object(a.setLineStyle)(e,t)}},Zp8I:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererStepLine",(function(){return c}));var n=i("GEp6"),r=i("VdBB"),o=i("aO4+"),s=i("jFln"),a=i("Y7w9"),l=i("Zp/P"),c=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.hitTest=function(e){if(null===this._data||0===this._data.items.length)return null;for(var t=this._data,i=t.items,s=t.lineWidth,c=Object(l.selectionTolerance)(s),u=Object(a.lowerbound)(i,e,(function(e,t){return e.x<=t.x})),h=Math.max(0,u-1),d=Math.min(i.length-1,u+1),p=h;p=0;n--){var r=this._renderers[n].hitTest(e,t);null!==r&&(null===i||r.result()>i.result())&&(i=r)}return i},e.prototype.doesIntersectWithBox=function(e){return this._renderers.some((function(t){return!!t.doesIntersectWithBox&&t.doesIntersectWithBox(e)}))},e}()},a7Ha:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"LineEnd",(function(){return n})),function(e){e[e.Normal=0]="Normal",e[e.Arrow=1]="Arrow",e[e.Circle=2]="Circle"}(n||(n={}))},a9Kt:function(e,t){e.exports=''},aDyP:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("5rJj"),o=i("7KDR").Action,s=i("rCHB").LineToolPitchforkStyle,a=null,l=i("j3hX"),c=l.LineToolWidthsProperty,u=l.LineToolColorsProperty;function h(e,t){var i=t||h.createProperties();n.call(this,e,i),this._properties.style.listeners().subscribe(this,h.prototype._recreatePaneView),this._recreatePaneView()}inherit(h,n),h.LevelsCount=8,h.prototype.levelsCount=function(){return h.LevelsCount},h.prototype.additionalActions=function(){for(var e=[],t=["Original","Modified Schiff","Inside","Schiff"],i=0;i<4;i++){var n=new o({checked:this.properties().style.value()===i,checkable:!0,label:window.t(t[i]),payload:{target:this,value:i},onExecute:function(e){var t=e.getPayload(),i=t.target,n=t.value;i.properties().style.setValue(n),i.updateAllViews(),i._model.updateSource(i)}});e.push(n)}return[e[0],e[3],e[1],e[2]]},h.prototype._recreatePaneView=function(){if(null!==a){var e=[];this._properties.style.value()===s.Original?e=[new a.PitchforkLinePaneView(this,this._model)]:this._properties.style.value()===s.Schiff?e=[new a.SchiffPitchforkLinePaneView(this,this._model)]:this._properties.style.value()===s.Schiff2?e=[new a.SchiffPitchfork2LinePaneView(this,this._model)]:this._properties.style.value()===s.Inside&&(e=[new a.InsidePitchforkLinePaneView(this,this._model)]),this._setPaneViews(e)}else i.e("lt-pane-views").then(function(e){null===a&&(a=i("cT+B")),this._recreatePaneView()}.bind(this).bind(null,i)).catch(i.oe)},h.prototype.pointsCount=function(){return 3},h.prototype.name=function(){return"Pitchfork"},h.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},h.createProperties=function(e){var t=new r("linetoolpitchfork",e,!1,{range:[0,8] });return h._configureProperties(t),t},h.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("HCdA").PitchForkDefinitionsViewModel}.bind(null,i)).catch(i.oe)},h._configureProperties=function(e){n._configureProperties(e);for(var t=[e.child("median").child("linewidth")],i=[e.child("median").child("color")],r=0;r<=h.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new u(i)),e.addChild("linesWidths",new c(t))},t.LineToolPitchfork=h},aILO:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolHeadAndShoulders",(function(){return a}));var n=i("mrSG"),r=i("Ocx9"),o=i("Ss5c"),s=i("j3hX"),a=function(e){function t(n,r){var o=this,s=r||t.createProperties();return o=e.call(this,n,s)||this,i.e("lt-pane-views").then(i.bind(null,"Fx2Q")).then((function(e){o._setPaneViews([new e.LineToolHeadAndShouldersPaneView(o,n)])})),o}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 7},t.prototype.name=function(){return"Head and Shoulders"},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.createProperties=function(e){var i=new r.DefaultProperty("linetoolheadandshoulders",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"/HOw")).then((function(e){return e.PatternWithBackgroundDefinitionViewModel}))},t._configureProperties=function(e){o.LineDataSource._configureProperties(e),e.addChild("linesColors",new s.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new s.LineToolColorsProperty([e.childs().textcolor]))},t}(o.LineDataSource)},aIha:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolFlagMark",(function(){return l}));var n=i("mrSG"),r=i("aO4+"),o=i("Ss5c"),s=i("Ocx9"),a=i("j3hX"),l=function(e){function t(n,o){var s=this,a=o||t.createProperties();return s=e.call(this,n,a)||this,i.e("lt-pane-views").then(function(e){var t=new(0,i("y/56").FlagMarkPaneView)(s,s.model());t.setAnchors(new r.Point(0,0)),s._setPaneViews([t])}.bind(null,i)).catch(void 0),s}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 1},t.prototype.name=function(){return"Flag Mark"},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.createProperties=function(e){e&&void 0===e.flagColor&&(e.flagColor="#318757");var i=new s.DefaultProperty("linetoolflagmark",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"w/mY")).then((function(e){return e.FlagMarkDefinitionsViewModel}))},t._configureProperties=function(e){o.LineDataSource._configureProperties(e),e.addChild("backgroundsColors",new a.LineToolColorsProperty([e.childs().flagColor])),e.addExclusion("backgroundsColors")},t.version=2,t}(o.LineDataSource)},aIyQ:function(e,t,i){ "use strict";(function(e){var t=i("txPx").getLogger("Common.Delegate");function n(){this._listeners=[]}function r(e){return!e.singleshot}n.prototype.subscribe=function(e,t,i){var n={object:e,member:t,singleshot:!!i};this._listeners.push(n)},n.prototype.unsubscribe=function(e,t){for(var i=0;i=0;--t){this._listeners[t].object===e&&this._listeners.splice(t,1)}},n.prototype.destroy=function(){delete this._listeners},n.prototype.fire=function(){var e=this._listeners;this._listeners=this._listeners.filter(r);for(var i=e.length,n=0;n0)},t.box=function(e,t){return{min:r(Math.min(e.x,t.x),Math.min(e.y,t.y)),max:r(Math.max(e.x,t.x),Math.max(e.y,t.y))}},t.equalBoxes=function(e,t){return o(e.min,t.min)&&o(e.max,t.max)}},akof:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererCircleShape",(function(){return a}));var n=i("mrSG"),r=i("2WC2"),o=i("aO4+"),s=2*Math.PI,a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._drawItemShapeUsingCSSPixels=function(e,t){var i=Math.max(t.width,t.height)/2,n=t.x,r=t.vertOffset,o=t.y+r;e.moveTo(n+i,o),e.arc(n,o,i,0,s,!1)},t.prototype._calcBoundingBox=function(t){var i=Math.max(t.width,t.height)/2,n=t.x,r=t.vertOffset,s=t.y+r,a=n-i,l=n+i,c=s-i,u=s+i,h=new o.Point(a,c),d=new o.Point(l,u),p=Object(o.box)(h,d),f=e.prototype._calcBoundingBox.call(this,t);return f&&(p=this._unionBox(p,f)),p},t}(r.a)},b1GK:function(e,t,i){"use strict";function n(){}i.r(t),i.d(t,"addPerfMark",(function(){return s}));var r=console.timeStamp?console.timeStamp.bind(console):n,o=window.performance&&performance.mark?performance.mark.bind(performance):n;function s(e){r(e),o(e)}},bGI9:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyTrackPricePaneView",(function(){return s}));var n=i("mrSG"),r=i("2ijp"),o=i("8Uy/"),s=function(e){function t(t,i){var n=e.call(this)||this;return n._lineRendererData.linestyle=o.LINESTYLE_DOTTED,n._study=t,n._plotName=i,n}return Object(n.c)(t,e),t.prototype._updateImpl=function(){this._lineRendererData.visible=!1;var e=this._study.properties().styles[this._plotName];if(e.trackPrice.value()){var t=this._study.lastValueData(this._plotName,!0);t.noData||(this._lineRendererData.visible=!0,this._lineRendererData.y=t.coordinate,this._lineRendererData.color=t.color,this._lineRendererData.linewidth=e.linewidth.value())}},t}(r.a)},bJYc:function(e,t,i){"use strict";i.r(t),i.d(t,"SetPropertyUndoCommand",(function(){return s}));var n=i("mrSG"),r=i("RDU5"),o=i("Ocx9"),s=function(e){function t(t,i,n,r,o){var s=e.call(this,n)||this;return s._targetObj=t,s._newValue=i,s._oldValue=s._targetObj.value(),s._model=r,o&&s.setCustomFlag("doesnt_affect_save",!0),s}return Object(n.c)(t,e),t.prototype.redo=function(){Object(o.saveDefaultProperties)(!0),this._targetObj.setValue(this._newValue),Object(o.saveDefaultProperties)(!1),this._model.recalculateAllPanes(),this._model.lightUpdate()},t.prototype.undo=function(){Object(o.saveDefaultProperties)(!0),this._targetObj.setValue(this._oldValue),Object(o.saveDefaultProperties)(!1),this._model.recalculateAllPanes(),this._model.lightUpdate()},t}(r.UndoCommand)},bKFv:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"StatsPosition",(function(){return n})),function(e){e[e.Left=0]="Left",e[e.Center=1]="Center",e[e.Right=2]="Right"}(n||(n={}))},bOGh:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})) ;var n=i("mrSG"),r=function(e){function t(t){var i=e.call(this,t,!1)||this;return i._subcommands=[],i}return Object(n.c)(t,e),t.prototype.addCommand=function(e){this._subcommands.push(e)},t.prototype.isEmpty=function(){return 0===this._subcommands.length},t.prototype.redo=function(){for(var e=0;e=0;e--)this._subcommands[e].undo()},t.prototype.commands=function(){return this._subcommands},t}(i("RDU5").UndoCommand)},bSeV:function(e,t,i){},bTqm:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolCypherPattern",(function(){return s}));var n=i("mrSG"),r=i("NJRZ"),o=i("Ocx9"),s=function(e){function t(i,n){var r=n||t.createProperties();return e.call(this,i,r)||this}return Object(n.c)(t,e),t.prototype.name=function(){return"Cypher Pattern"},t.createProperties=function(e){var i=new o.DefaultProperty("linetoolcypherpattern",e);return t._configureProperties(i),i},t.prototype._loadPaneViews=function(e){var t=this;i.e("lt-pane-views").then(i.bind(null,"mjK7")).then((function(i){t._setPaneViews([new i.CypherPaneView(t,e)])}))},t._configureProperties=function(e){r.LineTool5PointsPattern._configureProperties(e)},t}(r.LineTool5PointsPattern)},bc0y:function(e,t,i){},biIa:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesWaterlinePaneView",(function(){return l}));var n=i("mrSG"),r=i("k4w6"),o=i("//lt"),s=i("VdBB"),a=i("8Uy/"),l=function(e){function t(t){var i=e.call(this,t)||this,n={cursorType:o.PaneCursorType.VerticalResize,itemIndex:0};return i._lineRenderer.setHitTest(new s.HitTestResult(s.HitTestResult.CUSTOM_MOVE,n)),i._lineRendererData.visible=!0,i._lineRendererData.linestyle=a.LINESTYLE_SPARSE_DOTTED,i}return Object(n.c)(t,e),t.prototype._updateImpl=function(){var e=this._series.properties().baselineStyle,t=Math.abs(100-e.baseLevelPercentage.value());this._lineRendererData.y=Math.round(this._series.priceScale().height()*(t/100)),this._lineRendererData.color=e.baselineColor.value()},t}(r.a)},brCa:function(e,t,i){"use strict";i.r(t),i.d(t,"createNoticeDialog",(function(){return o})),i.d(t,"showNoticeDialog",(function(){return s}));var n=i("mrSG"),r=(i("YFKU"),{width:400,destroyOnClose:!0,title:window.t("Notification"),content:window.t("You are notified"),contentWrapTemplate:'

',actionsWrapTemplate:'
',actions:[{name:"ok",type:"primary",text:window.t("Ok"),method:"close",key:[13,32]}]});function o(e){return new Promise((function(t){Promise.all([i.e("dialogs-core"),i.e(57),i.e(0),i.e(18),i.e("create-dialog")]).then(function(o){var s=i("YDhE").createDialog;t(s(Object(n.a)(Object(n.a)({},r),e)))}.bind(null,i)).catch(void 0)}))}function s(e){o(e).then((function(e){return e.open()}))}},"bv/X":function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;function o(e,t){var r=t||o.createProperties() ;n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("piZW").SineLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.name=function(){return"Sine Line"},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("LX4V").CyclicAndSineLinesPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o.createProperties=function(e){var t=new r("linetoolsineline",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},t.LineToolSineLine=o},c2JX:function(e,t,i){"use strict";i.r(t),i.d(t,"renderSpinnerTemplate",(function(){return o})),i.d(t,"Spinner",(function(){return a}));i("SzKR");var n=i("gWrr"),r=i("Owlf");function o(e){return void 0===e&&(e=""),'\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\x3c!--\n\t\t\t\t--\x3e
\n\t\t\t
\n\t\t
\n\t'}var s=Object(n.b)(o()),a=function(){function e(e){this._shown=!1,this._el=s.cloneNode(!0),this.setSize(e||r.a)}return e.prototype.spin=function(e){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=e,void 0!==e&&e.appendChild(this._el)),this._shown=!0,this},e.prototype.stop=function(e){return e&&void 0!==this._container&&this._container.removeChild(this._el),this._el.classList.remove("tv-spinner--shown"),this._shown=!1,this},e.prototype.setStyle=function(e){var t=this;return Object.keys(e).forEach((function(i){var n=e[i];void 0!==n&&t._el.style.setProperty(i,n)})),this},e.prototype.setSize=function(e){var t=void 0!==e?"tv-spinner--size_"+e:"";return this._el.className="tv-spinner "+t+" "+(this._shown?"tv-spinner--shown":""),this},e.prototype.getEl=function(){return this._el},e.prototype.destroy=function(){this.stop(),delete this._el,delete this._container},e}()},c44N:function(e,t,i){"use strict";function n(e,t){return e.pixelRatio===t.pixelRatio}i.r(t),i.d(t,"areEqualPaneRenderParams",(function(){return n}))},cBZt:function(e,t,i){"use strict";function n(e,t){return e+"@"+t}function r(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")}i.r(t),i.d(t,"studyIdString",(function(){return n})),i.d(t,"extractStudyId",(function(){return r}))},cKqi:function(e,t,i){"use strict" ;var n=i("aO4+").Point,r=i("qJq3").Series,o=i("GVHu").Study,s=i("k9/m").PlotRowSearchMode,a=i("FBsw").OverlayPriceAxisView,l=i("KtbP").PanePriceAxisView,c=i("x0JF"),u=c.SeriesAreaPaneView,h=c.SeriesLinePaneView,d=c.SeriesHollowCandlesPaneView,p=c.SeriesCandlesPaneView,f=c.SeriesBarsPaneView,_=c.SeriesBaselinePaneView,m=i("biIa").SeriesWaterlinePaneView,v=i("2kV1").StudyStatusView,y=i("JjUe").OverlayDataWindowView,g=i("z8/4").OverlayLegendView,b=i("qXYw").OverlayLegendValuesProvider,S=i("ZsYR").OverlayStatusProvider,w=i("38az").SeriesBarColorer,P=i("l4sv").HorizontalLineRenderer,C=i("Kxc7"),T=i("6sst").OverlayStudyPriceLineAxisView,x=i("Qb4w").PriceRange,I=i("XPit").barFunction,L=i("XPit").seriesPlotFunctionMap,O=i("k9/m").PlotList,M=i("n5al").createSeriesFormatter,A=i("y/Xm").StudyOverlayBase,k=i("qFKp").CheckMobile.any()&&!1,E=!C.enabled("hide_study_overlay_legend_item"),V=i("txPx").getLogger("Chart.StudyOverlay");function D(e,t){this._source=e,this._model=t,this._points=[new n(0,0)],this._lineRenderer=new P}function B(e,t){return null==e[t]}function R(e,t,i,n){this._waterlineView=null,A.call(this,e,t,i,n),this.m_data=new O(L(),B),this._formatter=null,this._paneView=null;var r=this;this.properties().minTick.listeners().subscribe(null,(function(){r._recreatePriceFormattingDependencies(),r.updateAllViews(),r._model.fullUpdate()})),this.properties().style.listeners().subscribe(this,this._updateBarFunction),this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}D.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var e=this._source.lastValueData(void 0,!0);e.noData||(this._visible=!0,this._points=[new n(0,e.coordinate)],this._color=e.color)}},D.prototype.renderer=function(){var e={};return e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.y=this._points[0].y,e.color=this._color,e.linewidth=1,e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),this._lineRenderer},inherit(R,A),R.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},R.prototype.lastValueData=function(e,t,i){var n={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return n;var o=this._model.timeScale().visibleBarsStrictRange();if(null===o)return n;if(!this.properties().visible.value())return n;var a=this.nearestIndex(o.lastBar(),s.NearestLeft,TradingView.OPEN_PLOT);if(null==a)return n;var l=this._lastNonEmptyPlotRow(TradingView.CLOSE_PLOT),c=null!==l&&o.contains(l.index),u=null!==l?l.value:null,h=t||c?u:this.data().valueAt(a);if(null===h)return n;var d=this._barFunction(h);if(!isNumber(d))return n;var p={noData:!1};i&&(p.price=d) ;var f=this.firstValue();if(!isNumber(f))return n;p.text=this.priceScale().formatPrice(d,f),p.text=this.priceScale().formatPrice(d,f),p.formattedPriceAbsolute=this.priceScale().formatPriceAbsolute(d),p.formattedPricePercentage=this.priceScale().formatPricePercentage(d,f),p.floatCoordinate=this.priceScale().priceToCoordinate(d,f),p.coordinate=p.floatCoordinate,p.item=h;var _=this.properties();switch(_.style.value()){case r.STYLE_BARS:p.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.barStyle.upColor.value():_.barStyle.downColor.value();break;case r.STYLE_CANDLES:case r.STYLE_HOLLOW_CANDLES:p.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.candleStyle.upColor.value():_.candleStyle.downColor.value();break;case r.STYLE_LINE:p.color=_.lineStyle.color.value();break;case r.STYLE_AREA:p.color=_.areaStyle.color1.value();break;case r.STYLE_BASELINE:var m=_.baselineStyle,v=this.priceScale(),y=Math.round(v.height()*(Math.abs(100-m.baseLevelPercentage.value())/100));p.color=p.coordinate0),o?{left:0,right:1,totallySlots:i}:{left:1,right:0,totallySlots:i}}return{left:e,right:t,totallySlots:e+t}},X.prototype.startScalePrice=function(e,t,i){e.startScalePrice(t,i)},X.prototype.scalePriceTo=function(e,t,i){e.scalePriceTo(t,i),this.mainSeries().priceScale().isLockScale()?this.lightUpdate():this.invalidate(this._paneInvalidationMask(e,S.Light)),this._setScalesResetAvailable(!0)},X.prototype.endScalePrice=function(e,t){e.endScalePrice(t),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.startScrollPrice=function(e,t,i){e.startScrollPrice(t,i)},X.prototype.scrollPriceTo=function(e,t,i){e.scrollPriceTo(t,i),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.endScrollPrice=function(e,t){e.endScrollPrice(t),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.setPriceAutoScale=function(e,t,i){e.setPriceAutoScale(t,i),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.restorePriceScaleState=function(e,t,i){e.restorePriceScaleState(t,i),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.resetPriceScale=function(e,t){this._setScalesResetAvailable(!1),e.resetPriceScale(t),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.updateScales=function(e,t){this._undoModel._chartWidget._updateScalesActions()},X.prototype.startScaleTime=function(e){this._timeScale.startScale(e)},X.prototype.mainSeriesScaleRatioProperty=function(){return this._mainSeriesScaleRatioProperty},X.prototype.mainSeriesScaleRatioPropertyOnChanged=function(){this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)},X.prototype.mainSeriesScaleRatio=function(){return N(this._timeScale,this.m_mainSeries.priceScale())},X.prototype.setMainSeriesScaleRatio=function(e){this.paneForSource(this.m_mainSeries).applyPriceScaleRatio(this.m_mainSeries.priceScale(),e)},X.prototype.scaleTimeTo=function(e){this._timeScale.scaleTo(e),this.recalculateAllPanes(),this.lightUpdate(),this._setScalesResetAvailable(!0)},X.prototype.endScaleTime=function(){this._timeScale.endScale(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies()},X.prototype.startScrollTime=function(e){this._timeScale.startScroll(e),this._isTimeScrolling=!0},X.prototype.scrollTimeTo=function(e){this._timeScale.scrollTo(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},X.prototype.endScrollTime=function(){this._timeScale.endScroll(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies(),this._isTimeScrolling=!1}, X.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach((function(e){p(e)&&e.recalcStudyIfNeeded&&e.recalcStudyIfNeeded()}))},X.prototype.onResetScales=function(){return this._resetScales},X.prototype.resetTimeScale=function(){this._timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies(),this.updateCrossHair(),this.lightUpdate(),this._resetScales.fire(),this._setScalesResetAvailable(!1)},X.prototype.restoreTimeScaleState=function(e){this._timeScale.restoreState(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},X.prototype.restoreFactoryDefaults=function(e){e.restoreFactoryDefaults(),this.recalcVisibleRangeStudies(!0)},X.prototype.selectionMacro=function(e){var t=this.selection().allSources();e({removeSourceFromSelection:ee.bind(this),addSourceToSelection:te.bind(this),clearSelection:Q.bind(this),selection:this.selection.bind(this)});var i=F(t,this.selection().allSources()),n=F(this.selection().allSources(),t);n.concat(t).forEach((function(e){e.updateAllViews()})),i.forEach((function(e){var t=e.hasAlert&&e.hasAlert.value()&&e.getAlertSync();t&&t.set("selected",!1)})),n.forEach((function(e){var t=e.hasAlert&&e.hasAlert.value()&&e.getAlertSync();t&&t.set("selected",!0)})),this.lightUpdate(),this.setHoveredSource(null),(i.length>0||n.length>0)&&this._selectedSourceChanged.fire()},X.prototype.checkLineToolSelection=function(){this._selection.checkLineToolSelection()},X.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},X.prototype.selection=function(){return this._selection},X.prototype.invalidate=function(e){this._invalidateHandler&&this._invalidateHandler(e)},X.prototype.orderedDataSources=function(e){var t=[];t.push(this.m_crossHairSource);for(var i=0;i0)for(s=this.dataSources(),a=0;a0){var c=r-n,u=l?null:i.rightOffset()-c;if(!this._options.shiftVisibleRangeOnNewBar&&l){var h=i.width()/(a.length()+c);h>=i.minBarSpacing()?(i.setBarSpacing(h),u=i.rightOffset()+c):s.lastBar()!==n&&(u=i.rightOffset()-c)}null!==u&&i.setRightOffset(u)}}i.setBaseIndex(r)}},X.prototype.recalculatePane=function(e){e&&e.recalculate()},X.prototype.recalculateAllPanes=function(){ for(var e=0;e1},X.prototype.lineBeingEdited=function(){return this._lineBeingEdited},X.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},X.prototype.changeLinePoint=function(e,t,i){var n=this.paneForSource(this._lineBeingEdited),r=e.price,o=e.index;if(void 0!==e.x&&void 0!==e.y){var s=this._lineBeingEdited.priceScale(),a=n.mainDataSource().firstValue();r=s.coordinateToPrice(e.y,a),o=Math.round(this.timeScale().coordinateToIndex(e.x)),r=this._magnet.align(r,o,n),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:r,index:o},t)}else this._lineBeingEdited.setPoint(this._linePointBeingEdited,e,t);var l={indexesChanged:o!==this._linePointBeingChanged.index,pricesChanged:r!==this._linePointBeingChanged.price};if(this._lineBeingEdited.updateAllViews(),this.lightUpdate(),!i&&this._lineBeingEdited.linkKey&&this._lineBeingEdited.isSynchronizable()){var c=this._lineBeingEdited.getChangePointForSync(this._linePointBeingEdited);if(null!==c){var u=this.externalTimeStamp(o);r=c.price,k.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:r,timeStamp:u},envState:t,changes:l})}}},X.prototype.calculateDefaultTags=function(){for(var e=[],t=this.dataSources(),i=0;i-1&&this._modelIntervals.splice(t,1)},X.prototype.clearIntervals=function(){for(var e=0;eu&&(h-=Math.abs(u-(d+l)),d=Math.floor(h-c)+.5);var p=d+l,f=0+t.borderSize+t.paddingTop+t.fontSize+t.paddingBottom;e.fillStyle=n.background;var _=Math.round(d*i),m=Math.round(0*i),v=Math.round(p*i),y=Math.round(f*i);e.fillRect(_,m,v-_,y-m);var g=Math.round(n.coordinate*i),b=m,S=Math.round((b+t.borderSize+t.tickLength)*i);e.fillStyle=n.color;var w=Math.max(1,Math.floor(i)),P=Math.floor(.5*i);e.fillRect(g-P,b,w,S-b);var C=f-t.baselineOffset-t.paddingBottom;e.textAlign="left",e.fillStyle=n.color,Object(r.drawScaled)(e,i,(function(){return e.fillText(n.text,d+a,C)})),e.restore()}}},e}();i.d(t,"a",(function(){return a}));var a=function(){function e(e){this._renderer=new s,this._rendererData={background:"",color:"",coordinate:0,text:"",visible:!1,width:0},this._invalidated=!0,this._model=e,this._renderer.setData(this._rendererData)}return e.prototype.update=function(){this._invalidated=!0},e.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer}, e.prototype.coordinate=function(){return this._rendererData.coordinate},e.prototype._updateImpl=function(){var e=this._rendererData;if(e.visible=!1,!this._model.timeScale().isEmpty()){var t=this._getIndex();if(null!==t){e.visible=!0,e.width=this._model.timeScale().width(),e.background=this._getBgColor(),e.color=Object(n.colorFromBackground)(e.background),e.coordinate=this._model.timeScale().indexToCoordinate(t);var i=this._model.timeScale().indexToUserTime(t);e.text=null!==i?this._model.dateTimeFormatter().format(i):"",this._invalidated=!1}}},e}()},d1Pk:function(e,t,i){"use strict";i.r(t),i.d(t,"fibLevelCoordinate",(function(){return r})),i.d(t,"fibLevelPrice",(function(){return o}));var n=i("Eyy1");function r(e,t,i,r,o,s){if(s)return Math.round(Object(n.ensureDefined)(e.coordinate)+Object(n.ensureDefined)(t.coordinate)*i);var a=e.price+t.price*i;return r.priceToCoordinate(a,o)}function o(e,t,i,r,o,s){if(!s)return e.price+t.price*i;var a=Object(n.ensureDefined)(e.coordinate)+Object(n.ensureDefined)(t.coordinate)*i;return r.coordinateToPrice(a,o)}},d700:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return o}));var n=i("/3z9");function r(e){if("INPUT"===e.tagName){var t=e.type;return"text"===t||"email"===t||"number"===t||"password"===t||"search"===t||"tel"===t||"url"===t}return"TEXTAREA"===e.tagName||e.isContentEditable}function o(e,t){if(!t)return!1;var i=255&e;if(27===i||i>>>4==7)return!1;switch(e^i){case n.Modifiers.Alt:return(38===i||40===i)&&"SELECT"===t.tagName||r(t);case n.Modifiers.Alt+n.Modifiers.Shift:return r(t);case n.Modifiers.Mod:if(67===i||!n.isMacKeyboard&&45===i){var o=t.ownerDocument&&t.ownerDocument.getSelection();if(o&&!o.isCollapsed)return!0}return r(t);case n.Modifiers.Mod+n.Modifiers.Shift:return i>=33&&i<=40&&r(t);case n.Modifiers.Shift:case 0:return!!(9!==i||t.ownerDocument&&t!==t.ownerDocument.body&&t!==t.ownerDocument.documentElement)&&((13===i||32===i||!function(e){if("BUTTON"===e.tagName)return!0;if("INPUT"===e.tagName){var t=e.type;if("submit"===t||"button"===t||"reset"===t||"checkbox"===t||"radio"===t)return!0}return!1}(t))&&("form"in t||t.isContentEditable))}return!1}},dBsn:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererCross",(function(){return l}));var n=i("aO4+"),r=i("GEp6"),o=i("ogJP"),s=i("Zp/P"),a=i("VdBB"),l=function(){function e(e){this._data=e}return e.prototype.draw=function(e,t){for(var i,n,r,s,a=t.pixelRatio,l="",c=!1,u=0,h=this._data.items;u0?"Forward":"Backward")),this._model=e,this._sourcesIds=t.map((function(e){return e.id()})),this._shift=i}function A(e,t,i,n,r,o){p.call(this,"Zoom"),this._model=e,this._startBar=t,this._endBar=i,this._startPrice=n,this._endPrice=r,this._pane=o}function k(e,t,i){p.call(this,"Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}function E(e,t,i){p.call(this,"Apply Chart Theme"),this._model=e,this._newChartProps=TradingView.factoryDefaults("chartproperties"),this._newSeriesProps=TradingView.factoryDefaults("chartproperties.mainSeriesProperties"),this._newSessionProps=t.sessions||TradingView.factoryDefaults("sessions"),["candleStyle","hollowCandleStyle","haStyle"].forEach((function(e){t.mainSourceProperties[e].wickUpColor=t.mainSourceProperties[e].wickUpColor||t.mainSourceProperties[e].wickColor,t.mainSourceProperties[e].wickDownColor=t.mainSourceProperties[e].wickDownColor||t.mainSourceProperties[e].wickColor})), t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=o({},this._newChartProps,t.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.showBidAskLabels,delete this._newChartProps.scalesProperties.showPrePostMarketPriceLabel,delete this._newChartProps.scalesProperties.showStudyPlotLabels,delete this._newChartProps.scalesProperties.showFundamentalNameLabel,delete this._newChartProps.scalesProperties.showFundamentalLastValue,delete this._newChartProps.scalesProperties.seriesLastValueMode,e.timeScale().preserveBarSpacing()&&delete this._newChartProps.scalesProperties.barSpacing,this._newSeriesProps=o({},this._newSeriesProps,t.mainSourceProperties),this._oldChartProps=e.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=e.mainSeries().properties().state(),this._oldSessionsProps=this._model.sessions().properties().state(),i||(delete this._oldSeriesProps.style,delete this._oldSeriesProps.symbol,delete this._oldSeriesProps.interval,delete this._oldSeriesProps.extendedHours,delete this._newSeriesProps.style,delete this._newSeriesProps.symbol,delete this._newSeriesProps.interval,delete this._newSeriesProps.extendedHours,delete this._newSeriesProps.bidAsk.visible,delete this._newSeriesProps.prePostMarket.visible,delete this._newSeriesProps.highLowAvgPrice)}function V(e,t){p.call(this,"Stop Sincing Drawing"),this._model=e,this._sourceId=t.id(),this._linkKey=t.linkKey}inherit(I,a),I.prototype.version=function(){return this.m_model._version},I.prototype.onData=function(e){switch(e.method){case"timescale_update":var t=e.params;this.m_model.updateTimeScale(t.index,t.zoffset,t.changes,t.index_diff,t.marks,t.clear)}},I.prototype.paneForSource=function(e){return this.m_model.paneForSource(e)},I.prototype.createPane=function(e){return this.m_model.createPane(e)},I.prototype.readOnly=function(){return this.m_model.readOnly()},I.prototype.restart=function(){this.m_model.restart()},I.prototype.disconnect=function(){this.m_model.disconnect()},I.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},I.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},I.prototype.chartModel=function(){return this._model()},I.prototype._model=function(){return this.m_model },I.prototype.pushUndoCommand=function(e){this._pushUndoCommand(e)},I.prototype._pushUndoCommand=function(e){this._undoHistory.pushUndoCommand(e)},I.prototype.startScalePrice=function(e,t,i){this.pushUndoCommand(new L(this.m_model,e,t,t.state())),this.chartModel().startScalePrice(e,t,i)},I.prototype.scalePriceTo=function(e,t,i){this.chartModel().scalePriceTo(e,t,i)},I.prototype.endScalePrice=function(e,t){this.chartModel().endScalePrice(e,t)},I.prototype.startScrollPrice=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollState=t.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(e,t,i))},I.prototype.scrollPriceTo=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new L(this.m_model,e,t,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(e,t,i))},I.prototype.endScrollPrice=function(e,t){t.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(e,t))},I.prototype.setPriceAutoScale=function(e,t,i){this.pushUndoCommand(new L(this.m_model,e,t,t.state())),this.chartModel().setPriceAutoScale(e,t,i)},I.prototype.resetPriceScale=function(e,t){this.pushUndoCommand(new L(this.m_model,e,t,t.state())),this.chartModel().resetPriceScale(e,t)},I.prototype.setWidth=function(e){this.m_model.setWidth(e)},I.prototype.setPaneHeight=function(e,t){this.m_model.setPaneHeight(e,t)},I.prototype.gridSource=function(){return this.m_model.gridSource()},I.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},I.prototype.addAlertsSource=function(e){return this.m_model.addAlertsSource(e)},I.prototype.alertsSources=function(){return this.m_model.alertsSources()},I.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()},I.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},I.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},I.prototype.model=function(){return this.m_model},I.prototype.chartWidget=function(){return this._chartWidget},I.prototype.mainSeries=function(){return this.m_model.m_mainSeries},I.prototype.mainSeriesScaleRatioProperty=function(){return this.m_model.mainSeriesScaleRatioProperty()},I.prototype.panes=function(){return this.m_model.panes()},I.prototype.timeScale=function(){return this.m_model.timeScale()},I.prototype.selectionMacro=function(e){return this.m_model.selectionMacro(e)},I.prototype.setHoveredSource=function(e,t){this.m_model.setHoveredSource(e,t)},I.prototype.selection=function(){return this.m_model.selection()},I.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},I.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},I.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},I.prototype.invalidate=function(e){this.m_model.invalidate(e)}, I.prototype.setCurrentPosition=function(e,t,i,n){this.m_model.setCurrentPosition(e,t,i,n)},I.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_model.setAndSaveCurrentPosition(e,t,i,n)},I.prototype.modifySeries=function(e,t,i){var n=new O(this.m_model,e,t,i);this.pushUndoCommand(n)},I.prototype.canCreateStudy=function(e){return this.model().chartApi().chartApi().isCanCreateStudy(e)},I.prototype.checkIfFeatureAvailable=function(e,t){var i=this.canCreateStudy(),n=t&&t instanceof c;return!this.readOnly()&&n&&(i=this.canCreateStudy(!0)),!!i||(n||h(),!1)},I.prototype.insertStudyWithoutCheck=function(e){return this._insertStudy(e)},I.prototype.createStudyInserter=function(e,t,i){var n=this,r=null,o={createStudy:function(e,t,i,o,s,a,l,c,u,h){return n.checkIfFeatureAvailable(e,a)?(S("studies","Study_"+e.id),"Compare@tv-basicstudies"===e.id&&S("compare","symbol:"+t.symbol),n._insertStudy(e,t,o,s,a,l,c,u,r,h)):(w.logNormal("Cannot insert study "+e.id),null)}};void 0!==i&&(o.createStub=function(){var e=n.m_model.insertStudyStub(i);return r={targetPaneId:n.m_model.paneForSource(e).id(),targetZOrder:e.zorder()},e.id()},o.removeStub=function(e){return n.m_model.removeStudyStub(e)});var s=new b(e,this.m_model._studiesMetaInfoRepository,o);return s.setParentSource(t),s},I.prototype.setProperty=function(e,t,i,n){if(e&&e.value()!==t){var r=new C(e,t,i,this.m_model,n);this.pushUndoCommand(r),this.emitEvent("setProperty")}},I.prototype.setProperties=function(e,t,i){var n=this;this.beginUndoMacro(i),this.m_model.selectionMacro((function(){for(var r=0;r0&&t.reverse(),t.forEach((function(t){e._model.changeZOrder(t,e._shift)}))},I.prototype.removePane=function(e){var t=this.m_model.panes()[e].dataSources().slice();this.removeSources(t,!1,"Remove pane")},inherit(A,p),A.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)},A.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.lightUpdate()},inherit(k,p),k.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void w.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},k.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void w.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(E,p),E.prototype._merge=function(e,t,i){var n=this._model;l(!0),e&&(n.properties().paneProperties.mergeAndFire(e.paneProperties),n.properties().scalesProperties.mergeAndFire(e.scalesProperties)),n.mainSeries().priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),n.mainSeries().properties().mergeAndFire(t),n.mainSeries().properties().saveDefaults(),n.mainSeries().createPaneView(),n.mainSeries().invalidateBarStylesCache(),n._version=t.version,n.recalculateAllPanes(), n.fullUpdate(),n.properties().saveDefaults(),n.sessions().restoreState({properties:i}),l(!1)},E.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps,this._oldSessionsProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},E.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps,this._newSessionProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(V,p),V.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},V.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},t.ChartUndoModel=I,t.PriceScaleChangeUndoCommand=L}).call(this,i("aIyQ"))},dOnf:function(e,t,i){"use strict";function n(e){var t;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if(Array.isArray(e)){t=[];for(var i=0,r=e.length;ii?i:Math.round(t)}function o(e,t,i){return n.isNaN(t)||ti?i:Math.round(1e4*t)/1e4}function s(e){return r(0,e,255)}function a(e){return r(0,e,255)}function l(e){return r(0,e,255)}function c(e){return o(0,e,1)}function u(e){return o(0,e,1)}function h(e){return o(0,e,1)}function d(e){return o(0,e,1)}function p(e){return o(0,e,1)}function f(e){return o(0,e,1)}function _(e){var t=e[0]/255,i=e[1]/255,n=e[2]/255,r=Math.min(t,i,n),o=Math.max(t,i,n),s=0,a=0,l=(r+o)/2;if(r===o)s=0,a=0;else{var c=o-r;switch(a=l>.5?c/(2-o-r):c/(o+r),o){case t:s=((i-n)/c+(i1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function v(e){var t,i,n,r=e[0],o=e[1],c=e[2];if(0===o)t=i=n=c;else{ var u=c<.5?c*(1+o):c+o-c*o,h=2*c-u;t=m(h,u,r+1/3),i=m(h,u,r),n=m(h,u,r-1/3)}return[s(255*t),a(255*i),l(255*n)]}t.normalizeRedComponent=s,t.normalizeGreenComponent=a,t.normalizeBlueComponent=l,t.normalizeAlphaComponent=c,t.rgb=function(e,t,i){return[s(e),a(t),l(i)]},t.areEqualRgb=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.rgba=function(e,t,i,n){if(Array.isArray(e)){var r=e;return n=t,[r[0],r[1],r[2],c(n)]}var o=t;return i=i||0,n=n||0,[s(e),a(o),l(i),c(n)]},t.areEqualRgba=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},t.normalizeHue=u,t.normalizeHslSaturation=h,t.normalizeHsvSaturation=d,t.normalizeLightness=p,t.normalizeValue=f,t.hsl=function(e,t,i){return[u(e),h(t),p(i)]},t.areEqualHsl=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.hsv=function(e,t,i){return[u(e),d(t),f(i)]},t.areEqualHsv=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.rgbToHsl=_,t.hslToRgb=v,t.rgbToHsv=function(e){var t=e[0],i=e[1],n=e[2],r=t/255,o=i/255,s=n/255,a=Math.min(r,o,s),l=Math.max(r,o,s),c=l-a,u=0,h=0===l?0:c/l,d=l;if(l===a)u=0;else switch(l){case t:u=((o-s)/c+(o255)throw new Error("invalid threshold value, valid values are [0, 255]");return g(e)>=t?"white":"black"},t.tryParseRgb=E,t.parseRgb=function(e){var t=E(e);if(null!==t)return t;throw new Error("Passed color string does not match any of the known color representations")},t.tryParseRgba=V,t.parseRgba=D},ePL1:function(e,t,i){"use strict";i.r(t),i.d(t,"types",(function(){return n}));var n={ECONOMIC:"economic",QUANDL:"quandl"}},eqEH:function(e,t,i){"use strict";i.r(t),i.d(t,"registerService",(function(){return s})),i.d(t,"unregisterService",(function(){return a})),i.d(t,"hasService",(function(){return l})),i.d(t,"service",(function(){return c})),i.d(t,"waitServiceRegistered",(function(){return u}));var n=i("jofe"),r={},o=new Map;function s(e,t){if(l(e))throw new Error("Service already registered");r[e.id]=t;var i=o.get(e.id);void 0!==i&&(o.delete(e.id),i.resolve(t))}function a(e){if(!l(e))throw new Error("Service not found");r[e.id]=void 0}function l(e){return void 0!==r[e.id]}function c(e){var t=r[e.id];if(void 0===t)throw new Error("ServiceLocator: Service "+e.id+" not found");return t}function u(e){if(l(e))return Promise.resolve(c(e));var t=o.get(e.id);return void 0===t&&(t=Object(n.createDeferredPromise)(),o.set(e.id,t)),t.promise}},"f+Sq":function(e,t,i){"use strict";function n(e){if(void 0===e)throw new Error("Value is undefined");return e}function r(e){if(null===e)throw new Error("Value is null");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.ensureNever=t.ensure=t.ensureNotNull=t.ensureDefined=t.assert=void 0,t.assert=function(e,t){if(!e)throw new Error("Assertion failed"+(t?": "+t:""))},t.ensureDefined=n,t.ensureNotNull=r,t.ensure=function(e){return r(n(e))},t.ensureNever=function(e){}}, f3xO:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererUnicodeChar",(function(){return p}));var n=i("mrSG"),r=i("/SnT"),o=i.n(r),s=i("Eyy1"),a=i("aO4+"),l=i("2WC2"),c=i("VdBB"),u=i("Zp/P"),h=i("zDbI"),d=i("gBDZ"),p=function(e){function t(t,i){var n=e.call(this,t,i)||this;n._heightEnsured=Object(s.ensureDefined)(n._height);var r=t.char.slice(0,40);return n._ch=o()(r)[0]||" ",n._fontFamily=t.fontFamily||h.CHART_FONT_FAMILY,n._charCache=new d.b(n._ch,!1,!1,n._fontFamily,n._heightEnsured),n}return Object(n.c)(t,e),t.prototype.hitTest=function(e){for(var t=Object(u.selectionTolerance)(this._heightEnsured),i=0,n=this._items;i0?1:-1,s=i.y+i.vertOffset-o*Math.round(this._heightEnsured/2);n=i.style&&void 0!==i.style.color?i.style.color:this._color,this._charCache.paintTo(e,t,n,r,s,d.a.Center,i.vertOffset>0?d.c.Top:d.c.Bottom)},t.prototype._startPath=function(e,t,i,n){},t.prototype._endPath=function(e){},t}(l.b)},f6yo:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("hBTJ");t.pointInHalfplane=function(e,t){var i=t.edge;return i.A*e.x+i.B*e.y+i.C>0===t.isPositive},t.pointInTriangle=function(e,t,i,r){var o=t.add(i).scaled(.5).add(r).scaled(.5),s=n.intersectLineSegments(t,i,o,e);return null===s&&(null===(s=n.intersectLineSegments(i,r,o,e))&&null===(s=n.intersectLineSegments(r,t,o,e)))},t.pointInBox=function(e,t){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},t.pointInPolygon=function(e,t){for(var i=t.length-1,n=!1,r=e.x,o=e.y,s=0;s=o||l.y=o)&&a.x+(o-a.y)/(l.y-a.y)*(l.x-a.x)=t.length||e.endIndex>=t.length)return null;var i=t[e.startIndex],n=t[e.endIndex];return i===o.a||n===o.a?null:(Object(r.assert)(i<=n,"startIndex should not exceed endIndex"),{startIndex:i,endIndex:n,level:e.level,extendLeft:e.extendLeft,extendRight:e.extendRight})}function l(e,t,i){var r=Object(s.ensureTimePointIndexIndex)(i.indexOf(e.startIndex)),o=Object(s.ensureTimePointIndexIndex)(i.indexOf(e.endIndex));return Object(n.a)(Object(n.a)({id:t},e),{startIndex:r,endIndex:o})}},fJhV:function(e,t,i){"use strict";i.r(t),i.d(t,"LineDataSourceTimeAxisView",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t,i){var n=e.call(this,t.model())||this;return n._active=!1,n._source=t,n._pointIndex=i,n}return Object(n.c)(t,e),t.prototype.setActive=function(e){this._active=e},t.prototype._getBgColor=function(){return this._active?"#1565C0":this._model.isDark()?"#1E88E5":"#2196F3"},t.prototype._getIndex=function(){ if(!this._model.selection().isSelected(this._source))return null;var e=this._source.axisPoints();return e.length<=this._pointIndex?null:e[this._pointIndex].index},t}(i("cgFQ").a)},fPdn:function(e,t,i){"use strict";window.TradingView=window.TradingView||{},window.requireAll=function(e){return e.keys().map(e)},i("6jKD"),i("bZMm"),i("P5fv"),i("YFKU"),i("VUhU"),i("si6p"),i("EsMY"),i("jjqu"),i("OV6q"),i("SpsL"),i("eqD+"),i("iA8Q"),i("32f0"),i("MApU"),i("w9cH").install(),i("QYoC"),i("oA7e"),i("qFKp"),i("1oAu"),i("ogJP"),i("jFln"),i("HbRj"),i("VVxS"),i("CLNU"),i("mZrn"),i("Vdly"),i("+GxX")},fTGZ:function(e,t,i){"use strict";(function(e,n,r){var o=i("Ss5c").LineDataSource,s=i("ogJP").isNumber,a=i("BOPY").BarsMarksContainerPaneView,l=i("BOPY").BarsMarksContainerRenderer,c=i("Bt3k").TooltipRenderer,u=i("LxhU").Interval,h=i("n5al").isPriceSourceStyle,d=i("txPx").getLogger("Chart.BarsMarksContainer");function p(t,i){this.toolname="Child class must override this member";var s=t._undoModel._chartWidget,a=s.onWidget(),l=!1;l=a?s._options&&!s._options.hideIdeas:!!e.enabled("bars_marks")&&TVSettings.getBool("BarsMarksContainer.visibile",!1),i?i.merge({visible:l,frozen:!1}):i=new n({visible:l,frozen:!1});var u=this;i.visible.listeners().subscribe(null,(function(t){a||s._containsData||!e.enabled("bars_marks")||TVSettings.setValue("BarsMarksContainer.visibile",!!t.value()),u._tooltip&&u._tooltip.removeAll()})),o._configureProperties(i),o.call(this,t,i),this.onNeedRepaint=new r,this._requests=[],this._marks={},this._loadedRange=null,this._getDataTimeout=null,this._collectedRange=null,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().symbolResolved().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().tickMarksRangeChanged().subscribe(this,this.getData),this._initialize(),this.pinnedTooltips={},this._tooltip=new c(this._createTooltip.bind(this),this)}inherit(p,o),p.prototype._initialize=function(e){throw new Error("Child class must override this member")},p.prototype.onClicked=function(){throw new Error("Child class must override this member")},p.prototype._getData=function(e){throw new Error("Child class must override this member")},p.prototype._createTooltip=function(){throw new Error("Child class must override this member")},p.prototype.updateDotData=function(e,t){return t},p.prototype.updatePlateData=function(e,t){},p.prototype.isAvailableInFloatingWidget=function(){return!1},p.prototype._plateViewData=function(e){return{}},p.prototype.pinTooltip=function(e,t){this.pinnedTooltips[e]=t},p.prototype.timeScale=function(){return this._model.timeScale()},p.prototype.getIntervalInTicks=function(){var e=this._model.mainSeries().properties().interval.value(),t=u.parse(e);if(!t.isValid())throw new TypeError("Unexpected interval");return t.isRange()?60:t.inMilliseconds()/1e3},p.prototype._maxDate=Math.round(new Date(2037,0,1).getTime()/1e3),p.prototype.getVisibleTickMarksRange=function(){if(this.timeScale().isEmpty())return{start:0,end:0} ;var e,t=this.timeScale().visibleBarsStrictRange();return t.lastBar()>this.timeScale().points().firstIndex()&&t.firstBar()=t.start&&o<=t.end+i&&e.push(r)}),this),e},p.prototype.getPublishedPlates=function(){var e={},t=this;return is_authenticated?(this.getVisibleRangePlates().forEach((function(i){i.is_public&&(t.pinnedTooltips[i.id]||i.user__id===user.id)&&(e[i.id]=i)})),e):e},p.prototype._maxPlatesPerBar=10,p.prototype.filterDisplayedPlates=function(e){return e=e.reduce(function(e,t){var i=this._getIndex(t.tickmark);return e[i]=e[i]||[],e[i].push(t),e}.bind(this),{}),e=Object.keys(e).reduce(function(t,i){var n=e[i];return n=(n=n.sort((function(e,t){return t.views_count-e.views_count}))).slice(0,this._maxPlatesPerBar),t.concat(n)}.bind(this),[])},p.prototype._layout=function(e){switch(e){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}},p.prototype._theme=function(e){switch(e){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"}},p.prototype._offset=function(e,t,i){var n;switch(e){default:case"up":n=null===i?t[TradingView.HIGH_PLOT]:i(t);break;case"down":n=null===i?t[TradingView.LOW_PLOT]:i(t)}return this.priceScale().priceToCoordinate(n,this.ownerSource().firstValue())},p.prototype._getIndex=function(e){return this.timeScale().timePointToIndex(e)},p.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}},p.prototype.barWidth=function(){return this.timeScale().barSpacing()},p.prototype.getPlatesViewData=function(){var e=this._model.mainSeries();if(e.data().isEmpty())return[];for(var t=h(e.style())?e.barFunction():null,i=this.filterDisplayedPlates(this.getVisibleRangePlates()),n=this,r={},o=this._model.lastHittestData(),s=(i=(i=i.map(function(e){var i=this._getIndex(e.tickmark),s=this._getBar(i);if(null===s)return!1;var a,l=this._layout(e.direction),c=this._theme(e.direction),u=o&&o.id===e.id,h=this.timeScale().indexToCoordinate(i),d=this._offset(l,s,t),p=this.priceScale().isInverted();return i in r||(r[i]={up:0,down:0}),a=r[i][l]++,TradingView.merge({id:e.id,x:h,y:d,yInverted:p,order:a,direction:l,theme:c,hovered:u,pinned:!0===n.pinnedTooltips[e.id],user__id:e.user__id,label:e.label,labelFontColor:e.labelFontColor||"#444",minSize:e.minSize||5},this._plateViewData(e))}.bind(this))).filter((function(e){return!!e}))).filter((function(e){return!0===e.hovered })),a=0;athis._loadedRange.end&&(e.start=this._loadedRange.end)),e},p.prototype._rangeUnion=function(e,t){return e=Object.assign({},e),t&&(e.start=Math.min(t.start,e.start),e.end=Math.max(t.end,e.end)),e},p.prototype._pushGetDataStack=function(e){s(e.start)&&s(e.end)?(this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._collectedRange=this._rangeUnion(e,this._collectedRange),this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange),this._getDataTimeout=this._collectedRange=null}.bind(this),300)):d.logError("Wrong tickmark range")},p.prototype.roundRange=function(e){return{start:Math.round(e.start),end:Math.round(e.end)}},p.prototype.refreshData=function(){this.getData(this._lastRange)},p.prototype.getData=function(e){s(e.start)&&s(e.end)?(this._lastRange=e,(e=Object.assign({},e)).end=this._maxDate,this._pushGetDataStack(e)):d.logError("Wrong range")},p.prototype._abortAllRequests=function(){this._requests.forEach((function(e){e.abort()})),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null},p.prototype.clearMarks=function(){this._abortAllRequests(),this._marks={},this._loadedRange=null},t.BarsMarksContainer=p}).call(this,i("Kxc7"),i("tc+8"),i("aIyQ"))},fZEr:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return o}));var n=i("mrSG");function r(e,t){return Object(n.b)(this,void 0,void 0,(function(){var r;return Object(n.d)(this,(function(n){switch(n.label){case 0:return[4,Promise.all([i.e("react"),i.e(1),i.e(2),i.e(5),i.e(7),i.e(9),i.e(15),i.e(16),i.e(86),i.e(0),i.e(4),i.e(8),i.e("simple-dialog")]).then(i.bind(null,"EcUf"))];case 1:return[2,(r=n.sent()).showSimpleDialog(e,r.renameModule,t)]}}))}))}function o(e,t){return Object(n.b)(this,void 0,void 0,(function(){var r;return Object(n.d)(this,(function(n){switch(n.label){case 0:return[4,Promise.all([i.e("react"),i.e(1),i.e(2),i.e(5),i.e(7),i.e(9),i.e(15),i.e(16),i.e(86),i.e(0),i.e(4),i.e(8),i.e("simple-dialog")]).then(i.bind(null,"EcUf"))];case 1:return[2,(r=n.sent()).showSimpleDialog(e,r.confirmModule,t)]}}))}))}},fgLi:function(e,t,i){"use strict";i.r(t),i.d(t,"DataSource",(function(){return l})) ;var n=i("hY0g"),r=i.n(n),o=i("e3/o"),s=i("aIyQ"),a=i.n(s),l=function(){function e(){this.hasAlert=new r.a(!1),this._zorder=0,this.m_priceScale=null,this._id=Object(o.randomHashN)(6),this._ownerSource=null,this._userEditEnabled=!0,this._onPriceScaleChanged=new a.a,this._isSelectionEnabled=!0,this._ownerSourceChanged=new a.a}return e.prototype.id=function(){return this._id},e.prototype.preferNoScale=function(){return!1},e.prototype.idForAlert=function(){return this._id},e.prototype.setId=function(e){this._id=e},e.prototype.zorder=function(){return this._zorder},e.prototype.setZorder=function(e){"number"==typeof e&&this._zorder!==e&&(this._zorder=e)},e.prototype.title=function(){throw new Error("Implement this fun in a subclass")},e.prototype.priceScale=function(){return this.m_priceScale},e.prototype.setPriceScale=function(e){this.m_priceScale=e,this._onPriceScaleChanged.fire()},e.prototype.ownerSource=function(){return this._ownerSource},e.prototype.setOwnerSource=function(e){this._ownerSource=e,this._ownerSourceChanged.fire()},e.prototype.ownerSourceChanged=function(){return this._ownerSourceChanged},e.prototype.isSavedInChart=function(e){return!0},e.prototype.isSavedInStudyTemplates=function(){return!0},e.prototype.isRemovedByStudyTemplates=function(){return!0},e.prototype.hasContextMenu=function(){return!0},e.prototype.showInObjectTree=function(){return!0},e.prototype.setUserEditEnabled=function(e){this._userEditEnabled=e},e.prototype.userEditEnabled=function(){return this._userEditEnabled},e.prototype.canBeHidden=function(){return this.userEditEnabled()},e.prototype.isUserDeletable=function(){return this.userEditEnabled()},e.prototype.canHasAlert=function(){return!1},e.prototype.properties=function(){throw new Error("Implement this fun in a subclass")},e.prototype.isVisible=function(){return this.properties().visible.value()},e.prototype.statusView=function(){return null},e.prototype.dataWindowView=function(){return null},e.prototype.legendView=function(){return null},e.prototype.marketStatusModel=function(){return null},e.prototype.dataUpdatedModeModel=function(){return null},e.prototype.dataProblemModel=function(){return null},e.prototype.priceAxisViews=function(e,t){return null},e.prototype.updateAllViews=function(){},e.prototype.paneViews=function(){return null},e.prototype.labelPaneViews=function(){return null},e.prototype.isFailed=function(){return!1},e.prototype.isLoading=function(){return!1},e.prototype.isPhantom=function(){return!1},e.prototype.isChildStudy=function(){return!1},e.prototype.hasChildren=function(){return!1},e.prototype.canHaveChildren=function(){return!1},e.prototype.onClickOutside=function(){},e.prototype.getInputsPropertyPage=function(){return null},e.prototype.getStylesPropertyPage=function(){return null},e.prototype.getDisplayPropertyPage=function(){return null},e.prototype.getVisibilitiesPropertyPage=function(){return null},e.prototype.getSourceIcon=function(){return null},e.prototype.state=function(e){throw new Error("Implement this fun in a subclass")}, e.prototype.onPriceScaleChanged=function(){return this._onPriceScaleChanged},e.prototype.doesMovingAffectsUndo=function(){return!0},e.prototype.isMultiPaneAvailable=function(){return!1},e.prototype.isMultiPaneEnabled=function(){return!1},e.prototype.copiable=function(){return!1},e.prototype.cloneable=function(){return!1},e.prototype.movable=function(){return!1},e.prototype.isIncludedInAutoScale=function(){return!1},e.prototype.isHoveredEnabled=function(){return this.isSelectionEnabled()},e.prototype.isSelectionEnabled=function(){return this._isSelectionEnabled},e.prototype.setSelectionEnabled=function(e){this._isSelectionEnabled=e},e.prototype.priceRange=function(e,t){return null},e.prototype.autoScaleInfo=function(e,t){return{range:this.priceRange(e,t)}},e}()},fs3R:function(e,t){e.exports=''},fxzW:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererDiamond",(function(){return s}));var n=i("mrSG"),r=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._drawItemShapeUsingCSSPixels=function(e,t){var i=Math.round(t.height/2),n=t.x,r=t.vertOffset,o=t.y+r;e.moveTo(n,o-i),e.lineTo(n+i,o),e.lineTo(n,o+i),e.lineTo(n-i,o),e.lineTo(n,o-i)},t.prototype._calcBoundingBox=function(t){var i=Math.round(t.height/2),n=t.x,r=t.vertOffset,s=t.y+r,a=n-i,l=n+i,c=s-i,u=s+i,h=new o.Point(a,c),d=new o.Point(l,u),p=Object(o.box)(h,d),f=e.prototype._calcBoundingBox.call(this,t);return f&&(p=this._unionBox(p,f)),p},t}(r.a)},g5Qf:function(e,t,i){"use strict";i.r(t),i.d(t,"getFavoriteDrawingToolbarPromise",(function(){return s})),i.d(t,"createFavoriteDrawingToolbar",(function(){return a}));i("YFKU");var n=i("yMne"),r=null,o=null;function s(){return o}function a(){null===o&&(o=new Promise((function(e){Promise.all([i.e(34),i.e(43),i.e(67),i.e(81),i.e(18),i.e(32),i.e("line-tools-icons"),i.e(39),i.e(51),i.e(60),i.e("floating-toolbars")]).then(function(t){if(null===r){var o=i("gmn6").FavoriteDrawingToolbar;r=new o({left:window.innerWidth/2,top:n.HEADER_TOOLBAR_HEIGHT_EXPANDED+61}),e(r)}}.bind(null,i)).catch(void 0)})))}},gASG:function(e,t,i){"use strict";i.r(t);var n=i("mrSG"),r=i("Eyy1"),o=i("Ocx9"),s=i("jvrd"),a=i("Ss5c"),l=i("tc+8"),c=i.n(l),u=i("mMWL"),h=i("aIyQ"),d=i.n(h),p=function(){function e(e){this._image=null,this._currentImageURL=null,this._imageReady=!1,this._ready=new d.a,this._source=e,this.updateImage()}return e.prototype.updateImage=function(){var e=this,t=this.imageURL();this._currentImageURL!==t&&(this._currentImageURL=t,this._image=null,null!==this._currentImageURL&&(this._image=new Image,this._image.onload=function(){e._imageReady=!0,e._ready.fire()},this._image.src=this._currentImageURL))},e.prototype.itemIndex=function(){return 1}, e.prototype.labelIndex=function(){return 0},e.prototype.image=function(){return this._imageReady&&this.showPlate()?this._image:null},e.prototype.showPlate=function(){return this._props().childs().showImage.value()},e.prototype.backgroundPlateColor=function(e){return this._props().childs().plateColor.value()},e.prototype.ready=function(){return this._ready},e.prototype.type=function(){return this._props().childs().itemType.value()},e.prototype.category=function(){return 1},e.prototype.time=function(){return 0},e.prototype.index=function(){var e=this._source.points();return 0===e.length?null:e[0].index},e.prototype.imageURL=function(){return this._props().childs().imageURL.value()},e.prototype.sourceImage=function(){return null},e.prototype.additionalImageURL=function(){return null},e.prototype.additionalImageSource=function(){return null},e.prototype.name=function(){return""},e.prototype.headline=function(){return this._props().childs().text.value()},e.prototype.text=function(){return""},e.prototype.fullTextAst=function(){return null},e.prototype.position=function(){return this._props().childs().position.value()},e.prototype.fontSize=function(){return this._props().childs().fontSize.value()},e.prototype.fontBold=function(){return this._props().childs().bold.value()},e.prototype.fontItalic=function(){return this._props().childs().italic.value()},e.prototype._props=function(){return this._source.properties()},e}(),f=function(e){function t(t){var i=e.call(this)||this;return i._source=t,t.pointAdded().subscribe(i,(function(){return i.listeners().fire(i)})),t.pointChanged().subscribe(i,(function(){return i.listeners().fire(i)})),i}return Object(n.c)(t,e),t.prototype.value=function(){var e=this._source.properties().childs().position.value();return parseFloat(e.toFixed(2))},t.prototype.setValue=function(e){this._source.properties().childs().position.setValue(e),this._source.model().updateSource(this._source),this.listeners().fire(this),this._source.syncMultichartState({pricesChanged:!1,indexesChanged:!1}),this._source.updateLastUpdateTime()},t}(c.a),_=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._source=t,n}return Object(n.c)(t,e),t.prototype._setPointImpl=function(e){this._source.setPointAndChangeIndex(this._pointIndex,e)},t}(i("j8de").a),m=i("j3hX");i.d(t,"LineToolSignpost",(function(){return v}));var v=function(e){function t(n,r){var o=this,s=r||t.createProperties();return(o=e.call(this,n,s)||this)._item=new p(o),o._startMovingAnchorY=NaN,o.properties().childs().imageURL.subscribe(o,(function(){return o._item.updateImage()})),i.e("lt-pane-views").then(i.bind(null,"KFbh")).then((function(e){o._setPaneViews([new e.SignpostPaneView(o,n)])})),o}return Object(n.c)(t,e),t.prototype.isItemHovered=function(e){return!1},t.prototype.isItemSelected=function(e){return!1},t.prototype.isHidden=function(e){return!1},t.prototype.items=function(){return[this.customEvent()]},t.prototype.priceSource=function(){return this.ownerSource()},t.prototype.pointsCount=function(){return 1},t.prototype.addPoint=function(t,i,n){ return e.prototype.addPoint.call(this,this._updatePositionAndCorrectPoint(t),i,n)},t.prototype.setPoint=function(t,i,n){e.prototype.setPoint.call(this,t,this._updatePositionAndCorrectPoint(i,!this.isPhantom()),n),this._syncPosition()},t.prototype.setPointAndChangeIndex=function(t,i,n){e.prototype.setPoint.call(this,t,this._updatePositionAndCorrectPoint(i,!1),n),this._syncPosition()},t.prototype.startMoving=function(t,i,n){this._startMovingAnchorY=Object(r.ensureNotNull)(this._anchorYCoordinate()),e.prototype.startMoving.call(this,t,i,n)},t.prototype.move=function(t,i,n){var o;if(0===i){var s=this._points[0],a=Object(r.ensureDefined)(Object(r.ensureNotNull)(this.startMovingPoint()).logical),l=Object(r.ensureDefined)(t.logical),c=l.index-a.index,u=Object(r.ensureNotNull)(this.priceScale()),h=Object(r.ensure)(null===(o=this.ownerSource())||void 0===o?void 0:o.firstValue()),d=u.priceToCoordinate(l.price,h)-u.priceToCoordinate(a.price,h),p=this._startMovingAnchorY+d,f=u.coordinateToPrice(p,h);this._updatePositionAndCorrectPoint({index:s.index+c,price:f})}e.prototype.move.call(this,t,i,n),this._syncPosition()},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.prototype.name=function(){return"Signpost"},t.prototype.customEvent=function(){return this._item},t.prototype.showInObjectTree=function(){return!this.isPhantom()&&e.prototype.showInObjectTree.call(this)},t.prototype.isPhantom=function(){return this._model.isPhantomLine(this)},t.prototype.clonePositionOffset=function(){return{barOffset:1,xCoordOffset:0,yCoordOffset:0}},t.prototype.template=function(){var t=e.prototype.template.call(this),i=this.properties().childs();return t.text=i.text.value(),t.position=i.position.value(),t},t.createProperties=function(e){var i=new o.DefaultProperty("linetoolsignpost",e);return t._configureProperties(i),i.hasChild("text")||i.addChild("text",new c.a(window.t("Text"))),i.hasChild("position")||i.addChild("position",new c.a(50)),i.addExclusion("text"),i.addExclusion("position"),i.addChild("backgroundsColors",new m.LineToolColorsProperty([i.childs().plateColor])),i},t.prototype._createPointProperty=function(t){e.prototype._createPointProperty.call(this,t);var i=this._pointsProperty.childs().points[t];i.removeProperty("price"),i.removeProperty("bar"),i.addChild("price",new f(this)),i.addChild("bar",new _(this,0))},t.prototype._applyTemplateImpl=function(t){e.prototype._applyTemplateImpl.call(this,t),this.properties().childs().text.setValue(t.text),this.properties().childs().position.setValue(t.position)},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"zb1A")).then((function(e){return e.SignpostDefinitionsViewModel}))},t._configureProperties=function(e){a.LineDataSource._configureProperties(e)},t.prototype._updatePositionAndCorrectPoint=function(e,t){t&&(e.index=this._points[0].index);var i=this.priceSource();if(null===i)return e;var n=i.priceScale(),r=i.firstValue();if(null===n||n.isEmpty()||null===r)return e ;var o=n.height(),a=o/2,l=e.price>=n.coordinateToPrice(a,r)?1:-1,c=this._model.mainSeries();if(i===c){var u=c.data().search(e.index);if(null!==u){var h=Object(s.e)(c,u,-1),d=Object(s.e)(c,u,1);l=e.price>=h?1:-1,a=n.priceToCoordinate(1===l?d:h,r),e.price=1===l?Math.max(d,e.price):e.price}}var p=1===(-1===l!==n.isInverted()?-1:1)?a:o-a,f=n.priceToCoordinate(e.price,r),_=Math.min(o,Math.abs(f-a)),m=Math.max(0,Math.min(100,100*_/p))*l;return this.properties().childs().position.setValue(m),e},t.prototype._syncPosition=function(){if(this.linkKey){var e={position:this.properties().childs().position.value()};Object(u.changeLineStyle)({linkKey:this.linkKey,state:e,model:this._model})}},t.prototype._anchorYCoordinate=function(){var e=this.priceSource();if(null===e)return null;var t=e.priceScale(),i=e.firstValue();if(null===t||t.isEmpty()||null===i)return null;var n=this._model.mainSeries(),r=this.customEvent(),o=null;if(e===n&&(o=Object(s.d)(n,r)),null===o&&(o=Object(s.a)(r,t,i)),null===o)return null;var a=r.position(),l=t.priceToCoordinate(o.price,i);return Object(s.b)(a,t.height(),l,Object(s.c)(a,t.isInverted()))},t.supportPhantomMode=!0,t}(a.LineDataSource)},gAom:function(e,t,i){"use strict";function n(e,t,i,n,r,o,s){e.save(),e.globalCompositeOperation="copy";var a=e.createLinearGradient(0,0,0,r);a.addColorStop(0,o),a.addColorStop(1,s),e.fillStyle=a,e.fillRect(t,i,n,r),e.restore()}function r(e,t,i,n,r,o){e.fillRect(t+o,i,n-2*o,o),e.fillRect(t+o,i+r-o,n-2*o,o),e.fillRect(t,i,o,r),e.fillRect(t+n-o,i,o,r)}function o(e,t,i,n){e.beginPath();var r=e.lineWidth%2?.5:0;e.moveTo(i,t+r),e.lineTo(n,t+r),e.stroke()}function s(e,t,i,n){e.beginPath();var r=e.lineWidth%2?.5:0;e.moveTo(t+r,i),e.lineTo(t+r,n),e.stroke()}i.r(t),i.d(t,"clearRectWithGradient",(function(){return n})),i.d(t,"fillRectInnerBorder",(function(){return r})),i.d(t,"drawHorizontalLine",(function(){return o})),i.d(t,"drawVerticalLine",(function(){return s}))},gBDZ:function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"c",(function(){return r})),i.d(t,"b",(function(){return c}));var n,r,o=i("Eyy1"),s=i("XlJ7"),a=i("c44N"),l=i("ikwP");!function(e){e.Left="left",e.Right="right",e.Center="center"}(n||(n={})),function(e){e.Top="top",e.Bottom="bottom",e.Middle="middle"}(r||(r={}));var c=function(){function e(e,t,i,n,r,a){void 0===a&&(a="center"),this._cacheRenderParams=null,this._canvasesMap={},this._lines=e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=function(e,t,i,n){return Object(s.makeFont)(n,i,(e?"bold ":"")+(t?"italic ":""))}(t,i,n,r),this._fontSize=r,this._verticalPadding=~~(r/6),this._textAlign=a;var c=Object(l.createDisconnectedCanvas)(document,new l.Size(0,0),1),u=Object(o.ensureNotNull)(c.getContext("2d"));u.font=this._font;for(var h=0,d=0,p=this._lines;dt.code?1:0}var R=function(){function e(e){this._convertibleItems=e,this._idsToItems=new Map;for(var t=0,i=e;t0){var i=this._strategySources[this._strategySources.length-1];this.setActiveStrategySource(i)}this._strategySourcesChange.fire()}},e.prototype.setActiveStrategySource=function(e){-1!==this._strategySources.indexOf(e)&&this._activeStrategySource.setValue(e)},e.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)},e.prototype.activeStrategySource=function(){return this._activeStrategySource},e.prototype.strategySources=function(){return this._strategySources},e.prototype.strategySourcesChange=function(){return this._strategySourcesChange},e.prototype.setScrollEnabled=function(e){this._scrollEnabled=e},e.prototype.scrollEnabled=function(){return this._scrollEnabled},e.prototype.setZoomEnabled=function(e){this._zoomEnabled=e},e.prototype.zoomEnabled=function(){return this._zoomEnabled},e.prototype.onTagsChanged=function(){return this._tagsChanged},e.prototype.canZoomIn=function(){return this._timeScale.canZoomIn()&&this._zoomEnabled},e.prototype.canZoomOut=function(){return this._timeScale.canZoomOut()&&this._zoomEnabled},e.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},e.prototype.panesCollectionChanged=function(){return this._panesCollectionChanged},e.prototype.dataSourceCollectionChanged=function(){return this._dataSourceCollectionChanged},e.prototype.sourceProperitesChanged=function(){return this._sourceProperitesChanged}, e.prototype.updateCrosshair=function(){var e=this.crossHairSource(),t=e.pane;if(null!==t){var i=e.originCoordX(),n=e.originCoordY();this.setAndSaveCurrentPosition(i,n,t)}},e.prototype.zoomTime=function(e,t,i){if(this._zoomEnabled){var n=this.timeScale();if(!n.isEmpty()&&0!==t){var r=n.width();e=Math.max(1,Math.min(e,r-2)),n.zoom(e,t,i),this.updateCrosshair(),this.recalculateAllPanes(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies(),this._setScalesResetAvailable(!0)}}},e.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},e.prototype.linePointBeingChanged=function(){return this._linePointBeingChanged},e.prototype.dataSources=function(){for(var e=[this.crossHairSource()],t=0,i=this._panes;t=0;t--)if(this._panes[t].hasDataSource(e))return this._panes[t];return e instanceof V.BarsMarksContainer?this.paneForSource(this.mainSeries()):null},e.prototype.findNonOverlayStudyWithGroupingKey=function(e,t){for(var i=function(t){var i=t.dataSources().find((function(i){return Object(_.isStudy)(i)&&i.metaInfo().groupingKey===e&&!t.isOverlay(i)}));if(void 0!==i)return{value:{pane:t,study:i}}},n=0,r=void 0!==t?[t]:this._panes;n=0&&e1)return void t.setValue(!1)}t.setValue(!0)}},e.prototype._pointToPercentPosition=function(e,t){return{x:e.x/this._timeScale.width(),y:e.y/Object(r.ensureNotNull)(Object(r.ensureNotNull)(t.mainDataSource()).priceScale()).height()}},e.prototype._percentPositionToPoint=function(e,t){var i=e.x*this._timeScale.width(),n=e.y*Object(r.ensureNotNull)(Object(r.ensureNotNull)(t.mainDataSource()).priceScale()).height();return new o.Point(i,n)},e.prototype._recalcVisibleRangeStudiesImpl=function(e){if(e.timerId=null,!this.timeScale().isEmpty()){var t=this.timeScale().visibleBarsStrictRange();if(null!==t){var i=this.mainSeries().nearestData(t.firstBar(),F.PlotRowSearchMode.NearestRight),n=this.mainSeries().nearestData(t.lastBar(),F.PlotRowSearchMode.NearestLeft),r=this.mainSeries().bars().lastIndex(),o=i?i.index:void 0,s=n?n.index:void 0,a=o===e.oldStartVisibleIndex,l=s===e.oldEndVisibleIndex;if(!a||!l||e.force){e.force=!1,e.oldStartVisibleIndex=void 0!==o?o:NaN,e.oldEndVisibleIndex=void 0!==s?s:NaN;var c={first_visible_bar_time:1e3*Math.floor(i&&i.value?i.value[0]:0),last_visible_bar_time:1e3*Math.floor(n&&n.value?n.value[0]:0),subscribeRealtime:n&&n.index===r},u=e.studies||this.priceDataSources();e.studies=void 0;for(var h=0,d=u;h0&&g.listeners().fire(g)}}}}}},e.prototype._getAvailableCurrencies=function(){var e=this;return this._options.currencyConversionEnabled?Object(k.isArray)(this._availableCurrenciesList)?this._availableCurrenciesList:(null!==this._availableCurrenciesList||(this._availableCurrenciesList=this.chartApi().availableCurrencies(),this._availableCurrenciesList.then((function(t){e._destroyed||(e._availableCurrenciesList=t,e.lightUpdate())})).catch((function(e){W.logWarn("An error occurred while getting available currencies: "+e)}))),[]):[]},e.prototype._getBackgroundColor=function(e){var t=this._properties.childs().paneProperties.childs();if(t.backgroundType.value()===D.ColorType.Gradient){var i=t.backgroundGradientStartColor.value(),n=t.backgroundGradientEndColor.value();return e?i:n}return t.background.value()},e.prototype._updateBackgroundColor=function(){this._backgroundColor.setValue(this._getBackgroundColor()),this._backgroundTopColor.setValue(this._getBackgroundColor(!0))},e}()},gQ5K:function(e,t,i){"use strict";i.r(t),i.d(t,"DateFormatter",(function(){return o}));var n=i("kcTO"),r=i("e1ZQ"),o=function(){ function e(e){void 0===e&&(e="yyyy-MM-dd"),this._dateFormatFunc=r.b[e]}return e.prototype.format=function(e){return n.customFormatters&&n.customFormatters.dateFormatter?n.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!1)},e.prototype.formatLocal=function(e){return n.customFormatters.dateFormatter?n.customFormatters.dateFormatter.formatLocal?n.customFormatters.dateFormatter.formatLocal(e):n.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!0)},e}()},gTEF:function(e,t,i){"use strict";i.r(t),i.d(t,"SelectionRendererArrowsUpDown",(function(){return a}));var n=i("mrSG"),r=i("Eyy1"),o=i("vq8G"),s=i("6Fc/"),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._drawMarker=function(e,t,i,n,o){var a=Object(r.ensureNotNull)(this._data),l=t.isUp?1:-1,c=i+l*Object(s.calculateVerticalOffset)(a.barSpacing)+l*Object(s.calculateMinHeight)(a.barSpacing),u=Math.round(3.5*o*2);u%2!=n%2&&(u+=1);var h=n%2/2,d=Math.round(t.x*o)+h,p=Math.round((t.y+c)*o)+h;e.beginPath(),e.arc(d,p,u/2,0,2*Math.PI,!0),e.closePath(),e.fill(),e.stroke()},t}(o.SelectionRenderer)},gVWb:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererBackground",(function(){return n}));var n=function(){function e(e){this._data=e}return e.prototype.draw=function(e,t){},e.prototype.drawBackground=function(e,t){e.save();for(var i=this._data,n=t.pixelRatio,r=null,o=Math.round(this._data.w*n),s=0;s0)i.items[s-1].index===a.index-1&&null!==r&&(c=r+1);var u=l+o,h=u-c+1;e.fillRect(c,Math.round(i.y*n),h,Math.round(i.h*n)),r=u}else r=null}e.restore()},e.prototype.hitTest=function(e){return null},e}()},gWck:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesLegendView",(function(){return a}));var n=i("mrSG"),r=i("cXAR"),o=i("C2K+"),s=window.t("At close"),a=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._showBarChange=i.properties().paneProperties.legendProperties.showBarChange,n._showSeriesOHLC=i.properties().paneProperties.legendProperties.showSeriesOHLC,n._showBarChange.subscribe(n,n.update),n._showSeriesOHLC.subscribe(n,n.update),n}return Object(n.c)(t,e),t.prototype.isValuesVisible=function(){return this._showSeriesOHLC.value()||this._showBarChange.value()},t.prototype.additional=function(){return null},t.prototype.marketTitle=function(){var e=this._series.marketStatusModel().status().value();return this._showLastPriceAndChangeOnly()&&("pre_market"===e||"post_market"===e)?s+":":""},t.prototype.destroy=function(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)},t.prototype._createValuesProvider=function(e,t){return new o.a(e,t)},t}(r.SeriesDataWindowView)},gWrr:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return o}));var n=new WeakMap;function r(e,t){var i,r;return i=null==t?document.documentElement:9===t.nodeType?t.documentElement:t,n&&(r=n.get(i)), r||((r=i.ownerDocument.createRange()).selectNodeContents(i),n&&n.set(i,r)),r.createContextualFragment(e)}function o(e,t){var i,n=r(e,t);if("firstElementChild"in n)i=n.firstElementChild;else{i=null;for(var o=0;o2;){var d=Math.round((h+u)/2);this.items[d].x<=e.x?u=d:h=d}u=Math.max(1,u-1),h=Math.min(this.items.length-1,h+1);for(var p=u;p<=h;++p)if(t=this.items[p-1],i=this.items[p],a=t.x,l=i.x,r(new n(a,t.y),new n(l,i.y),new n(e.x,e.y)).distance<=c)return this.hittest?this.hittest:new s(s.REGULAR);return null},t.PaneRendererLine=TradingView.PaneRendererLine=l},gzUS:function(e,t,i){"use strict";i.r(t),i.d(t,"PointsetsManager",(function(){return s}));var n=i("LxhU"),r=i("txPx"),o=Object(r.getLogger)("ChartApi.PointsetsManager"),s=function(){function e(){this._pointsetsDataBySymbol=new Map}return e.prototype.destroy=function(){this._pointsetsDataBySymbol.clear()},e.prototype.createPointset=function(e,t,i,n,r){var s=this._pointsetsDataBySymbol.get(t);void 0===s&&(s=new Map,this._pointsetsDataBySymbol.set(t,s));for(var a=[],l=0,c=n;l "+t),null;c.push({index:r,value:[h,u.extrapolation.timeMs/1e3]})}return c},e}()},h24c:function(e,t,i){"use strict";i.r(t),i.d(t,"parseIntervalValue",(function(){return c})),i.d(t,"intervalIsSupported",(function(){return u})),i.d(t,"canShowSpreadActions",(function(){return h})),i.d(t,"globalKeypressMatches",(function(){return d})),i.d(t,"skipAccept",(function(){return p})),i.d(t,"syncSymbolSearch",(function(){return f})),i.d(t,"setLinkingResolution",(function(){return _})) ;var n=i("Kxc7"),r=i("pPtI"),o=i("PT1i"),s=i("LxhU"),a=i("ePL1"),l=new RegExp("^"+a.types.QUANDL,"i");function c(e){var t=/^[,\s]*(\d*)\s*([hdwmst]?)\s*$/i.exec(e)||[],i=~~t[1],n=t[2]&&t[2].toUpperCase()||null,r={qty:!i&&n?1:i,unit:n};return r.error=!i&&!n,r.intraday=!(r.error||r.unit&&"H"!==r.unit&&"S"!==r.unit&&"T"!==r.unit),r}function u(e){if(n.enabled("allow_supported_resolutions_set_only")){var t=s.Interval.normalize(e);return null!==t&&Object(r.isAvailable)(t)}var i=c(e);if(i.error)return!1;if(i.intraday)return o.linking.intraday.value();var a=o.linking.supportedResolutions.value();return!a||null!==i.unit&&!!~a.indexOf(i.unit)}function h(){return!1}function d(e){return!e.ctrlKey&&(!e.metaKey&&(!!e.charCode&&(!(!e.which||e.which<=32)&&(null===e.target||!/^(input|textarea)$/i.test(e.target.tagName)))))}function p(e,t){return!t&&(e===o.linking.symbol.value()||e===o.linking.seriesShortSymbol.value())}function f(e,t){var i=o.linking.symbol.value()||"";i=function(e,t){if(!t)return e;if(l.test(e)){var i=e.split(/\//);i.length&&(e=i[i.length-1])}else e=o.linking.seriesShortSymbol.value()||e;return e}(i,t),e.val(i)}function _(e){Object(r.setLastUsedResolution)(e),o.linking.interval.setValue(e)}},hBTJ:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("Eyy1"),r=i("aO4+"),o=i("GEp6"),s=i("f6yo");function a(e,t){var i=e.A,n=t.A,o=e.B,s=t.B,a=e.C,l=t.C,c=i*s-n*o;if(Math.abs(c)<1e-6)return null;var u=(o*l-s*a)/c,h=(n*a-i*l)/c;return new r.Point(u,h)}function l(e,t,i,n){var r=function(e,t,i,n){var r=t.subtract(e),o=n.subtract(i),s=r.x*o.y-r.y*o.x;if(Math.abs(s)<1e-6)return null;var a=e.subtract(i);return(a.y*o.x-a.x*o.y)/s}(e,t,i,n);if(null===r)return null;var s=t.subtract(e).scaled(r).add(e),a=o.distanceToSegment(i,n,s);return Math.abs(a.distance)<1e-6?r:null}function c(e,t){for(var i=0,n=e;i0&&r.equalPoints(e[e.length-1],t))&&(e.push(t),!0)}function h(e,t){for(var i=[],n=0;n=3?i:null}t.intersectLineSegmentAndBox=function(e,t){var i=e[0].x,n=e[0].y,o=e[1].x,s=e[1].y,a=t.min.x,l=t.min.y,c=t.max.x,u=t.max.y;function h(e,t,i,n,r,o){var s=0;return er&&(s|=2),to&&(s|=8),s}for(var d=h(i,n,a,l,c,u),p=h(o,s,a,l,c,u),f=!1,_=0;;){if(_>1e3)throw new Error("Cohen - Sutherland algorithm: infinity loop");if(_++,!(d|p)){f=!0;break}if(d&p)break;var m=d||p,v=void 0,y=void 0;8&m?(v=i+(o-i)*(u-n)/(s-n),y=u):4&m?(v=i+(o-i)*(l-n)/(s-n),y=l):2&m?(y=n+(s-n)*(c-i)/(o-i),v=c):(y=n+(s-n)*(a-i)/(o-i),v=a),m===d?d=h(i=v,n=y,a,l,c,u):p=h(o=v,s=y,a,l,c,u)}return f?r.equalPoints(r.point(i,n),r.point(o,s))?r.point(i,n):r.lineSegment(r.point(i,n),r.point(o,s)):null},t.intersectLines=a,t.intersectLineSegments=l,t.intersectLineAndBox=function(e,t){ var i=t.min.x,o=t.min.y,s=t.max.x,a=t.max.y;if(0===e.A){var l=-e.C/e.B;return o<=l&&l<=a?r.lineSegment(r.point(i,l),r.point(s,l)):null}if(0===e.B){var u=-e.C/e.A;return i<=u&&u<=s?r.lineSegment(r.point(u,o),r.point(u,a)):null}var h=[],d=function(t){var i=function(e,t){return-(e.C+e.A*t)/e.B}(e,t);o<=i&&i<=a&&c(h,new r.Point(t,i))},p=function(t){var n=function(e,t){return-(e.C+e.B*t)/e.A}(e,t);i<=n&&n<=s&&c(h,new r.Point(n,t))};switch(d(i),p(o),d(s),p(a),h.length){case 0:return null;case 1:return h[0];case 2:return r.equalPoints(h[0],h[1])?h[0]:r.lineSegment(h[0],h[1])}return n.assert(!1,"We should have at most two intersection points"),null},t.intersectRayAndBox=function(e,t,i){var n=l(e,t,i.min,new r.Point(i.max.x,i.min.y)),o=l(e,t,new r.Point(i.max.x,i.min.y),i.max),a=l(e,t,i.max,new r.Point(i.min.x,i.max.y)),c=l(e,t,new r.Point(i.min.x,i.max.y),i.min),u=[];if(null!==n&&n>=0&&u.push(n),null!==o&&o>=0&&u.push(o),null!==a&&a>=0&&u.push(a),null!==c&&c>=0&&u.push(c),0===u.length)return null;u.sort((function(e,t){return e-t}));var h=s.pointInBox(e,i)?u[0]:u[u.length-1];return e.addScaled(t.subtract(e),h)},t.intersectPolygonAndHalfplane=h,t.intersectPolygons=function(e,t){for(var i=e,n=0;n0){var d=this._points[this._points.length-1],p=this._model.timeScale().indexToCoordinate(d.index),f=d.price,_=a.priceToCoordinate(f,u);if(new o.Point(l,h).subtract(new o.Point(p,_)).length()<5)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0 ;var m=this._points[0],v=this._model.timeScale().indexToCoordinate(m.index),y=m.price,g=a.priceToCoordinate(y,u);if(new o.Point(l,h).subtract(new o.Point(v,g)).length()<5)return this.properties().childs().filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return e.prototype.addPoint.call(this,t,i,n)},t.prototype.setPoint=function(t,i,n){var s;e.prototype.setPoint.call(this,t,i,n);var a=this.priceScale();if(!(this._model.timeScale().isEmpty()||null===a||a.isEmpty()||t!==this._points.length-1&&0!==t)){var l=Object(r.ensure)(null===(s=this.ownerSource())||void 0===s?void 0:s.firstValue()),c=this._model.timeScale().indexToCoordinate(i.index),u=a.priceToCoordinate(i.price,l),h=t===this._points.length-1?this._points[0]:this._points[this._points.length-1],d=this._model.timeScale().indexToCoordinate(h.index),p=a.priceToCoordinate(h.price,l);new o.Point(c,u).subtract(new o.Point(d,p)).length()<5&&this.properties().childs().filled.setValue(!0)}},t.createProperties=function(e){var i=new s.DefaultProperty("linetoolpolyline",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"91EF")).then((function(e){return e.PolylinesDefinitionsViewModel}))},t._configureProperties=function(e){a.LineDataSource._configureProperties(e),e.addExclusion("filled")},t}(a.LineDataSource)},hY0g:function(e,t,i){"use strict";(function(e){var t=i("txPx").getLogger("Common.WatchedValue");function n(){}function r(e){if(!(this instanceof r))return new r(e);arguments.length>0&&(this._value=e),this._listeners=[]}r.prototype.value=function(){return this._owner?this._owner._value:this._value},r.prototype.setValue=function(e,i){var n=this._owner?this._owner:this;if("function"==typeof n.hook&&(e=n.hook(e)),n.writeLock)return n._value;if(!i&&n._value===e&&n.hasOwnProperty("_value"))return e;n._value=e;for(var r=n._listeners.slice(),o=0,s=0;s=1&&t.multiplier()<=15?"1D":"1W";case r.ResolutionKind.Seconds:case r.ResolutionKind.Ticks:return"1D"}throw new Error("Unexpected resolution type: "+e.symbol.resolution)}(e);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw new Error("No such pivTimeFrame: "+t)}}var u={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe", options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:2,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots"},constructor:function(){function e(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}return e.prototype.init=function(e,t){var i=t(0),r=t(1),o=t(2),a=t(3);this._data=new s,this._firstMainSeriesBarTime=NaN,this._kindPP=function(e){switch(e){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;default:throw new Error("Unknown kind "+e)}}(i),this._showHistoricalPivots=r,this._historicalPivotsToKeep=a,this._pivTimeFrame=o,this._isValidResolution=function(e,t){return(!n.Std.isdaily(e)||"Daily"!==t)&&((!n.Std.isweekly(e)||"Daily"!==t&&"Weekly"!==t)&&(!n.Std.ismonthly(e)||"Daily"!==t&&"Weekly"!==t&&"Monthly"!==t))}(e,this._pivTimeFrame),this._isValidResolution||n.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=c(e,this._pivTimeFrame)),e.new_sym(e.symbol.tickerid,this._secondaryRes)},e.prototype.main=function(e){if(!this._isValidResolution)return null;if(e.symbol.time)return isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null;e.select_sym(1);var t=e.new_var(n.Std.open(e)),i=e.new_var(n.Std.high(e)),r=e.new_var(n.Std.low(e)),s=e.new_var(n.Std.close(e)),a=e.new_var(n.Std.time(e)),c=this._data,u=t.get(0),h=a.get(0),d=t.get(1),p=i.get(1),f=r.get(1),_=s.get(1),m=e.symbol.isLastBar;if(0!==c.pivots.length&&e.symbol.isNewBar){var v=c.pivots[c.pivots.length-1];v.endIndex__t!==h&&(v.endIndex__t=h)}if(0===e.symbol.index||!e.symbol.isNewBar)return e.select_sym(0),null;var y=function(e,t,i,r,s,a,l,c){var u=new o,h=NaN,d=i-r;switch(c){case 0:h=(i+r+s)/3,u.p=h,u.r1=2*h-r,u.s1=2*h-i,u.r2=h+(i-r),u.s2=h-(i-r),u.r3=2*h+(i-2*r),u.s3=2*h-(2*i-r),u.r4=3*h+(i-3*r),u.s4=3*h-(3*i-r),u.r5=4*h+(i-4*r),u.s5=4*h-(4*i-r);break;case 1:h=(i+r+s)/3,u.p=h,u.r1=h+.382*d,u.s1=h-.382*d,u.r2=h+.618*d,u.s2=h-.618*d,u.r3=h+d,u.s3=h-d;break;case 2:h=(i+r+2*e)/4,u.p=h,u.r1=2*h-r,u.s1=2*h-i,u.r2=h+d,u.s2=h-d,u.r3=i+2*(h-r),u.s3=r-2*(i-h),u.r4=u.r3+d,u.s4=u.s3-d;break;case 3:h=(i+r+s)/3,u.p=h,u.r1=2*h-r,u.s1=2*h-i,u.r2=h+d,u.s2=h-d,u.r3=h+2*d,u.s3=h-2*d,u.r4=h+3*d,u.s4=h-3*d;break;case 4:var p=NaN;h=(p=n.Std.equal(t,s)?i+r+2*s:n.Std.greater(s,t)?2*i+r+s:2*r+i+s)/4,u.p=h,u.r1=p/2-r,u.s1=p/2-i;break;case 5:h=(i+r+s)/3,u.p=h,u.r1=s+1.1*d/12,u.s1=s-1.1*d/12,u.r2=s+1.1*d/6,u.s2=s-1.1*d/6,u.r3=s+1.1*d/4,u.s3=s-1.1*d/4,u.r4=s+1.1*d/2,u.s4=s-1.1*d/2;break;default:throw new Error("Unknown kind")}return u.startIndex__t=a,u.endIndex__t=l,u}(u,d,p,f,_,h,l(e,h),this._kindPP);return e.select_sym(0),this._showHistoricalPivots||(c.pivots=[]),c.pivots.push(y),c.pivots.length>this._historicalPivotsToKeep&&c.pivots.shift(),m?this._createResponse():null},e.prototype._createResponse=function(){ return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}},e.prototype._removeUnusedPivots=function(){var e=this,t=Math.max(this._data.pivots.findIndex((function(t){return t.startIndex__t>e._firstMainSeriesBarTime}))-1,0);t>0&&this._data.pivots.splice(0,t)},e}()}},"i/Bj":function(e,t,i){"use strict";function n(e){if(void 0===e)return null;var t=e.match(/(delayed_streaming)_([\d]{1,4})/);return null===t?null:{mode:t[1],interval:parseInt(t[2])}}i.r(t),i.d(t,"parseUpdateMode",(function(){return n}))},i126:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyColorRotatorFactory",(function(){return u}));var n=i("eJTA"),r=i("Tmoa"),o=i("HGP3"),s=i("3ClC"),a=["color-sky-blue-400","color-banana-yellow-700","color-deep-blue-500","color-grapes-purple-a700","color-iguana-green-500","color-minty-green-a700","color-ripe-red-a200","color-berry-pink-200","color-tv-blue-a100","color-tan-orange-a200","color-sky-blue-a400","color-deep-blue-a100","color-grapes-purple-400","color-iguana-green-a700","color-minty-green-200","color-ripe-red-200","color-berry-pink-a200","color-ripe-red-500","color-grapes-purple-500","color-deep-blue-400","color-tv-blue-a200","color-sky-blue-500","color-iguana-green-400","color-minty-green-400","color-banana-yellow-600","color-tan-orange-500","color-berry-pink-400","color-ripe-red-300","color-grapes-purple-300","color-deep-blue-300","color-tv-blue-300","color-sky-blue-300","color-iguana-green-300","color-minty-green-300","color-banana-yellow-400","color-tan-orange-300","color-berry-pink-300","color-tan-orange-a700"],l=function(){function e(e){this._offset=0,this._offset=e}return e.prototype.getColor=function(e){if(0===this._offset)return e;var t=a[(this._offset-1)%a.length],i=o.a[t],s=Object(r.isHexColor)(e)?1:Object(n.parseRgba)(e)[3];return Object(r.generateColor)(i,Object(r.alphaToTransparency)(s))},e}(),c=function(){function e(e,t){this._offset=e,this._modelStartOffset=t}return e.prototype.getColor=function(e){if(Object(r.isHexColor)(e)){var t=Object(n.parseRgb)(e);return Object(n.rgbToHexString)(Object(n.shiftRgb)(t,this._offset,this._modelStartOffset))}var i=Object(n.parseRgba)(e);return Object(n.rgbaToString)(Object(n.shiftRgba)(i,this._offset,this._modelStartOffset))},e}();var u=function(){function e(e){this._chartModel=e}return e.prototype.getColorRotator=function(e){var t=Object(s.studyColorRotationMode)(e);if(null===t)return null;var i=this._calcDefaultColorsOffset(e);switch(t){case"loop":return new l(i);case"shift":var n=this._chartModel.getStudyShiftColorStartOffset();return new c(i,n)}},e.prototype._calcDefaultColorsOffset=function(e){var t=0;return this._chartModel.dataSources().filter(s.isStudy).forEach((function(i){var n,r,o=i.metaInfo().id===e.id,s=(n=i.metaInfo(),r=e,(n.pine?n.pine.version:void 0)===(r.pine?r.pine.version:void 0));o&&s&&t++})),t},e}()},i80N:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;function o(e,t){var r=t||o.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){ var t=i("8MBc").FibSpiralPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.name=function(){return"Fib Spiral"},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("nBUU").FibSpiralDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o.createProperties=function(e){var t=new r("linetoolfibspiral",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},t.LineToolFibSpiral=o},iDOr:function(e,t,i){"use strict";(function(e){var n=i("Y7w9").moveToHead,r=i("704P").ExecutionsPositionController,o=i("Ss5c").LineDataSource,s=i("7ktv").PriceDataSource,a=i("CW80").isLineTool,l=i("s1Gx").isSpeciallyZOrderedSource,c=i("1Wlv").PriceScale,u=i("MWAT").createPriceScaleSelectionStrategy,h=i("yfAl").PaneBase,d=i("s1Gx").sortSources;function p(t,i,n,r){h.call(this,t,i,n,r),this.m_timeScale=t,this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=n,this._destroyed=new e,n.properties().priceScaleSelectionStrategyName.listeners().subscribe(null,function(e){this._priceScaleSelectionStrategy=u(e.value()),this._priceScaleSelectionStrategy.apply(this)}.bind(this)),this.m_timeScale.barSpacingChanged().subscribe(this,function(){this.m_mainDataSource===this._model.mainSeries()&&this._recalculatePriceScaleByScaleRatio(this.m_mainDataSource.priceScale())}.bind(this)),i.topMargin.listeners().subscribe(this,p.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,p.prototype._updateMargins),this._updateMargins(),this._maximized=!1,this._isMainPane=!1}inherit(p,h),p.DEFAULT_STRETCH_FACTOR=1e3,p.PANE_ANIMATION_DURATION=500,p.prototype.destroy=function(){this._properties.topMargin.listeners().unsubscribe(this,p.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,p.prototype._updateMargins),this._model.properties().priceScaleSelectionStrategyName.listeners().unsubscribeAll(this),this.m_timeScale.barSpacingChanged().unsubscribeAll(this),this._leftPriceScales.concat(this._rightPriceScales).forEach((function(e){e.modeChanged().unsubscribeAll(this),e.priceRangeChanged().unsubscribeAll(this),e.internalHeightChanged().unsubscribeAll(this)}),this);for(var e=0;ee.left){var t=n(this._leftPriceScales,this.mainDataSource().priceScale());return t.splice(e.left),t}return this._leftPriceScales},p.prototype.visibleRightPriceScales=function(){var e=this._model.priceScaleSlotsCount();if(this._rightPriceScales.length>e.right){var t=n(this._rightPriceScales,this.mainDataSource().priceScale());return t.splice(e.right),t}return this._rightPriceScales},p.prototype.timeScale=function(){return this.m_timeScale},p.prototype._processMainSourceChange=function(){var e;if(null===this.m_mainDataSource)for(var t=0;te)&&(e=n)}}return null===e&&(e=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach((function(t){t.zorder()>e&&t.setZorder(t.zorder()+1)})),e+1},p.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},p.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},p.prototype.startScalePrice=function(e,t){e.startScale(t)},p.prototype.scalePriceTo=function(e,t){e.scaleTo(t),this.updateAllViews()},p.prototype.endScalePrice=function(e){e.endScale()},p.prototype.startScrollPrice=function(e,t){e.startScroll(t)},p.prototype.scrollPriceTo=function(e,t){e.scrollTo(t),this.updateAllViews()},p.prototype.endScrollPrice=function(e){e.endScroll()},p.prototype.setPriceAutoScale=function(e,t){e.setMode({autoScale:t}),this.timeScale().isEmpty()?e.setPriceRange(null):this.recalculatePriceScale(e)},p.prototype.restorePriceScaleState=function(e,t){e.restoreState(t),this.updateAllViews()},p.prototype.defaultPriceScale=function(){var e=this.m_mainDataSource?this.m_mainDataSource.priceScale():null ;return null===e&&(e=new c(this._model.properties().scalesProperties)),e},p.prototype._priceScaleIsPrice=function(e){var t=e.mainSource();return!!t&&(!!TradingView.isInherited(t.constructor,TradingView.Series)||!!TradingView.isInherited(t.constructor,TradingView.Study)&&t.metaInfo().is_price_study)},p.prototype.findSuitableScale=function(e,t,i){return this._priceScaleSelectionStrategy.findSuitableScale(this,e,t,i)},p.prototype.createNewPriceScaleIfPossible=function(){return this._priceScaleSelectionStrategy.createNewPriceScaleIfPossible(this)},p.prototype.canCreateNewPriceScale=function(){return this._priceScaleSelectionStrategy.canCreateNewPriceScale(this)},p.prototype.mainDataSource=function(){return this.m_mainDataSource},p.prototype.resetPriceScale=function(e){var t=this.timeScale().visibleBarsStrictRange();e.isLockScale()||e.setMode({autoScale:!0}),e.recalculatePriceRange(t),this.updateAllViews()},p.prototype.recalculate=function(){this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale);for(var e=0;e0&&t<0){var s=i[n-1].zorder(),a=e.zorder();i[n-1].setZorder(a),e.setZorder(s)}else if(n0){var l=i[n+1].zorder();a=e.zorder();i[n+1].setZorder(a),e.setZorder(l)}this._invalidateSourcesCache(),this._dataSourcesCollectionChanged.fire()},p.prototype.onDestroyed=function(){return this._destroyed},p.prototype.clearSeries=function(e){for(var t=this.m_dataSources.length-1;t>=0;t--)TradingView.isInherited(this.m_dataSources[t].constructor,TradingView.Series)&&this._removeSourceFromCollections(t,e)},p.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter((function(e){return(!e.properties().linkedToSeries||!e.properties().linkedToSeries.value())&&(TradingView.isInherited(e.constructor,s)&&e.showInObjectTree()&&!this.isOverlay(e))}),this).length},p.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},p.prototype.actionNoScaleIsEnabled=function(e){return!(!this.isOverlay(e)&&TradingView.isInherited(e.constructor,s))||this.canHaveMoreNoScaleSources()}, p.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new r(this,this._model.timeScale())),this._executionsPositionController},p.prototype.isLast=function(){var e=this._model.panes();return e[e.length-1]===this},p.prototype.setMaximized=function(e){this._maximized=e},p.prototype.isMaximized=function(){return this._maximized},p.prototype.isMainPane=function(){var e=this._model.mainSeries(),t=!1;return this.m_dataSources.forEach((function(i){t||(t=i===e)})),this._isMainPane=t,t},p.prototype.properties=function(){return this._properties},p.prototype.priceScaleRatio=function(){return this._currentPriceScaleRatio},p.prototype.getPriceScaleById=function(e){var t=this.m_dataSources.find((function(t){return null!==t.priceScale()&&t.priceScale().id()===e}));return void 0===t?null:t.priceScale()},p.prototype.setPriceScaleSelectionStrategy=function(e){this._priceScaleSelectionStrategy=e,e.apply(this)},p.prototype.priceScaleIndex=function(e,t){switch(t){case"left":return this.leftPriceScales().indexOf(e);case"right":return this.rightPriceScales().indexOf(e)}},p.prototype.realignLineTools=function(){for(var e=0;e0&&(c=2*Math.PI-c),0===e&&(c+=Math.PI),s.angle.setValue(c)}else{var u=2*o.subtract(r).length();u*=this._sizeScale,s.size.setValue(u),s.scale.setValue(1)}},t.prototype.endChanging=function(t,i){var n=e.prototype.endChanging.call(this,t,i);return this._sizeScale=NaN,n},t.prototype.properties=function(){return e.prototype.properties.call(this)}, t.prototype.getSourceIcon=function(){return{type:"text",text:String.fromCharCode(this.properties().childs().icon.value())}},t.createProperties=function(e){var i=new r.DefaultProperty("linetoolicon",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"XCOO")).then((function(e){return e.IconsDefinitionsViewModel}))},t._configureProperties=function(e){o.LineDataSource._configureProperties(e),e.addChild("backgroundsColors",new s.LineToolColorsProperty([e.childs().color])),e.addExclusion("angle"),e.addExclusion("scale")},t}(o.LineDataSource)},ijBy:function(e,t,i){"use strict";i.r(t),i.d(t,"SetChartLayoutCommand",(function(){return s}));var n=i("mrSG"),r=i("RDU5"),o=i("VNzU"),s=function(e){function t(t,i){var n=this,r="Change Chart Layout to "+o.layouts[i].title;return(n=e.call(this,r)||this)._chartWidgetCollection=t,n._newLayoutType=i,n._oldLayoutType=t.layout.value(),n}return Object(n.c)(t,e),t.prototype.redo=function(){this._chartWidgetCollection.layout.setValue(this._newLayoutType)},t.prototype.undo=function(){this._chartWidgetCollection.layout.setValue(this._oldLayoutType)},t}(r.UndoCommand)},ikwP:function(e,t,i){"use strict";i.r(t),i.d(t,"Size",(function(){return s})),i.d(t,"getCanvasDevicePixelRatio",(function(){return a})),i.d(t,"getContext2D",(function(){return l})),i.d(t,"getPrescaledContext2D",(function(){return c})),i.d(t,"getPretransformedContext2D",(function(){return u})),i.d(t,"hardResizeCanvas",(function(){return h})),i.d(t,"resizeCanvasPreservingContent",(function(){return d})),i.d(t,"fillRect",(function(){return p})),i.d(t,"clearRect",(function(){return f})),i.d(t,"drawScaled",(function(){return _})),i.d(t,"createDisconnectedCanvas",(function(){return m})),i.d(t,"createDisconnectedBoundCanvas",(function(){return v})),i.d(t,"createBoundCanvas",(function(){return g})),i.d(t,"calcTextHorizontalShift",(function(){return b})),i.d(t,"disableSelection",(function(){return S}));var n=i("f2KN"),r=i("Eyy1"),o=i("Ialn"),s=function(){function e(e,t){this.w=e,this.h=t}return e.prototype.equals=function(e){return this.w===e.w&&this.h===e.h},e}();function a(e){var t,i;return Math.max(1,(null===(i=null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===i?void 0:i.devicePixelRatio)||1)}function l(e){var t=Object(r.ensureNotNull)(e.getContext("2d"));return t.setTransform(1,0,0,1,0,0),t}function c(e){var t=Object(r.ensureNotNull)(e.getContext("2d")),i=a(e);return t.setTransform(i,0,0,i,0,0),t}function u(e){var t=Object(r.ensureNotNull)(e.canvas.getContext("2d"));return t.setTransform(e.pixelRatio,0,0,e.pixelRatio,0,0),t.translate(.5,.5),t}function h(e,t){e.resizeCanvas({width:0,height:0}),e.resizeCanvas({width:t.w,height:t.h})}function d(e,t){var i=v(document,t),n=c(i.canvas);return n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(e.canvas,0,0,e.canvasSize.width*e.pixelRatio,e.canvasSize.height*e.pixelRatio),n.restore(),i}function p(e,t,i,n,r,o){e.save(),e.translate(-.5,-.5), e.fillStyle=o,e.fillRect(t,i,n,r),e.restore()}function f(e,t,i,n,r,o){e.save(),e.translate(-.5,-.5),e.globalCompositeOperation="copy",e.fillStyle=o,e.fillRect(t,i,n,r),e.restore()}function _(e,t,i){e.save(),e.scale(t,t),i(),e.restore()}function m(e,t,i){var n=y(e);return void 0===i&&(i=a(n)),n.width=t.w*i,n.height=t.h*i,n}function v(e,t){var i=y(e),r=Object(n.a)(i,{allowDownsampling:!1});return r.resizeCanvas({width:t.w,height:t.h}),r}function y(e){var t=e.createElement("canvas");return S(t),t}function g(e,t){var i=y(Object(r.ensureNotNull)(e.ownerDocument));e.appendChild(i);var o=Object(n.a)(i,{allowDownsampling:!1});return o.resizeCanvas({width:t.w,height:t.h}),o}function b(e,t){return"center"===e.textAlign?0:Object(o.isRtl)()?"start"===e.textAlign||"right"===e.textAlign?t:0:"start"===e.textAlign||"left"===e.textAlign?0:t}function S(e){e.style.userSelect="none",e.style.webkitUserSelect="none",e.style.msUserSelect="none",e.style.MozUserSelect="none",e.style.webkitTapHighlightColor="transparent"}},isVH:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,o=i("j3hX").LineToolColorsProperty;function s(e,t){var r=t||s.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("D4q4").TrianglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,n),s.prototype.pointsCount=function(){return 3},s.prototype.name=function(){return"Triangle"},s.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Zd1D").GeneralFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},s.createProperties=function(e){var t=new r("linetooltriangle",e);return s._configureProperties(t),t},s._configureProperties=function(e){n._configureProperties(e),e.addChild("linesColors",new o([e.childs().color]))},t.LineToolTriangle=s},it7y:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyDataWindowView",(function(){return a}));var n=i("mrSG"),r=i("ivNn"),o=i("4miz"),s=i("EYFt"),a=function(e){function t(t,i){var n=e.call(this)||this;return n._invalidated=!0,n._study=t,n._model=i,n._valueProvider=n._createValuesProvider(t,i),n._items=n._valueProvider.getItems().map((function(e){return new o.a(e.title,"")})),n.update(),n}return Object(n.c)(t,e),t.prototype.update=function(){this._invalidated=!0},t.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},t.prototype._updateImpl=function(){this._header=this._study.title(!0),this._title=this._study.title();var e=this._currentIndex();if(null!==e&&Object(r.isNumber)(e))for(var t=this._valueProvider.getValues(e),i=0;i0)},t.fixComputationError=n,t.alignTo=function(e,t){var i=e/t,r=Math.floor(i),o=i-r;return o>2e-10?n(o>.5?(r+1)*t:r*t):e}},j3hX:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolMultiplePropertyBaseImpl",(function(){return c})),i.d(t,"LineToolCollectedProperty",(function(){return u})),i.d(t,"LineToolWidthsProperty",(function(){return h})),i.d(t,"LineToolColorsProperty",(function(){return d})),i.d(t,"MultipleLineWidthsProperty",(function(){return f})),i.d(t,"MultipleLineColorsProperty",(function(){return _}));var n=i("mrSG"),r=i("txPx"),o=i("aIyQ"),s=i.n(o),a=Object(r.getLogger)("Chart.LineToolCollectedProperty"),l=function(){function e(){}return e.prototype.applyValue=function(e,t){e.setValue(t)},e}(),c=function(){function e(e,t){var i=this;this._onChange=new s.a,this._properties=e,e.forEach((function(e){return e.subscribe(i,(function(){i._onChange.fire(i)}))})),this._showIfProperty=t}return e.prototype.visible=function(){var e;return!this._showIfProperty||(null===(e=this._showIfProperty)||void 0===e?void 0:e.value())},e.prototype.value=function(){if(0===this._properties.length)return a.logError("Incorrect call, should not request value of 0 properties"),"mixed";var e=this._properties[0].value();return 1===this._properties.length||this._properties.every((function(t){return t.value()===e}))?e:"mixed"},e.prototype.state=function(){},e.prototype.merge=function(){},e.prototype.destroy=function(){var e=this;this._properties.forEach((function(t){return t.unsubscribeAll(e)}))},e.prototype.subscribe=function(e,t){this._onChange.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._onChange.unsubscribe(e,t)},e.prototype.unsubscribeAll=function(e){this._onChange.unsubscribeAll(e)},e}(),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype.setValue=function(e,t,i){if("mixed"!==e){var n=null!=i?i:new l;this._properties.forEach((function(t){return n.applyValue(t,e)}))}},t}(c),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t}(u),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype.firstColor=function(){return this._properties[0].value()},t}(u),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype.setValue=function(e,t,i){if("mixed"!==e){var n=null!=i?i:new l;this._properties.forEach((function(t){return t.setValue(e,void 0,n)}))}},t}(c),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t}(p),_=function(e){function t(){ return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t}(p)},j8de:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i("mrSG"),r=i("tc+8"),o=function(e){function t(t,i){var n=e.call(this)||this;return n._lineSource=t,n._pointIndex=i,n}return Object(n.c)(t,e),t.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},t.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.index=e,this._lineSource.startChanging(this._pointIndex,t),this._setPointImpl(t),this._lineSource.model().updateSource(this._lineSource),this._listeners.fire(this);var i=this._lineSource.endChanging(!0,!1);this._lineSource.syncMultichartState(i),this._lineSource.properties().lastUpdateTime.setValue((new Date).valueOf())},t.prototype._setPointImpl=function(e){this._lineSource.setPoint(this._pointIndex,e)},t}(i.n(r).a)},jA0t:function(e,t,i){"use strict";var n=function(){var e={};function t(e){return e.is_price_study}function i(e,t){var i=t.slice(0).toLowerCase();if(e){for(var n=0;nt){if((r=o-1)0&&e-t[n-1]<=r)return r;return 0},r.prototype.is_valid=function(){return!this._invalid},r._offset=function(e,t,i){var n=o(e,i);return-1===n?0:t[n]};var s=function(e){return 0|e},a=function(e){return 60*e*1e3};function l(e){return e%4==0&&(e%100!=0||e%400==0)}var c={0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334},u={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,FEBRUARY:1,MARCH:2,APRIL:3,MAY:4,JUNE:5,JULY:6,AUGUST:7,SEPTEMBER:8,OCTOBER:9,NOVEMBER:10,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:a(1440),get_minutes_from_hhmm:function(e){return-1!==e.indexOf(":")&&(e=e.split(":").join("")),e%100+60*s(e/100)},get_year:function(e){return e.getUTCFullYear()},get_month:function(e){return e.getUTCMonth()},get_hours:function(e){return e.getUTCHours()},get_minutes:function(e){return e.getUTCMinutes()},get_seconds:function(e){return e.getUTCSeconds()},get_day_of_month:function(e){return e.getUTCDate()},get_day_of_week:function(e){return e.getUTCDay()+1},get_day_of_year:function(e){var t=e.getUTCMonth(),i=c[t];return t>u.JANUARY+1&&l(e.getUTCFullYear())&&(i+=1),i+e.getUTCDate()},get_week_of_year:function(e){var t=new Date(Date.UTC(e.getUTCFullYear(),0,1)).getUTCDay(),i=0===t?1:8-t,n=u.get_day_of_year(e)-i;return Math.ceil(n/7)+1},get_minutes_from_midnight:function(e){return 60*u.get_hours(e)+u.get_minutes(e)},set_hms:function(e,t,i,n,r,o){e.setUTCHours(t),e.setUTCMinutes(i),e.setUTCSeconds(n),e.setUTCMilliseconds(r),u.correct_time(e,o)},correct_time:function(e,t){var i=e.getTime(),n=t.correction_loc(i);e.setTime(i+n)},add_days_considering_dst:function(e,t,i){var n=e.offset_utc(t),r=this.clone(t);this.add_date(r,i);var o=e.offset_utc(r);return r.setTime(r.getTime()+n-o),r},add_date:function(e,t){e.setTime(e.getTime()+t*u.secondsPerDay)},add_minutes:function(e,t){e.setTime(e.getTime()+a(t))},clone:function(e){return new Date(e.getTime())},get_days_per_year:function(e){var t=e.getUTCFullYear();return this.days_per_year(t)},days_per_year:function(e){return l(e)?366:365},get_part:function(e,t){switch(t){case u.YEAR:return u.get_year(e);case u.MONTH:return u.get_month(e);case u.DAY_OF_MONTH:return u.get_day_of_month(e);case u.WEEK_OF_YEAR:return u.get_week_of_year(e);case u.DAY_OF_WEEK:return u.get_day_of_week(e);case u.HOUR_OF_DAY:return u.get_hours(e);case u.MINUTE:return u.get_minutes(e);case u.DAY_OF_YEAR:return u.get_day_of_year(e);case u.SECOND:return u.get_seconds(e);default:return e.getTime()}},time_minutes:a,time_seconds:function(e){return 1e3*e},time_minutes_diff:function(e,t){return s((s(e/1e3)-s(t/1e3))/60)},time_seconds_diff:function(e,t){return s(s(e/1e3)-s(t/1e3))},utc_to_cal:function(e,t){var i=e.offset_utc(t);return new Date(t+i)},get_cal:function(e,t,i,n,r,o,s){var a=new Date(Date.UTC(t,i,n,r||0,o||0,s||0)),l=e.offset_utc(+a);return new Date(a.valueOf()-l)}, get_cal_from_unix_timestamp_ms:function(e,t){return new Date(t+e.offset_utc(t))},get_cal_utc:function(e,t,i){return new Date(Date.UTC(e,t,i))},cal_to_utc:function(e,t){var i=t.getTime();return i-e.offset_loc(i)},get_timezone:function(e){return new r(e)},shift_day:function(e,t){var i=e-1;return(i+=t)>6?i%=7:i<0&&(i=(7+i%7)%7),i+1}};e.exports=u},jFln:function(e,t,i){"use strict";var n=i("Hr11"),r=n.greaterThan,o=n.lessThan,s=window.CanvasEx=i("8Uy/");s.computeDashPattern=function(e){return[[e.lineWidth,2*e.lineWidth],[5*e.lineWidth,6*e.lineWidth],[6*e.lineWidth,6*e.lineWidth],[e.lineWidth,4*e.lineWidth],[2*e.lineWidth,e.lineWidth]][e.lineStyle-1]},s.drawLine=function(e,t,i,n,r){isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(r)&&(e.lineStyle!==s.LINESTYLE_SOLID?s.drawDashedLine(e,t,i,n,r):s.drawSolidLine(e,t,i,n,r))},s.drawArrow=function(e,t,i,n,r,o){if(o=void 0===o?2:o,isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(r)){var s=Math.round(o/2);e.beginPath(),e.moveTo(n,r),e.lineTo(t,i),e.moveTo(t+o,i+o),e.lineTo(t-o,i+o),e.moveTo(t-s,i+s),e.lineTo(t+s,i+s),e.stroke()}},s.drawSolidLine=function(e,t,i,n,r){e.beginPath(),e.moveTo(t,i),e.lineTo(n,r),e.stroke()},s.setLineStyle=function(e,t){e.lineStyle=t;var i=[];t!==s.LINESTYLE_SOLID&&(i=s.computeDashPattern(e)),s.setLineDash(e,i)},s.setLineDash=function(e,t){"function"==typeof e.setLineDash?e.setLineDash(t):void 0!==e.mozDash?e.mozDash=t:void 0!==e.webkitLineDash&&(e.webkitLineDash=t)},s.drawPoly=function(e,t,i){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var n=0;n0&&(c.thereYet=o,c.cap=Math.max),t-n>0&&(l.thereYet=o,l.cap=Math.max),e.moveTo(t,i);for(var u=t,h=i,d=0,p=!0;!l.thereYet(u,n)||!c.thereYet(h,s);){var f=Math.atan2(s-i,n-t),_=a[d];u=l.cap(n,u+Math.cos(f)*_),h=c.cap(s,h+Math.sin(f)*_),p?e.lineTo(u,h):e.moveTo(u,h),d=(d+1)%a.length,p=!p}}, s.setFont=function(e,t){if(e.font!==t)try{e.font=t}catch(i){}},"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(e){s.setFont(this,e)},CanvasRenderingContext2D.prototype.lineStyle=s.LINESTYLE_SOLID),e.exports=s},jJ9X:function(e,t,i){},jRfx:function(e,t,i){"use strict";i.d(t,"c",(function(){return s})),i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return l}));var n=i("mrSG"),r=i("Eyy1"),o=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r._restorePane=!1,r}return Object(n.c)(t,e),t.prototype.redo=function(){var e=this,t=this._chartModel.panes().length,i=this._chartModel.panes()[this._targetPaneIndex()],n=Object(r.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),o=Object(r.ensureNotNull)(this._chartModel.paneForSource(n)),s=this._chartModel.children(n,!0);o.bulkActionMacro((function(){s.forEach((function(t){return e._chartModel.detachSource(t)})),e._restorePane=e._chartModel.detachSource(n)}));var a="overlay"===this._initialPriceScalePosition?this._initialPriceScalePosition:void 0,l=i.findSuitableScale(n,void 0,a),c=0===l.dataSources().length;if(i.bulkActionMacro((function(){i.addDataSource(n,l,!1),s.forEach((function(e){return i.addDataSource(e,l,!1)}))})),n===this._chartModel.mainSeries()){var u=i.priceScalePosition(l);i.movePriceScale(l,u,0)}c&&Object(r.ensureNotNull)(n.priceScale()).restoreState(this._newPriceScaleState(i.isOverlay(n)));this._chartModel.fullUpdate(),t!==this._chartModel.panes().length&&this._chartModel.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){var e,t=this;e=this._restorePane?this._chartModel.createPane(this._initialPaneIndex):this._chartModel.panes()[this._initialPaneIndex];var i=Object(r.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),n=Object(r.ensureNotNull)(this._chartModel.paneForSource(i)),o=this._chartModel.children(i,!0);n.bulkActionMacro((function(){o.forEach((function(e){return t._chartModel.detachSource(e)})),t._chartModel.detachSource(i)}));var s=e.getPriceScaleById(this._initialPriceScaleId);null===s&&(s=e.createPriceScaleAtPosition(this._initialPriceScalePosition,this._initialPriceScaleIndex)),e.bulkActionMacro((function(){e.addDataSource(i,s,!0),o.forEach((function(t){return e.addDataSource(t,s,!1)}))})),Object(r.ensureNotNull)(i.priceScale()).restoreState(this._originalPriceScaleState()),this._chartModel.fullUpdate()},t}(i("3u3j").a),s=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.c)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex-1},t}(o),a=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.c)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex+1},t}(o),l=function(e){function t(t,i,n,r){var o=e.call(this,t,i,r)||this;return o._targetPane=n,o}return Object(n.c)(t,e),t.prototype._targetPaneIndex=function(){return this._targetPane},t}(o)},jTis:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"CalloutConsts",(function(){return n})),function(e){ e[e.RoundRadius=8]="RoundRadius",e[e.TextMargins=2]="TextMargins",e[e.MinWidth=100]="MinWidth"}(n||(n={}))},jeZR:function(e,t,i){"use strict";i.r(t),i.d(t,"AppliedTimeFrame",(function(){return r}));var n=i("QfUd"),r=function(){function e(e){this._appliedTimeFrame=new n.a(null),this._appliedTimeFrameInfo=null,this._model=e,e.mainSeries().dataEvents().messageReceived().subscribe(this,this._onSeriesMessageReceived)}return e.prototype.destroy=function(){this._model.timeScale().logicalRangeChanged().unsubscribeAll(this),this._model.mainSeries().dataEvents().messageReceived().unsubscribeAll(this)},e.prototype.appliedTimeFrame=function(){return this._appliedTimeFrame},e.prototype._onSeriesMessageReceived=function(e){if("series_timeframe"===e.method){var t=this._model.timeScale();t.logicalRangeChanged().unsubscribe(this,this._invalidateAppliedTimeFrame),(null==e.params[5]||e.params[5])&&(this._appliedTimeFrameInfo={logicalRange:t.logicalRange(),baseIndex:t.baseIndex()},t.logicalRangeChanged().subscribe(this,this._invalidateAppliedTimeFrame))}},e.prototype._invalidateAppliedTimeFrame=function(){if(null!==this._appliedTimeFrameInfo){var e=this._model.timeScale(),t=e.logicalRange(),i=e.baseIndex(),n=this._appliedTimeFrameInfo.logicalRange,r=this._appliedTimeFrameInfo.baseIndex;null!==t&&null!==n&&i-t.left()==r-n.left()&&i-t.right()==r-n.right()||(this._appliedTimeFrame.setValue(null),e.logicalRangeChanged().unsubscribe(this,this._invalidateAppliedTimeFrame))}},e}()},jenN:function(e,t,i){"use strict";i.r(t);var n=i("txPx"),r=i("7Fue"),o=i("xWfy"),s=i("qySK"),a=i("mrSG"),l=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return Object(a.c)(t,e),t.prototype._updateRendererData=function(e,t,i){e.visible=!1;var n=this._source.priceScale(),r=this._source.properties().visible.value();if(n&&!n.isEmpty()&&r){var o=this._source.properties().graphics[this._data.lineType][this._data.styleId];if(o.visible&&o.visible.value()&&o.showPrice&&o.showPrice.value()){var s=this._source.firstValue();if(null!==s){var a=this._data.line.level,l=o.color.value();i.background=l,i.color=this.generateTextColor(l),i.coordinate=n.priceToCoordinate(a,s),e.text=n.formatPrice(a,s),e.visible=!0}}}},t}(i("KcY8").a);i.d(t,"createGraphicsPaneViews",(function(){return u})),i.d(t,"createGraphicsPriceAxisViews",(function(){return d})),i.d(t,"isStudyGraphicsEmpty",(function(){return r.a})),i.d(t,"StaticStudyGraphics",(function(){return o.a})),i.d(t,"emptyStudyGraphics",(function(){return o.b})),i.d(t,"loadStudyGraphics",(function(){return o.c})),i.d(t,"saveStudyGraphics",(function(){return o.d})),i.d(t,"LiveStudyGraphics",(function(){return s.a}));var c=Object(n.getLogger)("Chart.StudyGraphics");function u(e,t,n){return new Promise((function(r){i.e("study-pane-views").then(function(o){var s=Object.keys(e.graphicsInfo());s.sort((function(e,t){return h(e)-h(t)})),r(s.map((function(r){var o={backgrounds:null,hhists:i("Gj0v").HHistPaneView,horizlines:i("1sos").HorizLinePaneView,hlines:null,lines:null,polygons:null,shapemarks:null, textmarks:null,trendchannels:null,vertlines:i("psYU").VertLinePaneView,dwglabels:null,dwglines:null,dwgtables:null,dwgcells:null}[r];return null===o?(c.logWarn(r+" is not supported by this build of graphics subsystem, skipping"),null):new o(e,t,n)})).filter((function(e){return null!==e})))}.bind(null,i)).catch(void 0)}))}function h(e){switch(e){case"polygons":return-100;case"trendchannels":return-90;default:return 0}}function d(e){for(var t=Object.keys(e.graphicsInfo()),i=[],n=function(t){switch(t){case"hlines":e.graphics().hlines().forEach((function(n,r){n.forEach((function(n){void 0!==n.level&&i.push(new l(e,{line:{level:n.level},styleId:r,lineType:t}))}))}));break;case"horizlines":e.graphics().horizlines().forEach((function(n,r){n.forEach((function(n){void 0!==n.level&&i.push(new l(e,{line:{level:n.level},styleId:r,lineType:t}))}))}))}},r=0,o=t;r0&&t.setValue(a.family),i.setValue(a.size),n.setValue(a.bold),s.setValue(a.italic)):o.logError("Invalid font: "+e)},fontHeight:function(e){if(!this._fontHeightCache[e]){var t=document.createElement("span");t.appendChild(document.createTextNode("height")),document.body.appendChild(t),t.style.cssText="font: "+e+"; white-space: nowrap; display: inline;";var i=t.offsetHeight;document.body.removeChild(t),this._fontHeightCache[e]=Math.ceil(i)}return this._fontHeightCache[e]},drawPolyHoverOrPress:function(e,t,i,n){n?(e.save(),e.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(e,t,!0),e.restore()):i&&(e.save(),e.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(e,t,!0),e.restore())},repaint:function(e){e.lightUpdate()},roundToMinTick:function(e,t){var i=1/e.mainSource().base();return i*Math.round(t/i)}};e.exports=s},jofe:function(e,t,i){"use strict";function n(){var e,t;return{promise:new Promise((function(i,n){e=i,t=n})),reject:t,resolve:e}}i.r(t),i.d(t,"createDeferredPromise",(function(){return n}))},jpZi:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i("mrSG"),r=i("Eyy1"),o=(i("YFKU"), i("HbRj"),i("RDU5")),s=window.t("Exclude line tools from group {group}"),a=function(e){function t(t,i,n){var r=e.call(this,s.format({group:i.name()}))||this;return r._model=t,r._groupId=i.id,r._groupName=i.name(),r._lineToolsIds=n.map((function(e){return e.id()})),r}return Object(n.c)(t,e),t.prototype.redo=function(){var e=this,t=Object(r.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(this._groupId)),i=this._lineToolsIds.map((function(t){return e._model.dataSourceForId(t)}));t.excludeLineTools(i),0===t.lineTools().length&&this._model.lineToolsGroupModel().removeGroup(t)},t.prototype.undo=function(){var e=this,t=this._lineToolsIds.map((function(t){return e._model.dataSourceForId(t)})),i=this._model.lineToolsGroupModel().groupForId(this._groupId);null!==i?i.addLineTools(t):this._model.lineToolsGroupModel().createGroup(t,this._groupName,this._groupId)},t}(o.UndoCommand)},jvrd:function(e,t,i){"use strict";i.d(t,"e",(function(){return r})),i.d(t,"c",(function(){return s})),i.d(t,"b",(function(){return a})),i.d(t,"a",(function(){return l})),i.d(t,"d",(function(){return c}));var n=i("k9/m");function r(e,t,i){var n=e.barFunction();switch(e.style()){case 3:case 10:case 2:return n(t.value);default:return t.value[-1===i?3:2]}}function o(e){return e>=0?1:-1}function s(e,t){return-1===o(e)!==t?-1:1}function a(e,t,i,n){var r=Math.min(t,Math.max(0,1===n?i:t-i));return i-n*Math.abs(r*e/100)}function l(e,t,i){if(void 0===e.index)return null;var n=e.index();return null===n?null:{index:n,price:t.coordinateToPrice(t.height()/2,i)}}function c(e,t){var i,s=e.data().bars(),a=s.first(),l=s.last();if(null===a||null===l)return null;if(void 0===t.index){var c=t.time(),u=a.value[0],h=l.value[0];if(ch)return null;i=s.searchByTime(c,n.PlotRowSearchMode.NearestRight,4)}else{var d=t.index();if(null===d)return null;i=s.search(d)}return null===i?null:{index:i.index,price:r(e,i,o(t.position()))}}},jy4L:function(e,t,i){"use strict";i.r(t),i.d(t,"makeNextSymbolId",(function(){return r})),i.d(t,"makeNextStudyId",(function(){return s}));var n=0;function r(){return"ss_"+ ++n}var o=0;function s(){return"st"+ ++o}},k4w6:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t){var i=e.call(this)||this;return i._series=t,i._model=t.model(),i}return Object(n.c)(t,e),t}(i("2ijp").a)},"k9/m":function(e,t,i){"use strict";i.r(t),i.d(t,"PlotRowSearchMode",(function(){return n})),i.d(t,"PlotList",(function(){return h})),i.d(t,"mergeMinMax",(function(){return d})),i.d(t,"mergePlotRows",(function(){return p}));var n,r=i("Eyy1"),o=i("Y7w9"),s=i("tqok"),a=i("txPx"),l=Object(a.getLogger)("Chart.PlotList");!function(e){e[e.NearestLeft=-1]="NearestLeft",e[e.Exact=0]="Exact",e[e.NearestRight=1]="NearestRight"}(n||(n={}));function c(e){return e.index}function u(e){return e.value[0]}var h=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache=new Map,this._rowSearchCacheByIndex=new Map, this._rowSearchCacheByIndexWithoutEmptyValues=new Map,this._rowSearchCacheByTime=new Map,this._rowSearchCacheByTimeWithoutEmptyValues=new Map,this._plotFunctions=e||new Map,this._emptyValuePredicate=t}return e.prototype.clear=function(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache.clear(),this._invalidateSearchCaches()},e.prototype.first=function(){return this.size()>0?this._items[this._start]:null},e.prototype.last=function(){return this.size()>0?this._items[this._end-1]:null},e.prototype.firstIndex=function(){return this.size()>0?this._indexAt(this._start):null},e.prototype.lastIndex=function(){return this.size()>0?this._indexAt(this._end-1):null},e.prototype.size=function(){return this._end-this._start},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.contains=function(e){return null!==this.search(e,n.Exact)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.add=function(e,t){if(this._shareRead)return l.logDebug("add: readonly collection modification attempt"),!1;var i={index:e,value:t},r=this._nonCachedSearch(e,n.Exact,c);return this._invalidateSearchCaches(),null===r?(this._items.splice(this._lowerbound(e,c),0,i),this._start=0,this._end=this._items.length,!0):(this._items[r]=i,!1)},e.prototype.search=function(e,t,i){return void 0===t&&(t=n.Exact),this._searchImpl(e,t,this._rowSearchCacheByIndex,this._rowSearchCacheByIndexWithoutEmptyValues,c,i)},e.prototype.searchByTime=function(e,t,i){return void 0===t&&(t=n.Exact),this._searchImpl(e,t,this._rowSearchCacheByTime,this._rowSearchCacheByTimeWithoutEmptyValues,u,i)},e.prototype.fold=function(e,t){for(var i=t,n=this._start;n=i;--n){var r=this._indexAt(n),o=this._valueAt(n);if(e(r,o))return{index:r,value:o}}return null},e.prototype.each=function(e){for(var t=this._start;tthis._items[this._items.length-1].index?this._append(e):1===e.length&&e[0].index===this._items[this._items.length-1].index?(this._updateLast(e[0]),e[0]):this._merge(e)},e.prototype.addTail=function(e,t){void 0===t&&(t=!1);var i=0;t&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=e[0].value);for(var n=i;n0?i[0]:null},e.prototype.state=function(){return{start:this._start,end:this._end,data:this._items,shareread:this._shareRead}},e.prototype.restoreState=function(e){e?(this._start=e.start,this._end=e.end,this._shareRead=e.shareread,this._items=e.data,this._minMaxCache.clear(),this._invalidateSearchCaches()):this.clear()},e.prototype._indexAt=function(e){return this._items[e].index},e.prototype._valueAt=function(e){return this._items[e].value},e.prototype._length=function(){return this._items.length},e.prototype._searchImpl=function(e,t,i,n,r,o){var s=void 0!==o?i:n,a=void 0!==o?1e4*(t+1)+o:t,l=s.get(e);if(void 0!==l){var c=l.get(a);if(void 0!==c)return c}var u=this._nonCachedSearch(e,t,r,o);if(null===u)return null;var h={index:this._indexAt(u),value:this._valueAt(u)};return void 0===l&&(l=new Map,s.set(e,l)),l.set(a,h),h},e.prototype._nonCachedSearch=function(e,t,i,r){var o=this._lowerbound(e,i),s=o===this._end||e!==i(this._items[o]);if(s&&t!==n.Exact)switch(t){case n.NearestLeft:return this._searchNearestLeft(o,r);case n.NearestRight:return this._searchNearestRight(o,r);default:throw new TypeError("Unknown search mode")}if(void 0===r||s||t===n.Exact)return s?null:o;switch(t){case n.NearestLeft:return this._nonEmptyNearestLeft(o,r);case n.NearestRight:return this._nonEmptyNearestRight(o,r);default:throw new TypeError("Unknown search mode")}},e.prototype._nonEmptyNearestRight=function(e,t){ for(var i=Object(r.ensure)(this._emptyValuePredicate),n=Object(r.ensure)(t);e=this._start&&i(this._valueAt(e),n);)e-=1;return ee}),this._start,this._end)},e.prototype._plotMinMax=function(e,t,i){var n=null,r=this._plotFunctions.get(i);if(void 0===r)throw new Error('Plot "'+i+'" is not registered');for(var o=e;on.max&&(n.max=s)))}return n},e.prototype._invalidateCacheForRow=function(e){var t=Math.floor(e.index/30);this._minMaxCache.forEach((function(e){return e.delete(t)}))},e.prototype._prepend=function(e){return Object(r.assert)(!this._shareRead,"collection should not be readonly"),Object(r.assert)(0!==e.length,"plotRows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=e.concat(this._items),this._start=0,this._end=this._items.length,e[0]},e.prototype._append=function(e){return Object(r.assert)(!this._shareRead,"collection should not be readonly"),Object(r.assert)(0!==e.length,"plotRows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=this._items.concat(e),this._start=0,this._end=this._items.length,e[0]},e.prototype._updateLast=function(e){Object(r.assert)(!this.isEmpty(),"plot list should not be empty");var t=this._items[this._end-1];Object(r.assert)(t.index===e.index,"last row index should match new row index"),this._invalidateCacheForRow(e),this._invalidateSearchCaches(),this._items[this._end-1]=e},e.prototype._merge=function(e){return Object(r.assert)(0!==e.length,"plot rows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=p(this._items,e),this._start=0,this._end=this._items.length,e[0]},e.prototype._minMaxOnRangeCachedImpl=function(e,t,i){if(this.isEmpty())return null;var n=null,o=Object(r.ensureNotNull)(this.firstIndex()),s=Object(r.ensureNotNull)(this.lastIndex()),a=Math.max(e,o),l=Math.min(t,s),c=30*Math.ceil(a/30),u=Math.max(c,30*Math.floor(l/30));n=d(n,this._minMaxOnRange(a,Math.min(c,t,l),i));var h=this._minMaxCache.get(i);void 0===h&&(h=new Map,this._minMaxCache.set(i,h)) ;for(var p=Math.max(c+1,a);pt[s].index?s++:(o++,s++,r--);return r}(e,t),n=new Array(i),r=0,o=0,s=e.length,a=t.length,l=0;rt[o].index?(n[l]=t[o],o++):(n[l]=t[o],r++,o++),l++;for(;r16)throw new TypeError("invalid length");if(0===t)return e.toString();return("0000000000000000"+e.toString()).slice(-t)}function h(e){ return"hasForexAdditionalPrecision"in e}var d=function(){function e(e,t,i,o){if(this.type="price",this._formatterErrors={custom:Object(n.t)("Price format is invalid."),fraction:Object(n.t)("Fraction part is invalid."),secondFraction:Object(n.t)("Second fraction part is invalid.")},t||(t=1),Object(r.isNumber)(e)&&Object(r.isInteger)(e)||(e=100),e<0)throw new TypeError("invalid base");this._priceScale=e,this._minMove=t,this._minMove2=o,i&&void 0!==o&&o>0&&2!==o&&4!==o&&8!==o?a.logDebug("invalid minmove2"):(this._fractional=i,this.calculateDecimal())}return e.prototype.isFractional=function(){return!!this._fractional},e.prototype.state=function(){return{fractional:this._fractional,fractionalLength:this._fractionalLength,minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale}},e.prototype.calculateDecimal=function(){if(this._fractionalLength=0,this._priceScale>0&&this._minMove>0){var e=this._priceScale;for(this._fractional&&this._minMove2&&(e/=this._minMove2);e>1;)e/=10,this._fractionalLength++}},e.prototype.format=function(e,t,i,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0);var s,a="";return e<0?(a=!1===n?"":"−",e=-e):e&&!0===t&&(a="+"),s=this._fractional?a+this._formatAsFractional(e,i):a+this._formatAsDecimal(e,i),r?Object(o.forceLTRStr)(s):s},e.prototype.parse=function(e){return e=(e=Object(o.stripLTRMarks)(e)).replace("−","-"),this._fractional?this._minMove2?this._parseAsDoubleFractional(e):this._parseAsSingleFractional(e):this._parseAsDecimal(e)},e.prototype.hasForexAdditionalPrecision=function(){return!this._fractional&&10===this._minMove2},e.serialize=function(e){return e.state()},e.deserialize=function(t){return new e(t.priceScale,t.minMove,t.fractional,t.minMove2)},e.prototype._formatAsDecimal=function(e,t){var i;t=t||0;var n,r=1/(i=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,t)*this._priceScale/this._minMove);if(i>1)n=Math.floor(e);else{var o=Math.floor(Math.round(e/r)*r);n=0===Math.round((e-o)/r)?o:o+r}var s="";if(i>1){var a=+(Math.round(e*i)-n*i).toFixed(this._fractionalLength);a>=i&&(a-=i,n+=1);var l=void 0!==this._fractionalLength?this._fractionalLength:NaN;s=c.decimalSign+u(+a.toFixed(this._fractionalLength)*this._minMove,l+t),s=this._removeEndingZeros(s,t)}return n.toString()+s},e.prototype._getFractPart=function(e,t){var i=[0,5],n=[0,2,5,7];return 2===t?void 0===i[e]?-1:i[e]:4===t?void 0===n[e]?-1:n[e]:e},e.prototype._formatAsFractional=function(e,t){var i=this._priceScale/this._minMove,n=Math.floor(e),r=t?Math.floor(e*i)-n*i:Math.round(e*i)-n*i;r===i&&(r=0,n+=1);var o="";if(t){var s=(e-n-r/i)*i;o=u(s=Math.round(s*Math.pow(10,t)),t),o=this._removeEndingZeros(o,t)}if(!this._fractionalLength)throw new Error("_fractionalLength is not calculated");var a="";if(this._minMove2){var l=r%this._minMove2,h=u(r=(r-l)/this._minMove2,this._fractionalLength),d=this._getFractPart(l,this._minMove2);a=h+c.decimalSignFractional+d}else a=u((r=this._getFractPart(r,this._priceScale))*this._minMove,this._fractionalLength);return n.toString()+c.decimalSignFractional+a+o}, e.prototype._removeEndingZeros=function(e,t){for(var i=0;i=r||o<0)return{error:this._formatterErrors.fraction,res:!1};var s=n+o/r;return i&&(s=-s),{value:s,res:!0,suggest:this.format(s)}}return{error:this._formatterErrors.custom,res:!1}},e.prototype._parseAsDoubleFractional=function(e){var t=new RegExp(/^(-?)[0-9]+$/).exec(e);if(t)return{value:u=parseFloat(e),res:!0,suggest:this.format(u)};if(t=new RegExp("^(-?)([0-9]+)\\"+c.decimalSignFractional+"([0-9]+)\\"+c.decimalSignFractional+"([0-9]+)$").exec(e)){var i=!!t[1],n=parseInt(t[2]),r=void 0!==this._minMove2?this._minMove2:NaN,o=this._priceScale/r,s=this._minMove2,a=this._patchFractPart(parseInt(t[3]),o),l=this._patchFractPart(parseInt(t[4]),s);if(a>=o||a<0)return{error:this._formatterErrors.fraction,res:!1};if(void 0!==s&&l>=s||l<0)return{error:this._formatterErrors.secondFraction,res:!1};var u=void 0!==s?n+a/o+l/(o*s):NaN;return i&&(u=-u),{value:u,res:!0,suggest:this.format(u)}}return{error:this._formatterErrors.custom,res:!1}},e}()},krs7:function(e,t,i){"use strict";i.r(t);var n=i("mrSG"),r=i("Eyy1"),o=i("ocLq"),s=i("LxhU"),a=function(){function e(e,t){this._minTick=NaN,this._minPrice=NaN,this._maxPrice=NaN,this._low=NaN,this._high=NaN,this._startPrice=NaN,this._indexLowVbP=NaN,this._indexHighVbP=NaN,this._rowSize=e,this._type=t}return e.prototype.init=function(e,t,i,n,r){this._minTick=e,this._minPrice=t,this._maxPrice=i,this._low=n,this._high=r},e.prototype.getStartPrice=function(){return this._startPrice},e.prototype.setStartPrice=function(e){this._startPrice=e},e.prototype.getIndexLowVbP=function(){return this._indexLowVbP},e.prototype.setIndexLowVbP=function(e){this._indexLowVbP=e},e.prototype.getIndexHighVbP=function(){return this._indexHighVbP},e.prototype.setIndexHighVbP=function(e){this._indexHighVbP=e},e.prototype.type=function(){return this._type},e}(),l=function(e){function t(t){return e.call(this,t,0)||this}return Object(n.c)(t,e),t.prototype.calculate=function(){this.setStartPrice(this._minPrice);var e=this.rowWidth(),t=Math.floor((this._low-this._minPrice)/e),i=Math.ceil((this._high-this._minPrice)/e)-1;t=Math.max(t,0),i=Math.max(i,0),i=Math.min(i,this._rowSize-1),t=Math.min(t,i), this.setIndexLowVbP(t),this.setIndexHighVbP(i)},t.prototype.rowWidth=function(){return Math.max((this._maxPrice-this._minPrice)/this._rowSize,this._minTick)},t}(a),c=function(e){function t(t){return e.call(this,t,1)||this}return Object(n.c)(t,e),t.prototype.calculate=function(){this.setStartPrice(0);var e=this.rowWidth(),t=Math.floor(this._low/e),i=Math.ceil(this._high/e)-1;t=Math.min(t,i),this.setIndexLowVbP(t),this.setIndexHighVbP(i)},t.prototype.rowWidth=function(){return this._minTick*this._rowSize},t}(a),u=i("Kxc7");var h=function(){function e(){}return e.prototype.findBasicResolutionForFromTo=function(e,t,i,n){var r=Object(o.getVolumeProfileResolutionForPeriod)(e.value(),t,i,n),a=s.Interval.parse(r);return u.enabled("charting_library_debug_mode")&&console.log("Selected resolution "+a.value()+" for ("+e.value()+", "+t+", "+i+")"),a},e.prototype.verifyRowSizeInput=function(e,t){if("Number Of Rows"===t&&e>6e3)throw new Error('Histogram is too large, please reduce "Row Size" input.')},e.prototype._getRowsLayout=function(e,t){return"Number Of Rows"===e?new l(t):new c(t)},e}(),d=i("KG+6"),p=function(){function e(){this._stable=[],this._variable=null,this._owner=null}return e.prototype.addStable=function(e){e.setOwner(this),this._stable.push(e)},e.prototype.setVariable=function(e){this._variable=e,null!==this._variable&&this._variable.setOwner(this)},e.prototype.primitivesData=function(e){var t=[];return this._forEach((function(i){return t.push.apply(t,i.primitivesData(e))})),t},e.prototype.deleteErasedItems=function(){this._forEach((function(e){return e.deleteErasedItems()}))},e.prototype.markPostedItems=function(){this._forEach((function(e){return e.markPostedItems()}))},e.prototype.isNaN=function(){return this._all((function(e){return e.isNaN()}))},e.prototype.dirty=function(){null!==this._owner&&this._owner.dirty()},e.prototype.setOwner=function(e){this._owner=e},e.prototype._forEach=function(e){for(var t=0,i=this._stable;t0&&(this._largestHistItem=this._getLargestHistItem(),this._updateCurrentPoc(),this._seriesGetter.developingPoc().set(this._currentPoc.level()),this._updateValueArea(),this._vaVolumePercent>0&&(this._seriesGetter.developingVAHigh().set(this._currentHists[this._currentVAEnd].priceHigh()),this._seriesGetter.developingVALow().set(this._currentHists[this._currentVAStart].priceLow()))),this._updateCurrentBox(),this._rebuildOutData()},e.prototype.setIdsGeneratorProxy=function(e){this._idsGenerator=e},e.prototype.nextGraphicsObjId=function(){return Object(r.ensureNotNull)(this._idsGenerator).nextGraphicsObjId()},e.prototype.pushEraseObjCmd=function(e,t){ Object(r.ensureNotNull)(this._idsGenerator).pushEraseObjCmd(e,t)},e.prototype.popEraseCmds=function(){return Object(r.ensureNotNull)(this._idsGenerator).popEraseCmds()},e.prototype._timeScale=function(){return this._seriesGetter.time()},e.prototype._seriesLow=function(){return this._seriesGetter.low()},e.prototype._seriesHigh=function(){return this._seriesGetter.high()},e.prototype._seriesVol=function(){return this._seriesGetter.volume()},e.prototype._seriesOpen=function(){return this._seriesGetter.open()},e.prototype._seriesClose=function(){return this._seriesGetter.close()},e.prototype._freezeCurrentHistogramAndCleanup=function(){null!==this._currentBox&&this._freezedBoxes.add(this._currentBox),o.Std.greater(this._getVolume(this._currentHists),0)&&(this._freezedHists.addAll(this._currentHistsGr),this._freezedVAHists.addAll(this._currentVAHistsGr),null!==this._currentPoc&&this._freezedPocs.add(this._currentPoc)),this._currentHists=[],this._currentHistsGr.clear(),this._currentHistsMap.clear(),this._initCurrentBox(),this._initCurrentPoc(),this._currentVAHistsGr.clear(),this._historyBarSet=[],this._minPrice=Number.POSITIVE_INFINITY,this._maxPrice=Number.NEGATIVE_INFINITY,this._prevRtBar=null,this._leftBoxTime=null,this._rightBoxTime=null},e.prototype._supplyRowsLayout=function(e){null===this._rowsLayout&&e.symbol.isFirstBar&&e.symbol.isNewBar&&(this._rowsLayout=this._rowsLayoutSupplier())},e.prototype._updateCurrentHistogram=function(e){if(this._needRecalc=!1,o.Std.greater(this._minPrice,e.low)&&(this._minPrice=e.low,this._needRecalc=!0),o.Std.less(this._maxPrice,e.high)&&(this._maxPrice=e.high,this._needRecalc=!0),this._ctx.symbol.isBarClosed&&this._historyBarSet.length>0){var t=this._historyBarSet[this._historyBarSet.length-1];t.time===e.time&&(this._prevRtBar=t,this._historyBarSet.pop())}this._needRecalc&&0===Object(r.ensureNotNull)(this._rowsLayout).type()?(this._recalculateCurrentResultsOnHistoryBarSet(),this._applyUpdateToCurrentResults(e,!1)):this._applyUpdateToCurrentResults(e,!0),this._ctx.symbol.isBarClosed?(Object(r.assert)(null===this._prevRtBar||e.time===this._prevRtBar.time),this._historyBarSet.push(e),this._prevRtBar=null):this._prevRtBar=e},e.prototype._getMidLevel=function(e){return(e.priceHigh()+e.priceLow())/2},e.prototype._getMidLevelFromList=function(e){return e.length%2==0?e[e.length/2].priceLow():this._getMidLevel(e[Math.floor(e.length/2)])},e.prototype._getLargestHistItem=function(){for(var e=[],t=this._currentHists[0],i=0,n=this._currentHists;i1){var s=this._getMidLevelFromList(this._currentHists);t=e[e.length-1];for(var a=e.length-2;a>=0;a--){r=e[a];o.Std.lessOrEqual(Math.abs(this._getMidLevel(r)-s),Math.abs(this._getMidLevel(t)-s))&&(t=r)}}return t},e.prototype._initCurrentPoc=function(){this._currentPoc=new T(this,0,0,0)},e.prototype._updateCurrentPoc=function(){var e=Object(r.ensureNotNull)(this._currentPoc) ;e.setStartIndex(Object(r.ensureNotNull)(this._leftBoxTime)),e.setEndIndex(Object(r.ensureNotNull)(this._rightBoxTime)),e.setExtendLeft(this._extendPocLeftRight),e.setExtendRight(this._extendPocLeftRight);var t=this._getMidLevel(Object(r.ensureNotNull)(this._largestHistItem));e.setLevel(t)},e.prototype._getVolume=function(e){for(var t=0,i=0,n=e;i=0,"ERROR - PocHistItemIndex == "+e),this._currentVAStart=e-1,this._currentVAEnd=e+1;for(var t=this._getVolume(this._currentHists)*this._vaVolumePercent*.01,i=this._currentHists[e].ratesSum(),n=0,s=null;o.Std.lessOrEqual(i+n,t)&&(i+=n,0===s?--this._currentVAStart:1===s&&++this._currentVAEnd,-1!==this._currentVAStart||this._currentVAEnd!==this._currentHists.length);){var a=void 0;if(this._currentVAStart>-1){a=this._currentHists[this._currentVAStart].ratesSum();var l=void 0;if(this._currentVAEndthis._getMidLevel(this._currentHists[this._currentVAStart])&&e.priceLow()0&&(e=this._currentHists[0].priceLow(),t=this._currentHists[this._currentHists.length-1].priceHigh()) ;var i=[],n=Object(r.ensureNotNull)(this._leftBoxTime),o=Object(r.ensureNotNull)(this._rightBoxTime);i.push(new P(n,e)),i.push(new P(n,t)),i.push(new P(o,t)),i.push(new P(o,e)),Object(r.ensureNotNull)(this._currentBox).setPoints(i)},e.prototype._recalculateCurrentResultsOnHistoryBarSet=function(){for(var e=0;e0&&(this._largestHistItem=this._getLargestHistItem(),this._updateCurrentPoc()),this._updateCurrentBox()},e.prototype._applyUpdateToCurrentResults=function(e,t){t&&null!==this._prevRtBar&&this._addHistoryBarToHistogram(this._prevRtBar,this._historyBarSet.length-1,this._currentHists,this._currentHistsMap,-1),this._addHistoryBarToHistogram(e,this._historyBarSet.length-1,this._currentHists,this._currentHistsMap,1),this._updateLastBarTimeInHistogram(this._currentHists)},e.prototype._addHistoryBarToHistogram=function(e,t,i,n,s){Object(r.assert)(-1===s||1===s,"Please set sign argument either +1 or -1");var a=e.low,l=e.high,c=isNaN(e.volume)?0:e.volume,u=e.isUp,h=Object(r.ensureNotNull)(this._rowsLayout);h.init(this._ctx.symbol.minTick,this._minPrice,this._maxPrice,a,l);var d=h.rowWidth();if(o.Std.greater(d,0)){h.calculate();var p=h.getIndexLowVbP(),f=h.getIndexHighVbP(),_=h.getStartPrice();if(p===f){var m=p*d+_,v=(p+1)*d+_;this._updateResult({start:m,end:v},s*c,u,i,n)}else{for(var y=0,g=p;g<=f;g++){var b=g*d+_,S=(g+1)*d+_,w=this._rowCoeff(b,S,a,l),P=w*c;y+=w,this._updateResult({start:b,end:S},s*P,u,i,n)}Object(r.assert)(o.Std.equal(y,1,.05),"totalCoeff not equal 1! totalConf = "+y)}}},e.prototype._updateResult=function(t,i,n,s,a){var l=this._createRates(n,i);Object(r.assert)(null!==this._leftBoxTime,"leftBoxTime is not set (equals null)"),Object(r.assert)(null!==this._rightBoxTime,"rightBoxTime is not set (equals null)");var c=Object(r.ensureNotNull)(this._leftBoxTime),u=Object(r.ensureNotNull)(this._rightBoxTime),h=a.get(t);if(void 0===h)h=new b(this,t.start,t.end,l,c,u),a.set(t,h),this._verifyHistogramSizeIsNotTooLarge(a.size()),this._currentHistsGr.add(h),e._addInOrder(h,s,0,s.length,(function(e,t){var i=o.Std.compare(e.firstBarTime(),t.firstBarTime());return 0!==i||0!==(i=o.Std.compare(e.priceLow(),t.priceLow()))?i:o.Std.compare(e.priceHigh(),t.priceHigh())}));else{for(var d=[],p=0;p0&&s.push(u)}}s.length>0&&(t[o]=s,i=!0)}return i?t:null},e.prototype.deleteErasedAndMarkPostedObjs=function(){this.forEachList((function(e){e.deleteErasedItems(),e.markPostedItems()}))},e.prototype.deleteErasedObjs=function(){this.forEachList((function(e){return e.deleteErasedItems()}))},e.prototype.getObjsContainer=function(e){return Object(r.ensureDefined)(this._containersMapCache.get(e))},e.prototype.forEachList=function(e){for(var t=0,i=this._containersCache;t0&&(t.erase=this.erase.map((function(e){return e.primitiveData()}))),void 0===t.create&&void 0===t.erase?null:t},e.prototype.setCreate=function(e){var t=this;this.create=e,this.create.forEachList((function(e){return e.setOwner(t)}))},e.prototype.isNaN=function(){return(null===this.erase||0===this.erase.length)&&null===this.create},e.prototype.isModified=function(){return this._modified},e.prototype.setModified=function(e){this._modified=e},e.prototype.dirty=function(){this._modified=!0},e.prototype.setOwner=function(e){throw new Error("Unsupported")},e}(),E=function(){function e(){this.isUpdate=!1,this.graphicsCmds=new k,this._offsetsChanged=!1,this._disableGraphicsAndData=!1}return e.prototype.isNaN=function(){return this.graphicsCmds.isNaN()},e.prototype.primitiveData=function(e){var t={};if(!this._disableGraphicsAndData){var i=this.graphicsCmds.primitiveData(e);null!==i&&(t.graphicsCmds=i)}return this.isUpdate&&(t.isUpdate=!0),void 0===t.graphicsCmds?void 0:t},e.prototype.disable=function(){this._disableGraphicsAndData=!0},e.prototype.checkForChangeAndResetChangedState=function(e){var t=this._offsetsChanged,i=this.graphicsCmds.isModified();this.graphicsCmds.setModified(!1),this._offsetsChanged=!1;return i||t||0!==e.length},e}(),V=function(){function e(e){this._dataObj=new E,this._isDirty=!1,this._eraseCmds=[],this._enableCmdDataStudy=e}return e.prototype.init=function(e){this._dataObj.graphicsCmds.setCreate(e),this.update(!0)},e.prototype.dataObj=function(){return this._dataObj},e.prototype.setEraseCmds=function(e){this._eraseCmds=e},e.prototype.resetDirtyState=function(){this._isDirty=!1},e.prototype.disable=function(){this._dataObj.disable()},e}(),D=i("ogJP");function B(e){return Boolean(e.isPosted)}var R=function(){function e(){}return e.prototype.isIgnoredObj=function(t,i){return e.isIgnoredObjDefault(t,i)},e.isIgnoredObjDefault=function(t,i){if(void 0===i)return e.isIgnoredObjNaNable(t);var n=t[i];return e.isIgnoredByGeneralRules(t,i)||e.isIgnoredObjNaNable(n)||e.isIgnoredObjListOfNaNables(n)},e.isIgnoredObjNaNable=function(e){return S(e)&&e.isNaN()},e.isIgnoredObjListOfNaNables=function(e){if(!Object(D.isArray)(e))return!1;for(var t=!0,i=0,n=e;i=0){var t=this._times[this._histPos];Object(r.assert)(t<=e,"History order violation"),this._histPos+=t===e?0:1}else this._histPos+=1;if(this._histPos===this._hist.length){var i=new Float64Array(2*this._hist.length);i.set(this._hist),this._hist=i;var n=new Float64Array(this._hist.length);n.set(this._times),this._times=n}this._hist[this._histPos]=NaN, this._times[this._histPos]=e},e.prototype.removeLastIfNaN=function(){Number.isNaN(this.get(0))&&(this._histPos-=1)},e.prototype.get=function(e){Object(r.assert)(0===e);var t=this._histPos-e;return this._hist[t]},e.prototype.getLeftOrEqual=function(e){var t=Object(z.upperbound)(this._times,e,(function(e,t){return e=this._firstBarTime){var c=this._developingPocSeries.getLeftOrEqual(l),u=this._developingVAHighSeries.getLeftOrEqual(l),h=this._developingVALowSeries.getLeftOrEqual(l);n.data.push([c,u,h])}else n.data.push([NaN,NaN,NaN])}return n},t.prototype.time=function(){return this._timeSeries},t.prototype.open=function(){return this._openSeries},t.prototype.high=function(){return this._highSeries},t.prototype.low=function(){return this._lowSeries},t.prototype.close=function(){return this._closeSeries},t.prototype.volume=function(){return this._volumeSeries},t.prototype.developingPoc=function(){return this._developingPocSeries},t.prototype.developingVAHigh=function(){return this._developingVAHighSeries},t.prototype.developingVALow=function(){return this._developingVALowSeries},t}(h),Y={constructor:G,name:"Volume Profile Visible Range",metainfo:{_metainfoVersion:51,id:"VbPVisible@tv-basicstudies-49",description:"Volume Profile Visible Range",shortDescription:"VPVR",format:{type:"volume"},is_price_study:!0,linkedToSeries:!0,palettes:{},inputs:[{id:"rowsLayout",name:"Rows Layout",defval:"Number Of Rows",options:["Number Of Rows","Ticks Per Row"],type:"text"},{id:"rows",name:"Row Size",defval:24,max:1e6,min:1,type:"integer"},{id:"volume",name:"Volume",defval:"Up/Down",options:["Up/Down","Total"],type:"text"},{id:"first_visible_bar_time",name:"First Visible Bar Time",defval:0,isHidden:!0,max:253370764800,min:-253370764800,type:"time"},{id:"last_visible_bar_time",name:"Last Visible Bar Time",defval:0,isHidden:!0,max:253370764800,min:-253370764800,type:"time"},{id:"vaVolume",name:"Value Area Volume",defval:70,max:100,min:0,type:"integer"}],plots:[{id:"developingPoc",type:"line"},{id:"developingVAHigh",type:"line"},{id:"developingVALow",type:"line"}],graphics:{hhists:{histBars2:{location:d.b.Relative,title:"Volume Profile",titles:["Up Volume","Down Volume"]},histBarsVA:{location:d.b.Relative, title:"Value Area",titles:["Value Area Up","Value Area Down"]}},horizlines:{pocLines:{name:"POC",showPrice:!0}}},defaults:{graphics:{hhists:{histBars2:{colors:["#1592e6","#fbc123"],direction:d.a.RightToLeft,percentWidth:30,showValues:!1,transparencies:[76,76],valuesColor:"#424242",visible:!0},histBarsVA:{colors:["#1592e6","#fbc123"],direction:d.a.RightToLeft,percentWidth:30,showValues:!1,transparencies:[30,30],valuesColor:"#424242",visible:!0}},horizlines:{pocLines:{color:"#ff0000",style:0,visible:!0,width:2}}},inputs:{first_visible_bar_time:0,last_visible_bar_time:0,rows:24,rowsLayout:"Number Of Rows",vaVolume:70,volume:"Up/Down"},styles:{developingPoc:{color:"#ff0000",linestyle:0,linewidth:1,plottype:9,trackPrice:!1,transparency:0,visible:!1},developingVAHigh:{color:"#0000ff",linestyle:0,linewidth:1,plottype:9,trackPrice:!1,transparency:0,visible:!1},developingVALow:{color:"#0000ff",linestyle:0,linewidth:1,plottype:9,trackPrice:!1,transparency:0,visible:!1}}},styles:{developingPoc:{histogramBase:0,title:"Developing Poc"},developingVAHigh:{histogramBase:0,title:"Developing VA High"},developingVALow:{histogramBase:0,title:"Developing VA Low"}}}}},l4sv:function(e,t,i){"use strict";i.r(t),i.d(t,"HorizontalLineRenderer",(function(){return s}));var n=i("VdBB"),r=i("jFln"),o=i("gAom"),s=function(){function e(){this._data=null,this._hitTest=new n.HitTestResult(n.HitTestResult.REGULAR)}return e.prototype.setData=function(e){this._data=e},e.prototype.setHitTest=function(e){this._hitTest=e},e.prototype.hitTest=function(e){if(null===this._data||!1===this._data.visible)return null;var t=Math.abs(e.y-this._data.y)<=3+this._data.linewidth/2,i=void 0===this._data.left||this._data.left-e.x<=3,n=void 0===this._data.right||e.x-this._data.right<=3;return t&&i&&n?this._hitTest:null},e.prototype.draw=function(e,t){if(null!==this._data&&!1!==this._data.visible&&!(this._data.y<-this._data.linewidth/2||this._data.y>t.cssHeight+this._data.linewidth/2)){var i=t.pixelRatio;e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=Math.max(1,Math.floor(this._data.linewidth*i)),void 0!==this._data.linestyle&&Object(r.setLineStyle)(e,this._data.linestyle);var n=void 0!==this._data.left?Math.max(this._data.left,0):0,s=void 0!==this._data.right?Math.min(this._data.right,t.cssWidth):t.cssWidth,a=Math.round(this._data.y*i),l=Math.floor(n*i),c=Math.ceil(s*i);Object(o.drawHorizontalLine)(e,a,l,c)}},e}()},l7mP:function(e,t,i){"use strict";function n(e,t,n){void 0===t&&(t={}),Promise.all([i.e("react"),i.e(2),i.e(9),i.e(16),i.e(41),i.e(65),i.e(87),i.e(8),i.e(54),i.e("take-chart-image-dialog-impl")]).then(function(r){i("fMMV").getImageOfChart(e,t,n)}.bind(null,i)).catch(void 0)}function r(e,t,n){void 0===t&&(t={}),Promise.all([i.e("react"),i.e(2),i.e(9),i.e(16),i.e(41),i.e(65),i.e(87),i.e(8),i.e(54),i.e("take-chart-image-dialog-impl")]).then(function(r){i("fMMV").getImageOfChartSilently(e,t,n)}.bind(null,i)).catch(void 0)}i.r(t),i.d(t,"getImageOfChart",(function(){return n})),i.d(t,"getImageOfChartSilently",(function(){return r}))},lA7n:function(e,t,i){ "use strict";i.r(t);var n=i("mrSG"),r=i("Kxc7"),o=function(e){function t(t,i){return e.call(this,t,i,"FAVORITE_CHARTS_CHANGED","loadChartDialog.favorites",{})||this}return Object(n.c)(t,e),t}(i("ulZB").b),s=i("zUrt"),a=i("FBuY"),l=i("Vdly"),c=i("/z0S"),u=i("sQaR");i.d(t,"LoadChartService",(function(){return h}));var h=function(e){function t(t){void 0===t&&(t=null);var i=e.call(this)||this;return i._favoriteChartsService=new o(a.TVXWindowEvents,l),i._chartWidgetCollection=null,i._promise=null,i._dialog=null,i._subscribe=function(e){i._setVisibility(e)},i._getChartEntry=function(e){return{id:e.id,url:e.url,title:e.name,symbol:e.short_symbol,interval:e.interval,toolsCount:0,modified:e.modified_iso,active:function(){return i._isActiveChart(e.id)},openAction:function(){return s.backend.loadChart(e)},deleteAction:function(){return new Promise((function(t){s.backend.removeChart(e.image_url,(function(){i._deleteChart(e.id),t()}))}))},favoriteAction:i._updateFavorites}},i._updateFavorites=function(e){return i._favoriteChartsService.set(e)},i._isActiveChart=function(e){return null!==i._chartWidgetCollection&&e===i._chartWidgetCollection.metaInfo.id.value()},i._deleteChart=function(e){i._isActiveChart(e)&&(r.enabled("saveload_storage_customization")?null!==i._chartWidgetCollection&&i._chartWidgetCollection.clearChartMetaInfo():location.href="/chart/"+location.search)},i._chartWidgetCollection=t,i}return Object(n.c)(t,e),t.prototype.showLoadDialog=function(){Object(c.a)(this._showLoadDialog.bind(this),{source:"Load chart",sourceMeta:"Chart"})},t.prototype.show=function(){this.showLoadDialog()},t.prototype.hide=function(){var e,t;null===(e=this._dialog)||void 0===e||e.hide(),null===(t=this._dialog)||void 0===t||t.visible().unsubscribe(this._subscribe)},t.prototype._showLoadDialog=function(){var e=this;(r.enabled("saveload_requires_authentication")&&!window.is_authenticated?Promise.resolve([]):new Promise((function(e){s.backend.getCharts((function(t){e(t)}))}))).then((function(t){return t.map(e._getChartEntry)})).then((function(t){var n=e._promise=Promise.all([i.e("redux"),i.e("react"),i.e(1),i.e(2),i.e(5),i.e(6),i.e(7),i.e(10),i.e(11),i.e(12),i.e(21),i.e(27),i.e(61),i.e(69),i.e(82),i.e(0),i.e(4),i.e(3),i.e(13),i.e(14),i.e(38),i.e(50),i.e("load-chart-dialog")]).then(i.bind(null,"EgWQ")).then((function(i){if(e._promise===n){e._dialog&&(e._dialog.hide(),e._dialog.visible().unsubscribe(e._subscribe));var r={charts:t,favoriteChartsService:e._favoriteChartsService,chartWidgetCollection:e._chartWidgetCollection};e._dialog=new i.LoadChartDialogRenderer(r),e._dialog.visible().subscribe(e._subscribe),e._dialog.show()}}))}))},t}(u.a)},lCO3:function(e,t,i){"use strict";i.r(t),i.d(t,"Version",(function(){return r}));var n=i("Eyy1"),r=function(){function e(e,t){this._major=e,this._minor=t}return e.prototype.major=function(){return this._major},e.prototype.minor=function(){return this._minor},e.prototype.isZero=function(){return 0===this._major&&0===this._minor},e.prototype.toString=function(){return this._major+"."+this._minor}, e.prototype.compareTo=function(e){return this._majore._major?1:this._minore._minor?1:0},e.prototype.isLess=function(e){return this.compareTo(e)<0},e.prototype.isLessOrEqual=function(e){return this.compareTo(e)<=0},e.prototype.isEqual=function(e){return 0===this.compareTo(e)},e.prototype.isGreater=function(e){return this.compareTo(e)>0},e.prototype.isGreaterOrEqual=function(e){return this.compareTo(e)>=0},e.parse=function(t){if(t instanceof e)return new e(t.major(),t.minor());if("number"==typeof t)return Object(n.assert)(Math.floor(t)===t,"Version should not be a float number"),new e(t,0);if("string"==typeof t){var i=t.split(".");if(1===i.length){var r=parseInt(i[0],10);return Object(n.assert)(!isNaN(r),"Bad version string: "+t),new e(r,0)}if(2===i.length){r=parseInt(i[0],10);Object(n.assert)(!isNaN(r),"Bad version string: "+t);var o=parseInt(i[1],10);return Object(n.assert)(!isNaN(o),"Bad version string: "+t),new e(r,o)}throw new Error("Bad version string (one dot expected): "+t)}throw new Error("Bad version: "+t)},e.ZERO=new e(0,0),e}()},lJvs:function(e,t,i){"use strict";var n=i("aO4+").Point,r=i("vAx0").ESDPaneView,o=i("fTGZ").BarsMarksContainer,s=i("mMWL"),a=i("FQhm"),l=i("6xeX").Tooltip,c=i("zDbI").CHART_FONT_FAMILY;function u(e){o.call(this,e),this.toolname="UserDefinedTimescaleMarks";var t=this;s.hideMarksOnBars().subscribe(this,(function(){t._properties.visible.setValue(!s.hideMarksOnBars().value())})),this._paneView=new h(e,this),this._requestedPointsets=new Set}function h(e,t){r.call(this,e,t,void 0,void 0),this.source=t,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}inherit(u,o),u.prototype._initialize=function(e){this._properties.visible.setValue(!0)},u.prototype.userEditEnabled=function(){return!1},u.prototype._plateViewData=function(e){return{text:e.text}},u.prototype.onClicked=function(e){a.emit("onTimescaleMarkClick",e.id)},u.prototype.clearMarks=function(){var e=this._model.chartApi();if(e.connected()){var t=this;Object.keys(this._marks).forEach((function(i){var n=t._getPointsetId(i);e.removePointset(n)}))}this._requestedPointsets.clear(),o.prototype.clearMarks.call(this),this._paneView.clearCaches(),this.onNeedRepaint.fire()},u.prototype._getData=function(e){var t=this._model.mainSeries().symbolInfo();if(t){var i=this.roundRange(this._rangeDifference(e)),n=this,r=this._model.mainSeries(),o=r.symbolId(),s=r.properties().interval.value();ChartApiInstance.getTimescaleMarks(t,i.start,i.end,(function(t){var i=n._model.chartApi();t.forEach((function(e){e.index=null;var t=e.id,r=n._getPointsetId(t),a=n._marks[t];if(a&&null!==a.index&&(a.tickmark===e.tickmark?e.index=a.index:n._requestedPointsets.has(r)&&i.connected()&&(i.removePointset(r),n._requestedPointsets.delete(r))),n._marks[t]=e,null===e.index&&i.connected()){n._requestedPointsets.add(r);var l=[[e.tickmark,0]];i.createPointset(r,"turnaround",o,s,l,(function(e){n._onPointsetData(e)}))}}),n),n._loadedRange=n._rangeUnion(e,n._loadedRange),n.onNeedRepaint.fire()}),s) }},u.prototype._getPointsetId=function(e){return"pointsetMark_"+e},u.prototype._onPointsetData=function(e){var t=e.params.customId.split("_")[1],i=this._marks[t],n=e.params.plots;i&&1===n.length&&(i.index=n[0].value[0])},u.prototype.updatePlateData=function(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t},u.prototype.hasContextMenu=function(){return!1},u.prototype.paneViews=function(){return this._properties.visible.value()?[this._paneView]:[]},u.prototype.onClickOutside=function(){this._paneView.onClickOutside()},inherit(h,r),h.prototype._createLollipops=function(){var e=this.source._model.timeScale(),t=r.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),o=this;Object.keys(this.source._marks).forEach((function(r){var s=this.source._marks[r],a=s.id,c=s.index;null!==c&&(o._lollipops[a]={id:a,basePoint:new n(e.indexToCoordinate(c)+1,t),hovered:i&&i.id===a||a===o.getLastClickedLollipopId(),barY:null,label:s.label,color:s.color,items:s.tooltip,tooltip:o._lollipops.hasOwnProperty(a)?o._lollipops[a].tooltip:new l,visible:!0})}),this)},h.prototype.clearCaches=function(){this.closeTooltips(),this.clearLastClicked(),this._lollipops={}},h.prototype.update=function(){this._createLollipops(),this._invalidated=!1},h.prototype.renderer=function(){return this.update(),r.prototype.renderer.call(this)},h.prototype._generateTemplateStyle=function(e,t,i){var n=e+t+i;if(!(n in this.stylesCache)){var r="default"!==e,o={strokeStyle:t,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:r?t:"white",fillCircle:r,strokeStyle:"#E2745B",text:{label:i,strokeStyle:r?"white":t,font:"normal 12px "+c}}};this.stylesCache[n]=o}return this.stylesCache[n]},h.prototype.getTemplate=function(e,t){var i=e+t.color+t.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(e,t.color,t.label))),this.templatesCache[i]},h.prototype.getStyle=function(e,t){return this._generateTemplateStyle(e,t.color,t.label)},h.prototype.createText=function(e,t){"string"==typeof e.items?t.addTextLine(e.items):Array.isArray(e.items)&&e.items.forEach((function(e){t.addTextLine(e)}))},h.prototype.hasTooltip=function(e){return!!e.tooltip&&e.tooltip.length},e.exports=u},"lNN+":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolTrianglePattern",(function(){return a}));var n=i("mrSG"),r=i("Ocx9"),o=i("Ss5c"),s=i("j3hX"),a=function(e){function t(n,r){var o=this,s=r||t.createProperties();return o=e.call(this,n,s)||this,i.e("lt-pane-views").then(i.bind(null,"Jej9")).then((function(e){o._setPaneViews([new e.LineToolTrianglePatternPaneView(o,n)])})),o}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 4},t.prototype.name=function(){return"Triangle Pattern"},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.createProperties=function(e){var i=new r.DefaultProperty("linetooltrianglepattern",e) ;return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"/HOw")).then((function(e){return e.PatternWithBackgroundDefinitionViewModel}))},t._configureProperties=function(e){o.LineDataSource._configureProperties(e),e.addChild("linesColors",new s.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new s.LineToolColorsProperty([e.childs().textcolor])),e.addChild("backgroundsColors",new s.LineToolColorsProperty([e.childs().backgroundColor]))},t}(o.LineDataSource)},lReN:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolsGroupControllerApi",(function(){return s}));var n=i("s1Gx"),r=i("Eyy1"),o=i("CW80"),s=function(){function e(e,t){this._controller=e,this._model=t}return e.prototype.createGroupFromSelection=function(){return this._controller.createGroupFromSelection().id},e.prototype.removeGroup=function(e){var t=Object(r.ensureDefined)(this._groupById(e));this._controller.removeGroup(t)},e.prototype.groups=function(){return this._controller.groups().map((function(e){return e.id}))},e.prototype.shapesInGroup=function(e){var t=Object(r.ensureDefined)(this._groupById(e));return Object(n.sortSources)(t.lineTools()).map((function(e){return e.id()}))},e.prototype.excludeShapeFromGroup=function(e,t){var i=Object(r.ensureDefined)(this._groupById(e)),n=Object(r.ensureNotNull)(this._model.dataSourceForId(t));Object(r.assert)(Object(o.isLineTool)(n),"Passed shapeId is not a line tool"),this._controller.excludeLineToolFromGroup(i,n)},e.prototype.availableZOrderOperations=function(e){var t=Object(r.ensureDefined)(this._groupById(e));return this._controller.availableZOrderOperations(t)},e.prototype.bringToFront=function(e){var t=Object(r.ensureDefined)(this._groupById(e));this._controller.bringToFront(t)},e.prototype.bringForward=function(e){var t=Object(r.ensureDefined)(this._groupById(e));this._controller.bringForward(t)},e.prototype.sendBackward=function(e){var t=Object(r.ensureDefined)(this._groupById(e));this._controller.sendBackward(t)},e.prototype.sendToBack=function(e){var t=Object(r.ensureDefined)(this._groupById(e));this._controller.sendToBack(t)},e.prototype.insertAfter=function(e,t){var i=Object(r.ensureDefined)(this._groupById(e)),n=Object(r.ensureNotNull)(this._groupById(t)||this._model.dataSourceForId(t));this._controller.insertAfter(i,n)},e.prototype.insertBefore=function(e,t){var i=Object(r.ensureDefined)(this._groupById(e)),n=Object(r.ensureNotNull)(this._groupById(t)||this._model.dataSourceForId(t));this._controller.insertBefore(i,n)},e.prototype.groupVisibility=function(e){return Object(r.ensureDefined)(this._groupById(e)).visibility()},e.prototype.setGroupVisibility=function(e,t){var i=Object(r.ensureDefined)(this._groupById(e));this._controller.setGroupVisibility(i,t)},e.prototype.groupLock=function(e){return Object(r.ensureDefined)(this._groupById(e)).locked()},e.prototype.setGroupLock=function(e,t){var i=Object(r.ensureDefined)(this._groupById(e)) ;this._controller.setGroupLock(i,t)},e.prototype.getGroupName=function(e){return Object(r.ensureDefined)(this._groupById(e)).name()},e.prototype.setGroupName=function(e,t){var i=Object(r.ensureDefined)(this._groupById(e));this._controller.setGroupName(i,t)},e.prototype.canBeGroupped=function(e){var t=this,i=e.map((function(e){return Object(r.ensureNotNull)(t._model.dataSourceForId(e))}));return!i.some((function(e){return!Object(o.isLineTool)(e)}))&&this._controller.canBeGroupped(i)},e.prototype._groupById=function(e){return this._controller.groups().find((function(t){return t.id===e}))},e}()},lTLF:function(e,t,i){"use strict";i.r(t);var n=i("Hr11"),r=function(){function e(e,t){if(this._base=e,this._integralDividers=t,Object(n.isBaseDecimal)(this._base))this._fractionalDividers=[2,2.5,2];else{this._fractionalDividers=[];for(var i=this._base;1!==i;){if(i%2==0)this._fractionalDividers.push(2),i/=2;else{if(i%5!=0)throw new Error("unexpected base");this._fractionalDividers.push(2),this._fractionalDividers.push(2.5),i/=5}if(this._fractionalDividers.length>100)throw new Error("something wrong with base")}}}return e.prototype.tickSpan=function(e,t,i){for(var r=0===this._base?0:1/this._base,o=Math.pow(10,Math.max(0,Math.ceil(Object(n.log10)(e-t)))),s=0,a=this._integralDividers[0];;){var l=Object(n.greaterOrEqual)(o,r,1e-9)&&o>r+1e-9,c=Object(n.greaterOrEqual)(o,i*a,1e-9),u=Object(n.greaterOrEqual)(o,1,1e-9);if(!(l&&c&&u))break;o/=a,a=this._integralDividers[++s%this._integralDividers.length]}if(o<=r+1e-9&&(o=r),o=Math.max(1,o),this._fractionalDividers.length>0&&Object(n.equal)(o,1,1e-9))for(s=0,a=this._fractionalDividers[0];Object(n.greaterOrEqual)(o,i*a,1e-9)&&o>r+1e-9;)o/=a,a=this._fractionalDividers[++s%this._fractionalDividers.length];return o},e}();i.d(t,"PriceTickMarkBuilder",(function(){return o}));var o=function(){function e(e,t,i,n){this._marks=null,this._priceScale=e,this._base=t,this._coordinateToLogicalFunc=i,this._logicalToCoordinateFunc=n}return e.prototype.base=function(){return this._base},e.prototype.setBase=function(e){if(e<0)throw new Error("base < 0");this._base=e},e.prototype.tickSpan=function(e,t,i){if(void 0===i&&(i=0),ei&&(c=u);var h=a.tickSpan(e,t,o);h>i&&(c=Math.min(c,h));var d=l.tickSpan(e,t,o);return d>i&&(c=Math.min(c,d)),c>0?c:e-t},e.prototype.rebuildTickMarks=function(){this._marks=null},e.prototype.marks=function(){return null===this._marks&&(this._marks=this._rebuildTickMarksImpl()),this._marks},e.prototype._fontHeight=function(){return this._priceScale.fontSize()},e.prototype._tickMarkHeight=function(){return Math.ceil(2.5*this._fontHeight())},e.prototype._rebuildTickMarksImpl=function(){var e=this._priceScale,t=[];if(e.isEmpty())return t;var i=e.mainSource();if(null===i)return t;var n=i.firstValue();null===n&&(n=0) ;var r=e.height(),o=this._coordinateToLogicalFunc(r-1,n),s=this._coordinateToLogicalFunc(0,n),a=Math.max(o,s),l=Math.min(o,s);if(a===l)return t;var c=this.tickSpan(a,l),u=a%c;u+=u<0?c:0;for(var h=a>=l?1:-1,d=null,p=e.formatter(),f=NaN,_=a-u;_>l;_-=c){_===f&&(c=this.tickSpan(a,l,c)),f=_;var m=this._logicalToCoordinateFunc(_,n);null!==d&&Math.abs(m-d)=3600&&(s=m(Math.floor(o/3600))),o%=3600;var a=m(Math.floor(o/60));o%=60;var l=m(Math.floor(o));return null!==s?s+":"+a+":"+l:a+":"+l},t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var n=this._source.properties();if(12!==n.style.value()){if(this._options.visibleOnHistoryOnly){var r=this._model.timeScale().visibleBarsStrictRange(),o=this._source.data().last();if(null===r||null===o||r.contains(o.index))return}var s=this._model.properties().scalesProperties,a=s.showSeriesLastValue.value(),l=v&&this._options.showCountdown&&-1!==y.indexOf(n.style.value())&&n.showCountdown.value(),c=this._options.showSymbolLabel&&s.showSymbolLabels.value(),u=s.seriesLastValueMode.value()===_.PriceAxisLastValueMode.LastPriceAndPercentageValue,h=this._source.lastValueData(void 0,this._options.alwaysShowGlobalLast);if(!h.noData){var d=8===n.style.value();if((a||l||c)&&d&&n.haStyle.showRealLastPrice.value()){var p=this._source.lastValueData(void 0,!1),f=this._source.lastValueData(void 0,!0);p.noData||f.noData||p.index!==f.index||(a=!1,l=!1,c=!1)}if(a||l){var m=this._axisFirstLineText(h,a,u),g=l?this._countdownText():"";this._previousCountdown=g,0===m.length?(e.text=g,e.secondLine=""):(e.text=m,e.secondLine=g), 0===m.length&&0===g.length||(e.visible=!0)}(c||u)&&(t.text=this._paneText(h,a,c,u),t.visible=t.text.length>0),i.background=this._source.priceLineColor(h.color),i.color=this.generateTextColor(i.background),i.coordinate=h.coordinate,i.floatCoordinate=h.floatCoordinate}}},t.prototype._paneText=function(e,t,i,n){var r="",o=this._source.symbolInfo();if(g)r+=o?o.exchange+" ":"";else if(i){var s=o&&Object(l.symbolCurrentContract)(o)||this._source.getSymbolName();s.length>40&&(s=s.substr(0,37)+"..."),r+=s+" "}return t&&n&&(r+=this._source.priceScale().isPercentage()?e.formattedPriceAbsolute:e.formattedPricePercentage),r.trim()},t.prototype._axisFirstLineText=function(e,t,i){return t?i?this._source.priceScale().isPercentage()?e.formattedPricePercentage:e.formattedPriceAbsolute:e.text:""},t.prototype._currentTime=function(){return Date.now()+1e3*this._source.serverTimeOffset()},t}(p.a),w=i("TmNs"),P=i("k9/m"),C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype.lastPrice=function(){return this._getSource().data().lastProjectionPrice},t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var n=this._getModel(),r=this._getSource(),o=r.priceScale(),s=n.timeScale(),a=this.lastPrice();if(!s.isEmpty()&&!o.isEmpty()&&void 0!==a){var l=s.visibleBarsStrictRange();if(null!==l){var c=l.firstBar(),u=l.lastBar(),d=r.data(),p=d.search(u,P.PlotRowSearchMode.NearestLeft);if(null!==p){var f=r.nearestIndex(c,P.PlotRowSearchMode.NearestRight);if(void 0!==f){var m=r.model().properties().scalesProperties,v=Object(h.ensureNotNull)(d.valueAt(f))[TradingView.CLOSE_PLOT],y=i.background,g=m.showSeriesLastValue.value(),b=!1,S=!1,w=!1,C=r.lastValueData(TradingView.CLOSE_PLOT,!1),T=r.properties();if(8===T.style.value()&&T.haStyle.showRealLastPrice.value()){var x=r.lastValueData(TradingView.CLOSE_PLOT,!0);if(x.noData||x.color===i.background||(y=x.color),!x.noData&&!C.noData){var I=x.index===C.index;b=I&&m.showSymbolLabels.value(),S=m.seriesLastValueMode.value()===_.PriceAxisLastValueMode.LastPriceAndPercentageValue,g=g&&I,w=I&&this._isCountdownEnabled()&&T.showCountdown.value()}}else{y=r.barColorer().barStyle(p.index,!0).barColor}i.background=y,i.color=this.generateTextColor(y),i.coordinate=o.priceToCoordinate(a,v),e.visible=g||w,C.noData||(C.text=o.formatPrice(a,v),C.formattedPriceAbsolute=o.formatPriceAbsolute(a),C.formattedPricePercentage=o.formatPricePercentage(a,v),e.text=this._axisFirstLineText(C,g,S),e.secondLine=w?this._countdownText():"",t.text=this._paneText(C,g,b,S)),t.visible=b||g&&S}}}}},t}(S),T=i("KtbP"),x=i("YFKU"),I=i("2ijp"),L=i("HGP3"),O=i("8Uy/"),M={light:{lineStyle:O.LINESTYLE_DOTTED,lineWidth:1,textColor:L.a["color-cold-gray-900"],backgroundColor:L.a["color-tv-blue-50"],lineColor:L.a["color-cold-gray-500"]},dark:{lineStyle:O.LINESTYLE_DOTTED,lineWidth:1,textColor:L.a["color-white"],backgroundColor:L.a["color-tv-blue-a800"],lineColor:L.a["color-cold-gray-500"]}};function A(e){return e?M.dark:M.light}var k=function(e){function t(t,i,n){var r=e.call(this)||this ;return r._model=t,r._isVisible=i,r._getValue=n,r}return Object(n.c)(t,e),t.prototype._updateImpl=function(){var e=this._lineRendererData;if(e.visible=!1,this._isVisible.value()){var t=this._model.mainSeries(),i=t.priceScale(),n=t.firstValue(),r=this._getValue();if(null!==n&&null!==r){var o=A(this._model.isDark());e.visible=!0,e.y=i.priceToCoordinate(r,n),e.linestyle=o.lineStyle,e.linewidth=o.lineWidth,e.color=o.lineColor}}},t}(I.a),E=function(e){function t(t,i,n,r){var o=e.call(this)||this;return o._model=t,o._label=i,o._isVisible=n,o._getValue=r,o}return Object(n.c)(t,e),t.prototype._updateRendererData=function(e,t,i){if(e.visible=!1,t.visible=!1,this._isVisible.value()){var n=this._model.mainSeries(),r=n.priceScale(),o=n.firstValue(),s=this._getValue();if(null!==o&&null!==s){var a=A(this._model.isDark());e.visible=!0,t.visible=!0,e.text=r.formatPriceAbsolute(s),t.text=this._label,i.coordinate=r.priceToCoordinate(s,o),i.background=a.backgroundColor,i.color=a.textColor}}},t}(p.a),V=function(e){function t(t,i,n){var r=e.call(this)||this;return r._model=t,r._isLineVisible=i,r._getValue=n,r}return Object(n.c)(t,e),t.prototype._isVisible=function(){return this._isLineVisible.value()},t.prototype._lineWidth=function(){return A(this._model.isDark()).lineWidth},t.prototype._lineStyle=function(){return A(this._model.isDark()).lineStyle},t.prototype._priceLineColor=function(e){return A(this._model.isDark()).lineColor},t.prototype._value=function(){var e=this._model.mainSeries(),t=e.priceScale(),i=e.firstValue(),n=this._getValue();if(null===i||null===n)return{noData:!0};var r=t.priceToCoordinate(n,i);return{noData:!1,floatCoordinate:r,coordinate:r,color:"",formattedPricePercentage:"",formattedPriceAbsolute:"",text:"",index:0}},t}(w.PriceLineAxisView),D=Object(x.t)("High"),B=Object(x.t)("Low"),R=Object(x.t)("Avg");function N(e,t,i,n,r,o){var s=new k(e,r,o),a=new E(e,i,n,o);return{paneView:s,panePriceAxisView:new T.PanePriceAxisView(a,t,e),priceAxisView:a,priceLineAxisView:new V(e,r,o)}}var j=i("C2K+"),F=i("WPIy"),W=i("aIyQ"),H=i.n(W);i.d(t,"SeriesBase",(function(){return U}));var z=f.enabled("price_scale_always_last_bar_value"),U=function(e){function t(t,i){var n=e.call(this,t)||this;n.extendedHours=new a.a,n.requestingIntradayWhenNotSupported=new H.a,n.requestingResolutionWhenNotSupported=new H.a,n._paneView=null,n._priceStep=null,n._symbolInfo=null,n._isPrePostMarketPricesForbiddenProperty=new a.a(!0),n._highLowAvgPriceCache=new Map,n._prevClosePriceAxisView=null,n._priceScaleChanged=new H.a,n._priceScaleAboutToBeChanged=new H.a,n._base=100,n._pointValue=1,n._formatter=new c.PriceFormatter(n._base),n._ignoreMinMoveFormatter=new c.PriceFormatter(n._base),n._ignoreMinMovePriceStep=null,n._lastBarCloseTime=null,n._quotesProvider=new u.a,n._quotesProvider.quotesUpdate().subscribe(n,n._onQuotesUpdate),n._setProperties(i);var r=new S(n,t,{alwaysShowGlobalLast:!0});n._priceAxisView=r;var o=null;z||(o=new S(n,t,{visibleOnHistoryOnly:!0,showSymbolLabel:!1,showCountdown:!1,alwaysShowGlobalLast:!1})), n._priceLinePriceAxisView=new w.SeriesPriceLineAxisView(n),n._priceLineAxisViews=[n._priceLinePriceAxisView];var s=new C(n,t);return n._priceAxisViews=[r,s],null!==o&&n._priceAxisViews.push(o),n._panePriceAxisView=new T.PanePriceAxisView(r,n,t),n._historyPricePanePriceAxisView=null!==o?new T.PanePriceAxisView(o,n,t):null,n._projectionPriceAxisView=new T.PanePriceAxisView(s,n,t),n._labelPaneViews=[n._panePriceAxisView,n._projectionPriceAxisView],null!==n._historyPricePanePriceAxisView&&n._labelPaneViews.push(n._historyPricePanePriceAxisView),n._highLowAvgPaneViews=[],n._createHighLowAvgViews(),n}return Object(n.c)(t,e),t.prototype.destroy=function(){this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._model.timeScale().visibleBarsStrictRangeChanged().unsubscribeAll(this)},t.prototype.quotesProvider=function(){return this._quotesProvider},t.prototype.labelPaneViews=function(){return this._labelPaneViews},t.prototype.clearHighLowAvgPriceCache=function(){this._highLowAvgPriceCache.clear()},t.prototype.priceScaleChanged=function(){return this._priceScaleChanged},t.prototype.priceScaleAboutToBeChanged=function(){return this._priceScaleAboutToBeChanged},t.prototype.symbolInfo=function(){return this._symbolInfo},t.prototype.symbolResolved=function(){return this.dataEvents().symbolResolved()},t.prototype.formatter=function(e){return void 0===e&&(e=!0),e?this._formatter:this._ignoreMinMoveFormatter},t.prototype.priceStep=function(e){return void 0===e&&(e=!0),e?this._priceStep:this._ignoreMinMovePriceStep},t.prototype.prevClose=function(){if(this.priceScale().isEmpty()||this.data().isEmpty())return null;var e=this.quotes(),t=this.firstValue();if(null===e||null===t)return null;var i=e.prev_close_price;return void 0===i?null:{coordinate:this.priceScale().priceToCoordinate(i,t),floatCoordinate:this.priceScale().priceToCoordinate(i,t),text:this.priceScale().formatPrice(i,t)}},t.prototype.hasClosePrice=function(){return 12!==this.properties().style.value()},t.prototype.nearestValue=function(e,t,i){var n=this.nearestData(e,i);return n?n.value[t]:void 0},t.prototype.autoScaleInfo=function(e,t){var i=this.priceRange(e,t);if(null===this._paneView)return{range:i};var n=this._paneView;return{range:i,topPixelMargin:n.topPixelMargin?n.topPixelMargin():void 0,bottomPixelMargin:n.bottomPixelMargin?n.bottomPixelMargin():void 0}},t.prototype.isPrePostMarketPricesForbiddenProperty=function(){return this._isPrePostMarketPricesForbiddenProperty},t.prototype.quotes=function(){return this.data().isEmpty()?null:this._quotesProvider.quotes()},t.prototype.base=function(){return this._base},t.prototype.pointValue=function(){return this._pointValue},t.prototype.barCloseTime=function(){return this._lastBarCloseTime},t.prototype.setSymbol=function(e){return this.properties().symbol.setValue(e)},t.prototype.currency=function(){return this.properties().currencyId.value()||null},t.prototype.setCurrency=function(e){this.properties().currencyId.setValue(e)},t.prototype.isConvertedToOtherCurrency=function(){ return Object(l.isConvertedToOtherCurrency)(this.symbolInfo())},t.prototype.symbolSource=function(){return this},t.prototype.valuesProvider=function(){return new j.a(this,this.model())},t.prototype.statusProvider=function(e){return new F.a(this,this._model.properties().scalesProperties.textColor,this.properties().statusViewStyle,e)},t.prototype.open=function(e){var t=this.data().valueAt(e);return t&&t[1]},t.prototype.high=function(e){var t=this.data().valueAt(e);return t&&t[2]},t.prototype.low=function(e){var t=this.data().valueAt(e);return t&&t[3]},t.prototype.close=function(e){var t=this.data().valueAt(e);return t&&t[4]},t.prototype.moveItem=function(e,t,i){if(10===this.style()&&0===t){var n=this.priceScale(),r=this.properties().baselineStyle,o=n.height(),s=100-e.y/o*100,a=s<0?0:Math.round(10*s)/10;r.baseLevelPercentage.setValue(Math.max(Math.min(a,100),0))}},t.prototype._isExtendedHoursAllowed=function(){return Boolean(this._symbolInfo&&-1!==["stock","index","futures"].indexOf(this._symbolInfo.type))},t.prototype._recreateFormatter=function(){this._formatter=Object(l.createSeriesFormatter)(this.symbolInfo(),this.properties().minTick.value()),this._ignoreMinMoveFormatter=Object(l.createSeriesFormatter)(this.symbolInfo(),this.properties().minTick.value(),!0),this.priceScale()&&this.priceScale().updateFormatter(),this._formatterChanged.fire()},t.prototype._recreatePriceStep=function(){var e=Object(l.getSeriesPriceFormattingState)(this.symbolInfo()),t=e.minMove,i=e.priceScale,n=t/i;this._ignoreMinMovePriceStep=1/i,this._priceStep!==n&&(this._priceStep=n,this._priceStepChanged.fire())},t.prototype._recreatePriceFormattingDependencies=function(){this._recreateFormatter(),this._recreatePriceStep()},t.prototype._updateIsPrePostMarketPricesForbiddenProperty=function(){var e=!this.isDWM()&&this.extendedHours.value()||!this._isExtendedHoursAllowed();this._isPrePostMarketPricesForbiddenProperty.setValue(e)},t.prototype._createHighLowAvgViews=function(){var e,t,i,n,r=this.properties().highLowAvgPrice,o=this._getHighLowAvgPrice.bind(this),s=function(e,t,i,n){var r=i.childs(),o=N(e,t,D,r.highLowPriceLabelsVisible,r.highLowPriceLinesVisible,(function(){return n(0)})),s=N(e,t,B,r.highLowPriceLabelsVisible,r.highLowPriceLinesVisible,(function(){return n(1)})),a=N(e,t,R,r.averageClosePriceLabelVisible,r.averageClosePriceLineVisible,(function(){return n(2)}));return{paneViews:[o.paneView,s.paneView,a.paneView],panePriceAxisViews:[o.panePriceAxisView,s.panePriceAxisView,a.panePriceAxisView],priceAxisViews:[o.priceAxisView,s.priceAxisView,a.priceAxisView],priceLineAxisViews:[o.priceLineAxisView,s.priceLineAxisView,a.priceLineAxisView]}}(this._model,this,r,o);(e=this._highLowAvgPaneViews).push.apply(e,s.paneViews),(t=this._labelPaneViews).push.apply(t,s.panePriceAxisViews),(i=this._priceAxisViews).push.apply(i,s.priceAxisViews),(n=this._priceLineAxisViews).push.apply(n,s.priceLineAxisViews)},t.prototype._getHighLowAvgPrice=function(e){if(!this._highLowAvgPriceCache.has(e)){var t=this._model.timeScale().visibleBarsStrictRange() ;if(null===t)return null;var i=this._model.mainSeries().bars(),n=t.firstBar(),r=t.lastBar();if(2===e){var s=function(e,t,i){for(var n=Object(o.barFunction)("close"),r=0,s=0,a=t;a<=i;a++){var l=e.valueAt(a);null!==l&&(r+=n(l),s++)}return s?r/s:null}(i,n,r);if(null===s)return null;this._highLowAvgPriceCache.set(2,s)}else{var a=function(e,t,i){return e.minMaxOnRangeCached(t,i,[{name:"low",offset:0},{name:"high",offset:0}])}(i,n,r);if(null===a)return null;this._highLowAvgPriceCache.set(1,a.min),this._highLowAvgPriceCache.set(0,a.max)}}return this._highLowAvgPriceCache.get(e)},t}(r.PriceDataSource)},"lW/c":function(e,t,i){"use strict";i.r(t);i("YFKU");var n=i("hY0g"),r=i.n(n),o=i("HySD"),s=function(){function e(e){var t=this;this._document=e,this.isFullscreen=new r.a;var i=function(){for(var e=["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement","msFullscreenElement"],i=0;i0;){var s=e._groups[o];if(!s.isDisabled()){if(s.handleHotkey(i,t))return;if(s.modal)return}}}},this._keyUpListener=function(t){var i=Object(n.hashFromEvent)(t);e._pressedKeys.setValue(i)},this._blurEvent=function(){e._pressedKeys.setValue(0)},this._mouseEvent=function(t){ var i=Object(n.modifiersFromEvent)(t),r=255&e._pressedKeys.value();e._pressedKeys.setValue(i|r)}}return e.prototype.listen=function(e){e.addEventListener("keydown",this._keyDownListener),e.addEventListener("keyup",this._keyUpListener),e.addEventListener("blur",this._blurEvent),e.addEventListener("mousemove",this._mouseEvent)},e.prototype.unlisten=function(e){e.removeEventListener("keydown",this._keyDownListener),e.removeEventListener("keyup",this._keyUpListener),e.removeEventListener("blur",this._blurEvent),e.removeEventListener("mousemove",this._mouseEvent)},e.prototype.registerGroup=function(e){this._groups.push(e)},e.prototype.unregisterGroup=function(e){for(var t=this._groups.length;t--;)this._groups[t]===e&&this._groups.splice(t,1)},e.prototype.promoteGroup=function(e){for(var t=this._groups.length-1,i=this._groups.length;i--;){if(this._groups[i]===e)return void(i!==t&&(this._groups.splice(i,1),this._groups.splice(t,0,e)));this._groups[i].modal&&(t=i-1)}},e.prototype.pressedKeys=function(){return this._pressedKeys},e}(),l=i("JWMC"),c=function(){function e(e,t){this._group=e,this.hotkey=t.hotkey,this.handler=t.handler,this.desc=t.desc,this.element=t.element||null,t.isDisabled?"function"==typeof t.isDisabled?this.isDisabled=t.isDisabled:this.isDisabled=function(){return!0}:this.isDisabled=function(){return!1}}return e.prototype.destroy=function(){this._group&&(this._group.remove(this),this._group=null)},e}(),u=function(){function e(e,t){this._actions=[],this._manager=e,this.modal=!(!t||!t.modal),t&&(this.desc=t.desc),t&&t.isDisabled?"function"==typeof t.isDisabled?this.isDisabled=t.isDisabled:this.isDisabled=function(){return!0}:this.isDisabled=function(){return!1},this._manager.registerGroup(this)}return e.prototype.add=function(e){var t=new c(this,e);return this._actions.push(t),t},e.prototype.remove=function(e){for(var t=this._actions.length;t-- >0;)this._actions[t]===e&&this._actions.splice(t,1)},e.prototype.handleHotkey=function(e,t){for(var i=this._actions.length;i-- >0;){var r=this._actions[i];if(r.hotkey===e&&((!r.element||t.target&&r.element.contains(t.target))&&!r.isDisabled()))return r.handler(t),t.preventDefault(),Object(l.trackEvent)("Keyboard Shortcuts",Object(n.humanReadableHash)(e)),!0}return!1},e.prototype.promote=function(){this._manager.promoteGroup(this)},e.prototype.destroy=function(){this._actions.length=0,this._manager.unregisterGroup(this)},e}();i.d(t,"pressedKeys",(function(){return d})),i.d(t,"createGroup",(function(){return p})),i.d(t,"registerWindow",(function(){return f})),i.d(t,"unregisterWindow",(function(){return _})),i.d(t,"Modifiers",(function(){return n.Modifiers}));var h=new a,d=h.pressedKeys();function p(e){return new u(h,e)}function f(e){h.listen(e)}function _(e){h.unlisten(e)}f(window)},"m/cY":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i("tc+8"),r=i.n(n);function o(e){return new r.a(e)}},mE5r:function(e,t,i){"use strict";i.r(t) ;var n=i("mrSG"),r=i("Eyy1"),o=i("ikwP"),s=i("gAom"),a=i("H0vP"),l=i("aO4+"),c=i("XlJ7"),u=i("EsvI"),h=i("OsWk"),d=i("rL76"),p=i("zDbI"),f=parseInt(d.labelheight),_=parseInt(d.bottommargin);function m(e){return e/11}var v=function(){function e(){this._wrapper=document.createElement("div"),this._element=document.createElement("div"),this._labelElement=document.createElement("div"),this._gearElement=document.createElement("div"),this._currentScale=1,this._info=null,this._mode="auto",this._wrapper.appendChild(this._element),this._wrapper.classList.add(d.wrapper),this._element.classList.add(d.label),this._labelElement.className=d.symbol,this._element.appendChild(this._labelElement),this._gearElement.className=d.gear,this._gearElement.innerHTML=h,this._element.appendChild(this._gearElement)}return e.prototype.getElement=function(){return this._wrapper},e.prototype.setMode=function(e){this._mode!==e&&(this._mode=e)},e.prototype.align=function(e,t){var i=m(t);Math.abs(i-this._currentScale)>.1&&(this._currentScale=i,Math.abs(this._currentScale-1)>.1?this._element.style.transform="scale("+this._currentScale+")":(this._currentScale=1,this._element.style.transform=""))},e.prototype.drawLabelForScreenshot=function(e,t){if(null!==this._info&&"gear"!==this._mode){var i=Object(c.makeFont)(t.fontSize,p.CHART_FONT_FAMILY);e.fillStyle=u.themes[t.theme].getThemedColor("color-price-axis-label-back"),e.globalAlpha=.5,e.beginPath();var n=m(t.fontSize)*f/2,r=Object(l.point)(t.offset+t.width/2,t.height/2);e.arc(r.x,r.y,n,0,2*Math.PI,!0),e.fill(),e.globalAlpha=1,e.fillStyle=u.themes[t.theme].getThemedColor("color-price-axis-label-text"),e.textAlign="center",e.font=i,e.textBaseline="middle",e.fillText(this._info.label,r.x,r.y)}},e.prototype.setAxisNameInfo=function(e){this._info=e,null!==e&&(this._labelElement.textContent=e.label)},e.height=function(e){return(f+_)*e},e}(),y=i("aIyQ"),g=i.n(y),b=i("S8xo"),S=i("5VQP"),w=i("CPmC"),P={enableTooltip:!0,showLabels:!0,enableMenu:!0,enableHighlight:!0},C=function(){function e(e,t,i,r,s){var a=this;this._invalidated=!0,this._size=new o.Size(0,0),this._offset=0,this._axisInfo=null,this._onLabelHovered=new g.a,this._highlighted=!1,this._labelMode="auto",this._fixedLabelMode=null,this._canvasConfiguredHandler=function(){return a.update()},this._isLeft="left"===e,this._rendererOptionsProvider=r.rendererOptionsProvider,this._sourcesTitlesProvider=r.sourcesTitlesProvider,this._contextMenuItemsProvider=r.contextMenuItemsProvider,this._backgroundBasedTheme=r.backgroundBasedTheme,this._getBackgroundTopColor=r.getBackgroundTopColor,this._getBackgroundBottomColor=r.getBackgroundBottomColor,this._properties=t,this._axisInfo=i,this._labelOptions=Object(n.a)(Object(n.a)({},P),s),this._properties.lineColor.subscribe(this,this._onPropertyChanged),this._cell=document.createElement("div"),this._cell.classList.add(d["price-axis-stub"]),this._labelOptions.enableTooltip&&this._cell.classList.add("apply-common-tooltip"),this._cell.style.width="25px",this._cell.style.height="100%",this._cell.style.position="absolute", this._cell.style.left="0",this._cell.style.overflow="hidden",this._labelOptions.showLabels?(this._label=new v,this._label.setAxisNameInfo(this._axisInfo),this._cell.appendChild(this._label.getElement()),this._labelOptions.enableTooltip&&Object(w.b)(this._cell,"text",(function(e){return a._tooltipContent()}))):this._label=null,this._mouseEventHandler=new b.MouseEventHandler(this._cell,this,{treatHorzTouchDragAsPageScroll:!0,treatVertTouchDragAsPageScroll:!0}),this._canvasBinding=Object(o.createBoundCanvas)(this._cell,new o.Size(16,16)),this._canvasBinding.subscribeCanvasConfigured(this._canvasConfiguredHandler);var l=this._canvasBinding.canvas;l.style.position="absolute",l.style.left="0",l.style.top="0"}return e.prototype.destroy=function(){this._canvasBinding.unsubscribeCanvasConfigured(this._canvasConfiguredHandler),this._canvasBinding.destroy(),this._properties.lineColor.unsubscribe(this,this._onPropertyChanged),this._mouseEventHandler.destroy(),$(this._cell).remove()},e.prototype.mouseEnterEvent=function(e){this._mouseOrTouchEnterEvent(e)},e.prototype.touchStartEvent=function(e){this._mouseOrTouchEnterEvent(e)},e.prototype.mouseLeaveEvent=function(e){this._mouseOrTouchLeaveEvent(e)},e.prototype.touchEndEvent=function(e){this._mouseOrTouchLeaveEvent(e)},e.prototype.mouseClickEvent=function(e){this._mouseClickOrTapEvent(e)},e.prototype.tapEvent=function(e){this._mouseClickOrTapEvent(e)},e.prototype.update=function(){this._invalidated=!0},e.prototype.getElement=function(){return this._cell},e.prototype.onLabelHovered=function(){return this._onLabelHovered},e.prototype.setSizeAndOffset=function(e,t){if(e.w<0||e.h<0)throw new Error("Try to set invalid size to PriceAxisStub "+JSON.stringify(e));this._size.equals(e)||(this._size=e,this._canvasBinding.resizeCanvas({width:e.w,height:e.h}),this._cell.style.width=e.w+"px",this._cell.style.minWidth=e.w+"px",this._cell.style.height=e.h+"px",this._invalidated=!0),this._offset!==t&&(this._offset=t,this._cell.style.left=t+"px")},e.prototype.paint=function(e){if((!(ethis._axises.length&&this._axises.lengthu;){var h=Object(r.ensureDefined)(this._stubs.pop());h.onLabelHovered().unsubscribeAll(this),this._cell.removeChild(h.getElement()),h.destroy()}for(var d=function(){var e=p._labelsOptions.showLabels?Object(T.a)(p._side,p._stubs.length):null,t=p._stubs.length,i=new C(p._side,p._stubProperties,e,p._stubParams(t),p._labelsOptions);i.onLabelHovered().subscribe(p,(function(t,i){o._labelsOptions.showLabels&&o._labelsOptions.enableHighlight&&o._onLabelHovered.fire({owner:t,axis:Object(r.ensureNotNull)(e)},i)})),p._stubs.push(i),p._cell.appendChild(i.getElement())},p=this;this._stubs.length=t.scrollWidth||t.setAttribute("title",t.textContent||""))}),!0),document.addEventListener("mouseenter",(function(e){var t=e.target;if(t instanceof HTMLElement&&t.matches(".apply-overflow-tooltip")){if(t.matches(".apply-overflow-tooltip--check-children")){for(var i=!1,n=t.children,r=0;r1,"Unable to change pane's height if there is only one pane");var r=i.indexOf(this._pane);Object(n.assert)(-1!==r,"Invalid pane index");var o=new l(t,r,e);this._chartWidget.model().undoHistory().pushUndoCommand(o)},e.prototype.moveTo=function(e){var t=this.paneIndex();t!==e&&(Object(n.assert)(e>=0&&e1&&"-"===t.text[0]?e.remove.push(t.text.slice(1)):(i="-"===t.text?new _:new f({label:t.text,onExecute:t.click}),t.position&&"top"===t.position?e.top.push(i):e.bottom.push(i)))}))}}),e},w.prototype._timeAxisMenu=function(){if(this._chartUndoModel().timeScale().isEmpty())return null;var e=this._chart.getTimeScale();return new f({label:window.t("Time Scale"),subItems:e.getContextMenuActions(),statName:"TimeScale"})},w.prototype.toggleLockTimeAxis=function(e,t){if("boolean"!=typeof t&&(t=!v.lockTimeAxis().value()),t){var i=this._chartUndoModel().timeScale(),n=i.coordinateToIndex(e),r=i.points().roughTime(n);v.lockTimeAxisTime.setValue(r)}v.lockTimeAxis().setValue(t)},w.prototype._createLockTimeAxisAction=function(e){var t=v.lockTimeAxis().value();return new f({label:window.t("Lock Vertical Line On Time Axis"),statName:"LockCursorInTime",checkable:!0,checked:t,onExecute:this.toggleLockTimeAxis.bind(this,e.localX,!t)})},w.prototype._createHVLineAction=function(e,t){var i=this;return new f({label:"vertical"===(t="vertical"===t?"vertical":"horizontal")?window.t("Create Vertical Line"):window.t("Create Horizontal Line"),statName:"vertical"===t?"CreateVerticalLine":"CreateHorizontalLine",onExecute:function(){var n=c(i._state),r=n.mainDataSource().firstValue(),o=i._chartUndoModel().timeScale().coordinateToIndex(e.localX),s=n.defaultPriceScale().coordinateToPrice(e.localY,r),a=i._chartUndoModel().createLineTool(n,{index:o,price:s},"vertical"===t?"LineToolVertLine":"LineToolHorzLine") ;i._finishTool(a)}})},w.prototype.update=function(){this._lhsPriceAxisesContainer.update(),this._rhsPriceAxisesContainer.update(),null!==this._legendWidget&&this._legendWidget.update(),this.updateControls()},w.prototype.updateControls=function(){null!==this._paneControls&&this._paneControls.update()},w.prototype.recalculatePriceScale=function(){var e=this.state();e.leftPriceScales().forEach((function(t){e.recalculatePriceScale(t)})),e.rightPriceScales().forEach((function(t){e.recalculatePriceScale(t)}));for(var t=e.dataSources(),i=0;i0,this._precision=e}return e.prototype.state=function(){return{ precision:this._precision}},e.prototype.format=function(e){if(!Object(o.isNumber)(e))return a;var t="";return e<0&&(t="-",e=-e),e>=1e100?Object(n.t)("N/A"):(!this._fractionalValues||e>=995?e=Math.round(e):this._fractionalValues&&(e=+e.toFixed(this._precision)),e<995?t+this._formatNumber(e):e<999995?t+this._formatNumber(e/1e3)+"K":e<999999995?(e=1e3*Math.round(e/1e3),t+this._formatNumber(e/1e6)+"M"):(e=1e6*Math.round(e/1e6),t+this._formatNumber(e/1e9)+"B"))},e.prototype.parse=function(e){if("---"===e)return{error:"not a number",res:!1,value:NaN};var t={K:1e3,M:1e6,B:1e9},i=e.slice(-1);if(t.hasOwnProperty(i)){var n=this._numericFormatter.parse(e.slice(0,-1));return Object(o.isNumber)(n)?{res:!0,value:n*t[i]}:{error:"not a number",res:!1,value:NaN}}n=this._numericFormatter.parse(e);return Object(o.isNumber)(n)?{res:!0,value:n}:{error:"not a number",res:!1,value:NaN}},e.serialize=function(e){return e.state()},e.deserialize=function(t){return new e(t.precision)},e.prototype._formatNumber=function(e){return this._fractionalValues&&(e=Object(s.fixComputationError)(e)),this._numericFormatter.format(e).replace(/(\.[1-9]*)0+$/,(function(e,t){return t}))},e}()},nW7S:function(e,t,i){"use strict";(function(e){var n=i("aO4+").Point,r=i("Ss5c").LineDataSource,o=i("Ocx9").DefaultProperty;function s(e,t){var n=t||s.createProperties();r.call(this,e,n),this._properties.addChild("angle",new s.AngleProperty(this)),i.e("lt-pane-views").then(function(e){var t=i("XHET").TrendAnglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,r),s.prototype.isSynchronizable=function(){return!1},s.AngleProperty=function(t){e.call(this),this._lineSource=t},inherit(s.AngleProperty,e),s.AngleProperty.prototype.value=function(){var e=180*this._lineSource._angle/Math.PI;return Math.round(e)},s.AngleProperty.prototype.setValue=function(e){var t=e*Math.PI/180;this._lineSource._angle=t;var i=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],r=Math.cos(this._lineSource._angle),o=-Math.sin(this._lineSource._angle),s=new n(r,o),a=i.addScaled(s,this._lineSource._distance),l=this._lineSource.screenPointToPoint(a);this._lineSource._points[1]=l,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)},s.prototype.pointsCount=function(){return 2},s.prototype.name=function(){return"Trend Angle"},s.prototype._calculateAngle=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e);i.length()>0?(i=i.normalized(),this._angle=Math.acos(i.x),i.y>0&&(this._angle=-this._angle),this._distance=t.subtract(e).length()):delete this._angle,this.properties().hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)},s.prototype.addPoint=function(e,t){var i=r.prototype.addPoint.call(this,e,t);return i&&this._calculateAngle(),i},s.prototype.setLastPoint=function(e,t){r.prototype.setLastPoint.call(this,e,t), this.points().length>1&&this._calculateAngle()},s.prototype.axisPoints=function(){if(this.points().length<2)return[];var e=[this.points()[0]],t=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,r=-Math.sin(this._angle)*this._distance,o=t.add(new n(i,r)),s=this.screenPointToPoint(o);return e.push(s),e},s.prototype.setPoint=function(e,t,i){r.prototype.setPoint.call(this,e,t,i),this.points().length>1&&1===e&&this._calculateAngle()},s.prototype.restoreData=function(e){this._angle=e.angle,this._distance=e.distance},s.prototype.state=function(e){var t=r.prototype.state.call(this,e);return t.angle=this._angle,t.distance=this._distance,t},s.prototype.cloneData=function(e){this._angle=e._angle,this._distance=e._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())]},s.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("o1gc").TrendAngleDefinitionsViewModel}.bind(null,i)).catch(i.oe)},s.createProperties=function(e){var t=new o("linetooltrendangle",e);return s._configureProperties(t),t},s._configureProperties=function(e){r._configureProperties(e)},t.LineToolTrendAngle=s}).call(this,i("tc+8"))},"nd9+":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolGannComplex",(function(){return h}));var n=i("mrSG"),r=i("aO4+"),o=i("Eyy1"),s=i("T6Of"),a=i("Ss5c"),l=i("FaJS"),c=i("LAp3"),u=i("j3hX"),h=function(e){function t(n,r){var o=e.call(this,n,r||t.createProperties())||this;o.version=2,o._scaleRatioFormatter=new s.LimitedPrecisionNumericFormatter(7),i.e("lt-pane-views").then(function(e){var t=i("X4Cb").GannComplexPaneView;o._setPaneViews([new t(o,o.model())])}.bind(null,i)).catch(void 0);var a=o.properties();return o._adjustScaleRatio(a),a.subscribe(o,o._adjustScaleRatio),a.childs().scaleRatio.subscribe(o,o._correctFirstPoint),o._syncStateExclusions=["scaleRatio"],a.addExclusion("scaleRatio"),o.properties().onRestoreFactoryDefaults().subscribe(o,o._handleRestoringFactoryDefaults),o._onTemplateApplying.subscribe(o,o._handleTemplateApplying),o._onTemplateApplied.subscribe(o,o._correctFirstPoint),o}return Object(n.c)(t,e),t.prototype.properties=function(){return e.prototype.properties.call(this)},t.prototype.migrateVersion=function(e,t,i){var n=this;1===e&&(this._points.length>=this.pointsCount()?setTimeout((function(){return n._migratePoint()})):this._timePoint.length>=this.pointsCount()&&this._pointAdded.subscribe(this,this._migratePoint))},t.prototype.destroy=function(){var t=this.properties();t.unsubscribe(this,this._adjustScaleRatio),t.childs().scaleRatio.unsubscribe(this,this._correctFirstPoint),this.properties().onRestoreFactoryDefaults().unsubscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.unsubscribe(this,this._handleTemplateApplying),this._onTemplateApplied.unsubscribe(this,this._correctFirstPoint), e.prototype.destroy.call(this)},t.prototype.pointsCount=function(){return 2},t.prototype.name=function(){return"Gann Square"},t.prototype.addPoint=function(t,i,n){this._points.length>1&&this._points.pop();var r=e.prototype.addPoint.call(this,t,i,n),s=this.priceScale();return!Object(o.ensureNotNull)(s).isLog()&&r&&this._correctFirstPoint(),r},t.prototype.setPoint=function(t,i,n){e.prototype.setPoint.call(this,t,i,n),void 0!==n&&n.shift()?this._correctPoint(t):this._correctScaleRatio()},t.prototype.setLastPoint=function(t,i){var n=this.priceScale();Object(o.ensureNotNull)(n).isLog()||(this._points[1]=t,this._correctPoint(1)),e.prototype.setLastPoint.call(this,t,i)},t.prototype.isReversed=function(){return this.properties().childs().reverse.value()},t.prototype.levelsCount=function(){return this.properties().childs().levels.childCount()},t.prototype.levels=function(){for(var e=[],t=this.properties().childs(),i=t.levels.childCount(),n=0;n0,s=n.index-r.index>0,a=o&&!s||!o&&s?-1:1;0===e&&(a=-a),n.price=r.price+a*t*i,this._pointChanged.fire(e)}this.normalizePoints()}}},t.prototype._correctFirstPoint=function(){this._correctPoint(this.isReversed()?0:1)},t.prototype._handleRestoringFactoryDefaults=function(){this.properties().childs().scaleRatio.setValue(this._getAdjustedScaleRatio())},t.prototype._handleTemplateApplying=function(e){""===e.scaleRatio&&(e.scaleRatio=this._getAdjustedScaleRatio())},t.prototype._migratePoint=function(){if(!(this.points().length0){r=r.normalized();var o=Math.acos(r.x);return r.y>0&&(o=-o),o}return null},t}(a.LineDataSource)},nda6:function(e,t,i){"use strict";i.r(t),i.d(t,"TimeSpanFormatter",(function(){return n}));i("YFKU");var n=function(){function e(){}return e.prototype.format=function(e){var t=e<0;e=Math.abs(e) ;var i=Math.floor(e/86400);e-=86400*i;var n=Math.floor(e/3600);e-=3600*n;var r=Math.floor(e/60);e-=60*r;var o="";return i&&(o+=i+window.t("d",{context:"dates"})+" "),n&&(o+=n+window.t("h",{context:"dates"})+" "),r&&(o+=r+window.t("m",{context:"dates"})+" "),e&&(o+=e+window.t("s",{context:"dates"})+" "),t&&(o="-"+o),o.trim()},e}()},"ng+v":function(e,t,i){"use strict";i.r(t),i.d(t,"LineDataSourceBase",(function(){return b}));var n=i("mrSG"),r=i("aO4+"),o=i("Eyy1"),s=i("FQhm"),a=i("fgLi"),l=i("mMWL"),c=i("aIyQ"),u=i.n(c),h=i("tc+8"),d=i.n(h),p=i("j3hX"),f=i("39QR"),_=i("j8de"),m=i("LxhU"),v=i("dOnf"),y=i("Ocx9");var g=function(){function e(){this._states=[]}return e.prototype.start=function(e){this._states.push(e)},e.prototype.finish=function(e){var t,i,n=Object(o.ensureDefined)(this._states.pop());return i=n,(t=e).length!==i.length?{indexesChanged:!0,pricesChanged:!0}:t.reduce((function(e,t,n){var r=i[n];return e.indexesChanged=e.indexesChanged||t.index!==r.index,e.pricesChanged=e.pricesChanged||t.price!==r.price,e}),{indexesChanged:!1,pricesChanged:!1})},e.prototype.isEmpty=function(){return 0===this._states.length},e}(),b=function(e){function t(t,i){var n=e.call(this)||this;return n._currentPointsetId=null,n._pointChanged=new u.a,n._pointAdded=new u.a,n._alertUndoMode=!1,n._priceAxisViews=[],n._timeAxisViews=[],n._timePoint=[],n._points=[],n._paneViews=new Map,n._normalizedPointsChanged=new u.a,n._changeStatesStack=new g,n._startMovingPoint=null,n._currentMovingPoint=null,n._fixedPoints=[],n._model=t,n._properties=i,n.localAndServerAlertsMismatch=!1,n}return Object(n.c)(t,e),t.prototype.destroy=function(){var e=this;this._paneViews.forEach((function(t,i){return e._destroyPanePaneViews(i)}))},t.prototype.normalizedPointsChanged=function(){return this._normalizedPointsChanged},t.prototype.widthsProperty=function(){var e;return null!==(e=this._properties.childs().linesWidths)&&void 0!==e?e:null},t.prototype.lineColorsProperty=function(){var e;return null!==(e=this._properties.childs().linesColors)&&void 0!==e?e:null},t.prototype.backgroundColorsProperty=function(){var e;return null!==(e=this._properties.childs().backgroundsColors)&&void 0!==e?e:null},t.prototype.textColorsProperty=function(){var e;return null!==(e=this._properties.childs().textsColors)&&void 0!==e?e:null},t.prototype.pointsProperty=function(){return this._pointsProperty},t.prototype.startMoving=function(e,t,i){this.isFixed()&&this.restoreFixedPoints(),this._startMovingPoint=e,this._properties.childs().lastUpdateTime.setValue((new Date).valueOf())},t.prototype.move=function(e,t,i){if(i&&(i.shiftOnly()||i.controlShift()))if(this.isFixed()){var n=this._alignScreenPointHorizontallyOrVertically(Object(o.ensureDefined)(e.screen));this._currentMovingPoint={screen:n}}else{var r=this._alignPointHorizontallyOrVertically(Object(o.ensureDefined)(e.logical));this._currentMovingPoint={logical:r}}else this._currentMovingPoint=e;this.updateAllViews()},t.prototype.endMoving=function(e){var t=!1,i=!1;if(this._currentMovingPoint&&this._startMovingPoint){ if(this.isFixed())this._correctFixedPoints(this._fixedPoints);else{var n=Object(o.ensureDefined)(this._currentMovingPoint.logical),r=Object(o.ensureDefined)(this._startMovingPoint.logical);if(t=n.index!==r.index,i=n.price!==r.price,this._correctPoints(this._points)){s.emit("drawing_event",this._id,"move");for(var a=0;a=0;--n)i.push(t[n]);return i},t.prototype.start=function(){this.createServerPoints()},t.prototype.pointAdded=function(){return this._pointAdded},t.prototype.pointChanged=function(){return this._pointChanged},t.prototype.restoreExternalPoints=function(e,t){if(this._timePoint=Object(v.deepCopy)(e.points),t.indexesChanged){if(this.properties().interval.setValue(e.interval),!this.isActualSymbol())return this._clearServerPoints(),void this._normalizedPointsChanged.fire();this.createServerPoints()}else{ for(var i=Math.min(this._points.length,e.points.length),n=0;nc[0].price?(r=i,o=c):c[0].price>i[0].price||c[1].price>i[1].price?(r=c,o=i):(r=i,o=c);var u=this.properties().extendLeft.value(),h=this.properties().extendRight.value();return e.index<=t.index?(s=u,a=h):(s=h,a=u),[this._linePointsToAlertPlot(r,"Upper",s,a),this._linePointsToAlertPlot(o,"Lower",s,a)]},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("vm8R").GeneralTrendFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o.createProperties=function(e){var t=new r("linetooldisjointangle",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},t.LineToolDisjointChannel=o},oNDq:function(e,t,i){"use strict";i.r(t),i.d(t,"createConfirmDialog",(function(){return o}));var n=i("mrSG"),r=i("YFKU");function o(e){var t={actions:[{key:13,name:"yes",text:r.t("Yes"),type:"success"},{method:"close",name:"no",text:r.t("No"),type:"default"}],actionsWrapTemplate:'
',content:r.t("Are you sure?"),contentWrapTemplate:'

',destroyOnClose:!0,title:r.t("Confirmation"),width:400,dataset:{"dialog-type":"confirm-dialog"}};return new Promise((function(r){Promise.all([i.e("dialogs-core"),i.e(57),i.e(0),i.e(18),i.e("create-dialog")]).then(function(o){var s=i("YDhE").createDialog;r(s(Object(n.a)(Object(n.a)({},t),e)))}.bind(null,i)).catch(void 0)}))}},oV8k:function(e,t,i){"use strict";i.r(t),i.d(t,"CustomSourceBase",(function(){return n}));var n=function(){function e(e,t){this._id=e,this._model=t}return e.prototype.id=function(){return this._id},e.prototype.isHoveredEnabled=function(){return!0},e.prototype.isSelectionEnabled=function(){ return!1},e.prototype.priceScale=function(){return null},e.prototype.paneViews=function(e){return[]},e.prototype.labelPaneViews=function(e){return[]},e.prototype.priceAxisViews=function(e,t){return[]},e.prototype.updateViewsForPane=function(e){e.containsMainSeries()&&this.updateAllViews()},e}()},oWyD:function(e,t,i){},oXaB:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"PriceAxisLastValueMode",(function(){return n})),function(e){e[e.LastPriceAndPercentageValue=0]="LastPriceAndPercentageValue",e[e.LastValueAccordingToScale=1]="LastValueAccordingToScale"}(n||(n={}))},ocLq:function(e,t,i){"use strict";(function(t){var n=i("5B3K").StudyError,r=i("Y7w9"),o=i("ogJP").inherit,s=i("E6p6").SessionStage,a=i("LxhU").Interval,l=i("OLhd").createDwmAligner,c=i("5fI3").decodeExtendedSymbol,u=i("5fI3").encodeExtendedSymbolOrGetSimpleSymbolString,h=function(){var e,h="undefined"!=typeof window?window:t,d=h.PineJsCalendar?h.PineJsCalendar:i("jCNj"),p=i("IiTo"),f=i("IDnv").extrapolateBarsFrontToTime,_={};function m(e,t,i,n,r){var o=r,s=0;if(isNaN(e.get(t-1)))return{index:NaN,value:NaN};for(var a=0;a1&&(this._currentIndex.set(o),this._currentValue.set(s),this._pivotIndex.set(a))}function y(e,t,i){this._deviation=e;var n=i.new_var(_.high(i)),r=i.new_var(_.low(i));n.get(2*t+1),r.get(2*t+1),this._pivotHigh=new v(t,t,v.HIGH,n,i),this._pivotLow=new v(t,t,v.LOW,r,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=_.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed;var o=this._lastIndex.get(1),s=this._lastVal.get(1),a=this._lastType.get(1);this._index>1&&this.addPivot(o,s,a),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function g(e){this.symbol=e,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0,this.varsAffectAdditionalDepth=!0}function b(e){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=e}function S(e){b.call(this,e),this.hist=new Float64Array(2e3),this.hist_pos=-1}function w(e,t,i,n,r){var o=c(e);const s="string"==typeof o.symbol?o:o.symbol;this.ticker=s.symbol,this.currencyCode=i||s["currency-id"];var l=s["currency-id"]!==this.currencyCode;s["currency-id"]=this.currencyCode,l&&(e=u(o)),this.tickerid=e;var h=a.parse(t);this.resolution=h.letter(),this.interval=h.multiplier(),this.period=h.value(),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 p.SessionInfo("Etc/UTC","24x7"),this.other_sessions={},this.script=n,this.bb_cache={},r&&this.set_symbolinfo(r)}function P(e,t,i,n,r,o,s,a,l){this.body=r, this.symbols=[],this.runner=n,this.inputCallback=s,this.out=o,this.nonseriesOut=a,this.ctx=new g(this.add_sym(e,t,i,l)),this.init()}function C(e){this.symbols=[],this.barsets=[],this.subscription=[],this.host=e,this.isRecalculated=!1,this.start()}function T(e){this.runner=new C(e)}function x(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0,this.firstLoadedTime=0!==this.bars.length?this.bars[0].time:1/0}function I(e,t){this.period=e,this.generateEmptyBars=!!t}function L(){}return _.max_series_default_size=10001,_.n=function(e){return e.symbol.index+1},_.nz=function(e,t){return t=t||0,isFinite(e)?e:t},_.na=function(e){return 0===arguments.length?NaN:isNaN(e)?1:0},_.isZero=function(e){return Math.abs(e)<=1e-10},_.toBool=function(e){return isFinite(e)&&!_.isZero(e)},_.eq=function(e,t){return _.isZero(e-t)},_.neq=function(e,t){return!_.eq(e,t)},_.ge=function(e,t){return _.isZero(e-t)||e>t},_.gt=function(e,t){return!_.isZero(e-t)&&e>t},_.lt=function(e,t){return!_.isZero(e-t)&&e(i||1e-10)},_.less=function(e,t,i){return t-e>(i||1e-10)},_.compare=function(e,t,i){return _.equal(e,t,i)?0:_.greater(e,t,i)?1:-1},_.max=Math.max,_.min=Math.min,_.pow=Math.pow,_.abs=Math.abs,_.log=Math.log,_.log10=function(e){return Math.log(e)/Math.LN10},_.sqrt=Math.sqrt,_.sign=function(e){return isNaN(e)?NaN:_.isZero(e)?0:e>0?1:-1},_.exp=Math.exp,_.sin=Math.sin,_.cos=Math.cos,_.tan=Math.tan,_.asin=Math.asin,_.acos=Math.acos,_.atan=Math.atan,_.floor=Math.floor,_.ceil=Math.ceil,_.round=Math.round,_.avg=function(e,t,i,n,r,o){if(2===arguments.length)return(e+t)/2;for(var s=0,a=0;a=0;--o){var s=t[o];if(!(s>=i.startOfBar(0))){i.moveTo(s);var a=t[o+1];n.push(a)}}n.reverse()}return n},_.iff=function(e,t,i){return _.not(e)?i:t},_.rising=function(e,t){for(var i=1;ie.get(0))return 0;return 1},_.falling=function(e,t){for(var i=1;i=0;r--){n+=(t-r)*e.get(r)}return 2*n/(t*(t+1))},_.vwma=function(e,t,i){var n=i.new_var(_.volume(i)),r=i.new_var(e.get(0)*_.volume(i));return _.sma(r,t,i)/_.sma(n,t,i)},_.swma=function(e,t){return(e.get(0)+2*e.get(1)+2*e.get(2)+e.get(3))/6},_.lowestbars=function(e,t,i){return-m(e,t,0,(function(e,t){return _.lt(e,t)}),Number.MAX_VALUE).index},_.lowest=function(e,t,i){return m(e,t,0,(function(e,t){return _.lt(e,t)}),Number.MAX_VALUE).value},_.highestbars=function(e,t,i){return-m(e,t,0,(function(e,t){return _.gt(e,t)}),Number.MIN_VALUE).index},_.highest=function(e,t,i){return m(e,t,0,(function(e,t){return _.gt(e,t) }),Number.MIN_VALUE).value},_.cum=function(e,t){var i=t.new_var(),n=_.nz(i.get(1))+e;return i.set(n),n},_.accdist=function(e){var t=_.high(e),i=_.low(e),n=_.close(e),r=_.volume(e);return _.cum(n===t&&n===i||t===i?0:r*(2*n-i-t)/(t-i),e)},_.correlation=function(e,t,i,n){var r=_.sma(e,i,n),o=_.sma(t,i,n),s=n.new_var(e.get()*t.get());return(_.sma(s,i,n)-r*o)/Math.sqrt(_.variance2(e,r,i)*_.variance2(t,o,i))},_.stoch=function(e,t,i,n,r){var o=_.highest(t,n),s=_.lowest(i,n);return _.fixnan(100*(e.get()-s)/(o-s),r)},_.tsi=function(e,t,i,n){var r=n.new_var(_.change(e)),o=n.new_var(_.abs(_.change(e))),s=n.new_var(_.ema(r,i,n)),a=n.new_var(_.ema(o,i,n));return _.ema(s,t,n)/_.ema(a,t,n)},_.cross=function(e,t,i){if(isNaN(e)||isNaN(t))return!1;var n,r=i.new_var((n=e-t)<0?-1:0===n?0:1);return!isNaN(r.get(1))&&r.get(1)!==r.get()},_.linreg=function(e,t,i){for(var n=0,r=0,o=0,s=0,a=0;a2&&(T=Math.min(T,b))):(T=Math.max(T,S),_.n(n)>2&&(T=Math.max(T,w))),p.set(T),T},_.alma=function(e,t,i,n){for(var r=Math.floor(i*(t-1)),o=t/n*(t/n),s=[],a=0,l=0;lthis._currentValue.get():ithis._areaRight},v.prototype.update=function(){if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(-1===this._pivotIndex.get()){for(var e=!0,t=0;tthis._deviation&&this.addPivot(e,t,i);else(i===v.HIGH?t>n:t0&&i.set(e),i},g.prototype.new_unlimited_var=function(e){var t=this.vars;t.length<=this.vars_index&&t.push(new S(this.symbol));var i=t[this.vars_index++];return arguments.length>0&&i.set(e),i},g.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new g(this.symbol)),this.ctx[this.ctx_index++]},g.prototype.prepare=function(e){this.ctx_index=0,this.vars_index=0 ;for(var t=0;te&&(e=i)}return e},g.prototype.stop=function(){this.symbol=null,this.vars=null},b.prototype.valueOf=function(){return this.get(0)},b.prototype.get=function(e){return isNaN(e)&&(e=0),e=e||0,this.hist?e>=this.hist.length?(console.error("not enough depth: "+this),NaN):this._get(e):(this.mindepth=_.max(this.mindepth,e),NaN)},b.prototype._get=function(e){var t=this.hist_pos-e;return t<0&&(t+=this.hist.length),this.hist[t]},b.prototype.set=function(e){this.hist&&(this.hist[this.hist_pos]=e,this.modified=!0)},b.prototype.prepare=function(e){e===this.symbol&&(e.isNewBar?(this.original=this.get(0),!this.modified&&this.hist||this.add_hist()):this.set(this.original),this.modified=!1)},b.prototype.add_hist=function(){if(!this.hist){var e=_.na(this.mindepth)?_.max_series_default_size:_.max(this.mindepth+1,1);e=Math.round(e);for(var t=new Array(e),i=0;i=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),this.time=t,this.open=e.open,this.high=e.high,this.low=e.low,this.close=e.close,this.volume=e.volume,this.updatetime=e.updatetime,this.isNewBar=i,this.isBarClosed=e.isBarClosed,this.isLastBar=e.isLastBar,this.isNewBar&&(this.index++,this.isFirstBar=0===this.index),this.script.calc(this)}},P.prototype.calc=function(e){var t=this.ctx,i=this.body;t.prepare(e);var n=i.main(t,this.inputCallback,e);if(n&&"composite"===n.type)for(let r=0;r1&&r.enable_dwm_aligning(this.symbols[0].session,r.session),r},P.prototype.maxAdditionalDepth=function(){return this.ctx.maxAdditionalDepth()},P.prototype.stop=function(){this.symbols=null,this.ctx.stop(),this.ctx=null},P.prototype.get_sym=function(e){return this.symbols[e]},C.prototype.add_sym=function(e,t,i,n,r){var o=new w(e,t,i,n,r);return this.symbols.push(o),o},C.prototype.get_sym=function(e){return this.symbols[e]},C.prototype.out=function(e,t){if(this.nonseriesUpdate){var i=Object.assign({},this.nonseriesUpdate);t.splice(0,0,e.time),i.lastBar=t,this.host.nonseriesOut(e,i)}else this.host.out(e,t)},C.prototype.start=function(){var e=this.host;this._script=new P(e.tickerid,e.period,e.currencyCode,this,e.body,this.out.bind(this),e.input,e.nonseriesOut,e.symbolInfo);var t=this,i=[],n=this.symbols,r=Object.assign({},e.dataRange,{countBack:e.dataRange.countBack+t._script.maxAdditionalDepth()}),o=n[0];function s(t,n,r){i.push(C.feed.subscribe(t.tickerid,t.currencyCode,t.period,r,e.onErrorCallback,e.symbolInfo,e.sessionId,n,e.forceAlignBars))}function c(i,n){"series"===(n.nonseries?"nonseries":"series")?t.update(i,n):n.lastBar?(t.nonseriesUpdate=n,n.lastBar.isLastBar=!0,t.symbols[0].lastbar(n.lastBar),t.nonseriesUpdate=null):e.nonseriesOut(d,n)}function u(){return r}s(o,u,(function(e){!e.nonseries&&Number.isFinite(e.firstLoadedTime)&&function(e){function t(t,i){var n=e,r=l(t,i);return null!==r&&(n=r.timeToExchangeTradingDay(n)),{to:n,countBack:0}}for(var i=1;i=0;i--)for(var n=e[i],r=this.barsets[i],o=r.count(),s=0;s=0;i--){var n=this._chartModel.restoreSource(this._restorePanes[i],this._paneIndexes[i],this._paneStates[i],this._sourceStates[i],this._priceScalePositionIds[i]);t.push(n)}t.some((function(i,n){return i.id()!==e._sourceIds[t.length-n-1]}))&&h.logError("Source was restored improperly - source ids does not match"),null!==this._initialPriceScaleMode&&Object(r.ensureNotNull)(t[0].priceScale()).setMode(this._initialPriceScaleMode),this._excludeLineToolsUndoCommands.forEach((function(e){return e.undo()}))},t}(o.UndoCommand)}, odCa:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("fgLi").DataSource,o=i("tc+8"),s=i("Ocx9").DefaultProperty,a=i("jTis").CalloutConsts,l=i("j3hX").LineToolColorsProperty;function c(e,t){var r=t||c.createProperties();n.call(this,e,r),this._barOffset=0,this._timeScale=e.timeScale(),i.e("lt-pane-views").then(function(e){var t=i("B4Hi").CalloutPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(c,n),c.prototype.pointsCount=function(){return 2},c.prototype.name=function(){return"Callout"},c.prototype._correctPoints=function(e){var t=this._currentMovingPoint.logical.index-this._startMovingPoint.logical.index,i=this._currentMovingPoint.logical.price-this._startMovingPoint.logical.price,n=e[1];n.index+=t,n.price+=i,e[1]=n},c.prototype.addPoint=function(e){var t=n.prototype.addPoint.call(this,e);return t&&this._calculateBarOffset(),t},c.prototype._calculateBarOffset=function(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)},c.prototype.setLastPoint=function(e){n.prototype.setLastPoint.call(this,e),2===this.points().length&&this._calculateBarOffset()},c.prototype.setPoint=function(e,t){switch(e){case 0:n.prototype.setPoint.call(this,e,t),this._calculateBarOffset();break;case 1:var i=this.properties();if(!i.wordWrapWidth)return;var r=this._points,o=this._dragStartLeftEdgeIndex,s=Math.round((t.index-o)/2);if(isFinite(o)&&isFinite(s)){r[1]={index:o+s,price:r[1].price},this._calculateBarOffset(),this.normalizePoints();var l=this._timeScale.indexToCoordinate(o+2*s)-this._timeScale.indexToCoordinate(o)-a.RoundRadius-a.TextMargins;if(!isFinite(l))return;i.wordWrapWidth.setValue(Math.max(a.MinWidth,l));break}r[1]=t,this._calculateBarOffset(),this.normalizePoints()}},c.prototype.setPoints=function(e){n.prototype.setPoints.call(this,e);var t=this.properties();if(t.wordWrapWidth){var i=this._dragStartLeftEdgeIndex,r=Math.round((e[1].index-i)/2);if(this._calculateBarOffset(),this.normalizePoints(),isFinite(i)&&isFinite(r)){var o=this._timeScale.indexToCoordinate(i+2*r)-this._timeScale.indexToCoordinate(i)-a.RoundRadius-a.TextMargins;if(!isFinite(o))return;t.wordWrapWidth.setValue(Math.max(a.MinWidth,o))}}},c.prototype._onPointsetUpdated=function(e){n.prototype._onPointsetUpdated.call(this,e),0!==e.length&&(this._dragStartLeftEdgeIndex=this.points()[1].index)},c.prototype.move=function(e,t,i){n.prototype.move.call(this,e,t,i),this._calculateBarOffset()},c.prototype.state=function(e){var t=n.prototype.state.call(this,e);return t.barOffset=this._barOffset,t},c.prototype.restoreData=function(e){e.barOffset?this._barOffset=e.barOffset:this._calculateBarOffset(),this._calculatePoint2()},c.prototype.setPriceScale=function(e){r.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&this._calculatePoint2()},c.prototype.template=function(){var e=n.prototype.template.call(this);return e.text=this.properties().childs().text.value(),e},c.prototype._applyTemplateImpl=function(e){n.prototype._applyTemplateImpl.call(this,e), this.properties().childs().text.setValue(e.text)},c.prototype._calculatePoint2=function(){if(!(this._model.lineBeingEdited()===this||this._model.sourcesBeingMoved().includes(this)||this._points.length<2)){var e=this.points()[0],t=this.points()[1];this._points[1]={price:t.price,index:e.index+this._barOffset}}},c.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("xhf0").CalloutDefinitionsViewModel}.bind(null,i)).catch(i.oe)},c.createProperties=function(e){var t=new s("linetoolcallout",e);return c._configureProperties(t),t},c._configureProperties=function(e){n._configureProperties(e),e.hasChild("text")||e.addChild("text",new o(window.t("Text"))),e.addExclusion("text"),e.addChild("textsColors",new l([e.childs().color]))},t.LineToolCallout=c},oiZD:function(e,t,i){"use strict";i.r(t);var n=i("hY0g"),r=i.n(n);i.d(t,"watchedTheme",(function(){return o})),i.d(t,"setTheme",(function(){return s}));var o=new r.a;function s(e){o.setValue(e)}o.subscribe((function(e){!function(e,t){void 0===t&&(t=window);for(var i="theme-"+e,n=t.document.documentElement.classList,r=0,o=Array.from(n);rt)return{success:!1};if(e===t)return{success:!0,result:0};var i=this._extrapolatedData.length,n=0!==i?this._extrapolatedData[0]:null,o=null!==n?this._extrapolatedData[i-1]:null,s=eo){var a=Object(r.extrapolateBarsFrontToTime)(this._barBuilder(),o||1e3*e,1e3*t,2e3,!0);this._extrapolatedData=this._extrapolatedData.concat(a.times),i=this._extrapolatedData.length,this._cacheForFuture=s}if((o=this._extrapolatedData[i-1])<1e3*t)return{success:!1};var l=this._extrapolatedData.indexOf(1e3*t);return-1===l?{success:!1}:{success:!0,result:l}},e.prototype.projectTime=function(e,t){if(!this.isValid())return e;var i=this._extrapolatedData.length,n=i>0?this._extrapolatedData[0]:null,o=null!==n?this._extrapolatedData[i-1]:null,s=t>=0;1e3*e===n&&this._cacheForFuture===s||(this._extrapolatedData=[1e3*e],i=1,n=null,o=null);var a=Math.abs(t);if(null===n||a>=i){ var l=Object(r.extrapolateBarsFrontByCount)(this._barBuilder(),o||1e3*e,Math.sign(t)*(a-i+1),!0);this._extrapolatedData=this._extrapolatedData.concat(l.times),i=this._extrapolatedData.length,this._cacheForFuture=s}return ii.zorder()}));if(0===n.length)throw new Error("Cannot bring forward source that alreadt on back");var r=n[0];if(Object(v.isLineTool)(r)){var o=e.model().lineToolsGroupModel().groupForLineTool(r);if(null!==o){var s=o.lineTools();r=s[s.length-1]}}return r}var N=function(e){function t(t,i,n){return e.call(this,t,n,R(i,n),"Send "+n[0].title()+" backward")||this}return Object(n.c)(t,e),t}(A);function j(e,t){return Object(r.ensureNotNull)(e.paneForSource(t.lineTools()[0]))}var F=function(e){function t(t,i){return e.call(this,t,i.lineTools(),D(j(t,i),i.lineTools()),"Send Group "+i.name()+" backward")||this}return Object(n.c)(t,e),t}(E),W=function(e){function t(t,i){return e.call(this,t,i.lineTools(),R(j(t,i),i.lineTools()),"Bring Group "+i.name()+" backward")||this}return Object(n.c)(t,e),t}(A),H=i("ogJP"),z=function(e){function t(t,i,n){var r=e.call(this,"Rearrange panes")||this;return r._chartModel=t,r._index=i,Object(H.isNumber)(n)?r._dstIndex=n:r._dstIndex="up"===n?i-1:i+1,r}return Object(n.c)(t,e),t.prototype.redo=function(){this._checkIndices()&&this._chartModel.movePane(this._index,this._dstIndex)},t.prototype.undo=function(){this._checkIndices()&&this._chartModel.movePane(this._dstIndex,this._index)},t.prototype._checkIndices=function(){var e=this._chartModel.panes().length;return this._index>=0&&this._index=0&&this._dstIndext.zorder()?e:t}),i[0]),o=n,s=t.lineToolsGroupModel().groupForLineTool(n);if(null!==s){var a=s.lineTools();o=a[a.length-1]}this._environment.beginUndoMacro(ce);var l=new Map,c=new Set;i.forEach((function(i){var n=e._groupForLineTool(i);if(null!==n){var o=l.get(n)||[];o.push(i),l.set(n,o);var s=Object(r.ensureNotNull)(t.paneForSource(i));c.add(s)}})),Object(r.assert)(c.size<=1,"All selected sources should be on the same pane"),l.forEach((function(i,n){var r=new b.a(t,n,i);e._environment.pushUndoCommand(r)}));var u=new ne(t,Object(C.sortSources)(i));this._environment.pushUndoCommand(u);var h=new k(t,i,o);this._environment.pushUndoCommand(h), this._environment.endUndoMacro();var d=Object(r.ensureNotNull)(u.createdGroupId());return Object(r.ensureNotNull)(t.lineToolsGroupModel().groupForId(d))},e.prototype.removeGroup=function(e){var t=this._environment.model(),i=e.lineTools();this._environment.beginUndoMacro(ue.format({name:e.name()}));var n=new te(t,e,"");this._environment.pushUndoCommand(n);var o=new g.RemoveSourcesCommand(t,i,"");this._environment.pushUndoCommand(o),i.forEach((function(e){null!==e.getLinkKey()&&Object(le.removeLineTool)({model:t,linkKey:Object(r.ensureNotNull)(e.getLinkKey())})})),this._environment.endUndoMacro()},e.prototype.groups=function(){return this._environment.model().lineToolsGroupModel().groups()},e.prototype.excludeLineToolFromGroup=function(e,t){var i=this._environment.model(),n=new b.a(i,e,[t]);this._environment.pushUndoCommand(n)},e.prototype.addLineToolToGroup=function(e,t){var i=this._environment.model(),n=i.lineToolsGroupModel().groupForLineTool(t);if(n!==e){var r=he.format({lineTool:t.title(),name:e.name()});this._environment.beginUndoMacro(r),null!==n&&this._environment.pushUndoCommand(new b.a(i,n,[t])),this._environment.pushUndoCommand(new oe(i,e,[t])),this._environment.endUndoMacro()}},e.prototype.bringToFront=function(e){var t=this._environment.model(),i=new O(t,e.lineTools());this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.sendToBack=function(e){var t=this._environment.model(),i=new M(t,e.lineTools());this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.bringForward=function(e){var t=this._environment.model(),i=new W(t,e);this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.sendBackward=function(e){var t=this._environment.model(),i=new F(t,e);this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.insertAfter=function(e,t){var i,n=this._environment.model();if(t instanceof ee.a){var r=t.lineTools();i=r[r.length-1]}else i=t;var o=new k(n,e.lineTools(),i);this._environment.pushUndoCommand(o),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.insertBefore=function(e,t){var i,n=this._environment.model();t instanceof ee.a?i=t.lineTools()[0]:i=t;var r=new V(n,e.lineTools(),i);this._environment.pushUndoCommand(r),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.availableZOrderOperations=function(e){var t=this._environment.model(),i=e.lineTools(),n=i[0],o=i[i.length-1],s=Object(r.ensureNotNull)(t.paneForSource(i[0])).sourcesByGroup().allExceptSpecialSources(),a=s[0],l=s[s.length-1];return{bringForwardEnabled:o!==l,bringToFrontEnabled:o!==l,sendBackwardEnabled:n!==a,sendToBackEnabled:n!==a}},e.prototype.setGroupVisibility=function(e,t){var i=this,n=(t?de:pe).format({group:e.name()}),r=this._environment.model();this._environment.beginUndoMacro(n),e.lineTools().forEach((function(e){var n=e.properties().visible,o=new se.SetPropertyUndoCommand(n,t,"",r) ;i._environment.pushUndoCommand(o)})),this._environment.endUndoMacro()},e.prototype.setGroupLock=function(e,t){var i=this,n=(t?fe:_e).format({group:e.name()}),r=this._environment.model();this._environment.beginUndoMacro(n),e.lineTools().forEach((function(e){var n=e.properties().frozen,o=new se.SetPropertyUndoCommand(n,t,"",r);i._environment.pushUndoCommand(o)})),this._environment.endUndoMacro()},e.prototype.setGroupName=function(e,t){var i=this._environment.model(),n=me.format({group:e.name(),newName:t}),r=new ae(i,e,t,n);this._environment.pushUndoCommand(r)},e.prototype.canBeGroupped=function(e){var t=this._environment.model();return new Set(e.map((function(e){return t.paneForSource(e)}))).size<=1},e.prototype._groupForLineTool=function(e){return this._environment.model().lineToolsGroupModel().groups().find((function(t){return t.containsLineTool(e)}))||null},e}(),ye=i("3ClC"),ge=i("pQ+n"),be=window.t("Apply study template {template}"),Se=function(e){function t(t,i,n){var r=e.call(this,be.format({template:n}))||this;return r._model=t,r._templateContent=i,r._initialState=t.studyTemplate(!0,!0),r._initialGroupsState=t.lineToolsGroupModel().state(),r}return Object(n.c)(t,e),t.prototype.redo=function(){var e=this._merge(this._templateContent).filter(v.isLineTool);this._model.lineToolsGroupModel().removeLineTools(e),this._model.mainSeries().onChartStyleChanged();var t=this._model.mainSeries().properties();Object(q.preparePriceAxisProperties)(t),this._model.recalcVisibleRangeStudies(!0),this._model.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){this._merge(this._initialState),this._model.mainSeries().onChartStyleChanged()},t.prototype._merge=function(e){var t=this._model,i=t.mainSeries(),o=i.id();if(i.priceScale().properties().childs().lockScale.setValue(!1),this._initialState.symbol&&e.symbol&&i.properties().symbol.setValue(e.symbol),this._initialState.symbol&&e.interval){var s=Object(q.getChartStyleByResolution)(e.interval,i.properties().style.value());i.setChartStyleWithIntervalIfNeeded(s,e.interval)}for(var a=t.panes(),l=[],c=a.length;c--;)for(var u=(b=a[c]).containsMainSeries(),h=(I=b.dataSources()).length;h--;){var d=I[h];(!u||Object(ye.isStudy)(d)&&d.isRemovedByStudyTemplates())&&l.push(d)}t.resetDeferredStudies();for(var p=Object(ge.a)(t,l),f=0;f-1,b=g?a[c]:t.createPane(c);if(g){var S=b.getZOrderMinMax(),w=y.sources[m],P=y.sources.slice(0,m);for(f=0;f1?"Remove drawings group":"Remove "+e[0].title();this.removeSources(e,!1,t)}},t.prototype.removeSources=function(e,t,i,n){var o=this;n||(e=e.filter((function(e){return e.isUserDeletable()})));var s=this._model(),a=s.lineToolsGroupModel();this.beginUndoMacro(i),s.selectionMacro((function(n){var l=new Map;e.forEach((function(e){if(Object(v.isLineTool)(e)){var t=a.groupForLineTool(e);if(null!==t){var i=l.get(t)||[];i.push(e),l.set(t,i)}null!==e.getLinkKey()&&Object(le.removeLineTool)({model:o.model(),linkKey:Object(r.ensureNotNull)(e.getLinkKey())})}})),l.forEach((function(e,t){var i=new b.a(s,t,e);o._pushUndoCommand(i)}));var c=new g.RemoveSourcesCommand(s,e,i),u=c.removedIds();o._pushUndoCommand(c),!t&&u.length>0&&(1===u.length?o.emitEvent("removeSource",[u[0]]):o.emitEvent("removeSources",[u]))})),this.endUndoMacro()},t.prototype.mergeSourceUp=function(e){var t=new P.c(this._model(),e,"Merge up");this._mergeUnmergeSource(e,t)},t.prototype.mergeSourceDown=function(e){var t=new P.a(this._model(),e,"Merge down");this._mergeUnmergeSource(e,t)},t.prototype.mergeToPane=function(e,t){var i=this._model().panes().indexOf(t),n=new P.b(this._model(),e,i,"Merge to pane");this._mergeUnmergeSource(e,n)},t.prototype.unmergeSourceUp=function(e){var t=new w.c(this._model(),e,"Unmerge up");this._mergeUnmergeSource(e,t)},t.prototype.unmergeSourceDown=function(e){var t=new w.a(this._model(),e,"Unmerge down");this._mergeUnmergeSource(e,t)},t.prototype.unmergeToNewBottomPane=function(e){var t=new w.b(this._model(),e,"Unmerge to new bottom pane");this._mergeUnmergeSource(e,t)},t.prototype.availableZOrderOperations=function(e){var t=this._model().lineToolsGroupModel(),i=e.filter(v.isLineTool),n=i.map((function(e){return t.groupForLineTool(e)}));Object(r.assert)(new Set(n).size<=1,"Cannot move line tools from different group");for(var o=0===n.length?null:n[0],s={bringForwardEnabled:!1,bringToFrontEnabled:!1,sendBackwardEnabled:!1,sendToBackEnabled:!1},a=new Set(i),l=function(e){if(Object(v.isLineTool)(e)&&null!==o){var t=Object(C.sortSources)(o.lineTools().filter((function(t){return!a.has(t)||t===e})));return s=Ue(s,{bringForwardEnabled:e!==t[t.length-1],bringToFrontEnabled:e!==t[t.length-1],sendBackwardEnabled:e!==t[0],sendToBackEnabled:e!==t[0]}),"continue"}var i=Object(r.ensureNotNull)(c._model().paneForSource(e)).sourcesByGroup().allExceptSpecialSources();if(0===i.length)return"continue";var n=e.zorder(),l=i[0].zorder(),u=i[i.length-1].zorder();s=Ue(s,{bringForwardEnabled:n!==u,bringToFrontEnabled:n!==u,sendBackwardEnabled:n!==l,sendToBackEnabled:n!==l})},c=this,u=0,h=Object(C.sortSources)(e);u20&&(this._pushUndoCommand(new U.a(this.model(),this._initialTimeScrollState,"Scroll Time")),this._initialTimeScrollPos=null,this._initialTimeScrollState=null,t=!0),this.model().scrollTimeTo(e),t},t.prototype.endScrollTime=function(){this.model().endScrollTime(),this._initialTimeScrollPos=null,this._initialTimeScrollState=null},t.prototype.startScaleTime=function(e){var t=this.timeScale(),i={rightOffset:t.rightOffset(),barSpacing:t.barSpacing()};this._pushUndoCommand(new U.a(this.model(),i,"Scale Time")),this.model().startScaleTime(e)},t.prototype.scaleTimeTo=function(e){this.model().scaleTimeTo(e)},t.prototype.endScaleTime=function(){this.model().endScaleTime()},t.prototype.resetTimeScale=function(){var e=this.timeScale(),t={rightOffset:e.rightOffset(),barSpacing:e.barSpacing()};this._pushUndoCommand(new U.a(this.model(),t,"Reset Time Scale")),this.model().resetTimeScale()},t.prototype.rearrangePanes=function(e,t){var i=new z(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.movePane=function(e,t){var i=new z(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.pasteSourceFromClip=function(e,t,i){var n=t||Object(I.get)();if(!n||0===n.sources.length)return null;var o=e||Object(r.ensureNotNull)(this.model().paneForSource(this.mainSeries()));if(!n.sources.some((function(e){return"drawing"!==e.type||null!==o.clipboardLineToolOwnerSource(e.source.id)})))return null;this.beginUndoMacro("Paste "+n.title);for(var s=0,a=[],l=0,c=n.sources;l0&&(c[0].x===c[1].x?Object(u.drawVerticalLine)(e,Math.round(c[0].x*n),c[0].y*n,c[1].y*n):c[0].y===c[1].y?Object(u.drawHorizontalLine)(e,Math.round(c[0].y*n),c[0].x*n,c[1].x*n):Object(l.drawLine)(e,c[0].x*n,c[0].y*n,c[1].x*n,c[1].y*n)),i.overlayLineEndings&&this._drawEnds(e,a,i.linewidth,n)}},e.prototype.hitTest=function(e,t){var i=this._data;if(null===i)return null;if("points"in i&&i.points.length<2)return null;if("floatPoints"in i&&i.floatPoints.length<2)return null;var n=Object(o.lastEventIsTouch)()?24:3,s="floatPoints"in i?i.floatPoints:i.points,a=s[0],l=s[1],c=this._extendAndClipLineSegment(a,l,t);if(null!==c&&Object(r.distanceToSegment)(c[0],c[1],e).distance<=n)return this._hittest;return null},e.prototype._extendAndClipLineSegment=function(e,t,i){var r=Object(n.ensureNotNull)(this._data);return Object(c.extendAndClipLineSegment)(e,t,i.cssWidth,i.cssHeight,r.extendleft,r.extendright)},e.prototype._drawEnds=function(e,t,i,r){var o=t[0],a=t[1],l=Object(n.ensureNotNull)(this._data);switch(l.leftend){case s.LineEnd.Arrow:d(a,o,e,i,r);break;case s.LineEnd.Circle:h(o,e,i,Object(n.ensureDefined)(l.endstyle),r)}switch(l.rightend){case s.LineEnd.Arrow:d(o,a,e,i,r);break;case s.LineEnd.Circle:h(a,e,i,Object(n.ensureDefined)(l.endstyle),r)}},e}()},pKDv:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolABCD",(function(){return l}));var n=i("mrSG"),r=i("Eyy1"),o=i("Ocx9"),s=i("Ss5c"),a=i("j3hX"),l=function(e){function t(n,r){var o=this,s=r||t.createProperties();return o=e.call(this,n,s)||this,i.e("lt-pane-views").then(i.bind(null,"bFMU")).then((function(e){o._setPaneViews([new e.ABCDPaneView(o,n)])})),o}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 4},t.prototype.name=function(){return"ABCD Pattern"},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.createProperties=function(e){var i=new o.DefaultProperty("linetoolabcd",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"aMeN")).then((function(e){return e.PatternWithoutBackgroundDefinitionsViewModel}))},t._configureProperties=function(e){s.LineDataSource._configureProperties(e),e.addChild("linesColors",new a.LineToolColorsProperty([Object(r.ensureDefined)(e.child("color"))])),e.addChild("textsColors",new a.LineToolColorsProperty([Object(r.ensureDefined)(e.child("textcolor"))]))},t}(s.LineDataSource)},pOzK:function(e,t,i){"use strict";i.r(t),i.d(t,"SetPriceScaleModeCommand",(function(){return o}));var n=i("mrSG"),r=i("Ocx9"),o=function(e){function t(t,i,n,r){var o=e.call(this,n)||this;return o._newMode=t,o._priceScale=i,o._model=r,o._oldMode=i.mode(),o}return Object(n.c)(t,e),t.prototype.redo=function(){this._applyMode(this._newMode)},t.prototype.undo=function(){this._applyMode(this._oldMode)},t.prototype._applyMode=function(e){Object(r.saveDefaultProperties)(!0),this._priceScale.setMode(e),Object(r.saveDefaultProperties)(!1), this._model&&(this._model.recalculateAllPanes(),this._model.lightUpdate())},t}(i("RDU5").UndoCommand)},pPtI:function(e,t,i){"use strict";i.r(t),i.d(t,"normalizeIntervalString",(function(){return m})),i.d(t,"isAvailable",(function(){return v})),i.d(t,"setLastUsedResolution",(function(){return y})),i.d(t,"getRangeResolution",(function(){return g})),i.d(t,"getTimeBasedResolution",(function(){return b})),i.d(t,"getDefaultResolution",(function(){return S})),i.d(t,"getResolutionByChartStyle",(function(){return w})),i.d(t,"getServerInterval",(function(){return P})),i.d(t,"isResolutionMultiplierValid",(function(){return C})),i.d(t,"getMaxResolutionValue",(function(){return x})),i.d(t,"getResolutionsFromSettings",(function(){return I})),i.d(t,"convertResolutionsFromSettings",(function(){return L})),i.d(t,"mergeResolutions",(function(){return O})),i.d(t,"sortResolutions",(function(){return M})),i.d(t,"getCustomResolutions",(function(){return E})),i.d(t,"getTranslatedResolution",(function(){return V})),i.d(t,"getTranslatedResolutionModel",(function(){return D}));i("bSeV"),i("YFKU");var n,r,o,s=i("LxhU"),a=i("n5al"),l=i("Vdly"),c=i("PT1i"),u=i("IVMC"),h=i.n(u),d=i("ogJP"),p=((n={})[s.ResolutionKind.Ticks]=1,n[s.ResolutionKind.Seconds]=60,n[s.ResolutionKind.Minutes]=1440,n[s.SpecialResolutionKind.Hours]=24,n[s.ResolutionKind.Days]=365,n[s.ResolutionKind.Weeks]=52,n[s.ResolutionKind.Months]=12,n[s.ResolutionKind.Range]=1e5,n[s.ResolutionKind.Invalid]=NaN,n),f=((r={})[s.ResolutionKind.Ticks]=0,r[s.ResolutionKind.Seconds]=1,r[s.ResolutionKind.Minutes]=2,r[s.SpecialResolutionKind.Hours]=3,r[s.ResolutionKind.Days]=4,r[s.ResolutionKind.Weeks]=5,r[s.ResolutionKind.Months]=6,r[s.ResolutionKind.Range]=7,r[s.ResolutionKind.Invalid]=8,r),_=((o={})[s.ResolutionKind.Invalid]="",o[s.ResolutionKind.Ticks]=window.t("T",{context:"interval_short"}),o[s.ResolutionKind.Seconds]=window.t("s",{context:"interval_short"}),o[s.ResolutionKind.Minutes]=window.t("m",{context:"interval_short"}),o[s.SpecialResolutionKind.Hours]=window.t("h",{context:"interval_short"}),o[s.ResolutionKind.Days]=window.t("D",{context:"interval_short"}),o[s.ResolutionKind.Weeks]=window.t("W",{context:"interval_short"}),o[s.ResolutionKind.Months]=window.t("M",{context:"interval_short"}),o[s.ResolutionKind.Range]=window.t("R",{context:"interval_short"}),o);function m(e){return s.Interval.parse(e).value()}function v(e){var t=s.Interval.parse(e);var i=t.value(),n=c.linking.supportedResolutions.value();return void 0!==n?void 0!==n.find((function(e){return m(e)===i})):t.isSeconds()?Boolean(c.linking.seconds.value()):t.isTicks()?Boolean(c.linking.ticks.value()):t.isIntraday()?Boolean(c.linking.intraday.value()):t.isDWM()}function y(e){s.Interval.isValid(e)&&(s.Interval.isRange(e)?l.setValue("chart.lastUsedRangeResolution",e):l.setValue("chart.lastUsedTimeBasedResolution",e))}function g(e){var t=l.getValue("chart.lastUsedRangeResolution");if(void 0!==t&&s.Interval.isRange(t))return t;for(var i="100R",n=0,r=e;n0},oe.prototype.onTagsChanged=function(){return this._tagsChanged},oe.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},oe.prototype.onIntervalChanged=function(){return this._intervalChanged},oe.prototype.onStatusChanged=function(){return this._onStatusChanged},oe.prototype.onStyleChanged=function(){return this._onStyleChanged},oe.prototype.onRestarted=function(){return this._onRestarted},oe.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},oe.prototype.status=function(){return this._status},oe.prototype.isDWM=function(){if(null!==this._isDWMCached)return this._isDWMCached;var e=H.parse(this._properties.interval.value());if(e.isDWM())this._isDWMCached=!0;else{var t=e.isSeconds()?e.multiplier():60*e.multiplier();this._isDWMCached=!(t<216e3)}return this._isDWMCached},oe.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._priceLineView=this.hasClosePrice()?new Y(this):null ;var e=this._properties.style.value();switch(e){case oe.STYLE_BARS:this._paneView=new _(this,this.m_model);break;case oe.STYLE_CANDLES:this._paneView=new f(this,this.m_model);break;case oe.STYLE_LINE:this._paneView=new d(this,this.m_model);break;case oe.STYLE_AREA:this._paneView=new h(this,this.m_model);break;case oe.STYLE_HEIKEN_ASHI:this._paneView=new m(this,this.m_model);break;case oe.STYLE_HOLLOW_CANDLES:this._paneView=new p(this,this.m_model);break;case oe.STYLE_BASELINE:this._paneView=new v(this,this.m_model),this._waterlineView=new g(this);break;case oe.STYLE_HILO:this._paneView=new y(this,this.m_model)}if(null===this._paneView)throw Error("Unknown chart style assigned: "+e)},oe.prototype._clearStylePlot=function(e,t){if(0!==e.size()){var i=t||o(e.firstIndex()),n=o(e.lastIndex())+1;e.range(i,n).each((function(e,t){t[TradingView.STYLE_PLOT]=null}))}},oe.prototype.invalidateBarStylesCache=function(e){D.logDebug("Invalidate style cache starting from "+e),this._clearStylePlot(this.m_data.m_bars,e),this._clearStylePlot(this.m_data.m_nsBars)},oe.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},oe.prototype.barColorer=function(){if(this._barColorerCache)return this._barColorerCache;for(var e=null,t=this.m_model.dataSources().length-1;t>=0;t--){var i=this.m_model.dataSources()[t];if(i.metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()){var n=i.barColorer();null===e?e=n:e.pushBackBarColorer(n)}}return null===e?e=new w(this):e.pushBackBarColorer(new w(this)),this._barColorerCache=e,this._barColorerCache},oe.prototype.properties=function(){return this._properties},oe.prototype._barsState=function(e){var t=e.state();return t.data.forEach((function(e){e.value.splice(7,1)})),t},oe.prototype.state=function(e){var t={type:this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),zorder:this.zorder(),haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle};return this._symbolInfo&&this._symbolInfo.ticker&&(t.state.symbol=this._symbolInfo.ticker),e&&(t.bars=this._barsState(this.m_data.m_bars),t.nsBars=this._barsState(this.m_data.m_nsBars),t.symbolInfo=this._symbolInfo,t.rtPrice=this.data().lastProjectionPrice),t.boxSize=this.data().boxSize,t.reversalAmount=this.data().reversalAmount,t},oe.prototype.restoreState=function(e,t){t&&this._setStatus(oe.STATUS_SNAPSHOT),this._properties.mergeAndFire(e.state),this._prevChartStyle=this.properties().style.value(),this.createPaneView(),t&&this.restoreData(e.bars,e.nsBars,e.symbolInfo,e.rtPrice,e.boxSize,e.reversalAmount)},oe.prototype.hasStateForAlert=function(){return!1},oe.prototype.stateForAlert=function(){throw new Error("Not implemented")},oe.prototype.idForAlert=function(){return s.prototype.idForAlert.call(this)},oe.prototype.restoreData=function(e,t,i,n,r,o){this._status=oe.STATUS_SNAPSHOT, this.m_data.m_bars.restoreState(e),this.m_data.m_nsBars.restoreState(t),this.updateSymbolInfo(i,!1),this.m_data.lastProjectionPrice=n,this.m_data.boxSize=r,r||(this.properties().style.value()===oe.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===oe.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=o,o||this.properties().style.value()===oe.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value()),this._loading=!1},oe.prototype._setProperties=function(e){e.timeframe||e.merge({timeframe:""}),e.shortName||e.merge({shortName:""}),e.currencyId||e.addChild("currencyId",new n(null)),this._properties=e,this._properties.symbol.listeners().subscribe(this,oe.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,oe.prototype.changeInterval),this._properties.currencyId.listeners().subscribe(this,oe.prototype.changeCurrency),this._properties.timeframe.listeners().subscribe(this,oe.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,oe.prototype.changeProperties)},oe.prototype.changeSymbol=function(){this.setSymbolIntervalCurrencyDelayed(),this.m_model.checkLineToolSelection()},oe.prototype.changeInterval=function(){this.setSymbolIntervalCurrencyDelayed()},oe.prototype.changeCurrency=function(){this.setSymbolIntervalCurrencyDelayed(),this.m_model.checkLineToolSelection(),this._currencyChanged.fire()},oe.prototype.changeTimeFrame=function(){k("GUI","Change timeframe")},oe.prototype.title=function(){return this.properties().symbol.value()+", "+E(this.properties().interval.value())},oe.prototype.changeProperties=function(e){e!==this._properties.symbol&&e!==this._properties.interval&&e!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this),J.emit("series_properties_changed",this._id))},oe.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},oe.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},oe.prototype.onData=function(e){var t=this;switch(e.method){case"symbol_resolved":if(e.params[0]!==this._symbolId){D.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+e.params[0]);break}this.updateSymbolInfo(e.params[1],!1),this.m_model.updateSource(this),this._dataEvents.fireSymbolResolved(this._symbolInfo),this.m_model.realignLineTools(),TradingView.onWidget()||(k("Symbol",e.params[1].listed_exchange,e.params[1].name),k("Symbol Type",e.params[1].type,e.params[1].listed_exchange));var i=this.symbolInfo().minmov/this.symbolInfo().pricescale,n=this.properties();n.style.value()===oe.STYLE_RENKO&&n.renkoStyle.inputs.boxSize.value()e.update()),this._labelPaneViews.forEach(e=>e.update()),this._priceAxisViews.forEach(e=>e.update()),this._priceLineAxisViews.forEach(e=>e.update()),this._futureBarsPaneView&&this._futureBarsPaneView.update(),this._projectionBarsPaneView&&this._projectionBarsPaneView.update(),null!==this._waterlineView&&this._waterlineView.update(),null!==this._priceLineView&&this._priceLineView.update(),null!==this._gotoDateView&&this._gotoDateView.update(),this._baseHorizontalLineView.update();var e=this._model.activeStrategySource().value();null!==e&&e.updateAllViews()},oe.prototype._setStatus=function(e){this._status=e,this._statusView.update(),this.m_model.updateSource(this),this._onStatusChanged.fire()},oe.prototype.requestMoreData=function(e){if((this._status===oe.STATUS_READY||this._status===oe.STATUS_PULSE||this._status===oe.STATUS_DELAYED||this._status===oe.STATUS_DELAYED_STREAMING||this._status===oe.STATUS_EOD||this._status===oe.STATUS_REPLAY)&&!this.m_model.timeScale().isEmpty()){var t=this.m_model.timeScale().visibleBarsStrictRange();if(null!==t&&0!==this.bars().size()){var i=t.lastBar()-o(this.data().last()).index;if(this._predictBars=0?0:1,basedOnPrevClose:r.change>=0?0:1}}}else{var o=this._study.data().search(i-1,h.PlotRowSearchMode.NearestLeft,1),s=o&&o.value[4]||null;if(null!==s)return{values:{change:e-s,percentChange:Object(f.a)(s,e)},priceDirection:{basedOnCurrentBar:e>=t?0:1,basedOnPrevClose:e>=s?0:1}}}return{priceDirection:{basedOnCurrentBar:e>=t?0:1,basedOnPrevClose:e>=t?0:1}}},e.prototype._color=function(e,t,i){var n=Object(l.resetTransparency)(_.SeriesBarColorer.upColor(this._study.properties())),r=Object(l.resetTransparency)(_.SeriesBarColorer.downColor(this._study.properties()));if(i&&!v)return t.priceDirection?n:r;var o=this._study.properties().childs().style.value();if(10===o){var s=this._study.barColorer().barStyle(e,!1);return null!=s.barBorderColor?Object(l.resetTransparency)(s.barBorderColor):Object(l.resetTransparency)(s.barColor)}var a=!1;return 0===o?a=this._study.properties().childs().barStyle.childs().barColorsOnPrevClose.value():1===o?a=this._study.properties().childs().candleStyle.childs().barColorsOnPrevClose.value():9===o&&(a=!0),a?0===t.priceDirection.basedOnPrevClose?n:r:0===t.priceDirection.basedOnCurrentBar?n:r},e}();i.d(t,"OverlayLegendValuesProvider",(function(){return w}));var w=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._showBarChange=i.properties().paneProperties.legendProperties.showBarChange,n._showSeriesOHLC=i.properties().paneProperties.legendProperties.showSeriesOHLC,n._seriesStyle=t.properties().childs().style,n}return Object(n.c)(t,e),t.prototype.getValues=function(t){var i=e.prototype.getValues.call(this,t);if(!this._showLastPriceAndChangeOnly()){var n=Object(r.isPriceSourceStyle)(this._seriesStyle.value()),o=this._showSeriesOHLC.value(),s=o&&!n,a=o&&n;i[0].visible=s,i[1].visible=s,i[2].visible=s,i[3].visible=s,i[6].visible=this._showBarChange.value(),i[4].visible=a}return i},t}(S)},qcGP:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,o=i("mMWL");function s(e,t){var r=t||s.createProperties();n.call(this,e,r),this._priceAxisViews.push(this.createPriceAxisView(3)),i.e("lt-pane-views").then(function(e){var t=i("9FRF").ParallelChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,n),s.prototype.calculatePriceDiff=function(){if(3===this.points().length){var e=this.points()[0],t=this.points()[1],i=this.points()[2];if(e.index===t.index)return ;var n=this._findPriceOffset(e,t,i);null!==n&&(this._priceOffset=n)}},s.prototype._findPriceOffset=function(e,t,i){var n=this.priceScale();if(null===n)return null;if(n.isLog()){var r=this._model.timeScale();if(r.isEmpty())return null;var o=this.ownerSource().firstValue(),s=r.indexToCoordinate(e.index),a=r.indexToCoordinate(t.index),l=n.priceToCoordinate(e.price,o),c=n.priceToCoordinate(t.price,o),u=l+(_=(c-l)/(a-s))*(r.indexToCoordinate(i.index)-s),h=n.priceToCoordinate(i.price,o)-u,d=(o=this.ownerSource().firstValue(),.5*(l+c)),p=n.coordinateToPrice(d,o),f=d+h;return n.coordinateToPrice(f,o)-p}var _=(t.price-e.price)/(t.index-e.index),m=e.price+_*(i.index-e.index);return i.price-m},s.prototype.setLastPoint=function(e,t){t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]),n.prototype.setLastPoint.call(this,e),this.calculatePriceDiff()},s.prototype.restorePoints=function(e,t,i){n.prototype.restorePoints.call(this,e,t,i),e&&e.length>=3&&(this._priceOffset=e[2].price-e[0].price)},s.prototype.setPoint=function(e,t,i){if(i&&i.shift())switch(e){case 0:case 1:this._snapPoint45Degree(t,this._points[1-e]);break;case 2:case 3:this._snapPoint45Degree(t,{index:this._points[3-e].index,price:this._points[3-e].price+this._priceOffset})}var r=!1;switch(e){case 0:case 1:n.prototype.setPoint.call(this,e,t,i);break;case 2:case 3:this._points[e-2].index=t.index,this._points[e-2].price=t.price-this._priceOffset;break;case 4:this._points[2]=t,this.calculatePriceDiff(),r=!0;break;case 5:var s=this._findPriceOffset(this._points[0],this._points[1],t);null!=s&&(this._points[0].price+=s,this._points[1].price+=s,this._priceOffset-=s,r=!0)}if(e%2==0&&this._correctThirdPoint(),r&&this.linkKey){for(var a=[],l=0;l'},qgcf:function(e,t,i){"use strict";i.r(t),i.d(t,"calculateLabelPosition",(function(){return p})),i.d(t,"wordWrap",(function(){return _})),i.d(t,"TextRenderer",(function(){return I}));var n,r=i("aO4+"),o=i("Eyy1"),s=i("f6yo"),a=i("Ialn"),l=i("VdBB"),c=i("jFln"),u=i("ogJP"),h=i("ikwP"),d=i("8Uy/");function p(e,t,i,n,o){var s=.5*(t.x+i.x),a=i.y;return t.y>i.y?(a-=e.height/2+n.y,a=Math.max(e.height/2,a)):(a+=e.height/2+n.y,a=Math.min(o-e.height/2,a)),new r.Point(s,a)}function f(){var e=document.createElement("canvas");e.width=0,e.height=0,n=Object(o.ensureNotNull)(e.getContext("2d"))}function _(e,t,i){n||f(),i=Object(u.isString)(i)?parseInt(i):i;var r=(e+="").split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/);if(r[r.length-1]||r.pop(),!Object(u.isNumber)(i)||!isFinite(i)||i<=0)return r;n.font=t;for(var o=[],s=0;s0&&n.measureText(c.slice(0,3*--d-1).join("")).width>i;);if(d>0)o.push(c.slice(0,3*d-1).join("")),c.splice(0,3*d);else{var p=c[0]+(c[1]||"");if(h=1===h?1:~~(i/n.measureText(p).width*p.length),n.measureText(p.substr(0,h)).width<=i)for(;n.measureText(p.substr(0,h+1)).width<=i;)h++;else for(;h>1&&n.measureText(p.substr(0,--h)).width>i;);h<1&&(h=1),o.push(p.substr(0,h)),c[0]=p.substr(h),c[1]=""}if(n.measureText(c.join("")).width<=i){o.push(c.join(""));break}}}return o}function m(e,t,i){if(0===i)return e.clone();var n=(e.x-t.x)*Math.cos(i)-(e.y-t.y)*Math.sin(i)+t.x,o=(e.x-t.x)*Math.sin(i)+(e.y-t.y)*Math.cos(i)+t.y;return new r.Point(n,o)}function v(e,t){return t+2*w(e)+2*b(e)}function y(e,t){return C(e)*t+P(e)*(t-1)+2*S(e)+2*g(e)}function g(e){return void 0!==e.boxPaddingVert?e.boxPaddingVert*x(e):void 0!==e.boxPadding?e.boxPadding*x(e):C(e)/3}function b(e){return void 0!==e.boxPaddingHorz?e.boxPaddingHorz*x(e):void 0!==e.boxPadding?e.boxPadding*x(e):C(e)/3}function S(e){return(e.backgroundVertInflate||0)*x(e)}function w(e){return(e.backgroundHorzInflate||0)*x(e)}function P(e){return(e.padding||0)*x(e)}function C(e){return Math.ceil(T(e)*x(e))}function T(e){return e.fontsize||e.fontSize||30}function x(e){var t=Math.min(1,Math.max(.2,Math.min(e.scaleX||1,e.scaleY||1)));if(1===t)return t;var i=T(e);return Math.ceil(t*i)/i}var I=function(){function e(e,t){this._data=null,this._internalData=null,this._boxSize=null,this._linesInfo=null,this._fontInfo=null,this._hittest=t||new l.HitTestResult(l.HitTestResult.MOVEPOINT,{areaName:"Text"}),void 0!==e&&this.setData(e)}return e.prototype.setData=function(e){e.horzTextAlign||(e.horzTextAlign=e.horzAlign),function(e,t){if(null===e||null===t)return null===e==(null===t);if(void 0===e.points!=(void 0===t.points))return!1;if(void 0!==e.points&&void 0!==t.points){if(e.points.length!==t.points.length)return!1;for(var i=0;ii&&(t=t.slice(0,i))}this._linesInfo={linesMaxWidth:this._getLinesMaxWidth(t),lines:t}}return this._linesInfo},e.prototype._getFontInfo=function(){if(null===this._fontInfo){var e=Object(o.ensureNotNull)(this._data),t=C(e),i=(e.bold?"bold ":"")+(e.italic?"italic ":"")+t+"px "+e.font;this._fontInfo={fontStyle:i,fontSize:t}}return this._fontInfo},e.prototype._getBoxSize=function(){if(null===this._boxSize){var e=this._getLinesInfo(),t=Object(o.ensureNotNull)(this._data);this._boxSize={boxWidth:v(t,e.linesMaxWidth),boxHeight:y(t,e.lines.length)}}return this._boxSize},e.prototype._getRotationPoint=function(){var e,t,i=this._getInternalData(),n=i.boxLeft,s=i.boxTop,a=i.boxWidth,l=i.boxHeight,c=Object(o.ensureNotNull)(this._data),u=c.horzAlign,h=c.vertAlign;switch(u){case"center":e=n+a/2;break;case"left":e=n;break;case"right":e=n+a}switch(h){case"middle":t=s+l/2;break;case"top":t=s;break;case"bottom":t=s+l}return new r.Point(e,t)},e}()},qocr:function(e,t,i){"use strict";function n(e,t){void 0===t&&(t=!1),("attachEvent"in document?"complete"===document.readyState:"loading"!==document.readyState)?t?setTimeout((function(){return e()}),1):e():document.addEventListener("DOMContentLoaded",(function(){return e()}))}i.d(t,"a",(function(){return n}));new Promise((function(e){n(e)}))},qySK:function(e,t,i){"use strict" ;i.d(t,"b",(function(){return u})),i.d(t,"a",(function(){return h}));var n=i("Eyy1"),r=i("JmuD"),o=i("KG+6"),s=i("fFKx"),a=i("SqfW"),l=i("7Fue"),c=i("xWfy");function u(e){if(!Object(r.isObject)(e))throw new Error("Graphics commands should be wrapped in an object");if(Object(r.hasProperty)(e,"create"),Object(r.hasProperty)(e,"erase")){var t=e.erase;Object(n.assert)(Array.isArray(t),"Collection of erase commands should be array");for(var i=0,o=t;ii?i/m:1,f+=y.lineHeight*y.zoom}}var v=Math.max((e-f)/2,0);for(_=0;_=r}},s9sR:function(e,t,i){"use strict";i.r(t),i.d(t,"SetResolutionUndoCommand",(function(){return a}));var n=i("mrSG"),r=i("RDU5"),o=i("LxhU"),s=i("n5al"),a=function(e){function t(t,i,n,r){var o=e.call(this,r)||this;return o._property=t,o._value=i,o._prevValue=t.value(),o._chartWidget=n,o}return Object(n.c)(t,e),t.prototype.redo=function(){this._chartWidget.screen.show(),this._property.setValue(this._value),this._handleResolution(this._value)},t.prototype.undo=function(){this._chartWidget.screen.show(),this._property.setValue(this._prevValue),this._handleResolution(this._prevValue)},t.prototype._handleResolution=function(e){var t=this._chartWidget.model().mainSeries().properties(),i=t.style.value(),n=Object(s.isRangeStyle)(i),r=o.Interval.isRange(e);!n&&r?t.style.setValue(11):n&&!r&&t.style.setValue(Object(s.getLastUsedStyle)())},t}(r.UndoCommand)},sEk5:function(e,t,i){"use strict";var n=i("fTGZ").BarsMarksContainer,r=i("mMWL"),o=i("CCPt").UserDefinedBarsMarksTooltip;function s(e){n.call(this,e),this.toolname="UserDefinedBarsMarks";var t=this;r.hideMarksOnBars().subscribe(this,(function(){t._properties.visible.setValue(!r.hideMarksOnBars().value())}))}inherit(s,n),s.prototype._initialize=function(e){this._properties.visible.setValue(!0)},s.prototype.userEditEnabled=function(){return!1},s.prototype._plateViewData=function(e){var t={text:e.text};return"object"==typeof e.color&&(t.theme="user_defined_theme",t.overridedTheme={},t.overridedTheme.border=e.color.border,t.overridedTheme.background=e.color.background),t},s.prototype.onClicked=function(e){var t=e.id;this._marks[t].onClicked()}, s.prototype.clearMarks=function(){n.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},s.prototype._getData=function(e){var t=this._model.mainSeries().symbolInfo();if(t){var i=this.roundRange(this._rangeDifference(e)),n=this,r=this._model.mainSeries().properties().interval.value();ChartApiInstance.getMarks(t,i.start,i.end,(function(t){t.forEach((function(e){n._marks[e.id]=e}),n),n._loadedRange=n._rangeUnion(e,n._loadedRange),n.onNeedRepaint.fire()}),r)}},s.prototype._createTooltip=function(){return new o},s.prototype.updatePlateData=function(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t},s.prototype.hasContextMenu=function(){return!1},s.prototype.calcIsActualCurrency=function(){this._isActualCurrency=!0},e.exports=s},sJA2:function(e,t,i){"use strict";i.r(t);var n=i("EsvI"),r=i("oiZD");i.d(t,"ThemesApi",(function(){return o}));var o=function(){function e(e){this._opts=e}return e.prototype.isStdTheme=function(){var e=this._opts.chartWidgetCollection.getAll().every((function(e){return Object(n.isStdTheme)(Object(n.extractThemeFromModel)(e.model()))}));return Promise.resolve(e)},e.prototype.setStdTheme=function(e,t,i){return void 0===t&&(t=!0),Object(n.loadTheme)(e,!0,!1,this._opts.chartWidgetCollection,t,i).then((function(){}))},e.prototype.setStdThemeForLayout=function(e,t){void 0===t&&(t=!0),Object(r.setTheme)(e),t&&Object(n.syncTheme)()},e.prototype.getCurrentThemeName=function(){return Object(n.getCurrentTheme)().name},e}()},sQaR:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i("hY0g"),r=i.n(n),o=function(){function e(){this._container=document.createElement("div"),this._visibility=new r.a(!1)}return e.prototype.visible=function(){return this._visibility.readonly()},e.prototype._setVisibility=function(e){this._visibility.setValue(e)},e}()},t2ex:function(e,t,i){"use strict";var n=i("5rJj"),r=i("Ss5c").LineDataSource,o=i("j3hX"),s=o.LineToolWidthsProperty,a=o.LineToolColorsProperty;function l(e,t){var n=t||l.createProperties();r.call(this,e,n),this.version=l.version,this._properties._stateVersion=1,i.e("lt-pane-views").then(function(e){var t=i("R7Bt").FibRetracementPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(l,r),l.version=2,l.LevelsCount=24,l.prototype.levelsCount=function(){return l.LevelsCount},l.prototype.pointsCount=function(){return 2},l.prototype.name=function(){return"Fib Retracement"},l.prototype.migrateVersion=function(e,t,i){1===e&&this.properties().extendLines.setValue(!0)},l.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("17v9").FibDrawingsWith24LevelsDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l.createProperties=function(e){var t=new n("linetoolfibretracement",e,!1,{range:[1,24],names:["coeff","color","visible"]}) ;return l._configureProperties(t),t},l._configureProperties=function(e){r._configureProperties(e);for(var t=[e.child("trendline").child("linewidth"),e.child("levelsStyle").child("linewidth")],i=[e.child("trendline").child("color")],n=1;n<=l.LevelsCount;n++)i.push(e.child("level"+n).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new s(t))},l.prototype.fibLevelsBasedOnLogScale=function(){return this.properties().fibLevelsBasedOnLogScale.value()&&this.priceScale().isLog()},t.LineToolFibRetracement=l},tBG4:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesStatusView",(function(){return s}));var n=i("mrSG"),r=i("nBJD"),o=i("WPIy"),s=function(e){function t(t,i,n){var r=e.call(this,new o.a(t,i,n))||this;return r._invalidated=!0,r._series=t,r._series.onRestarted().subscribe(r,r.update),r._series.dataEvents().symbolResolved().subscribe(r,r.update),r._series.dataEvents().completed().subscribe(r,r.update),r._series.onBoxSizeChanged().subscribe(r,r.update),n.childs().symbolTextSource.listeners().subscribe(r,r.update),r}return Object(n.c)(t,e),t.prototype.getSeriesPrecision=function(){var e=4,t=this._series.symbolInfo();return t&&t.pricescale&&(e=Math.round(Math.log(t.pricescale)/Math.log(10))),e},t.prototype.round=function(e){var t=this.getSeriesPrecision(),i=Math.round(e*Math.pow(10,t))/Math.pow(10,t);return i?i.toString():""},t.prototype.update=function(){this._invalidated=!0},t.prototype.text=function(){return this._updateImpl(),e.prototype.text.call(this)},t.prototype.color=function(){return this._updateImpl(),e.prototype.color.call(this)},t.prototype.bold=function(){return this._updateImpl(),e.prototype.bold.call(this)},t.prototype.size=function(){return this._updateImpl(),e.prototype.size.call(this)},t.prototype.getSplitTitle=function(){return this._updateImpl(),this._statusProvider.getSplitTitle()},t.prototype._updateImpl=function(){this._invalidated&&(this._bold=this._statusProvider.bold(),this._size=this._statusProvider.size(),this._text=this._statusProvider.text(),this._invalidated=!1)},t}(r.a)},tDUI:function(e,t,i){"use strict";(function(e){var n=i("Eyy1").ensureNotNull,r=i("Ss5c").LineDataSource,o=i("gMtF").LineToolRiskRewardPriceAxisView,s=i("mMWL"),a=i("Ocx9").DefaultProperty,l=i("zXvd").NumericFormatter,c=i("wGNx").RiskRewardPointIndex,u=i("39QR").LineDataSourcePointPriceProperty,h=i("ogJP").isNumber;function d(t,n){var s=n;if(r.call(this,t,s),!n.stopLevel&&!n.profitLevel){var a=t.timeScale().visibleBarsStrictRange(),c=a.firstBar(),u=a.lastBar(),h=t.mainSeries().priceRange(c,u),p=t.mainSeries().priceScale();if(p.isLog()){var f=p.logicalToPrice(h.minValue()),_=p.logicalToPrice(h.maxValue());h=new e(f,_)}if(h&&!h.isEmpty()){var m=Math.round(.2*h.length()*t.mainSeries().base());s.merge({stopLevel:m,profitLevel:m})}}var v=this;s.stopLevel.listeners().subscribe(this,this.recalculate),s.stopLevel.listeners().subscribe(null,(function(){v.properties().stopPrice._listeners.fire(v.properties().stopPrice)})),s.profitLevel.listeners().subscribe(this,this.recalculate), s.profitLevel.listeners().subscribe(null,(function(){v.properties().targetPrice._listeners.fire(v.properties().targetPrice)})),s.addChild("entryPrice",new d.PriceProperty(this,0)),s.addChild("stopPrice",new d.StopPriceProperty(this)),s.addChild("targetPrice",new d.TargetPriceProperty(this)),s.addProperty("riskSize",250),s.addProperty("qty",0),s.addProperty("amountTarget",s.accountSize.value()),s.addProperty("amountStop",s.accountSize.value()),this._riskInPercentsFormatter=new l(2),this._riskInMoneyFormatter=new l,s.risk.subscribe(this,this._recalculateRiskSize),s.accountSize.subscribe(this,this._recalculateRiskSize),s.riskDisplayMode.subscribe(this,this._recalculateRisk),s.riskDisplayMode.subscribe(this,this._recalculateRiskSize),s.entryPrice.subscribe(this,this._recalculateRiskSize),s.stopPrice.subscribe(this,this._recalculateRiskSize),s.profitLevel.subscribe(this,this._recalculateRiskSize),s.profitLevel.subscribe(this,this._syncPriceLevels.bind(this)),s.stopLevel.subscribe(this,this._recalculateRiskSize),s.stopLevel.subscribe(this,this._syncPriceLevels.bind(this)),s.qty.subscribe(this,this._recalculateRiskSize),"percents"===s.riskDisplayMode.value()&&s.risk.value()>100&&s.riskDisplayMode.setValueSilently("money"),this._syncStateExclusions=["points","entryPrice","stopPrice","targetPrice","stopLevel","profitLevel","riskSize","qty","amountTarget","amountStop","risk","accountSize"],this.version=d.version,this._entryPriceAxisView=new o(this,{colorProperty:s.linecolor,priceProperty:s.entryPrice}),this._stopPriceAxisView=new o(this,{colorProperty:s.stopBackground,priceProperty:s.stopPrice}),this._profitPriceAxisView=new o(this,{colorProperty:s.profitBackground,priceProperty:s.targetPrice}),i.e("lt-pane-views").then(function(e){var t=i("u+oH").RiskRewardPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function p(e,t){var i=t||p.createProperties();d.call(this,e,i);var n=this.properties();n.entryPrice.subscribe(this,this._recalculateQty),n.stopPrice.subscribe(this,this._recalculateQty),n.riskSize.subscribe(this,this._recalculateQty),n.entryPrice.subscribe(this,this._recalculateAmount),n.profitLevel.subscribe(this,this._recalculateAmount),n.stopLevel.subscribe(this,this._recalculateAmount),n.accountSize.subscribe(this,this._recalculateAmount),n.riskSize.subscribe(this,this._recalculateAmount),n.qty.subscribe(this,this._recalculateAmount)}function f(e,t){var i=t||f.createProperties();d.call(this,e,i);var n=this.properties();n.entryPrice.subscribe(this,this._recalculateQty),n.stopPrice.subscribe(this,this._recalculateQty),n.riskSize.subscribe(this,this._recalculateQty),n.entryPrice.subscribe(this,this._recalculateAmount),n.profitLevel.subscribe(this,this._recalculateAmount),n.stopLevel.subscribe(this,this._recalculateAmount),n.accountSize.subscribe(this,this._recalculateAmount),n.riskSize.subscribe(this,this._recalculateAmount),n.qty.subscribe(this,this._recalculateAmount)}inherit(d,r),d.prototype.riskFormatter=function(e){ return"percents"===e?this._riskInPercentsFormatter:this._riskInMoneyFormatter},d.prototype.getRiskStep=function(e){return"percents"===e?.01:1},d.prototype._roundValue=function(e){return parseFloat(e.toFixed(2))},d.prototype.hasEditableCoordinates=function(){return!1},d.prototype._recalculateRisk=function(){var e=this.properties(),t=e.riskDisplayMode.value(),i=e.riskSize.value(),n=e.accountSize.value(),r=e.risk.value();r="percents"===t?this._roundValue(i/n*100):this._roundValue(n/100*r),this._riskInChange=!0,e.risk.setValue(this.riskFormatter(t).format(r)),this._riskInChange=!1},d.prototype._recalculateRiskSize=function(){if(!this._riskInChange){var e=this.properties(),t=e.risk.value(),i=e.riskDisplayMode.value(),n=e.accountSize.value();"percents"===i?e.riskSize.setValue(t/100*n):t>n?(e.risk.setValue(n),e.riskSize.setValue(n)):e.riskSize.setValue(t)}},d.version=2,d.prototype.lastBarData=function(){var e=this._model.mainSeries().bars().firstIndex(),t=this._model.mainSeries().bars().lastIndex();if(null===e||null===t||isNaN(e)||isNaN(t))return null;var i=this.points();if(4===i.length){var r=i[c.ActualClose];return r.index=1){var n=[];if(n.push(this._points[0]),o={price:(o=this._points[0]).price,index:this._getClosePointIndex(o.index)},n.push(o),this._points[1]&&n.push(this._points[1]),this._points[2]&&n.push(this._points[2]),this._points=n,this._timePoint.length>=1){var r=[],o=this._timePoint[0];r.push(o);var s={price:o.price,time_t:o.time_t,offset:this._getClosePointIndex(o.offset)};r.push(s),this._timePoint[1]&&n.push(this._points[1]),this._timePoint[2]&&n.push(this._points[2]),this._timePoint=r}}},d.prototype.checkAlert=function(){this.recalculate()},d.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()||t!==this.priceScale()||this._model.paneForSource(this)!==e?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]},d.prototype.updateAllViews=function(){this.isActualSymbol()&&this._properties.visible.value()&&(s.hideAllDrawings().value()&&this.userEditEnabled()||(r.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update()))},d.prototype.restoreExternalState=function(e){(e=Object.assign({},e),this.isActualSymbol())||h(e.entryPrice)&&(this._timePoint[0].price=e.entryPrice,delete e.entryPrice);this.properties().merge(e)},d.prototype._changeEntryPoint=function(e){var t=this.properties().stopPrice.value(),i=this.properties().targetPrice.value(),n=1/this._model.mainSeries().base(),o=Math.min(t,i)+n,s=Math.max(t,i)-n;e.price=Math.max(o,Math.min(s,this._roundPrice(e.price))),r.prototype.setPoint.call(this,0,e),this.properties().stopPrice.setValue(t),this.properties().targetPrice.setValue(i)}, d.prototype.setPoint=function(e,t,i){if(this.isActualSymbol()){switch(this._muteSyncLineStyle(),e){case 0:this._changeEntryPoint(t);break;case 2:this.properties().stopPrice.setValue(this.preparseStopPrice(t.price));break;case 3:this.properties().targetPrice.setValue(this.preparseProfitPrice(t.price));break;case 1:t.price=this._roundPrice(t.price),r.prototype.setPoint.call(this,1,t),this.recalculate()}this._unmuteSyncLineStyleWithoutApplyingChanges(),this._syncPriceLevels()}},d.prototype.getPoint=function(e){switch(e){case 0:return this._points[0];case 1:return{index:this._points[1].index,price:this._points[0].price};case 2:return{index:this._points[0].index,price:this.stopPrice()};case 3:return{index:this._points[0].index,price:this.profitPrice()}}return null},d.prototype.setPoints=function(e){this._muteSyncLineStyle(),r.prototype.setPoints.call(this,e),this.recalculate(),this._unmuteSyncLineStyleWithoutApplyingChanges(),this._syncPriceLevels()},d.prototype._syncPriceLevels=function(){if(this.linkKey){var e=this.properties(),t={entryPrice:e.entryPrice.value(),stopLevel:e.stopLevel.value(),profitLevel:e.profitLevel.value()};s.changeLineStyle({linkKey:this.linkKey,state:t,model:this._model})}},d.PriceProperty=function(e,t){u.call(this,e,t)},inherit(d.PriceProperty,u),d.PriceProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];this._lineSource.startChanging(this._pointIndex,t),t.price=parseFloat(e),this._lineSource.setPoint(this._pointIndex,t),this._lineSource.recalculate(),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(),this._lineSource._syncPriceLevels()},d.PriceProperty.prototype.state=function(){return this.value()},d.PriceProperty.prototype.merge=function(e,t){return this.setValue(e),t?[]:null},d.StopPriceProperty=function(e){d.PriceProperty.call(this,e,1)},inherit(d.StopPriceProperty,d.PriceProperty),d.StopPriceProperty.prototype.value=function(){var e=this._lineSource.stopPrice(),t=this._lineSource.ownerSource().formatter();return t.parse(t.format(e)).value},d.StopPriceProperty.prototype.setValue=function(e){var t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().stopLevel.setValue(t),this._lineSource._syncPriceLevels()},d.TargetPriceProperty=function(e){d.PriceProperty.call(this,e,2)},inherit(d.TargetPriceProperty,d.PriceProperty),d.TargetPriceProperty.prototype.value=function(){var e=this._lineSource.profitPrice(),t=this._lineSource.ownerSource().formatter();return t.parse(t.format(e)).value},d.TargetPriceProperty.prototype.setValue=function(e){var t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().profitLevel.setValue(t),this._lineSource._syncPriceLevels()},d.prototype.pointsCount=function(){return 1},d.prototype.name=function(){return"Risk/Reward"},d.prototype.addPoint=function(e){e.price=this._roundPrice(e.price),r.prototype.addPoint.call(this,e,null,!0) ;var t={price:e.price,index:this._getClosePointIndex(e.index)};r.prototype._addPointIntenal.call(this,t,null,!0);var i=this.calculateActualEntry(e,t);i&&(r.prototype._addPointIntenal.call(this,i,null,!0),(t=this.findClosePoint(i,t))&&r.prototype._addPointIntenal.call(this,t,null,!0));return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},d.prototype.setOwnerSource=function(e){r.prototype.setOwnerSource.call(this,e),this._model.mainSeries().symbolInfo()&&(this._recalculateAmount(),this._recalculateQty())},d.prototype._roundPrice=function(e){var t=this._model.mainSeries().base();return Math.round(e*t)/t},d.prototype.recalculate=function(){if(0!==this.points().length){var e=this.properties().targetPrice.value(),t=this.properties().stopPrice.value(),i=[this._points[0],this._points[1]],n=this.calculateActualEntry(this.points()[0],this.points()[1]);if(n){i.push(n);var r=this.findClosePoint(n,this.points()[1]);r&&i.push(r)}this._points=i,e!==this.properties().targetPrice.value()&&this.properties().targetPrice._listeners.fire(this.properties().targetPrice),t!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice)}},d.prototype.start=function(){r.prototype.start.call(this),this.recalculate()},d.prototype.startMoving=function(e,t,i){e.logical.price=this._roundPrice(e.logical.price),r.prototype.startMoving.call(this,e,t,i)},d.prototype.move=function(e,t,i){e.logical.price=this._roundPrice(e.logical.price),r.prototype.move.call(this,e,t,i),this.recalculate(),this._entryPriceAxisView.update()},d.prototype._correctPoints=function(e){return!!this.isActualSymbol()&&r.prototype._correctPoints.call(this,[e[0],e[1]])},d.prototype.entryPrice=function(){return this.points()[0].price},d.prototype.findClosePoint=function(e,t){for(var i=this._model.mainSeries().bars(),r=n(i.firstIndex()),o=Math.max(e.index,r),s=n(i.lastIndex()),a=Math.min(s,t.index),l=o;l<=a;l++){var c=n(i.valueAt(l)),u=this.checkStopPrice(c);if(null!=u)return{index:l,price:u}}return null},d.prototype.calculateActualEntry=function(e,t){for(var i=this._model.mainSeries().bars(),r=n(i.firstIndex()),o=Math.max(e.index,r),s=e.price,a=n(i.lastIndex()),l=Math.min(a,t.index),c=o;c<=l;c++){var u=n(i.valueAt(c));if(u[TradingView.HIGH_PLOT]>=s&&u[TradingView.LOW_PLOT]<=s)return{index:c,price:s}}return null},d.prototype.axisPoints=function(){if(!this._points[c.ActualEntry])return[];var e=this._points[c.ActualEntry],t=null;if(4===this._points.length)t=this._points[c.ActualClose];else{var i=this.lastBarData();if(!i)return[];t={index:i.index,price:i.closePrice}}return[e,t]},d.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("RYNR").RiskRewardDefinitionsViewModel}.bind(null,i)).catch(i.oe)},d.prototype.template=function(){var e=this.properties(),t=r.prototype.template.call(this);return t.stopLevel=e.stopLevel.value(),t.profitLevel=e.profitLevel.value(),t},d.prototype._applyTemplateImpl=function(e){ delete e.targetPrice,delete e.stopPrice,delete e.entryPrice,r.prototype._applyTemplateImpl.call(this,e);var t=this.properties();void 0!==e.stopLevel&&t.stopLevel.setValue(e.stopLevel),void 0!==e.profitLevel&&t.profitLevel.setValue(e.profitLevel)},d.prototype.getOrderTemplate=function(){return null},d.prototype._propertiesStateExclusions=function(){return["entryPrice","stopPrice","targetPrice"]},d._configureProperties=function(e){r._configureProperties(e),e.addExclusion("stopLevel"),e.addExclusion("profitLevel"),e.addExclusion("stopPrice"),e.addExclusion("targetPrice"),e.addExclusion("entryPrice")},d.prototype._roundQty=function(e){var t=this._model.mainSeries().symbolInfo();return"bitcoin"===t.type||"crypto"===t.type||"futures"===t.type?Math.round(1e3*e)/1e3:Math.floor(e)},d.prototype._getClosePointIndex=function(e){var t=this._model.timeScale(),i=Math.round(t.width()/t.barSpacing());return e+Math.max(3,Math.round(.15*i))},inherit(p,d),p.prototype._recalculateQty=function(){if(0!==this.points().length){var e=this.properties(),t=e.entryPrice.value(),i=e.stopPrice.value(),n=e.riskSize.value(),r=this._model.mainSeries().pointValue(),o=this._roundQty(n/(Math.abs(i-t)*r));e.qty.setValue(o)}},p.prototype._recalculateAmount=function(){if(0!==this.points().length){var e=this.properties(),t=e.accountSize.value(),i=e.entryPrice.value(),n=e.qty.value(),r=e.stopPrice.value(),o=e.targetPrice.value(),s=this._model.mainSeries().pointValue(),a=this._roundValue(t+(i-o)*n*s),l=this._roundValue(t-(r-i)*n*s);e.amountTarget.setValue(a),e.amountStop.setValue(l)}},p.prototype.name=function(){return"Risk/Reward short"},p.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this._model.mainSeries().base()},p.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this._model.mainSeries().base()},p.prototype.calculatePL=function(e){return this.entryPrice()-e},p.prototype.preparseStopPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(e,t)},p.prototype.preparseProfitPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(e,t)},p.prototype.checkStopPrice=function(e){var t=this.stopPrice(),i=this.profitPrice();return e[TradingView.HIGH_PLOT]>=t?this.stopPrice():e[TradingView.LOW_PLOT]<=i?this.profitPrice():null},p.prototype._orderSide=function(){throw new Error("not supported")},p.createProperties=function(e){var t=new a("linetoolriskrewardshort",e);return p._configureProperties(t),t},p._configureProperties=function(e){d._configureProperties(e)},inherit(f,d),f.prototype._recalculateQty=function(){if(0!==this.points().length){var e=this.properties(),t=e.entryPrice.value(),i=e.stopPrice.value(),n=e.riskSize.value(),r=this._model.mainSeries().pointValue(),o=this._roundQty(n/(Math.abs(t-i)*r));e.qty.setValue(o)}},f.prototype._recalculateAmount=function(){if(0!==this.points().length){ var e=this.properties(),t=e.accountSize.value(),i=e.entryPrice.value(),n=e.qty.value(),r=e.stopPrice.value(),o=e.targetPrice.value(),s=this._model.mainSeries().pointValue(),a=this._roundValue(t+(o-i)*n*s),l=this._roundValue(t-(i-r)*n*s);e.amountTarget.setValue(a),e.amountStop.setValue(l)}},f.prototype.stopPrice=function(){return this.entryPrice()-this.properties().stopLevel.value()/this._model.mainSeries().base()},f.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this._model.mainSeries().base()},f.prototype.calculatePL=function(e){return e-this.entryPrice()},f.prototype.preparseStopPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(e,t)},f.prototype.preparseProfitPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(e,t)},f.prototype.checkStopPrice=function(e){var t=this.stopPrice(),i=this.profitPrice();return e[TradingView.LOW_PLOT]<=t?this.stopPrice():e[TradingView.HIGH_PLOT]>=i?this.profitPrice():null},f.prototype.name=function(){return"Risk/Reward long"},f.prototype._orderSide=function(){throw new Error("not supported")},f.createProperties=function(e){var t=new a("linetoolriskrewardlong",e);return f._configureProperties(t),t},f._configureProperties=function(e){d._configureProperties(e)},t.LineToolRiskRewardLong=f,t.LineToolRiskRewardShort=p}).call(this,i("Qb4w").PriceRange)},tG6Q:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;function o(e,t){var r=t||o.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("GS+0").LineToolCircleLinesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.name=function(){return"Cyclic Lines"},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("LX4V").CyclicAndSineLinesPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o.createProperties=function(e){var t=new r("linetoolcirclelines",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},t.LineToolCircleLines=o},tWVy:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return o}));var n=i("aIyQ"),r=new(i.n(n).a);function o(){r.fire()}},"tc+8":function(e,t,i){"use strict";(function(t){var n=i("ogJP").isFunction;function r(e){if(this._listeners=new t,this._childs=[],this._muteChildChanges=!1,void 0!==e)if(this.isPrimitiveType(e))this._value=e;else for(var i in e)this.addProperty(i,e[i])}r.prototype.merge=function(e,t){var i=null;if(t)var n=(i=[]).length;if(void 0===e)return i;if(this.isPrimitiveType(e))return t&&this._value!==e&&i.push(this),this._value=e,i;if(Array.isArray(e))for(var r=0;rn&&i.push(this),i},r.prototype.mergeAndFire=function(e){var t=this.merge(e,!0);this._muteChildChanges=!0,t.forEach((function(e){e._muteChildChanges=!0})),t.forEach((function(e){e._muteChildChanges=!1,e.listeners().fire(e)})),this._muteChildChanges=!1,t.length>0&&this.listeners().fire(this)},r.prototype.state=function(e){var t=n(this.value)?this.value():void 0;void 0===t&&(t={});for(var i=0;i=0},r.prototype.addChild=function(e,t){this[e]&&this[e].unsubscribe(this,this.childChanged),this[e]=t,-1===this._childs.indexOf(e)&&this._childs.push(e),t.subscribe(this,this.childChanged)},r.prototype.childChanged=function(e,t){this._muteChildChanges||this.listeners().fire(this)},r.prototype.subscribe=function(e,t){this.listeners().subscribe(e,t,!1)},r.prototype.unsubscribe=function(e,t){this.listeners().unsubscribe(e,t)},r.prototype.unsubscribeAll=function(e){this.listeners().unsubscribeAll(e)},r.prototype.childs=function(){return this},e.exports=r}).call(this,i("aIyQ"))},teHb:function(e,t,i){"use strict";i.r(t),i.d(t,"ratioStudyItem",(function(){return s}));var n=i("mrSG"),r=i("7dm8"),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._doCalculation=function(e,t,i,n){return e*t/(i*n)},t}(r.a),s={name:"Ratio",metainfo:{_metainfoVersion:15,defaults:r.b,plots:r.d,styles:r.e,description:"Ratio",shortDescription:"Ratio",is_price_study:!1,inputs:r.c,id:"Ratio@tv-basicstudies-1"},constructor:o}},tqok:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var n=-2e6},txPx:function(e,t,i){"use strict";i.r(t),i.d(t,"LOGLEVEL",(function(){return n})),i.d(t,"getLogLevel",(function(){return f})), i.d(t,"isHighRateEnabled",(function(){return _})),i.d(t,"setLogLevel",(function(){return m})),i.d(t,"getRawLogHistory",(function(){return v})),i.d(t,"serializeLogHistoryEntry",(function(){return y})),i.d(t,"getLogHistory",(function(){return g})),i.d(t,"getLogger",(function(){return S})),i.d(t,"loggingOn",(function(){return P})),i.d(t,"loggingOff",(function(){return C}));var n,r="undefined"!=typeof window?window:{},o=!1;try{localStorage.getItem(""),o=!0}catch(x){}!function(e){e[e.ERROR=1]="ERROR",e[e.WARNING=2]="WARNING",e[e.INFO=3]="INFO",e[e.NORMAL=4]="NORMAL",e[e.DEBUG=5]="DEBUG"}(n||(n={}));var s=0,a=[],l=null,c=null,u=null,h=NaN,d=n.WARNING,p=!1;function f(){return d}function _(){return p}function m(e){e=Math.max(n.ERROR,Math.min(n.DEBUG,e)),d=e,T()}function v(e,t){var i=a.reduce((function(e,t){return e.concat(t)}),[]);return i.sort((function(e,t){return e.id-t.id})),void 0!==t&&(i=i.filter((function(e){return e.subSystemId===t}))),"number"==typeof e&&(i=i.slice(-e)),i}function y(e){return new Date(e.timestamp).toISOString()+":"+e.subSystemId+":"+e.message.replace(/"/g,"'")}function g(e,t){return function(e,t){var i,n=0;for(i=e.length-1;i>=1&&(n+=8*(1+encodeURIComponent(e[i]).length),!(i-1>0&&n+8*(1+encodeURIComponent(e[i-1]).length)>t));i--);return e.slice(i)}(v(e,t).map(y),75497472)}function b(e,t,i,r){if(t!==c||r.id!==u){var o=new Date;if(e<=n.NORMAL&&function(e,t,i,n,r){var o={id:s,message:String(t),subSystemId:n,timestamp:Number(e)};s+=1,i.push(o),void 0!==r&&i.length>r&&i.splice(0,1)}(o,t,i,r.id,r.maxCount),e<=d&&(!r.highRate||_())&&(!l||r.id.match(l))){var a=o.toISOString()+":"+r.id+":"+t;switch(e){case n.DEBUG:console.debug(a);break;case n.INFO:case n.NORMAL:r.color?console.log("%c"+a,"color: "+r.color):console.log(a);break;case n.WARNING:console.warn(a);break;case n.ERROR:console.error(a)}c=t,u=r.id,h&&clearTimeout(h),h=setTimeout((function(){c=null,u=null,h=NaN}),1e3)}}}function S(e,t){void 0===t&&(t={});var i=[];a.push(i);var r=Object.assign(t,{id:e});function o(e){return function(t){return b(e,t,i,r)}}return{logDebug:o(n.DEBUG),logError:o(n.ERROR),logInfo:o(n.INFO),logNormal:o(n.NORMAL),logWarn:o(n.WARNING)}}var w=S("logger"),P=r.lon=function(e,t){m(n.DEBUG),w.logNormal("Debug logging enabled"),p=Boolean(e),l=t||null,T()},C=r.loff=function(){m(n.INFO),w.logInfo("Debug logging disabled")};function T(){try{o&&(localStorage.setItem("tv.logger.logHighRate",String(p)),localStorage.setItem("tv.logger.loglevel",String(d)))}catch(e){w.logWarn("Cannot save logger state (level: "+d+", high-rate: "+p+") to localStorage: "+e.message)}}!function(){p=!!o&&"true"===localStorage.getItem("tv.logger.logHighRate");var e=parseInt(o&&localStorage.getItem("tv.logger.loglevel")||"");Number.isNaN(e)&&(e=n.WARNING),m(e),w.logNormal("Init with settings - level: "+d+", high-rate: "+p)}(),r.performance&&r.performance.now?w.logNormal("Sync logger and perf times, now is "+r.performance.now()):w.logWarn("Perf time is not available")},tzRX:function(e,t){ e.exports=''},"u+0B":function(e,t,i){"use strict";i.r(t),i.d(t,"TextWidthCache",(function(){return r}));var n=/[2-9]/g,r=function(){function e(e){void 0===e&&(e=50),this._actualSize=0,this._usageTick=1,this._oldestTick=1,this._tick2Labels={},this._cache={},this._maxSize=e}return e.prototype.reset=function(){this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}},e.prototype.measureText=function(e,t,i){var r=i||n,o=String(t).replace(r,"0");if(this._cache[o])return this._cache[o].width;if(this._actualSize===this._maxSize){var s=this._tick2Labels[this._oldestTick];delete this._tick2Labels[this._oldestTick],delete this._cache[s],this._oldestTick++,this._actualSize--}var a=e.measureText(o).width;return 0===a&&t.length?0:(this._cache[o]={width:a,tick:this._usageTick},this._tick2Labels[this._usageTick]=o,this._actualSize++,this._usageTick++,a)},e}()},u0yd:function(e,t,i){"use strict";var n=i("Zp/P").coordinateIsValid,r=i("gyZD").PaneRendererLine;function o(e){e.forceLineColor=!1,r.call(this,e),this.color1=e.color1,this.color2=e.color2,this.bottom=e.bottom,this.isSeries=!!e.isSeries,this._simpleMode=e.simpleMode}inherit(o,r),o.prototype._drawImpl=function(e){if(0!==this.items.length){e.lineCap="butt",e.strokeStyle=this.lineColor,e.lineWidth=this.lineWidth,e.lineStyle=this.lineStyle,e.lineWidth=1;for(var t=0;t=0&&!n(this.items[i].y);)i--;if(!(t>=i)){for(var o={},s=this.items,a=t;a<=i;a++){var l=s[a];if(h=l.style?l.style.color:this.lineColor,a0;){if(t[i]<=e)return i;i--}return i},C.prototype._spanOffset=function(e,t){if(t0&&this._hightlightBackground(e,n,t)}var r=i.model().crossHairSource();r.startMeasurePoint()&&this._hightlightBackground(e,r.measurePoints(),t)}},C.prototype.drawTickMarks=function(e,t){var i=this.chart.model().timeScale().marks();if(i&&0!==i.length){var n=i.reduce((function(e,t){return e.span>t.span?e:t}),i[0]).span;n>30&&n<40&&(n=30),e.save(),e.strokeStyle=this.lineColor();var r=this.rendererOptions(),o=r.borderSize+r.tickLength+r.paddingTop+r.fontSize-r.baselineOffset;e.textAlign="center",e.fillStyle=this.lineColor();var s=Math.max(1,Math.floor(t)),a=Math.floor(.5*t),l=Math.round(r.tickLength*t);e.beginPath();for(var c=i.length;c--;){var u=Math.round(i[c].coord*t);e.rect(u-a,0,s,l)}e.fill(),e.fillStyle=this.textColor();var d=this;h(e,t,(function(){e.font=d.baseFont();for(var t=0;t=n&&e.fillText(r.label,r.coord,o)}})),e.restore()}},C.prototype.drawBackLabels=function(e,t){e.save() ;var i=new Set,n=this.chart.model(),r=n.dataSources();n.selection().allSources().forEach((function(e){i.add(e)})),n.hoveredSource()&&i.add(n.hoveredSource()),n.sourcesBeingMoved().forEach((function(e){i.add(e)}));var o=n.lineBeingEdited()||n.lineBeingCreated();o&&i.add(o),i.add(this.chart.model().crossHairSource()),r=r.concat(n.model().customSources());for(var s=this.rendererOptions(),a=0;a=s)&&(n={value:s,view:o})}}})),i.view&&t.push(i.view),n.view&&t.push(n.view),t},C.prototype._addViewsOrMaxMin=function(e,t){e.length<=1?e.forEach((function(e){if(e.timeAxisViews){var i=e.timeAxisViews();i&&i.length&&t.push(i)}})):t.push(this._minMaxViews(e))},C.prototype.drawCrossHairLabel=function(e,t){e.save(),e.clearRect(0,0,Math.ceil(this.size.w*t)+1,Math.ceil(this.size.h*t)+1);var i,n=this.chart.model(),r=[],o=n.lineBeingEdited()||n.lineBeingCreated();o&&o.timeAxisViews&&((i=o.timeAxisViews())&&i.length&&r.push(i));(this._addViewsOrMaxMin(n.sourcesBeingMoved(),r),this._addViewsOrMaxMin(n.selection().allSources(),r),n.hoveredSource()&&!n.selection().isSelected(n.hoveredSource()))&&(n.hoveredSource().timeAxisViews&&(i=n.hoveredSource().timeAxisViews())&&i.length&&r.push(i));(i=n.crossHairSource().timeAxisViews())&&i.length&&r.push(i);var s=this.rendererOptions();r.forEach((function(i){i.forEach((function(i){e.save(),i.renderer().draw(e,s,t),e.restore()}))})),e.restore()},C.prototype.hardResetCanvas=function(){this.size&&(d(this._canvasBinding,this.size),d(this._topCanvasBinding,this.size))},C.prototype.paint=function(e){if(e!==a.None){var t=u(this._topCanvasBinding.canvas);if(e>a.Cursor){var i=u(this._canvasBinding.canvas),n=this._canvasBinding.pixelRatio;this.drawBackground(i,n),this.chart.model()&&(this.drawTickMarks(i,n),this.drawBackLabels(i,n),this.chart.model().crossHairSource().updateAllViews(),this.drawCrossHairLabel(t,n)),this._lhsStubContainer.paintStubs(e),this._rhsStubContainer.paintStubs(e)}this.drawCrossHairLabel(t,this._topCanvasBinding.pixelRatio)}},C.prototype.restoreDefaultCursor=function(){this.setCursor("")},C.prototype.setCursor=function(e){var t="";"grabbing"!==e&&"ew-resize"!==e||(t="time-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._cell.classList.remove(this._currentCursorClassName),t&&this._cell.classList.add(t),this._currentCursorClassName=t,this._cell.style.cursor)},C.prototype.updatePriceAxisStubs=function(){var e=this.chart.model().model(),t=this.chart.isMaximizedPane()?this.chart.maximizedPaneWidget().state():e.paneForSource(e.mainSeries());if(t){var i=e.priceScaleSlotsCount() ;this._lhsStubContainer.setScales([],i.left,t.leftPriceScales().length,i.left+i.right),this._rhsStubContainer.setScales([],i.right,t.rightPriceScales().length,i.left+i.right)}},C.prototype.getScreenshotData=function(){var e={};return e.content=this._canvasBinding.canvas.toDataURL(),e.canvas=this._canvasBinding.canvas,e.contentWidth=this.size.w,e.contentHeight=this.size.h,e.lhsStub=this._lhsStubContainer.getScreenshotData(),e.rhsStub=this._rhsStubContainer.getScreenshotData(),e},t.TimeAxisWidget=C}).call(this,i("aIyQ"),i("Kxc7"))},ufwo:function(e,t,i){"use strict";i.r(t),i.d(t,"rangesAreEqual",(function(){return o}));var n=i("uDHo"),r=i("LxhU");function o(e,t){return!!r.Interval.isEqual(e.res,t.res)&&Object(n.areEqualTimeFrames)(e.val,t.val)}},ulZB:function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return a}));var n=i("mrSG"),r=i("aIyQ"),o=i.n(r),s=function(){function e(e,t,i,n,r){var s=this;this._onChange=new o.a,this._handleChange=function(){s._onChange.fire(s.get())},this._crossTabEvents=e,this._jsonKeyValueStore=t,this.CROSSTAB_EVENT_NAME=i,this.JSON_STORE_KEY=n,this.defaultStoreValue=this._serialize(r),this._subscribe()}return e.prototype.get=function(){var e=this._jsonKeyValueStore.getJSON(this.JSON_STORE_KEY,this.defaultStoreValue);return this._deserialize(e)},e.prototype.set=function(e,t){var i=this._serialize(e);this._jsonKeyValueStore.setJSON(this.JSON_STORE_KEY,i,t),this._crossTabEvents.emit(this.CROSSTAB_EVENT_NAME),this._onChange.fire(e)},e.prototype.getOnChange=function(){return this._onChange},e.prototype.destroy=function(){this._unsubscribe(),this._onChange.destroy(),delete this._onChange},e.prototype._subscribe=function(){this._crossTabEvents.on(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.subscribe(this,this._handleChange)},e.prototype._unsubscribe=function(){this._crossTabEvents.off(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.unsubscribe(this,this._handleChange)},e}(),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._serialize=function(e){return e},t.prototype._deserialize=function(e){return e},t}(s)},v5F8:function(e,t,i){"use strict";var n=i("5rJj"),r=i("aDyP").LineToolPitchfork;function o(e,t){var i=t||o.createProperties();r.call(this,e,i)}inherit(o,r),o.prototype.name=function(){return"Modified Schiff Pitchfork"},o.createProperties=function(e){var t=new n("linetoolschiffpitchfork",e,!1,{range:[0,8]});return o._configureProperties(t),t},o._configureProperties=function(e){r._configureProperties(e)},t.LineToolSchiffPitchfork=o},vAx0:function(e,t,i){"use strict";var n=i("aO4+").Point,r=i("f6yo").pointInCircle,o=i("VdBB").HitTestResult,s=i("Zy3/").CompositeRenderer,a=i("6xeX").Tooltip,l=(i("GH0z").PercentageFormatter,i("55Xp").roundToFirstValuable,i("LxhU").Interval, i("jCNj").utc_to_cal),c=i("jCNj").get_timezone,u=i("ZZnO").dateFormatProperty,h=i("gQ5K").DateFormatter,d=i("ikwP"),p=d.Size,f=d.createDisconnectedCanvas,_=d.getPrescaledContext2D,m=i("cPgM").ScaledPaneRenderer,v=i("z+cS").VerticalLineRenderer,y=i("zDbI").CHART_FONT_FAMILY;function g(e,t,i,n){this._lastClickedId=null,this._model=e,this._study=t,this._lollipops={},this._textCache={},this.templatesCache={},this._invalidated=!0,this._hideLollipops=!1,this.defaultStyle=i,this.hoveredStyle=n,this._templatesSize=new p(300,150),this.templatesCache.hovered=void 0!==this.hoveredStyle?this.createTemplate(this.hoveredStyle):null,this.templatesCache.default=void 0!==this.defaultStyle?this.createTemplate(this.defaultStyle):null,this._onPaneBgChangeBound=this.onPaneBgChange.bind(this),e.backgroundColor().subscribe(this._onPaneBgChangeBound),e.mainSeries().onSymbolIntervalChanged().subscribe(this,this._onSymbolOrIntervalChanged)}function b(e){m.call(this),this.data=e,this._hittest=new o(o.CUSTOM,e)}function S(e,t){m.call(this),this._data=e,this._paneView=t,this.textRenderer=new S.TextRenderer(e.style.lollipop.importance)}g.prototype.destroy=function(){this._model.backgroundColor().unsubscribe(this._onPaneBgChangeBound),this._model.mainSeries().onSymbolIntervalChanged().unsubscribeAll(this)},g.prototype.onPaneBgChange=function(){void 0!==this.defaultStyle&&(this.defaultStyle.lollipop.fillStyle=this._model.backgroundColor().value(),this._stylesCache=null,Object.keys(this.templatesCache).forEach((function(e){0===e.indexOf("default")&&(this.templatesCache[e]=null)}),this))},g.prototype.onClickOutside=function(){this.clearLastClicked()},g.prototype.clearLastClicked=function(){this._lastClickedId=null},g.prototype.closeTooltips=function(){for(var e in this._lollipops)if(this._lollipops.hasOwnProperty(e)){var t=this._lollipops[e];t.visible&&(t.tooltip.isOpened()&&t.tooltip.hide(),t.visible=!1)}},g.prototype.getLastClickedLollipopId=function(){return this._lastClickedId},g.prototype._setStackStudies=function(){this._stackStudies=[]},g.prototype._getY=function(){for(var e=0,t=this._model.panes(),i=t.length;i--;){var n=t[i];n.containsMainSeries()&&(e+=n.height())}return e},g.prototype.update=function(){this._invalidated=!0},g.prototype.updateImpl=function(){this._setStackStudies();var e=this,t=this._study.data(),i=this._model.timeScale(),n=i.visibleBarsStrictRange(),r=this._model.mainSeries().bars(),o=this._study.priceScale(),s=this._model.mainSeries().firstBar();if(o&&!o.isEmpty()&&!i.isEmpty()&&s&&t){0,this._hideLollipops=!1,this.closeTooltips();var a=this._getY(),l=n.firstBar(),c=n.lastBar();t.range(l,c).each((function(t,n){for(var s=0,u=0;ul&&t")+", line "+e.lineno+", col "+e.colno+".\nError: "+n(e.error))}),!1),window.addEventListener("unhandledrejection",(function(e){var t=(new Date).toISOString();window.__tv_js_errors.push(t+" Unhandled rejection.\nReason: "+n(e.reason))}),!1),document.addEventListener("securitypolicyviolation",(function(e){var t,i,r=(new Date).toISOString(),o="report"===e.disposition?"CSP report-only":"CSP violation";window.__tv_js_errors.push(r+" "+o+": "+(e.violatedDirective||e.effectiveDirective)+". "+(e.sourceFile||"")+", line "+(null!==(t=e.lineno)&&void 0!==t?t:e.lineNumber)+", col "+(null!==(i=e.colno)&&void 0!==i?i:e.columnNumber)+".\nBlocked URI: "+(e.blockedURL||e.blockedURI)+"\nSample: "+e.sample+"\nTarget: "+n(e.target))}),!1)}i.r(t),i.d(t,"install",(function(){return r}))},wGNx:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"RiskRewardPointIndex",(function(){return n})),function(e){e[e.Entry=0]="Entry",e[e.Close=1]="Close",e[e.ActualEntry=2]="ActualEntry",e[e.ActualClose=3]="ActualClose"}(n||(n={}))},wOSo:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i("IWXC"),r=i("aIyQ"),o=i.n(r),s=i("e3/o"),a=function(){function e(){this._quotes=null,this._quoteSessionSymbol=null,this._quoteSessionClientId="",this._quotesUpdate=new o.a,this._quoteSymbolChanged=new o.a}return e.prototype.setQuotesSessionSymbol=function(e){this._quoteSessionSymbol!==e&&(this._quoteSessionClientId||(this._quoteSessionClientId="series-"+Object(s.guid)()),this._unsubscribeQuoteSession(),this._quotes=null,e&&(this._quoteSessionSymbol=e,Object(n.getQuoteSessionInstance)("full").subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,this._onUpdate.bind(this))),this._quoteSymbolChanged.fire())},e.prototype.quotesUpdate=function(){return this._quotesUpdate},e.prototype.quoteSymbolChanged=function(){return this._quoteSymbolChanged},e.prototype.quotes=function(){return this._quotes},e.prototype.destroy=function(){ this._unsubscribeQuoteSession()},e.prototype._onUpdate=function(e,t){this._quotes=e&&e.values||null,t&&t.values&&this._quotesUpdate.fire(e,t)},e.prototype._unsubscribeQuoteSession=function(){this._quoteSessionSymbol&&(Object(n.getQuoteSessionInstance)("full").unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=null,this._quotes=null)},e}()},wZIs:function(e,t,i){"use strict";var n=i("dfhE"),r=i("rCHB").LineToolPitchforkStyle,o=i("Ye2/").LineToolBarsPatternMode,s=i("23IT").LineStudyPlotStyle,a=i("8OdW"),l=i("oXaB").PriceAxisLastValueMode,c=i("XXdw").StoriesTimeLineItemType,u=i("4o++").MagnetMode,h=i("a7Ha").LineEnd,d=i("4vW/").ColorType,p=i("bKFv").StatsPosition,f=i("KUek").sessionsPreferencesDefault,_=i("txPx").getLogger("Chart.Defaults"),m=i("zDbI").CHART_FONT_FAMILY,v=function(e){var t=function(e,t){return{color:e,visible:t}},i=function(e,t,i){return{coeff:e,color:t,visible:i}},_=function(e,t,i,n,r){return{coeff:e,color:t,visible:i,linestyle:void 0===n?CanvasEx.LINESTYLE_SOLID:n,linewidth:void 0===r?1:r}},v=function(e,t,i){return{color:e,width:i,visible:t}},y=function(e,t,i,n,r){return{color:e,visible:t,width:i,x:n,y:r}},S=function(e,t,i,n,r,o){return{coeff1:e,coeff2:t,color:i,visible:n,linestyle:void 0===r?CanvasEx.LINESTYLE_SOLID:r,linewidth:void 0===o?1:o}};if(void 0===TradingView.defaultProperties){var w;switch(window.locale){case"ar_AE":w="Asia/Dubai";break;case"au":w="Australia/Sydney";break;case"br":w="America/Sao_Paulo";break;case"ca":w="America/Toronto";break;case"de_DE":case"it":w="Europe/Berlin";break;case"es":w="Europe/Madrid";break;case"fa_IR":w="Asia/Tehran";break;case"fr":case"sv_SE":w="Europe/Paris";break;case"he_IL":case"tr":w="Europe/Athens";break;case"hu_HU":case"pl":w="Europe/Warsaw";break;case"id":case"th_TH":case"vi_VN":w="Asia/Bangkok";break;case"in":w="Asia/Kolkata";break;case"ja":case"kr":w="Asia/Tokyo";break;case"ms_MY":w="Asia/Singapore";break;case"ru":w="Europe/Moscow";break;case"uk":w="Europe/London";break;case"zh_CN":case"zh_TW":w="Asia/Shanghai";break;default:w="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:w,priceScaleSelectionStrategyName:"auto",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:{backgroundType:d.Solid,background:"#ffffff",backgroundGradientStartColor:"#ffffff",backgroundGradientEndColor:"#ffffff",vertGridProperties:{color:"rgba(42, 46, 57, 0.06)",style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"rgba(42, 46, 57, 0.06)",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"#758696",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:10,bottomMargin:8,axisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,indexedTo100:!1,log:!1,logDisabled:!1,alignLabels:!0,isInverted:!1},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0, showBarChange:!0,showBackground:!0,backgroundTransparency:50,wrapText:!1}},scalesProperties:{backgroundColor:"#ffffff",lineColor:"rgba(42, 46, 57, 0.14)",textColor:"#131722",fontSize:12,scaleSeriesOnly:!1,showSeriesLastValue:!0,seriesLastValueMode:l.LastValueAccordingToScale,showSeriesPrevCloseValue:!1,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1,showBidAskLabels:!1,showPrePostMarketPriceLabel:!0,showFundamentalNameLabel:!1,showFundamentalLastValue:!1,barSpacing:a.DEFAULT_BAR_SPACING,showCurrency:!0},mainSeriesProperties:{style:n.STYLE_CANDLES,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"rgba( 235, 77, 92, 1)",style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,bidAsk:{visible:!1,lineStyle:CanvasEx.LINESTYLE_DOTTED,lineWidth:1,bidLineColor:"#2196F3",askLineColor:"#EF5350"},prePostMarket:{visible:!0,lineStyle:CanvasEx.LINESTYLE_DOTTED,lineWidth:1,preMarketColor:"#fb8c00",postMarketColor:"#2196f3"},highLowAvgPrice:{highLowPriceLinesVisible:!1,highLowPriceLabelsVisible:!1,averageClosePriceLineVisible:!1,averageClosePriceLabelVisible:!1},showInDataWindow:!0,visible:!0,showPriceLine:!0,priceLineWidth:1,priceLineColor:"",baseLineColor:"#B2B5BE",showPrevClosePriceLine:!1,prevClosePriceLineWidth:1,prevClosePriceLineColor:"rgba( 85, 85, 85, 1)",minTick:"default",extendedHours:!1,dividendsAdjustment:void 0,sessVis:!1,statusViewStyle:{fontSize:16,showExchange:!0,showInterval:!0,symbolTextSource:"description"},candleStyle:{upColor:"#26a69a",downColor:"#ef5350",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350",barColorsOnPrevClose:!1,drawBody:!0},hollowCandleStyle:{upColor:"#26a69a",downColor:"#ef5350",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"#26a69a",wickDownColor:"#ef5350",drawBody:!0},haStyle:{upColor:"#26a69a",downColor:"#ef5350",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"#26a69a",wickDownColor:"#ef5350",showRealLastPrice:!1,barColorsOnPrevClose:!1,inputs:{},inputInfo:{},drawBody:!0},barStyle:{upColor:"#26a69a",downColor:"#ef5350",barColorsOnPrevClose:!1,dontDrawOpen:!1,thinBars:!0},hiloStyle:{color:"#2196f3",showBorders:!0,borderColor:"#2196f3",showLabels:!0,labelColor:"#2196f3",fontSize:7,drawBody:!0},lineStyle:{color:"#2196f3",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,priceSource:"close",styleType:n.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba(33, 150, 243, 0.28)",color2:"#2196f3",linecolor:"#2196f3",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,priceSource:"close",transparency:100},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,indexedTo100:!1,log:!1,logDisabled:!1,isInverted:!1,alignLabels:!0},renkoStyle:{ upColor:"#26a69a",downColor:"#ef5350",borderUpColor:"#26a69a",borderDownColor:"#ef5350",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",wickUpColor:"#26a69a",wickDownColor:"#ef5350",inputs:{source:"close",sources:"Close",boxSize:3,style:"ATR",atrLength:14,wicks:!0},inputInfo:{source:{name:"source"},sources:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR length"},wicks:{name:"Wicks"}}},pbStyle:{upColor:"#26a69a",downColor:"#ef5350",borderUpColor:"#26a69a",borderDownColor:"#ef5350",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{upColor:"#26a69a",downColor:"#ef5350",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",style:"ATR",atrLength:14,reversalAmount:1},inputInfo:{source:{name:"Source"},style:{name:"Style"},atrLength:{name:"ATR length"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"#26a69a",downColor:"#ef5350",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{sources:"Close",reversalAmount:3,boxSize:1,style:"ATR",atrLength:14,oneStepBackBuilding:!1},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR length"},oneStepBackBuilding:{name:"One step back building"}}},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 38, 166, 154, 0.28)",topFillColor2:"rgba( 38, 166, 154, 0.05)",bottomFillColor1:"rgba( 239, 83, 80, 0.05)",bottomFillColor2:"rgba( 239, 83, 80, 0.28)",topLineColor:"rgba( 38, 166, 154, 1)",bottomLineColor:"rgba( 239, 83, 80, 1)",topLineWidth:2,bottomLineWidth:2,priceSource:"close",transparency:50,baseLevelPercentage:50},rangeStyle:{upColor:"#26a69a",downColor:"#ef5350",thinBars:!0,upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{range:10,phantomBars:!1},inputInfo:{range:{name:"Range"},phantomBars:{name:"Phantom bars"}}}},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_DOTTED},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},sessions:f,drawings:{magnet:!1,magnetMode:u.WeakMagnet,stayInDrawingMode:!1,drawOnAllCharts:!0},linetoolorder:{extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 255, 0, 0, 1)",lineActiveBuyColor:"rgb(64,148,232)",lineInactiveBuyColor:"rgba(64,148,232,.5)",lineActiveSellColor:"rgb(231,86,86)", lineInactiveSellColor:"rgba(231,86,86,.5)",lineStyle:"inherit",lineWidth:"inherit",bodyBorderActiveBuyColor:"rgb(64,148,232)",bodyBorderInactiveBuyColor:"rgba(64,148,232,.5)",bodyBorderActiveSellColor:"rgb(231,86,86)",bodyBorderInactiveSellColor:"rgba(231,86,86,.5)",bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextInactiveLimitColor:"rgba(38,140,2,.5)",bodyTextActiveLimitColor:"rgb(38,140,2)",bodyTextInactiveStopColor:"rgba(231,86,86,.5)",bodyTextActiveStopColor:"rgb(231,86,86)",bodyTextInactiveBuyColor:"rgba(64,148,232,.5)",bodyTextActiveBuyColor:"rgb(64,148,232)",bodyTextInactiveSellColor:"rgba(231,86,86,.5)",bodyTextActiveSellColor:"rgb(231,86,86)",bodyFontFamily:"Verdana",bodyFontSize:9,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderActiveBuyColor:"rgb(64,148,232)",quantityBorderInactiveBuyColor:"rgba(64,148,232,.5)",quantityBorderActiveSellColor:"rgb(231,86,86)",quantityBorderInactiveSellColor:"rgba(231,86,86,.5)",quantityBackgroundInactiveBuyColor:"rgba(64,148,232,.5)",quantityBackgroundActiveBuyColor:"rgb(64,148,232)",quantityBackgroundInactiveSellColor:"rgba(231,86,86,.5)",quantityBackgroundActiveSellColor:"rgb(231,86,86)",quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:9,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderActiveBuyColor:"rgb(64,148,232)",cancelButtonBorderInactiveBuyColor:"rgba(64,148,232,.5)",cancelButtonBorderActiveSellColor:"rgb(231,86,86)",cancelButtonBorderInactiveSellColor:"rgba(231,86,86,.5)",cancelButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",cancelButtonBackgroundTransparency:25,cancelButtonIconActiveBuyColor:"rgb(64,148,232)",cancelButtonIconInactiveBuyColor:"rgba(64,148,232,.5)",cancelButtonIconActiveSellColor:"rgb(231,86,86)",cancelButtonIconInactiveSellColor:"rgba(231,86,86,.5)",tooltip:"",modifyTooltip:"",cancelTooltip:""},linetoolposition:{extendLeft:"inherit",lineLength:"inherit",lineBuyColor:"rgb(64,148,232)",lineSellColor:"rgb(231,86,86)",lineStyle:"inherit",lineWidth:"inherit",bodyBorderBuyColor:"rgb(64,148,232)",bodyBorderSellColor:"rgb(231,86,86)",bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextPositiveColor:"rgb(38,140,2)",bodyTextNeutralColor:"rgb(100,100,100)",bodyTextNegativeColor:"rgb(231,86,86)",bodyFontFamily:"Verdana",bodyFontSize:9,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderBuyColor:"rgb(64,148,232)",quantityBorderSellColor:"rgb(231,86,86)",quantityBackgroundBuyColor:"rgb(64,148,232)",quantityBackgroundSellColor:"rgb(231,86,86)",quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:9,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderBuyColor:"rgb(64,148,232)",reverseButtonBorderSellColor:"rgb(231,86,86)",reverseButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",reverseButtonBackgroundTransparency:25,reverseButtonIconBuyColor:"rgb(64,148,232)",reverseButtonIconSellColor:"rgb(231,86,86)", closeButtonBorderBuyColor:"rgb(64,148,232)",closeButtonBorderSellColor:"rgb(231,86,86)",closeButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",closeButtonBackgroundTransparency:25,closeButtonIconBuyColor:"rgb(64,148,232)",closeButtonIconSellColor:"rgb(231,86,86)",tooltip:"",protectTooltip:"",closeTooltip:"",reverseTooltip:""},linetoolexecution:{direction:"buy",arrowHeight:8,arrowSpacing:1,arrowBuyColor:"#4094e8",arrowSellColor:"#e75656",text:"",textColor:"rgba( 0, 0, 0, 1)",textTransparency:0,fontFamily:"Verdana",fontSize:10,fontBold:!1,fontItalic:!1,tooltip:""},linetoolicon:{color:"rgba( 61, 133, 198, 1)",size:40,icon:61720,angle:.5*Math.PI,scale:1},linetoolimage:{transparency:.5},linetoolbezierquadro:{linecolor:"#2196f3",linewidth:1,fillBackground:!1,backgroundColor:"rgba(33, 150, 243, 0.2)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:h.Normal,rightEnd:h.Normal},linetoolbeziercubic:{linecolor:"#00bcd4",linewidth:1,fillBackground:!1,backgroundColor:"rgba(0, 188, 212, 0.2)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:h.Normal,rightEnd:h.Normal},linetooltrendline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:h.Normal,rightEnd:h.Normal,showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",font:"Verdana",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:p.Right},linetoolinfoline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:h.Normal,rightEnd:h.Normal,font:"Verdana",showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!0,showMiddlePoint:!1,showPriceRange:!0,showBarsRange:!0,showDateTimeRange:!0,showDistance:!0,showAngle:!0,statsPosition:p.Center},linetooltimecycles:{linecolor:"rgba(21, 153, 128, 1)",linewidth:1,fillBackground:!0,backgroundColor:"rgba(106, 168, 79, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolsineline:{linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooltrendangle:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"rgba(33, 150, 243, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1,statsPosition:p.Right},linetooldisjointangle:{linecolor:"rgba(0, 150, 136, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba(0, 150, 136, 0.2)",transparency:20,extendLeft:!1,extendRight:!1,leftEnd:h.Normal,rightEnd:h.Normal,font:"Verdana",textcolor:"rgba(0, 150, 136, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1}, linetoolflatbottom:{linecolor:"rgba(171, 71, 188, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba(171, 71, 188, 0.2)",transparency:20,extendLeft:!1,extendRight:!1,leftEnd:h.Normal,rightEnd:h.Normal,font:"Verdana",textcolor:"rgba(171, 71, 188, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolfibspiral:{counterclockwise:!1,linecolor:"rgba(0, 150, 136, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooldaterange:{linecolor:"rgba(30,136,229,1)",linewidth:1,font:m,textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba(30,136,229,0.9)",fillBackground:!0,backgroundColor:"rgba(30,136,229,0.2)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba(30,136,229,0.9)",extendTop:!1,extendBottom:!1},linetoolpricerange:{linecolor:"rgba(30,136,229,1)",linewidth:1,font:m,textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba(30,136,229,0.9)",fillBackground:!0,backgroundColor:"rgba(30,136,229,0.2)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba(30,136,229,0.9)",extendLeft:!1,extendRight:!1},linetooldateandpricerange:{linecolor:"rgba(30,136,229,1)",linewidth:1,font:m,textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba(30,136,229,0.9)",fillBackground:!0,backgroundColor:"rgba(30,136,229,0.2)",backgroundTransparency:60,borderWidth:1,drawBorder:!1,borderColor:"rgba(30,136,229,1)"},linetoolriskrewardshort:{linecolor:"rgba(120, 123, 134, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",fillBackground:!0,stopBackground:"rgba(244, 67, 54, 0.2)",profitBackground:"rgba(0, 150, 136, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25,alwaysShowStats:!1,showPriceLabels:!0},linetoolriskrewardlong:{linecolor:"rgba(120, 123, 134, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",fillBackground:!0,stopBackground:"rgba(244, 67, 54, 0.2)",profitBackground:"rgba(0, 150, 136, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25,alwaysShowStats:!1,showPriceLabels:!0},linetoolarrow:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:h.Normal,rightEnd:h.Arrow,font:"Verdana",showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:p.Right},linetoolray:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1, linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!0,leftEnd:h.Normal,rightEnd:h.Normal,font:"Verdana",showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:p.Right},linetoolextended:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!0,extendRight:!0,leftEnd:h.Normal,rightEnd:h.Normal,font:"Verdana",showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:"#2196f3",fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:p.Right},linetoolhorzline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,font:"Verdana",textcolor:"rgba(33, 150, 243, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolhorzray:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,font:"Verdana",textcolor:"rgba(33, 150, 243, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLine:!0,showTime:!0,showLabel:!1,horzLabelsAlign:"right",vertLabelsAlign:"top",font:"Verdana",textcolor:"#2196f3",textOrientation:"vertical",fontsize:14,bold:!1,italic:!1},linetoolcrossline:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showTime:!0},linetoolcirclelines:{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",baselinecolor:"rgba( 128, 128, 128, 1)",linecolor:"rgba( 0, 85, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showLabels:!0,font:m,fillBackground:!1,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:_(0,"rgba(120, 123, 134, 1)",!0),level2:_(1,"rgba(33, 150, 243, 1)",!0),level3:_(2,"rgba(33, 150, 243, 1)",!0),level4:_(3,"rgba(33, 150, 243, 1)",!0),level5:_(5,"rgba(33, 150, 243, 1)",!0),level6:_(8,"rgba(33, 150, 243, 1)",!0),level7:_(13,"rgba(33, 150, 243, 1)",!0),level8:_(21,"rgba(33, 150, 243, 1)",!0),level9:_(34,"rgba(33, 150, 243, 1)",!0),level10:_(55,"rgba(33, 150, 243, 1)",!0),level11:_(89,"rgba(33, 150, 243, 1)",!0)},linetooltext:{color:"#2196f3",font:"Verdana",fontsize:14,fillBackground:!1,backgroundColor:"rgba( 91, 133, 191, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:200},linetooltextabsolute:{color:"#2196f3",font:"Verdana",fontsize:14,fillBackground:!1, backgroundColor:"rgba( 155, 190, 213, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,fixedSize:!1,wordWrap:!1,wordWrapWidth:200},linetoolballoon:{color:"#ffffff",backgroundColor:"rgba(156, 39, 176, 0.7)",borderColor:"rgba(156, 39, 176, 0.0)",fontsize:14,transparency:30},linetoolbrush:{linecolor:"#00bcd4",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,smooth:5,fillBackground:!1,backgroundColor:"rgba(0, 188, 212, 0.5)",transparency:50,leftEnd:h.Normal,rightEnd:h.Normal},linetoolhighlighter:{linecolor:"rgba(236, 64, 122, 0.15)",smooth:5,transparency:85},linetoolpolyline:{linecolor:"#7e57c2",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba(126, 87, 194, 0.2)",transparency:50,filled:!1},linetoolsignpost:{itemType:c.Emoji,imageURL:"https://twemoji.maxcdn.com/v/13.0.1/72x72/1f642.png",showImage:!1,plateColor:"#2962FF",fontSize:12,bold:!1,italic:!1},linetoolpath:{lineColor:"#2196f3",lineWidth:2,lineStyle:CanvasEx.LINESTYLE_SOLID,leftEnd:h.Normal,rightEnd:h.Arrow},linetoolarrowmarkleft:{color:"#2196F3",arrowColor:"#2196F3",fontsize:20,font:m,bold:!1,italic:!1,showLabel:!0},linetoolarrowmarkup:{color:"#009688",arrowColor:"#009688",fontsize:20,font:m,bold:!1,italic:!1,showLabel:!0},linetoolarrowmarkright:{color:"#2196F3",arrowColor:"#2196F3",fontsize:20,font:m,bold:!1,italic:!1,showLabel:!0},linetoolarrowmarkdown:{color:"#E53935",arrowColor:"#E53935",fontsize:20,font:m,bold:!1,italic:!1,showLabel:!0},linetoolflagmark:{flagColor:"#2196F3"},linetoolnote:{markerColor:"#2196f3",textColor:"#ffffff",backgroundColor:"rgba(33, 150, 243, 0.7)",backgroundTransparency:0,borderColor:"#2196f3",font:"Verdana",fontSize:14,bold:!1,italic:!1,fixedSize:!0},linetoolnoteabsolute:{markerColor:"#2196f3",textColor:"#ffffff",backgroundColor:"rgba(33, 150, 243, 0.7)",backgroundTransparency:0,borderColor:"#2196f3",font:"Verdana",fontSize:14,bold:!1,italic:!1,fixedSize:!0},linetoolpricelabel:{color:"#ffffff",backgroundColor:"#2196f3",borderColor:"#2196f3",fontWeight:"bold",fontsize:14,font:m,transparency:0},linetoolpricenote:{showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textColor:"#2962FF",fontSize:14,bold:!1,italic:!1,snapTo45Degrees:!0,lineColor:"#2962FF",priceLabelBackgroundColor:"#2962FF",priceLabelBorderColor:"#2962FF",priceLabelTextColor:"#ffffff",priceLabelFontSize:12,priceLabelBold:!1,priceLabelItalic:!1},linetoolarrowmarker:{backgroundColor:"#1E88E5",textColor:"#1E88E5",font:m,bold:!0,italic:!1,fontsize:16,showLabel:!0},linetoolrectangle:{color:"#9c27b0",fillBackground:!0,backgroundColor:"rgba(156, 39, 176, 0.2)",linewidth:1,snapTo45Degrees:!0,transparency:50,showLabel:!1,horzLabelsAlign:"left",vertLabelsAlign:"bottom",textColor:"#9c27b0",fontSize:14,bold:!1,italic:!1,extendLeft:!1,extendRight:!1},linetoolrotatedrectangle:{color:"#4caf50",fillBackground:!0,backgroundColor:"rgba(76, 175, 80, 0.2)",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolellipse:{color:"#e91e63",fillBackground:!0,backgroundColor:"rgba(233, 30, 99, 0.2)", transparency:50,linewidth:1},linetoolarc:{color:"#ab47bc",fillBackground:!0,backgroundColor:"rgba(171, 71, 188, 0.2)",transparency:50,linewidth:1},linetoolprediction:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,sourceBackColor:"rgba(33, 150, 243, 1)",sourceTextColor:"rgba(255, 255, 255, 1)",sourceStrokeColor:"rgba(33, 150, 243, 1)",targetStrokeColor:"rgba(33, 150, 243, 1)",targetBackColor:"rgba(33, 150, 243, 1)",targetTextColor:"rgba(255, 255, 255, 1)",successBackground:"rgba(76, 175, 80, 1)",successTextColor:"rgba(255, 255, 255, 1)",failureBackground:"rgba(244, 67, 54, 1)",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:{color:"#f57c00",fillBackground:!0,backgroundColor:"rgba(245, 124, 0, 0.2)",transparency:50,linewidth:1},linetoolcallout:{color:"#ffffff",backgroundColor:"rgba(0, 151, 167, 0.7)",transparency:50,linewidth:1,fontsize:14,font:"Verdana",bordercolor:"rgba(0, 151, 167, 1)",bold:!1,italic:!1,wordWrap:!1,wordWrapWidth:200},linetoolparallelchannel:{linecolor:"rgba(33, 150, 243, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:"rgba(33, 150, 243, 0.2)",transparency:20,showMidline:!0,midlinecolor:"rgba(33, 150, 243, 1)",midlinewidth:1,midlinestyle:CanvasEx.LINESTYLE_DASHED},linetoolelliottimpulse:{degree:7,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliotttriangle:{degree:7,showWave:!0,color:"rgba( 255, 152, 0, 1)",linewidth:1},linetoolelliotttriplecombo:{degree:7,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolelliottcorrection:{degree:7,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliottdoublecombo:{degree:7,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolbarspattern:{color:"rgba(33, 150, 243, 1)",mode:o.Bars,mirrored:!1,flipped:!1},linetoolghostfeed:{averageHL:20,variance:50,candleStyle:{upColor:"rgba(178, 223, 219, 1)",downColor:"rgba(239, 154, 154, 1)",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"rgba(0, 150, 136, 1)",borderDownColor:"rgba(244, 67, 54, 1)",wickColor:"rgba(120, 123, 134, 1)"},transparency:50},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},graphics:{},showInDataWindow:!0,visible:!0,showStudyArguments:!0,precision:"default"},linetoolpitchfork:{fillBackground:!0,transparency:80,style:r.Original,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},extendLines:!1,level0:_(.25,"rgba(255, 183, 77, 1)",!1),level1:_(.382,"rgba(129, 199, 132, 1)",!1),level2:_(.5,"rgba(76, 175, 80, 1)",!0),level3:_(.618,"rgba(0, 150, 136, 1)",!1),level4:_(.75,"rgba(100, 181, 246, 1)",!1),level5:_(1,"rgba(33, 150, 243, 1)",!0),level6:_(1.5,"rgba(156, 39, 176, 1)",!1),level7:_(1.75,"rgba(233, 30, 99, 1)",!1),level8:_(2,"rgba(229, 115, 115, 1)",!1)},linetoolpitchfan:{fillBackground:!0,transparency:80,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1, linestyle:CanvasEx.LINESTYLE_SOLID},level0:_(.25,"rgba(255, 183, 77, 1)",!1),level1:_(.382,"rgba(129, 199, 132, 1)",!1),level2:_(.5,"rgba(76, 175, 80, 1)",!0),level3:_(.618,"rgba(0, 150, 136, 1)",!1),level4:_(.75,"rgba(100, 181, 246, 1)",!1),level5:_(1,"rgba(33, 150, 243, 1)",!0),level6:_(1.5,"rgba(156, 39, 176, 1)",!1),level7:_(1.75,"rgba(233, 30, 99, 1)",!1),level8:_(2,"rgba(229, 115, 115, 1)",!1)},linetoolgannfan:{showLabels:!0,font:"Verdana",fillBackground:!0,transparency:80,level1:S(1,8,"rgba(255, 183, 77, 1)",!0),level2:S(1,4,"rgba(129, 199, 132, 1)",!0),level3:S(1,3,"rgba(76, 175, 80, 1)",!0),level4:S(1,2,"rgba(0, 150, 136, 1)",!0),level5:S(1,1,"rgba(100, 181, 246, 1)",!0),level6:S(2,1,"rgba(33, 150, 243, 1)",!0),level7:S(3,1,"rgba(156, 39, 176, 1)",!0),level8:S(4,1,"rgba(233, 30, 99, 1)",!0),level9:S(8,1,"rgba(229, 115, 115, 1)",!0)},linetoolganncomplex:{fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,scaleRatio:"",showLabels:!0,labelsStyle:{font:m,fontSize:12,bold:!1,italic:!1},levels:[v("rgba(120, 123, 134, 1)",!0,1),v("rgba(255, 152, 0, 1)",!0,1),v("rgba(129, 199, 132, 1)",!0,1),v("rgba(76, 175, 80, 1)",!0,1),v("rgba(0, 150, 136, 1)",!0,1),v("rgba(120, 123, 134, 1)",!0,1)],fanlines:[y("rgba(179, 157, 219, 1)",!1,1,8,1),y("rgba(244, 67, 54, 1)",!1,1,5,1),y("rgba(120, 123, 134, 1)",!1,1,4,1),y("rgba(255, 152, 0, 1)",!1,1,3,1),y("rgba(129, 199, 132, 1)",!0,1,2,1),y("rgba(76, 175, 80, 1)",!0,1,1,1),y("rgba(0, 150, 136, 1)",!0,1,1,2),y("rgba(0, 150, 136, 1)",!1,1,1,3),y("rgba(33, 150, 243, 1)",!1,1,1,4),y("rgba(149, 117, 205, 1)",!1,1,1,5),y("rgba(179, 157, 219, 1)",!1,1,1,8)],arcs:[y("rgba(255, 152, 0, 1)",!0,1,1,0),y("rgba(255, 152, 0, 1)",!0,1,1,1),y("rgba(255, 152, 0, 1)",!0,1,1.5,0),y("rgba(129, 199, 132, 1)",!0,1,2,0),y("rgba(129, 199, 132, 1)",!0,1,2,1),y("rgba(76, 175, 80, 1)",!0,1,3,0),y("rgba(76, 175, 80, 1)",!0,1,3,1),y("rgba(0, 150, 136, 1)",!0,1,4,0),y("rgba(0, 150, 136, 1)",!0,1,4,1),y("rgba(33, 150, 243, 1)",!0,1,5,0),y("rgba(33, 150, 243, 1)",!0,1,5,1)]},linetoolgannfixed:{fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,levels:[v("rgba(120, 123, 134, 1)",!0,1),v("rgba(255, 152, 0, 1)",!0,1),v("rgba(129, 199, 132, 1)",!0,1),v("rgba(76, 175, 80, 1)",!0,1),v("rgba(0, 150, 136, 1)",!0,1),v("rgba(120, 123, 134, 1)",!0,1)],fanlines:[y("rgba(179, 157, 219, 1)",!1,1,8,1),y("rgba(244, 67, 54, 1)",!1,1,5,1),y("rgba(120, 123, 134, 1)",!1,1,4,1),y("rgba(255, 152, 0, 1)",!1,1,3,1),y("rgba(129, 199, 132, 1)",!0,1,2,1),y("rgba(76, 175, 80, 1)",!0,1,1,1),y("rgba(0, 150, 136, 1)",!0,1,1,2),y("rgba(0, 150, 136, 1)",!1,1,1,3),y("rgba(33, 150, 243, 1)",!1,1,1,4),y("rgba(149, 117, 205, 1)",!1,1,1,5),y("rgba(179, 157, 219, 1)",!1,1,1,8)], arcs:[y("rgba(255, 152, 0, 1)",!0,1,1,0),y("rgba(255, 152, 0, 1)",!0,1,1,1),y("rgba(255, 152, 0, 1)",!0,1,1.5,0),y("rgba(129, 199, 132, 1)",!0,1,2,0),y("rgba(129, 199, 132, 1)",!0,1,2,1),y("rgba(76, 175, 80, 1)",!0,1,3,0),y("rgba(76, 175, 80, 1)",!0,1,3,1),y("rgba(0, 150, 136, 1)",!0,1,4,0),y("rgba(0, 150, 136, 1)",!0,1,4,1),y("rgba(33, 150, 243, 1)",!0,1,5,0),y("rgba(33, 150, 243, 1)",!0,1,5,1)]},linetoolgannsquare:{color:"rgba( 21, 56, 153, 0.8)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:m,showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,reverse:!1,fans:t("rgba(149, 152, 161, 1)",!1),hlevel1:i(0,"rgba(120, 123, 134, 1)",!0),hlevel2:i(.25,"rgba(245, 124, 0, 1)",!0),hlevel3:i(.382,"rgba(129, 199, 132, 1)",!0),hlevel4:i(.5,"rgba(76, 175, 80, 1)",!0),hlevel5:i(.618,"rgba(0, 150, 136, 1)",!0),hlevel6:i(.75,"rgba(33, 150, 243, 1)",!0),hlevel7:i(1,"rgba(120, 123, 134, 1)",!0),vlevel1:i(0,"rgba(120, 123, 134, 1)",!0),vlevel2:i(.25,"rgba(245, 124, 0, 1)",!0),vlevel3:i(.382,"rgba(129, 199, 132, 1)",!0),vlevel4:i(.5,"rgba(76, 175, 80, 1)",!0),vlevel5:i(.618,"rgba(0, 150, 136, 1)",!0),vlevel6:i(.75,"rgba(33, 150, 243, 1)",!0),vlevel7:i(1,"rgba(120, 123, 134, 1)",!0)},linetoolfibspeedresistancefan:{fillBackground:!0,transparency:80,grid:{color:"rgba( 21, 56, 153, 0.8)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,visible:!0},linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:m,showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,snapTo45Degrees:!0,reverse:!1,hlevel1:i(0,"rgba(120, 123, 134, 1)",!0),hlevel2:i(.25,"rgba(245, 124, 0, 1)",!0),hlevel3:i(.382,"rgba(129, 199, 132, 1)",!0),hlevel4:i(.5,"rgba(76, 175, 80, 1)",!0),hlevel5:i(.618,"rgba(0, 150, 136, 1)",!0),hlevel6:i(.75,"rgba(33, 150, 243, 1)",!0),hlevel7:i(1,"rgba(120, 123, 134, 1)",!0),vlevel1:i(0,"rgba(120, 123, 134, 1)",!0),vlevel2:i(.25,"rgba(245, 124, 0, 1)",!0),vlevel3:i(.382,"rgba(129, 199, 132, 1)",!0),vlevel4:i(.5,"rgba(76, 175, 80, 1)",!0),vlevel5:i(.618,"rgba(0, 150, 136, 1)",!0),vlevel6:i(.75,"rgba(33, 150, 243, 1)",!0),vlevel7:i(1,"rgba(120, 123, 134, 1)",!0)},linetoolfibretracement:{showCoeffs:!0,showPrices:!0,font:m,fillBackground:!0,transparency:80,extendLines:!1,extendLinesLeft:!1,horzLabelsAlign:"left",vertLabelsAlign:"bottom",reverse:!1,coeffsAsPercents:!1,fibLevelsBasedOnLogScale:!1,trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:i(0,"rgba(120, 123, 134, 1)",!0),level2:i(.236,"rgba(244, 67, 54, 1)",!0),level3:i(.382,"rgba(129, 199, 132, 1)",!0),level4:i(.5,"rgba(76, 175, 80, 1)",!0),level5:i(.618,"rgba(0, 150, 136, 1)",!0),level6:i(.786,"rgba(100, 181, 246, 1)",!0),level7:i(1,"rgba(120, 123, 134, 1)",!0),level8:i(1.618,"rgba(33, 150, 243, 1)",!0),level9:i(2.618,"rgba(244, 67, 54, 1)",!0),level10:i(3.618,"rgba(156, 39, 176, 1)",!0),level11:i(4.236,"rgba(233, 30, 99, 1)",!0), level12:i(1.272,"rgba(129, 199, 132, 1)",!1),level13:i(1.414,"rgba(244, 67, 54, 1)",!1),level16:i(2,"rgba(0, 150, 136, 1)",!1),level14:i(2.272,"rgba(129, 199, 132, 1)",!1),level15:i(2.414,"rgba(76, 175, 80, 1)",!1),level17:i(3,"rgba(100, 181, 246, 1)",!1),level18:i(3.272,"rgba(120, 123, 134, 1)",!1),level19:i(3.414,"rgba(33, 150, 243, 1)",!1),level20:i(4,"rgba( 204, 40, 40, 1)",!1),level21:i(4.272,"rgba(156, 39, 176, 1)",!1),level22:i(4.414,"rgba(233, 30, 99, 1)",!1),level23:i(4.618,"rgba(129, 199, 132, 1)",!1),level24:i(4.764,"rgba(0, 150, 136, 1)",!1)},linetoolfibchannel:{showCoeffs:!0,showPrices:!0,font:m,fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",coeffsAsPercents:!1,levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:i(0,"rgba(120, 123, 134, 1)",!0),level2:i(.236,"rgba(244, 67, 54, 1)",!0),level3:i(.382,"rgba(129, 199, 132, 1)",!0),level4:i(.5,"rgba(76, 175, 80, 1)",!0),level5:i(.618,"rgba(0, 150, 136, 1)",!0),level6:i(.786,"rgba(100, 181, 246, 1)",!0),level7:i(1,"rgba(120, 123, 134, 1)",!0),level8:i(1.618,"rgba(33, 150, 243, 1)",!0),level9:i(2.618,"rgba(244, 67, 54, 1)",!0),level10:i(3.618,"rgba(156, 39, 176, 1)",!0),level11:i(4.236,"rgba(233, 30, 99, 1)",!0),level12:i(1.272,"rgba(129, 199, 132, 1)",!1),level13:i(1.414,"rgba(244, 67, 54, 1)",!1),level16:i(2,"rgba(0, 150, 136, 1)",!1),level14:i(2.272,"rgba(129, 199, 132, 1)",!1),level15:i(2.414,"rgba(76, 175, 80, 1)",!1),level17:i(3,"rgba(100, 181, 246, 1)",!1),level18:i(3.272,"rgba(120, 123, 134, 1)",!1),level19:i(3.414,"rgba(33, 150, 243, 1)",!1),level20:i(4,"rgba( 204, 40, 40, 1)",!1),level21:i(4.272,"rgba(156, 39, 176, 1)",!1),level22:i(4.414,"rgba(233, 30, 99, 1)",!1),level23:i(4.618,"rgba(129, 199, 132, 1)",!1),level24:i(4.764,"rgba(0, 150, 136, 1)",!1)},linetoolprojection:{showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,color1:"rgba(33, 150, 243, 0.2)",color2:"rgba(156, 39, 176, 0.2)",linewidth:1,trendline:{visible:!0,color:"rgba(149, 152, 161, 1)",linestyle:CanvasEx.LINESTYLE_SOLID},level1:_(1,"rgba( 128, 128, 128, 1)",!0)},linetool5pointspattern:{color:"#2196F3",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"#2196F3",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:1},linetoolcypherpattern:{color:"#2196F3",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#2196F3",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:1},linetooltrianglepattern:{color:"#673AB7",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#673AB7",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:1},linetoolabcd:{color:"#009688",textcolor:"rgba( 255, 255, 255, 1)",font:"Verdana",fontsize:12,bold:!1,italic:!1,linewidth:1},linetoolthreedrivers:{color:"#673AB7",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},linetoolheadandshoulders:{color:"#009688", textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"#009688",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:1},linetoolfibwedge:{showCoeffs:!0,font:m,fillBackground:!0,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:_(.236,"rgba(244, 67, 54, 1)",!0),level2:_(.382,"rgba(129, 199, 132, 1)",!0),level3:_(.5,"rgba(76, 175, 80, 1)",!0),level4:_(.618,"rgba(0, 150, 136, 1)",!0),level5:_(.786,"rgba(100, 181, 246, 1)",!0),level6:_(1,"rgba(120, 123, 134, 1)",!0),level7:_(1.618,"rgba(33, 150, 243, 1)",!1),level8:_(2.618,"rgba(244, 67, 54, 1)",!1),level9:_(3.618,"rgba(103, 58, 183, 1)",!1),level10:_(4.236,"rgba(233, 30, 99, 1)",!1),level11:_(4.618,"rgba(233, 30, 99, 1)",!1)},linetoolfibcircles:{showCoeffs:!0,font:m,fillBackground:!0,transparency:80,snapTo45Degrees:!0,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:_(.236,"rgba(244, 67, 54, 1)",!0),level2:_(.382,"rgba(129, 199, 132, 1)",!0),level3:_(.5,"rgba(76, 175, 80, 1)",!0),level4:_(.618,"rgba(0, 150, 136, 1)",!0),level5:_(.786,"rgba(100, 181, 246, 1)",!0),level6:_(1,"rgba(120, 123, 134, 1)",!0),level7:_(1.618,"rgba(33, 150, 243, 1)",!0),level8:_(2.618,"rgba(244, 67, 54, 1)",!0),level9:_(3.618,"rgba(103, 58, 183, 1)",!0),level10:_(4.236,"rgba(233, 30, 99, 1)",!0),level11:_(4.618,"rgba(233, 30, 99, 1)",!0)},linetoolfibspeedresistancearcs:{showCoeffs:!0,font:m,fillBackground:!0,transparency:80,fullCircles:!1,trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:_(.236,"rgba(244, 67, 54, 1)",!0),level2:_(.382,"rgba(129, 199, 132, 1)",!0),level3:_(.5,"rgba(76, 175, 80, 1)",!0),level4:_(.618,"rgba(0, 150, 136, 1)",!0),level5:_(.786,"rgba(100, 181, 246, 1)",!0),level6:_(1,"rgba(120, 123, 134, 1)",!0),level7:_(1.618,"rgba(33, 150, 243, 1)",!0),level8:_(2.618,"rgba(244, 67, 54, 1)",!0),level9:_(3.618,"rgba(103, 58, 183, 1)",!0),level10:_(4.236,"rgba(233, 30, 99, 1)",!0),level11:_(4.618,"rgba(233, 30, 99, 1)",!0)},linetooltrendbasedfibextension:{showCoeffs:!0,showPrices:!0,font:m,fillBackground:!0,transparency:80,extendLines:!1,extendLinesLeft:!1,horzLabelsAlign:"left",vertLabelsAlign:"bottom",reverse:!1,coeffsAsPercents:!1,fibLevelsBasedOnLogScale:!1,trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:i(0,"rgba(120, 123, 134, 1)",!0),level2:i(.236,"rgba(244, 67, 54, 1)",!0),level3:i(.382,"rgba(129, 199, 132, 1)",!0),level4:i(.5,"rgba(76, 175, 80, 1)",!0),level5:i(.618,"rgba(0, 150, 136, 1)",!0),level6:i(.786,"rgba(100, 181, 246, 1)",!0),level7:i(1,"rgba(120, 123, 134, 1)",!0),level8:i(1.618,"rgba(33, 150, 243, 1)",!0),level9:i(2.618,"rgba(244, 67, 54, 1)",!0),level10:i(3.618,"rgba(156, 39, 176, 1)",!0),level11:i(4.236,"rgba(233, 30, 99, 1)",!0),level12:i(1.272,"rgba(129, 199, 132, 1)",!1), level13:i(1.414,"rgba(244, 67, 54, 1)",!1),level16:i(2,"rgba(0, 150, 136, 1)",!1),level14:i(2.272,"rgba(129, 199, 132, 1)",!1),level15:i(2.414,"rgba(76, 175, 80, 1)",!1),level17:i(3,"rgba(100, 181, 246, 1)",!1),level18:i(3.272,"rgba(120, 123, 134, 1)",!1),level19:i(3.414,"rgba(33, 150, 243, 1)",!1),level20:i(4,"rgba( 204, 40, 40, 1)",!1),level21:i(4.272,"rgba(156, 39, 176, 1)",!1),level22:i(4.414,"rgba(233, 30, 99, 1)",!1),level23:i(4.618,"rgba(129, 199, 132, 1)",!1),level24:i(4.764,"rgba(0, 150, 136, 1)",!1)},linetooltrendbasedfibtime:{showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:"rgba(120, 123, 134, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:_(0,"rgba(120, 123, 134, 1)",!0),level2:_(.382,"rgba(244, 67, 54, 1)",!0),level3:_(.5,"rgba(129, 199, 132, 1)",!1),level4:_(.618,"rgba(76, 175, 80, 1)",!0),level5:_(1,"rgba(0, 150, 136, 1)",!0),level6:_(1.382,"rgba(100, 181, 246, 1)",!0),level7:_(1.618,"rgba(120, 123, 134, 1)",!0),level8:_(2,"rgba(33, 150, 243, 1)",!0),level9:_(2.382,"rgba(244, 67, 54, 1)",!0),level10:_(2.618,"rgba(156, 39, 176, 1)",!0),level11:_(3,"rgba(233, 30, 99, 1)",!0)},linetoolschiffpitchfork:{fillBackground:!0,transparency:80,style:r.Schiff,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},extendLines:!1,level0:_(.25,"rgba(255, 183, 77, 1)",!1),level1:_(.382,"rgba(129, 199, 132, 1)",!1),level2:_(.5,"rgba(76, 175, 80, 1)",!0),level3:_(.618,"rgba(0, 150, 136, 1)",!1),level4:_(.75,"rgba(100, 181, 246, 1)",!1),level5:_(1,"rgba(33, 150, 243, 1)",!0),level6:_(1.5,"rgba(156, 39, 176, 1)",!1),level7:_(1.75,"rgba(233, 30, 99, 1)",!1),level8:_(2,"rgba(229, 115, 115, 1)",!1)},linetoolschiffpitchfork2:{fillBackground:!0,transparency:80,style:r.Schiff2,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},extendLines:!1,level0:_(.25,"rgba(255, 183, 77, 1)",!1),level1:_(.382,"rgba(129, 199, 132, 1)",!1),level2:_(.5,"rgba(76, 175, 80, 1)",!0),level3:_(.618,"rgba(0, 150, 136, 1)",!1),level4:_(.75,"rgba(100, 181, 246, 1)",!1),level5:_(1,"rgba(33, 150, 243, 1)",!0),level6:_(1.5,"rgba(156, 39, 176, 1)",!1),level7:_(1.75,"rgba(233, 30, 99, 1)",!1),level8:_(2,"rgba(229, 115, 115, 1)",!1)},linetoolinsidepitchfork:{fillBackground:!0,transparency:80,style:r.Inside,median:{visible:!0,color:"rgba(244, 67, 54, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},extendLines:!1,level0:_(.25,"rgba(255, 183, 77, 1)",!1),level1:_(.382,"rgba(129, 199, 132, 1)",!1),level2:_(.5,"rgba(76, 175, 80, 1)",!0),level3:_(.618,"rgba(0, 150, 136, 1)",!1),level4:_(.75,"rgba(100, 181, 246, 1)",!1),level5:_(1,"rgba(33, 150, 243, 1)",!0),level6:_(1.5,"rgba(156, 39, 176, 1)",!1),level7:_(1.75,"rgba(233, 30, 99, 1)",!1),level8:_(2,"rgba(229, 115, 115, 1)",!1)},linetoolregressiontrend:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,styles:{upLine:{visible:!0,color:"rgba(33, 150, 243, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0, color:"rgba(33, 150, 243, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba(244, 67, 54, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}}},g(TradingView.defaultProperties.chartproperties),b()}if(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:"#2196F3",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:s.Line,histogramBase:0,title:"MA"}}}),void 0===TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"#2196F3",backColor:"#E3F2FD",textColor:"#131722"}),void 0===TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]){TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,font:"Arial",fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:!0,"S1/R1":!0,"S2/R2":!0,"S3/R3":!0,"S4/R4":!0,"S5/R5":!0},colors:{P:"#FB8C00","S1/R1":"#FB8C00","S2/R2":"#FB8C00","S3/R3":"#FB8C00","S4/R4":"#FB8C00","S5/R5":"#FB8C00"},widths:{P:1,"S1/R1":1,"S2/R2":1,"S3/R3":1,"S4/R4":1,"S5/R5":1}}}}if(void 0===TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]&&(TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]={color:"#2196F3",linewidth:2}),void 0===TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]&&(TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:t("rgba( 255, 0, 0, 1)",!1),level1:t("rgba( 0, 128, 0, 1)",!1),level2:t("rgba( 0, 0, 255, 1)",!1),level3:t("rgba( 255, 0, 255, 1)",!1),level4:t("rgba( 0, 128, 255, 1)",!0),level5:t("rgba( 255, 0, 0, 1)",!0),level6:t("rgba( 0, 128, 0, 1)",!0),level7:t("rgba( 0, 0, 255, 1)",!0),level8:t("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(33, 150, 243, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba(33, 150, 243, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba(244, 67, 54, 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_Compare@tv-basicstudies"]&&(TradingView.defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"}),void 0===TradingView.defaultProperties["study_Overlay@tv-basicstudies"]){TradingView.defaultProperties["study_Overlay@tv-basicstudies"]={style:n.STYLE_LINE,showPriceLine:!1,minTick:"default",candleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,drawBody:!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,drawBody:!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,thinBars:!0},lineStyle:{color:"#FF6D00",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,priceSource:"close",styleType:n.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"#2196f3",color2:"#2196f3",linecolor:"#2196f3",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,priceSource:"close",transparency:95},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.05)",topFillColor2:"rgba( 83, 185, 135, 0.05)",bottomFillColor1:"rgba( 235, 77, 92, 0.05)",bottomFillColor2:"rgba( 235, 77, 92, 0.05)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:2,bottomLineWidth:2,priceSource:"close",transparency:50,baseLevelPercentage:50},styles:{open:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:s.Line,histogramBase:0},high:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:s.Line,histogramBase:0},low:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:s.Line,histogramBase:0},close:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:s.Line,histogramBase:0}}}}for(var P=e.split("."),C=TradingView.defaultProperties,T=0;T1?u(e[r],t.slice(1),i):(e[r]&&e[r].setValue?e[r].setValue(i):e[r]=i,!0))}function h(e){i||_.logWarn("Path `"+e+"` does not exist.")}}function g(e,t,i,n){window.__defaultsOverrides&&y(e,t,i,window.__defaultsOverrides,n)}function b(){var e=/^linetool.+/;Object.keys(TradingView.defaultProperties).forEach((function(t){e.test(t)&&g(TradingView.defaultProperties[t],null,!1,t)}))}function S(e,t){return t?function(e,t){var i=v(e);if(!window._UNIT_TESTS){var n=TradingView.clone(TVSettings.getJSON(e,null));if(function(e){var t=new Set(["linetoolregressiontrend"]);return e.startsWith("study_")||t.has(e)}(e)&&n&&function(e){if(!e)return!1;e=e.toString();var t=new RegExp("\\d+").exec(e) ;return null!==t&&t[0]===e}(n.version)){var r=n.inputs,o=t.updateStudyInputs(n.id,n.version,"last",r,null);n.inputs=o;var s=t.updateStudyState(n,n);n=s}TradingView.merge(i,n)}return i}(e,t):function(e){var t=v(e);if(!window._UNIT_TESTS){var i=TradingView.clone(TVSettings.getJSON(e,null));i&&TradingView.merge(t,i)}return t}(e)}S.create=function(e,t){if(t){var i=v(e);TradingView.defaultProperties[e]=Object.assign(t,i)}},S.remove=function(e){TradingView.defaultProperties[e]=void 0},TradingView.saveDefaults=function(e,t){TVSettings.setJSON(e,t)},TradingView.factoryDefaults=v,window.applyDefaultOverridesToLinetools=b,window.applyDefaultsOverrides=g,window.applyPropertiesOverrides=y,window.defaults=S,t.applyDefaultOverridesToLinetools=b,t.applyDefaultsOverrides=g,t.applyPropertiesOverrides=y,t.defaults=S,t.factoryDefaults=v,t.saveDefaults=TradingView.saveDefaults},wamh:function(e,t,i){"use strict";i.r(t),i.d(t,"ChangeToolBarsThemeUndoCommand",(function(){return s}));var n=i("mrSG"),r=i("EsvI"),o=i("oiZD"),s=function(e){function t(t,i,n){void 0===n&&(n=!0);var r=e.call(this,"Apply Toolbars Theme")||this;return r._prevThemeName=t,r._themeName=i,r._syncState=n,r}return Object(n.c)(t,e),t.prototype.undo=function(){Object(r.isStdThemeName)(this._prevThemeName)&&(Object(o.setTheme)(this._prevThemeName),this._syncState&&Object(r.syncTheme)())},t.prototype.redo=function(){Object(r.isStdThemeName)(this._themeName.toLowerCase())&&(Object(o.setTheme)(this._themeName.toLowerCase()),this._syncState&&Object(r.syncTheme)())},t}(i("RDU5").UndoCommand)},wi9r:function(e,t,i){"use strict";(function(e){var t=i("e3/o").randomHash;function n(e){this._chartApi=e,this._sessionid="qs_"+t(),this._sessionstarted=!1}n.prototype.destroy=function(){this._sessionstarted&&(this._chartApi.quoteDeleteSession(this._sessionid),this._sessionid=null,this._sessionstarted=!1)},n.prototype.connected=function(){return this._chartApi.connected()},n.prototype.connect=function(e){this._globalHandler=e,this._chartApi.createSession(this._sessionid,this),this._chartApi.connect()},n.prototype.disconnect=function(){this._chartApi.disconnect()},n.prototype.quoteAddSymbols=function(e,t){e=[].concat(e),t&&t.forcePermission&&(e=e.concat({flags:["force_permission"]})),this._chartApi.quoteAddSymbols(this._sessionid,e)},n.prototype.quoteRemoveSymbols=function(e){this._chartApi.quoteRemoveSymbols(this._sessionid,e)},n.prototype.quoteFastSymbols=function(e){this._chartApi.quoteFastSymbols(this._sessionid,e)},n.prototype.quoteSetFields=function(e){this._chartApi.quoteSetFields(this._sessionid,e)},n.prototype.onMessage=function(e){switch(e.method){case"connected":this._sessionstarted||(this._chartApi.quoteCreateSession(this._sessionid),this._sessionstarted=!0);break;case"disconnected":this._sessionstarted=!1}this._globalHandler(e)},n.prototype.quoteHibernateAll=function(e){this._chartApi.quoteHibernateAll(this._sessionid)},TradingView.QuoteSession=n,e&&e.exports&&(e.exports=n)}).call(this,i("YuTi")(e))},wiuq:function(e,t,i){"use strict";i.r(t), i.d(t,"LineToolArrowMarker",(function(){return l}));var n=i("mrSG"),r=i("Ss5c"),o=i("Ocx9"),s=i("tc+8"),a=i.n(s),l=function(e){function t(n,r){var o=e.call(this,n,r||t.createProperties())||this;return i.e("lt-pane-views").then(function(e){var t=i("Qa6j").ArrowMarkerPaneView;o._setPaneViews([new t(o,o.model())])}.bind(null,i)).catch(void 0),o}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.name=function(){return"Trend Line"},t.createProperties=function(e){var i=new o.DefaultProperty("linetoolarrowmarker",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"FxV7")).then((function(e){return e.ArrowMarkerDefinitionsViewModel}))},t._configureProperties=function(e){r.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new a.a("")),e.addExclusion("text")},t}(r.LineDataSource)},wjVR:function(e,t,i){"use strict";i.r(t);var n,r=i("mrSG"),o=i("Eyy1"),s=i("qFKp"),a=i("FQhm"),l=function(e){function t(){var t=e.call(this)||this;return t._dialog=null,t._subscribe=function(e){t._setVisibility(e)},t}return Object(r.c)(t,e),t.prototype.show=function(){this._load().then((function(e){return e.show()}))},t.prototype.hide=function(){var e;null===(e=this._dialog)||void 0===e||e.hide()},t.getInstance=function(){return n||(n=new t),n},t.prototype._load=function(){var e=this;return Promise.all([i.e("redux"),i.e("react"),i.e(1),i.e(2),i.e(5),i.e(6),i.e(7),i.e(9),i.e(10),i.e(11),i.e(12),i.e(20),i.e(21),i.e(27),i.e(35),i.e(36),i.e(46),i.e(61),i.e(68),i.e(75),i.e(0),i.e(4),i.e(3),i.e(8),i.e(13),i.e(14),i.e(37),i.e(50),i.e(59),i.e("object-tree-dialog")]).then(i.bind(null,"xNz2")).then((function(t){var i,n;return null===(i=e._dialog)||void 0===i||i.hide(),null===(n=e._dialog)||void 0===n||n.visible().unsubscribe(e._subscribe),e._dialog=new t.ObjectTreeDialogRenderer,e._dialog.visible().subscribe(e._subscribe),e._dialog}))},t}(i("sQaR").a),c=i("ogJP"),u=i("dDSx");var h,d=i("CW80"),p=i("3ClC"),f=i("H0vP"),_=i("mkn5"),m=i("eJTA"),v=i("Hr11"),y=i("S8xo"),g=i("ikwP"),b=(i("bc0y"),function(){function e(e,t,i,n){if(this._handleEl=null,this._startY=0,this._deltaY=0,this._totalHeight=0,this._totalStretch=0,this._prevStretchA=0,this._minPaneHeight=0,this._maxPaneHeight=0,this._pixelStretchFactor=0,this._mouseEventHandler=null,this._colorCache={lineColor:"",backgroundColor:"",color:""},this._chart=e,this._paneA=e.paneWidgets()[t],this._paneB=e.paneWidgets()[i],this._timeAxisSeparator=Boolean(n),this._row=document.createElement("tr"),this._row.style.height="1px",this._cell=document.createElement("td"),this._row.appendChild(this._cell),this._cell.classList.add("pane-separator"),this._cell.setAttribute("colspan","3"),this._cell.style.background=this._color(),this._cell.addEventListener("click",(function(){})),this._timeAxisSeparator)this._mouseEventHandler=null;else{var r=document.createElement("div");r.classList.add("handle"),this._cell.appendChild(r), this._mouseEventHandler=new y.MouseEventHandler(r,this,{treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!0}),this._handleEl=r}}return e.prototype.destroy=function(){null!==this._mouseEventHandler&&this._mouseEventHandler.destroy(),this._row.parentElement&&this._row.parentElement.removeChild(this._row)},e.prototype.getElement=function(){return this._row},e.prototype.hide=function(){this._row.classList.add("js-hidden")},e.prototype.show=function(){this._row.classList.remove("js-hidden")},e.prototype.mouseDownEvent=function(e){this._mouseDownOrTouchStartEvent(e)},e.prototype.touchStartEvent=function(e){this._mouseDownOrTouchStartEvent(e)},e.prototype.pressedMouseMoveEvent=function(e){this._pressedMouseOrTouchMoveEvent(e)},e.prototype.touchMoveEvent=function(e){this._pressedMouseOrTouchMoveEvent(e)},e.prototype.mouseUpEvent=function(e){this._mouseUpOrTouchEndEvent(e)},e.prototype.touchEndEvent=function(e){this._mouseUpOrTouchEndEvent(e)},e.prototype.update=function(){this._cell.style.background=this._color().toString()},e.prototype.paint=function(){},e.prototype.image=function(){var e=this._paneA.leftPriceAxisesContainer().getWidth(),t=this._paneA.width(),i=this._paneA.rightPriceAxisesContainer().getWidth(),n=this._color(),r=Object(g.createDisconnectedCanvas)(document,new g.Size(e,1)),o=Object(g.getPrescaledContext2D)(r);o.fillStyle=n,o.fillRect(0,0,e,1);var s=Object(g.createDisconnectedCanvas)(document,new g.Size(t,1)),a=Object(g.getPrescaledContext2D)(s);a.fillStyle=n,a.fillRect(0,0,t,1);var l=Object(g.createDisconnectedCanvas)(document,new g.Size(i,1)),c=Object(g.getPrescaledContext2D)(l);return c.fillStyle=n,c.fillRect(0,0,i,1),{type:"separator",leftAxis:{content:r.toDataURL(),canvas:r,contentWidth:e,contentHeight:1},rightAxis:{content:l.toDataURL(),canvas:l,contentWidth:i,contentHeight:1},content:s.toDataURL(),canvas:s,contentWidth:t,contentHeight:1}},e.height=function(){return 1},e.prototype._mouseDownOrTouchStartEvent=function(e){this._startY=e.pageY,this._deltaY=0,this._totalHeight=this._paneA.height()+this._paneB.height(),this._totalStretch=this._paneA.state().stretchFactor()+this._paneB.state().stretchFactor(),this._prevStretchA=this._paneA.state().stretchFactor(),this._minPaneHeight=30,this._maxPaneHeight=this._totalHeight-this._minPaneHeight,this._pixelStretchFactor=this._totalStretch/this._totalHeight,Object(o.ensureNotNull)(this._handleEl).classList.add("i-active")},e.prototype._pressedMouseOrTouchMoveEvent=function(e){this._deltaY=e.pageY-this._startY;var t=this._paneA.height(),i=Object(v.clamp)(t+this._deltaY,this._minPaneHeight,this._maxPaneHeight)*this._pixelStretchFactor,n=this._totalStretch-i;this._paneA.state().setStretchFactor(i),this._paneB.state().setStretchFactor(n),this._chart.adjustSize(),this._paneA.height()!==t&&(this._startY=e.pageY),this._chart.model().model().fullUpdate()},e.prototype._mouseUpOrTouchEndEvent=function(e){this._chart.model().addPaneStretchFactorUndoCommand(this._paneA.state(),this._paneB.state(),this._prevStretchA,this._paneA.state().stretchFactor()), this._startY=0,this._deltaY=0,this._totalHeight=0,this._totalStretch=0,this._minPaneHeight=0,this._maxPaneHeight=0,this._pixelStretchFactor=0,Object(o.ensureNotNull)(this._handleEl).classList.remove("i-active")},e.prototype._color=function(){var e=this._chart.properties().childs().scalesProperties.childs().lineColor.value(),t=this._chart.model().model().backgroundColor().value();if(this._colorCache.lineColor!==e||this._colorCache.backgroundColor!==t){var i=Object(m.parseRgba)(t),n=Object(m.parseRgba)(e),r=0===i[3]&&0===n[3]?"rgba(0,0,0,0)":Object(m.rgbaToString)(Object(m.blendRgba)(i,n));this._colorCache={lineColor:e,backgroundColor:t,color:r}}return this._colorCache.color},e}()),S=i("mMWL"),w=i("KnF9"),P=i("VaSN"),C=i("aIyQ"),T=i.n(C),x=i("hY0g"),I=i.n(x),L=i("Tmoa"),O=i("EsvI"),M=((h={}).moving="wait_finishing",h.wait_finishing="stop",h.stop="moving",h),A=function(){function e(e){var t=this;this._chartModel=null,this._currentDistance=0,this._deferredFinishTimeout=0,this._finishingTimeout=0,this._moveType="",this._startTime=0,this._state="stop",this._movingTimeout=0,this._chart=e,this._chart.withModel(this,(function(){t._chartModel=t._chart.model()}))}return e.prototype.destroy=function(){clearTimeout(this._movingTimeout)},e.prototype.move=function(e){var t=this;if(null!==this._chartModel&&"stop"===this._state&&this._chartModel.beginUndoMacro(1===e?"Move Left":"Move Right"),this._state=M.stop,this._moveType="animated",this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0),this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0),this._startTime=Date.now(),0===this._movingTimeout){var i=this._startTime,n=function(){t.moveStep(i,0,50*e,1e3),t._movingTimeout=setTimeout(n,10)};this._movingTimeout=setTimeout(n,10)}},e.prototype.moveStep=function(e,t,i,n){if(null!==this._chartModel&&!this._chartModel.timeScale().isEmpty()){var r=Date.now();r1||!isFinite(o))&&(o=1);var s=1-Math.pow(1-o,3);return this._currentDistance=(i-t)*s+t,this._chartModel.scrollChart(this._currentDistance),o}},e.prototype.moveByBar=function(e){var t=this;if(null!==this._chartModel){var i=this._chartModel.timeScale();if(i.isEmpty())return;if("stop"===this._state&&this._chartModel.beginUndoMacro(1===e?"Move Left":"Move Right"),null!==i.visibleBarsStrictRange()){var n=i.indexToCoordinate(i.visibleBarsStrictRange().lastBar())+i.barSpacing()/2;Math.abs(i.width()-n)>i.barSpacing()/6&&this._chartModel.scrollChart(i.width()-n)}if(this._state=M.stop,this._moveType="by_bar",this._startTime=Date.now(),!this._movingTimeout){var r=0,o=150,s=function(){t._moveByBarStep(e),r++,o>100&&(o-=r/5*20),t._movingTimeout=setTimeout(s,o)};this._movingTimeout=setTimeout(s,400),this._moveByBarStep(e)}}},e.prototype.stopMove=function(){"by_bar"===this._moveType?this.stopMoveByBar():this._stopMove()},e.prototype.stopMoveByBar=function(){"moving"===this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state=M.wait_finishing,this._moveType="", this._movingTimeout=0,this._currentDistance=0,null!==this._chartModel&&this._chartModel.endUndoMacro())},e.prototype._finishMove=function(){var e=this;clearTimeout(this._movingTimeout),this._movingTimeout=0,this._deferredFinishTimeout=0;var t=this._currentDistance,i=Date.now(),n=function(){var r=e.moveStep(i,t,0,700);r&&r<1?e._finishingTimeout=setTimeout(n,10):null!==e._chartModel&&(e._state=M.wait_finishing,e._moveType="",e._movingTimeout=0,e._currentDistance=0,e._chartModel.endUndoMacro())};this._finishingTimeout=setTimeout(n,10)},e.prototype._stopMove=function(){"moving"===this._state&&(this._state=M.moving,Date.now()-this._startTime<200?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-(Date.now()-this._startTime)):this._finishMove())},e.prototype._moveByBarStep=function(e){if(null!==this._chartModel){if(this._chartModel.timeScale().isEmpty())return;this._chartModel.scrollChartByBar(e)}},e}(),k=i("/3z9"),E=i("d700"),V=function(){function e(e,t){this._pressedKeyCode=null,this._boundKeydownHandler=null,this._boundKeyupHandler=null,this._chartWidget=e,this._parent=t,this._boundKeydownHandler=this._keydownHandler.bind(this),this._boundKeyupHandler=this._keyupHandler.bind(this),this._parent.ownerDocument.addEventListener("keydown",this._boundKeydownHandler),this._parent.ownerDocument.addEventListener("keyup",this._boundKeyupHandler)}return e.prototype.destroy=function(){null!==this._boundKeydownHandler&&(this._parent.ownerDocument.removeEventListener("keydown",this._boundKeydownHandler),this._boundKeydownHandler=null),null!==this._boundKeyupHandler&&(this._parent.ownerDocument.removeEventListener("keyup",this._boundKeyupHandler),this._boundKeyupHandler=null)},e.prototype._keydownHandler=function(e){window.document.activeElement===window.document.body&&this._chartWidget.isActive()&&(this._handleMoveDrawingsKeyDown(e)||this._handleScrollKeyDown(e))&&e.preventDefault()},e.prototype._keyupHandler=function(e){this._handleScrollKeyUp(e)},e.prototype._handleMoveDrawingsKeyDown=function(e){var t=255&Object(k.hashFromEvent)(e),i=this._chartWidget.model();switch(t){case 37:return i.moveSelectedToolsLeft();case 39:return i.moveSelectedToolsRight();case 38:return i.moveSelectedToolsUp();case 40:return i.moveSelectedToolsDown()}return!1},e.prototype._handleScrollKeyDown=function(e){if(null!==this._pressedKeyCode)return!1;var t,i=Object(k.hashFromEvent)(e),n=255&i,r=Object(k.modifiersFromEvent)(e);if(37===n)t=1;else{if(39!==n)return!1;t=-1}return!(k.isMacKeyboard&&r===k.Modifiers.Mod||r!==k.Modifiers.Mod&&r!==k.Modifiers.Alt&&r!==k.Modifiers.None)&&(!Object(E.a)(i,e.target)&&(this._pressedKeyCode=n,r===k.Modifiers.None?this._chartWidget.scrollHelper().moveByBar(t):this._chartWidget.scrollHelper().move(t),!0))},e.prototype._handleScrollKeyUp=function(e){if(null===this._pressedKeyCode)return!1;var t=Object(k.hashFromEvent)(e);return!Object(E.a)(t,e.target)&&((255&t)===this._pressedKeyCode&&(this._pressedKeyCode=null,this._chartWidget.scrollHelper().stopMove(),!0))},e}(),D=i("Kxc7"),B=function(){function e(){ this._totalDeltaX=0,this._totalDeltaY=0,this._prevWheelTime=0}return e.prototype.processWheel=function(e){e.timeStamp-this._prevWheelTime>100&&this._reset(),this._totalDeltaX+=e.deltaX,this._totalDeltaY+=e.deltaY,this._prevWheelTime=e.timeStamp;var t={deltaX:e.deltaX,deltaY:e.deltaY};return 0===this._totalDeltaX||0===this._totalDeltaY||(Math.abs(this._totalDeltaX)>=Math.abs(3*this._totalDeltaY)&&(t.deltaY=0),Math.abs(this._totalDeltaY)>=Math.abs(3*this._totalDeltaX)&&(t.deltaX=0)),t},e.prototype._reset=function(){this._totalDeltaX=0,this._totalDeltaY=0},e}(),R=i("n5al"),N=i("pPtI");i("brCa");i.d(t,"ChartWidgetBase",(function(){return H}));var j=Object(D.enabled)("chart_content_overrides_by_defaults"),F={addToWatchlistEnabled:!0,showFinancialsEnabled:!1,sourceSelectionEnabled:!0,propertyPagesEnabled:!0,paneContextMenuEnabled:!0,priceScaleContextMenuEnabled:!0,currencyConversionEnabled:!1,goToDateEnabled:!1,marketStatusWidgetEnabled:!0,chartWarningWidgetEnabled:!0,dataProblemWidgetEnabled:!0,paneControlsEnabled:!0,isSymbolAvailable:function(e){return Promise.resolve(!0)},legendWidgetEnabled:!0,chartEventsEnabled:!0,esdEnabled:!1,croppedTickMarks:!0,useKineticScroll:s.CheckMobile.any(),handleScale:{mouseWheel:!0,pinch:!0,axisPressedMouseMove:{time:!0,price:!0}},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0}};function W(e,t,i,n){void 0===n&&(n=0);var r=t.mainSeries().syncModel(),o=e.mainSeries().syncModel(),s=i;if(null!==r&&null!==o){var a=e.createSyncPoint(r,o);0!==n&&(i=r.projectTime(i,n)),s=a.sourceTimeToTargetTime(i)}return e.timeScale().points().roughIndex(s,o&&o.distance.bind(o))}var H=function(){function e(e,t,i){var n=this;this.activePaneWidget=null,this._model=null,this._paneWidgets=[],this._maximizedPaneWidget=null,this._timeAxisWidget=null,this._paneSeparators=[],this._timeAxisSeparator=null,this._controlBarNavigation=null,this._lineToolsSynchronizer=null,this._modelCreated=new T.a,this._isDestroyed=!1,this._customLegendWidgetsFactoryMap=new Map,this._backgroundTopTheme=new I.a("light"),this._backgroundBasedTheme=new I.a("light"),this._backgroundBottomTheme=new I.a("light"),this._lhsAxesWidth=0,this._rhsAxesWidth=0,this._lhsPriceAxisWidthChanged=new T.a,this._rhsPriceAxisWidthChanged=new T.a,this._mainDiv=null,this._parent=null,this._elTooltipDiv=null,this._hotkeysListener=null,this._mouseWheelHelper=null,this._onWheelBound=null,this._justActivated=!1,this._inited=!1,this._containsData=!1,this._initialLoading=!1,this._defTimeframe=void 0,this._removeMaximizeHotkey=null,this._metaInfoRepository=null,this._invalidationMask=null,this._drawPlanned=!1,this._drawRafId=0,this._inLoadingState=!1,this._timingsMeter=null,this._tagsChanged=new T.a,this._updateThemedColorBound=this._updateThemedColor.bind(this),this._saveChartService=null,this._objectTreeDialogController=null,this._id=t,this._layoutId=i,this._options=Object(c.merge)(Object(c.clone)(F),e),this._options.customLegendWidgetFactories&&(this._customLegendWidgetsFactoryMap=this._options.customLegendWidgetFactories), this._subscribeToDrawingState(),this.withModel(this,(function(){var e=n.model().model();e.backgroundTopColor().subscribe(n._updateThemedColorBound),e.backgroundColor().subscribe(n._updateThemedColorBound)})),this._scrollHelper=new A(this),this._objectTreeDialogController=l.getInstance()}return e.prototype.destroy=function(){var e;null===(e=this._lineToolsSynchronizer)||void 0===e||e.destroy(),null!==this._model&&(this._model.model().backgroundTopColor().unsubscribe(this._updateThemedColorBound),this._model.model().backgroundColor().unsubscribe(this._updateThemedColorBound),this._model.destroy()),this._customLegendWidgetsFactoryMap.clear(),this._scrollHelper.destroy(),this._isDestroyed=!0},e.prototype.id=function(){return this._id},e.prototype.layoutId=function(){return this._layoutId},e.prototype.getPriceAxisWidthChangedByName=function(e){return"left"===e?this._lhsPriceAxisWidthChanged:this._rhsPriceAxisWidthChanged},e.prototype.getPriceAxisMaxWidthByName=function(e){return"left"===e?this._lhsAxesWidth:this._rhsAxesWidth},e.prototype.timeAxisHeight=function(){return null!==this._timeAxisWidget?this._timeAxisWidget.size.h:0},e.prototype.withModel=function(e,t){this.model()?t.call(e):this.modelCreated().subscribe(e,t,!0)},e.prototype.images=function(e){var t=this;window.TradingView.printing=!0;var i=this.model().selection().allSources();this.model().selectionMacro((function(e){return e.clearSelection()}));var n,r=function(i,n){i.paint(n,t.onWidget());var r={showCollapsedLegend:Boolean(null==e?void 0:e.showCollapsedLegend),status:null==e?void 0:e.status};return i.getScreenshotData(r)},s=[];if(null!==this._maximizedPaneWidget){var a=this._paneWidgets.indexOf(this._maximizedPaneWidget);s.push(r(this._maximizedPaneWidget,f.InvalidationMask.light().invalidateForPane(a)))}else for(var l=0;l=61,x=T?C:0;x%2&&(x+=1);for(var I=P+x,L=v0){var l=new b(this,n-1,n);this._paneSeparators.push(l),this._timeAxisWidget?this._elMainTable.insertBefore(l.getElement(),this._timeAxisWidget.getElement()):this._elMainTable.appendChild(l.getElement())}this._timeAxisWidget?this._elMainTable.insertBefore(a.getElement(),this._timeAxisWidget.getElement()):this._elMainTable.appendChild(a.getElement())}null!==this._timeAxisSeparator&&this._timeAxisSeparator.destroy(),null!==this._timeAxisWidget&&(this._timeAxisSeparator=new b(this,this._paneWidgets.length-1,0,!0),this._elMainTable.insertBefore(this._timeAxisSeparator.getElement(),this._timeAxisWidget.getElement()));for(n=0;nr)){var s,a=this.m_series.bars().range(i,r),l=this.m_series.priceScale(),c=this.m_series.barColorer(),u={};if(a.each((function(i,n){var r,o={};(o.time=Math.round(i),e(n,o))&&(u.value=n,r=n[TradingView.STYLE_PLOT]?n[TradingView.STYLE_PLOT]:c.barStyle(i,!1,u),n[TradingView.STYLE_PLOT]=r,u.previousValue=n,o.color=r.barColor,o.borderColor=r.barBorderColor,o.wickColor=r.barWickColor,o.hollow=r.isBarHollow,t.m_bars.push(o))}),this),0!==this.m_bars.length&&(s=this.m_series.firstValue(),l.barPricesToCoordinates(this.m_bars,s)),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_model.selection().isSelected(this.m_series)){var h=this._selectionIndexer.indexes(i,r);this._selectionData={points:[],bgColors:[],visible:!0};var d=this.m_model.paneForSource(this.m_series).height();this._selectionData.hittestResult=o.REGULAR;for(var p=0;p=t&&e.y<=i||e.y<=t&&e.y>=i))return new r(r.REGULAR);return null},h.prototype._drawImpl=function(e){if(null!==this._data){var t=this._data.isHlineFill;if(t||0!==this._data.points1.length&&0!==this._data.points2.length){var i=this._data.timePoints,n=this._data.points1,r=this._data.points2,s=this._data.colors,l=isNumber(this._data.transparency)?this._data.transparency:50;l=Math.min(l,100),l=Math.max(l,0);for(var c,u={},h=[],d=.25*this._data.getBarSpacing(),p=0;p0&&null!==c){var m=u[c]||[];m.push(h),u[c]=m}h=_?[f]:[]}}for(var v in u){var y=u[v];e.beginPath();for(var g=0;g=0;P--)e.lineTo(b[P].timePoint,b[P].point2)}else{var C=b[0].point2;e.lineTo(S+d,w),e.lineTo(S+d,C),e.lineTo(S-d,C),e.lineTo(S-d,w)}}e.closePath(),e.fillStyle=a.generateColor(v,l),e.fill()}}}},d.prototype.update=function(){this._invalidated=!0},d.prototype._plotNames=function(){return this._source.metaInfo().plots.map((function(e){return e.id}))},d.prototype._plotIndex1=function(){return null===this._plIndex1&&(this._plIndex1=this._plotNames().indexOf(this._plotAId())+1),this._plIndex1},d.prototype._plotIndex2=function(){return null===this._plIndex2&&(this._plIndex2=this._plotNames().indexOf(this._plotBId())+1),this._plIndex2},d.prototype._updateImpl=function(){if(this._points1=[],this._points2=[],this._colorsMap&&(this._colors=[]),this._timePoints=[],this._visible()){var e=this._source.priceScale(),t=this._source._model.timeScale();if(e&&!e.isEmpty()&&!this._source._model.timeScale().isEmpty()&&!this._source._series.bars().isEmpty()){if(this._isHlineFill){var i=this._source.firstValue(),n=this._source.properties().bands[this._bandAKey],r=this._source.properties().bands[this._bandBKey];this._level1=e.priceToCoordinate(n.value.value(),i),this._level2=e.priceToCoordinate(r.value.value(),i)}var o=this._source._model.timeScale().visibleBarsStrictRange();if(null!==o){var s=this._source._series.nearestIndex(o.firstBar(),c.NearestRight),a=this._source._series.nearestIndex(o.lastBar(),c.NearestLeft);if(!((s=this._correctStartBarIndex(s))>a)){var l=this._source.data().range(s,a);if(l.size()>0){var u=l.firstIndex(),h=l.lastIndex(),d=this._source.offset(this._plotAId()),p=this._source.offset(this._plotBId()),f=Math.max(d,p),_=Math.min(d,p),m=u+f,v=this._source.data().firstIndex();u>v&&(m=ug+_&&hh?u+f:m,S=m;S<=y;++S){if(this._timePoints.push(t.indexToCoordinate(b++)),this._colors){var w=this._source.data().valueAt(S-_);if(null!==w){var P=w[this._colorPlotOffset+1];null==P?this._colors.push(null):this._colors.push(this._colorValues[this._colorsMap[P]].color.value())}}if(!this._isHlineFill){var C=this._source.data().valueAt(S-d),T=this._source.data().valueAt(S-p);if(null!==C&&null!==T){var x=C[this._plotIndex1()],I=T[this._plotIndex2()];this._points1.push(x),this._points2.push(I)}}}}i=this._source.firstValue();e.pricesArrayToCoordinates(this._points1,i),e.pricesArrayToCoordinates(this._points2,i)}}}}},d.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var e={};return e.points1=this._points1,e.points2=this._points2,e.timePoints=this._timePoints,e.getBarSpacing=this._getBarSpacing,e.backcolor=this._color(),e.transparency=this._transparency(),e.isHlineFill=this._isHlineFill,e.level1=this._level1,e.level2=this._level2,this._colors&&(e.colors=this._colors),this._areaRenderer.setData(e),this._areaRenderer},d.prototype._plotAId=function(){n(!1,"Pure virtual call!")},d.prototype._plotBId=function(){n(!1,"Pure virtual call!")},d.prototype._color=function(){ n(!1,"Pure virtual call!")},d.prototype._transparency=function(){n(!1,"Pure virtual call!")},d.prototype._visible=function(){n(!1,"Pure virtual call!")},d.prototype._correctStartBarIndex=function(e){return e},inherit(p,d),p.prototype._plotAId=function(){return this._source.properties().area[0].name.value()},p.prototype._plotBId=function(){return this._source.properties().area[1].name.value()},p.prototype._color=function(){return this._source.properties().areaBackground.backgroundColor.value()},p.prototype._transparency=function(){var e=this._source.properties().areaBackground.transparency.value();return l(e,0,100)},p.prototype._visible=function(){return this._source.properties().areaBackground.fillBackground.value()},inherit(f,d),f.prototype._initBandIndexes=function(e,t){this._bandAKey=null,this._bandBKey=null;for(var i=0;i0)e[e.length-1].addCommand(n);else{i.clear();var r=t.head(),o=r&&r.text();r&&r.canMerge(n)?r.merge(n):t.push(n);var a=n.text();""!==a&&a!==o&&h.logNormal("DO: "+a)}n.executeOnPush()&&n.redo(),e.length||s.fire(c())}function c(){var e=t.head(),n=i.head();return{enableUndo:!t.isEmpty(),undoText:void 0===e?void 0:e.text(),enableRedo:!i.isEmpty(),redoText:void 0===n?void 0:n.text()}}return{beginUndoMacro:function(t){var i=new o.a(t);return e.push(i),i},clearStack:function(){t.clear(),i.clear(),s.fire(c())},createUndoCheckpoint:function(){return{lastActualCommand:t.isEmpty()?null:t.head()}},endUndoMacro:function(){var t=Object(n.ensureDefined)(e.pop());t.isEmpty()||l(t)},pushUndoCommand:l,redo:function(){if(i.isEmpty())return!1;var e=i.pop();return!!e&&(e.redo(),t.push(e),h.logNormal("REDO: "+e.text()),s.fire(c()),!0)},redoStack:function(){return i},setWatchedValue:function(e,t,i){if(e.value()!==t){var n=new a(e,t,i);l(n),n.redo()}},undo:function(){if(t.isEmpty())return!1;var e=t.pop();return!!e&&(e.undo(),i.push(e),h.logNormal("UNDO: "+e.text()),s.fire(c()),!0)},undoStack:function(){return t},undoToCheckpoint:function(e){for(;!t.isEmpty()&&e.lastActualCommand!==t.head();)t.pop().undo();i.clear(),s.fire(c())},state:c,onChange:function(){return s}}}},xDuj:function(e,t,i){"use strict";i.r(t),i.d(t,"translatedIntervalString",(function(){return r}));i("YFKU");var n=i("pPtI");function r(e){var t=Object(n.getTranslatedResolutionModel)(e,!0);return null===t?e:t.multiplier+(t.mayOmitShortKind?"":t.shortKind)}},xUGI:function(e,t,i){"use strict";var n=i("GH0z").PercentageFormatter,r=i("zXvd").NumericFormatter,o=i("zDbI").CHART_FONT_FAMILY,s=i("d1Pk").fibLevelPrice,a=i("ikwP").drawScaled ;function l(e,t,i){this._fibLevelsBasedOnLogScaleProperty=e,this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=1,this._actualWidth=1,this._numericFormatter=new r,this._percentageFormatter=new n,this._pixelRatio=i.pixelRatio,this._recreateCanvas(this._actualWidth,l.ROW_HEIGHT*this._actualCapacity),this._levelsCount=t}l.prototype.destroy=function(){this._canvas=null,this._cache=null},l.prototype.topByRow=function(e){return e*l.ROW_HEIGHT},l.prototype.rowHeight=function(e){return l.ROW_HEIGHT},l.prototype.devicePixelRatio=function(){return this._canvas&&this._canvas.pixelRatio||0},l.prototype._recreateCanvas=function(e,t){this._canvas=document.createElement("canvas"),this._canvas.width=Math.ceil(e*this._pixelRatio),this._canvas.height=Math.ceil(t*this._actualCapacity*this._pixelRatio),this._cache=this._canvas.getContext("2d"),this._cache.font="12px "+o},l.prototype.canvas=function(){return this._canvas},l.ROW_HEIGHT=14,l.prototype.points=function(e){return[e.points()[0],e.points()[1]]},l.prototype._selectStartPrice=function(e,t){return t?e.points()[0].price:e.points()[1].price},l.prototype.startPoint=function(e,t){var i=this._selectStartPrice(e,t);if(!this._calculateLogLevels(e))return{price:i};var n=e.ownerSource().firstValue();return{price:i,coordinate:e.priceScale().priceToCoordinate(i,n)}},l.prototype._calculatePriceRange=function(e,t,i){return i?t.price-e.price:e.price-t.price},l.prototype.priceRange=function(e,t){var i=this.points(e),n=i[0],r=i[1],o=this._calculatePriceRange(n,r,t);if(!this._calculateLogLevels(e))return{price:o};var s=e.priceScale(),a=e.ownerSource().firstValue(),l=s.priceToCoordinate(n.price,a),c=s.priceToCoordinate(r.price,a);return{price:o,coordinate:t?c-l:l-c}},l.prototype.sourceIsReady=function(e){return e.points().length>=2},l.prototype._calculateLogLevels=function(e){return e.fibLevelsBasedOnLogScale&&e.fibLevelsBasedOnLogScale()},l.prototype._calculateWidth=function(e){if(!this.sourceIsReady(e))return null;var t=this._canvas.getContext("2d");t.font="12px "+o;var i=!!e.properties().showPrices&&e.properties().showPrices.value(),n=!!e.properties().coeffsAsPercents&&e.properties().coeffsAsPercents.value(),r=e.properties().showCoeffs.value(),a=this.points(e),l=a[0],c=a[1];if(!l||!c)return null;var u=e.ownerSource().firstValue();if(null===u)return 0;var h=!1,d=e.properties();d.reverse&&d.reverse.value()&&(h=d.reverse.value());for(var p=this.startPoint(e,h),f=this.priceRange(e,h),_=this._calculateLogLevels(e),m=0,v=[],y=1;y<=this._levelsCount;y++){var g=d["level"+y].coeff.value(),b="";if(r&&(b+=n?this._percentageFormatter.format(Math.round(1e4*g)/100):this._numericFormatter.format(g)),i){var S=e.priceScale(),w=s(p,f,g,S,u,_);b+="("+S.formatPrice(w,u)+")"}var P={text:b,left:m,width:t.measureText(b).width+4};v.push(P),m+=P.width}return{totalWidth:m,cells:v}},l.prototype._effectiveState=function(e){var t={},i=e.properties();i.showPrices&&(t.showPrices=i.showPrices.value()),i.coeffsAsPercents&&(t.coeffsAsPercents=i.coeffsAsPercents.value()), t.showCoeffs=i.showCoeffs.value();var n=e.priceScale();n&&(n.formatter().state&&(t.formatter=e.priceScale().formatter().state()),t.logLevels=this._calculateLogLevels(e)),i.reverse&&(t.reverse=i.reverse.value()),t.p1=e.points()[0],t.p2=e.points()[1],3===e.points().length&&(t.p3=e.points()[2]),t.items=[];for(var r=1;r<=this._levelsCount;r++){var o=i["level"+r],s={coeff:o.coeff.value(),color:o.color.value()};t.items.push(s)}return t},l.prototype._findEmptyRow=function(e){for(var t=0;this._rowsToSources[t];)t++;return this._rowsToSources[t]=e,t>=this._actualCapacity&&(this._actualCapacity++,this._recreateCanvas(this._actualWidth,l.ROW_HEIGHT*this._actualCapacity)),t},l.prototype._repaintSource=function(e,t,i){var n=l.ROW_HEIGHT*i.row;a(this._cache,this._pixelRatio,function(){this._cache.clearRect(0,n,this._actualWidth,l.ROW_HEIGHT),this._cache.textBaseline="bottom",this._cache.font="12px "+o,n+=l.ROW_HEIGHT;for(var i=0;ithis._actualWidth&&(this._recreateCanvas(o.totalWidth,l.ROW_HEIGHT*this._actualCapacity),this._actualWidth=o.totalWidth);i=this._sourcesToRow[e.id()];this._repaintSource(o,r,i),this._sourcesToRow[e.id()].effectiveState=r,this._sourcesToRow[e.id()].preparedCells=o}else this._sourcesToRow[e.id()].effectiveState=null}return this._sourcesToRow[e.id()]},e.exports=l},xWfy:function(e,t,i){"use strict";i.d(t,"a",(function(){return a })),i.d(t,"b",(function(){return h})),i.d(t,"c",(function(){return d})),i.d(t,"d",(function(){return p}));var n=i("tqok"),r=i("fFKx"),o=i("SqfW"),s=i("7Fue"),a=function(){function e(e,t){if(this._indexes=[],this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,this._dwglabels=new Map,this._dwglines=new Map,this._dwgtables=new Map,this._dwgcells=new Map,"data"===e){var i=t;this._indexes=i.indexes,this._vertlines=l(i.vertlines,this._indexes,o.b),this._horizlines=l(i.horizlines,this._indexes,r.b)}else if("state"===e){var n=t;this._indexes=n.indexes||[],this._vertlines=c(n.vertlines,this._indexes,o.b),this._horizlines=c(n.horizlines,this._indexes,r.b)}this._hhistsByTimePointIndex=Object(s.b)(this._hhists)}return e.prototype.horizlines=function(){return this._horizlines},e.prototype.vertlines=function(){return this._vertlines},e.prototype.lines=function(){return this._lines},e.prototype.hlines=function(){return this._hlines},e.prototype.textmarks=function(){return this._textmarks},e.prototype.shapemarks=function(){return this._shapemarks},e.prototype.backgrounds=function(){return this._backgrounds},e.prototype.polygons=function(){return this._polygons},e.prototype.trendchannels=function(){return this._trendchannels},e.prototype.hhists=function(){return this._hhists},e.prototype.dwglabels=function(){return this._dwglabels},e.prototype.dwglines=function(){return this._dwglines},e.prototype.dwgtables=function(){return this._dwgtables},e.prototype.dwgcells=function(){return this._dwgcells},e.prototype.hhistsByTimePointIndex=function(){return this._hhistsByTimePointIndex},e}();function l(e,t,i){var n=new Map;return e.forEach((function(e,r){var o=n.get(r)||new Set;e.forEach((function(e){var n=i(e,t);null!==n&&o.add(n)})),n.set(r,o)})),n}function c(e,t,i){var n=new Map;if(void 0===e)return n;for(var r=function(e){var r=e.styleId,o=n.get(r)||new Set;e.data.forEach((function(e){var n=i(e,t);null!==n&&o.add(n)})),n.set(r,o)},o=0,s=e;o0?r:void 0}function h(){return new a}function d(e){return new a("state",e)}function p(e){var t=function(e){var t=new Set;e.horizlines().forEach((function(e,i){e.forEach((function(e){t.add(e.startIndex),t.add(e.endIndex)}))})),e.vertlines().forEach((function(e,i){e.forEach((function(e){t.add(e.index)}))})),e.lines().forEach((function(e,i){e.forEach((function(e){t.add(e.startIndex),t.add(e.endIndex)}))})),e.textmarks().forEach((function(e,i){e.forEach((function(e){t.add(e.time)}))})),e.shapemarks().forEach((function(e,i){e.forEach((function(e){t.add(e.time)}))})),e.backgrounds().forEach((function(e,i){e.forEach((function(e){ t.add(null!==e.start?e.start:n.a),t.add(e.stop)}))})),e.polygons().forEach((function(e,i){e.forEach((function(e){e.points.forEach((function(e){t.add(e.index)}))}))})),e.trendchannels().forEach((function(e,i){e.forEach((function(e){t.add(e.startIndex),t.add(e.endIndex)}))})),e.hhists().forEach((function(e,i){e.forEach((function(e){t.add(e.firstBarTime),t.add(e.lastBarTime)}))})),e.dwglabels().forEach((function(e,i){e.forEach((function(e){t.add(e.x)}))})),e.dwglines().forEach((function(e,i){e.forEach((function(e){t.add(e.x1),t.add(e.x2)}))}));var i=Array.from(t);return i.sort((function(e,t){return e-t})),i}(e),i={indexes:t},s={currentId:0};return i.vertlines=u(e.vertlines(),s,t,o.a),i.horizlines=u(e.horizlines(),s,t,r.a),i}},xdS3:function(e,t,i){},xnA2:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("5rJj"),o=i("j3hX").LineToolColorsProperty;function s(e,t){var r=t||s.createProperties();n.call(this,e,r),this.version=s.version,i.e("lt-pane-views").then(function(e){var t=i("CR3a").FibChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,n),s.LevelsCount=24,s.version=2,s.prototype.levelsCount=function(){return s.LevelsCount},s.prototype.migrateVersion=function(e,t,i){i.properties.removeProperty("reverse")},s.prototype.pointsCount=function(){return 3},s.prototype.name=function(){return"Fib Channel"},s.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},s.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("17v9").FibDrawingsWith24LevelsDefinitionsViewModel}.bind(null,i)).catch(i.oe)},s.createProperties=function(e){var t=new r("linetoolfibchannel",e,!1,{range:[1,24],names:["coeff","color","visible"]});return s._configureProperties(t),t},s._configureProperties=function(e){n._configureProperties(e);var t=[];for(let i=1;i<=s.LevelsCount;i++)t.push(e.child("level"+i).child("color"));e.addChild("linesColors",new o(t)),e.addExclusion("linesColors")},t.LineToolFibChannel=s},xo8u:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i("mrSG"),r=i("Eyy1"),o=i("RDU5"),s=i("n5al"),a=function(e){function t(t,i,n,o){var a=e.call(this,o)||this;a._newSourcesCurrencies=new Map,a._oldSourcesCurrencies=new Map,a._showFade=!1,a._chartWidget=n;for(var l=n.model().mainSeries(),c=0,u=t.seriesLikeSources();c0&&(n=Object.assign({},this._points[0]),this._points.unshift(n))}},c.prototype.applyTemplate=function(e){delete e.background,delete e.backgroundColor,delete e.showBackground,n.prototype.applyTemplate.call(this,e)},c.prototype.name=function(){return"Elliott Labels"},c.prototype.additionalActions=function(e){var t=this;return[new r({label:window.t("Degree"),subItems:a.map((function(i){var n=l.filter((function(e){return e.value===i}))[0];return new r({label:n.title,checkable:!0,checked:t.properties().degree.value()===i,onExecute:function(){e.setProperty(t.properties().degree,i,"Change Elliott Degree")}})}))})]},c.prototype.label=function(e){var t=a.length-this.properties().degree.value()-1,i=Math.floor(t/3);return{group:i,bold:!!(i%2),decoration:["","brackets","circle"][t%3],label:this.labelsGroup()[i][e]}},c.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("UHSU").ElliottPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},c.prototype.availableDegreesValues=function(){return l},c.createProperties=function(e){var t=new o("linetoolelliott",e);return c._configureProperties(t),t},c._configureProperties=function(e){n._configureProperties(e),e.addChild("linesColors",new s([e.color])),e.addExclusion("linesColors")},inherit(u,c),u.prototype.pointsCount=function(){return 6},u._configureProperties=function(e){c._configureProperties(e)},inherit(h,u),h._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"]],h.prototype.name=function(){return"Elliott Impulse Wave (12345)"},h.prototype.labelsGroup=function(){return h._labelsGroups},h.createProperties=function(e){var t=new o("linetoolelliottimpulse",e);return h._configureProperties(t),t},h._configureProperties=function(e){u._configureProperties(e)},inherit(d,u),d._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"]],d.prototype.name=function(){return"Elliott Triangle Wave (ABCDE)"},d.prototype.labelsGroup=function(){return d._labelsGroups},d.createProperties=function(e){var t=new o("linetoolelliotttriangle",e);return d._configureProperties(t),t},d._configureProperties=function(e){u._configureProperties(e)},inherit(p,u), p._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"]],p.prototype.name=function(){return"Elliott Triple Combo Wave (WXYXZ)"},p.prototype.labelsGroup=function(){return p._labelsGroups},p.createProperties=function(e){var t=new o("linetoolelliotttriplecombo",e);return p._configureProperties(t),t},p._configureProperties=function(e){u._configureProperties(e)},inherit(f,c),f.prototype.pointsCount=function(){return 4},f._configureProperties=function(e){c._configureProperties(e)},inherit(_,f),_._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],_.prototype.name=function(){return"Elliott Correction Wave (ABC)"},_.prototype.labelsGroup=function(){return _._labelsGroups},_.createProperties=function(e){var t=new o("linetoolelliottcorrection",e);return _._configureProperties(t),t},_._configureProperties=function(e){f._configureProperties(e)},inherit(m,f),m._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],m.prototype.name=function(){return"Elliott Double Combo Wave (WXY)"},m.prototype.labelsGroup=function(){return m._labelsGroups},m.createProperties=function(e){var t=new o("linetoolelliottdoublecombo",e);return m._configureProperties(t),t},m._configureProperties=function(e){f._configureProperties(e)},t.LineToolElliott=c,t.LineToolElliottImpulse=h,t.LineToolElliottTriangle=d,t.LineToolElliottTripleCombo=p,t.LineToolElliottCorrection=_,t.LineToolElliottDoubleCombo=m},xzdg:function(e,t,i){"use strict";i.r(t);var n=i("Eyy1"),r=i("YFKU"),o=i("7KDR"),s=i("ikwP"),a=i("ogJP"),l=i("jFln"),c=i("u+0B"),u=i("XlJ7"),h=i("JWMC"),d=i("zDbI"),p=i("Hr11"),f=i("Kxc7").enabled("charting_library_debug_mode"),_=function(){function e(e,t,i,n){this._textWidthCache=new c.TextWidthCache(200),this._fontSize=0,this._color="",this._font="",this._keys=[],this._hash=new Map,this._fontSize=e,this._color=t,this._font=Object(u.makeFont)(e,i,n)}return e.prototype.destroy=function(){delete this._textWidthCache,this._keys=[],this._hash.clear()},e.prototype.paintTo=function(e,t,i,n,r){var o=this._getLabelImage(e,t);if("left"!==r){var a=Object(s.getCanvasDevicePixelRatio)(e.canvas);i-=Math.floor(o.textWidth*a)}n-=Math.ceil(o.height/2),e.drawImage(o.canvas,i,n,o.width,o.height)},e.prototype.getLabelHeight=function(e,t){return this._getLabelImage(e,t).height},e.prototype._getLabelImage=function(e,t){var i,r=this;if(this._hash.has(t))i=Object(n.ensureDefined)(this._hash.get(t));else{if(this._keys.length>=200){var o=Object(n.ensureDefined)(this._keys.shift());this._hash.delete(o)}var a=Object(s.getCanvasDevicePixelRatio)(e.canvas),l=Math.ceil(this._fontSize/4.5),c=Math.round(this._fontSize/10),u=Math.ceil(this._textWidthCache.measureText(e,t)),h=Object(p.ceiledEven)(Math.round(u+2*l)),d=Object(p.ceiledEven)(this._fontSize+2*l),_=Object(s.createDisconnectedCanvas)(document,new s.Size(h,d),a);i={text:t,textWidth:Math.round(Math.max(1,u)),width:Math.floor(h*a), height:Math.floor(d*a),canvas:_},0!==u?(this._keys.push(i.text),this._hash.set(i.text,i)):f&&console.log('Canvas 2d context measureText return zero width for "'+t+'" text'),e=Object(s.getContext2D)(i.canvas),Object(s.drawScaled)(e,a,(function(){e.font=r._font,e.fillStyle=r._color,e.fillText(t,0,d-l-c)}))}return i},e}(),m=i("CPmC"),v=i("+cnz"),y=i("CxTi"),g=function(){function e(){var e=this;this._width=null,this._currencyInfo=null,this._fontSize=0,this._currencyLabelWrapper=document.createElement("div"),this._currencyLabelWrapper.className=y["price-axis-currency-label-wrapper"],this._currencyLabel=document.createElement("span"),this._currencyLabel.className=y["price-axis-currency-label"],this._currencyLabel.classList.add("apply-common-tooltip"),Object(m.b)(this._currencyLabel,"text",(function(t){return e._tooltipContent()})),this._currencyText=document.createElement("span"),this._currencyText.className=y["price-axis-currency-label-text"],this._currencyLabel.appendChild(this._currencyText),this._arrowDown=document.createElement("span"),this._arrowDown.className=y["price-axis-currency-label-arrow-down"],this._arrowDown.innerHTML=v,this._currencyLabel.appendChild(this._arrowDown),this._currencyLabelWrapper.appendChild(this._currencyLabel)}return e.prototype.element=function(){return this._currencyLabelWrapper},e.prototype.labelElement=function(){return this._currencyLabel},e.prototype.isVisible=function(){return!this._currencyLabel.classList.contains("js-hidden")},e.prototype.width=function(){if(null!==this._width)return this._width;var e=this._currencyLabel.getBoundingClientRect();return this._width=e.right-e.left+1+8,this._width},e.prototype.drawLabel=function(e,t,i,n){var r=this._currencyText.textContent;if(null!==r){var o=Math.round(t/2*i),a=this._currencyLabel.getBoundingClientRect(),c=Object(p.ceiledEven)(a.width*i/2),h=this._currencyLabel.style,f=Math.round(this.labelTop()*i),_=Math.round(a.height*i),m=Math.round(Number(y.css_value_currency_label_radius)*i);Object(l.drawRoundRect)(e,o-c,f,2*c,_,m),e.fillStyle=h.backgroundColor,e.fill();var v=Math.max(1,Math.floor(i));e.lineWidth=v,e.strokeStyle=n?y.css_value_border_color_dark:y.css_value_border_color_light,Object(l.drawRoundRect)(e,o-c+v/2,f+v/2,2*c-v,_-v,m),e.stroke(),e.fillStyle=h.color,e.font=Object(u.makeFont)(this._fontSize,d.CHART_FONT_FAMILY),e.textBaseline="middle",e.textAlign="center",Object(s.drawScaled)(e,i,(function(){return e.fillText(r,o/i,(f+_/2)/i)}))}},e.prototype.show=function(){this._currencyLabel.classList.remove("js-hidden"),this._width=null},e.prototype.hide=function(){this._currencyLabel.classList.add("js-hidden")},e.prototype.setCurrencyInfo=function(e){if(null!==this._currencyInfo&&this._currencyInfo.selectedCurrency===e.selectedCurrency&&this._currencyInfo.readOnly===e.readOnly&&this._currencyInfo.originalCurrencies.size===e.originalCurrencies.size)return this._currencyInfo=e,!1;this._currencyInfo=e;var t=null===e.selectedCurrency?Object(r.t)("Mixed"):Object(n.ensureDefined)(e.displayedValues.get(e.selectedCurrency)) ;return this._currencyText.textContent!==t&&(this._currencyText.textContent=t,this._width=null),this._arrowDown.classList.contains("js-hidden")!==e.readOnly&&(this._arrowDown.classList.toggle("js-hidden",e.readOnly),this._currencyLabel.classList.toggle(y.readonly,e.readOnly),this._width=null),!0},e.prototype.updateColors=function(e,t){var i=this._currencyLabel.style;i.background=e,i.color=t},e.prototype.currencyInfo=function(){return this._currencyInfo},e.prototype.setFontSize=function(e){this._fontSize=e,this._currencyLabel.style.fontSize=e+"px",this._width=null},e.prototype.setLineHeight=function(e){this._currencyLabel.style.lineHeight=e+"px"},e.prototype.labelTop=function(){return Number(y.css_value_currency_label_top)},e.prototype._tooltipContent=function(){var e=this._currencyInfo;return null===e?"":null===e.selectedCurrency?Array.from(e.currencies).map((function(t){return Object(n.ensureDefined)(e.displayedValues.get(t))})).join(", "):""},e}(),b=i("mrSG");i.d(t,"PriceAxisWidgetBase",(function(){return w}));var S={contextMenuEnabled:!0,currencyConversionEnabled:!1,contextMenu:{general:!0,source:!0},pressedMouseMoveScale:!0,croppedTickMarks:!0},w=function(){function e(e,t,i,n,r,o){var l=this;this._priceScale=null,this._widthCache=new c.TextWidthCache(50),this._tickmarksCache=new _(12,"#000",d.CHART_FONT_FAMILY,""),this._color=null,this._fontSize=null,this._currencyFontSize=0,this._currencyLabelWidth=null,this._isVisible=!0,this._updateTimeout=null,this._currencyMenu=null,this._prevOptimalWidth=0,this._size=null,this._destroyed=!1,this._pane=e,this._undoModel=t,this._properties=i,this._isLeft="left"===n,this._options=Object(a.merge)(Object(a.clone)(S),r),this._rendererOptionsProvider=o,this._cell=document.createElement("div"),this._cell.className="price-axis",this._cell.style.width="25px",this._cell.style.left="0",this._canvasConfiguredHandler=function(){l._recreateTickMarksCache(l._rendererOptionsProvider.options()),l._undoModel.model().lightUpdate()},this._canvasBinding=Object(s.createBoundCanvas)(this._cell,new s.Size(16,16)),this._canvasBinding.subscribeCanvasConfigured(this._canvasConfiguredHandler);var u=this._canvasBinding.canvas;u.style.position="absolute",u.style.zIndex="1",u.style.left="0",u.style.top="0",this._topCanvasConfiguredHandler=function(){return l._undoModel.model().lightUpdate()},this._topCanvasBinding=Object(s.createBoundCanvas)(this._cell,new s.Size(16,16)),this._topCanvasBinding.subscribeCanvasConfigured(this._topCanvasConfiguredHandler);var h=this._topCanvasBinding.canvas;h.style.position="absolute",h.style.zIndex="2",h.style.left="0",h.style.top="0",this._options.currencyConversionEnabled?(this._currencyLabel=new g,this._cell.appendChild(this._currencyLabel.element()),this._currencyLabel.labelElement().addEventListener("click",(function(e){return l._showCurrenciesContextMenu(e)}))):this._currencyLabel=null,this._properties.childs().fontSize.subscribe(this,this._onFontSizeChanged)}return e.prototype.getElement=function(){return this._cell}, e.prototype.onOptimalWidthNeedToBeRecalculated=function(){var e=this,t=this.optimalWidth();this._prevOptimalWidth0&&(e=Math.max(this._widthCache.measureText(i,r[0].label),this._widthCache.measureText(i,r[r.length-1].label)));for(var o=this.backLabels(!0),a=o.length;a--;){var c=this._widthCache.measureText(i,o[a].text());e=Math.max(e,c);var u=o[a].secondLineText();u&&(e=Math.max(e,this._widthCache.measureText(i,u)))}}var h=0;this._isCurrencyLabelVisible()&&(null===this._currencyLabelWidth&&(this._currencyLabelWidth=Object(n.ensureNotNull)(this._currencyLabel).width()),h=this._currencyLabelWidth);var d=Math.max(h,Math.ceil(t.borderSize+t.tickLength+t.paddingInner+t.paddingOuter+e));return d+=d%2},e.prototype.getImage=function(){var e=Object(n.ensureNotNull)(this._size),t=Object(s.createDisconnectedCanvas)(document,e);if(Object(s.getPrescaledContext2D)(t).drawImage(this._canvasBinding.canvas,0,0,e.w,e.h),null!==this._currencyLabel&&this._currencyLabel.isVisible()){var i=this._undoModel.model().isDark();this._currencyLabel.drawLabel(Object(s.getContext2D)(t),e.w,Object(s.getCanvasDevicePixelRatio)(t),i)}return t},e.prototype.priceScale=function(){return Object(n.ensureNotNull)(this._priceScale)},e.prototype.setPriceScale=function(e){this._priceScale!==e&&(null!==this._priceScale&&this._priceScale.onMarksChanged().unsubscribe(this,this.onOptimalWidthNeedToBeRecalculated),this._priceScale=e,null!==e&&e.onMarksChanged().subscribe(this,this.onOptimalWidthNeedToBeRecalculated))},e.prototype.isVisible=function(){return this._isVisible},e.prototype.setVisible=function(e){(e=!!e)!==this._isVisible&&(this._cell.style.display=e?"table-cell":"none",this._isVisible=e)},e.prototype.destroy=function(){null!==this._currencyMenu&&(this._currencyMenu.close(),this._currencyMenu=null),this._topCanvasBinding.unsubscribeCanvasConfigured(this._topCanvasConfiguredHandler),this._topCanvasBinding.destroy(),this._canvasBinding.unsubscribeCanvasConfigured(this._canvasConfiguredHandler),this._canvasBinding.destroy(),null!==this._priceScale&&this._priceScale.onMarksChanged().unsubscribe(this,this.onOptimalWidthNeedToBeRecalculated),this._priceScale=null,this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=null),this._properties.childs().fontSize.unsubscribe(this,this._onFontSizeChanged),this._destroyed=!0},e.prototype.backgroundColor=function(){return this._pane.state().model().backgroundColor().value()},e.prototype.backgroundTopColor=function(){return this._pane.state().model().backgroundTopColor().value()},e.prototype.lineColor=function(){return this._properties.childs().lineColor.value()}, e.prototype.textColor=function(){return this._properties.childs().textColor.value()},e.prototype.fontSize=function(){return this._properties.childs().fontSize.value()},e.prototype.baseFont=function(){return Object(u.makeFont)(this.fontSize(),d.CHART_FONT_FAMILY,"")},e.prototype.rendererOptions=function(){var e=this._rendererOptionsProvider.options();return this._color===e.color&&this._fontSize===e.fontSize||(this._recreateTickMarksCache(e),this._color=e.color),this._fontSize!==e.fontSize&&(this._widthCache.reset(),this._fontSize=e.fontSize,this._currencyLabelWidth=null,this._currencyFontSize=0,this.onOptimalWidthNeedToBeRecalculated()),e},e.prototype._isCurrencyLabelVisible=function(){return null!==this._currencyLabel&&this._currencyLabel.isVisible()},e.prototype._updateCurrencyLabel=function(){if(null!==this._currencyLabel){var e=this.priceScale().currency(this._undoModel.model().availableCurrencies());null!==e&&this._properties.childs().showCurrency.value()?(this._currencyLabel.show(),this._currencyLabel.updateColors(this.backgroundTopColor(),this.textColor()),this._currencyLabel.setCurrencyInfo(e)&&(this._currencyLabelWidth=null,this.onOptimalWidthNeedToBeRecalculated())):this._currencyLabel.hide(),this._updateCurrencyLabelFont()}},e.prototype._currencyLabelLineHeight=function(){var e=this.rendererOptions();return Math.floor(this.fontSize()+e.paddingTop+e.paddingBottom)},e.prototype._updateCurrencyLabelFont=function(){if(null!==this._currencyLabel){var e=this.fontSize();e!==this._currencyFontSize&&(this._currencyLabel.setFontSize(e),this._currencyLabel.setLineHeight(this._currencyLabelLineHeight()),this._currencyFontSize=e,this._currencyLabelWidth=null,this.onOptimalWidthNeedToBeRecalculated())}},e.prototype._recreateTickMarksCache=function(e){this._tickmarksCache.destroy(),this._tickmarksCache=new _(e.fontSize,e.color,d.CHART_FONT_FAMILY,"")},e.prototype._hasAlertLabel=function(){return!1},e.prototype._currenciesActions=function(){var e=this,t=Object(n.ensureNotNull)(this._currencyLabel).currencyInfo();if(null===t||t.readOnly)return[];var i=[],s=function(e,t,i,n){return new o.Action({label:e,checkable:!0,checked:t,onExecute:i,statName:n})},a=t.selectedCurrency,l=t.originalCurrencies,c=t.baseCurrencies,u=t.displayedValues;if(l.size>1){var h=s(Object(r.t)("Mixed"),null===t.selectedCurrency,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),null)}),"Mixed");i.push(h)}var d=this._pane.state().model().availableCurrencies();if(null!==a){var p=s(Object(n.ensureDefined)(u.get(a)),!0,(function(){}),a);i.push(p)}for(var f=d.filterConvertible(c,(function(e){return e!==a&&l.has(e)})),_=function(n){i.push(s(n.code,t.selectedCurrency===n.id,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),n.id)}),n.id))},m=0,v=f;m0)&&i.push(new o.Separator);for(var y=function(n){i.push(s(n.code,t.selectedCurrency===n.id,(function(){e._undoModel.setPriceScaleCurrency(e.priceScale(),n.id)}),n.id))},g=0,b=d.filterConvertible(c,(function(e){return e!==a&&!l.has(e) }));g0&&!this.timeScale().isEmpty()){var i=this.timeScale().visibleBarsStrictRange();e.recalculatePriceRange(i)}e.updatePaneViews()}},e.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},e.prototype.getZOrderMinMax=function(){var e=this.sourcesByGroup().all();if(0===e.length)return{minZOrder:0,maxZOrder:0};for(var t=1/0,i=-1/0,n=0,r=e;n=0&&t.removeDataSource(e),t&&null===t.mainSource()){var i=t.dataSources().length;0!==i&&w.logError("Invalid priceScale state: empty mainSource but non-empty data sources="+i),this.removePriceScale(t)}},e}()},yi8X:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolInfoLine",(function(){return s}));var n=i("mrSG"),r=i("Ocx9"),o=i("WPQD"),s=function(e){function t(i,n){return e.call(this,i,n||t.createProperties())||this}return Object(n.c)(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.name=function(){return"Info Line"},t.createProperties=function(e){var i=new r.DefaultProperty("linetoolinfoline",e);return t._configureProperties(i),i},t._configureProperties=function(e){o.LineToolTrendLine._configureProperties(e)},t}(o.LineToolTrendLine)},"z+Sa":function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesHorizontalBaseLinePaneView",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t){return e.call(this,t)||this}return Object(n.c)(t,e),t.prototype._updateImpl=function(){this._lineRendererData.visible=!1;var e=this._series.priceScale().mode();if(e.percentage||e.indexedTo100){var t=this._series.firstValue();null!==t&&(this._lineRendererData.visible=!0,this._lineRendererData.y=this._series.priceScale().priceToCoordinate(t,t),this._lineRendererData.color=this._series.properties().baseLineColor.value())}},t}(i("k4w6").a)},"z+cS":function(e,t,i){"use strict";i.r(t),i.d(t,"VerticalLineRenderer",(function(){return s}));var n=i("VdBB"),r=i("jFln"),o=i("gAom"),s=function(){function e(){this._data=null,this._hitTest=null}return e.prototype.setData=function(e){this._data=e},e.prototype.setHitTest=function(e){this._hitTest=e},e.prototype.hitTest=function(e){if(null===this._data)return null ;var t=this._hitTest||new n.HitTestResult(n.HitTestResult.MOVEPOINT),i=Math.abs(e.x-this._data.x)<=3+this._data.linewidth/2,r=void 0===this._data.top||this._data.top-e.y<=3,o=void 0===this._data.bottom||e.y-this._data.bottom<=3;return i&&r&&o?t:null},e.prototype.draw=function(e,t){if(null!==this._data&&!(this._data.linewidth<=0||this._data.x<-this._data.linewidth/2||this._data.x>t.cssWidth+this._data.linewidth/2)){var i=t.pixelRatio;e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=Math.max(1,Math.floor(this._data.linewidth*i)),void 0!==this._data.linestyle&&Object(r.setLineStyle)(e,this._data.linestyle);var n=void 0!==this._data.top?Math.max(this._data.top,0):0,s=void 0!==this._data.bottom?Math.min(this._data.bottom,t.cssHeight):t.cssHeight,a=Math.round(this._data.x*i),l=Math.floor(n*i),c=Math.ceil(s*i);Object(o.drawVerticalLine)(e,a,l,c)}},e}()},"z61+":function(e,t,i){"use strict";i.d(t,"a",(function(){return f}));var n,r=i("mrSG"),o=i("Eyy1"),s=i("0YCj"),a=i.n(s),l=i("23IT"),c=i("ogJP"),u=i("txPx"),h=i("W5mg"),d=i("Ecpn"),p=Object(u.getLogger)("Platform.GUI.PropertyDialog.Indicators.MetaInfo"),f=function(){function e(e){this._metaInfo=e}return e.prototype.hasUserEditableInputs=function(){return this._metaInfo.inputs.some(h.a)},e.prototype.getUserEditableInputs=function(){return this._metaInfo.inputs.filter(h.a)},e.prototype.hasUserEditableProperties=function(){return a.a.isScriptStrategy(this._metaInfo)},e.prototype.hasUserEditableStyles=function(){var e=this._metaInfo;return this.getUserEditablePlots().length>0||void 0!==e.bands||void 0!==e.filledAreas||Object(d.a)(e.shortId)||a.a.isScriptStrategy(this._metaInfo)||Object.values(e.graphics).some((function(e){return void 0!==e}))},e.prototype.getUserEditablePlots=function(){var e=new Set,t=this._metaInfo;return t.plots.filter((function(i){if(Object(l.isColorerPlot)(i)||Object(l.isTextColorerPlot)(i)||Object(l.isDataOffsetPlot)(i)||Object(l.isOhlcColorerPlot)(i)||Object(l.isAlertConditionPlot)(i))return!1;if(Object(l.isOhlcPlot)(i)){var n=i.target;if(e.has(n))return!1;e.add(n);var r=Object(o.ensureDefined)(t.ohlcPlots);return!Object(o.ensureDefined)(r[n]).isHidden}var s=t.styles?t.styles[i.id]:void 0;return void 0===s||!s.isHidden}))},e.prototype.hasUserEditableOptions=function(){return this.hasUserEditableInputs()||this.hasUserEditableProperties()||this.hasUserEditableStyles()},e.prototype.getStrategyProperties=function(){for(var e,t=this._metaInfo,i=t.inputs.filter(m),n=Object(r.a)({},_),s=0,a=i;s=0&&Object(T.drawVerticalLine)(e,o,0,l),r&&s>=0&&Object(T.drawHorizontalLine)(e,s,0,a),this._data.drawCenter&&(e.beginPath(),e.arc(o,s,Math.round(3*i),0,2*Math.PI,!0),e.fillStyle=this._data.color,e.fill()),e.restore()}},e}(),I=i("CW80"),L=function(){function e(e,t,i){this._rendererData={},this._renderer=new x(this._rendererData),this._source=e,this._pane=t,this._horzVisible=i}return e.prototype.update=function(){},e.prototype.renderer=function(e,t){var i=this._source.visible&&this._source.areLinesVisible&&!this._source.linesShouldBeHidden(),n=Object(p.lockTimeAxis)().value(),r=this._rendererData;if(!i||null===this._pane)return null;r.horzLinesVisible=i&&this._horzVisible,r.vertLinesVisible=i||n;var o,s=this._source.model(),a=this._source.properties(),l=this._source.selectBarMode().value()&&this._source.isOnHoveredChartWidget(),c=s.currentTool(),u=Object(w.lastEventIsTouch)()&&(Object(I.isLineToolName)(c)||Object(p.toolIsMeasure)(c))&&!l;o=u?s.isDark()?"#1E88E5":"#2196F3":a.childs().color.value();var h=a.childs().transparency.value();return!u&&h>0&&(o=Object(b.generateColor)(o,h)),r.color=o,r.lineWidth=a.childs().width.value(),r.lineStyle=a.childs().style.value(),r.drawCenter=u&&this._pane===this._source.pane,r.w=this._pane.width(),r.h=this._pane.height(),r.x=void 0!==this._source.lockedX&&isFinite(this._source.lockedX)&&this._source.lockedX||this._source.x,r.y=this._source.y,l&&(r.vertLinesVisible=!0,r.lineStyle=S.LINESTYLE_SOLID,r.lineWidth=2,r.color="#ff0000"),this._renderer},e}(),O=i("IjC5"),M=function(){function e(e){this._renderer=new O.RectangleRenderer,this._rectangle=null,this._crosshair=e}return e.prototype.update=function(){var e=this._crosshair.selection();null!==e&&null!==this._crosshair.pane?this._rectangle=this._crosshair.pane.logicalRectToPixels(e):this._rectangle=null},e.prototype.renderer=function(e,t){if(!this._rectangle)return null;var i=this._crosshair.model().isDark(),n={backcolor:i?"rgba(21, 101, 192, 0.3)":"rgba(33, 150, 243, 0.3)",color:i?"rgba(21, 101, 192, 0.8)":"rgba(33, 150, 243, 0.8)",fillBackground:!0,linewidth:1,points:[this._rectangle.min,this._rectangle.max],extendLeft:!1,extendRight:!1};return this._renderer.setData(n),this._renderer},e}(),A=i("Ialn"),k=i("GH0z"),E=i("5C6T"),V=i("nda6"),D=i("pJOz"),B=i("qgcf"),R=i("Zy3/"),N=i("a7Ha"),j=i("zDbI"),F=window.t("{0} bars"),W=new V.TimeSpanFormatter,H=function(){function e(e,t){this._pipFormatter=null,this._lastSymbolInfo=null,this._horzTrenRenderer=new D.TrendLineRenderer,this._vertTrenRenderer=new D.TrendLineRenderer, this._bgRenderer=new O.RectangleRenderer,this._labelRenderer=new B.TextRenderer,this._p1=null,this._p2=null,this._label=null,this._source=e,this._pane=t}return e.prototype.update=function(){var e=this._source.measurePoints(),t=e[0],i=e[1];if(void 0===i)return this._p1=null,void(this._p2=null);var n=Object(r.ensureNotNull)(this._source.measurePane()),s=t.price,a=i.price,l=i.price-s,c=i.index-t.index,u=Object(A.forceLTRStr)(""+c),h=Object(r.ensureNotNull)(n.mainDataSource()),d=Object(r.ensureNotNull)(h.formatter()).format(l);if(Math.abs(s)>1e-8){var p=l/Math.abs(s);d+=" ("+(new k.PercentageFormatter).format(100*p)+")"}var f=Object(A.forceLTRStr)(d);this._label=f+"\n"+F.format(u);var _=Object(r.ensureNotNull)(h.firstValue()),m=this._source.model().timeScale().indexToCoordinate(t.index),v=this._source.model().timeScale().indexToCoordinate(i.index),y=n.defaultPriceScale().priceToCoordinate(s,_),g=n.defaultPriceScale().priceToCoordinate(a,_);this._p1=new o.Point(m,y),this._p2=new o.Point(v,g);var b=this._source.model().timeScale().indexToUserTime(t.index),w=this._source.model().timeScale().indexToUserTime(i.index),P=null;if(null!==b&&null!==w){var C=this._pane.model().mainSeries().symbolInfo();null!==C&&C!==this._lastSymbolInfo&&(this._pipFormatter=new E.PipFormatter(C.pricescale,C.minmov,C.type,C.minmove2),this._lastSymbolInfo=C),P=(w.valueOf()-b.valueOf())/1e3}var T=this._pipFormatter?this._pipFormatter.format(l):null,x=null!==T?" , "+T:"",I=null!==P?W.format(P):null,L=null!==I?", "+Object(A.startWithLTR)(I):"";this._label=Object(A.forceLTRStr)(f+x)+"\n"+F.format(u)+L;var O=a=50?N.LineEnd.Arrow:N.LineEnd.Normal};this._horzTrenRenderer.setData(z);var U,G,Y=Math.round(R.x);z={points:[U=new o.Point(Y,this._p1.y),G=new o.Point(Y,this._p2.y)],color:M,linewidth:1,linestyle:S.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:N.LineEnd.Normal,rightend:Math.abs(U.y-G.y)>=50?N.LineEnd.Arrow:N.LineEnd.Normal};this._vertTrenRenderer.setData(z);var q,K={x:0,y:10},Z=.5*(this._p1.x+this._p2.x),J=this._p2.y,X=new o.Point(Z,J),Q=(q=Object(r.ensureNotNull)(this._label),{points:[X],text:q,color:"#FFFFFF",horzAlign:"center",vertAlign:"middle",font:j.CHART_FONT_FAMILY,offsetX:K.x,offsetY:K.y,bold:!1,italic:!1,fontsize:12,padding:8,highlightBorder:!1,backgroundColor:V,backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4});this._labelRenderer.setData(Q);var $=this._labelRenderer.measure(),ee=Object(B.calculateLabelPosition)($,this._p1,this._p2,K,this._pane.height());this._labelRenderer.setPoints([ee])}, e.prototype.renderer=function(){if(null===this._p1||null===this._p2)return null;var e=new R.CompositeRenderer;return e.append(this._bgRenderer),e.append(this._horzTrenRenderer),e.append(this._vertTrenRenderer),e.append(this._labelRenderer),e},e}(),z=function(e){function t(t){var i=e.call(this)||this;return i._data=t,i}return Object(n.c)(t,e),t.prototype.hitTest=function(e){return null},t.prototype._drawImpl=function(e){e.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),e.strokeStyle="rgba(153,153,153,.3)",e.lineWidth=2,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.strokeStyle="rgba(153,153,153,.7)",e.lineWidth=1,e.beginPath(),e.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),e.closePath(),e.stroke(),e.translate(0,-1),e.strokeStyle="#777",e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.fillStyle="rgba(255,255,255,.7)",e.beginPath(),e.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),e.fill(),e.beginPath(),e.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),e.stroke(),e.closePath(),e.fillStyle="#777",e.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)},t.prototype._drawShackle=function(e){var t=(this._data.width-3)/2,i=this._data.height-this._data.bodyHeight;e.moveTo(1.5,t),e.arc(this._data.width/2,t,t,Math.PI,2*Math.PI),i>t&&(e.moveTo(1.5,t),e.lineTo(1.5,i),e.moveTo(this._data.width-1.5,t),e.lineTo(this._data.width-1.5,i))},t}(i("cPgM").ScaledPaneRenderer),U=function(){function e(e,t,i){this._horzVisible=!1,this._source=e,this._pane=t,this._axis=i||"x"}return e.prototype.update=function(){},e.prototype.renderer=function(e,t){var i=this._source.visible&&this._source.areLinesVisible,n=Object(p.lockTimeAxis)().value(),o=i&&this._horzVisible,s=i||n;if("y"===this._axis&&!o||!s)return null;var a="y"===this._axis?this._pane.width()-4.5:Object(r.ensureDefined)(this._source.lockedX)+1,l="y"===this._axis?this._source.y:this._pane.height()-5.5-1;return new z({x:a,y:l,width:9,height:11,bodyHeight:7})},e}(),G=i("qFKp"),Y=i("aIyQ"),q=i.n(Y),K=i("GDWD");i.d(t,"CrosshairBase",(function(){return J}));var Z={menuEnabled:!1,menuForMainSourceOnly:!1,disableTradingMenuActions:!1},J=function(e){function t(t,i){var n=e.call(this)||this;n._measuringStarted=new q.a,n._measurePane=null,n._startMeasurePoint=null,n._endMeasurePoint=null,n._lastValidMeasurePoint=null,n._isOnHoveredChartWidget=!1,n._selectBarMode=new l.a(!1),n._selectionPane=null,n._selectionView=new M(n),n._selectionStartPoint=null,n._measurePaneView=null,n._timeLockPaneView=null,n._priceAxisViews=new Map,n._panePriceAxisViews=new Map,n._startMeasurePriceAxisViews=new Map,n._endMeasurePriceAxisViews=new Map,n._model=t,n._options=Object.assign({},Z,i||{}),n._linesShouldBeHidden=n._model.readOnly(),n.setSelectionEnabled(!1);var o=function(e){return function(t){return t===Object(r.ensureNotNull)(n._measurePane).defaultPriceScale()?e():null}} ;return n._currentPosPriceProvider=function(e){var t=Object(r.ensureNotNull)(n.pane);if(e===t.defaultPriceScale())return n.price;var i=Object(r.ensureNotNull)(t.defaultPriceScale().mainSource()).firstValue();if(null===i)return null;var o=t.defaultPriceScale().priceToCoordinate(n.price,i),s=Object(r.ensureNotNull)(e.mainSource()).firstValue();return null===s?null:e.coordinateToPrice(o,s)},n._startMeasurePriceProvider=o((function(){return Object(r.ensureNotNull)(n._startMeasurePoint).price})),n._endMeasurePriceProvider=o((function(){return Object(r.ensureNotNull)(n._lastMeasurePoint()).price})),n}return Object(n.c)(t,e),t.prototype.currentPoint=function(){return new o.Point(this.x,this.y)},t.prototype.startMeasurePoint=function(){return this._startMeasurePoint||null},t.prototype.endMeasurePoint=function(){return this._endMeasurePoint||null},t.prototype.measurePane=function(){return this._measurePane||null},t.prototype.startMeasuring=function(e,t){this._startMeasurePoint=e,this._measurePane=t,this._measuringStarted.fire()},t.prototype.finishMeasure=function(e){this._endMeasurePoint=e},t.prototype.clearMeasure=function(){delete this._measurePane,delete this._startMeasurePoint,delete this._endMeasurePoint,delete this._lastValidMeasurePoint,this._model.lightUpdate()},t.prototype.measuringStarted=function(){return this._measuringStarted},t.prototype.measurePoints=function(){this.updateAllViews();var e=[Object(r.ensureNotNull)(this._startMeasurePoint)],t=this._lastMeasurePoint();return null!==t&&e.push(t),e},t.prototype.startSelection=function(e){this._selectionStartPoint=this.currentLogicalPoint(),this._selectionPane=e},t.prototype.clearSelection=function(){this._selectionStartPoint=null,this._selectionPane=null},t.prototype.selection=function(){return this._selectionStartPoint?{p1:this._selectionStartPoint,p2:this.currentLogicalPoint()}:null},t.prototype.currentLogicalPoint=function(){return{index:this.appliedIndex(),price:this.price}},t.prototype.setLinesShouldBeHidden=function(e){this._linesShouldBeHidden=e},t.prototype.linesShouldBeHidden=function(){return this._linesShouldBeHidden},t.prototype.priceAxisViews=function(e,t){var i=[];return this._selectBarMode.value()&&this._isOnHoveredChartWidget||this.pane!==e||i.push(this._createPriceAxisViewOnDemand(this._priceAxisViews,this._panePriceAxisViews,e,t,this._currentPosPriceProvider,h,!0)),this._startMeasurePoint&&i.push(this._createPriceAxisViewOnDemand(this._startMeasurePriceAxisViews,null,e,t,this._startMeasurePriceProvider,d)),this._lastMeasurePoint()&&i.push(this._createPriceAxisViewOnDemand(this._endMeasurePriceAxisViews,null,e,t,this._endMeasurePriceProvider,d)),i},t.prototype.timeAxisViews=function(){var e=[];return this._linesShouldBeHidden||!this.visible&&!Object(p.lockTimeAxis)().value()||e.push(this._timeAxisView),this._startMeasurePoint&&e.push(this._startMeasureTimeAxisView),this._lastMeasurePoint()&&e.push(this._endMeasureTimeAxisView),e},t.prototype.paneViews=function(e){if(void 0===e)return null ;var t=this._selectBarMode.value()&&this._isOnHoveredChartWidget,i=e===this.pane&&!t,n=[new L(this,e,i)];if(e===this._selectionPane&&n.push(this._selectionView),e===this._measurePane&&(null===this._measurePaneView&&(this._measurePaneView=new H(this,e)),this._measurePaneView.update(),n.push(this._measurePaneView)),K.addPlusButtonProperty.value()){var r=e===this.pane,o=!G.CheckMobile.any()||window.screen.width>=320,s=p.tool.value(),a=Object(I.isLineToolName)(s),l=null!==this._model.lineBeingEdited()||null!==this._model.lineBeingCreated()||this._model.sourcesBeingMoved().length>0;if(r&&this._isOnHoveredChartWidget&&!t&&o&&!a&&!l){var c=this._panePriceAxisViews.get(e);void 0!==c&&c.forEach((function(e){return n.push(e)}))}}return Object(p.lockTimeAxis)().value()&&(null===this._timeLockPaneView&&(this._timeLockPaneView=new U(this,e)),n.push(this._timeLockPaneView)),n},t.prototype.updateAllViews=function(){this._priceAxisViews.forEach((function(e){e.forEach((function(e){return e.update()}))})),this._panePriceAxisViews.forEach((function(e){e.forEach((function(e){return e.update()}))})),this._startMeasurePoint&&(this._startMeasurePriceAxisViews.forEach((function(e){e.forEach((function(e){return e.update()}))})),this._startMeasureTimeAxisView.update()),this._lastMeasurePoint()&&(this._endMeasurePriceAxisViews.forEach((function(e){e.forEach((function(e){return e.update()}))})),this._endMeasureTimeAxisView.update()),this._timeAxisView.update(),this._selectionView.update(),this._dataWindowView.update()},t.prototype.setLockedPosition=function(e){delete this.lockedIndex,delete this.lockedX,e!==this._measurePane&&Object(p.lockTimeAxis)().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(p.lockTimeAxisTime.value()),null!==this.lockedIndex&&(this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex)))},t.prototype.isMenuEnabled=function(){return this._options.menuEnabled},t.prototype._lastMeasurePoint=function(){return this._endMeasurePoint?this._endMeasurePoint:(null!==this.pane&&this._measurePane===this.pane&&(this._lastValidMeasurePoint={price:this._model.magnet().align(this.price,this.index,this.pane),index:this.index}),this._lastValidMeasurePoint||null)},t.prototype._createPriceAxisViewOnDemand=function(e,t,i,n,r,o,s){var a=this;void 0===s&&(s=!1);var l=e.get(i),c=null!==t?t.get(i):void 0;void 0===l&&(l=new Map,e.set(i,l),this._options.menuEnabled&&null!==t&&(c=new Map,t.set(i,c)),s&&i.onDestroyed().subscribe(this,(function(){return a._onPaneDestroyed(i)})));var u=l.get(n);if(void 0===u){if(u=new o(this,n,r),l.set(n,u),void 0!==c){var h=new g(u,this,n,this._model,this._options);c.set(n,h)}s&&n.lastSourceRemoved().subscribe(this,(function(){return a._onPriceScaleCleared(n)}))}return u},t.prototype._onPaneDestroyed=function(e){e.onDestroyed().unsubscribeAll(this),this._priceAxisViews.delete(e),this._panePriceAxisViews.delete(e),this._startMeasurePriceAxisViews.delete(e),this._endMeasurePriceAxisViews.delete(e)},t.prototype._onPriceScaleCleared=function(e){ e.lastSourceRemoved().unsubscribeAll(this),this._priceAxisViews.forEach((function(t){return t.delete(e)})),this._panePriceAxisViews.forEach((function(t){return t.delete(e)})),this._startMeasurePriceAxisViews.forEach((function(t){return t.delete(e)})),this._endMeasurePriceAxisViews.forEach((function(t){return t.delete(e)}))},t}(s.DataSource)},zZ5f:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("5rJj"),o=i("j3hX").LineToolColorsProperty;function s(e,t){var r=t||s.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("xp9B").FibSpeedResistanceFanPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,n),s.HLevelsCount=7,s.VLevelsCount=7,s.prototype.hLevelsCount=function(){return s.HLevelsCount},s.prototype.vLevelsCount=function(){return s.VLevelsCount},s.prototype.pointsCount=function(){return 2},s.prototype.name=function(){return"Fib Speed Resistance Fan"},s.prototype.processErase=function(e,t){var i="h"===t.type?"hlevel"+t.index:"vlevel"+t.index,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},s.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("2PB4").FibSpeedResistanceFanDefinitionsViewModel}.bind(null,i)).catch(i.oe)},s.createProperties=function(e){void 0!==e&&void 0===e.reverse&&(e.reverse=!0);var t=new r("linetoolfibspeedresistancefan",e,!1,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]});return s._configureProperties(t),t},s._configureProperties=function(e){n._configureProperties(e);var t=[e.child("grid").child("color")];for(let i=1;i<=s.HLevelsCount;i++)t.push(e.child("hlevel"+i).child("color"));for(let i=1;i<=s.VLevelsCount;i++)t.push(e.child("vlevel"+i).child("color"));e.addChild("linesColors",new o(t)),e.addExclusion("linesColors")},t.LineToolFibSpeedResistanceFan=s},ziJ5:function(e,t,i){"use strict";(function(e){var n=i("QIuV").LineToolTrading,r=i("Ss5c").LineDataSource,o=i("RTYN").PositionAveragePriceAxisView,s=i("jkoZ"),a=i("Ocx9").DefaultProperty,l=i("kcTO").PriceFormatter,c=i("s1Gx").sortSourcesPreOrdered.LineToolPosition;function u(e){this._line=e,this._data={bodyText:"position",quantityText:"0"},this._closeEnabled=!0,this._direction="buy",this._profitState="neutral"}function h(e){return null==e?e="":e+="",e}function d(e,t){this._adapter=new u(this);var r=t||d.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("GzSs").PositionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe);var o=e.mainSeries().symbolInfo(),s=null!==o?o.pricescale:100,a=null!==o&&o.fractional?o.minmov:1,c=null!==o&&o.fractional,h=null!==o?o.minmove2:void 0;this._formatter=new l(s,a,c,h)}u.prototype.setDirection=function(e){return this._direction=e,this._line.updateAllViewsAndRedraw(),this},u.prototype.setProfitState=function(e){return this._profitState=e,this._line.updateAllViewsAndRedraw(),this}, u.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},u.prototype.setPrice=function(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},u.prototype.getText=function(){return this._data.bodyText},u.prototype.setText=function(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this},u.prototype.setTooltip=function(e){return this._line.properties().tooltip.setValue(h(e)),this},u.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},u.prototype.setProtectTooltip=function(e){return this._line.properties().protectTooltip.setValue(h(e)),this},u.prototype.getProtectTooltip=function(){return this._line.properties().protectTooltip.value()},u.prototype.setCloseTooltip=function(e){return this._line.properties().closeTooltip.setValue(h(e)),this},u.prototype.getCloseTooltip=function(){return this._line.properties().closeTooltip.value()},u.prototype.setReverseTooltip=function(e){return this._line.properties().reverseTooltip.setValue(h(e)),this},u.prototype.getReverseTooltip=function(){return this._line.properties().reverseTooltip.value()},u.prototype.getQuantity=function(){return this._data.quantityText},u.prototype.setQuantity=function(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this},u.prototype.getExtendLeft=function(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e},u.prototype.setExtendLeft=function(e){return this._line.properties().extendLeft.setValue(e),this},u.prototype.getLineLength=function(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e},u.prototype.setLineLength=function(e){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this},u.prototype.getLineColor=function(){var e=this._line.properties();return("buy"===this._direction?e.lineBuyColor:e.lineSellColor).value()},u.prototype.setLineColor=function(e){return"buy"===this._direction?this.setLineBuyColor(e):this.setLineSellColor(e),this},u.prototype.setLineBuyColor=function(e){return this._line.properties().lineBuyColor.setValue(e),this},u.prototype.setLineSellColor=function(e){return this._line.properties().lineSellColor.setValue(e),this},u.prototype.getLineStyle=function(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e},u.prototype.setLineStyle=function(e){return this._line.properties().lineStyle.setValue(e),this},u.prototype.getLineWidth=function(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e}, u.prototype.setLineWidth=function(e){return this._line.properties().lineWidth.setValue(e),this},u.prototype.getBodyBorderColor=function(){var e=this._line.properties();return("buy"===this._direction?e.bodyBorderBuyColor:e.bodyBorderSellColor).value()},u.prototype.setBodyBorderColor=function(e){return"buy"===this._direction?this.setBodyBorderBuyColor(e):this.setBodyBorderSellColor(e),this},u.prototype.setBodyBorderBuyColor=function(e){return this._line.properties().bodyBorderBuyColor.setValue(e),this},u.prototype.setBodyBorderSellColor=function(e){return this._line.properties().bodyBorderSellColor.setValue(e),this},u.prototype.getBodyBackgroundColor=function(){return s.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},u.prototype.setBodyBackgroundColor=function(e){return s.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},u.prototype.getBodyTextColor=function(){var e=this._line.properties();return("positive"===this._profitState?e.bodyTextPositiveColor:"negative"===this._profitState?e.bodyTextNegativeColor:e.bodyTextNeutralColor).value()},u.prototype.setBodyTextColor=function(e){return"positive"===this._profitState?this.setBodyTextPositiveColor(e):"negative"===this._profitState?this.setBodyTextNegativeColor(e):this.setBodyTextNeutralColor(e),this},u.prototype.setBodyTextPositiveColor=function(e){return this._line.properties().bodyTextPositiveColor.setValue(e),this},u.prototype.setBodyTextNegativeColor=function(e){return this._line.properties().bodyTextNegativeColor.setValue(e),this},u.prototype.setBodyTextNeutralColor=function(e){return this._line.properties().bodyTextNeutralColor.setValue(e),this},u.prototype.getBodyFont=function(){return s.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},u.prototype.setBodyFont=function(e){return s.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},u.prototype.getQuantityBorderColor=function(){var e=this._line.properties();return("buy"===this._direction?e.quantityBorderBuyColor:e.quantityBorderSellColor).value()},u.prototype.setQuantityBorderColor=function(e){return"buy"===this._direction?this.setQuantityBorderBuyColor(e):this.setQuantityBorderSellColor(e),this},u.prototype.setQuantityBorderBuyColor=function(e){return this._line.properties().quantityBorderBuyColor.setValue(e),this},u.prototype.setQuantityBorderSellColor=function(e){return this._line.properties().quantityBorderSellColor.setValue(e),this},u.prototype.getQuantityBackgroundColor=function(){var e=this._line.properties();return("buy"===this._direction?e.quantityBackgroundBuyColor:e.quantityBackgroundSellColor).value()},u.prototype.setQuantityBackgroundColor=function(e){ return"buy"===this._direction?this.setQuantityBackgroundBuyColor(e):this.setQuantityBackgroundSellColor(e),this},u.prototype.setQuantityBackgroundBuyColor=function(e){return this._line.properties().quantityBackgroundBuyColor.setValue(e),this},u.prototype.setQuantityBackgroundSellColor=function(e){return this._line.properties().quantityBackgroundSellColor.setValue(e),this},u.prototype.getQuantityTextColor=function(){return s.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},u.prototype.setQuantityTextColor=function(e){return s.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},u.prototype.getQuantityFont=function(){return s.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},u.prototype.setQuantityFont=function(e){return s.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},u.prototype.getReverseButtonBorderColor=function(){var e=this._line.properties();return("buy"===this._direction?e.reverseButtonBorderBuyColor:e.reverseButtonBorderSellColor).value()},u.prototype.setReverseButtonBorderColor=function(e){return"buy"===this._direction?this.setReverseButtonBorderBuyColor(e):this.setReverseButtonBorderSellColor(e),this},u.prototype.setReverseButtonBorderBuyColor=function(e){return this._line.properties().reverseButtonBorderBuyColor.setValue(e),this},u.prototype.setReverseButtonBorderSellColor=function(e){return this._line.properties().reverseButtonBorderSellColor.setValue(e),this},u.prototype.getReverseButtonBackgroundColor=function(){return s.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)},u.prototype.setReverseButtonBackgroundColor=function(e){return s.setColorToProperties(e,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency),this},u.prototype.getReverseButtonIconColor=function(){var e=this._line.properties();return("buy"===this._direction?e.reverseButtonIconBuyColor:e.reverseButtonIconSellColor).value()},u.prototype.setReverseButtonIconColor=function(e){return"buy"===this._direction?this.setReverseButtonIconBuyColor(e):this.setReverseButtonIconSellColor(e),this},u.prototype.setReverseButtonIconBuyColor=function(e){return this._line.properties().reverseButtonIconBuyColor.setValue(e),this},u.prototype.setReverseButtonIconSellColor=function(e){return this._line.properties().reverseButtonIconSellColor.setValue(e),this},u.prototype.getCloseButtonBorderColor=function(){var e=this._line.properties();return("buy"===this._direction?e.closeButtonBorderBuyColor:e.closeButtonBorderSellColor).value()},u.prototype.setCloseButtonBorderColor=function(e){ return"buy"===this._direction?this.setCloseButtonBorderBuyColor(e):this.setCloseButtonBorderSellColor(e),this},u.prototype.setCloseButtonBorderBuyColor=function(e){return this._line.properties().closeButtonBorderBuyColor.setValue(e),this},u.prototype.setCloseButtonBorderSellColor=function(e){return this._line.properties().closeButtonBorderSellColor.setValue(e),this},u.prototype.getCloseButtonBackgroundColor=function(){return s.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)},u.prototype.setCloseButtonBackgroundColor=function(e){return s.setColorToProperties(e,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency),this},u.prototype.getCloseButtonIconColor=function(){var e=this._line.properties();return("buy"===this._direction?e.closeButtonIconBuyColor:e.closeButtonIconSellColor).value()},u.prototype.setCloseButtonIconColor=function(e){return"buy"===this._direction?this.setCloseButtonIconBuyColor(e):this.setCloseButtonIconSellColor(e),this},u.prototype.setCloseButtonIconBuyColor=function(e){return this._line.properties().closeButtonIconBuyColor.setValue(e),this},u.prototype.setCloseButtonIconSellColor=function(e){return this._line.properties().closeButtonIconSellColor.setValue(e),this},u.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},u.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},u.prototype.isFunction=function(e){return"function"==typeof e},u.prototype.onReverse=function(e,t){return t?this.isFunction(t)&&(this._onReverseData=e,this._onReverseCallback=t):this.isFunction(e)&&(this._onReverseCallback=e),this},u.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)},u.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)},u.prototype.onClose=function(e,t){return t?this.isFunction(t)&&(this._onCloseData=e,this._onCloseCallback=t):this.isFunction(e)&&(this._onCloseCallback=e),this},u.prototype.setCloseEnabled=function(e){return this._closeEnabled===e||(this._closeEnabled=e,this._onCloseCallback&&this._line.updateAllViewsAndRedraw()),this},u.prototype.isCloseEnabled=function(){return this._closeEnabled},u.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._closeEnabled&&this._onCloseCallback.call(this,this._onCloseData)},u.prototype.isOnCloseCallbackPresent=function(){return this._closeEnabled&&this.isFunction(this._onCloseCallback)},u.prototype.onModify=function(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this},u.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},u.prototype.onContextMenu=function(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e, this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this},u.prototype.shouldShowContextMenu=function(){return this.isFunction(this._onContextMenuCallback)},u.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},u.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(d,n),d.prototype.zorder=function(){return c},d.prototype.setPoint=function(e,t,i){this._points[e]=t,this.normalizePoints()},d.prototype.addPoint=function(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},d.prototype.name=function(){return"Position"},d.prototype.createPriceAxisView=function(e){return this._priceAxisView=new o(this,{pointIndex:e,backgroundPropertyGetter:this._adapter.getLineColor.bind(this._adapter)}),this._priceAxisView},d.prototype.paneViews=function(){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?r.prototype.paneViews.call(this):null},d.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?r.prototype.priceAxisViews.call(this,t,i):null},d.prototype.hasContextMenu=function(){return this._adapter.shouldShowContextMenu()},d.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},d.prototype.formatter=function(){return this._formatter},d.createProperties=function(e){var t=new a("linetoolposition",e,!1,!1);return d._configureProperties(t),t},d._configureProperties=function(e){n._configureProperties(e)},t.LineToolPosition=d}).call(this,i("Kxc7"))},zqZp:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,o=i("j3hX").LineToolColorsProperty;function s(e,t){var r=t||s.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("Ni7V").PriceLabelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,n),s.prototype.pointsCount=function(){return 1},s.prototype.name=function(){return"Price Label"},s.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("hQgR").PriceLabelDefinitionsViewModel}.bind(null,i)).catch(i.oe)},s.createProperties=function(e){var t=new r("linetoolpricelabel",e);return s._configureProperties(t),t},s._configureProperties=function(e){n._configureProperties(e),e.addChild("linesColors",new o([e.childs().borderColor])),e.addChild("textsColors",new o([e.childs().color]))},t.LineToolPriceLabel=s}},[["/G2Z","runtime","vendors"]]]);