From b430d12f94006c70a6b560d6f752581355b5f11d Mon Sep 17 00:00:00 2001 From: "jenkins@nwork.local" Date: Wed, 11 Nov 2020 09:35:32 +0000 Subject: [PATCH] Release v17.023 (from 9f0bfab4) --- ...a9a8b4e.html => ar-tv-chart.9f0bfab4.html} | 2 +- ...827.js => library.c49fcc0ab0023c1bd767.js} | 386 +++++++++--------- charting_library/charting_library.js | 2 +- ...a9a8b4e.html => cs-tv-chart.9f0bfab4.html} | 2 +- ...8b4e.html => da_DK-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => de-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => el-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => en-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => es-tv-chart.9f0bfab4.html} | 2 +- ...8b4e.html => et_EE-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => fa-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => fr-tv-chart.9f0bfab4.html} | 2 +- ...8b4e.html => he_IL-tv-chart.9f0bfab4.html} | 2 +- ...8b4e.html => hu_HU-tv-chart.9f0bfab4.html} | 2 +- ...8b4e.html => id_ID-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => it-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => ja-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => ko-tv-chart.9f0bfab4.html} | 2 +- ...8b4e.html => ms_MY-tv-chart.9f0bfab4.html} | 2 +- ...8b4e.html => nl_NL-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => no-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => pl-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => pt-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => ro-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => ru-tv-chart.9f0bfab4.html} | 2 +- ...8b4e.html => sk_SK-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => sv-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => th-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => tr-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => vi-tv-chart.9f0bfab4.html} | 2 +- ...a9a8b4e.html => zh-tv-chart.9f0bfab4.html} | 2 +- ...8b4e.html => zh_TW-tv-chart.9f0bfab4.html} | 2 +- 32 files changed, 224 insertions(+), 224 deletions(-) rename charting_library/{ar-tv-chart.5a9a8b4e.html => ar-tv-chart.9f0bfab4.html} (99%) rename charting_library/bundles/{library.793445b03594f5a91827.js => library.c49fcc0ab0023c1bd767.js} (96%) rename charting_library/{cs-tv-chart.5a9a8b4e.html => cs-tv-chart.9f0bfab4.html} (99%) rename charting_library/{da_DK-tv-chart.5a9a8b4e.html => da_DK-tv-chart.9f0bfab4.html} (99%) rename charting_library/{de-tv-chart.5a9a8b4e.html => de-tv-chart.9f0bfab4.html} (99%) rename charting_library/{el-tv-chart.5a9a8b4e.html => el-tv-chart.9f0bfab4.html} (99%) rename charting_library/{en-tv-chart.5a9a8b4e.html => en-tv-chart.9f0bfab4.html} (99%) rename charting_library/{es-tv-chart.5a9a8b4e.html => es-tv-chart.9f0bfab4.html} (99%) rename charting_library/{et_EE-tv-chart.5a9a8b4e.html => et_EE-tv-chart.9f0bfab4.html} (99%) rename charting_library/{fa-tv-chart.5a9a8b4e.html => fa-tv-chart.9f0bfab4.html} (99%) rename charting_library/{fr-tv-chart.5a9a8b4e.html => fr-tv-chart.9f0bfab4.html} (99%) rename charting_library/{he_IL-tv-chart.5a9a8b4e.html => he_IL-tv-chart.9f0bfab4.html} (99%) rename charting_library/{hu_HU-tv-chart.5a9a8b4e.html => hu_HU-tv-chart.9f0bfab4.html} (99%) rename charting_library/{id_ID-tv-chart.5a9a8b4e.html => id_ID-tv-chart.9f0bfab4.html} (99%) rename charting_library/{it-tv-chart.5a9a8b4e.html => it-tv-chart.9f0bfab4.html} (99%) rename charting_library/{ja-tv-chart.5a9a8b4e.html => ja-tv-chart.9f0bfab4.html} (99%) rename charting_library/{ko-tv-chart.5a9a8b4e.html => ko-tv-chart.9f0bfab4.html} (99%) rename charting_library/{ms_MY-tv-chart.5a9a8b4e.html => ms_MY-tv-chart.9f0bfab4.html} (99%) rename charting_library/{nl_NL-tv-chart.5a9a8b4e.html => nl_NL-tv-chart.9f0bfab4.html} (99%) rename charting_library/{no-tv-chart.5a9a8b4e.html => no-tv-chart.9f0bfab4.html} (99%) rename charting_library/{pl-tv-chart.5a9a8b4e.html => pl-tv-chart.9f0bfab4.html} (99%) rename charting_library/{pt-tv-chart.5a9a8b4e.html => pt-tv-chart.9f0bfab4.html} (99%) rename charting_library/{ro-tv-chart.5a9a8b4e.html => ro-tv-chart.9f0bfab4.html} (99%) rename charting_library/{ru-tv-chart.5a9a8b4e.html => ru-tv-chart.9f0bfab4.html} (99%) rename charting_library/{sk_SK-tv-chart.5a9a8b4e.html => sk_SK-tv-chart.9f0bfab4.html} (99%) rename charting_library/{sv-tv-chart.5a9a8b4e.html => sv-tv-chart.9f0bfab4.html} (99%) rename charting_library/{th-tv-chart.5a9a8b4e.html => th-tv-chart.9f0bfab4.html} (99%) rename charting_library/{tr-tv-chart.5a9a8b4e.html => tr-tv-chart.9f0bfab4.html} (99%) rename charting_library/{vi-tv-chart.5a9a8b4e.html => vi-tv-chart.9f0bfab4.html} (99%) rename charting_library/{zh-tv-chart.5a9a8b4e.html => zh-tv-chart.9f0bfab4.html} (99%) rename charting_library/{zh_TW-tv-chart.5a9a8b4e.html => zh_TW-tv-chart.9f0bfab4.html} (99%) diff --git a/charting_library/ar-tv-chart.5a9a8b4e.html b/charting_library/ar-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/ar-tv-chart.5a9a8b4e.html rename to charting_library/ar-tv-chart.9f0bfab4.html index 3a2a210f..761e0682 100644 --- a/charting_library/ar-tv-chart.5a9a8b4e.html +++ b/charting_library/ar-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/bundles/library.793445b03594f5a91827.js b/charting_library/bundles/library.c49fcc0ab0023c1bd767.js similarity index 96% rename from charting_library/bundles/library.793445b03594f5a91827.js rename to charting_library/bundles/library.c49fcc0ab0023c1bd767.js index c4df2a03..e2d510f2 100644 --- a/charting_library/bundles/library.793445b03594f5a91827.js +++ b/charting_library/bundles/library.c49fcc0ab0023c1bd767.js @@ -1,51 +1,51 @@ (window.webpackJsonp=window.webpackJsonp||[]).push([["library"],{"+6ja":function(e,t,i){"use strict";i.r(t),i.d(t,"availableTimezones",(function(){return u})),i.d(t,"timezoneIsAvailable",(function(){return h}));i("YFKU");for(var r=i("U/gD"),n=[{id:"Etc/UTC",title:window.t("UTC")},{id:"exchange",title:window.t("Exchange")}],o=[{id:"Africa/Cairo",title:window.t("Cairo"),offset:0},{id:"Africa/Johannesburg",title:window.t("Johannesburg"),offset:0},{id:"Africa/Lagos",title:window.t("Lagos"),offset:0},{id:"America/Argentina/Buenos_Aires",title:window.t("Buenos Aires"),offset:0},{id:"America/Bogota",title:window.t("Bogota"),offset:0},{id:"America/Caracas",title:window.t("Caracas"),offset:0},{id:"America/Chicago",title:window.t("Chicago"),offset:0},{id:"America/El_Salvador",title:window.t("San Salvador"),offset:0},{id:"America/Juneau",title:window.t("Juneau"),offset:0},{id:"America/Lima",title:window.t("Lima"),offset:0},{id:"America/Los_Angeles",title:window.t("Los Angeles"),offset:0},{id:"America/Mexico_City",title:window.t("Mexico City"),offset:0},{id:"America/New_York",title:window.t("New York"),offset:0},{id:"America/Phoenix",title:window.t("Phoenix"),offset:0},{id:"America/Santiago",title:window.t("Santiago"),offset:0},{id:"America/Sao_Paulo",title:window.t("Sao Paulo"),offset:0},{id:"America/Toronto",title:window.t("Toronto"),offset:0},{id:"America/Vancouver",title:window.t("Vancouver"),offset:0},{id:"US/Mountain",title:window.t("Denver"),offset:0},{id:"Asia/Almaty",title:window.t("Almaty"),offset:0},{id:"Asia/Ashkhabad",title:window.t("Ashkhabad"),offset:0},{id:"Asia/Bahrain",title:window.t("Bahrain"),offset:0},{id:"Asia/Bangkok",title:window.t("Bangkok"),offset:0},{id:"Asia/Chongqing",title:window.t("Chongqing"),offset:0},{id:"Asia/Dubai",title:window.t("Dubai"),offset:0},{id:"Asia/Ho_Chi_Minh",title:window.t("Ho Chi Minh"),offset:0},{id:"Asia/Hong_Kong",title:window.t("Hong Kong"),offset:0},{id:"Asia/Jakarta",title:window.t("Jakarta"),offset:0},{id:"Asia/Jerusalem",title:window.t("Jerusalem"),offset:0},{id:"Asia/Kolkata",title:window.t("Kolkata"),offset:0},{id:"Asia/Kuwait",title:window.t("Kuwait"),offset:0},{id:"Asia/Muscat",title:window.t("Muscat"),offset:0},{id:"Asia/Qatar",title:window.t("Qatar"),offset:0},{id:"Asia/Riyadh",title:window.t("Riyadh"),offset:0},{id:"Asia/Seoul",title:window.t("Seoul"),offset:0},{id:"Asia/Shanghai",title:window.t("Shanghai"),offset:0},{id:"Asia/Singapore",title:window.t("Singapore"),offset:0},{id:"Asia/Taipei",title:window.t("Taipei"),offset:0},{id:"Asia/Tehran",title:window.t("Tehran"),offset:0},{id:"Asia/Tokyo",title:window.t("Tokyo"),offset:0},{id:"Atlantic/Reykjavik",title:window.t("Reykjavik"),offset:0},{id:"Australia/Adelaide",title:window.t("Adelaide"),offset:0},{id:"Australia/Brisbane",title:window.t("Brisbane"),offset:0},{id:"Australia/Perth",title:window.t("Perth"),offset:0},{id:"Australia/Sydney",title:window.t("Sydney"),offset:0},{id:"Europe/Athens",title:window.t("Athens"),offset:0},{id:"Europe/Belgrade",title:window.t("Belgrade"),offset:0},{id:"Europe/Berlin", title:window.t("Berlin"),offset:0},{id:"Europe/Copenhagen",title:window.t("Copenhagen"),offset:0},{id:"Europe/Helsinki",title:window.t("Helsinki"),offset:0},{id:"Europe/Istanbul",title:window.t("Istanbul"),offset:0},{id:"Europe/London",title:window.t("London"),offset:0},{id:"Europe/Luxembourg",title:window.t("Luxembourg"),offset:0},{id:"Europe/Madrid",title:window.t("Madrid"),offset:0},{id:"Europe/Moscow",title:window.t("Moscow"),offset:0},{id:"Europe/Oslo",title:window.t("Oslo"),offset:0},{id:"Europe/Paris",title:window.t("Paris"),offset:0},{id:"Europe/Riga",title:window.t("Riga"),offset:0},{id:"Europe/Rome",title:window.t("Rome"),offset:0},{id:"Europe/Stockholm",title:window.t("Stockholm"),offset:0},{id:"Europe/Tallinn",title:window.t("Tallinn"),offset:0},{id:"Europe/Vilnius",title:window.t("Vilnius"),offset:0},{id:"Europe/Warsaw",title:window.t("Warsaw"),offset:0},{id:"Europe/Zurich",title:window.t("Zurich"),offset:0},{id:"Pacific/Auckland",title:window.t("New Zealand"),offset:0},{id:"Pacific/Chatham",title:window.t("Chatham Islands"),offset:0},{id:"Pacific/Fakaofo",title:window.t("Tokelau"),offset:0},{id:"Pacific/Honolulu",title:window.t("Honolulu"),offset:0},{id:"Pacific/Norfolk",title:window.t("Norfolk Island"),offset:0}],s=0,a=o;s'},"+hLl":function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Brush");function a(e,t){this._constructor="LineToolBrush";var n=t||a.createProperties();r.call(this,e,n),this._finished=!1,i.e("lt-pane-views").then(function(e){var t=i("00XE").BrushPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return-1},a.prototype.finished=function(){return this._finished},a.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Brush"},a.prototype.hasEditableCoordinates=function(){return!1},a.prototype.percentDistance=function(e,t){return Math.abs((t-e)/e)},a.prototype.addPoint=function(e){if(this._finished)return!0;if(this._lastPoint=null,this._points.length>0){var t=this._points[this._points.length-1],i=this.pointToScreenPoint(t)[1];if(this.pointToScreenPoint(e)[1].subtract(i).length()<2)return this._finished}return r.prototype.addPoint.call(this,e),this._finished},a.prototype.restorePoints=function(e,t,i){r.prototype.restorePoints.call(this,e,t,i),this._finished=!0},a.prototype.getInputsPropertyPage=function(){return null},a.prototype.getStylesPropertyPage=function(){return o.LineToolBrushStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("ZSes").BrushDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolbrush",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolBrush=a},"+q2u":function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererCrossShape",(function(){return s}));var r=i("mrSG"),n=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(t,e),t.prototype._drawItemShape=function(e,t,i){ -var r=i.width,n=i.height,o=i.x-r/2,s=i.vertOffset,a=i.y-n/2+s,l=t.pixelRatio,c=this._lineWidth(t),u=c%2?.5:0,h=Math.round(o*l),d=Math.round((o+r)*l);(d-h)%2!=c%2&&(d+=1);var p=Math.floor((h+d)/2)+u,f=Math.round(a*l),_=Math.round((a+n)*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,r=t.height,n=t.x-i/2,s=t.vertOffset,a=t.y-r/2+s,l=n,c=n+i,u=a,h=a+r,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}(n.c)},"//lt":function(e,t,i){"use strict";var r;i.r(t),i.d(t,"PaneCursorType",(function(){return r})),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"}(r||(r={}))},"/3z9":function(e,t,i){"use strict";i.r(t),i.d(t,"isMacKeyboard",(function(){return o})),i.d(t,"Modifiers",(function(){return r})),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 r,n=i("qFKp"),o=Object(n.isMac)()||n.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"}(r||(r={}));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 r=i("mrSG"),n=i("UJLt"),o=i("hkLy"),s=i("zUrt"),a=i("Kxc7"),l=i("hY0g"),c=i.n(l),u=i("FQhm"),h=i("htUT"),d=i("/z0S"),p=i("BxxN");i("YFKU"),i("HbRj"),i("+GxX");i.d(t,"SaveChartService",(function(){return S}));var f={labelName:window.t("Chart layout name"),labelRename:window.t("Enter a new chart layout name"),error:window.t("Please enter chart layout name"),titleNew:window.t("Save New Chart Layout"),titleRename:window.t("Rename Chart Layout"),titleCopy:window.t("Copy Chart Layout"),valueCopy:window.t("{0} copy",{context:"ex: AAPL chart copy"})};function _(e,t,i,s){return Object(r.__awaiter)(this,void 0,void 0,(function(){var a;return Object(r.__generator)(this,(function(r){return a=new n.SaveRenameDialog({fields:[new o.InputField({name:"chart-title",label:e+":",error:t,maxLength:64})],title:i}),void 0!==s&&a.setField("chart-title",s),[2,a.show().then((function(e){return e["chart-title"]}))]}))}))}function m(e){ -return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(t){return[2,_(f.labelRename,f.error,f.titleRename,e)]}))}))}function y(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(t){return[2,_(f.labelRename,f.error,f.titleCopy,f.valueCopy.format(e))]}))}))}function g(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(t){return[2,_(f.labelRename,f.error,f.titleNew,e)]}))}))}function v(){return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(e){return[2,new Promise((function(e){a.enabled("saved_charts_count_restriction")&&window.is_authenticated&&!window.user.is_pro?s.backend.getChartsCount((function(t){e(t<5)})):e(!0)}))]}))}))}var S=function(){function e(e,t){this._autosaveTimer=null,this._watchedAutoSaveEnabled=new c.a,this._toggleAutoSaveEnabledHandler=this._toggleAutoSaveEnabled.bind(this),this._chartWidgetCollection=e,this._chartSaver=t,this._chartChangesWatcher=new h.ChartChangesWatcher(e.undoHistory,t,u),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.cloneChart=function(){return Object(r.__awaiter)(this,void 0,void 0,(function(){var e,t;return Object(r.__generator)(this,(function(i){switch(i.label){case 0:return e=this._chartWidgetCollection,[4,v()];case 1:return i.sent()?[4,y(e.metaInfo.name.value())]:[3,3];case 2:return t=i.sent(),this._saveCurrentChartAsNewWithTitle(t),[3,5];case 3:return[3,5];case 4:i.sent().open(),i.label=5;case 5:return[2]}}))}))},e.prototype.saveChartAs=function(){Object(d.a)(this.cloneChart.bind(this),{source:"Clone chart"})},e.prototype.renameChart=function(){var e=this;Object(d.a)((function(){return Object(r.__awaiter)(e,void 0,void 0,(function(){var e,t;return Object(r.__generator)(this,(function(i){switch(i.label){case 0:return e=this._chartWidgetCollection,[4,m(e.metaInfo.name.value())];case 1:return t=i.sent(),e.metaInfo.name.setValue(t),this._doSave(),[2]}}))}))}),{source:"Rename chart"})},e.prototype.saveNewChart=function(e,t,i){return Object(r.__awaiter)(this,void 0,void 0,(function(){var n,o,s;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return n=this._chartWidgetCollection,o=n.metaInfo.name.value(),[4,v()];case 1:return r.sent()?[4,g(o)]:[3,3];case 2:return s=r.sent(),n.metaInfo.name.setValue(s),this._doSave(e,t,i),[3,5];case 3:return[3,5];case 4:r.sent().open(),r.label=5;case 5:return[2]}}))}))},e.prototype.saveExistentChart=function(e,t,i){this._doSave(e,t,i)},e.prototype.saveChartOrShowTitleDialog=function(e,t,i){var r=this,n=window.saver.isSaveInProcess(),o=this._chartChangesWatcher.hasChanges(),s=!!this._chartWidgetCollection.metaInfo.id.value();window.is_authenticated&&(n||!o&&s)||Object(d.a)((function(){ +var r=i.width,n=i.height,o=i.x-r/2,s=i.vertOffset,a=i.y-n/2+s,l=t.pixelRatio,c=this._lineWidth(t),u=c%2?.5:0,h=Math.round(o*l),d=Math.round((o+r)*l);(d-h)%2!=c%2&&(d+=1);var p=Math.floor((h+d)/2)+u,f=Math.round(a*l),_=Math.round((a+n)*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,r=t.height,n=t.x-i/2,s=t.vertOffset,a=t.y-r/2+s,l=n,c=n+i,u=a,h=a+r,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}(n.c)},"//lt":function(e,t,i){"use strict";var r;i.r(t),i.d(t,"PaneCursorType",(function(){return r})),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"}(r||(r={}))},"/3z9":function(e,t,i){"use strict";i.r(t),i.d(t,"isMacKeyboard",(function(){return o})),i.d(t,"Modifiers",(function(){return r})),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 r,n=i("qFKp"),o=Object(n.isMac)()||n.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"}(r||(r={}));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 r=i("mrSG"),n=i("UJLt"),o=i("hkLy"),s=i("zUrt"),a=i("Kxc7"),l=i("hY0g"),c=i.n(l),u=i("FQhm"),h=i("htUT"),d=i("/z0S"),p=i("BxxN");i("YFKU"),i("HbRj"),i("+GxX");i.d(t,"SaveChartService",(function(){return b}));var f={labelName:window.t("Chart layout name"),labelRename:window.t("Enter a new chart layout name"),error:window.t("Please enter chart layout name"),titleNew:window.t("Save New Chart Layout"),titleRename:window.t("Rename Chart Layout"),titleCopy:window.t("Copy Chart Layout"),valueCopy:window.t("{0} copy",{context:"ex: AAPL chart copy"})};function _(e,t,i,s){return Object(r.__awaiter)(this,void 0,void 0,(function(){var a;return Object(r.__generator)(this,(function(r){return a=new n.SaveRenameDialog({fields:[new o.InputField({name:"chart-title",label:e+":",error:t,maxLength:64})],title:i}),void 0!==s&&a.setField("chart-title",s),[2,a.show().then((function(e){return e["chart-title"]}))]}))}))}function m(e){ +return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(t){return[2,_(f.labelRename,f.error,f.titleRename,e)]}))}))}function y(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(t){return[2,_(f.labelRename,f.error,f.titleCopy,f.valueCopy.format(e))]}))}))}function g(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(t){return[2,_(f.labelRename,f.error,f.titleNew,e)]}))}))}function v(){return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(e){return[2,new Promise((function(e){a.enabled("saved_charts_count_restriction")&&window.is_authenticated&&!window.user.is_pro?s.backend.getChartsCount((function(t){e(t<5)})):e(!0)}))]}))}))}var b=function(){function e(e,t){this._autosaveTimer=null,this._watchedAutoSaveEnabled=new c.a,this._toggleAutoSaveEnabledHandler=this._toggleAutoSaveEnabled.bind(this),this._chartWidgetCollection=e,this._chartSaver=t,this._chartChangesWatcher=new h.ChartChangesWatcher(e.undoHistory,t,u),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.cloneChart=function(){return Object(r.__awaiter)(this,void 0,void 0,(function(){var e,t;return Object(r.__generator)(this,(function(i){switch(i.label){case 0:return e=this._chartWidgetCollection,[4,v()];case 1:return i.sent()?[4,y(e.metaInfo.name.value())]:[3,3];case 2:return t=i.sent(),this._saveCurrentChartAsNewWithTitle(t),[3,5];case 3:return[3,5];case 4:i.sent().open(),i.label=5;case 5:return[2]}}))}))},e.prototype.saveChartAs=function(){Object(d.a)(this.cloneChart.bind(this),{source:"Clone chart"})},e.prototype.renameChart=function(){var e=this;Object(d.a)((function(){return Object(r.__awaiter)(e,void 0,void 0,(function(){var e,t;return Object(r.__generator)(this,(function(i){switch(i.label){case 0:return e=this._chartWidgetCollection,[4,m(e.metaInfo.name.value())];case 1:return t=i.sent(),e.metaInfo.name.setValue(t),this._doSave(),[2]}}))}))}),{source:"Rename chart"})},e.prototype.saveNewChart=function(e,t,i){return Object(r.__awaiter)(this,void 0,void 0,(function(){var n,o,s;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return n=this._chartWidgetCollection,o=n.metaInfo.name.value(),[4,v()];case 1:return r.sent()?[4,g(o)]:[3,3];case 2:return s=r.sent(),n.metaInfo.name.setValue(s),this._doSave(e,t,i),[3,5];case 3:return[3,5];case 4:r.sent().open(),r.label=5;case 5:return[2]}}))}))},e.prototype.saveExistentChart=function(e,t,i){this._doSave(e,t,i)},e.prototype.saveChartOrShowTitleDialog=function(e,t,i){var r=this,n=window.saver.isSaveInProcess(),o=this._chartChangesWatcher.hasChanges(),s=!!this._chartWidgetCollection.metaInfo.id.value();window.is_authenticated&&(n||!o&&s)||Object(d.a)((function(){ null!=r._chartWidgetCollection.metaInfo.id.value()?r.saveExistentChart(e,t,i):r.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(d.a)((function(){t._watchedAutoSaveEnabled.setValue(e)}),{source:"AutoSave chart"})},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._saveCurrentChartAsNewWithTitle=function(e){var t=this._chartWidgetCollection;a.enabled("saveload_storage_customization")?(t.metaInfo.uid.deleteValue(),t.metaInfo.id.deleteValue(),t.metaInfo.name.setValue(e),this._doSave()):window.open(Object(p.a)({clone:t.metaInfo.uid.value(),name:e}),"_blank")},e.prototype._doSave=function(e,t,i,r){var n=this._chartWidgetCollection;void 0!==e&&e(),this._chartSaver.saveChartSilently((function(e){var i;i=n.metaInfo.uid.value(),"/chart/"===location.pathname&&(location.href="/chart/"+i),void 0!==t&&t(e)}),(function(){void 0!==i&&i()}),{autoSave:Boolean(r)})},e.prototype._startAutosave=function(){var e=this;a.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}()},"/DxK":function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("p1SQ").LineToolHorzLinePriceAxisView,o=i("tc+8"),s=i("Ocx9").DefaultProperty,a=i("hayr").propertyPages,l=window.t("Horizontal Line");function c(e,t){this._constructor="LineToolHorzLine";var o=t||c.createProperties();this._priceAxisView=new n(this),r.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(c,r),c.prototype.state=function(e){var t=r.prototype.state.call(this,e);return t.points&&0!==t.points.length&&(t.points[0].offset=0),t},c.prototype.pointsCount=function(){return 1},c.prototype.translatedType=function(){return l},c.prototype.name=function(){return"Horizontal Line"},c.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},c.prototype.updateAllViews=function(){r.prototype.updateAllViews.call(this),this._priceAxisView.update()},c.prototype.canHasAlert=function(){return!0},c.prototype._getAlertPlots=function(){return[this.points()[0].price] },c.prototype.getInputsPropertyPage=function(){return a.LineToolHorzLineInputsPropertyPage},c.prototype.getStylesPropertyPage=function(){return a.LineToolHorzLineStylesPropertyPage},c.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("NEbb").HorizontalLineDefinitionsViewModel}.bind(null,i)).catch(i.oe)},c.prototype.template=function(){var e=r.prototype.template.call(this);return e.text=this.properties().childs().text.value(),e},c.prototype._applyTemplateImpl=function(e){r.prototype._applyTemplateImpl.call(this,e),this.properties().childs().text.setValue(e.text)},c.createProperties=function(e){var t=new s("linetoolhorzline",e);return c._configureProperties(t),t},c._configureProperties=function(e){r._configureProperties(e),e.hasChild("text")||e.addChild("text",new o("")),e.addExclusion("text")},t.LineToolHorzLine=c},"/McG":function(e){ e.exports=JSON.parse('{"content":{"chartProperties":{"scalesProperties":{"textColor":"#5D606B","lineColor":"#787B86","backgroundColor":"#ffffff"},"paneProperties":{"vertGridProperties":{"color":"#F0F3FA"},"horzGridProperties":{"color":"#F0F3FA"},"background":"#ffffff"}},"sessions":{"graphics":{"backgrounds":{"outOfSession":{"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 r=i("mrSG"),n=i("Eyy1"),o=function(e){function t(t,i,r,n){var o=e.call(this,t,i,n)||this;return o._sourcePaneRemoved=!1,o._targetPaneIndex=t.panes().indexOf(r),o}return Object(r.__extends)(t,e),t.prototype.redo=function(){for(var e=this._chartModel.panes()[this._initialPaneIndex],t=this._chartModel.panes()[this._targetPaneIndex],i=e!==t,r=this._targetPriceScale(t),o=Object(n.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),s=0,a=this._chartModel.children(o,!0);s1),u.fullscreen.setValue(se===u)}else u&&n(u)}xe(),De(),function(){for(var e=H.count,t=e,i=0;i1)}(),t(),F.forEach((function(e){e.chartWidget.onZoom().subscribe(this,(function(e){fe.fire(e)}))})),z.value()<1&&l>0&&F[l-1].rdState.bridge().attach()}function De(){var e=Math.min(H.count,F.length)-1;if(e<0)R.deleteValue();else{var t=j;t<0&&(t=0),t>e&&(t=e),R.setValue(F[t].chartWidget)}}function Ve(){for(var e=F.length;e--;){var t=e===j;$(F[e].container.value()).toggleClass("active",t).toggleClass("inactive",!t)}}function Be(){}k.seriesControlBarEnabled&&(me=V+B+"px",(ye=document.createElement("div")).style.left=me,ye.style.right=me,ye.style.bottom=me,ye.classList.add("chart-toolbar","chart-controls-bar"),he[0].appendChild(ye),Promise.all([i.e("react"),i.e(2),i.e(3),i.e(8),i.e(9),i.e(22),i.e(23),i.e(25),i.e(43),i.e(45),i.e(46),i.e(59),i.e(62),i.e(67),i.e(0),i.e(1),i.e(10),i.e(12),i.e(15),i.e(49),i.e("chart-bottom-toolbar")]).then(function(e){var r=i("MfqI").BottomToolbarRenderer,n=k.resizerBridge,o=[n.container.spawn(),n.width.spawn(),n.height.spawn()],s=n.container.value(),a=new t,l=function(){a.fire()};o.forEach((function(e){e.subscribe(l)})),ge=new r(ye,a,(function(){var e=s.getBoundingClientRect(),t=Se();return t.top=e.top+t.top,t.left=e.left+t.left,t}),A,ChartApiInstance,ae,k.seriesControlBar),ve=function(){null!==ge&&(ge.destroy(),ge=null,ye.remove(),ye=null),o.forEach((function(e){e.destroy()})),a.destroy()}}.bind(null,i)).catch(i.oe)),ne.subscribe(xe),oe.subscribe(xe),this.updateLayout=xe;var Re=new t,Ne=new g,Fe=new g,je=null;function We(e){var t=e.mainSeries().properties();t.style.subscribe(null,ze),ze(t.style),e.model().onSelectedSourceChanged().subscribe(null,He),He(e.selection().sources())}function ze(e){Ne.setValue(e.value())}function He(){var e=je.model();Fe.setValue(e.selection().sources())}function Ue(e){for(var t=!1,i=0;i1),u.fullscreen.setValue(se===u)}else u&&n(u)}xe(),De(),function(){for(var e=H.count,t=e,i=0;i1)}(),t(),F.forEach((function(e){e.chartWidget.onZoom().subscribe(this,(function(e){fe.fire(e)}))})),z.value()<1&&l>0&&F[l-1].rdState.bridge().attach()}function De(){var e=Math.min(H.count,F.length)-1;if(e<0)R.deleteValue();else{var t=j;t<0&&(t=0),t>e&&(t=e),R.setValue(F[t].chartWidget)}}function Ve(){for(var e=F.length;e--;){var t=e===j;$(F[e].container.value()).toggleClass("active",t).toggleClass("inactive",!t)}}function Be(){}k.seriesControlBarEnabled&&(me=V+B+"px",(ye=document.createElement("div")).style.left=me,ye.style.right=me,ye.style.bottom=me,ye.classList.add("chart-toolbar","chart-controls-bar"),he[0].appendChild(ye),Promise.all([i.e("react"),i.e(2),i.e(3),i.e(8),i.e(9),i.e(22),i.e(23),i.e(25),i.e(43),i.e(45),i.e(46),i.e(59),i.e(62),i.e(67),i.e(0),i.e(1),i.e(10),i.e(12),i.e(15),i.e(49),i.e("chart-bottom-toolbar")]).then(function(e){var r=i("MfqI").BottomToolbarRenderer,n=k.resizerBridge,o=[n.container.spawn(),n.width.spawn(),n.height.spawn()],s=n.container.value(),a=new t,l=function(){a.fire()};o.forEach((function(e){e.subscribe(l)})),ge=new r(ye,a,(function(){var e=s.getBoundingClientRect(),t=be();return t.top=e.top+t.top,t.left=e.left+t.left,t}),A,ChartApiInstance,ae,k.seriesControlBar),ve=function(){null!==ge&&(ge.destroy(),ge=null,ye.remove(),ye=null),o.forEach((function(e){e.destroy()})),a.destroy()}}.bind(null,i)).catch(i.oe)),ne.subscribe(xe),oe.subscribe(xe),this.updateLayout=xe;var Re=new t,Ne=new g,Fe=new g,je=null;function We(e){var t=e.mainSeries().properties();t.style.subscribe(null,ze),ze(t.style),e.model().onSelectedSourceChanged().subscribe(null,He),He(e.selection().sources())}function ze(e){Ne.setValue(e.value())}function He(){var e=je.model();Fe.setValue(e.selection().sources())}function Ue(e){for(var t=!1,i=0;i=o[e].count)return e;return"s"}function Xe(e,t){if(K=!0,Z=Boolean(t),G=[],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=ke((function(e){return i.has(e)}));i.add(t),e.chartId=t}})),U=Je(e.layout||"s");for(var r=0;r1},setActive:Ke,inlineChartsCount:z.readonly(),revertToInline:function(){Oe(null);for(var e=0;e0||e.status()===L.STATUS_INVALID_SYMBOL||e.status()===L.STATUS_NO_BARS)tt();else{var i=e.dataEvents(),r=function(){tt(),i.barReceived().unsubscribe(null,r),i.completed().unsubscribe(null,r),i.error().unsubscribe(null,r)};i.barReceived().subscribe(null,r),i.completed().subscribe(null,r),i.error().subscribe(null,r)}}))}})),a()){var it=h.tool.setValue;h.tool.setValue=function(){A.selectedSources.value()&&A.activeChartWidget.value().model().lineBeingCreated()&&A.activeChartWidget.value().model().cancelCreatingLine(),it.apply(h.tool,arguments)}}Promise.all(F.map((function(e){return S(e.chartWidget.modelCreated()).promise}))).then((function(){return Promise.all(F.map((function(e){return S(e.chartWidget.model().mainSeries().dataEvents().symbolResolved()).promise})))})).then((function(){window.saver&&window.is_authenticated&&k.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 r,n=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"}(r||(r={}));var a=i("uOxu");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.insert=function(e,t){return Object(n.__awaiter)(this,void 0,void 0,(function(){var i,o,s,a,c,u,h;return Object(n.__generator)(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(), +handler:function(){R.value().onAppClipboardCut()}}),p.isMacKeyboard||(te.add({desc:"Paste sources",hotkey:d.Modifiers.Shift+45,handler:function(){R.value().onAppClipboardPaste()}}),te.add({desc:"Copy sources",hotkey:d.Modifiers.Mod+45,handler:function(){R.value().onAppClipboardCopy()}}),te.add({desc:"Cut sources",hotkey:d.Modifiers.Shift+46,handler:function(){R.value().onAppClipboardCut()}})));var et=0;function tt(){0===--et&&f.emitOnce("onChartReady")}if(F.forEach((function(e){if(e){et++;var t=e.chartWidget;t.withModel(null,(function(){var e=t.model().mainSeries();if(e.bars().size()>0||e.status()===L.STATUS_INVALID_SYMBOL||e.status()===L.STATUS_NO_BARS)tt();else{var i=e.dataEvents(),r=function(){tt(),i.barReceived().unsubscribe(null,r),i.completed().unsubscribe(null,r),i.error().unsubscribe(null,r)};i.barReceived().subscribe(null,r),i.completed().subscribe(null,r),i.error().subscribe(null,r)}}))}})),a()){var it=h.tool.setValue;h.tool.setValue=function(){A.selectedSources.value()&&A.activeChartWidget.value().model().lineBeingCreated()&&A.activeChartWidget.value().model().cancelCreatingLine(),it.apply(h.tool,arguments)}}Promise.all(F.map((function(e){return b(e.chartWidget.modelCreated()).promise}))).then((function(){return Promise.all(F.map((function(e){return b(e.chartWidget.model().mainSeries().dataEvents().symbolResolved()).promise})))})).then((function(){window.saver&&window.is_authenticated&&k.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 r,n=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"}(r||(r={}));var a=i("uOxu");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.insert=function(e,t){return Object(n.__awaiter)(this,void 0,void 0,(function(){var i,o,s,a,c,u,h;return Object(n.__generator)(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(r.CannotGetMetainfo)];case 4:return null!==i&&(o=this._inserterImpl.removeStub(i)),[7];case 5:return o?void 0!==t&&t.cancelled?[2,Promise.reject(r.Cancelled)]:this._canApplyStudyToParent(s)?(a=Object(n.__assign)({},s.defaults.inputs),void 0===e?[3,7]:[4,e(a,s.inputs,s)]):[2,Promise.reject(r.StudyCannotBeChild)]:[2,Promise.reject(r.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(r.Cancelled)]:null===(h=this._insertStudy(s,c))?[2,Promise.reject(r.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)},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 n})),i.d(t,"endOfPeriodToBarTime",(function(){return o}));var r=i("E6p6");function n(e,t,i,n){if(n.isDays())return i;if(e.moveTo(1e3*i),n.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(r.SessionStage.LASTBAR_SESSION)/1e3}function o(e,t,i,r){if(r.isDays())return i;var n=1e3*i-1;if(e.moveTo(n),r.isIntraday()){var o=e.indexOfBar(n);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 r=i("Eyy1"),n=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 r=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,n="",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*n)Object(o.fillRectInnerBorder)(e,u,d,h-u+1,p-d+1,n);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="",r=this._calculateBorderWidth(t),n=0,s=this._bars;nc)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 r=i("Eyy1"),n=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(r.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()===n.MagnetMode.StrongMagnet||Math.abs(m.y-_)<50)&&(s=m.price),s},e}()},"/kal":function(e,t){e.exports=''},"/mDy":function(e,t,i){},"/tGj":function(e,t,i){"use strict";function r(e){return e.symbolSource()===e}i.r(t),i.d(t,"isSymbolSource",(function(){return r}))},"/z0S":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var r=i("Kxc7");function n(e,t){r.enabled("saveload_requires_authentication")?window.runOrSignIn(e,t):e()}},"08i5":function(e,t,i){"use strict";var r,n;i.r(t),i.d(t,"AlertStatus",(function(){return r})),i.d(t,"Direction",(function(){return n})),function(e){e[e.Waiting=0]="Waiting",e[e.Success=1]="Success",e[e.Failure=2]="Failure"}(r||(r={})),function(e){e[e.Up=1]="Up",e[e.Down=2]="Down"}(n||(n={}))},"0F0w":function(e,t,i){"use strict";i.r(t);var r=i("mrSG"),n=i("aIyQ"),o=i.n(n),s=i("Eyy1"),a=i("hY0g"),l=i.n(a),c=i("0waE"),u=i("uOxu"),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 r=e.call(this,t,"cs",!1)||this;return r._sessionDisabled=!1,r._handler=null,r._criticalError=new o.a,r._disableStatistics=i,r}return Object(r.__extends)(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,r,n,o){return this._getChartApi().createSeries(this.sessionId(),e,t,i,r,n,o)},t.prototype.modifySeries=function(e,t,i,r,n){return this._getChartApi().modifySeries(this.sessionId(),e,t,i,r,n)}, 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,r,n,o,s){return this._getChartApi().createStudy(this.sessionId(),e,t,i,r,n,o,s)},t.prototype.rebindStudy=function(e,t,i,r,n,o,s){return this._getChartApi().rebindStudy(this.sessionId(),e,t,i,r,n,o,s)},t.prototype.modifyStudy=function(e,t,i,r){return this._getChartApi().modifyStudy(this.sessionId(),e,t,i,r)},t.prototype.removeStudy=function(e,t,i){return this._getChartApi().removeStudy(this.sessionId(),e,t,i)},t.prototype.createPointset=function(e,t,i,r,n,o){return this._getChartApi().createPointset(this.sessionId(),e,t,i,r,n,o)},t.prototype.modifyPointset=function(e,t,i,r){return this._getChartApi().modifyPointset(this.sessionId(),e,t,i,r)},t.prototype.removePointset=function(e){return this._getChartApi().removePointset(this.sessionId(),e)},t.prototype.setVisibleTimeRange=function(e,t,i,r,n){this._getChartApi().setVisibleTimeRange(e,this.sessionId(),t,i,r,n)},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 r=i("aO4+").Point,n=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("hayr").propertyPages,p=window.t("Arc");function f(e,t){this._constructor="LineToolArc";var r=t||f.createProperties();u.call(this,e,r),this.version=f.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(f,u),f.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=n(i,o,s).distance;var a=o.subtract(i),l=new r(-a.y,a.x),c=i.add(o).scaled(.5);s.subtract(c).dotProduct(l)<0&&(this._dist=-this._dist)}},f.prototype.pointsCount=function(){return 3},f.prototype.translatedType=function(){return p},f.prototype.name=function(){return"Arc"},f.prototype.hasEditableCoordinates=function(){return!1},f.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 r(-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=n(o,u,h).distance;d=(u=this.pointToScreenPoint(i)[0]).subtract(o),p=o.add(u).scaled(.5);_=(_=new r(-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=n(o,u,i).distance,d=u.subtract(o),p=o.add(u).scaled(.5);_=(_=new r(-d.y,d.x)).normalized(),h=p.add(_.scaled(f));var m=p.add(_.scaled(-f)),y=d.length(),g=d.x/y,v=d.y/y,S=Math.acos(g);v<0&&(S=-S);var b=l(-p.x,-p.y);i=c(b,i);var w=c(b,h);b=s(-S),i=c(b,i),w=c(b,w),b=a(1,y/(2*f)),i=c(b,i),w=c(b,w);var P=i.y*w.y>=0?new r(h.x,h.y):new r(m.x,m.y);P=this.screenPointToPoint(P),this._points[2]=P}this.normalizePoints()},f.version=2,f.prototype.migrateVersion=function(e,t,i){if(1===e&&2===this._points.length){var r=(2*this._points[0].price+3*this._points[1].price)/5;this._points.append({price:r,index:this._points[1].index})}if(1===e&&2===this._timePoint.length){var n={price:r=(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(n)}},f.prototype.getInputsPropertyPage=function(){return null},f.prototype.getStylesPropertyPage=function(){return d.LineToolArcStylesPropertyPage},f.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Zd1D").GeneralFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},f.createProperties=function(e){var t=new h("linetoolarc",e);return f._configureProperties(t),t},f._configureProperties=function(e){u._configureProperties(e)},t.LineToolArc=f},"0YCj":function(e,t,i){"use strict";(function(e,t){i("Eyy1").assert;var r=i("uOxu").getLogger("Chart.Study.MetaInfo"),n=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, +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=n(i,o,s).distance;var a=o.subtract(i),l=new r(-a.y,a.x),c=i.add(o).scaled(.5);s.subtract(c).dotProduct(l)<0&&(this._dist=-this._dist)}},f.prototype.pointsCount=function(){return 3},f.prototype.translatedType=function(){return p},f.prototype.name=function(){return"Arc"},f.prototype.hasEditableCoordinates=function(){return!1},f.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 r(-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=n(o,u,h).distance;d=(u=this.pointToScreenPoint(i)[0]).subtract(o),p=o.add(u).scaled(.5);_=(_=new r(-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=n(o,u,i).distance,d=u.subtract(o),p=o.add(u).scaled(.5);_=(_=new r(-d.y,d.x)).normalized(),h=p.add(_.scaled(f));var m=p.add(_.scaled(-f)),y=d.length(),g=d.x/y,v=d.y/y,b=Math.acos(g);v<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,y/(2*f)),i=c(S,i),w=c(S,w);var P=i.y*w.y>=0?new r(h.x,h.y):new r(m.x,m.y);P=this.screenPointToPoint(P),this._points[2]=P}this.normalizePoints()},f.version=2,f.prototype.migrateVersion=function(e,t,i){if(1===e&&2===this._points.length){var r=(2*this._points[0].price+3*this._points[1].price)/5;this._points.append({price:r,index:this._points[1].index})}if(1===e&&2===this._timePoint.length){var n={price:r=(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(n)}},f.prototype.getInputsPropertyPage=function(){return null},f.prototype.getStylesPropertyPage=function(){return d.LineToolArcStylesPropertyPage},f.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Zd1D").GeneralFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},f.createProperties=function(e){var t=new h("linetoolarc",e);return f._configureProperties(t),t},f._configureProperties=function(e){u._configureProperties(e)},t.LineToolArc=f},"0YCj":function(e,t,i){"use strict";(function(e,t){i("Eyy1").assert;var r=i("uOxu").getLogger("Chart.Study.MetaInfo"),n=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=51,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&&r.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 r=i[1].split("-");if(3===r.length)t.packageId=r.slice(0,2).join("-"),t.id=t.shortId+"@"+t.packageId,t.version=r[2];else if(1===r.length&&"decisionbar"===r[0])t.packageId="les-"+r[0],t.id=t.shortId+"@"+t.packageId,t.version=1;else{if(1!==r.length)throw new Error("unexpected study id:"+e);t.packageId="tv-"+r[0],t.id=t.shortId+"@"+t.packageId,t.version=1}}if(t.fullId=t.id+"-"+t.version,"tv-scripting"===t.packageId){var n=t.shortId;if(0===n.indexOf("Script$")||0===n.indexOf("StrategyScript$")){var o=n.indexOf("_");t.productId=o>=0?n.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);r.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 r(e,t),c=this._pane.state(),u=n.length-1;u>=0;--u){var h=n[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},L.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)},L.prototype.mouseClickEvent=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))}))},L.prototype.mouseMoveEvent=function(e){this._priceScale&&(this.dataSourceAtPoint(e.localX,e.localY)?this._setCursorClassName("pointer"):this._setResizeCursor())},L.prototype._zoomAvailable=function(){return!this.priceScale().isEmpty()&&this._pane.chart().model().model().zoomEnabled()&&this._options.pressedMouseMoveScale},L.prototype.mouseDownEvent=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)}},L.prototype.pressedMouseMoveEvent=function(e){if(this._zoomAvailable()){var t=this._pane.chart().model(),i=this._pane.state(),r=this.priceScale();t.scalePriceTo(i,r,e.localY)}},L.prototype.mouseDownOutsideEvent=function(e){if(this._zoomAvailable()&&this._pane.hasState()){var t=this._pane.chart().model(),i=this._pane.state(),r=this.priceScale();this._mousedown&&(this._mousedown=!1,t.endScalePrice(i,r),this.restoreDefaultCursor())}},L.prototype.mouseUpEvent=function(e){if(this._zoomAvailable()){var t=this._pane.chart().model(),i=this._pane.state(),r=this.priceScale();this._mousedown=!1,t.endScalePrice(i,r),this.restoreDefaultCursor()}},L.prototype.mouseEnterEvent=function(e){this._setResizeCursor()},L.prototype.mouseLeaveEvent=function(e){this._setCursorClassName("")},L.prototype._setResizeCursor=function(){this._priceScale.isPercentage()||this._priceScale.isIndexedTo100()?this._setCursorClassName(""):this._pane.chart().model().model().zoomEnabled()&&this._setCursorClassName("ns-resize")},L.prototype._initActions=function(e){if(this._pane.hasState()&&null===this.actions){this.actions={};var t=this,r=this._pane.chart().model();this.actions.reset=new a({ label:window.t("Reset Price Scale"),icon:i("LdoW"),shortcut:"Alt+R",shortcutHint:n.humanReadableHash(n.Modifiers.Alt+82),statName:"ResetScale",onExecute:L.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(){r.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(){r.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(){r.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(){r.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(){r.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(){r.invertPriceScale(t.priceScale()),t._updateScalesActions()}}),this._updateScalesActions()}},L.prototype._logAction=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().logSeriesScale:this.actions.setLog},L.prototype._percentageAction=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().percentSeriesScale:this.actions.setPercentage},L.prototype._indexedTo100Action=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().indexedTo100SeriesScale:this.actions.setIndexedTo100},L.prototype._autoScaleAction=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().autoSeriesScale:this.actions.setAutoScale},L.prototype._regularScaleAction=function(){return this._isMainSeriesAxis()?this._pane.chart().actions().regularSeriesScale:this.actions.setRegular},L.prototype._lockScaleAction=function(){var e=this._pane.chart().actions().lockSeriesScale,t=M(this.priceScale(),this._pane.chart().model().model().mainSeriesScaleRatio());return e.update({hint:t}),e},L.prototype._invertAction=function(){ return this._isMainSeriesAxis()?this._pane.chart().actions().invertSeriesScale:this.actions.invertScale},L.prototype._isMainSeriesAxis=function(){return this.priceScale().hasMainSeries()},L.prototype._updateMainSeriesScalesActions=function(){this._isMainSeriesAxis()&&null!==this.actions&&this._updateScalesActions()},L.prototype._updateScalesActions=function(){var e=this.priceScale(),t=this._isMainSeriesAxis(),i=e.mainSource().properties(),r=t&&e.isLockScale(),n=t&&i.style.value()===TradingView.Series.STYLE_PNF;this.actions.setRegular.update({checked:e.isRegular(),disabled:r||n}),this.actions.setPercentage.update({checked:e.isPercentage(),disabled:r||n}),this.actions.setIndexedTo100.update({checked:e.isIndexedTo100(),disabled:r||n}),this.actions.setLog.update({checked:e.isLog(),disabled:r||n}),this.actions.setAutoScale.update({checked:e.isAutoScale(),disabled:e.properties().autoScaleDisabled.value()})},L.prototype.mouseDoubleClickEvent=function(e){var t=this.dataSourceAtPoint(e.localX,e.localY);t?this._pane.processDoubleClickOnSource(t):(this.reset(),y("GUI","Double click price scale"))},L.prototype.contextMenuEvent=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)}))}},L.prototype._createContextMenu=function(){return c.createMenu(this.getContextMenuActions(),{statName:"PriceScaleContextMenu"})},L.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:T,subItems:i})},L.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)),!x.enabled("fundamental_widget")){t.push(new a({label:window.t("Labels"),subItems:[e.showSymbolLabelsAction,e.showSeriesLastValue,e.showStudyPlotNamesAction,e.showStudyLastValue,null,null,this.actions.alignLabels].filter(Boolean)}))}return x.enabled("countdown")&&t.push(e.showCountdown),this._options.currencyLabelEnabled&&t.push(e.showCurrency),!TradingView.onWidget()&&x.enabled("show_chart_property_page")&&x.enabled("chart_property_page_scales")&&e.scalesProperties&&t.push(new l,e.scalesProperties),t},L.prototype._sameSideSources=function(){var e=this._isLeft?"left":"right" -;return this._pane.state().orderedSources(e)},L.prototype._grouppedSources=function(){var e=this._pane,t=e.chart().model(),i=this._sameSideSources().slice(),r=e.state(),n=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().sources().forEach((function(e){o.add(e)})),t.hoveredSource()&&o.add(t.hoveredSource()),n===r.defaultPriceScale())for(var a=this._pane.state().dataSources(),l=0;l0&&this._hightlightBackground(e,a,this.priceScale().mainSource(),t);var l=o.model().crossHairSource();l.startMeasurePoint()&&this._hightlightBackground(e,l.measurePoints(),this.priceScale().mainSource(),t)},L.prototype.drawBorder=function(e,t){e.save(),e.fillStyle=this.lineColor();var i,r=Math.max(1,Math.floor(this.rendererOptions().borderSize*t));i=this._isLeft?Math.floor(this._size.w*t)-r:0,e.fillRect(i,0,r,Math.ceil(this._size.h*t)+1),e.restore()},L.prototype.drawTickMarks=function(e,t){var i=this.priceScale().marks();e.save(),e.setFont(this.baseFont()) -;var r=this.rendererOptions(),n=this._isLeft?Math.floor((this._size.w-r.tickLength-r.borderSize)*t):Math.floor(r.borderSize*t),o=this._isLeft?Math.round(n-r.paddingInner*t):Math.round(n+(r.tickLength+r.paddingInner)*t),s=this._isLeft?"right":"left",a=Math.round(r.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(r),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++){(y=t[a]).setFixedCoordinate(y.coordinate())}var m=this.priceScale().properties();if(m.alignLabels&&m.alignLabels.value()){for(a=1;aS-g&&y.setFixedCoordinate(S-g)}for(var b=1;b=l)&&(o={value:l,view:a})}})),n.view&&r.push(n.view),o.view&&r.push(o.view),r}, +;return this._pane.state().orderedSources(e)},L.prototype._grouppedSources=function(){var e=this._pane,t=e.chart().model(),i=this._sameSideSources().slice(),r=e.state(),n=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().sources().forEach((function(e){o.add(e)})),t.hoveredSource()&&o.add(t.hoveredSource()),n===r.defaultPriceScale())for(var a=this._pane.state().dataSources(),l=0;l0&&this._hightlightBackground(e,a,this.priceScale().mainSource(),t);var l=o.model().crossHairSource();l.startMeasurePoint()&&this._hightlightBackground(e,l.measurePoints(),this.priceScale().mainSource(),t)},L.prototype.drawBorder=function(e,t){e.save(),e.fillStyle=this.lineColor();var i,r=Math.max(1,Math.floor(this.rendererOptions().borderSize*t));i=this._isLeft?Math.floor(this._size.w*t)-r:0,e.fillRect(i,0,r,Math.ceil(this._size.h*t)+1),e.restore()},L.prototype.drawTickMarks=function(e,t){var i=this.priceScale().marks();e.save(),e.setFont(this.baseFont()) +;var r=this.rendererOptions(),n=this._isLeft?Math.floor((this._size.w-r.tickLength-r.borderSize)*t):Math.floor(r.borderSize*t),o=this._isLeft?Math.round(n-r.paddingInner*t):Math.round(n+(r.tickLength+r.paddingInner)*t),s=this._isLeft?"right":"left",a=Math.round(r.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(r),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++){(y=t[a]).setFixedCoordinate(y.coordinate())}var m=this.priceScale().properties();if(m.alignLabels&&m.alignLabels.value()){for(a=1;ab-g&&y.setFixedCoordinate(b-g)}for(var S=1;S=l)&&(o={value:l,view:a})}})),n.view&&r.push(n.view),o.view&&r.push(o.view),r}, L.prototype._isFromSameSide=function(e){return(this._isLeft?this._pane.state().leftPriceScales():this._pane.state().rightPriceScales()).includes(e)},L.prototype._addViewsOrMaxMin=function(e,t){var i=this._pane.state(),r=this.priceScale();if(r!==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 n=e[0].priceAxisViews(i,r);n&&n.length&&t.push(n)}else t.push(this._minMaxViews(e))},L.prototype.drawCrossHairLabel=function(e,t){e.save();var i=this._pane.chart().model().model(),r=this._pane.state(),n=this.priceScale(),o=[],s=this._pane.state(),a=this.priceScale()===r.defaultPriceScale(),l=i.lineBeingEdited()||i.lineBeingCreated();l&&(l.priceScale()===n||a&&r.isOverlay(l))&&((u=l.priceAxisViews(s,n))&&u.length&&o.push(u));this._addViewsOrMaxMin(i.sourcesBeingMoved(),o),this._addViewsOrMaxMin(i.selection().sources(),o);var c=i.hoveredSource();if(c){var u,h=r.customSources().includes(c)?n:c.priceScale();if(!i.selection().isSelected(c)&&(this._isFromSameSide(h)||a&&r.isOverlay(c)))(u=i.hoveredSource().priceAxisViews(s,n))&&u.length&&o.push(u)}(u=i.crossHairSource().priceAxisViews(s,n))&&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()},L.prototype.setAutoScale=function(e){var t=this._pane.state(),i=this.priceScale();this._pane.chart().model().setPriceAutoScale(t,i,e)},L.prototype.reset=function(){var e=this._pane.state(),t=this.priceScale();this._pane.chart().model().resetPriceScale(e,t)},L.prototype.hardResetCanvas=function(){null!==this._size&&(p(this._canvasBinding,this._size),p(this._topCanvasBinding,this._size))},L.prototype._isMainPane=function(){return this._pane.state().containsMainSeries()},L.prototype.paint=function(e){if(this._isVisible&&e){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),r=this._topCanvasBinding.pixelRatio;i.clearRect(0,0,Math.ceil(this._size.w*r)+1,Math.ceil(this._size.h*r)+1),this.drawCrossHairLabel(i,r)}}},L.prototype.restoreDefaultCursor=function(){this.setCursor("")},L.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)},L.prototype.axisInfo=function(){return this._axisInfo},L.prototype.setHighlighted=function(e){this._highlighted!==e&&(this._highlighted=e)};var M=I(4);e.exports={PriceAxisWidget:L, -scaleRatioForContextMenuTransformer:I}},"1Wlv":function(e,t,i){"use strict";(function(e){var r=i("Yj6H").PriceScaleBase,n=i("Ss5c").LineDataSource,o=i("7ktv").PriceDataSource,s=i("qJq3").Series,a=i("kcTO").PriceFormatter,l=i("GH0z").PercentageFormatter,c=i("Qb4w").PriceRange,u=i("0waE").randomHash,h=i("s1Gx").sortSources,d=i("3ClC").isStudy,p=i("lTLF").PriceTickMarkBuilder,f=i("TTFo"),_=f.fromPercent,m=f.toPercent,y=f.toPercentRange,g=f.fromIndexedTo100,v=f.toIndexedTo100,S=f.toIndexedTo100Range,b=f.fromLog,w=f.toLog,P=new l,C=new a(100,1);function x(t,i){r.call(this,i),this._scalesProperties=t,this.m_height=0,this._internalHeightCache=null,this._internalHeightChanged=new e,this.m_priceRange=null,this._priceRangeChanged=new e,this.m_topMargin=0,this.m_bottomMargin=0,this._topPixelMargin=0,this._bottomPixelMargin=0,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_maxPriceRange=null,this.m_minPriceRange=null,this.m_priceRangeSnapshot=null,this._invalidatedForRange={isValid:!0,visibleBars:null};var n=this;this._coordinateToLogicalFunc=function(e,t){return n._coordinateToLogical(e,t)},this._logicalToCoordinateFunc=function(e,t){return n._logicalToCoordinate(e,t)},this.m_markBuilder=new p(this,100,this._coordinateToLogicalFunc,this._logicalToCoordinateFunc),this._modeChanged=new e,this._properties.isInverted.listeners().subscribe(this,x.prototype._onIsInvertedChanged),this._properties.listeners().subscribe(null,(function(){if(n.mainSource()&&n.mainSource().model()){var e=n.mainSource().model().paneForSource(n.mainSource());n.mainSource().model().updatePane(e)}})),this._scalesProperties.listeners().subscribe(this,(function(){this._marksCache=null})),this.setId(u())}inherit(x,r),x.prototype.id=function(){return this._id},x.prototype.setId=function(e){this._id=e},x.prototype._convertPriceRangeFromLog=function(e){if(null===e)return null;var t=b(e.minValue()),i=b(e.maxValue());return new c(t,i)},x.prototype._convertPriceRangeToLog=function(e){if(null===e)return null;var t=w(e.minValue()),i=w(e.maxValue());return new c(t,i)},x.prototype._canConvertPriceRangeFromLog=function(e){if(null===e)return!1;var t=b(e.minValue()),i=b(e.maxValue());return isFinite(t)&&isFinite(i)},x.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()}},x.prototype.setMode=function(e){var t={},i=this.mode(),r=this._properties.state(),n=null;void 0!==e.autoScale&&e.autoScale!==r.autoScale&&(t.autoScale=e.autoScale,this._setAutoScaleValueWithDependentProperties(e.autoScale)),void 0!==e.lockScale&&e.lockScale!==r.lockScale&&(t.lockScale=e.lockScale,this._setLockScaleValueWithDependentProperties(e.lockScale)),void 0!==e.percentage&&e.percentage!==r.percentage&&(t.percentage=e.percentage,this._setPercentageValueWithDependentProperties(e.percentage),this._invalidatedForRange.isValid=!1), +scaleRatioForContextMenuTransformer:I}},"1Wlv":function(e,t,i){"use strict";(function(e){var r=i("Yj6H").PriceScaleBase,n=i("Ss5c").LineDataSource,o=i("7ktv").PriceDataSource,s=i("qJq3").Series,a=i("kcTO").PriceFormatter,l=i("GH0z").PercentageFormatter,c=i("Qb4w").PriceRange,u=i("0waE").randomHash,h=i("s1Gx").sortSources,d=i("3ClC").isStudy,p=i("lTLF").PriceTickMarkBuilder,f=i("TTFo"),_=f.fromPercent,m=f.toPercent,y=f.toPercentRange,g=f.fromIndexedTo100,v=f.toIndexedTo100,b=f.toIndexedTo100Range,S=f.fromLog,w=f.toLog,P=new l,C=new a(100,1);function x(t,i){r.call(this,i),this._scalesProperties=t,this.m_height=0,this._internalHeightCache=null,this._internalHeightChanged=new e,this.m_priceRange=null,this._priceRangeChanged=new e,this.m_topMargin=0,this.m_bottomMargin=0,this._topPixelMargin=0,this._bottomPixelMargin=0,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_maxPriceRange=null,this.m_minPriceRange=null,this.m_priceRangeSnapshot=null,this._invalidatedForRange={isValid:!0,visibleBars:null};var n=this;this._coordinateToLogicalFunc=function(e,t){return n._coordinateToLogical(e,t)},this._logicalToCoordinateFunc=function(e,t){return n._logicalToCoordinate(e,t)},this.m_markBuilder=new p(this,100,this._coordinateToLogicalFunc,this._logicalToCoordinateFunc),this._modeChanged=new e,this._properties.isInverted.listeners().subscribe(this,x.prototype._onIsInvertedChanged),this._properties.listeners().subscribe(null,(function(){if(n.mainSource()&&n.mainSource().model()){var e=n.mainSource().model().paneForSource(n.mainSource());n.mainSource().model().updatePane(e)}})),this._scalesProperties.listeners().subscribe(this,(function(){this._marksCache=null})),this.setId(u())}inherit(x,r),x.prototype.id=function(){return this._id},x.prototype.setId=function(e){this._id=e},x.prototype._convertPriceRangeFromLog=function(e){if(null===e)return null;var t=S(e.minValue()),i=S(e.maxValue());return new c(t,i)},x.prototype._convertPriceRangeToLog=function(e){if(null===e)return null;var t=w(e.minValue()),i=w(e.maxValue());return new c(t,i)},x.prototype._canConvertPriceRangeFromLog=function(e){if(null===e)return!1;var t=S(e.minValue()),i=S(e.maxValue());return isFinite(t)&&isFinite(i)},x.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()}},x.prototype.setMode=function(e){var t={},i=this.mode(),r=this._properties.state(),n=null;void 0!==e.autoScale&&e.autoScale!==r.autoScale&&(t.autoScale=e.autoScale,this._setAutoScaleValueWithDependentProperties(e.autoScale)),void 0!==e.lockScale&&e.lockScale!==r.lockScale&&(t.lockScale=e.lockScale,this._setLockScaleValueWithDependentProperties(e.lockScale)),void 0!==e.percentage&&e.percentage!==r.percentage&&(t.percentage=e.percentage,this._setPercentageValueWithDependentProperties(e.percentage),this._invalidatedForRange.isValid=!1), void 0!==e.indexedTo100&&e.indexedTo100!==r.indexedTo100&&(t.indexedTo100=e.indexedTo100,this._setIndexedTo100ValueWithDependentProperties(e.indexedTo100),this._invalidatedForRange.isValid=!1),void 0!==e.log&&e.log!==r.log&&(t.log=e.log,this._setLogValueWithDependentProperties(e.log)),r.log&&!this._properties.log.value()&&(this._canConvertPriceRangeFromLog(this.m_priceRange)?null!==(n=this._convertPriceRangeFromLog(this.m_priceRange))&&this.setPriceRange(n):this.properties().autoScale.setValue(!0)),!r.log&&this._properties.log.value()&&null!==(n=this._convertPriceRangeToLog(this.m_priceRange))&&this.setPriceRange(n),r.autoScale!==this._properties.autoScale.value()&&this._properties.autoScale.listeners().fire(this._properties.autoScale),r.autoScaleDisabled!==this._properties.autoScaleDisabled.value()&&this._properties.autoScaleDisabled.listeners().fire(this._properties.autoScaleDisabled),r.lockScale!==this._properties.lockScale.value()&&this._properties.lockScale.listeners().fire(this._properties.lockScale),r.percentage!==this._properties.percentage.value()&&(this._properties.percentage.listeners().fire(this._properties.percentage),this.updateFormatter()),r.indexedTo100!==this._properties.indexedTo100.value()&&(this._properties.indexedTo100.listeners().fire(this._properties.indexedTo100),this.updateFormatter()),r.percentageDisabled!==this._properties.percentageDisabled.value()&&this._properties.percentageDisabled.listeners().fire(this._properties.percentageDisabled),r.log!==this._properties.log.value()&&this._properties.log.listeners().fire(this._properties.log),r.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())},x.prototype.modeChanged=function(){return this._modeChanged},x.prototype.fontSize=function(){return this._scalesProperties.fontSize.value()},x.prototype.height=function(){return this.m_height},x.prototype.setHeight=function(e){this.m_height!==e&&(this.m_height=e,this._invalidateInternalHeightCache(),this._marksCache=null)},x.prototype.topPixelMargin=function(){return this.isInverted()?this.m_bottomMargin*this.height()+this._bottomPixelMargin:this.m_topMargin*this.height()+this._topPixelMargin},x.prototype.topMargin=function(){return this.m_topMargin},x.prototype.setTopMargin=function(e){if(!isNumber(e))throw new TypeError("invalid margin");if(e<0||e>30)throw new RangeError("invalid margin");this.m_topMargin!==e&&(this.m_topMargin=e,this._invalidateInternalHeightCache(),this._marksCache=null)},x.prototype.bottomPixelMargin=function(){return this.isInverted()?this.m_topMargin*this.height()+this._topPixelMargin:this.m_bottomMargin*this.height()+this._bottomPixelMargin},x.prototype.bottomMargin=function(){return this.m_bottomMargin},x.prototype.setBottomMargin=function(e){if(!isNumber(e))throw new TypeError("invalid margin");if(e<0||e>30)throw new RangeError("invalid margin") -;this.m_bottomMargin!==e&&(this.m_bottomMargin=e,this._invalidateInternalHeightCache(),this._marksCache=null)},x.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var e=this.height()-this.topPixelMargin()-this.bottomPixelMargin();return this._internalHeightCache=e,e},x.prototype._invalidateInternalHeightCache=function(){this._internalHeightCache=null,this._internalHeightChanged.fire()},x.prototype.internalHeightChanged=function(){return this._internalHeightChanged},x.prototype.priceRange=function(){return this.makeSureItIsValid(),this.m_priceRange},x.prototype.priceRangeChanged=function(){return this._priceRangeChanged},x.prototype.setPriceRange=function(e,t,i){if(!(e instanceof c))throw new TypeError("incorrect price range");var r=this.m_priceRange;if(!t&&(null!==r||null===e)&&(null===r||r.equals(e)))return!1;var n=null!==this.m_maxPriceRange&&this.m_maxPriceRange.containsStrictly(e),o=null!==this.m_minPriceRange&&e.containsStrictly(this.m_minPriceRange);if(this.isLockScale()&&!t&&(n||o))return!1;this._marksCache=null,this.m_priceRange=e,i||this._priceRangeChanged.fire(r,e)},x.prototype.isEmpty=function(){return this.makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()},x.prototype.invertedCoordinate=function(e){return this.isInverted()?e:this.height()-1-e},x.prototype.priceToLogical=function(e){return this.isLog()&&e?w(e):e},x.prototype.logicalToPrice=function(e){return this.isLog()?b(e):e},x.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)},x.prototype.priceToCoordinate=function(e,t){return this.isPercentage()?e=m(e,t):this.isIndexedTo100()&&(e=v(e,t)),this._logicalToCoordinate(e,t)},x.prototype.pointsArrayToCoordinates=function(e,t){this.makeSureItIsValid();var i=this.bottomPixelMargin(),r=this.priceRange().minValue(),n=this.priceRange().maxValue(),o=this.internalHeight()-1,s=this.isInverted(),a=o/(n-r);if(this.isPercentage())for(var l=0;l0||Math.abs(s-this._bottomPixelMargin)>0)&&(this._bottomPixelMargin=s,this._topPixelMargin=o,this._marksCache=null,this._invalidateInternalHeightCache()),t?(t.minValue()===t.maxValue()&&(t=new c(t.minValue()-.5,t.maxValue()+.5)),this.setPriceRange(t)):this.m_priceRange||this.setPriceRange(new c(-.5,.5)),this._invalidatedForRange.isValid=!0}},x.prototype.sourcesToUpdateViews=function(){if(!this._sourcesToUpdateViews){this._sourcesToUpdateViews=[];for(var e=0;e'},"2+aH":function(e,t,i){"use strict";(function(e){ +this.isPercentage()?(this._formatter=P,t=100):this.isIndexedTo100()?(this._formatter=new a(100,1),t=100):this._formatter=e?e.formatter():C,this.m_markBuilder=new p(this,t,this._coordinateToLogicalFunc,this._logicalToCoordinateFunc),this.m_markBuilder.rebuildTickMarks()},x.prototype._onIsInvertedChanged=function(){this._marksCache=null,this.m_markBuilder.rebuildTickMarks()},x.prototype._mainSourceFormatter=function(){return this.mainSource().formatter()||C},x.prototype.sourcesForAutoscale=function(){return this._mainSource&&this._scaleSeriesOnly!==this._scalesProperties.scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null),this._sourcesForAutoscale||this._recalculateSourcesForAutoscale(),this._sourcesForAutoscale},x.prototype.recalculatePriceRange=function(e){this._invalidatedForRange={visibleBars:e,isValid:!1}},x.prototype.makeSureItIsValid=function(){this._invalidatedForRange.isValid||(this._invalidatedForRange.isValid=!0,this.recalculatePriceRangeImpl())},x.prototype.recalculatePriceRangeImpl=function(){var e=this._invalidatedForRange.visibleBars;if(null!==e){for(var t=null,i=this.sourcesForAutoscale(),r=this.isPercentage(),n=this.isIndexedTo100(),o=0,s=0,a=0;a0||Math.abs(s-this._bottomPixelMargin)>0)&&(this._bottomPixelMargin=s,this._topPixelMargin=o,this._marksCache=null,this._invalidateInternalHeightCache()),t?(t.minValue()===t.maxValue()&&(t=new c(t.minValue()-.5,t.maxValue()+.5)),this.setPriceRange(t)):this.m_priceRange||this.setPriceRange(new c(-.5,.5)),this._invalidatedForRange.isValid=!0}},x.prototype.sourcesToUpdateViews=function(){if(!this._sourcesToUpdateViews){this._sourcesToUpdateViews=[];for(var e=0;e'},"2+aH":function(e,t,i){"use strict";(function(e){ var r=i("aO4+").Point,n=i("vdSZ").CrosshairDataWindowView,o=i("Hm6r").CrosshairTimeAxisView,s=i("zZ2k").CrosshairBase,a=i("mMWL"),l=i("ogJP").isNaN;function c(t,i,r){var l=this;s.call(this,t,r),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 o(t,c,!1),this._startMeasureTimeAxisView=new o(t,u,!0),this._endMeasureTimeAxisView=new o(t,h,!0),this.visible=!0,t.readOnly()?this.areLinesVisible=!0:a.cursorTool.subscribe((function(e){l.areLinesVisible="arrow"!==e}),{callWithLast:!0}),this._movedDelegate=new e,this._subscribed=!1,this._barSelectedDelegate=new e}inherit(c,s),c.prototype.index=0,c.prototype.price=NaN,c.prototype.pane=null,c.prototype.color="white",c.prototype.style="",c.prototype.customization={disableSelection:!0},c.prototype.model=function(){return this._model},c.prototype.properties=function(){return this._properties},c.prototype.moved=function(){return this._movedDelegate},c.prototype.originX=function(){return this._originX},c.prototype.originY=function(){return this._originY},c.prototype.saveOriginCoord=function(e,t){this._originX=e,this._originY=t},c.prototype.originCoordX=function(){return this._originX},c.prototype.originCoordY=function(){return this._originY},c.prototype.clearOriginCoord=function(){this._originX=NaN,this._originY=NaN},c.prototype.setPosition=function(e,t,i){this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,c.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.visible=!0,this._tryToUpdateViews(e,t,i)},c.prototype.selectionPane=function(){return this._selectionPane},c.prototype.update=function(){if(this.visible){var e=this._priceScaleByPane(this.pane),t=this._originX||this.x,i=this._originY||this.y,r=this._model.timeScale().coordinateToIndex(t),n=NaN;if(null!==e){var o=this.pane.mainDataSource().firstValue();n=e.coordinateToPrice(i,o)}this._tryToUpdateViews(r,n,this.pane)}else this._setIndexToLastSeriesBarIndex()},c.prototype._priceScaleByPane=function(e){return e&&!e.defaultPriceScale().isEmpty()?e.defaultPriceScale():null},c.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}))},c.prototype._tryToUpdateData=function(e,t,i){var r=this.x,n=this.y,o=this.price,s=this.index,a=this.pane,c=this._priceScaleByPane(i);if(this.index=e,this.x=l(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 r!==this.x||n!==this.y||s!==this.index||o!==this.price||a!==this.pane},c.prototype.setLockedPosition=function(e){delete this.lockedIndex,delete this.lockedX, e!==this._measurePane&&a.lockTimeAxis().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(a.lockTimeAxisTime.value()),this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex))},c.prototype.clearPosition=function(){this.visible=!1,this._setIndexToLastSeriesBarIndex(),this.price=NaN,this.x=NaN,this.y=NaN,this.pane=null,this.clearOriginCoord()},c.prototype._setIndexToLastSeriesBarIndex=function(){var e=this._model.mainSeries().bars().lastIndex();this.index=null!==e?e:NaN},c.prototype.dataWindowView=function(){return this._dataWindowView},c.prototype.currentPoint=function(){return new r(this.x,this.y)},c.prototype.appliedIndex=function(){return isFinite(this.lockedIndex)&&this.lockedIndex||this.index},c.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x},c.prototype.selectBarMode=function(){return this._selectBarMode},c.prototype.toggleSelectBarMode=function(){this._setSelectBarModeState(!this._selectBarMode.value())},c.prototype.onBarSelected=function(){return this._barSelectedDelegate},c.prototype._setSelectBarModeState=function(e){this._selectBarMode.setValue(e),this._model.lightUpdate()},c.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))}},c.prototype.handleContextMenuEvent=function(){this._selectBarMode.value()&&this._setSelectBarModeState(!1)},c.prototype.setOnHoveredChartWidget=function(e){this._isOnHoveredChartWidget=e},c.prototype.isOnHoveredChartWidget=function(){return this._isOnHoveredChartWidget},c.prototype.setLinesShouldBeHidden=function(e){this._linesShouldBeHidden=e},c.prototype.linesShouldBeHidden=function(){return this._linesShouldBeHidden},t.CrossHair=c}).call(this,i("aIyQ"))},"22xp":function(e,t,i){"use strict";i.r(t);var r=i("mrSG"),n=i("Eyy1"),o=(i("YFKU"),i("j1f4")),s=i("uOxu"),a=i("beCu"),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(n.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 r=e+this._zoffset;if(r<0){var n=Math.abs(r);if(i.lengththis._items.length){n=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 r=i.length-1,n=this._validOffsetToIndex(0),o=this._validOffsetToIndex(r),s=i[0],a=i[r];if(e>=s&&e<=a)return this.closestIndexLeft(e);var l=(a-s)/(o-n);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 r=0,n=t[r];if(er+1;){var o=r+i>>1,s=t[o];if(s>e)i=o;else{if(!(s=t[i])return this._validOffsetToIndex(i);var r=0,n=t[r];if(er+1;){var o=r+i>>1,s=t[o];if(s>e)i=o;else{if(!(s0&&this._points.merge(e,t,i),this._tickMarks.merge(r),this._correctOffset()},e.prototype.addTail=function(e,t,i){this._tickMarks.removeTail(t);for(var r=e.params,o=Object(n.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),r=Object(n.ensureNotNull)(this.visibleBarsStrictRange()),o=Math.max(r.firstBar(),r.firstBar()-i),s=Math.max(r.lastBar(),r.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(n.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 r=this._rightOffset-i-1;this.scrollToOffsetAnimated(r,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(n.ensureNotNull)(this._points.valueAt(t)),r=this.indexToCoordinate(t);if(r<=0||r>=this._width)return null;var o=this.barSpacing(),s=this.baseIndex(),a=r+(e-i)/(Object(n.ensureNotNull)(this._points.valueAt(s))-Object(n.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,r=e;i0&&r>s&&(r=s);var l=this._model;Object(a.doAnimate)({from:n,to:r,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.recalcVisibleRangeStudy(l.dataSources())}})}else this._visibleBarsInvalidated=!0,this._rightOffset=r,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 r=void 0===t?400:t;if(!isFinite(r)||r<=0)throw new RangeError("animationDuration (optional) must be finite positive number") -;var n=this._rightOffset,o=Date.now(),s=function(){i._visibleBarsInvalidated=!0;var t=(Date.now()-o)/r;if(t>=1)return i._rightOffset=e,i._correctOffset(),i._visibleBarsInvalidated=!0,i._model.recalculateAllPanes(),void i._model.lightUpdate();i._rightOffset=n+(e-n)*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(b.saveDefaultProperties)(!0),this._scalesProperties.childs().barSpacing.setValue(this._barSpacing),Object(b.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,r=this.baseIndex(),o=Object(n.ensureNotNull)(this._points.firstIndex());return er?(t=Object(n.ensureNotNull)(this._points.valueAt(r)),i=e-r):(t=Object(n.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+O},e.prototype.maxRightOffset=function(){return this.width()/this._barSpacing-O},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 r=this.coordinateToIndex(e),n=this.barSpacing(),o=n+t*(n/10);this.setBarSpacing(o),(void 0!==i?!i:this._options.rightBarStaysOnScroll)||this.setRightOffset(this.rightOffset()-.5+(r-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 r=k.get(this._model.mainSeries().style())||.6,n=Math.max(t-e+r,O);this.setBarSpacing(this.width()/n),this._visibleBarsInvalidated=!0}}, +;var n=this._rightOffset,o=Date.now(),s=function(){i._visibleBarsInvalidated=!0;var t=(Date.now()-o)/r;if(t>=1)return i._rightOffset=e,i._correctOffset(),i._visibleBarsInvalidated=!0,i._model.recalculateAllPanes(),void i._model.lightUpdate();i._rightOffset=n+(e-n)*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,r=this.baseIndex(),o=Object(n.ensureNotNull)(this._points.firstIndex());return er?(t=Object(n.ensureNotNull)(this._points.valueAt(r)),i=e-r):(t=Object(n.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+O},e.prototype.maxRightOffset=function(){return this.width()/this._barSpacing-O},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 r=this.coordinateToIndex(e),n=this.barSpacing(),o=n+t*(n/10);this.setBarSpacing(o),(void 0!==i?!i:this._options.rightBarStaysOnScroll)||this.setRightOffset(this.rightOffset()-.5+(r-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 r=k.get(this._model.mainSeries().style())||.6,n=Math.max(t-e+r,O);this.setBarSpacing(this.width()/n),this._visibleBarsInvalidated=!0}}, e.prototype.coordinateToIndex=function(e){return Math.ceil(this._coordinateToFloatIndex(e))},e.prototype.canZoomIn=function(){return this.barSpacing()M},e.prototype.minBarSpacing=function(){return M},e.prototype.maxBarSpacing=function(){return I?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 r=null,n=this._barLineWidth<=this._barWidth&&this._barSpacing>=Math.floor(1.5*t.pixelRatio),o=0,s=this._bars;o_+y-1&&(S=(b=_+y-1)-h+1),e.fillRect(v,S,u-v,b-S+1)}var w=c+g,P=Math.max(_,Math.round(a.close*i)-l),C=P+h-1;C>_+y-1&&(P=(C=_+y-1)-h+1),e.fillRect(d+1,P,w-d,C-P+1)}}e.restore()},e.prototype._calcBarWidth=function(e){var t=Math.floor(e);return Math.max(t,Math.floor(Object(n.optimalBarWidth)(this._barSpacing,e)))},e}()},"2Fqk":function(e,t,i){"use strict";i.r(t),i.d(t,"CompareLegendView",(function(){return n}));var r=i("mrSG"),n=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r._additional=null,r._showStudyValues=i.properties().paneProperties.legendProperties.showStudyValues,r._showStudyValues.subscribe(r,r.update),r}return Object(r.__extends)(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}(i("TrvT").CompareDataWindowView)},"2OVc":function(e,t,i){"use strict";i.r(t),i.d(t,"InsertStudyCommand",(function(){return a}));var r=i("mrSG"),n=i("Eyy1"),o=i("RDU5"),s=i("PC8g"),a=function(e){function t(t,i,r,n,o,s,a,l,c,u,h){var d=e.call(this,h)||this;return d._studyId=null,d._chartModel=t,d._studyMetaInfo=i,d._props=n,d._addAsOverlay=o,d._parentId=null==s?null:s.id(),d._inputs=r,d._targetZOrder=u,d._preferredPriceScale=a,d._allowChangeCurrency=l,d._paneSize=c,d}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=null===this._parentId?void 0:this._chartModel.dataSourceForId(this._parentId),t=this._chartModel.insertStudyWithParams(this._studyMetaInfo,this._inputs,this._targetZOrder,this._props,this._addAsOverlay,e,this._preferredPriceScale,this._allowChangeCurrency,this._paneSize,null===this._studyId?void 0:this._studyId);this._studyId=t.id(),t.childStudyByRebind().subscribe(null,(function(){return Object(s.trackEvent)("SOS","Apply SOS","Rebind SOS")})),this._chartModel.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){var e=Object(n.ensureNotNull)(this._chartModel.dataSourceForId(Object(n.ensureNotNull)(this._studyId)));this._chartModel.removeSource(e)},t.prototype.insertedStudy=function(){return this._chartModel.dataSourceForId(Object(n.ensureNotNull)(this._studyId))},t}(o.UndoCommand)},"2S76":function(e,t,i){"use strict";i.r(t) +var i=this,r=this._formattedBySpan.get(t);return void 0===r&&(r=new C((function(e){return i.formatLabelImpl(e,t)})),this._formattedBySpan.set(t,r)),r.format(new Date(e))},e.prototype.formatLabelImpl=function(e,t){if(!(e&&e instanceof Date))return"incorrect time";var i=this._model.mainSeries().isDWM();return te&&(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 r=null,n=this._barLineWidth<=this._barWidth&&this._barSpacing>=Math.floor(1.5*t.pixelRatio),o=0,s=this._bars;o_+y-1&&(b=(S=_+y-1)-h+1),e.fillRect(v,b,u-v,S-b+1)}var w=c+g,P=Math.max(_,Math.round(a.close*i)-l),C=P+h-1;C>_+y-1&&(P=(C=_+y-1)-h+1),e.fillRect(d+1,P,w-d,C-P+1)}}e.restore()},e.prototype._calcBarWidth=function(e){var t=Math.floor(e);return Math.max(t,Math.floor(Object(n.optimalBarWidth)(this._barSpacing,e)))},e}()},"2Fqk":function(e,t,i){"use strict";i.r(t),i.d(t,"CompareLegendView",(function(){return n}));var r=i("mrSG"),n=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r._additional=null,r._showStudyValues=i.properties().paneProperties.legendProperties.showStudyValues,r._showStudyValues.subscribe(r,r.update),r}return Object(r.__extends)(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}(i("TrvT").CompareDataWindowView)},"2OVc":function(e,t,i){"use strict";i.r(t),i.d(t,"InsertStudyCommand",(function(){return a}));var r=i("mrSG"),n=i("Eyy1"),o=i("RDU5"),s=i("PC8g"),a=function(e){function t(t,i,r,n,o,s,a,l,c,u,h){var d=e.call(this,h)||this;return d._studyId=null,d._chartModel=t,d._studyMetaInfo=i,d._props=n,d._addAsOverlay=o,d._parentId=null==s?null:s.id(),d._inputs=r,d._targetZOrder=u,d._preferredPriceScale=a,d._allowChangeCurrency=l,d._paneSize=c,d}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=null===this._parentId?void 0:this._chartModel.dataSourceForId(this._parentId),t=this._chartModel.insertStudyWithParams(this._studyMetaInfo,this._inputs,this._targetZOrder,this._props,this._addAsOverlay,e,this._preferredPriceScale,this._allowChangeCurrency,this._paneSize,null===this._studyId?void 0:this._studyId);this._studyId=t.id(),t.childStudyByRebind().subscribe(null,(function(){return Object(s.trackEvent)("SOS","Apply SOS","Rebind SOS")})),this._chartModel.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){var e=Object(n.ensureNotNull)(this._chartModel.dataSourceForId(Object(n.ensureNotNull)(this._studyId)));this._chartModel.removeSource(e)},t.prototype.insertedStudy=function(){return this._chartModel.dataSourceForId(Object(n.ensureNotNull)(this._studyId))},t}(o.UndoCommand)},"2S76":function(e,t,i){"use strict";i.r(t) ;var r=i("mrSG"),n=i("Eyy1"),o=i("hY0g"),s=i.n(o),a=i("+DwS"),l=i("dfhE"),c=i("8woN"),u=i.n(c),h=["DJ","CBOE"];function d(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,i,n;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[3,2];case 1:return r.sent(),i=t.getProduct(function(e){return"exchange-"+e.pro_perm}(e)),(n=function(e){0;return null}(i.exchange))&&"cme-full"===n.exchange?[2,i]:[2,n||i];case 2:return[2,null]}}))}))}var p=i("uOxu"),f=i("Cf1E");i.d(t,"DataUpdatedModeModel",(function(){return y}));var _=Object(p.getLogger)("Chart.Definitions.Series");function m(e,t){var i,r=[];return void 0!==(i=e.delay)&&i>0?(!function(e){return"index"===e.type&&h.includes(e.listed_exchange)}(e)?r.push("DelayToRealtime"):r.push("DelayNoRealtime"),r):function(e,t){return u.a.hasEodSymbols(e.full_name)||t===l.STATUS_EOD}(e,t)?(r.push("EOD"),r):r}var y=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(r.__awaiter)(this,void 0,void 0,(function(){var e,t,i,o;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:if(null===(e=this._symbolInfo.value()))return[2,""];t={},r.label=1;case 1:return r.trys.push([1,3,,4]),i=n.ensureNotNull,[4,d(e)];case 2:return t=i.apply(void 0,[r.sent()]),[3,4];case 3:return o=r.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 r=i("mrSG"),n=i("Eyy1"),o=i("aO4+"),s=i("f6yo"),a=i("VdBB");function l(e,t,i){var r=e.get(t);return void 0!==r?r:(e.set(t,i),i)}function c(e,t,i,r){var n=l(e,t,new Map);return l(n,i,r)} function u(e,t,i,r,n){var o=l(e,t,new Map),s=l(o,i,new Map);return l(s,r,n)}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(r.__extends)(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(r.__extends)(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,r){e(i,r,t)}))}))}}(h),function(e){function t(){return e.call(this)||this}Object(r.__extends)(t,e),t.prototype._add=function(e,t,i,r){u(this._map,e,t,i,[]).push(r),++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,r){t.forEach((function(t,n){e(i,r,n,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(r.__extends)(t,e),t.prototype.get=function(e){if(!e.text||!e.fontSize||!e.align)return null;var t=e.fontSize,i=e.text,r=e.align,n=c(this._map,t,r,new Map),o=n.get(i);return void 0!==o||(this._size>=this._maxSize?this._deleteFirstKey():++this._size,this._keysQueue.push([t,i,r]),o=new d.b(e.text,e.bold,e.italic,e.font,e.fontSize,e.align),n.set(i,o)),o},t.prototype._deleteFirstKey=function(){var e=this._keysQueue.shift(),t=e[0],i=e[1],r=this._map.get(t);r.delete(i),0===r.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 y})),i.d(t,"a",(function(){return g}));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,r=0,n=this._items;r0?0:-n,c=t>0?n: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),r=Math.max(e.max.x,t.max.x),n=Math.min(e.min.y,t.min.y),s=Math.max(e.max.y,t.max.y),a=new o.Point(i,n),l=new o.Point(r,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(r.__assign)({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 r=this._getTextCache(i);if(null!==r){var n,o=i.x,s=i.vertOffset,a=i.y+s+i.textVertOffset;n=i.style&&void 0!==i.style.textColor?i.style.textColor:this._textColor,r.paintTo(e,t,n,o,a,d.a.Center,s>0?d.c.Top:d.c.Bottom)}},e.prototype._drawWithOptimizations=function(e,t){for(var i,r,n=null,o=!1,s=0,a=this._items;sn?r.Std.nz(e)<=0?1:r.Std.nz(e)+1:r.Std.nz(e)>=0?-1:r.Std.nz(e)-1,this._context.new_var(e)}),this.main=function(e,t){this._context=e,this._input=t;var i=r.Std.close(this._context),n=this._context.new_var(i),o=this._input(0),s=this._input(1),a=this._input(2),l=r.Std.rsi(this.f_1(n,o,this._context),this.f_2(n,o,this._context)),c=this.f_3(n),u=r.Std.rsi(this.f_1(c,s,this._context),this.f_2(c,s,this._context)),h=this._context.new_var(r.Std.roc(n,1)),d=r.Std.percentrank(h,a);return[r.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:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:14,in_2:11}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Coppock Curve",shortDescription:"Coppock Curve",is_price_study:!1,inputs:[{id:"in_0",name:"WMA Length",defval:10,type:"integer",min:-1e12,max:5e3},{id:"in_1",name:"Long RoC Length",defval:14,type:"integer",min:1,max:4999},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:1,max:4999}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve"},constructor:function(){this.f_0=function(e,t){return e+t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),n=this._input(1),o=this._input(2),s=r.Std.close(this._context),a=this._context.new_var(s),l=r.Std.roc(a,n),c=this._context.new_var(s),u=r.Std.roc(c,o),h=this.f_0(l,u),d=this._context.new_var(h);return[r.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:40,visible:!0,color:"#800080"}},precision:4,inputs:{in_0:"AAPL",in_1:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Correlation 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),r.Std.period(this._context),r.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),n=(this._input(0),r.Std.period(this._context),r.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=r.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(n),h=this._context.new_var(c);return[r.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:"#800080"}},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),r.Std.period(this._context),r.Std.period(this._context)),this._context.new_sym(this._input(1),r.Std.period(this._context),r.Std.period(this._context)),this.period=this._input(2)},this.correlationLog=function(e,t,i,n){var o=r.Std.sma(e,i,n),s=r.Std.sma(t,i,n),a=n.new_var(e.get()*t.get());return(r.Std.sma(a,i,n)-o*s)/Math.sqrt(r.Std.variance2(e,o,i)*r.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 n=this._context.new_var(r.Std.close(this._context)),o=this._context.new_var(r.Std.log(n.get()/n.get(1))),s=this._context.new_var(this._context.symbol.time);this._context.select_sym(1);var a=this._context.new_var(r.Std.close(this._context)),l=this._context.new_var(r.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:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:21,in_1:!1}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"DPO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Detrended Price Oscillator",shortDescription:"DPO",is_price_study:!1,is_hidden_study:!1,id:"detrended_price_oscillator@tv-basicstudies-1",bands:[{id:"hline_0",name:"Zero",isHidden:!1}],inputs:[{id:"in_0",name:"Period",defval:21,type:"integer",min:1,max:1e12},{id:"in_1",name:"isCentered",defval:!1,type:"bool"}],scriptIdPart:"",name:"Detrended Price Oscillator"}, -constructor:function(){this.f_0=function(){var e=this._input(0),t=this._input(1),i=Math.floor(e/2+1),n=this._context.new_var(r.Std.close(this._context)),o=this._context.new_var(r.Std.sma(n,e,this._context)),s=this._context.new_var(r.Std.close(this._context)).get(i)-o,a=r.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:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"ADX",histogramBase:0,joinPoints:!1}},description:"Directional Movement",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 r.Std.and(r.Std.gt(e,t),r.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 r.Std.abs(e-t)/(r.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),n=this._input(1),o=r.Std.high(this._context),s=this._context.new_var(o),a=r.Std.change(s),l=r.Std.low(this._context),c=this._context.new_var(l),u=r.Std.change(c),h=this.f_0(u),d=r.Std.tr(this._context),p=this._context.new_var(d),f=r.Std.rma(p,i,this._context),_=this.f_1(a,h),m=this._context.new_var(_),y=r.Std.rma(m,i,this._context),g=this.f_2(y,f),v=r.Std.fixnan(g,this._context),S=this.f_1(h,a),b=this._context.new_var(S),w=r.Std.rma(b,i,this._context),P=this.f_2(w,f),C=r.Std.fixnan(P,this._context),x=this.f_3(v,C),T=this.f_4(v,C,x),L=this._context.new_var(T),I=r.Std.rma(L,n,this._context);return[v,C,this.f_5(I)]}}},{name:"Donchian Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"},{id:"plot_1", +constructor:function(){this.f_0=function(){var e=this._input(0),t=this._input(1),i=Math.floor(e/2+1),n=this._context.new_var(r.Std.close(this._context)),o=this._context.new_var(r.Std.sma(n,e,this._context)),s=this._context.new_var(r.Std.close(this._context)).get(i)-o,a=r.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:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"ADX",histogramBase:0,joinPoints:!1}},description:"Directional Movement",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 r.Std.and(r.Std.gt(e,t),r.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 r.Std.abs(e-t)/(r.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),n=this._input(1),o=r.Std.high(this._context),s=this._context.new_var(o),a=r.Std.change(s),l=r.Std.low(this._context),c=this._context.new_var(l),u=r.Std.change(c),h=this.f_0(u),d=r.Std.tr(this._context),p=this._context.new_var(d),f=r.Std.rma(p,i,this._context),_=this.f_1(a,h),m=this._context.new_var(_),y=r.Std.rma(m,i,this._context),g=this.f_2(y,f),v=r.Std.fixnan(g,this._context),b=this.f_1(h,a),S=this._context.new_var(b),w=r.Std.rma(S,i,this._context),P=this.f_2(w,f),C=r.Std.fixnan(P,this._context),x=this.f_3(v,C),T=this.f_4(v,C,x),L=this._context.new_var(T),I=r.Std.rma(L,n,this._context);return[v,C,this.f_5(I)]}}},{name:"Donchian Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"},{id:"plot_1", type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Lower",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Basis",histogramBase:0,joinPoints:!1}},description:"Donchian Channels",shortDescription:"DC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_0",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels"},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),n=r.Std.low(this._context),o=this._context.new_var(n),s=r.Std.lowest(o,i,this._context),a=r.Std.high(this._context),l=this._context.new_var(a),c=r.Std.highest(l,i,this._context);return[s,c,r.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:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double 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),n=r.Std.close(this._context),o=this._context.new_var(n),s=r.Std.ema(o,i,this._context),a=this._context.new_var(s),l=r.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:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:1e4,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Ease Of Movement",shortDescription:"EOM",is_price_study:!1,inputs:[{id:"in_0",name:"Divisor",defval:1e4,type:"integer",min:1,max:1e9},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement"},constructor:function(){this.f_0=function(e,t,i,r,n){return e*t*(i-r)/n},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),n=this._input(1),o=r.Std.hl2(this._context),s=this._context.new_var(o),a=r.Std.change(s),l=this.f_0(i,a,r.Std.high(this._context),r.Std.low(this._context),r.Std.volume(this._context)),c=this._context.new_var(l);return[r.Std.sma(c,n,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:35,visible:!0,color:"#800000"}},precision:4,bands:[{ color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"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),n=r.Std.close(this._context),o=this._context.new_var(n),s=r.Std.change(o),a=this.f_0(s,r.Std.volume(this._context)),l=this._context.new_var(a);return[r.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:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"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:r.Std.na()},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),n=this._input(1),o=r.Std.close(this._context),s=this._context.new_var(o),a=r.Std.ema(s,i,this._context),l=this._context.new_var(o),c=r.Std.ema(l,n,this._context),u=a,h=c,d=r.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:35,visible:!0,color:"#FF7F00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20,in_1:10,in_2: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(r.Std[this._input(4)](this._context)),n=r.Std.sma(i,this._input(0),this._context);return"Exponential"===this._input(3)?n=r.Std.ema(i,this._input(0),this._context):"Weighted"===this._input(3)&&(n=r.Std.wma(i,this._input(0),this._context)),[this.f_0(n,this._input(1)/100),n,this.f_1(n,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:35,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,n,o=this._context.new_var(r.Std.close(this._context)),s=0,a=0,l=0;l=0;n--)this.backColorers[n].applyBarStyle(e,t,r,i);return this.applyBarStyle(e,t,r,i),r},n.prototype.pushBackBarColorer=function(e){this.backColorers.push(e)},n.prototype.applyBarStyle=function(e,t,i){throw new Error("This function is supposed to be reimplemented in a subclass")},inherit(o,n),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,r,n){i.barColor=o.upColor(n)},o.prototype._applyAreaStyle=function(e,t,i,r,n){i.barColor=o.upColor(n)},o.prototype._applyBarStyle=function(e,t,i,r,n){var s=o.upColor(n),a=o.downColor(n),l=this.findBar(e,!1,r);if(n.barStyle.barColorsOnPrevClose.value()){var c=this.findPrevBar(e,!1,r);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,r,n){var s,a=o.upColor(n,t),l=o.downColor(n,t),c=n.candleStyle.borderUpColor?n.candleStyle.borderUpColor.value():n.candleStyle.borderColor.value(),u=n.candleStyle.borderDownColor?n.candleStyle.borderDownColor.value():n.candleStyle.borderColor.value(),h=n.candleStyle.wickUpColor?n.candleStyle.wickUpColor.value():n.candleStyle.wickColor.value(),d=n.candleStyle.wickDownColor?n.candleStyle.wickDownColor.value():n.candleStyle.wickColor.value(),p=this.findBar(e,!1,r);n.candleStyle.barColorsOnPrevClose.value()?s=this.findPrevBar(e,!1,r)[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,r,n){var s=o.upColor(n,t),a=o.downColor(n,t),l=n.hollowCandleStyle.borderUpColor?n.hollowCandleStyle.borderUpColor.value():n.hollowCandleStyle.borderColor.value(),c=n.hollowCandleStyle.borderDownColor?n.hollowCandleStyle.borderDownColor.value():n.hollowCandleStyle.borderColor.value(),u=n.hollowCandleStyle.wickUpColor?n.hollowCandleStyle.wickUpColor.value():n.hollowCandleStyle.wickColor.value(),h=n.hollowCandleStyle.wickDownColor?n.hollowCandleStyle.wickDownColor.value():n.hollowCandleStyle.wickColor.value(),d=this.findBar(e,!1,r);this.findPrevBar(e,!1,r)[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,r,n){ var s,a=o.upColor(n,t),l=o.downColor(n,t),c=n.haStyle.borderUpColor.value(),u=n.haStyle.borderDownColor.value(),h=n.haStyle.wickUpColor.value(),d=n.haStyle.wickDownColor.value(),p=this.findBar(e,t,r);n.haStyle.barColorsOnPrevClose.value()?s=this.findPrevBar(e,t,r)[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,r,n){var s=this.findBar(e,t,r),a=n.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(n,t):i.barColor=o.downColor(n,t)},o.prototype._applyHiLoStyle=function(e,t,i,r,n){i.barColor=o.upColor(n,t),i.barBorderColor=n.hiloStyle.borderColor.value()},o.prototype.applyBarStyle=function(e,t,i,r){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 n=this._series.properties();switch(n.style.value()){case TradingView.Series.STYLE_LINE:this._applyLineStyle(e,t,i,r,n);break;case TradingView.Series.STYLE_AREA:this._applyAreaStyle(e,t,i,r,n);break;case TradingView.Series.STYLE_BARS:this._applyBarStyle(e,t,i,r,n);break;case TradingView.Series.STYLE_CANDLES:this._applyCandleStyle(e,t,i,r,n);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._applyHollowCandleStyle(e,t,i,r,n);break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._applyHAStyle(e,t,i,r,n);break;case TradingView.Series.STYLE_BASELINE:this._applyBaseLineStyle(e,t,i,r,n);break;case TradingView.Series.STYLE_HILO:this._applyHiLoStyle(e,t,i,r,n)}return i},o.prototype.getSeriesBars=function(e){return e?this._series.nsBars():this._series.bars()},o.prototype._findBarFieldValue=function(e,t,i){var r=this.getSeriesBars(i).valueAt(e);if(null!==r)return r[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 n=this._series.bars()._search(e,r.Exact);return null!==n&&n>0?this._series.bars()._valueAt(n-1):[]},inherit(s,n),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=r.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=n.plots[this._plotIndex].palette,d=r.palettes[h],p=n.palettes[h].valToIndex?n.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},"3ClC":function(e,t,i){"use strict";i.r(t);var r=i("0YCj"),n=i.n(r),o=i("GVHu"),s=i("FVma"),a=i("cKqi"),l=i("0gbU"),c=i("TMWk"),u=i("8sOK"),h=i("mrSG"),d=function(e){function t(t,i,r,n){var o=e.call(this,t,i,r,n)||this;return o.properties().styles.vol_ma.visible.listeners().subscribe(o,(function(){return o.invalidateTitleCache()})),o}return Object(h.__extends)(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.__assign)(Object(h.__assign)({},e),{skippedInputs:["length"]}))},t}(o.Study);function p(e,t){return void 0===t&&(t="shift"),{studyConstructor:e,colorRotationMode:t}}i.d(t,"isStudy",(function(){return m})),i.d(t,"isStudyStrategy",(function(){return y})),i.d(t,"isStudyStub",(function(){return g})),i.d(t,"isFundamentalStudy",(function(){return v})),i.d(t,"isESDStudy",(function(){return S})),i.d(t,"isFundamentalStudyMetaInfo",(function(){return b})),i.d(t,"createStudy",(function(){return P})),i.d(t,"studyColorRotationMode",(function(){return C}));var f={study_PivotPointsStandard:p(s.study_PivotPointsStandard),study_Overlay:p(a.study_Overlay,"loop"),study_Compare:p(l.study_Compare,"loop"),study_Volume:p(d),study_ScriptWithDataOffset:p(c.study_ScriptWithDataOffset)};for(var _ in f)f.hasOwnProperty(_)&&(TradingView[_]=f[_].studyConstructor);function m(e){return e instanceof o.Study}function y(e){return!1}function g(e){return e instanceof u.StudyStub}function v(e){return e instanceof Fundamental}function S(e){return!1}function b(e){return"study_Internal$STD;Fund_"===w(e)}function w(e){var t="study_"+(e.classId||e.shortId);return t.startsWith("study_Internal$STD;Fund_")?"study_Internal$STD;Fund_":t}function P(e,t,i,r,n){var s=w(r),a=new(s in f?f[s].studyConstructor:o.Study)(e,t,i,r);return void 0!==n&&a.setId(n),a}function C(e){var t=w(e);return t in f?f[t].colorRotationMode:1!==e.plots.length?"shift":void 0===e.pine||n.a.isStandardPine(e.id)?"loop":"shift"}},"3UA0":function(e,t){e.exports.tzData={"America/New_York":{ +;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=n.plots[this._plotIndex].palette,d=r.palettes[h],p=n.palettes[h].valToIndex?n.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},"3ClC":function(e,t,i){"use strict";i.r(t);var r=i("0YCj"),n=i.n(r),o=i("GVHu"),s=i("FVma"),a=i("cKqi"),l=i("0gbU"),c=i("TMWk"),u=i("8sOK"),h=i("mrSG"),d=function(e){function t(t,i,r,n){var o=e.call(this,t,i,r,n)||this;return o.properties().styles.vol_ma.visible.listeners().subscribe(o,(function(){return o.invalidateTitleCache()})),o}return Object(h.__extends)(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.__assign)(Object(h.__assign)({},e),{skippedInputs:["length"]}))},t}(o.Study);function p(e,t){return void 0===t&&(t="shift"),{studyConstructor:e,colorRotationMode:t}}i.d(t,"isStudy",(function(){return m})),i.d(t,"isStudyStrategy",(function(){return y})),i.d(t,"isStudyStub",(function(){return g})),i.d(t,"isFundamentalStudy",(function(){return v})),i.d(t,"isESDStudy",(function(){return b})),i.d(t,"isFundamentalStudyMetaInfo",(function(){return S})),i.d(t,"createStudy",(function(){return P})),i.d(t,"studyColorRotationMode",(function(){return C}));var f={study_PivotPointsStandard:p(s.study_PivotPointsStandard),study_Overlay:p(a.study_Overlay,"loop"),study_Compare:p(l.study_Compare,"loop"),study_Volume:p(d),study_ScriptWithDataOffset:p(c.study_ScriptWithDataOffset)};for(var _ in f)f.hasOwnProperty(_)&&(TradingView[_]=f[_].studyConstructor);function m(e){return e instanceof o.Study}function y(e){return!1}function g(e){return e instanceof u.StudyStub}function v(e){return e instanceof Fundamental}function b(e){return!1}function S(e){return"study_Internal$STD;Fund_"===w(e)}function w(e){var t="study_"+(e.classId||e.shortId);return t.startsWith("study_Internal$STD;Fund_")?"study_Internal$STD;Fund_":t}function P(e,t,i,r,n){var s=w(r),a=new(s in f?f[s].studyConstructor:o.Study)(e,t,i,r);return void 0!==n&&a.setId(n),a}function C(e){var t=w(e);return t in f?f[t].colorRotationMode:1!==e.plots.length?"shift":void 0===e.pine||n.a.isStandardPine(e.id)?"loop":"shift"}},"3UA0":function(e,t){e.exports.tzData={"America/New_York":{ time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1536530400,-1523224800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-76941e4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3], offset:[-17762,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Los_Angeles":{ time:[-2717668378,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-769420800,-765410400,-687995940,-662680800,-620866800,-608162400,-589417200,-576108e3,-557967600,-544658400,-526518e3,-513208800,-495068400,-481759200,-463618800,-450309600,-431564400,-418255200,-400114800,-386805600,-368665200,-355356e3,-337215600,-323906400,-305766e3,-292456800,-273711600,-261007200,-242262e3,-226533600,-210812400,-195084e3,-179362800,-163634400,-147913200,-13158e4,-116463600,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Chicago":{ @@ -141,18 +141,18 @@ function t(t,i){var r=e.call(this)||this;return r._active=!1,r._source=t,r._data return r.customFormatters.timeFormatter?r.customFormatters.timeFormatter.format(e):this._formatStr.replace("%h",Object(r.numberToStringWithLeadingZero)(e.getUTCHours(),2)).replace("%m",Object(r.numberToStringWithLeadingZero)(e.getUTCMinutes(),2)).replace("%s",Object(r.numberToStringWithLeadingZero)(e.getUTCSeconds(),2))},e.prototype.formatLocal=function(e){return r.customFormatters.timeFormatter?r.customFormatters.timeFormatter.formatLocal?r.customFormatters.timeFormatter.formatLocal(e):r.customFormatters.timeFormatter.format(e):this._formatStr.replace("%h",Object(r.numberToStringWithLeadingZero)(e.getHours(),2)).replace("%m",Object(r.numberToStringWithLeadingZero)(e.getMinutes(),2)).replace("%s",Object(r.numberToStringWithLeadingZero)(e.getSeconds(),2))},e}()},"4miz":function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}));var r=function(){function e(e,t){this._visible=!0,this._title=e,this._value=t}return e.prototype.title=function(){return this._title},e.prototype.setTitle=function(e){this._title=e},e.prototype.text=function(){return this._value},e.prototype.value=function(){return this._value},e.prototype.setValue=function(e){this._value=e},e.prototype.visible=function(){return this._visible},e.prototype.setVisible=function(e){this._visible=e},e.prototype.color=function(){return this._color},e.prototype.setColor=function(e){this._color=e},e}(),n=function(){function e(){this._items=[],this._header="",this._title=""}return e.prototype.header=function(){return this._header},e.prototype.title=function(){return this._title},e.prototype.items=function(){return this._items},e.prototype.update=function(){},e}()},"4o++":function(e,t,i){"use strict";var r;i.r(t),i.d(t,"MagnetMode",(function(){return r})),function(e){e[e.WeakMagnet=0]="WeakMagnet",e[e.StrongMagnet=1]="StrongMagnet"}(r||(r={}))},"4u8j":function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("hayr").propertyPages,s=i("ytGH").LineToolWidthsProperty,a=window.t("Gann Fan");function l(e,t){this._constructor="LineToolGannFan";var n=t||l.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("ZJWf").GannFanPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe);for(var o=[],a=1;a<=l.LevelsCount;a++)o.push(this._properties.child("level"+a).child("linewidth"));this._widthsProperty=new s(o)}inherit(l,r),l.LevelsCount=9,l.prototype.levelsCount=function(){return l.LevelsCount},l.prototype.pointsCount=function(){return 2},l.prototype.translatedType=function(){return a},l.prototype.name=function(){return"Gann Fan"},l.prototype.processErase=function(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},l.prototype.getStylesPropertyPage=function(){return o.LineToolGannFanStylesPropertyPage},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("ASG6").GannFanDefinitionsViewModel}.bind(null,i)).catch(i.oe)}, l.createProperties=function(e){var t=new n("linetoolgannfan",e,!1,{range:[1,9]});return l._configureProperties(t),t},l._configureProperties=function(e){r._configureProperties(e)},t.LineToolGannFan=l},"5/lF":function(e,t,i){"use strict";i.r(t),i.d(t,"TrendLineStatsRenderer",(function(){return y}));var r=i("aO4+"),n=i("f6yo"),o=i("Eyy1"),s=i("qFKp"),a=i("qgcf"),l=i("VdBB"),c=i("jFln"),u=i("ogJP"),h=i("ikwP"),d=null;function p(e){var t=new Image;return t.width=_,t.height=_,t.src=e,t}var f={angle:{dark:p("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjQ5OTk5IDE1SDIuNjU3NzFMMy4wNjEwNCAxNC4yNjA2TDkuMDYxMDQgMy4yNjA1N0w5LjMwMDQ2IDIuODIxNjJMMTAuMTc4NCAzLjMwMDQ4TDkuOTM4OTMgMy43Mzk0Mkw3LjUxMzg1IDguMTg1NDJDMTAuNTYyMSA5LjY3MjA1IDEwLjk0NTEgMTIuNjI2MSAxMC45OTMxIDE0SDE0LjVIMTVWMTVIMTQuNUgzLjQ5OTk5Wk05Ljk5MTk3IDE0QzkuOTQyMzYgMTIuNzI1OSA5LjU4NjI5IDEwLjI4OCA3LjAzNDM1IDkuMDY0NDlMNC4zNDIyNiAxNEg5Ljk5MTk3WiIgZmlsbD0iI0Y4RjlGRCIvPgo8L3N2Zz4K"),light:p("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMy40OTk5OSAxNUgyLjY1NzcxTDMuMDYxMDQgMTQuMjYwNkw5LjA2MTA0IDMuMjYwNTdMOS4zMDA0NiAyLjgyMTYyTDEwLjE3ODQgMy4zMDA0OEw5LjkzODkzIDMuNzM5NDJMNy41MTM4NSA4LjE4NTQyQzEwLjU2MjEgOS42NzIwNSAxMC45NDUxIDEyLjYyNjEgMTAuOTkzMSAxNEgxNC41SDE1VjE1SDE0LjVIMy40OTk5OVpNOS45OTE5NyAxNEM5Ljk0MjM2IDEyLjcyNTkgOS41ODYyOSAxMC4yODggNy4wMzQzNSA5LjA2NDQ5TDQuMzQyMjYgMTRIOS45OTE5N1oiIGZpbGw9IiMyQTJFMzkiLz4NCjwvc3ZnPg0K")},barsRange:{dark:p("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMiAzVjMuNVY1SDFWNlYxM1YxNEgyVjE1LjVWMTZIM1YxNS41VjE0SDRWMTNWNlY1SDNWMy41VjNIMlpNOC4yMDcxMSA3LjVMNy44NTM1NSA3Ljg1MzU1TDYuNzA3MTEgOUgxMS4yOTI5TDEwLjE0NjQgNy44NTM1NUw5Ljc5Mjg5IDcuNUwxMC41IDYuNzkyODlMMTAuODUzNiA3LjE0NjQ1TDEyLjg1MzYgOS4xNDY0NUwxMy4yMDcxIDkuNUwxMi44NTM2IDkuODUzNTVMMTAuODUzNiAxMS44NTM2TDEwLjUgMTIuMjA3MUw5Ljc5Mjg5IDExLjVMMTAuMTQ2NCAxMS4xNDY0TDExLjI5MjkgMTBINi43MDcxMUw3Ljg1MzU1IDExLjE0NjRMOC4yMDcxMSAxMS41TDcuNSAxMi4yMDcxTDcuMTQ2NDUgMTEuODUzNkw1LjE0NjQ1IDkuODUzNTVMNC43OTI4OSA5LjVMNS4xNDY0NSA5LjE0NjQ1TDcuMTQ2NDUgNy4xNDY0NUw3LjUgNi43OTI4OUw4LjIwNzExIDcuNVpNMyA2SDJWMTNIM1Y2Wk0xNSAzLjVWM0gxNlYzLjVWNUgxN1Y2VjEzVjE0SDE2VjE1LjVWMTZIMTVWMTUuNVYxNEgxNFYxM1Y2VjVIMTVWMy41Wk0xNSA2SDE2VjEzSDE1VjZaIiBmaWxsPSIjRjhGOUZEIi8+DQo8L3N2Zz4NCg=="), light:p("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMiAzVjMuNVY1SDFWNlYxM1YxNEgyVjE1LjVWMTZIM1YxNS41VjE0SDRWMTNWNlY1SDNWMy41VjNIMlpNOC4yMDcxMSA3LjVMNy44NTM1NSA3Ljg1MzU1TDYuNzA3MTEgOUgxMS4yOTI5TDEwLjE0NjQgNy44NTM1NUw5Ljc5Mjg5IDcuNUwxMC41IDYuNzkyODlMMTAuODUzNiA3LjE0NjQ1TDEyLjg1MzYgOS4xNDY0NUwxMy4yMDcxIDkuNUwxMi44NTM2IDkuODUzNTVMMTAuODUzNiAxMS44NTM2TDEwLjUgMTIuMjA3MUw5Ljc5Mjg5IDExLjVMMTAuMTQ2NCAxMS4xNDY0TDExLjI5MjkgMTBINi43MDcxMUw3Ljg1MzU1IDExLjE0NjRMOC4yMDcxMSAxMS41TDcuNSAxMi4yMDcxTDcuMTQ2NDUgMTEuODUzNkw1LjE0NjQ1IDkuODUzNTVMNC43OTI4OSA5LjVMNS4xNDY0NSA5LjE0NjQ1TDcuMTQ2NDUgNy4xNDY0NUw3LjUgNi43OTI4OUw4LjIwNzExIDcuNVpNMyA2SDJWMTNIM1Y2Wk0xNSAzLjVWM0gxNlYzLjVWNUgxN1Y2VjEzVjE0SDE2VjE1LjVWMTZIMTVWMTUuNVYxNEgxNFYxM1Y2VjVIMTVWMy41Wk0xNSA2SDE2VjEzSDE1VjZaIiBmaWxsPSIjMkEyRTM5Ii8+DQo8L3N2Zz4NCg==")},priceRange:{dark:p("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMyAySDMuNUgxMy41SDE0VjNIMTMuNUgzLjVIM1YyWk04LjUgMy43OTI4OUw4Ljg1MzU1IDQuMTQ2NDVMMTAuODUzNiA2LjE0NjQ1TDExLjIwNzEgNi41TDEwLjUgNy4yMDcxMUwxMC4xNDY0IDYuODUzNTVMOSA1LjcwNzExVjEyLjI5MjlMMTAuMTQ2NCAxMS4xNDY0TDEwLjUgMTAuNzkyOUwxMS4yMDcxIDExLjVMMTAuODUzNiAxMS44NTM2TDguODUzNTUgMTMuODUzNkw4LjUgMTQuMjA3MUw4LjE0NjQ1IDEzLjg1MzZMNi4xNDY0NSAxMS44NTM2TDUuNzkyODkgMTEuNUw2LjUgMTAuNzkyOUw2Ljg1MzU1IDExLjE0NjRMOCAxMi4yOTI5VjUuNzA3MTFMNi44NTM1NSA2Ljg1MzU1TDYuNSA3LjIwNzExTDUuNzkyODkgNi41TDYuMTQ2NDUgNi4xNDY0NUw4LjE0NjQ1IDQuMTQ2NDVMOC41IDMuNzkyODlaTTMuNSAxNkgzVjE1SDMuNUgxMy41SDE0VjE2SDEzLjVIMy41WiIgZmlsbD0iI0Y4RjlGRCIvPg0KPC9zdmc+DQo="),light:p("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMyAySDMuNUgxMy41SDE0VjNIMTMuNUgzLjVIM1YyWk04LjUgMy43OTI4OUw4Ljg1MzU1IDQuMTQ2NDVMMTAuODUzNiA2LjE0NjQ1TDExLjIwNzEgNi41TDEwLjUgNy4yMDcxMUwxMC4xNDY0IDYuODUzNTVMOSA1LjcwNzExVjEyLjI5MjlMMTAuMTQ2NCAxMS4xNDY0TDEwLjUgMTAuNzkyOUwxMS4yMDcxIDExLjVMMTAuODUzNiAxMS44NTM2TDguODUzNTUgMTMuODUzNkw4LjUgMTQuMjA3MUw4LjE0NjQ1IDEzLjg1MzZMNi4xNDY0NSAxMS44NTM2TDUuNzkyODkgMTEuNUw2LjUgMTAuNzkyOUw2Ljg1MzU1IDExLjE0NjRMOCAxMi4yOTI5VjUuNzA3MTFMNi44NTM1NSA2Ljg1MzU1TDYuNSA3LjIwNzExTDUuNzkyODkgNi41TDYuMTQ2NDUgNi4xNDY0NUw4LjE0NjQ1IDQuMTQ2NDVMOC41IDMuNzkyODlaTTMuNSAxNkgzVjE1SDMuNUgxMy41SDE0VjE2SDEzLjVIMy41WiIgZmlsbD0iIzJBMkUzOSIvPg0KPC9zdmc+DQo=")}},_=18,m=new Map,y=function(){function e(e,t,i){this._fontSize=0,this._preRendered=!1,this._boundingBox=null,this._rect=null,this._padding=null,this._textPoint=null,this._textSizeCache=t,this._data=e,this._fontSize=e.fontSize?e.fontSize:12,this._lineSpacing=Object(u.isNumber)(this._data.lineSpacing)&&this._data.lineSpacing?this._data.lineSpacing:0, -e.lines=this._lines=Object(a.wordWrap)(e.text,this.fontStyle(),e.wordWrapWidth),this._hittest=i||new l.HitTestResult(l.HitTestResult.MOVEPOINT)}return e.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},e.prototype.draw=function(e){if(0===this._data.points.length)return{width:0};this._preRender();var t=this._fontSize+this._lineSpacing;e.textBaseline="top",e.font=this.fontStyle();var i=Object(o.ensureNotNull)(this._rect);if(this._rect){if("right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||!0!==this._data.doNotAlignText&&(e.textAlign="right"===this._data.horzAlign?"end":"center"),this._data.backgroundRoundRect?(Object(c.drawRoundRect)(e,i.x,i.y,i.w,i.h,this._data.backgroundRoundRect),e.fillStyle=this._data.backgroundColor,e.fill(),e.globalAlpha=1):(e.fillStyle=this._data.backgroundColor,e.fillRect(i.x,i.y,i.w,i.h),e.globalAlpha=1),!s.isIE&&this._data.icons)for(var r=0,n=Math.ceil((_-this._fontSize)/2),a=Object(o.ensureNotNull)(this._padding),l=0,u=this._data.icons;l=48&&e<=57}var c=function(){function e(){ -this.entries=[],this.firstDayOfWeek=r.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 r=0,n=h;r2)return a.logError("Only one `first day` specification expected @ session "+e),e;if(1===t.length)return e;var i=1,n=t[0].indexOf("-")>=0?NaN:parseInt(t[0]);return isNaN(n)&&(i=0,n=parseInt(t[1])),nr.SATURDAY?(a.logError("Unexpected day index @ session: "+e+"; day index "+n),e):(this.firstDayOfWeek=n,t[i])},e._parseDay=function(e){var t=parseInt(e.substring(0,4)),i=parseInt(e.substring(4,6)),r=parseInt(e.substring(6,8));return new s.a(t,i,r)},e._parseSessionEntry=function(t,i){var r=i.split("-");2!==r.length&&(a.logError("Bad sessions entry: "+i),r=["0000","0000"]);var n=0,o=r[0];if(o.includes("F")){var s=o.split("F");o=s[0],n=""!==s[1]?parseInt(s[1]):1}var l=0,c=r[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),n,l)},e._isCorrectSession=function(e){ +this.entries=[],this.firstDayOfWeek=r.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 r=0,n=h;r2)return a.logError("Only one `first day` specification expected @ session "+e),e;if(1===t.length)return e;var i=1,n=t[0].indexOf("-")>=0?NaN:parseInt(t[0]);return isNaN(n)&&(i=0,n=parseInt(t[1])),nr.SATURDAY?(a.logError("Unexpected day index @ session: "+e+"; day index "+n),e):(this.firstDayOfWeek=n,t[i])},e._parseDay=function(e){var t=parseInt(e.substring(0,4)),i=parseInt(e.substring(4,6)),r=parseInt(e.substring(6,8));return new s.a(t,i,r)},e._parseSessionEntry=function(t,i){var r=i.split("-");2!==r.length&&(a.logError("Bad sessions entry: "+i),r=["0000","0000"]);var n=0,o=r[0];if(o.includes("F")){var s=o.split("F");o=s[0],n=""!==s[1]?parseInt(s[1]):1}var l=0,c=r[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),n,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-=n*r.minutesPerDay),o>0&&(i-=o*r.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 y}));var u=[r.MONDAY,r.TUESDAY,r.WEDNESDAY,r.THURSDAY,r.FRIDAY],h=[r.SUNDAY,r.MONDAY,r.TUESDAY,r.WEDNESDAY,r.THURSDAY,r.FRIDAY,r.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+r.minutesPerDay*this.sessionStartDaysOffset()},e.prototype.startOffset=function(){return this._start},e.prototype.sessionStartDaysOffset=function(){return this._start>=0?0:this._start%r.minutesPerDay==0?-Math.ceil(this._start/r.minutesPerDay):-Math.floor(this._start/r.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 er?1:-1},e.prototype.contains=function(e){var t=60*r.get_hours(e)+r.get_minutes(e),i=r.get_day_of_week(e)-this._dayOfWeek;i>0&&(i-=7);var n=i*r.minutesPerDay+t;return n>=this._start&&n0&&(t-=n*r.minutesPerDay),o>0&&(i-=o*r.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,r=this._holidaySessions;ithis._entries.length-1||this._entries[t].dayOfWeek()!==e},e.prototype.isCalWeekEnd=function(e){var t=r.get_day_of_week(e);if(!this._isThereCorrections)return this.isWeekEnd(t);var i=s.a.fromCalendar(e),n=this._holidayAndCorrectionMap.get(i.toString());return void 0===n?this.isWeekEnd(t):0===n.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=r.get_timezone(this._timezone),i=new s.a(r.get_year(e),r.JANUARY,1),n=s.a.fromCalendar(e),o=0,a=this._selectHolidays(i,n),l=0;l0?1:-1;;){var c=s+l;if(c<0||c>=o.length||o[c].dayOfWeek()!==a)break;s=c}return new _(n.weekIndex,s,o)},e.prototype.getWeekIndex=function(e){if(!this._isThereCorrections)return 0;var t=r.get_day_of_week(e)-r.SUNDAY,i=r.get_timezone("Etc/UTC"),n=r.get_cal(i,r.get_year(e),r.get_month(e),r.get_day_of_month(e)-t);return Math.floor((n.getTime()+621672192e5)/1e3/86400/7)},e.prototype.correctTradingDay=function(e){var t=r.get_day_of_week(e),i=60*r.get_hours(e)+r.get_minutes(e),n=this.getWeekIndex(e),o=this.findSession(n,t,i,0),s=o.getEntry().dayOfWeek()-t+7*(o.weekIndex-n);return 0!==s&&r.add_date(e,s),e},e.prototype.alignToSessionStart=function(e,t){void 0===t&&(t=0) ;var i=r.get_day_of_week(e),n=60*r.get_hours(e)+r.get_minutes(e),o=this.getWeekIndex(e),s=this.findSession(o,i,n,t),a=s.getEntry(),l=a.dayOfWeek()-i+7*(s.weekIndex-o);0!==l&&r.add_date(e,l);var c=a.startOffset();return r.set_hms(e,c/60,c%60,0,0,r.get_timezone(this._timezone)),a.length()},e.prototype.businessDaysToCalendarDays=function(e,t){for(var i=this.getWeekIndex(e),n=r.get_day_of_week(e),o=0,s=0;sc);)a[l].dayOfWeek()=t)return o}i++,n=r.SUNDAY}return o},e.prototype.calendarDaysToBusinessDays=function(e,t){for(var i=this.getWeekIndex(e),n=r.get_day_of_week(e),o=0,s=0;oc);)a[l].dayOfWeek()=t)return s}i++,n=r.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]),n=t[t.length-1],o=r.clone(e),s=60*(n.startOffset()+n.length())-1,a=Math.floor(s/3600);return s-=3600*a,r.set_hms(o,a,s/60,s%60,0,r.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=r.get_timezone(this._timezone);t=this._entries.slice();for(var n=this._weekIndexToCalendar(e),o=this._weekIndexToCalendar(e+1),a=s.a.fromCalendar(n),l=s.a.fromCalendar(o),c=function(e){var n=e.day.toCalendar(i),o=r.get_day_of_week(n);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)&&r.add_date(t,7*c),!s.contains(t)){var h=a-o;u&&i<0&&(h=-(7-a+o)),r.add_date(t,h),o=r.get_day_of_week(t)}s.isOvernight()&&o===s.dayOfWeek()&&r.add_date(t,-s.sessionStartDaysOffset());var d=n(s),p=Math.floor(d/3600);return d-=3600*p,r.set_hms(t,p,d/60,d%60,0,r.get_timezone(this._timezone)),t},e.prototype._getEntriesForDay=function(e){var t=r.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=r.clone(e),n=t.startOffset();return r.set_hms(i,n/60,n%60,0,0,r.get_timezone(this._timezone)),i},e}()},"5rJj":function(e,t,i){"use strict";(function(t){var r=i("ogJP").isSameType,n=i("Ocx9").DefaultProperty,o=i("vADo");function s(e,t,i,r){this._map=Object.assign({},this._map,r),t&&(t=this.unpackLevels(t)),n.call(this,e,t,i),this.updateCollectibleProperty()}inherit(s,n),s.prototype.state=function(e,i){(e=e||[]).push("__collectibleLines");var r=t.prototype.state.call(this,e);return i?r:this.packLevels(r)},s.prototype.clone=function(){var e=this.state();this.__collectibleLines&&(e.__collectibleLines=this.__collectibleLines.state());for(var t=new s(this._defaultName,e),i=0;i=0&&!0!==n[t].func(e);t--);}function l(e){e.addEventListener("keypress",a,!1)}function c(e,t){var i={name:e,func:t},r=s(i.name);r>-1?n[r]=i:n.push(i)}function u(e){n.forEach((function(t,i){t.name===e&&n.splice(i,1)}))}function h(e,t){var i={name:e,func:t},r=s(i.name);r>-1&&n.splice(r,1),n.unshift(i)}function d(){return o?null:o=Object(r.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 r=i("mrSG"),n=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(t,e),t.prototype._drawItemShape=function(e,t,i){var r=t.pixelRatio,n=Math.max(1,Math.floor(r))%2?.5:0,o=this._lineWidth(t)%2?.5:0,s=Math.round(i.height/2*r);(n+s)%1!=o%1&&(s+=.5);var a=Math.round(i.x*r)+n,l=Math.round((i.y+i.vertOffset)*r)+n,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,r=Math.round(i/2),n=t.x-r,s=t.vertOffset,a=t.y+s-r,l=n,c=n+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}(n.a)},"6sst":function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayStudyPriceLineAxisView",(function(){return n}));var r=i("mrSG"),n=function(e){function t(t){var i=e.call(this)||this;return i._study=t,i}return Object(r.__extends)(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(){ +;this.__collectibleLines._childs.forEach((function(i){for(var r=e.__collectibleLines[i].value().split("."),n=e[r[0]],o=1;o=0&&!0!==n[t].func(e);t--);}function l(e){e.addEventListener("keypress",a,!1)}function c(e,t){var i={name:e,func:t},r=s(i.name);r>-1?n[r]=i:n.push(i)}function u(e){n.forEach((function(t,i){t.name===e&&n.splice(i,1)}))}function h(e,t){var i={name:e,func:t},r=s(i.name);r>-1&&n.splice(r,1),n.unshift(i)}function d(){return o?null:o=Object(r.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 r=i("mrSG"),n=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(t,e),t.prototype._drawItemShape=function(e,t,i){var r=t.pixelRatio,n=Math.max(1,Math.floor(r))%2?.5:0,o=this._lineWidth(t)%2?.5:0,s=Math.round(i.height/2*r);(n+s)%1!=o%1&&(s+=.5);var a=Math.round(i.x*r)+n,l=Math.round((i.y+i.vertOffset)*r)+n,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,r=Math.round(i/2),n=t.x-r,s=t.vertOffset,a=t.y+s-r,l=n,c=n+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}(n.a)},"6sst":function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayStudyPriceLineAxisView",(function(){return n}));var r=i("mrSG"),n=function(e){function t(t){var i=e.call(this)||this;return i._study=t,i}return Object(r.__extends)(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 r=function(){function e(e,t){for(var i=0;i2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.hasOwnProperty("text")){var s=r&&(0,n.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=r&&(0,n.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 r=document.createElement("dl");r.appendChild(d(e,document.createElement("dt"))),t.appendChild(r),e.hasOwnProperty("listItem")&&r.classList.add("list-item")}}function f(e,t){var i=(0,n.forceLTRStr)(e.text);e.attr=e.attr||{};var r=document.createElement("a");o.attr(r,"href",e.href),o.addClass(r,e.class),o.attr(r,e.attr.name,e.attr.value),o.html(r,i),t.appendChild(r)}function _(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("string"==typeof e){var r=(0,n.forceLTRStr)(e),s=document.createElement("h2");o.html(s,r),t.appendChild(s)}else if(e.hasOwnProperty("lines"))for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},i=t.direction,r=void 0===i?"top":i,n=t.clickable,o=void 0!==n&&n,s=t.width;l(this,e),this._direction=r,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 r(e,[{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.items,i=void 0===t?[]:t,r=e.x,n=void 0===r?0:r,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),y=o.contentHeight(c),g=!1,v=!1;if(this._tooltipShown||(c.appendChild(this._tooltip),this._tooltipShown=!0,g=!0,v=!0),n===this._tooltipX&&a===this._tooltipY||(g=!0),g){var S=Math.max(Math.min(n-this._width/2,m-this._width-10),0);this._tooltip.style.left=Math.round(S)+"px",this._tooltip.style.bottom=Math.round(y-a+10)+"px"}if(this._tooltipItems||(v=!0),!v)for(var b=i.length;b--;)if(this._tooltipItems[b]!==i[b]){v=!0;break}if(v){var w=void 0;if(i.length<=1)w=i;else{for(var P={},C=i.length;C--;){var x=i[C].importance;null==x&&(x=-1),P[x]||(P[x]=[]),P[x].push(i[C])}var T=Object.keys(P).sort((function(e,t){return e-t}));if(T.length<=1)w=P[T[0]];else{w=[];for(var L=T.length;L--;)for(var I=P[T[L]],M=I.length;M--;)w.push(I[M])}}this._tooltipContent.innerHTML="";for(var O=w.length;O--;){var A=w[O],k="" +var d=document.createElement("dl");d.classList.add("tv-chart-events-tooltip-date");var _=document.createElement("dd");o.html(_,c(e.timestamp,i)||"—"),d.appendChild(_),t.appendChild(d)}var m=document.createElement("table");m.classList.add("tv-chart-events-table");var y=document.createElement("tr"),g=document.createElement("tr");m.appendChild(y),m.appendChild(g);var v=document.createElement("th");v.textContent=window.t("Actual"),y.appendChild(v);var b=document.createElement("th");b.textContent=window.t("Forecast"),y.appendChild(b);var S=document.createElement("th");S.textContent=window.t("Previous"),y.appendChild(S);var w=document.createElement("td"),P=e.actual&&(0,n.forceLTRStr)(e.actual);o.html(w,P||"—"),g.appendChild(w);var C=document.createElement("td"),x=e.forecast&&(0,n.forceLTRStr)(e.forecast);o.html(C,x||"—"),g.appendChild(C);var T=document.createElement("td"),L=e.previous&&(0,n.forceLTRStr)(e.previous);o.html(T,L||"—"),g.appendChild(T),t.appendChild(m)}}t.Tooltip=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.direction,r=void 0===i?"top":i,n=t.clickable,o=void 0!==n&&n,s=t.width;l(this,e),this._direction=r,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 r(e,[{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.items,i=void 0===t?[]:t,r=e.x,n=void 0===r?0:r,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),y=o.contentHeight(c),g=!1,v=!1;if(this._tooltipShown||(c.appendChild(this._tooltip),this._tooltipShown=!0,g=!0,v=!0),n===this._tooltipX&&a===this._tooltipY||(g=!0),g){var b=Math.max(Math.min(n-this._width/2,m-this._width-10),0);this._tooltip.style.left=Math.round(b)+"px",this._tooltip.style.bottom=Math.round(y-a+10)+"px"}if(this._tooltipItems||(v=!0),!v)for(var S=i.length;S--;)if(this._tooltipItems[S]!==i[S]){v=!0;break}if(v){var w=void 0;if(i.length<=1)w=i;else{for(var P={},C=i.length;C--;){var x=i[C].importance;null==x&&(x=-1),P[x]||(P[x]=[]),P[x].push(i[C])}var T=Object.keys(P).sort((function(e,t){return e-t}));if(T.length<=1)w=P[T[0]];else{w=[];for(var L=T.length;L--;)for(var I=P[T[L]],M=I.length;M--;)w.push(I[M])}}this._tooltipContent.innerHTML="";for(var O=w.length;O--;){var A=w[O],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 D=document.createElement("div");o.attr(D,"class",E),f&&(D.style.borderLeftColor=f),_(A,D,d),this._tooltipContent.appendChild(D)}this._tooltipItems=i}"bottom"===this._direction&&(this._tooltip.style.bottom=Math.round(y-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 r=i("Ss5c").LineDataSource,n=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),this._constructor="LineToolExecution";var n=t||u.createProperties();this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0},r.call(this,e,n),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.orderedSources(),r=0;rf.lastBar()||i=0;--m){var y=_[m];if(y instanceof u&&y._adapter._index===i&&y._adapter.getDirection()===n){if(y===e._line)break;var g=y._adapter._height();r=o?r+g:r-g}}return{x:t.indexToCoordinate(i),y:r}},c.prototype._height=function(){var e=this.getArrowHeight(),t=this.getArrowSpacing();this.getText()&&n.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){var t=this._line._model.mainSeries();return this._unixtime=ChartApiInstance.alignTimePoint?ChartApiInstance.alignTimePoint(e,t.interval(),t.symbolInfo()):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 n.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)},c.prototype.setTextColor=function(e){return n.setColorToProperties(e,this._line.properties().textColor,this._line.properties().textTransparency),this},c.prototype.getFont=function(){return n.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)},c.prototype.setFont=function(e){return n.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,r),u.prototype.zorder=function(){return a},u.POINTS_COUNT=1,u.prototype.pointsCount=function(){return u.POINTS_COUNT},u.prototype.translatedType=function(){return"Execution"},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()?r.prototype.updateAllViews.call(this):null},u.prototype.priceAxisViews=function(e,t){return this._isVisible()?r.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()?r.prototype.paneViews.call(this):null},u.prototype.userEditEnabled=function(){return!1},u.prototype.showInObjectTree=function(){return!1},u.prototype.getInputsPropertyPage=function(){return null},u.prototype.cloneable=function(){return!1},u.prototype.copiable=function(){return!1},u.createProperties=function(e){var t=new o("linetoolexecution",e,!1,!1);return u._configureProperties(t),t},u._configureProperties=function(e){r._configureProperties(e)},t.ExecutionsPositionController=l,t.LineToolExecution=u}).call(this,i("Kxc7"))},"7Fue":function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return s}));var r=i("mrSG"),n=["horizlines","vertlines","lines","hlines","textmarks","shapemarks","backgrounds","polygons","trendchannels","hhists","dwglabels","dwglines"];function o(e){return!n.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 n=Object(r.__assign)(Object(r.__assign)({},e),{styleId:i}),o=e.firstBarTime,s=t.get(o);void 0===s&&(s=new Set,t.set(o,s)),s.add(n)}))})),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 r=i("mrSG"),n=i("zRdu"),o=i("aIyQ"),s=i.n(o),a=i("/3z9"),l=i("0waE"),c=function(){function e(e,t){void 0===t&&(t=l.guid()),this.type=n.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}, @@ -160,24 +160,24 @@ e.prototype.isActive=function(){return!0===this._options.active},e.prototype.isC ;var r=i("ocLq"),n=function(){function e(){}return e.prototype.init=function(e,t){e.new_sym(t(1),r.Std.period(e),r.Std.period(e)),this._source=t(0),this._scaleFactor1=1,this._scaleFactor2=1},e.prototype.main=function(e,t){var i=e.symbol.time,n=r.Std[this._source](e);e.select_sym(1);var o=r.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,n,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 a}));var r=i("mrSG"),n=i("fgLi"),o=i("aIyQ"),s=i.n(o),a=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._metaInfo=null,i._priceStep=null,i._model=t,i}return Object(r.__extends)(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}(n.DataSource)},"7nsU":function(e,t,i){"use strict";i.r(t),i.d(t,"showConfirmInputsDialog",(function(){return r}));i("YFKU");function r(e,t,r,n,o){void 0===o&&(o="default"),Promise.all([i.e("react"),i.e(2),i.e(3),i.e(4),i.e(6),i.e(7),i.e(8),i.e(9),i.e(11),i.e(16),i.e(20),i.e(24),i.e(28),i.e(56),i.e(90),i.e(0),i.e(1),i.e(5),i.e(13),i.e(17),i.e(18),i.e(19),i.e(27),i.e(50),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,r,n);return s.show(),s}))}},"7qI1":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolRectangle",(function(){return h}));var r=i("mrSG"),n=i("YFKU"),o=i("hayr"),s=i("Ocx9"),a=i("tc+8"),l=i.n(a),c=i("Ss5c"),u=Object(n.t)("Rectangle"),h=function(e){function t(r,n){var o=this,s=n||t.createProperties() ;return(o=e.call(this,r,s)||this)._constructor="LineToolRectangle",i.e("lt-pane-views").then(function(e){var t=[new(0,i("GW0y").RectanglePaneView)(o,r)];o._setPaneViews(t)}.bind(null,i)).catch(void 0),o}return Object(r.__extends)(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.prototype.translatedType=function(){return u},t.prototype.name=function(){return"Rectangle"},t.prototype.setPoint=function(t,i,r){if(t<2)e.prototype.setPoint.call(this,t,i,r);else{if(r&&r.shift()&&this.properties().childs().snapTo45Degrees){var n=this.points()[0],o=this.points()[1],s={price:2===t?n.price:o.price,index:2===t?o.index:n.index};this._snapPoint45Degree(i,s)}3===t?(this._points[0].price=i.price,this._points[1].index=i.index):(this._points[1].price=i.price,this._points[0].index=i.index),this.normalizePoints()}},t.prototype.getStylesPropertyPage=function(){return o.propertyPages.LineToolRectangleStylesPropertyPage},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 s.DefaultProperty("linetoolrectangle",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),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._configureProperties=function(e){c.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new l.a("")),e.addExclusion("text")},t}(c.LineDataSource)},"7qT/":function(e,t,i){"use strict";function r(e,t){return 100*(t-e)/Math.abs(e)}i.d(t,"a",(function(){return r}))},"8C8C":function(e,t,i){"use strict";i.r(t),i.d(t,"RestoreFactoryDefaultsUndoCommand",(function(){return n}));var r=i("mrSG"),n=function(e){function t(t,i,r){void 0===r&&(r="Restore Defaults");var n=e.call(this,r)||this;return n._chartModel=t,n._defaultProperty=i,n._state=i.state(),n}return Object(r.__extends)(t,e),t.prototype.redo=function(){this._chartModel.restoreFactoryDefaults(this._defaultProperty)},t.prototype.undo=function(){this._defaultProperty.mergeAndFire(this._state),this._chartModel.mainSeries().onChartStyleChanged()},t}(i("RDU5").UndoCommand)},"8OdW":function(e,t,i){"use strict";i.r(t),i.d(t,"MINUTE_SPAN",(function(){return r})),i.d(t,"HOUR_SPAN",(function(){return n})),i.d(t,"DAY_SPAN",(function(){return o})),i.d(t,"WEEK_SPAN",(function(){return s})),i.d(t,"MONTH_SPAN",(function(){return a})),i.d(t,"YEAR_SPAN",(function(){return l})),i.d(t,"DEFAULT_BAR_SPACING",(function(){return c}));var r=20,n=30,o=40,s=50,a=60,l=70,c=6},"8Uy/":function(e,t,i){"use strict";i.r(t),i.d(t,"LINESTYLE_SOLID",(function(){return r})),i.d(t,"LINESTYLE_DOTTED",(function(){return n})),i.d(t,"LINESTYLE_DASHED",(function(){return o})),i.d(t,"LINESTYLE_LARGE_DASHED",(function(){ return s})),i.d(t,"LINESTYLE_SPARSE_DOTTED",(function(){return a})),i.d(t,"LINESTYLE_SMALL_DASHED",(function(){return l}));var r=0,n=1,o=2,s=3,a=4,l=5},"8aff":function(e,t,i){"use strict";i.r(t),i.d(t,"CompareStudyPriceAxisView",(function(){return o}));var r=i("mrSG"),n=i("oXaB"),o=function(e){function t(t,i){var r=e.call(this)||this;return r._studyCompare=t,r._data=i,r}return Object(r.__extends)(t,e),t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var r=this._studyCompare.lastValueData(this._data.plotIndex,!1);if(!r.noData){i.background=r.color,i.color=this.generateTextColor(r.color),i.coordinate=r.coordinate,i.floatCoordinate=r.floatCoordinate;var o=this._studyCompare.model().properties().scalesProperties;o.showSeriesLastValue.value()&&(e.text=this._axisText(r),e.visible=!0),t.text="",(o.showSymbolLabels.value()||o.seriesLastValueMode.value()===n.PriceAxisLastValueMode.LastPriceAndPercentageValue)&&(t.text=this._paneText(r),t.visible=t.text.length>0)}},t.prototype._paneText=function(e){var t="",i=this._studyCompare.model().properties().scalesProperties;i.showSymbolLabels.value()&&(t+=this._studyCompare.symbol()+" ");var r=this._studyCompare.priceScale();return null!==r&&i.showSeriesLastValue.value()&&i.seriesLastValueMode.value()===n.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()!==n.PriceAxisLastValueMode.LastPriceAndPercentageValue||null===i?e.text:i.isPercentage()?e.formattedPricePercentage:e.formattedPriceAbsolute},t}(i("KcY8").a)},"8gnj":function(e,t,i){"use strict";(function(t){var r=i("ESp1").HeikenAshi,n=i("LxhU").Interval,o=function(){var e=i("ocLq"),o=i("IiTo"),s=e.Symbol,a=e.StudyEngine,l=e.BarBuilder,c=e.BarSet;function u(e){this.host=e,this.cache={}}function h(e){var t=e.indexOf(",");return-1===t?e:e.slice(0,t)}function d(e){return e.has_empty_bars||e.force_session_rebuild}function p(e){return"string"==typeof e&&"="===e[0]}function f(e){if(!p(e))return{symbol:e};var t;try{t=JSON.parse(e.slice(1))}catch(i){return{symbol:e}}return t.type&&(0===t.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?t.builder=new r:console.error("unknown builder type: "+t.type)),"string"!=typeof t.symbol&&(t.session=t.symbol.session||t.session,t.currencyCode=t.symbol.currencyCode||t.currencyCode,t.symbol=t.symbol.symbol),t}u.prototype.getCache=function(e){return this.cache[e]},u.prototype.putCache=function(e,t){this.cache[e]=t},u.prototype.subscribe=function(e,t,i,r,n,o,s,a,l,c,u){var h=function(e,t,i,r,n,o,s,a){var l=d(n)?"_":"";return o+e+i+(t||"")+r+l+s+"_"+a}(e,t,i,r,a,l,n,u),p=this.getCache(h);return p||(p=this.createItem(e,t,i,r,a,c,l,n,u),this.putCache(h,p)),p.listeners.addListener(o,s),{key:h,listener:o}},u.prototype.unsubscribe=function(e){var t=this.getCache(e.key);t&&t.listeners.removeListener(e.listener)}, -u.prototype.removeUnused=function(){var e=[];for(var t in this.cache){if(this.cache[t])0===this.cache[t].listeners.listenersCount()&&e.push(t)}if(0!==e.length){for(var i=0;i=0;l--){var c=+a[l];if(o%c==0)return c+(r.isSeconds?"S":"")}return""}return o+(r.isSeconds?"S":"")},u.prototype.createItem=function(e,t,i,r,o,s,a,c,u){var p=new y,g=f(e);if(t=g.currencyCode||t,g.builder)return new m(p,g.symbol,t,i,r,g.builder,o,s,a);var v=h(i),S=this.rebuildFrom(v,h(r),o),b=d(o);if(!n.isEqual(v,S)||b){var w=o.has_empty_bars,P=Object.assign({},o);return b&&(P.has_empty_bars=!1,P.force_session_rebuild=!1),new m(p,g.symbol,t,i,S,new l(i,w),P,s,a,c,u)}var C=g.session&&"extended"!==g.session,x={currency:t};return new _(p,g.symbol,x,i,r,C,this.host,o,s,c,u)};var _=function(e,t,i,r,n,o,s,a,l,c,u){this.listeners=e,this.host=s;var d=this;this.host.resolve(t,i,(function(e){o&&e.regular_session&&(e.session=e.regular_session);var i=d.calculateFromTo(e,c||n||r,t,l,u);d.subs=d.host.subscribe(e,h(r),i,(function(e){d.listeners.fire(e)}),(function(e){d.listeners.onError(e)}))}),(function(e){d.listeners.onError(e)}))};_.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)},_.prototype.calculateFromTo=function(e,i,r,n,a){var l,c,u,h=s.parsePeriod(i),d=(new Date).valueOf(),p=e.expired&&t.cal_to_utc(t.get_timezone(e.timezone),new Date(1e3*e.expiration_date))||d;if(""===h.resolution)c=h.interval,u="D";else if("S"===h.resolution)c=10*h.interval,u="";else{c=12*("D"===h.resolution?1:"W"===h.resolution?5:30)*h.interval,u="M"}if(h.range)c=h.range.interval,u=h.range.resolution;else if(this.host.calculateHistoryDepth){var f=this.host.calculateHistoryDepth(i,u,c);f&&(c=f.intervalBack||c,u=void 0===f.resolutionBack?u:f.resolutionBack)}var _=e.sessionString||e.session;if(l=o.alignPeriodsBack(_,e.holidays,e.corrections,u,c,1,p),n&&n.getRangeExtensionTime){var m=n.getRangeExtensionTime();m&&(l=Math.min(1e3*m,l))}var y=Math.ceil(1.5*a);return n&&n.getRangeExtensionCount&&(y+=n.getRangeExtensionCount()),y>0&&(l=o.alignPeriodsBack(_,e.holidays,e.corrections,h.resolution,h.interval,y,l)),{from:l,to:p+6e4}};var m=function(e,t,i,r,n,o,s,l,c,u,h){if(this.listeners=e,this.isRecalculated=!1,""===n)return console.error("unsupported resolution for rebuild: "+r),void this.listeners.onError("unsupported resolution for rebuild: "+r);this.symbolInfo=s +u.prototype.removeUnused=function(){var e=[];for(var t in this.cache){if(this.cache[t])0===this.cache[t].listeners.listenersCount()&&e.push(t)}if(0!==e.length){for(var i=0;i=0;l--){var c=+a[l];if(o%c==0)return c+(r.isSeconds?"S":"")}return""}return o+(r.isSeconds?"S":"")},u.prototype.createItem=function(e,t,i,r,o,s,a,c,u){var p=new y,g=f(e);if(t=g.currencyCode||t,g.builder)return new m(p,g.symbol,t,i,r,g.builder,o,s,a);var v=h(i),b=this.rebuildFrom(v,h(r),o),S=d(o);if(!n.isEqual(v,b)||S){var w=o.has_empty_bars,P=Object.assign({},o);return S&&(P.has_empty_bars=!1,P.force_session_rebuild=!1),new m(p,g.symbol,t,i,b,new l(i,w),P,s,a,c,u)}var C=g.session&&"extended"!==g.session,x={currency:t};return new _(p,g.symbol,x,i,r,C,this.host,o,s,c,u)};var _=function(e,t,i,r,n,o,s,a,l,c,u){this.listeners=e,this.host=s;var d=this;this.host.resolve(t,i,(function(e){o&&e.regular_session&&(e.session=e.regular_session);var i=d.calculateFromTo(e,c||n||r,t,l,u);d.subs=d.host.subscribe(e,h(r),i,(function(e){d.listeners.fire(e)}),(function(e){d.listeners.onError(e)}))}),(function(e){d.listeners.onError(e)}))};_.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)},_.prototype.calculateFromTo=function(e,i,r,n,a){var l,c,u,h=s.parsePeriod(i),d=(new Date).valueOf(),p=e.expired&&t.cal_to_utc(t.get_timezone(e.timezone),new Date(1e3*e.expiration_date))||d;if(""===h.resolution)c=h.interval,u="D";else if("S"===h.resolution)c=10*h.interval,u="";else{c=12*("D"===h.resolution?1:"W"===h.resolution?5:30)*h.interval,u="M"}if(h.range)c=h.range.interval,u=h.range.resolution;else if(this.host.calculateHistoryDepth){var f=this.host.calculateHistoryDepth(i,u,c);f&&(c=f.intervalBack||c,u=void 0===f.resolutionBack?u:f.resolutionBack)}var _=e.sessionString||e.session;if(l=o.alignPeriodsBack(_,e.holidays,e.corrections,u,c,1,p),n&&n.getRangeExtensionTime){var m=n.getRangeExtensionTime();m&&(l=Math.min(1e3*m,l))}var y=Math.ceil(1.5*a);return n&&n.getRangeExtensionCount&&(y+=n.getRangeExtensionCount()),y>0&&(l=o.alignPeriodsBack(_,e.holidays,e.corrections,h.resolution,h.interval,y,l)),{from:l,to:p+6e4}};var m=function(e,t,i,r,n,o,s,l,c,u,h){if(this.listeners=e,this.isRecalculated=!1,""===n)return console.error("unsupported resolution for rebuild: "+r),void this.listeners.onError("unsupported resolution for rebuild: "+r);this.symbolInfo=s ;var d=this;this.engine=new a({tickerid:t,currencyCode:i,period:n,periodBase:r,body:o,sessionId:c,symbolInfo:s,rangeExtension:l,periodForInitialRange:u,additionalBarsCount:h,recalc:function(e,t){d._recalc(t)},out:function(e,t){d._out(e,t)},nonseriesOut:function(e,t){d._nonseriesOut(e,t)},setNoMoreData:function(){d.barset&&(d.barset.endOfData=!0)},onErrorCallback:function(e){d.listeners.onError(e)}})};m.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},m.prototype._recalc=function(e){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new c(this.symbolInfo)),e&&(this.barset.nextTime=e.nextTime,this.barset.endOfData=e.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},m.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)},m.prototype._out=function(e,t){var i=t[0];if(!isNaN(i)){var r={time:i,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],updatetime:t[6]},n=t[7];this.barset||(this.barset=new c(e.info));var o=t[8];if(o instanceof Array)for(var s=0;s=1;--t){var r=this._ticker.slice(0,t);if(e(r)){this._root=r,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))},r(y,n),y.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},y.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},g.prototype.toString=function(){return this.value},r(v,m),v.prototype.isIncomplete=!0,v.prototype.incompleteSuggest=function(){if("'"!==this.value)return String("'")},r(S,y),S.prototype.isIncomplete=!0;var b=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 r,n=[];e:for(;r=b.exec(t);){for(var s=e.length;s--;)if(r[s+1]){if(e[s].ctor){var a=new e[s].ctor(r[s+1]);a._offset=r.index,n.push(a)}continue e}var l=new g(r[0]);l._offset=r.index,n.push(l)}if(i&&i.recover){var c;for(s=n.length;s--;){var u=n[s];if(u instanceof y||u instanceof m){if(void 0!==c){var h=new m(""),d=n.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 n}function P(e){ +;n.setVisible(n.visible()&&t)}},t}(i("it7y").StudyDataWindowView)},"8sOK":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyStub",(function(){return c}));var r=i("mrSG"),n=i("2kV1"),o=i("7ktv"),s=i("kcTO"),a=i("tc+8"),l=i.n(a),c=function(e){function t(t,i,r){var o=e.call(this,t)||this;o._priceStep=.01,o._status=window.t("compiling..."),o._formatter=new s.PriceFormatter(100),o._failed=!1,o._loading=!0,o._origState=i,o._title=r;return o._properties=new l.a({visible:!0}),o._statusView=new n.StudyStatusView(o,o._model.properties().scalesProperties.textColor),o._statusView.setText(o._title+" "+o._status),o}return Object(r.__extends)(t,e),t.prototype.properties=function(){return this._properties},t.prototype.statusView=function(){return this._statusView},t.prototype.legendView=function(){return null},t.prototype.state=function(e){return this._origState},t.prototype.setStatus=function(e){this._status=e,this._statusView.setText(this._title+" "+this._status)},t.prototype.formatter=function(){return this._formatter},t.prototype.title=function(){return this._title},t.prototype.titleInParts=function(){return[this._title,void 0]},t.prototype.isFailed=function(){return this._failed},t.prototype.isLoading=function(){return this._loading},t.prototype.setFailed=function(e){this._failed=e,this._failed&&(this._loading=!1)},t.prototype.start=function(){},t.prototype.status=function(){return this._status},t.prototype.firstValue=function(){return null},t.prototype.currency=function(){return null},t.prototype.symbolSource=function(){return this._model.mainSeries()},t}(o.PriceDataSource)},"8woN":function(e,t,i){"use strict";(function(t){var i=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}],r=function(){var e=[{pattern:"(",ctor:s},{pattern:")",ctor:a},{pattern:"+",ctor:c},{pattern:"-",ctor:u},{pattern:"*",ctor:h},{pattern:"/",ctor:d},{pattern:"^",ctor:p},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:y},{pattern:/\./,ctor:b},{pattern:t.enabled("charting_library_base")?/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:\.&]*|'.+?'/:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:\.&]*|'.+?'/,ctor:m},{pattern:/'[^']*/,ctor:v},{pattern:/[\0-\x20\s]+/,ctor:o}];function r(e,t){var i=function(){};return i.prototype=t.prototype,e.prototype=new i,e}function n(){}function o(e){this.value=e}function s(){}function a(){}function l(){}function c(){}function u(){}function h(){}function d(){}function p(){}n.prototype.toString=function(){return this.value},r(o,n),r(s,n),s.prototype.value="(",r(a,n),a.prototype.value=")",r(l,n),r(c,l),c.prototype.value="+",c.prototype.precedence=0,c.prototype.commutative=!0,r(u,l),u.prototype.value="-", +u.prototype.precedence=0,u.prototype.commutative=!1,r(h,l),h.prototype.value="*",h.prototype.precedence=1,h.prototype.commutative=!0,r(d,l),d.prototype.value="/",d.prototype.precedence=1,d.prototype.commutative=!1,r(p,l),p.prototype.value="^",p.prototype.precedence=2,p.prototype.commutative=!1;var f=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,_=/[\+\-\/\*]/;function m(e){this.value=e}function y(e){this.value=e}function g(e){this.value=e}function v(){m.apply(this,arguments)}function b(){y.apply(this,arguments)}r(m,n),m.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var e=_.test(this._ticker)?"'":"";return e+(this._exchange?this._exchange+":":"")+this._ticker+e}return this.value},m.prototype.parse=function(){var e=f.exec(this.value);e[1]&&(this._exchange=e[1]),this._ticker=e[2]},m.prototype.parseAsFutures=function(){this.hasOwnProperty("_ticker")||this.parse();for(var e=function(e){return i.some((function(t){return t.t===e}))},t=2;t>=1;--t){var r=this._ticker.slice(0,t);if(e(r)){this._root=r,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))},r(y,n),y.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},y.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},g.prototype.toString=function(){return this.value},r(v,m),v.prototype.isIncomplete=!0,v.prototype.incompleteSuggest=function(){if("'"!==this.value)return String("'")},r(b,y),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 r,n=[];e:for(;r=S.exec(t);){for(var s=e.length;s--;)if(r[s+1]){if(e[s].ctor){var a=new e[s].ctor(r[s+1]);a._offset=r.index,n.push(a)}continue e}var l=new g(r[0]);l._offset=r.index,n.push(l)}if(i&&i.recover){var c;for(s=n.length;s--;){var u=n[s];if(u instanceof y||u instanceof m){if(void 0!==c){var h=new m(""),d=n.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 n}function P(e){ for(var t=[],i=0;io.precedence&&(r[r.length-1].minPrecedence=o.precedence);else if(o instanceof s)r.push(t={minPrecedence:1/0,openBraceIndex:n});else if(o instanceof a){var c=e[(t=r.pop()).openBraceIndex-1],u=e[n+1];u instanceof l&&!(u.precedence<=t.minPrecedence)||!(!(c instanceof l)||c.precedencet.minPrecedence&&(r[r.length-1].minPrecedence=t.minPrecedence))}}for(n=i.length;n--;)e.splice(i[n],1);return e}function x(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 T(e){return 1!==(e=x(e)).length?null:e[0]}function L(e,t){return(e=x(e)).some((function(e){return t.includes((e||"").toUpperCase())}))}function I(e){return e.join("")}return{tokenize:w,validate:function(e){if(t.enabled("charting_library_base"))return{currentState:"var"};for(var i="init",r={warnings:[],errors:[],isEmpty:!0},n=[],c=0;ct[t.length-1].time+i)return null;var r=t[Object(a.lowerbound)(t,e.x-i,(function(e,t){return e.timer.time+i)return null;var n=Object(l.selectionTolerance)(this._barWidth),o=Math.min(r.high,r.low),s=Math.max(r.high,r.low),u=this._data.fontSize;return o-n-u<=e.y&&e.y<=o+n||s-n<=e.y&&e.y<=s+n+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,r=0;r5},t.prototype._getLabelWidth=function(e){return this._widthsCache.measureText(this._context,e)},t}(s.SeriesBarCandlesPaneView)},"9QkW":function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("xUGI"),s=i("hayr").propertyPages,a=i("ytGH").LineToolWidthsProperty,l=window.t("Fib Wedge");function c(){o.call(this)}function u(e,t){this._constructor="LineToolFibSpeedResistanceArcs";var n=t||u.createProperties();r.call(this,e,n),e._fibWedgeLabelsCache||(e._fibWedgeLabelsCache=new c),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);for(var o=[this._properties.child("trendline").child("linewidth")],s=1;s<=u.LevelsCount;s++)o.push(this._properties.child("level"+s).child("linewidth"));this._widthsProperty=new a(o)}inherit(c,o),c.prototype.levelsCount=function(){return u.LevelsCount},inherit(u,r),u.LevelsCount=11,u.prototype.isSynchronizable=function(){return!1},u.prototype.levelsCount=function(){return u.LevelsCount},u.prototype.getCache=function(){return this._model._fibWedgeLabelsCache||(this._model._fibWedgeLabelsCache=new c),this._model._fibWedgeLabelsCache},u.prototype.pointsCount=function(){return 3},u.prototype.translatedType=function(){return l},u.prototype.name=function(){return"Fib Wedge"},u.prototype.hasEditableCoordinates=function(){return!1},u.prototype.setPoint=function(e,t){if(r.prototype.setPoint.call(this,e,t),!this._recursiveGuard){if(this._recursiveGuard=!0,2===e){var i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],o=(l=this.pointToScreenPoint(this._points[2])[0]).subtract(i).length(),s=n.subtract(i).normalized();n=i.add(s.scaled(o));var a=this.screenPointToPoint(n);this._properties.points[1].price.setValue(a.price),this._properties.points[1].bar.setValue(a.index)}else{i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0] -;var l=this.pointToScreenPoint(this._points[2])[0],c=n.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}},u.prototype.addPoint=function(e){if(2===this._points.length){var t=this.pointToScreenPoint(this._points[0])[0],i=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(e)[0],o=i.subtract(t).length(),s=n.subtract(t).normalized();n=t.add(s.scaled(o));var a=this.ownerSource().firstValue(),l=this.priceScale().coordinateToPrice(n.y,a);e={index:Math.round(this._model.timeScale().coordinateToIndex(n.x)),price:l}}return r.prototype.addPoint.call(this,e)},u.prototype.processErase=function(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},u.prototype.getInputsPropertyPage=function(){return null},u.prototype.getStylesPropertyPage=function(){return s.LineToolFibWedgeStylesPropertyPage},u.createProperties=function(e){var t=new n("linetoolfibwedge",e,!1,{range:[1,11]});return u._configureProperties(t),t},u.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("6mGk").FibWedgeDefinitionsViewModel}.bind(null,i)).catch(i.oe)},u._configureProperties=function(e){r._configureProperties(e)},t.LineToolFibWedge=u},"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 r,n,o=i("Eyy1"),s=i("23IT"),a=i("uOxu"),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,y=!p||"plot"===d?n.getPlotIdByTitle(e,h):null,g=f?n.getBandIndexByName(e,h):null,v=_?n.getFilledAreaIdByTitle(e,h):null,S=m?n.getInputByName(e,h):null,b=t.hasOwnProperty(h);if((null!==y?1:0)+(null!==g?1:0)+(null!==v?1:0)+(null!==S?1:0)+(b?1:0)>1)l.logWarn("Study '"+e.description+"' has ambiguous identifier '"+h+"'");else{var w=s[1];if(null!==y){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);r.applyPlotProperty(e,t,y,P,o)}else if(null!==S)r.applyInputValue(t,S,o);else if(null!==g){if(void 0===w)return void l.logWarn("Property name of '"+h+"' band for study '"+e.description+"' must be set");r.applyBandProperty(t,g,w,o)}else if(null!==v){if(void 0===w)return void l.logWarn("Property name of '"+h+"' area for study '"+e.description+"' must be set") -;r.applyFilledAreaProperty(t,v,w,o)}else b?r.setRootProperty(t,s,o):l.logWarn("Study '"+e.description+"' has no plot or input '"+h+"'")}}}function u(e,t){var i=e.properties(),r=i.state();for(var n in t)t.hasOwnProperty(n)&&c(e.metaInfo(),r,n,t[n]);i.mergeAndFire(r)}function h(e,t,i){for(var r in e)if(e.hasOwnProperty(r)){var o=r.indexOf(".");if(-1!==o){var s=r.substr(0,o),a=n.getMetaInfoByDescription(t,s);if(null!==a){var u=i(a);null!==u?c(a,u,r.substr(o+1),e[r]):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,r,n,a){if(void 0!==i.styles){var c=n[0];if("color"!==c){var u=i.styles[r];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,r,n){if(void 0!==e.styles)if(null===t&&!isNaN(r)&&r>0)l.logWarn("Study plot does not have color #"+r);else{if(0===r||isNaN(r))Object(o.ensureDefined)(e.styles[i]).color=String(n),r=0;null!==t&&(Object(o.ensureDefined)(t.colors[r]).color=String(n))}else l.logWarn("Study does not have styles")}(i,function(e,t,i){if(void 0===e.plots)return null;for(var r=0,n=e.plots;r1?parseInt(n[1]):NaN,a)}}else l.logWarn("Study does not have styles")},e.applyBandProperty=function(e,i,r,n){if(void 0!==e.bands){var o=e.bands[i];if(void 0!==o&&o.hasOwnProperty(r)){if("plottype"===r){var s=t[String(n)];if(void 0===s)return void l.logWarn("Unsupported plot type for band: "+n);n=s}o[r]=n}else l.logWarn("Study band does not have property '"+r+"'")}else l.logWarn("Study does not have bands")},e.applyFilledAreaProperty=function(e,t,i,r){if(void 0!==e.filledAreasStyle){var n=e.filledAreasStyle[t];void 0!==n&&n.hasOwnProperty(i)?n[i]=r: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 r=e,n=0,o=t.slice(0,-1);n=this.chartsCount())throw Error("Incorrect index: "+e);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[e])},S.prototype.getSymbolInterval=function(e){var t={symbol:n.symbol.value(),interval:n.interval.value()};return e&&e(t),t},S.prototype.saveChart=function(e){var t=this;this._saveChartService.whenReadyToSave((function(){var i=t._saveChartService.saveToJSON();return e&&e(JSON.parse(i.content))}))},S.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(),n.symbol.setValue(this.activeChart().symbol()),a.emit("chart_loaded")},S.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter((function(e){return!e.is_hidden_study})).map((function(e){return e.description}))},S.prototype.getSavedCharts=function(e){h.getCharts(e)},S.prototype.loadChartFromServer=function(e){h.loadChart(e)},S.prototype.saveChartToServer=function(e,t,i){this._saveChartService.saveChartSilently(e,t,i)},S.prototype.removeChartFromServer=function(e,t){h.removeChart(e,t)},S.prototype.getIntervals=function(){var e=[],t=u.getCustomResolutions();return null!==this._chartApiInstance&&(e=this._chartApiInstance.defaultResolutions()),u.mergeResolutions(e,t)},S.prototype.closePopupsAndDialogs=function(){for(var e=document.querySelectorAll("._tv-dialog-title-close"),t=0;t'},"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 r,n,o=i("Eyy1"),s=i("23IT"),a=i("uOxu"),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,y=!p||"plot"===d?n.getPlotIdByTitle(e,h):null,g=f?n.getBandIndexByName(e,h):null,v=_?n.getFilledAreaIdByTitle(e,h):null,b=m?n.getInputByName(e,h):null,S=t.hasOwnProperty(h);if((null!==y?1:0)+(null!==g?1:0)+(null!==v?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!==y){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);r.applyPlotProperty(e,t,y,P,o)}else if(null!==b)r.applyInputValue(t,b,o);else if(null!==g){if(void 0===w)return void l.logWarn("Property name of '"+h+"' band for study '"+e.description+"' must be set");r.applyBandProperty(t,g,w,o)}else if(null!==v){if(void 0===w)return void l.logWarn("Property name of '"+h+"' area for study '"+e.description+"' must be set") +;r.applyFilledAreaProperty(t,v,w,o)}else S?r.setRootProperty(t,s,o):l.logWarn("Study '"+e.description+"' has no plot or input '"+h+"'")}}}function u(e,t){var i=e.properties(),r=i.state();for(var n in t)t.hasOwnProperty(n)&&c(e.metaInfo(),r,n,t[n]);i.mergeAndFire(r)}function h(e,t,i){for(var r in e)if(e.hasOwnProperty(r)){var o=r.indexOf(".");if(-1!==o){var s=r.substr(0,o),a=n.getMetaInfoByDescription(t,s);if(null!==a){var u=i(a);null!==u?c(a,u,r.substr(o+1),e[r]):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,r,n,a){if(void 0!==i.styles){var c=n[0];if("color"!==c){var u=i.styles[r];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,r,n){if(void 0!==e.styles)if(null===t&&!isNaN(r)&&r>0)l.logWarn("Study plot does not have color #"+r);else{if(0===r||isNaN(r))Object(o.ensureDefined)(e.styles[i]).color=String(n),r=0;null!==t&&(Object(o.ensureDefined)(t.colors[r]).color=String(n))}else l.logWarn("Study does not have styles")}(i,function(e,t,i){if(void 0===e.plots)return null;for(var r=0,n=e.plots;r1?parseInt(n[1]):NaN,a)}}else l.logWarn("Study does not have styles")},e.applyBandProperty=function(e,i,r,n){if(void 0!==e.bands){var o=e.bands[i];if(void 0!==o&&o.hasOwnProperty(r)){if("plottype"===r){var s=t[String(n)];if(void 0===s)return void l.logWarn("Unsupported plot type for band: "+n);n=s}o[r]=n}else l.logWarn("Study band does not have property '"+r+"'")}else l.logWarn("Study does not have bands")},e.applyFilledAreaProperty=function(e,t,i,r){if(void 0!==e.filledAreasStyle){var n=e.filledAreasStyle[t];void 0!==n&&n.hasOwnProperty(i)?n[i]=r: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 r=e,n=0,o=t.slice(0,-1);n=this.chartsCount())throw Error("Incorrect index: "+e);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[e])},b.prototype.getSymbolInterval=function(e){var t={symbol:n.symbol.value(),interval:n.interval.value()};return e&&e(t),t},b.prototype.saveChart=function(e){var t=this;this._saveChartService.whenReadyToSave((function(){var i=t._saveChartService.saveToJSON();return e&&e(JSON.parse(i.content))}))},b.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(),n.symbol.setValue(this.activeChart().symbol()),a.emit("chart_loaded")},b.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter((function(e){return!e.is_hidden_study})).map((function(e){return e.description}))},b.prototype.getSavedCharts=function(e){h.getCharts(e)},b.prototype.loadChartFromServer=function(e){h.loadChart(e)},b.prototype.saveChartToServer=function(e,t,i){this._saveChartService.saveChartSilently(e,t,i)},b.prototype.removeChartFromServer=function(e,t){h.removeChart(e,t)},b.prototype.getIntervals=function(){var e=[],t=u.getCustomResolutions();return null!==this._chartApiInstance&&(e=this._chartApiInstance.defaultResolutions()),u.mergeResolutions(e,t)},b.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){ @@ -192,8 +192,8 @@ c.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all( var i=Object(n.ensureNotNull)(t.priceScale()),o=Object(n.ensureNotNull)(t.firstValue());return e.map((function(e){var t=e.price,n=i.priceToCoordinate(t,o)-40,s=i.coordinateToPrice(n,o);return Object(r.__assign)(Object(r.__assign)({},e),{price:s})}))}function y(e,t,i,r){var s=Object(n.ensureNotNull)(_(t.constructor)),a=t.properties().clone();a.visible.setValue(!0);var l=Object(n.ensureNotNull)(t.ownerSource()),u=c(s,e,a);void 0!==r&&u.setId(r),u.setOwnerSource(l);var h=t.fixedPoints();(i?h.map((function(e){return e.add(new o.Point(20,20))})):h).forEach((function(e){return u.addFixedPoint(e)}));var d=t.normalizedPoints(),p=i?m(d,l):d,f=t.points();return u.restorePoints(p,f),u.cloneData&&u.cloneData(t),u.checkAlert&&u.checkAlert(),u}i.d(t,"isLineToolName",(function(){return l.a})),i.d(t,"isStudyLineToolName",(function(){return l.b})),function(e){for(var t=0,i=Object.keys(e);t'},Daqx:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var r=["Z","Y","X","W","V","U","T","S"],n=["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?r:n;return new o(t=0&&o.setLastBarClosed(!1)}r(o)}}(e,i,o),s)},unsubscribe:function(e){return t._cachedDatafeed.unsubscribe(e)},calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth?this._externalDatafeed.calculateHistoryDepth.bind(this._externalDatafeed):void 0})};function y(e,t){null!=e.graphicsCmds&&null!=e.graphicsCmds.create&&null!=e.graphicsCmds.create.vertlines&&e.graphicsCmds.create.vertlines.forEach((function(e){e.data.forEach(t)}))}function g(e,t){for(var i=e.length,r=t.length,n=0,o=0;o=r?e[o]=t[r-1].index:e[o]=t[n].index}}m.createDWMAligner=function(e,t){return c.isDWM(e)?l.createAligner(e,t,!0):null},m.prototype._barsCoefficients=function(e,t){if(void 0===o.parseSymbol(e).type)return{};var i=e+t;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},m.prototype.destroy=function(){this._cachedDatafeed.destroy(),this._externalDatafeed=null,this._pointsetsManager.pointsetsCreated().unsubscribeAll(this)},m.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={},this._sessionsLastDataCache={},this._studiesCache={}},m.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},m.prototype._logMessage=function(e){t.enabled("charting_library_debug_mode")&&console.log(e)},m.prototype._extendRange=function(e,t){this._rangeExtensionData[e]||this.purgeRangeExtensionData(e),void 0===this._rangeExtensionData[e].summary&&(this._rangeExtensionData[e].summary=0),this._rangeExtensionData[e].summary+=t},m.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},m.prototype._fireEvent=function(e,t,i){if(this._callbacks.hasOwnProperty(e)){for(var r=this._callbacks[e],n=0;nm[a].value[0];l?m.push({index:_(r),value:[r].concat(n)}):m[a].value=[r].concat(n),p||u([m[m.length-1]],l,m.length,y,i)}(e,t,l)}, -nonseriesOut:function(e,t){d(t,l)},setNoMoreData:function(){v=!0},recalc:function(e,i){p=!1,m.endOfData=v,t.error&&null!==t.error()||c(m,g>0?y:void 0,l,i)}});if(!S._studiesCache[e]||!S._studiesCache[e][o])throw Error("This should never happen");S._studiesCache[e][o].engine=f}catch(b){if(!b.studyError)throw b;h(b.message)}else h("Unsupported resolution. Did you forget to set has_intraday to true?")},w=function(e){h(e)},P=function(){return S._studiesCache[e]&&S._studiesCache[e][o]&&S._studiesCache[e][o].activeResolve===f};S._studiesCache[e][o].activeResolve=f,this.resolveSymbol(i,(function(){P()&&b.apply(S,arguments)}),(function(){P()&&w.apply(S,arguments)}))},m.prototype._createStudy=function(e,t,i,r,n,o,s){var a=this;function l(i,s,l){i=_(i),TradingView.ChartapiMessagerInstances[r].onDataUpdate(n,o,a._convertBarsTimeToUnix(i),s,l,a._extendedRange(e,t)),TradingView.ChartapiMessagerInstances[r].onStudyCompleted(n,o)}s=function(e){if(Array.isArray(e))return e;for(var t=[],i=a._studiesCache[r][n].metainfo.inputs,o=0;om[a].value[0];l?m.push({index:_(r),value:[r].concat(n)}):m[a].value=[r].concat(n),p||u([m[m.length-1]],l,m.length,y,i)}(e,t,l)}, +nonseriesOut:function(e,t){d(t,l)},setNoMoreData:function(){v=!0},recalc:function(e,i){p=!1,m.endOfData=v,t.error&&null!==t.error()||c(m,g>0?y:void 0,l,i)}});if(!b._studiesCache[e]||!b._studiesCache[e][o])throw Error("This should never happen");b._studiesCache[e][o].engine=f}catch(S){if(!S.studyError)throw S;h(S.message)}else h("Unsupported resolution. Did you forget to set has_intraday to true?")},w=function(e){h(e)},P=function(){return b._studiesCache[e]&&b._studiesCache[e][o]&&b._studiesCache[e][o].activeResolve===f};b._studiesCache[e][o].activeResolve=f,this.resolveSymbol(i,(function(){P()&&S.apply(b,arguments)}),(function(){P()&&w.apply(b,arguments)}))},m.prototype._createStudy=function(e,t,i,r,n,o,s){var a=this;function l(i,s,l){i=_(i),TradingView.ChartapiMessagerInstances[r].onDataUpdate(n,o,a._convertBarsTimeToUnix(i),s,l,a._extendedRange(e,t)),TradingView.ChartapiMessagerInstances[r].onStudyCompleted(n,o)}s=function(e){if(Array.isArray(e))return e;for(var t=[],i=a._studiesCache[r][n].metainfo.inputs,o=0;o0?1e3*p[0].value[0]:void 0;if(c.nextTime&&(!f||c.nextTime=0&&l&&e.lastBar){for(var c=[],d=0;d<=a;d++)c.push(n+.001*d);var p=e.lastBar.slice(0);p[0]=p[0]/1e3,TradingView.ChartapiMessagerInstances[r].onTimescaleUpdate(o,s,[{index:l-1,value:p}],t,l-1,c);var f=l+a,_=1e3*Math.trunc(c[a]);h(t,f,_),u.rebuildExtrapolatedData(r,t.full_name,i,t,_)}u._updateProjectionData(r,o,s,e)}))},m.prototype.onMoreTickmarksRequested=function(e,t,i,r,n){this._extrapolationManager.storage(e,i.full_name,r).onTickmarksNeeded(i,n)},m.prototype.removePointset=function(e){this._pointsetsManager.removePointset(e)},m.prototype.rebuildExtrapolatedData=function(e,t,i,r,n){this._extrapolationManager.storage(e,r.full_name,i).rebuild(n,r)},m.prototype.createPointset=function(e,t,i,r,n,o){var s=this._extrapolationManager.storage(e,r.full_name,n);this._pointsetsManager.createPointset(t,i,o,s,r,e)},m.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},m.prototype.searchSymbols=function(e,t,i,r){this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(e,t,i));var n=this;this._externalDatafeed.searchSymbols(e,t,i,(function(e){n._logMessage("Symbol search response: {0}".format(JSON.stringify(e))),r(e)}))},m.prototype.resolveSymbol=function(e,t,i){o.isSymbolEncoded(e)||console.error("Expect to get symbol encoded string, but got the following instead: "+e);var r=o.parseSymbol(e),n={currency:r.currencyCode};this._resolveSymbolByName(r.symbol,n,t,i)},m.prototype._resolveSymbolByName=function(e,t,i,r){var n,o=t&&t.currency,s=e+(o?"_#_"+o:"");this._resolveRequests[s]?n=this._resolveRequests[s]:(n=this._resolveSymbolInternal(e,o||void 0),this._resolveRequests[s]=n),n.then(i).catch(r)},m.prototype._resolveSymbolInternal=function(e,i){var r=this;return new Promise(function(n,o){this._logMessage("Symbol resolve requested: `{0}` ".format(e));var s=!0;this._externalDatafeed.resolveSymbol(e,(function(i){ @@ -206,36 +206,36 @@ this._symbolIdCache[this._makeSymbolKey(e,o)]?s():(this.on("symbol_resolved",c), this._recentSeriesId[e]=t,this._studyEngine.updateSeriesTurnaround(e,t,i),a&&(this._seriesIdCache[this._makeSeriesKey(e,a)]=null),this._seriesIdCache[this._makeSymbolKey(e,t)]={symbolId:r,resolution:n,turnaround:i},this._doWhenSeriesSymbolIdIsReady(e,t,(function(t){c._studyEngine.purgeRangeExtensionData(e),c._studyEngine.recreateSources(t.name,n,e,!0)}))},JSServer.ChartApi.prototype.requestMoreData=function(e,t,i,r){if(this._enabledMoreBarsRequest){var n=this,o=setTimeout((function(){n._notificationHandlers[e][t]=new u(r,t),n._studyEngine.extendSeriesRange(t,e,i)}),0);f(this._seriesTimers,e,t,o)}},JSServer.ChartApi.prototype.setStudiesAccessController=function(e){this.studiesAccessController=e},JSServer.ChartApi.prototype.setWatchlistSettings=function(e){this._watchlistSettings=e},JSServer.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()},JSServer.ChartApi.prototype.requestMetadata=function(e,t,i){this._notificationHandlers[e][t]=new u(i,t);var r=this.studiesAccessController.getEnabledTools();TradingView.ChartapiMessagerInstances[e].onRequestMetadata(t,r)},JSServer.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCountere&&n.logNormal("Study inputs migration is done, studyId: "+this._studyId+", inputs: "+JSON.stringify(r)),r},o.prototype._findMigration=function(e){for(var t=-1,i=this._maxFromVers,r=0;r=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),n.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,n.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal)),e},e.exports=o},Eyy1:function(e,t,i){"use strict";function r(e){if(void 0===e)throw new Error("Value is undefined");return e}function n(e){if(null===e)throw new Error("Value is null");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("Assertion failed"+(t?": "+t:""))},t.ensureDefined=r,t.ensureNotNull=n,t.ensure=function(e){return n(r(e))},t.ensureNever=function(e){}},F58L:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyTemplates",(function(){return p}));var r=i("zUrt"),n=i("PC8g"),o=i("aIyQ"),s=i.n(o),a=i("hY0g"),l=i.n(a),c=i("oNDq"),u=i("uOxu"),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,r.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(3),i.e(4),i.e(6),i.e(7),i.e(9),i.e(11),i.e(16),i.e(20),i.e(41),i.e(46),i.e(79),i.e(0),i.e(5),i.e(13),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(n.trackEvent)("GUI","Load Study Template"),e.model().applyStudyTemplate(JSON.parse(t.content),i.name)} ;void 0!==i.id?i.is_default?r.backend.getStandardStudyTemplateContentById(i.id,o):r.backend.getStudyTemplateContentById(i.id,o):r.backend.getStudyTemplateContent(i.name,o)}),{source:"Study templates apply"}):h.logNormal("Template "+name+" 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;r.backend.getStudyTemplatesList((function(i){t._list.setValue(i),void 0!==e&&e()}))},e.prototype._removeTemplate=function(e){var t=this;window.runOrSignIn((function(){Object(c.createConfirmDialog)({type:"modal",content:document.createTextNode(d.confirmDelete.format(e.name))}).then((function(i){i.on("action:yes",(function(i){var n=function(){t.refreshStudyTemplateList((function(){var r=t.list();t._list.setValue(r.filter((function(t){return t!==e}))),t._favoriteStudyTemplatesService&&t._favoriteStudyTemplatesService.remove(e.name),i.actionLoader("yes","stop"),i.close()}))};i.actionLoader("yes","start"),r.backend.invalidateStudyTemplatesList(),void 0!==e.id?r.backend.removeStudyTemplateById(e.id,n):r.backend.removeStudyTemplate(e.name,n)})),i.open()}))}),{source:"Study templates delete"})},e}()},FBsw:function(e,t,i){"use strict";i.r(t),i.d(t,"OverlayPriceAxisView",(function(){return s}));var r=i("mrSG"),n=i("KcY8"),o=i("oXaB"),s=function(e){function t(t){var i=e.call(this)||this;return i._source=t,i}return Object(r.__extends)(t,e),t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var r=this._source.lastValueData("close",!1);if(!r.noData){var n=this._source.model(),s=this._source.priceScale();if(null!==s&&n.isPriceScaleVisible(s)){i.background=r.color,i.color=this.generateTextColor(r.color),i.coordinate=r.coordinate,i.floatCoordinate=r.floatCoordinate;var a=this._source.model().properties().scalesProperties;a.showSeriesLastValue.value()&&(e.text=this._text(r),e.visible=!0),t.text="",(a.showSymbolLabels.value()||a.seriesLastValueMode.value()===o.PriceAxisLastValueMode.LastPriceAndPercentageValue)&&(t.text=this._paneText(r),t.visible=t.text.length>0)}}},t.prototype._paneText=function(e){var t="",i=this._source.model().properties().scalesProperties;i.showSymbolLabels.value()&&(t+=this._source.symbol()+" ");var r=this._source.priceScale();return null!==r&&i.showSeriesLastValue.value()&&i.seriesLastValueMode.value()===o.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()!==o.PriceAxisLastValueMode.LastPriceAndPercentageValue||null===i?e.text:i.isPercentage()?e.formattedPricePercentage:e.formattedPriceAbsolute},t}(n.a)},FBuY:function(e,t,i){"use strict";i.r(t), i.d(t,"TVXWindowEvents",(function(){return r}));i("HbRj");var r,n=i("uOxu"),o=i("VVxS"),s=Object(n.getLogger)("XWindowEvents");!function(e){var t,i="tvxwevents.",r={};window.BroadcastChannel?((t=new BroadcastChannel("tvxwevents")).addEventListener("message",(function(e){var t=e.data,i=t.event,n=t.value;r[i]&&r[i].forEach((function(e){e(n)}))})),function(){for(var e=[],t=performance.now(),r=0;r=this._actualCapacity){this._actualCapacity++;var i=new c.Size(this._currentWidth,this._rowHeight*this._actualCapacity);this._canvas.unsubscribeCanvasConfigured(this._dprChangeHandler);var r=this._canvas;this._canvas=Object(c.resizeCanvasPreservingContent)(this._canvas,i),r.destroy(),this._canvas.subscribeCanvasConfigured(this._dprChangeHandler),this._ctx=Object(c.getPrescaledContext2D)(this._canvas.canvas),this._ctx.font=u+"px "+a.CHART_FONT_FAMILY,p.logDebug("TrendLineCache. Expanding cache to "+this._actualCapacity+" items")}return t},e.prototype._effectiveState=function(e){var t=e.properties(),i={p1:Object.assign({},e.points()[0]),p2:Object.assign({},e.points()[1]),props:e.properties(), -showBars:t.showBarsRange.value(),showTimeRange:t.showDateTimeRange.value(),showDistance:t.showDistance.value(),showPriceRange:t.showPriceRange.value(),showAngle:t.showAngle.value(),dark:e.model().isDark(),priceRange:void 0,barSpacing:void 0};return!0===i.showAngle&&(i.priceRange=Object(r.ensureNotNull)(Object(r.ensureNotNull)(e.priceScale()).priceRange()).state(),i.barSpacing=e.model().timeScale().barSpacing()),i},e.prototype._effectiveStatesEquals=function(e,t){if(null!==e&&null===t)return!1;if(null===e&&null!==t)return!1;var i=Object(r.ensureNotNull)(e),n=Object(r.ensureNotNull)(t);if(f(i.p1,n.p1))return!1;if(f(i.p2,n.p2))return!1;if(i.dark!==n.dark)return!1;if(i.showBars!==n.showBars)return!1;if(i.showTimeRange!==n.showTimeRange)return!1;if(i.showDistance!==n.showDistance)return!1;if(i.showPriceRange!==n.showPriceRange)return!1;if(i.showAngle!==n.showAngle)return!1;if(i.showAngle&&n.showAngle){if(i.priceRange.min!==n.priceRange.min)return!1;if(i.priceRange.max!==n.priceRange.max)return!1;if(i.barSpacing!==n.barSpacing)return!1}return!0},e.prototype._repaintSource=function(e,t,i){this._ctx.save(),this._ctx.translate(.5,this.topByRow(t)+.5),i.points[0]=new n.Point(0,0),i.offsetX=0,i.offsetY=0,delete i.horzAlign,delete i.vertAlign,this._ctx.clearRect(0,0,this._currentWidth,this.rowHeight(t));var o=new s.TrendLineStatsRenderer(i,{widths:[]}).draw(this._ctx);Object(r.ensureDefined)(this._sourcesToRow.get(e)).width=o.width,this._ctx.restore()},e.prototype._recreateCanvas=function(){this._canvas.unsubscribeCanvasConfigured(this._dprChangeHandler),this._canvas.destroy(),this._canvas=Object(c.createDisconnectedBoundCanvas)(document,new c.Size(this._currentWidth,this._rowHeight*this._actualCapacity)),this._canvas.subscribeCanvasConfigured(this._dprChangeHandler),this._sourcesToRow.clear(),this._rowsToSources.clear(),this._ctx=Object(c.getPrescaledContext2D)(this._canvas.canvas),this._needRecreateCanvas=!1},e}()},FVma:function(e,t,i){"use strict";(function(e){var r=i("aO4+").Point,n=i("2kV1").StudyStatusView,o=i("it7y").StudyDataWindowView,s=i("Qq0B").NonSeriesStudy,a=i("dUDn").StandardPivotPointsPriceAxisView,l=i("KtbP").PanePriceAxisView,c=i("l4sv").HorizontalLineRenderer,u=i("loH8"),h=i("VdBB").HitTestResult,d=i("Zy3/").CompositeRenderer,p=i("k9/m").PlotRowSearchMode,f=i("hayr").propertyPages,_=i("ikwP"),m=_.getPretransformedContext2D,y=_.Size,g=_.createDisconnectedBoundCanvas;function v(e,t,i){this._prices=[],this._recreateCanvasAndContext(new y(0,0)),this.reset({font:e,fontSize:t,backColors:i}),this._priceAxisFontSize=11}function S(e,t){this._model=e,this._source=t,this._pivots=[],this._textCache={}}function b(e,t){this._source=e,this._model=e._model,this._prices=[],this._invidated=!0,this._cache=t,this._visiblePivots=new Set}function w(e,t,i,r){s.call(this,e,t,i,r);for(var n=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],o=this.properties().levelsStyle.visibility,a=0;as)){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(_),y=r.priceToCoordinate(m,a);this._pivots.push({x1:p,x2:f,y,label:h[_].text,labelIds:h[_].ids,src:e[l]})}}}}}},S.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);for(var e=new d,t=this._source.properties().levelsStyle.colors,i=this._source.properties().levelsStyle.widths,n=this._source.visiblePivots(),o=0;o0){var g=this._cache._labelRectByIndex(y+11),v={left:Math.round(_.x-g.width+f),top:Math.round(_.y-g.height/2),width:g.width,height:g.height};f+=g.width/2;var S=this._cache._canvasBinding.canvas,b=new u(S,g,v,this._cache._canvasBinding.pixelRatio);e.append(b)}g=this._cache._labelRectByIndex(y),v={left:Math.round(_.x-g.width+f),top:Math.round(_.y-g.height/2),width:g.width,height:g.height};f+=g.width;S=this._cache._canvasBinding.canvas,b=new u(S,g,v,this._cache._canvasBinding.pixelRatio);e.append(b)}}}return e},b.prototype.visiblePivots=function(){return this._visiblePivots},b.prototype._updateImpl=function(){if(this._visiblePivots.clear(),!this._model.timeScale().isEmpty()&&!this._source.priceScale().isEmpty()){var e=this._model.timeScale().visibleBarsStrictRange();if(null!==e&&this._source.customData()&&this._source.customData().pivots){var t=this._model.mainSeries(),i=this._source.priceScale(),r=t.bars().search(e.lastBar(),p.NearestLeft);if(null!==r){for(var n=r.index,o=this._source.customData().pivots,s=this._source._indexes,a=this._source.properties(),l=this._source.firstValue(),c=0;c=n||d)){this._visiblePivots.add(o[c]);var f=["p","s1","r1","s2","r2","s3","r3","s4","r4","s5","r5"];this._prices=[];for(var _=0;_i)){var l=[],c=this._properties.levelsStyle.visibility;c.P.value()&&l.push(r[s].p),c["S1/R1"].value()&&l.push(r[s].s1,r[s].r1),c["S2/R2"].value()&&l.push(r[s].s2,r[s].r2),c["S3/R3"].value()&&l.push(r[s].s3,r[s].r3), +showBars:t.showBarsRange.value(),showTimeRange:t.showDateTimeRange.value(),showDistance:t.showDistance.value(),showPriceRange:t.showPriceRange.value(),showAngle:t.showAngle.value(),dark:e.model().isDark(),priceRange:void 0,barSpacing:void 0};return!0===i.showAngle&&(i.priceRange=Object(r.ensureNotNull)(Object(r.ensureNotNull)(e.priceScale()).priceRange()).state(),i.barSpacing=e.model().timeScale().barSpacing()),i},e.prototype._effectiveStatesEquals=function(e,t){if(null!==e&&null===t)return!1;if(null===e&&null!==t)return!1;var i=Object(r.ensureNotNull)(e),n=Object(r.ensureNotNull)(t);if(f(i.p1,n.p1))return!1;if(f(i.p2,n.p2))return!1;if(i.dark!==n.dark)return!1;if(i.showBars!==n.showBars)return!1;if(i.showTimeRange!==n.showTimeRange)return!1;if(i.showDistance!==n.showDistance)return!1;if(i.showPriceRange!==n.showPriceRange)return!1;if(i.showAngle!==n.showAngle)return!1;if(i.showAngle&&n.showAngle){if(i.priceRange.min!==n.priceRange.min)return!1;if(i.priceRange.max!==n.priceRange.max)return!1;if(i.barSpacing!==n.barSpacing)return!1}return!0},e.prototype._repaintSource=function(e,t,i){this._ctx.save(),this._ctx.translate(.5,this.topByRow(t)+.5),i.points[0]=new n.Point(0,0),i.offsetX=0,i.offsetY=0,delete i.horzAlign,delete i.vertAlign,this._ctx.clearRect(0,0,this._currentWidth,this.rowHeight(t));var o=new s.TrendLineStatsRenderer(i,{widths:[]}).draw(this._ctx);Object(r.ensureDefined)(this._sourcesToRow.get(e)).width=o.width,this._ctx.restore()},e.prototype._recreateCanvas=function(){this._canvas.unsubscribeCanvasConfigured(this._dprChangeHandler),this._canvas.destroy(),this._canvas=Object(c.createDisconnectedBoundCanvas)(document,new c.Size(this._currentWidth,this._rowHeight*this._actualCapacity)),this._canvas.subscribeCanvasConfigured(this._dprChangeHandler),this._sourcesToRow.clear(),this._rowsToSources.clear(),this._ctx=Object(c.getPrescaledContext2D)(this._canvas.canvas),this._needRecreateCanvas=!1},e}()},FVma:function(e,t,i){"use strict";(function(e){var r=i("aO4+").Point,n=i("2kV1").StudyStatusView,o=i("it7y").StudyDataWindowView,s=i("Qq0B").NonSeriesStudy,a=i("dUDn").StandardPivotPointsPriceAxisView,l=i("KtbP").PanePriceAxisView,c=i("l4sv").HorizontalLineRenderer,u=i("loH8"),h=i("VdBB").HitTestResult,d=i("Zy3/").CompositeRenderer,p=i("k9/m").PlotRowSearchMode,f=i("hayr").propertyPages,_=i("ikwP"),m=_.getPretransformedContext2D,y=_.Size,g=_.createDisconnectedBoundCanvas;function v(e,t,i){this._prices=[],this._recreateCanvasAndContext(new y(0,0)),this.reset({font:e,fontSize:t,backColors:i}),this._priceAxisFontSize=11}function b(e,t){this._model=e,this._source=t,this._pivots=[],this._textCache={}}function S(e,t){this._source=e,this._model=e._model,this._prices=[],this._invidated=!0,this._cache=t,this._visiblePivots=new Set}function w(e,t,i,r){s.call(this,e,t,i,r);for(var n=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],o=this.properties().levelsStyle.visibility,a=0;as)){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(_),y=r.priceToCoordinate(m,a);this._pivots.push({x1:p,x2:f,y,label:h[_].text,labelIds:h[_].ids,src:e[l]})}}}}}},b.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);for(var e=new d,t=this._source.properties().levelsStyle.colors,i=this._source.properties().levelsStyle.widths,n=this._source.visiblePivots(),o=0;o0){var g=this._cache._labelRectByIndex(y+11),v={left:Math.round(_.x-g.width+f),top:Math.round(_.y-g.height/2),width:g.width,height:g.height};f+=g.width/2;var b=this._cache._canvasBinding.canvas,S=new u(b,g,v,this._cache._canvasBinding.pixelRatio);e.append(S)}g=this._cache._labelRectByIndex(y),v={left:Math.round(_.x-g.width+f),top:Math.round(_.y-g.height/2),width:g.width,height:g.height};f+=g.width;b=this._cache._canvasBinding.canvas,S=new u(b,g,v,this._cache._canvasBinding.pixelRatio);e.append(S)}}}return e},S.prototype.visiblePivots=function(){return this._visiblePivots},S.prototype._updateImpl=function(){if(this._visiblePivots.clear(),!this._model.timeScale().isEmpty()&&!this._source.priceScale().isEmpty()){var e=this._model.timeScale().visibleBarsStrictRange();if(null!==e&&this._source.customData()&&this._source.customData().pivots){var t=this._model.mainSeries(),i=this._source.priceScale(),r=t.bars().search(e.lastBar(),p.NearestLeft);if(null!==r){for(var n=r.index,o=this._source.customData().pivots,s=this._source._indexes,a=this._source.properties(),l=this._source.firstValue(),c=0;c=n||d)){this._visiblePivots.add(o[c]);var f=["p","s1","r1","s2","r2","s3","r3","s4","r4","s5","r5"];this._prices=[];for(var _=0;_i)){var l=[],c=this._properties.levelsStyle.visibility;c.P.value()&&l.push(r[s].p),c["S1/R1"].value()&&l.push(r[s].s1,r[s].r1),c["S2/R2"].value()&&l.push(r[s].s2,r[s].r2),c["S3/R3"].value()&&l.push(r[s].s3,r[s].r3), c["S4/R4"].value()&&l.push(r[s].s4,r[s].r4),c["S5/R5"].value()&&l.push(r[s].s5,r[s].r5);for(var u=0;u-1,L=T&&navigator.userAgent.toLowerCase().indexOf("windows")>-1,I=navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("edge"),M=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}return!1}(),O=window.urlParams||{},A=(window.initData,null);function k(e,t,i){var r=(0,p.createDisconnectedBoundCanvas)(document,new p.Size(t,i));return(0,p.getPrescaledContext2D)(r.canvas).drawImage(e,0,0,t,i),r}function E(e,t){return function(){i.e("ie-fallback-logos").then(function(){A=i("j1nX"),e.call(t)}.bind(null,i)).catch(i.oe)}}function D(e){return!S||e>500}var V=function(){function e(t){var i=t.layout,r=void 0===i?"site_branding":i,n=t.symbol,o=void 0===n?"":n,s=t.model,l=t.onReadyCallback;_(this,e),this._model=s,this._image=null,this._imageReady=!1,this._needDisplayImage=!1,this._imageWidth=22,this._imageHeight=13,this._layout=r,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=c.color.brandNew,this._colorOldBlue=c.color.brandNew2,this._colorOldGray=c.color.black30,this._strokeColor=c.color.black255,this._brandCircleShadowColor=c.color.black0,this._strokeWidth=4,this._fontSize=this.showAnimatedBranding?11:14,this._font="px "+v,this._txt="TradingView",this._onReadyCallback=l,this._upscaleRatio=I?1:2,this._verticalTextShift=T?this.showAnimatedBranding?2:4:0,this._strokeCanv=null,this._fillCanv=null,M&&(this._init=E(this._init,this)),this._init()}return n(e,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this.showAnimatedBranding?(this._loadImage(g,"tvLogo"),this._createFillText()):this._loadImage(g,"tvLogo"),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var e=(0,u.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,e>.2?(this._brandCircleColor=c.color.black255,this._animatedColorBg=c.color.black255,this._brandCircleShadowOpacity=.09, +if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var m,y=i("JOqt").debounce,g=i("/b+7"),v=i("zDbI").CHART_FONT_FAMILY,b=a.enabled("adaptive_logo"),S=a.enabled("small_no_display");m=a.enabled("38914");var w="Ch{0}ar{1}t{2}by{3}{4}".format("",""," "," ","TradingView"),P="po{0}wer{1}ed{2}by{3}{4}".format("",""," "," ","TradingView"),C="by{3}{4}".format("",""," "," ","TradingView"),x=m?C:P,T=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,L=T&&navigator.userAgent.toLowerCase().indexOf("windows")>-1,I=navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("edge"),M=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}return!1}(),O=window.urlParams||{},A=(window.initData,null);function k(e,t,i){var r=(0,p.createDisconnectedBoundCanvas)(document,new p.Size(t,i));return(0,p.getPrescaledContext2D)(r.canvas).drawImage(e,0,0,t,i),r}function E(e,t){return function(){i.e("ie-fallback-logos").then(function(){A=i("j1nX"),e.call(t)}.bind(null,i)).catch(i.oe)}}function D(e){return!b||e>500}var V=function(){function e(t){var i=t.layout,r=void 0===i?"site_branding":i,n=t.symbol,o=void 0===n?"":n,s=t.model,l=t.onReadyCallback;_(this,e),this._model=s,this._image=null,this._imageReady=!1,this._needDisplayImage=!1,this._imageWidth=22,this._imageHeight=13,this._layout=r,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=c.color.brandNew,this._colorOldBlue=c.color.brandNew2,this._colorOldGray=c.color.black30,this._strokeColor=c.color.black255,this._brandCircleShadowColor=c.color.black0,this._strokeWidth=4,this._fontSize=this.showAnimatedBranding?11:14,this._font="px "+v,this._txt="TradingView",this._onReadyCallback=l,this._upscaleRatio=I?1:2,this._verticalTextShift=T?this.showAnimatedBranding?2:4:0,this._strokeCanv=null,this._fillCanv=null,M&&(this._init=E(this._init,this)),this._init()}return n(e,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this.showAnimatedBranding?(this._loadImage(g,"tvLogo"),this._createFillText()):this._loadImage(g,"tvLogo"),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var e=(0,u.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,e>.2?(this._brandCircleColor=c.color.black255,this._animatedColorBg=c.color.black255,this._brandCircleShadowOpacity=.09, this._strokeOpacity=.8):(this._brandCircleColor=c.color.black27,this._animatedColorBg=c.color.black27,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.1)}},{key:"_loadImage",value:function(e,t){var i=this;if(this._needDisplayImage){if(this._image={canvas:new Image},this.showAnimatedBranding&&(this._imageWhite={canvas:new Image}),M)this._image.canvas.src=A.fallbackImages[t+"Blue"],this.showAnimatedBranding&&(this._imageWhite.canvas.src=A.fallbackImages[t+"White"]);else{var r=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(r))}this._image.canvas.addEventListener("load",(function(){L&&(i._image=k(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":this.show=!0;break;case"site_branding":this.show=!CheckMobile.any();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(w);break;case"library_custom_branding":this._txt=window.t(x)}}},{key:"_drawTextStroke",value:function(e){if(!this._strokeCanv){this._strokeCanv=(0,p.createDisconnectedBoundCanvas)(document,new p.Size(0,0));var t=(0,p.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 r=this._textWidth+2*i,n=(this._fontSize+2*i)*this._upscaleRatio;r%2==0&&(r+=1,n+=1),this._strokeCanv.resizeCanvas({width:r,height:n}),(t=(0,p.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, -p.createDisconnectedBoundCanvas)(document,new p.Size(0,0));var e=(0,p.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,p.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,p.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,r,n,o,s){e.save(),(0,d.drawRoundRect)(e,t-1,i-1,r+2,n+2,o),e.globalAlpha=this._brandCircleShadowOpacity,e.fillStyle=this._brandCircleShadowColor,e.fill(),e.closePath(),e.restore(),e.save(),(0,d.drawRoundRect)(e,t,i,r,n,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:"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+n,.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 "+v;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!b||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+(I?-.5:0);e.translate(this._imageWidth+c,-.5);var u=D(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(I?-.5:0,-.5);var h=D(t);h&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),h&&(this.width=this._strokeCanv.canvas.width/this._upscaleRatio/this._strokeCanv.pixelRatio)}}}]),e}(),B=function(){function e(t){var i=t.layout,r=void 0===i?"site_branding":i,n=t.src,o=t.onReadyCallback;_(this,e),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=r,this._src=n,this._onReadyCallback=o,M&&(this._init=E(this._init,this)),this._init()}return n(e,[{key:"_init",value:function(){var e=this;if(this._checkLayout(),this.show){var t=this._src.match(/(\w+)\.svg/);if(M&&t&&2===t.length){var i=t[1];this._img.src=A.fallbackImages[i],this._img.addEventListener("load",(function(){var t=A.logoSizes -;i in t?(e.width=t[i].width,e.height=t[i].height):(e.width=135,e.height=25),e._ready=!0,"function"==typeof e._onReadyCallback&&e._onReadyCallback()}))}else 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=k(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(){function e(t,i,r){var n=this;_(this,e),this._model=t,this._mainSeries=this._model.mainSeries(),this._canvasWidth=0,this._showAllowance=i,this._showForPro=r,this._paneHeight=0,this._left=13,this._bottom=16,this._layout="site_branding",this._needToShow=!0,this._customLogoSrc="",this._customLogoLink="",this._checkLayout(),"widget_custom_branding"!==this._layout&&"fundamental_custom_branding"!==this._layout||(this._left=8,this._bottom=5);var o=function(){n._needToShow?"site_branding"===n._layout?n._showBranding=window.innerWidth>=768:n._showBranding=!0:n._showBranding=!1};this._resizeHandlerDelayed=y(o,200),o(),window.addEventListener("resize",this._resizeHandlerDelayed),this._monitorCanvas=(0,p.createDisconnectedBoundCanvas)(document,new p.Size(0,0)),this._monitorCanvas.subscribeCanvasConfigured((function(){n._init()})),this._model.isSnapshot()?this._init():(this._mainSeries.dataEvents().symbolResolved().subscribe(this,this._init),null!==this._mainSeries.symbolInfo()&&this._init()),this._cubicBezier=new c.CubicBezier(.4,.01,.22,1)}return n(e,[{key:"destroy",value:function(){window.removeEventListener("resize",this._resizeHandlerDelayed)}},{key:"_init",value:function(){var e=this,t=this._mainSeries.symbolInfo()||{};this._powBy=new V({layout:this._layout,symbol:t.name,model:this._model,onReadyCallback:function(){return e._model.fullUpdate()}}),this._custom=new B({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("amp_terminal")||a.enabled("cqg_terminal")||a.enabled("trading_terminal")){var e=JSON.parse(O.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,h.doAnimate)({from:this._currentStateForAnimation(),to:this._openedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_startCloseAnimation",value:function(){null===this._closeAnimation&&(null!==this._openAnimation&&(this._openAnimation.stop(),this._openAnimation=null),this._closeAnimation=(0,h.doAnimate)({from:this._currentStateForAnimation(),to:this._closedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{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:"priceAxisViews",value:function(){return[]}},{key:"onClickOutside",value:function(){}},{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 l.HitTestResult(l.HitTestResult.CUSTOM,{mouseClickHandler:function(){"site_branding"!==t._layout&&(window.open(t.tvUrl(),"_blank").opener=null)},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"):case a.enabled("amp_terminal"):case a.enabled("cqg_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 r=0;O.utm=!0,(0,p.drawScaled)(e,t.pixelRatio,(function(){e.translate(-.5,-.5),i._powBy&&i._powBy.show&&(r=i._powBy.height-i._powBy.bottomShift(),e.save(),e.translate(i._left,i._paneHeight-i._bottom-r),i._powBy.draw(e,t,i._canvasWidth),e.restore()),i._custom&&i._custom.show&&(e.save(), -e.translate(i._left,i._paneHeight-i._bottom-r-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)}]:[]}}]),e}()},GUQs:function(e,t,i){"use strict";function r(e){e.cancelable&&e.preventDefault()}function n(e){return function(t){r(t),e()}}i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}))},GVHu:function(e,t,i){"use strict";(function(e,r,n){var o=i("Eyy1"),s=o.assert,a=o.ensureNotNull,l=i("hsV8").unpackNonSeriesData,c=i("38az").StudyBarColorer,u=i("l4sv").HorizontalLineRenderer,h=i("AXy7"),d=h.BandPaneView,p=h.BandBackgroundPaneView,f=h.HlineFillPaneView,_=i("hezA").StudyPriceAxisView,m=i("KtbP").PanePriceAxisView,y=i("I9zs"),g=y.StudyPaneView,v=y.StudyBackgroundPaneView,S=y.StudyPlotShapesPaneView,b=y.StudyPlotCharsPaneView,w=y.StudyPlotArrowsPaneView,P=y.StudyPlotBarsPaneView,C=y.StudyPlotCandlesPaneView,x=i("x40+"),T=x.PlotFillPaneView,L=x.AreaBackgroundPaneView,I=i("it7y").StudyDataWindowView,M=i("8qoI").StudyLegendView,O=i("2kV1").StudyStatusView,A=i("jenN"),k=A.emptyStudyGraphics,E=A.loadStudyGraphics,D=A.saveStudyGraphics,V=A.LiveStudyGraphics,B=A.createGraphicsPaneViews,R=A.createGraphicsPriceAxisViews,N=i("XzZr").ChartApiInterface,F=i("aO4+").Point,j=i("Ocx9").DefaultProperty,W=i("kcTO").PriceFormatter,z=i("nEwK").VolumeFormatter,H=i("zXvd").NumericFormatter,U=i("GH0z").PercentageFormatter,Y=i("k9/m"),G=Y.PlotList,q=Y.PlotRowSearchMode,K=Y.mergeMinMax,Z=i("972a").MarkLocation,J=i("0YCj"),X=(i("cBZt").extractStudyId,i("TcSq").extractPineId,i("FQhm")),Q=i("23IT"),$=Q.LineStudyPlotStyle,ee=i("hayr").propertyPages,te=i("TmNs").StudyPriceLineAxisView,ie=i("w4Ji").studyPlotFunctionMap,re=i("w4Ji").studyEmptyPlotValuePredicate,ne=i("jy4L").makeNextStudyId,oe=i("Kxc7"),se=i("IcDj").StudyBase,ae=i("uOxu").getLogger("Chart.Study"),le=(Number(window.TELEMETRY_SERVER_TIME_DIFF_THRESHOLD),oe.enabled("datasource_copypaste"));function ce(e,t,i,r){this._study=e,this.m_series=t,this.m_model=i,this._plotName=r,this._visible=!1,this._points=[new F(0,0)],this._invalidated=!0,this._lineRenderer=new u}function ue(e,t,i){var r=new j(t,i,!0);r.addExclusion("visible"),r.addExclusion("precision"),r.addExclusion("minTick");for(var n=0;nv+1){var x=m[v+1];if(null!=x){var T=S.valToIndex?S.valToIndex[x]:x;g.color=y.colors[T].color.value()}else g.color=C}else g.color=C;return g.floatCoordinate=this.priceScale().priceToCoordinate(w,P),g.coordinate=g.floatCoordinate,g.item=m,g},de.prototype.isFailed=function(){return this._failed},de.prototype.isLoading=function(){return this._loading},de.prototype.series=function(){return this._series},de.prototype.model=function(){return this._model},de.prototype.currency=function(){var e=this.metaInfo();return Boolean(e)&&e.is_price_study?this.parentSource().currency():null},de.prototype._invalidateLastNonEmptyPlotRowCache=function(){this._lastNonEmptyPlotRowCache={}},de.prototype.clearData=function(){this._invalidateLastNonEmptyPlotRowCache(), -this.m_data.clear(),this._graphics.clear&&this._graphics.clear(),this._plotOffsets={}},de.prototype.onTagsChanged=function(){return this._tagsChanged},de.prototype.properties=function(){return this._properties},de.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 J?i.metaInfo=TradingView.clone(this.metaInfo().state()):(i.metaInfo=TradingView.clone(this.metaInfo()),i.metaInfo.id=J.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=D(this.graphics()),i.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(i.ownerSource=this.ownerSource().id());for(var r=0;r=0?s:0}}return this._isChildStudy&&J.patchChildStudyMetaInfoState(i),i},de.prototype._plotsForAlert=function(){var e=this,t=this._metaInfo,i=[Q.isLinePlot,Q.isShapesPlot,Q.isCharsPlot,Q.isArrowsPlot,Q.isOhlcPlot,Q.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 r={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:e.offset(i.id)};return t.styles&&void 0!==t.styles[i.id]&&(r.title=t.styles[i.id].title||"",r.text=t.styles[i.id].text||""),i.target&&t.ohlcPlots&&t.ohlcPlots[i.target]&&(r.ohlcTitle=t.ohlcPlots[i.target].title),r}))},de.prototype._collectDepsForAlert=function(){throw new Error("Not implemented")},de.prototype.idForAlert=function(){return se.prototype.idForAlert.call(this)},de.prototype.dependenciesForAlerts=function(){throw new Error("Not implemented")},de.prototype._hasAvailableAlertPlots=function(){return!1},de.prototype._hasAlertablePlots=function(){return(this.metaInfo().plots||[]).some((function(e){return"line"===e.type}))},de.prototype._hasAlertConditions=function(){if(this.metaInfo().plots.some(Q.isAlertConditionPlot))return!0;var e=this.stateForAlert();return!(!e.alerts||!e.alerts.conditions)},de.prototype._isAlertFeatureEnabled=function(){return!1},de.prototype.hasStateForAlert=function(){return this._isAlertFeatureEnabled()&&(this.metaInfo().isTVScript?this._hasAlertConditions()||this._hasAvailableAlertPlots()&&!this.isFailed():this._hasAlertablePlots()&&!this.isFailed())},de.prototype.stateForAlert=function(){throw new Error("Not implemented")},de.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},de.prototype.start=function(e,t){var i=this._model.mainSeries();if(i.isStarted()){this._isChildStudy&&this._source.isHibernated()&&this._source.start();var r=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible() -;!this._chartApi||!this._chartApi.connected()||r&&!0!==t||this._allSymbolsAreResolved().then(function(){this._startAfterSymbolsResolved(e,t)}.bind(this)).catch(function(e){ae.logError("ERROR: "+this._debugId()+" start failed, "+e),delete this._restarting}.bind(this))}else i.dataEvents().completed().subscribe(this,(function(){this.start(e,t)}),!0)},de.prototype._getStudyIdWithLatestVersion=function(){var e=J.cutDollarHash(this._metaInfo.id),t=e;return e.indexOf("@tv-scripting")>=0?t+="-101!":t+="-"+this._metaInfo.version,t},de.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);J.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=ne(),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 r=0;r=e){var i=a(this._series.bars().lastIndex())-e;t=a(this._series.bars().valueAt(i))[TradingView.TIME_PLOT]}return t},de.prototype._titleInputs=function(e,t){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1,skippedGroups:[],noExchanges:e,noResolution:t})},de.prototype.inputsForAlert=function(){var e=this.offset(),t=this.inputs();return e&&t.push(e),t},de.prototype.inputs=function(e){var t={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,skipBooleanInputs:oe.enabled("dont_show_boolean_study_arguments"),asObject:!0,skippedGroups:[],skippedInputs:[],noExchanges:!1,noResolution:!1,keepOptionalSymbolsEmpty:!1};return TradingView.merge(t,e),this._buildInputs(t)},de.prototype.inputsForAlertState=function(){return this.inputs()},de.prototype._buildInputs=function(e){s(!!e,"options not set");var t={};try{t=this._prepareInputs(e)}catch(r){ae.logWarn("Failed to prepare study inputs: "+r)}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},de.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()},de.prototype._rebindToSource=function(e,t){var i=this.parentSource();if(this._isChildStudy){var r;this._source.unsetChild(this),delete this._nonPriceParent;var n=null;if(e===this._model.mainSeries())this._source.currencyChanged().unsubscribeAll(this),delete this._source,delete this._isChildStudy,delete this._ownerSource,r=this._series._seriesId,n=N.REBIND_STUDY_CHILD_TO_STANDALONE,this._series.currencyChanged().subscribe(this,this._onSourceCurrencyChanged);else{if(!(e instanceof de))return ae.logError("Unable to rebind study to source of this type"),!1;this._ownerSource=e,this._source.currencyChanged().unsubscribeAll(this),this._source=e,this._source.currencyChanged().subscribe(this,this._onSourceCurrencyChanged),r=this._source.sourceId(),this._source.setChild(this),this._source.isHibernated()&&this._source.start()}this._incrementTurnaround(),this._chartApi.rebindStudy(this._studyId,this._turnaround,r,this._studyName,t,this._handler,n)}else{if(!(e instanceof de))return ae.logError("Unable to rebind study to source of this type"),!1;var o=e.isHibernated();o&&e.start();var s=!1;if(this._canCreateStudyWithRebindType(N.REBIND_STUDY_STANDALONE_TO_CHILD)&&(this._incrementTurnaround(),s=this._chartApi.rebindStudy(this._studyId,this._turnaround,e.sourceId(),this._studyName,t,this._handler,N.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(),this._series.currencyChanged().unsubscribeAll(this),this._source.currencyChanged().subscribe(this,this._onSourceCurrencyChanged)} -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)}return i.formatterChanged().unsubscribe(this,this._onSourceFormatterChanged),this.parentSource().formatterChanged().subscribe(this,this._onSourceFormatterChanged),i.priceStepChanged().unsubscribe(this,this._onSourcePriceStepChanged),this.parentSource().priceStepChanged().subscribe(this,this._onSourcePriceStepChanged),i.currencyChanged().unsubscribeAll(this),this._recreatePriceFormattingDependencies(),!0},de.prototype.childStudyByRebind=function(){return this._childStudyByRebind},de.prototype._changeInputsImpl=function(e,t){var i=this.source(),r=this._properties.inputs&&this._properties.inputs.state(),n=J.getSourceIdByInputs(this._metaInfo.inputs,r),o=!0;if(n)if("high"===n||"open"===n||"low"===n||"close"===n||"hl2"===n||"ohl3"===n||"ohlc4"===n)i=this._model.mainSeries();else for(var s=this._model.dataSources(),a=0;ao&&(e.translate(this._imageWidth/2+n,.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 "+v;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+(I?-.5:0);e.translate(this._imageWidth+c,-.5);var u=D(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(I?-.5:0,-.5);var h=D(t);h&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),h&&(this.width=this._strokeCanv.canvas.width/this._upscaleRatio/this._strokeCanv.pixelRatio)}}}]),e}(),B=function(){function e(t){var i=t.layout,r=void 0===i?"site_branding":i,n=t.src,o=t.onReadyCallback;_(this,e),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=r,this._src=n,this._onReadyCallback=o,M&&(this._init=E(this._init,this)),this._init()}return n(e,[{key:"_init",value:function(){var e=this;if(this._checkLayout(),this.show){ +var t=this._src.match(/(\w+)\.svg/);if(M&&t&&2===t.length){var i=t[1];this._img.src=A.fallbackImages[i],this._img.addEventListener("load",(function(){var t=A.logoSizes;i in t?(e.width=t[i].width,e.height=t[i].height):(e.width=135,e.height=25),e._ready=!0,"function"==typeof e._onReadyCallback&&e._onReadyCallback()}))}else 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=k(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(){function e(t,i,r){var n=this;_(this,e),this._model=t,this._mainSeries=this._model.mainSeries(),this._canvasWidth=0,this._showAllowance=i,this._showForPro=r,this._paneHeight=0,this._left=13,this._bottom=16,this._layout="site_branding",this._needToShow=!0,this._customLogoSrc="",this._customLogoLink="",this._checkLayout(),"widget_custom_branding"!==this._layout&&"fundamental_custom_branding"!==this._layout||(this._left=8,this._bottom=5);var o=function(){n._needToShow?"site_branding"===n._layout?n._showBranding=window.innerWidth>=768:n._showBranding=!0:n._showBranding=!1};this._resizeHandlerDelayed=y(o,200),o(),window.addEventListener("resize",this._resizeHandlerDelayed),this._monitorCanvas=(0,p.createDisconnectedBoundCanvas)(document,new p.Size(0,0)),this._monitorCanvas.subscribeCanvasConfigured((function(){n._init()})),this._model.isSnapshot()?this._init():(this._mainSeries.dataEvents().symbolResolved().subscribe(this,this._init),null!==this._mainSeries.symbolInfo()&&this._init()),this._cubicBezier=new c.CubicBezier(.4,.01,.22,1)}return n(e,[{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 V({layout:this._layout,symbol:t.name,model:this._model,onReadyCallback:function(){return e._model.fullUpdate()}}),this._custom=new B({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("amp_terminal")||a.enabled("cqg_terminal")||a.enabled("trading_terminal")){var e=JSON.parse(O.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,h.doAnimate)({from:this._currentStateForAnimation(),to:this._openedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_startCloseAnimation",value:function(){null===this._closeAnimation&&(null!==this._openAnimation&&(this._openAnimation.stop(),this._openAnimation=null),this._closeAnimation=(0,h.doAnimate)({from:this._currentStateForAnimation(),to:this._closedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{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:"priceAxisViews",value:function(){return[]}},{key:"onClickOutside",value:function(){}},{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 l.HitTestResult(l.HitTestResult.CUSTOM,{mouseClickHandler:function(){"site_branding"!==t._layout&&(window.open(t.tvUrl(),"_blank").opener=null)},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"):case a.enabled("amp_terminal"):case a.enabled("cqg_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 r=0;O.utm=!0,(0,p.drawScaled)(e,t.pixelRatio,(function(){e.translate(-.5,-.5),i._powBy&&i._powBy.show&&(r=i._powBy.height-i._powBy.bottomShift(),e.save(),e.translate(i._left,i._paneHeight-i._bottom-r),i._powBy.draw(e,t,i._canvasWidth),e.restore()),i._custom&&i._custom.show&&(e.save(),e.translate(i._left,i._paneHeight-i._bottom-r-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)}]:[]}}]),e}()},GUQs:function(e,t,i){"use strict";function r(e){e.cancelable&&e.preventDefault()}function n(e){return function(t){r(t),e()}}i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}))},GVHu:function(e,t,i){"use strict";(function(e,r,n){var o=i("Eyy1"),s=o.assert,a=o.ensureNotNull,l=i("hsV8").unpackNonSeriesData,c=i("38az").StudyBarColorer,u=i("l4sv").HorizontalLineRenderer,h=i("AXy7"),d=h.BandPaneView,p=h.BandBackgroundPaneView,f=h.HlineFillPaneView,_=i("hezA").StudyPriceAxisView,m=i("KtbP").PanePriceAxisView,y=i("I9zs"),g=y.StudyPaneView,v=y.StudyBackgroundPaneView,b=y.StudyPlotShapesPaneView,S=y.StudyPlotCharsPaneView,w=y.StudyPlotArrowsPaneView,P=y.StudyPlotBarsPaneView,C=y.StudyPlotCandlesPaneView,x=i("x40+"),T=x.PlotFillPaneView,L=x.AreaBackgroundPaneView,I=i("it7y").StudyDataWindowView,M=i("8qoI").StudyLegendView,O=i("2kV1").StudyStatusView,A=i("jenN"),k=A.emptyStudyGraphics,E=A.loadStudyGraphics,D=A.saveStudyGraphics,V=A.LiveStudyGraphics,B=A.createGraphicsPaneViews,R=A.createGraphicsPriceAxisViews,N=i("XzZr").ChartApiInterface,F=i("aO4+").Point,j=i("Ocx9").DefaultProperty,W=i("kcTO").PriceFormatter,z=i("nEwK").VolumeFormatter,H=i("zXvd").NumericFormatter,U=i("GH0z").PercentageFormatter,Y=i("k9/m"),G=Y.PlotList,q=Y.PlotRowSearchMode,K=Y.mergeMinMax,Z=i("972a").MarkLocation,J=i("0YCj"),X=(i("cBZt").extractStudyId,i("TcSq").extractPineId,i("FQhm")),Q=i("23IT"),$=Q.LineStudyPlotStyle,ee=i("hayr").propertyPages,te=i("TmNs").StudyPriceLineAxisView,ie=i("w4Ji").studyPlotFunctionMap,re=i("w4Ji").studyEmptyPlotValuePredicate,ne=i("jy4L").makeNextStudyId,oe=i("Kxc7"),se=i("IcDj").StudyBase,ae=i("uOxu").getLogger("Chart.Study"),le=(Number(window.TELEMETRY_SERVER_TIME_DIFF_THRESHOLD),oe.enabled("datasource_copypaste"));function ce(e,t,i,r){this._study=e,this.m_series=t,this.m_model=i,this._plotName=r,this._visible=!1,this._points=[new F(0,0)],this._invalidated=!0,this._lineRenderer=new u}function ue(e,t,i){var r=new j(t,i,!0);r.addExclusion("visible"),r.addExclusion("precision"),r.addExclusion("minTick");for(var n=0;nv+1){var x=m[v+1];if(null!=x){var T=b.valToIndex?b.valToIndex[x]:x;g.color=y.colors[T].color.value()}else g.color=C}else g.color=C;return g.floatCoordinate=this.priceScale().priceToCoordinate(w,P),g.coordinate=g.floatCoordinate,g.item=m,g},de.prototype.isFailed=function(){return this._failed},de.prototype.isLoading=function(){return this._loading},de.prototype.series=function(){return this._series},de.prototype.model=function(){return this._model}, +de.prototype.currency=function(){var e=this.metaInfo();return Boolean(e)&&e.is_price_study?this.parentSource().currency():null},de.prototype._invalidateLastNonEmptyPlotRowCache=function(){this._lastNonEmptyPlotRowCache={}},de.prototype.clearData=function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.clear(),this._graphics.clear&&this._graphics.clear(),this._plotOffsets={}},de.prototype.onTagsChanged=function(){return this._tagsChanged},de.prototype.properties=function(){return this._properties},de.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 J?i.metaInfo=TradingView.clone(this.metaInfo().state()):(i.metaInfo=TradingView.clone(this.metaInfo()),i.metaInfo.id=J.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=D(this.graphics()),i.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(i.ownerSource=this.ownerSource().id());for(var r=0;r=0?s:0}}return this._isChildStudy&&J.patchChildStudyMetaInfoState(i),i},de.prototype._plotsForAlert=function(){var e=this,t=this._metaInfo,i=[Q.isLinePlot,Q.isShapesPlot,Q.isCharsPlot,Q.isArrowsPlot,Q.isOhlcPlot,Q.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 r={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:e.offset(i.id)};return t.styles&&void 0!==t.styles[i.id]&&(r.title=t.styles[i.id].title||"",r.text=t.styles[i.id].text||""),i.target&&t.ohlcPlots&&t.ohlcPlots[i.target]&&(r.ohlcTitle=t.ohlcPlots[i.target].title),r}))},de.prototype._collectDepsForAlert=function(){throw new Error("Not implemented")},de.prototype.idForAlert=function(){return se.prototype.idForAlert.call(this)},de.prototype.dependenciesForAlerts=function(){throw new Error("Not implemented")},de.prototype._hasAvailableAlertPlots=function(){return!1},de.prototype._hasAlertablePlots=function(){return(this.metaInfo().plots||[]).some((function(e){return"line"===e.type}))},de.prototype._hasAlertConditions=function(){if(this.metaInfo().plots.some(Q.isAlertConditionPlot))return!0;var e=this.stateForAlert();return!(!e.alerts||!e.alerts.conditions)},de.prototype._isAlertFeatureEnabled=function(){return!1},de.prototype.hasStateForAlert=function(){return this._isAlertFeatureEnabled()&&(this.metaInfo().isTVScript?this._hasAlertConditions()||this._hasAvailableAlertPlots()&&!this.isFailed():this._hasAlertablePlots()&&!this.isFailed())},de.prototype.stateForAlert=function(){throw new Error("Not implemented")},de.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},de.prototype.start=function(e,t){var i=this._model.mainSeries();if(i.isStarted()){this._isChildStudy&&this._source.isHibernated()&&this._source.start();var r=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible();!this._chartApi||!this._chartApi.connected()||r&&!0!==t||this._allSymbolsAreResolved().then(function(){this._startAfterSymbolsResolved(e,t)}.bind(this)).catch(function(e){ae.logError("ERROR: "+this._debugId()+" start failed, "+e),delete this._restarting}.bind(this))}else i.dataEvents().completed().subscribe(this,(function(){this.start(e,t)}),!0)},de.prototype._getStudyIdWithLatestVersion=function(){var e=J.cutDollarHash(this._metaInfo.id),t=e;return e.indexOf("@tv-scripting")>=0?t+="-101!":t+="-"+this._metaInfo.version,t},de.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);J.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=ne(),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 r=0;r=e){var i=a(this._series.bars().lastIndex())-e;t=a(this._series.bars().valueAt(i))[TradingView.TIME_PLOT]}return t},de.prototype._titleInputs=function(e,t){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1,skippedGroups:[],noExchanges:e,noResolution:t})},de.prototype.inputsForAlert=function(){var e=this.offset(),t=this.inputs();return e&&t.push(e),t},de.prototype.inputs=function(e){var t={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,skipBooleanInputs:oe.enabled("dont_show_boolean_study_arguments"),asObject:!0,skippedGroups:[],skippedInputs:[],noExchanges:!1,noResolution:!1,keepOptionalSymbolsEmpty:!1};return TradingView.merge(t,e),this._buildInputs(t)},de.prototype.inputsForAlertState=function(){return this.inputs()},de.prototype._buildInputs=function(e){s(!!e,"options not set");var t={};try{t=this._prepareInputs(e)}catch(r){ae.logWarn("Failed to prepare study inputs: "+r)}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},de.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()},de.prototype._rebindToSource=function(e,t){var i=this.parentSource();if(this._isChildStudy){var r;this._source.unsetChild(this),delete this._nonPriceParent;var n=null;if(e===this._model.mainSeries())this._source.currencyChanged().unsubscribeAll(this),delete this._source,delete this._isChildStudy,delete this._ownerSource,r=this._series._seriesId,n=N.REBIND_STUDY_CHILD_TO_STANDALONE,this._series.currencyChanged().subscribe(this,this._onSourceCurrencyChanged);else{if(!(e instanceof de))return ae.logError("Unable to rebind study to source of this type"),!1;this._ownerSource=e,this._source.currencyChanged().unsubscribeAll(this),this._source=e,this._source.currencyChanged().subscribe(this,this._onSourceCurrencyChanged),r=this._source.sourceId(),this._source.setChild(this),this._source.isHibernated()&&this._source.start()}this._incrementTurnaround(),this._chartApi.rebindStudy(this._studyId,this._turnaround,r,this._studyName,t,this._handler,n)}else{if(!(e instanceof de))return ae.logError("Unable to rebind study to source of this type"),!1;var o=e.isHibernated();o&&e.start();var s=!1;if(this._canCreateStudyWithRebindType(N.REBIND_STUDY_STANDALONE_TO_CHILD)&&(this._incrementTurnaround(),s=this._chartApi.rebindStudy(this._studyId,this._turnaround,e.sourceId(),this._studyName,t,this._handler,N.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(),this._series.currencyChanged().unsubscribeAll(this), +this._source.currencyChanged().subscribe(this,this._onSourceCurrencyChanged)}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)}return i.formatterChanged().unsubscribe(this,this._onSourceFormatterChanged),this.parentSource().formatterChanged().subscribe(this,this._onSourceFormatterChanged),i.priceStepChanged().unsubscribe(this,this._onSourcePriceStepChanged),this.parentSource().priceStepChanged().subscribe(this,this._onSourcePriceStepChanged),i.currencyChanged().unsubscribeAll(this),this._recreatePriceFormattingDependencies(),!0},de.prototype.childStudyByRebind=function(){return this._childStudyByRebind},de.prototype._changeInputsImpl=function(e,t){var i=this.source(),r=this._properties.inputs&&this._properties.inputs.state(),n=J.getSourceIdByInputs(this._metaInfo.inputs,r),o=!0;if(n)if("high"===n||"open"===n||"low"===n||"close"===n||"hl2"===n||"ohl3"===n||"ohlc4"===n)i=this._model.mainSeries();else for(var s=this._model.dataSources(),a=0;a0?" ("+t+")":"")},de.prototype._titleInParts=function(e,t,i,r){var n="";n=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(n)],s=[];if(!i){var a=this._getMTFResolutionInputTitle();if(null!==a&&a.length>0&&o.push(a),(s=this._titleInputs(r,!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,r);if(1===p.plots.length)l[d]=f;else{var _=d.split("$")[1],m=p.plots[_].id,y=p.styles&&p.styles[m]&&p.styles[m].title||m;l[d]=f+": "+y}}break}}var g=this;s=s.map((function(e){var i=isNumber(e)?g._numericFormatter.format(e):l&&l[e]||e;return t[i]&&(i=t[i]),i}))}}return[o.join(" · "),s]},de.prototype._getMTFResolutionInputTitle=function(){for(var e=0;e0?window.t(t):""},de.prototype._handleStudyError=function(e){delete this._loadingStartTime,this._failed=!0,this._loading=!1,this.clearData();e.params[2];this._status=this._getStatusTextOnStudyError(e.params[2]),this._statusView.update(),this._model.updateSource(this)},de.prototype.onData=function(e){switch(e.method){case"study_loading":this._status=window.t("loading..."),this._failed=!1,this._loading=!0,this._statusView.update(),this._model.updateSource(this),this._loadingStartTime=(new Date).getTime();break;case"study_error":this._handleStudyError(e);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;ae.logDebug(t+", Study "+this._metaInfo.description+" loading took "+i+" ms"),delete this._loadingStartTime,this._loading=!1,this._status="",this._statusView.update();var r=this._model.paneForSource(this);this._model.recalculatePane(r),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)}},de.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},de.prototype._onDataUnpacked=function(e,t,i){this._isDestroyed||("nochange"!==t&&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))},de.prototype._onDataUpdated=function(e,t,i){if(this.hasBarColorer()&&e.length>0){var r=this.barColorer().firstColoredBar(e[0].index);this._model.mainSeries().invalidateBarStylesCache(r)}null!==t&&this._postProcessGraphics();var n=this._model.paneForSource(this);this._model.recalculatePane(n),this._updateSources()},de.prototype.transformData=function(e){},de.prototype.moveData=function(e){this._ongoingDataUpdate=this._ongoingDataUpdate.then(function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.move(e)}.bind(this))},de.prototype.replaceData=function(e,t,i){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.remove(e+1),this.m_data.addTail(i,t)},de.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},de.processPlotOffsets=function(e,t){t&&t.indexes_replace||(e._plotOffsets=t&&t.offsets||{})},de.prototype._processPlotOffsets=function(e){de.processPlotOffsets(this,e)},de.prototype._mergeData=function(e){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.merge(e)},de.prototype._postProcessGraphics=function(){this._priceAxisViews=[].concat(this._priceAxisViewsBase,R(this))},de.prototype._getNonPriceParent=function(){if(this._nonPriceParent)return this._nonPriceParent;for(var e=this.source();e instanceof de;){var t=e.metaInfo();if(!t.is_price_study||"Compare@tv-basicstudies"===t.id)return this._nonPriceParent=e,e;e=e.source()}},de.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(),r=t.lastBar(),n=null,o=this,s=o._metaInfo.plots;return null===n&&this.data().range(i,r).each((function(t,i){for(var r=0;r= 1");var l=TradingView.clone(defaults("study"));he(l,t);var c=J.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),r&&(s(!(r instanceof e),"propsState should not be an instance of Property"),TradingView.merge(l,r)) ;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!==n){var f=n.model().studiesColorRotatorFactory().getColorRotator(t);"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 r=e.styles[i].color;r&&(e.styles[i].color=t.getColor(r))}return e}(l,f))}r&&TradingView.merge(l.styles,r.styles);return l}(t,r,n,o),u=J.getSourceInputIds(t);if(u.length>0){var h=u[0];l instanceof de?c.inputs[h]="{pid}$0":void 0!==c.inputs[h]&&-1!==c.inputs[h].indexOf("$")&&(c.inputs[h]="close")}return ue(t,a,c)}(t,r,n,o,J.getStudyPropertyRootName(t),a)},t.prepareStudyPropertiesForLoadChart=function(e,t,r,n,o,s){return function(e,t,r,n,o,s,a){var l=function(e,t,r,n,o){var s=i("K4L1");e.version&&r.version&&e.version!==r.version&&ae.logWarn("Serialized metaInfo version "+e.version+" is not equal to the saved state version "+r.version);var a=TradingView.clone(defaults("study"));TradingView.merge(a,TradingView.factoryDefaults(J.getStudyPropertyRootName(e))),he(a,e),TradingView.merge(a,r),a=o.updateStudyState(a,e,t);var l=TradingView.clone(t||e);if(l&&J.versionOf(l)>=1){var c={};s.mergeInputsObjPart(c,l.defaults.inputs),s.mergeInputsObjPart(c,a.inputs),a.inputs=c,delete l.inputs,delete l.defaults.inputs;var u={};TradingView.merge(u,l.defaults),TradingView.merge(u,TradingView.factoryDefaults(J.getStudyPropertyRootName(l))),TradingView.merge(u,a),delete l.defaults,TradingView.merge(u,l),a=u}return a}(e,t,r,0,o);return ue(t||e,s,l)}(e,t,r,0,o,J.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,"get",(function(){return n})),i.d(t,"set",(function(){return o}));var r=i("VVxS");function n(){try{return JSON.parse(r.TVLocalStorage.getItem("application-clipboard"))}catch(e){return null}}function o(e){try{r.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={},r=0;r=o||(this.maxIndex=o),t[s]||(t[s]=[]),t[s].push(n),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 r=Math.round((t+i)/2);1e3*this._marksByIndex[r].time>e?i=r:t=r}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 r=[],n=this._marksBySpan.length;n--;)if(this._marksBySpan[n]){var o=r;r=[];for(var s=o.length,a=0,l=this._marksBySpan[n],c=l.length,u=1/0,h=-1/0,d=0;d=i&&f-h>=i&&(r.push(p),h=f)}for(;a_?"labelled":"sided",y=Object(c.a)(t,_).label,g=f[t][m].format({label:y});return new a.Action({checkable:!1,disabled:!d,label:g,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,r){var n=e.priceScale()===t;return new a.Action({checkable:!0,checked:n,label:i,statName:"ToggleScale",payload:{datasource:e,priceScale:t,undoText:r},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 a.Action({checkable:!0,checked:i.isOverlay(e),label:G,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,l=o.rightPriceScales(),u=o.leftPriceScales(),h=this._createActionScaleDetachRight(e),d=this._createActionScaleDetachLeft(e),p=l.length+u.length+(null===h?0:1)+(null===d?0:1)>2,f={right:{hidden:{checked:{labelled:I,sided:M},unchecked:{labelled:O,sided:A}},visible:{checked:{labelled:k,sided:E},unchecked:{labelled:D,sided:V}}},left:{hidden:{checked:{labelled:I,sided:B},unchecked:{labelled:O,sided:R}},visible:{checked:{labelled:k,sided:N},unchecked:{labelled:D,sided:F}}}},_={left:o.visibleLeftPriceScales(),right:o.visibleRightPriceScales()},m=function(t,i){var r=("right"===i?l:u)[t],n=_[i].includes(r)?"visible":"hidden",o=e.priceScale()===r?"checked":"unchecked",a=s?"labelled":"sided",h=f[i],d={labelled:h.visible.unchecked.labelled,sided:h.visible.unchecked.sided},p=Object(c.a)(i,t).label;return{actionText:h[n][o][a].format({label:p}),undoText:d[a].format({label:p})}};return i.push.apply(i,l.map((function(i,r){var n=m(r,"right");return t._createMoveToScaleAction(e,i,n.actionText,n.undoText)}))),null!==h&&i.push(h),p&&(l.length>0||null!==h)&&i.push(new a.Separator),i.push.apply(i,u.map((function(i,r){var n=m(r,"left");return t._createMoveToScaleAction(e,i,n.actionText,n.undoText)}))),null!==d&&i.push(d),p&&(u.length>0||null!==d)&&i.push(new a.Separator),i.push(this._createActionNoScale(e)),i},e.prototype._createVisualOrderAction=function(e){var t=this._chartWidget.model(),r=t.availableZOrderOperations(e),n=[new a.Action({label:Q,statName:"BringToFront",disabled:!r.bringToFrontEnabled,onExecute:function(){return t.bringToFront(e)}}),new a.Action({label:$,statName:"SendToBack",disabled:!r.sendToBackEnabled,onExecute:function(){return t.sendToBack(e)}}),new a.Action({label:ee,statName:"BringForward",disabled:!r.bringForwardEnabled,onExecute:function(){return t.bringForward(e)}}),new a.Action({label:te,statName:"SendBackward",disabled:!r.sendBackwardEnabled,onExecute:function(){return t.sendBackward(e)}})];return new a.Action({label:ie,icon:i("9dnG"),statName:"VisualOrder",subItems:n})},e.prototype._createActionMergeUp=function(e){var t=this._chartWidget.model();return t.model().isMergeUpAvailableForSource(e)?new a.Action({label:K,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 a.Action({ -label:Z,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 a.Action({label:J,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 a.Action({label:X,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(o.notNull)},e.prototype._createActionMove=function(e){var t=this._mergeContentMenuItems(e);return t.length>0?new a.Action({label:q,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 a.Separator),t.push(this._createActionScale(e));else{0,t.length>0&&!(t[t.length-1]instanceof a.Separator)&&t.push(new a.Separator),s.enabled("symbol_info")&&t.push(o.showSymbolInfoDialog),t.length>0&&!(t[t.length-1]instanceof a.Separator)&&t.push(new a.Separator),t.push(this._createVisualOrderAction([e]));var l=this._createActionMove(e);null!==l&&t.push(l),t.push(this._createActionScale(e)),t.push(i?this._createActionHide(e):this._createActionShow(e)),t.push(new a.Separator),t.push(o.showPriceLine),t.push(new a.Separator),window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist)&&o.addToWatchlist&&t.push(o.addToWatchlist),s.enabled("text_notes")&&t.push(o.addToTextNotes),t[t.length-1]instanceof a.Separator||t.push(new a.Separator),t[t.length-1]instanceof a.Separator&&t.pop()}return t},e.prototype._createActionAddChildStudy=function(e){var t=this,r=this._chartWidget.model().model();return new a.Action({label:re.format({studyTitle:e.title(!0)}),icon:i("CwKc"),statName:"ApplyIndicator",onExecute:function(){var i=t._chartWidget.showIndicators(Object(u.isStudy)(e)?e:void 0);if(i&&Object(u.isStudy)(e)){var n=function(){trackEvent("SOS","Apply SOS","Apply by RC menu")},o=r.studyInserted();o.subscribe(t,n),i.visibilityChanged.subscribe(t,(function(e){e||o.unsubscribe(t,n)}),!0)}}})},e.prototype._createActionAddFundamentals=function(e){return null},e.prototype._createActionShowSymbolInfoDialog=function(e){return new a.Action({label:window.t("Symbol Info..."),icon:i("1pHB"),checkable:!1,statName:"SymbolInfo",onExecute:function(){var t=e.symbol(),i=e.symbolInfo();Object(S.showSymbolInfoDialog)(t,{symbolInfo:i})}})},e.prototype._createActionRemove=function(e){var t=this;return new a.Action({label:ne,icon:i("PgQx"),statName:"RemoveSelectedObject",onExecute:function(){return t._chartWidget.removeDataSources([e])} -})},e.prototype._createActionShowProperties=function(e){var t=this;return new a.Action({label:oe,icon:i("MXV9"),statName:"EditSelectedObject",onExecute:function(){return t._chartWidget.showSourceProperties(e)}})},e.prototype._contextMenuActionsForStudy=function(e){var t=this,i=(this._chartWidget.actions(),e.properties().visible.value()),r=[];if(!e.userEditEnabled())return r;if(this._chartWidget.readOnly())r.push(i?this._createActionHide(e):this._createActionShow(e)),r.push(new a.Separator),e.constructor instanceof d.NonSeriesStudy||r.push(this._createActionScale(e));else{if(s.enabled("study_on_study")&&e.canHaveChildren()&&r.push(this._createActionAddChildStudy(e)),r.length>0&&!(r[r.length-1]instanceof a.Separator)&&r.push(new a.Separator),s.enabled("symbol_info")&&(e instanceof v.study_Compare||e instanceof g.study_Overlay)&&null!==e.symbolInfo()&&(r.push(this._createActionShowSymbolInfoDialog(e)),r.push(new a.Separator)),r.push(this._createVisualOrderAction([e])),!(e.constructor instanceof d.NonSeriesStudy)){var n=this._createActionMove(e);null!==n&&r.push(n),r.push(this._createActionScale(e))}r.push(new a.Separator);var o=e.metaInfo();if(r[r.length-1]instanceof a.Separator||r.push(new a.Separator),e.copiable()){var l=new a.Action({label:le,shortcutHint:Object(f.humanReadableHash)(f.Modifiers.Mod+67),statName:"Copy",onExecute:function(){t._chartWidget.onAppClipboardCopy([e])}});r.push(l)}r.push(i?this._createActionHide(e):this._createActionShow(e)),r.push(this._createActionRemove(e)),r.push(new a.Separator),s.enabled("property_pages")&&new p.a(o).hasUserEditableOptions()&&r.push(this._createActionShowProperties(e)),r[r.length-1]instanceof a.Separator&&r.pop()}return r},e.prototype._createEditAlertDrawingAction=function(e){return new a.Action({label:w.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 a.ActionAsync((function(){var r=[],n=new a.Action({label:ae,statName:"SaveAs",onExecute:function(){i.showSaveDialog((function(t){var r=JSON.stringify(e.template());i.saveTemplate(t,r)}))}});r.push(n);var o=new a.Action({label:se,statName:"ApplyDefault",onExecute:function(){t._chartWidget.model().restorePropertiesForSource(e),window.lineToolPropertiesToolbar.onSourceChanged(e)}});return r.push(o),new Promise((function(e){i.templatesLoaded().then((function(){var e=i.getData();e.length>0&&r.push(new a.Separator),e.forEach((function(e,t){var n=new a.Action({label:e,statName:"ApplyTemplate",onExecute:function(){return i.loadTemplate(e)},toolbox:{type:_.ToolboxType.Delete,action:function(){i.deleteAction(e)}},showToolboxOnHover:!0});r.push(n)}))}),(function(e){b.logWarn(e)})).then((function(){e({label:ue,statName:"Template",subItems:r})}))}))}))}, +label:Z,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 a.Action({label:J,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 a.Action({label:X,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(o.notNull)},e.prototype._createActionMove=function(e){var t=this._mergeContentMenuItems(e);return t.length>0?new a.Action({label:q,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 a.Separator),t.push(this._createActionScale(e));else{0,t.length>0&&!(t[t.length-1]instanceof a.Separator)&&t.push(new a.Separator),s.enabled("symbol_info")&&t.push(o.showSymbolInfoDialog),t.length>0&&!(t[t.length-1]instanceof a.Separator)&&t.push(new a.Separator),t.push(this._createVisualOrderAction([e]));var l=this._createActionMove(e);null!==l&&t.push(l),t.push(this._createActionScale(e)),t.push(i?this._createActionHide(e):this._createActionShow(e)),t.push(new a.Separator),t.push(o.showPriceLine),t.push(new a.Separator),window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist)&&o.addToWatchlist&&t.push(o.addToWatchlist),s.enabled("text_notes")&&t.push(o.addToTextNotes),t[t.length-1]instanceof a.Separator||t.push(new a.Separator),t[t.length-1]instanceof a.Separator&&t.pop()}return t},e.prototype._createActionAddChildStudy=function(e){var t=this,r=this._chartWidget.model().model();return new a.Action({label:re.format({studyTitle:e.title(!0)}),icon:i("CwKc"),statName:"ApplyIndicator",onExecute:function(){var i=t._chartWidget.showIndicators(Object(u.isStudy)(e)?e:void 0);if(i&&Object(u.isStudy)(e)){var n=function(){trackEvent("SOS","Apply SOS","Apply by RC menu")},o=r.studyInserted();o.subscribe(t,n),i.visibilityChanged.subscribe(t,(function(e){e||o.unsubscribe(t,n)}),!0)}}})},e.prototype._createActionAddFundamentals=function(e){return null},e.prototype._createActionShowSymbolInfoDialog=function(e){return new a.Action({label:window.t("Symbol Info..."),icon:i("1pHB"),checkable:!1,statName:"SymbolInfo",onExecute:function(){var t=e.symbol(),i=e.symbolInfo();Object(b.showSymbolInfoDialog)(t,{symbolInfo:i})}})},e.prototype._createActionRemove=function(e){var t=this;return new a.Action({label:ne,icon:i("PgQx"),statName:"RemoveSelectedObject",onExecute:function(){return t._chartWidget.removeDataSources([e])} +})},e.prototype._createActionShowProperties=function(e){var t=this;return new a.Action({label:oe,icon:i("MXV9"),statName:"EditSelectedObject",onExecute:function(){return t._chartWidget.showSourceProperties(e)}})},e.prototype._contextMenuActionsForStudy=function(e){var t=this,i=(this._chartWidget.actions(),e.properties().visible.value()),r=[];if(!e.userEditEnabled())return r;if(this._chartWidget.readOnly())r.push(i?this._createActionHide(e):this._createActionShow(e)),r.push(new a.Separator),e.constructor instanceof d.NonSeriesStudy||r.push(this._createActionScale(e));else{if(s.enabled("study_on_study")&&e.canHaveChildren()&&r.push(this._createActionAddChildStudy(e)),r.length>0&&!(r[r.length-1]instanceof a.Separator)&&r.push(new a.Separator),s.enabled("symbol_info")&&(e instanceof v.study_Compare||e instanceof g.study_Overlay)&&null!==e.symbolInfo()&&(r.push(this._createActionShowSymbolInfoDialog(e)),r.push(new a.Separator)),r.push(this._createVisualOrderAction([e])),!(e.constructor instanceof d.NonSeriesStudy)){var n=this._createActionMove(e);null!==n&&r.push(n),r.push(this._createActionScale(e))}r.push(new a.Separator);var o=e.metaInfo();if(r[r.length-1]instanceof a.Separator||r.push(new a.Separator),e.copiable()){var l=new a.Action({label:le,shortcutHint:Object(f.humanReadableHash)(f.Modifiers.Mod+67),statName:"Copy",onExecute:function(){t._chartWidget.onAppClipboardCopy([e])}});r.push(l)}r.push(i?this._createActionHide(e):this._createActionShow(e)),r.push(this._createActionRemove(e)),r.push(new a.Separator),s.enabled("property_pages")&&new p.a(o).hasUserEditableOptions()&&r.push(this._createActionShowProperties(e)),r[r.length-1]instanceof a.Separator&&r.pop()}return r},e.prototype._createEditAlertDrawingAction=function(e){return new a.Action({label:w.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 a.ActionAsync((function(){var r=[],n=new a.Action({label:ae,statName:"SaveAs",onExecute:function(){i.showSaveDialog((function(t){var r=JSON.stringify(e.template());i.saveTemplate(t,r)}))}});r.push(n);var o=new a.Action({label:se,statName:"ApplyDefault",onExecute:function(){t._chartWidget.model().restorePropertiesForSource(e),window.lineToolPropertiesToolbar.onSourceChanged(e)}});return r.push(o),new Promise((function(e){i.templatesLoaded().then((function(){var e=i.getData();e.length>0&&r.push(new a.Separator),e.forEach((function(e,t){var n=new a.Action({label:e,statName:"ApplyTemplate",onExecute:function(){return i.loadTemplate(e)},toolbox:{type:_.ToolboxType.Delete,action:function(){i.deleteAction(e)}},showToolboxOnHover:!0});r.push(n)}))}),(function(e){S.logWarn(e)})).then((function(){e({label:ue,statName:"Template",subItems:r})}))}))}))}, e.prototype._createActionToggleLockObject=function(e){var t=this,r=e.properties().frozen.value();return new a.Action({label:r?he:de,statName:"ToggleLockSelectedObject",checkable:!0,icon:i(r?"fs3R":"qckB"),onExecute:function(){return t._chartWidget.toggleLockSelectedObject()}})},e.prototype._contextMenuActionsForLineTool=function(e){var t=this,r=[],n=this._chartWidget.actions(),o=(this._chartWidget.model().model(),function(){r.push(t._createVisualOrderAction(e))}),l=function(){var n=e.filter((function(e){return e.cloneable()}));if(n.length>0){var o=new a.Action({label:ce,icon:i("K8V9"),shortcutHint:Object(f.humanReadableModifiers)(f.Modifiers.Mod)+"Drag",doNotBindShortcut:!0,statName:"Clone",onExecute:function(){return t._chartWidget.model().cloneLineTools(n,!1)}},"Clone");r.push(o)}return!!n.length},c=function(){var i=e.filter((function(e){return e.copiable()}));if(i.length>0){var n=new a.Action({label:le,shortcutHint:Object(f.humanReadableHash)(f.Modifiers.Mod+67),statName:"Copy",onExecute:function(){return t._chartWidget.onAppClipboardCopy(i)}},"Copy");r.push(n)}return!!i.length};if(1===e.length){var u=e[0];if(this._chartWidget.readOnly())r.push(n.lineHide);else if(u.userEditEnabled()){if(s.enabled("alerts")&&!this._chartWidget.onWidget())if(u.hasAlert&&u.hasAlert.value())r.push(this._createEditAlertDrawingAction(u)),r.push(new a.Separator);else;if(!s.enabled("charting_library_base")){var h=this._createLineToolTemplateAction(u);null!==h&&r.push(h)}o(),we(this._options,"objectTree")&&n.paneObjectTree&&r.push(n.paneObjectTree),r.push(new a.Separator);var d=l();if((d=d=c()||d)&&r.push(new a.Separator),r.push(this._createActionToggleLockObject(u)),r.push(n.lineHide),r.push(n.lineRemove),r.push(new a.Separator),s.enabled("property_pages")&&Object(m.hasStylesPropertyPage)(u)&&r.push(n.format),u.additionalActions){r.push(new a.Separator);var p=u.additionalActions(this._chartWidget.model());r.push.apply(r,p)}}}else we(this._options,"objectTree")&&n.paneObjectTree&&r.push(n.paneObjectTree),o(),r.push(new a.Separator),l(),c(),r.push(new a.Separator),r.push(n.lineHide),r.push(n.lineRemove);return r},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(),r=[];if(r.push(i.lineHide),window.is_authenticated){var n=e.properties().filter,o=new a.Action({checked:n.value()===PublishedChartsFilter.None,checkable:!0,label:pe,statName:"ToggleAllIdeas",onExecute:function(){return t._chartWidget.model().setProperty(n,PublishedChartsFilter.None,pe)}}),s=new a.Action({checked:n.value()===PublishedChartsFilter.Following,checkable:!0,label:fe,statName:"ToggleIdeasOfPeopleAndUser",onExecute:function(){return t._chartWidget.model().setProperty(n,PublishedChartsFilter.Following,fe)}}),l=new a.Action({checked:n.value()===PublishedChartsFilter.Private,checkable:!0,label:_e, statName:"ToggleUserIdeas",onExecute:function(){return t._chartWidget.model().setProperty(n,PublishedChartsFilter.Private,_e)}});r.push(new a.Separator,o,s,l)}return r},e.prototype._contextMenuActionsForTradingDrawings=function(e){return e.contextMenuItems()},e.prototype._createAlertToggleHorzLineLabelAction=function(e){var t=this,i=getGlobalAlertSettingsProperty().childs().line.childs().visible,r=i.value()?x:C;return new a.Action({checkable:!0,label:P,checked:i.value(),statName:"ToggleExtendAlertLine",onExecute:function(){return t._chartWidget.model().setProperty(i,!i.value(),r)}})},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 a.Separator),i.push(this._createAlertToggleHorzLineLabelAction(e)),i},e.prototype._contextMenuActionsForChartEvents=function(e){var t=this,i=[];if(s.enabled("property_pages")){var r=new a.Action({label:me,statName:"Format",onExecute:function(){return t._chartWidget.showGeneralChartProperties(h.TabNames.eventsAndAlerts)}});i.push(r)}var n=new a.Action({label:ye,statName:"HideEvents",onExecute:function(){return t._chartWidget.model().setProperty(e.properties().visible,!1,ye)}});return i.push(n),i},e}()},Hm6r:function(e,t,i){"use strict";i.r(t),i.d(t,"CrosshairTimeAxisView",(function(){return o}));var r=i("mrSG"),n=i("cgFQ"),o=function(e){function t(t,i,r){void 0===r&&(r=!1);var n=e.call(this,t)||this;return n._indexProvider=i,n._highlighted=r,n}return Object(r.__extends)(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}(n.a)},Hr11:function(e,t,i){"use strict";i.r(t),i.d(t,"lessThan",(function(){return o})),i.d(t,"greaterThan",(function(){return s})),i.d(t,"clamp",(function(){return a})),i.d(t,"sign",(function(){return l})),i.d(t,"isBaseDecimal",(function(){return c})),i.d(t,"greaterOrEqual",(function(){return u})),i.d(t,"equal",(function(){return h})),i.d(t,"log10",(function(){return d})),i.d(t,"defComparator",(function(){return p})),i.d(t,"min",(function(){return f})),i.d(t,"max",(function(){return _})),i.d(t,"ceiledEven",(function(){return m}));var r=i("uOxu"),n=Object(r.getLogger)("Common.MathEx");function o(e,t){return e<=t}function s(e,t){return e>=t}function a(e,t,i){return Math.min(Math.max(e,t),i)}function l(e){return e<0?-1:e>0?1:0}function c(e){if(e<0)return n.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(var t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}function u(e,t,i){return t-e<=i}function h(e,t,i){return Math.abs(e-t)t?1:0}function f(e,t){ if(void 0===t&&(t=p),e.length<1)throw Error("array is empty");for(var i=e[0],r=0;r0&&(i=e[r]);return i}function m(e){var t=Math.ceil(e);return t%2!=0?t-1:t}},HySD:function(e,t,i){"use strict";i.r(t),i.d(t,"ResizerDetacherState",(function(){return s}));var r=i("Eyy1"),n=i("hY0g"),o=i.n(n),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 r=i("mrSG"),n=i("yMne"),o=i("YuHv"),s=function(e){function t(t,i){var r=e.call(this)||this;return r._toolsBootloader=t,r._headerProps=i,r._headerProps.resizerBridge.negotiateHeight(n.HEADER_TOOLBAR_HEIGHT_EXPANDED),r._headerProps.resizerBridge.container.value().appendChild(Object(o.a)()),r}return Object(r.__extends)(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(r.__assign)(Object(r.__assign)({},e._headerProps),{tools:i}))}))},t.prototype._loadHeaderToolbar=function(){return Promise.all([i.e("react"),i.e(43),i.e(44),i.e(73),i.e(12),i.e(15),i.e(40),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 r=i("Eyy1").assert,n=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,y=i("u0yd").PaneRendererArea,g=i("/hKg").PaneRendererCandles,v=i("dBsn").PaneRendererCross,S=i("OYox").PaneRendererCircles,b=i("6Fc/").PaneRendererArrowsUpDownItem,w=i("6Fc/").PaneRendererArrowsUpDown,P=i("gTEF").SelectionRendererArrowsUpDown,C=i("f3xO").PaneRendererUnicodeChar,x=i("gVWb").PaneRendererBackground,T=i("Zp8I").PaneRendererStepLine,L=i("Zy3/").CompositeRenderer,I=i("ga+R"),M=i("Hr11").clamp,O=i("Nu4p"),A=i("23IT"),k=A.LineStudyPlotStyle,E=A.PlotSymbolSize,D=i("972a").MarkLocation,V=i("G3Rl").memoize,B=i("Tmoa"),R=i("k9/m").PlotRowSearchMode,N=i("Kxc7"),F=i("Zp/P"),j=i("Kmdw"),W=i("akof"),z=i("+q2u"),H=i("fxzW"),U=i("P+Pi"),Y=i("IOzl"),G=i("6ptY"),q=i("PF2b"),K=i("V0al");function Z(e,t,i,r){this.m_study=e,this.m_series=t,this.m_model=i,this._plotName=r,this.m_items=[],this._invalidated=!0,this._isMarkersEnabled=N.enabled("source_selection_markers");var n=this.m_study.metaInfo().plots;this._colorer=null,this._palette=null,this._paletterProps=null,this._plotIndex=0;for(var o=0;o=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 r=i("mrSG"),n=i("yMne"),o=i("YuHv"),s=function(e){function t(t,i){var r=e.call(this)||this;return r._toolsBootloader=t,r._headerProps=i,r._headerProps.resizerBridge.negotiateHeight(n.HEADER_TOOLBAR_HEIGHT_EXPANDED),r._headerProps.resizerBridge.container.value().appendChild(Object(o.a)()),r}return Object(r.__extends)(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(r.__assign)(Object(r.__assign)({},e._headerProps),{tools:i}))}))},t.prototype._loadHeaderToolbar=function(){return Promise.all([i.e("react"),i.e(43),i.e(44),i.e(73),i.e(12),i.e(15),i.e(40),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 r=i("Eyy1").assert,n=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,y=i("u0yd").PaneRendererArea,g=i("/hKg").PaneRendererCandles,v=i("dBsn").PaneRendererCross,b=i("OYox").PaneRendererCircles,S=i("6Fc/").PaneRendererArrowsUpDownItem,w=i("6Fc/").PaneRendererArrowsUpDown,P=i("gTEF").SelectionRendererArrowsUpDown,C=i("f3xO").PaneRendererUnicodeChar,x=i("gVWb").PaneRendererBackground,T=i("Zp8I").PaneRendererStepLine,L=i("Zy3/").CompositeRenderer,I=i("ga+R"),M=i("Hr11").clamp,O=i("Nu4p"),A=i("23IT"),k=A.LineStudyPlotStyle,E=A.PlotSymbolSize,D=i("972a").MarkLocation,V=i("G3Rl").memoize,B=i("Tmoa"),R=i("k9/m").PlotRowSearchMode,N=i("Kxc7"),F=i("Zp/P"),j=i("Kmdw"),W=i("akof"),z=i("+q2u"),H=i("fxzW"),U=i("P+Pi"),Y=i("IOzl"),G=i("6ptY"),q=i("PF2b"),K=i("V0al");function Z(e,t,i,r){this.m_study=e,this.m_series=t,this.m_model=i,this._plotName=r,this.m_items=[],this._invalidated=!0,this._isMarkersEnabled=N.enabled("source_selection_markers");var n=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-=r,i+=r):(t+=r,i-=r);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._bsearch(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._bsearch(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=M(this._getTranspValue(),0,100),y={},g=function(e,t){var i=e+"@"+t;return y[i]||(this._plotName&&"vol"===this._plotName?y[i]=B.generateColor(e,t):y[i]=B.generateColor(e,t,!0)),y[i]}.bind(this);if(f.each(function(e,t){e+=r,e=Math.floor(e);var i=null==(h=t[this._plotIndex+1]);if(l&&i)return!1;var o=new n(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)?g(d,m):d}else{d=s.color.value();o.style.color=g(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 v=I(t,i);this._selectionData={points:[],bgColor:this.m_model.backgroundColor().value(),visible:!0},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 r=t[this._plotIndex+1],a=new n(Math.floor(e)-.5),l=isNumber(s)?s:50;l=Math.min(l,100),l=Math.max(l,0);if(null!=r){var u=o.valToIndex?o.valToIndex[r]:r -;a.color=B.generateColor(i[u].color.value(),l)}else a.color=null;return 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 L;return t.append(new x(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 r=this.m_series.nearestIndex(i.firstBar(),R.NearestRight),n=this.m_series.nearestIndex(i.lastBar(),R.NearestLeft),o=this.m_study.offset(this.m_plotName);o>0?(r-=o,n+=o):(r+=o,n-=o);var s=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName);if(!(s>n)){r=Math.max(s,r);var a=this.m_study.data(),l=this.m_study.firstValue(),c=a.range(r,n),u=this._getTranspValue(),d=I(r,n),p=this.m_model.selection().isSelected(this.m_study);this.m_selectionData=p?{points:[],hittestResult:h.REGULAR,vertOffset:0,isDark:this.m_model.isDark(),bgColor:this.m_model.backgroundColor().value(),visible:!0}:null;var f,_,m=this.m_series.properties().style.value(),y=m===TradingView.Series.STYLE_LINE?"lineStyle":m===TradingView.Series.STYLE_AREA?"areaStyle":null;y?(f=this.m_series.properties()[y].priceSource.value(),_=f):(f="high",_="low");var g=this.m_study.priceScale().isInverted(),v=t.coordinateToPrice(t.height()*t.topMargin(),l),S=t.coordinateToPrice(t.height()*(1-t.bottomMargin()),l);this._topCoord=g?S:v,this._bottomCoord=g?v:S,c.each(function(e,t){var i=Math.floor(e+o);if(null==(l=t[this.m_plotIndex+1]))return!1;var r=this._createItem(i,l,f,_);if(null!=r){var n=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor;if(this._colorer&&n){var s,a,l=t[this._colorer+1];if(r.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,r.style.color=B.generateColor(s,u)}else s=this.m_study.properties().styles[this.m_plotName].color.value(),a=100,r.style.color=B.generateColor(s,100);r.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(r.style||(r.style={}),null!=l){c=this._textPalette.valToIndex?this._textPalette.valToIndex[l]:l;m=this._textPaletterProps.colors[c].color.value(),r.style.textColor=B.generateColor(m,u)}else m=this.m_study.properties().styles[this.m_plotName].textColor.value(),r.style.textColor=B.generateColor(m,100)} +Z.isIndexValid=function(e,t){return null!==e&&e>=0&&e0?(t-=r,i+=r):(t+=r,i-=r);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._bsearch(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._bsearch(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=M(this._getTranspValue(),0,100),y={},g=function(e,t){var i=e+"@"+t;return y[i]||(this._plotName&&"vol"===this._plotName?y[i]=B.generateColor(e,t):y[i]=B.generateColor(e,t,!0)),y[i]}.bind(this);if(f.each(function(e,t){e+=r,e=Math.floor(e);var i=null==(h=t[this._plotIndex+1]);if(l&&i)return!1;var o=new n(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)?g(d,m):d}else{d=s.color.value();o.style.color=g(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 v=I(t,i);this._selectionData={points:[],bgColor:this.m_model.backgroundColor().value(),visible:!0},this._selectionData.hittestResult=h.REGULAR;for(var b=0;b0?(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 r=t[this._plotIndex+1],a=new n(Math.floor(e)-.5),l=isNumber(s)?s:50;l=Math.min(l,100),l=Math.max(l,0);if(null!=r){var u=o.valToIndex?o.valToIndex[r]:r +;a.color=B.generateColor(i[u].color.value(),l)}else a.color=null;return 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 L;return t.append(new x(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 r=this.m_series.nearestIndex(i.firstBar(),R.NearestRight),n=this.m_series.nearestIndex(i.lastBar(),R.NearestLeft),o=this.m_study.offset(this.m_plotName);o>0?(r-=o,n+=o):(r+=o,n-=o);var s=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName);if(!(s>n)){r=Math.max(s,r);var a=this.m_study.data(),l=this.m_study.firstValue(),c=a.range(r,n),u=this._getTranspValue(),d=I(r,n),p=this.m_model.selection().isSelected(this.m_study);this.m_selectionData=p?{points:[],hittestResult:h.REGULAR,vertOffset:0,isDark:this.m_model.isDark(),bgColor:this.m_model.backgroundColor().value(),visible:!0}:null;var f,_,m=this.m_series.properties().style.value(),y=m===TradingView.Series.STYLE_LINE?"lineStyle":m===TradingView.Series.STYLE_AREA?"areaStyle":null;y?(f=this.m_series.properties()[y].priceSource.value(),_=f):(f="high",_="low");var g=this.m_study.priceScale().isInverted(),v=t.coordinateToPrice(t.height()*t.topMargin(),l),b=t.coordinateToPrice(t.height()*(1-t.bottomMargin()),l);this._topCoord=g?b:v,this._bottomCoord=g?v:b,c.each(function(e,t){var i=Math.floor(e+o);if(null==(l=t[this.m_plotIndex+1]))return!1;var r=this._createItem(i,l,f,_);if(null!=r){var n=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor;if(this._colorer&&n){var s,a,l=t[this._colorer+1];if(r.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,r.style.color=B.generateColor(s,u)}else s=this.m_study.properties().styles[this.m_plotName].color.value(),a=100,r.style.color=B.generateColor(s,100);r.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(r.style||(r.style={}),null!=l){c=this._textPalette.valToIndex?this._textPalette.valToIndex[l]:l;m=this._textPaletterProps.colors[c].color.value(),r.style.textColor=B.generateColor(m,u)}else m=this.m_study.properties().styles[this.m_plotName].textColor.value(),r.style.textColor=B.generateColor(m,100)} return p&&-1!==d.indexOf(e)&&this.m_selectionData.points.push(r),this.m_items.push(r),!1}}.bind(this)),this._convertItemsToCoordinates()}}}},X.prototype._updateRenderer=function(){this._updateImpl();var e=this.m_model.timeScale(),t={},i=this._getTranspValue(),r=e.barSpacing(),n=this._calculateShapeHeight(r),o=this.m_study.properties().styles[this.m_plotName].location.value(),s=this._calculateVerticalOffset(o,n+n/2);t.barSpacing=r,t.items=this.m_items,t.color=B.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),i),t.height=n,t.vertOffset=s;var a=this.m_study.properties().styles[this.m_plotName].plottype.value(),l=O.plotShapesData[a],c=new L;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(r){}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),M(e,0,100)},X.prototype._createItem=function(e,t,i,r){var o=this.m_study.properties().styles[this.m_plotName].location.value();if(!t&&o!==D.Absolute)return null;switch(o){case D.AboveBar:var s=this._getSeriesVal(i,e);if(void 0===s||null==s)return null;var a=s;break;case D.BelowBar:var l=this._getSeriesVal(r,e);if(void 0===l||null==l)return null;a=l;break;case D.Top:a=this._topCoord;break;case D.Bottom:a=this._bottomCoord;break;case D.Absolute:a=t;break;default:throw new Error("Bad value: "+o)}return new n(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 D.AboveBar:case D.Bottom:i=-t;break;case D.BelowBar:case D.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(),r={},n=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(),n),c=n>19?n-10:0,u=this._calculateVerticalOffset(a,Math.round(1.5*t));r.barSpacing=o,r.items=this.items(),r.color=l,r.borderColor=B.generateColor(e.color.value(),c),r.height=t,r.vertOffset=u;var h=e.plottype.value(),p=O.plotShapesData[h],f=new L,_=e.text?e.text.value():void 0;if(void 0!==_&&""!==_.trim()){var m=_.trim().replace(/\\n/gm,"\n");m=TradingView.cleanButAmpersand(m,!0),r.text=m,r.fontSize=12;var y=e.textColor?e.textColor.value():void 0;r.textColor=y?B.generateColor(y,n):l}null!=p&&f.append(new TradingView[p.paneRendererClass](r)),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,r={},n=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(),n),c=this._calculateVerticalOffset(a,i);r.items=this.items(),r.barSpacing=o,r.char=e.char.value(),r.height=i,r.vertOffset=c,r.color=l;var u=new L,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),r.text=p,r.fontSize=12;var f=e.textColor?e.textColor.value():void 0;r.textColor=f?B.generateColor(f,n):l}return u.append(new C(r)),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=M(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 r=u(e.colorup),n=r?100*(1-r[3]):0,o=u(e.colordown),s=o?100*(1-o[3]):0;e.colorBorderUp=B.generateColor("#000000",n),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 L;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,r){if(0!==t){Math.abs(t)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(t));var n,o=t>0;if(o){var s=this._getSeriesVal(r,e);if(void 0===s||null==s)return null;n=s}else{var a=this._getSeriesVal(i,e);if(void 0===a||null==a)return null;n=a}return new b(e,n,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()),r=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value());if(i>r){var n=i;i=r,r=n}for(var o=(r-i)/this._maxAbsValue,s=this.m_items,a=0;ai)){t=Math.max(r,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,r={},n=TradingView.OPEN_PLOT;n<=TradingView.CLOSE_PLOT;++n){var o=t[this._ohlcPlotIndexes[n]+1];if(null==o){i=!1;break}r[n]=o}if(!i)return!1;var s=r[TradingView.OPEN_PLOT],a=r[TradingView.CLOSE_PLOT],u=Math.max(s,r[TradingView.HIGH_PLOT],r[TradingView.LOW_PLOT],a),h=Math.min(s,r[TradingView.HIGH_PLOT],r[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=I(t,i);this._selectionData={points:[],hittestResult:h.REGULAR,isDark:this.m_model.isDark(),bgColor:this.m_model.backgroundColor().value(),visible:!0};for(var d=0;dthis._maxAbsValue&&(this._maxAbsValue=Math.abs(t));var n,o=t>0;if(o){var s=this._getSeriesVal(r,e);if(void 0===s||null==s)return null;n=s}else{var a=this._getSeriesVal(i,e);if(void 0===a||null==a)return null;n=a}return new S(e,n,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()),r=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value());if(i>r){var n=i;i=r,r=n}for(var o=(r-i)/this._maxAbsValue,s=this.m_items,a=0;ai)){t=Math.max(r,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,r={},n=TradingView.OPEN_PLOT;n<=TradingView.CLOSE_PLOT;++n){var o=t[this._ohlcPlotIndexes[n]+1];if(null==o){i=!1;break}r[n]=o}if(!i)return!1;var s=r[TradingView.OPEN_PLOT],a=r[TradingView.CLOSE_PLOT],u=Math.max(s,r[TradingView.HIGH_PLOT],r[TradingView.LOW_PLOT],a),h=Math.min(s,r[TradingView.HIGH_PLOT],r[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=I(t,i);this._selectionData={points:[],hittestResult:h.REGULAR,isDark:this.m_model.isDark(),bgColor:this.m_model.backgroundColor().value(),visible:!0};for(var d=0;di){var s=n(e,i,t,r,o);return s.count=-s.count,s}return a(e,t,1,(function(e,t){return t>i||0!==r&&e>r}),o)}function o(e,t,i,r){void 0===r&&(r=!1);var n=i<0?-1:1;return a(e,t,n,(function(e,t){return e>=i*n}),r)}function s(e,t,i){var r=i<0?-1:1;return a(e,t,r,(function(e,t){return e>=i*r}),!0).times}function a(e,t,i,n,o){var s=0,a=t;e.moveTo(a);for(var l=0,c=Number.MAX_VALUE,u=!1,h=t,d=[];!n(s,a);){if(l>15)throw new Error("Internal error 0x10 while extrapolating.");var p=e.indexOfBar(a);if(p===r.SessionStage.PRE_SESSION&&1===i)a=e.startOfBar(0),e.moveTo(a);else if(p===r.SessionStage.PRE_SESSION&&-1===i)a=e.startOfBar(r.SessionStage.PRE_SESSION)-1,e.moveTo(a);else if(p===r.SessionStage.POST_SESSION&&1===i)a=e.startOfBar(r.SessionStage.POST_SESSION),e.moveTo(a);else{if(p===r.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(r.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-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-600","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-header-bg":"color-mirage-3","color-screener-header-bg-hover":"color-ebony-clay","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-delay-mode":"color-berry-pink-600","color-delay-mode-bg":"color-berry-pink-600","color-eod-mode":"color-berry-pink-600","color-eod-mode-bg":"color-berry-pink-600","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"}') },IOzl:function(e,t,i){"use strict";i.r(t);var r,n=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(n.__extends)(t,e),t.prototype.setData=function(e,t){this._setBaseData(e,t);for(var i=0,r=this._items;i=this._sessionEndMs?u.SessionStage.POST_SESSION:d(r.time_seconds_diff(e,this._sessionStartMs)/this._periodSec)},t.prototype.startOfBar=function(e){if(e===u.SessionStage.PRE_SESSION){var t=r.get_cal_from_unix_timestamp_ms(this._session.timezone,this._sessionStartMs-1),i=this._session.spec.alignToNearestSessionEnd(t,-1);return r.cal_to_utc(this._session.timezone,i)}if(e===u.SessionStage.POST_SESSION)return this._sessionEndMs;if(e<0)throw new Error("Negative offset is not supported");return this._sessionStartMs+r.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+r.time_seconds(this._periodSec*(e+1)-1)},t.prototype.moveTo=function(e){ var t=this._session.timezone,i=r.utc_to_cal(t,e),n=this._session.spec.alignToSessionStart(i);this._sessionStartMs=r.cal_to_utc(t,i),r.add_minutes(i,n),this._sessionEndMs=r.cal_to_utc(t,i)},t.prototype.moveNext=function(){this.moveTo(this._sessionEndMs)},t}(f),m=i("OBgQ");function y(e,t){var i=r.clone(t),n=e.businessDaysToCalendarDays(i,1);n>1&&r.add_date(i,n-1);var o=e.leftBorderOfDailyBar(i);if(null===o)throw new Error("Cannot calculate left border of daily bar");return r.cal_to_utc(r.get_timezone(e.timezone()),o)}var g=function(e){function t(t,i,r,n,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 m.a(0,0,0),s._periodEndDay=new m.a(0,0,0),s._period=r,s._sessionTgt=t,s._builder=n,s._useBusinessDays=o,s._sessionSrc=o?new p("Etc/UTC","24x7"):i||t,s}return Object(c.__extends)(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=m.a.fromCalendar(r.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e));return t.before(this._periodStartDay)?u.SessionStage.PRE_SESSION:this._periodEndDay.before(t)?u.SessionStage.POST_SESSION:0}return e=this._periodEnd?u.SessionStage.POST_SESSION:0},t.prototype.startOfBar=function(e){if(e===u.SessionStage.PRE_SESSION){var t=r.get_cal_from_unix_timestamp_ms(this._sessionTgt.timezone,this._periodStart-1),i=this._sessionTgt.spec.alignToNearestSessionEnd(t,-1);return r.cal_to_utc(this._sessionTgt.timezone,i)-1}return e===u.SessionStage.POST_SESSION||e>0?this._periodEnd:e===u.SessionStage.LASTBAR_SESSION?this._periodLastBarStart:this._periodStart},t.prototype.moveTo=function(e){var t=r.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e);this._sessionSrc.spec.correctTradingDay(t);var i=r.get_year(t),n=this._indexOfPeriodInYear(t),o=n+this._period,s=this._sessionTgt.spec,a=this._sessionTgt.timezone,l=this._builder.startOfPeriod(a,n,i);this._periodStart=y(s,l);var c=r.clone(l),u=s.businessDaysToCalendarDays(c,1);u>1&&r.add_date(c,u-1),this._periodStartDay=m.a.fromCalendar(c);var h=this._builder.startOfPeriod(a,o,i);this._periodEnd=y(s,h);var d=r.clone(h);for(r.add_date(d,-1);s.isCalWeekEnd(d);)r.add_date(d,-1);this._periodEndDay=m.a.fromCalendar(d),r.add_date(h,-1),function(e,t){for(;e.isCalWeekEnd(t);)r.add_date(t,-1)}(this._sessionTgt.spec,h),this._periodLastBarStart=y(s,h),(this._periodLastBarStart=this._periodLastBarStart},t.prototype.currentRange=function(){ -return{from:this._periodStartDay,to:this._periodEndDay}},t.prototype.indexOfBarInYear=function(e){var t=r.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e),i=r.get_year(t),n=this._builder.indexOfPeriod(t),o=this._sessionTgt.timezone,s=this._builder.startOfPeriod(o,n,i),a=y(this._sessionTgt.spec,s);return s=r.get_cal_from_unix_timestamp_ms(r.get_timezone("Etc/UTC"),a),i=0&&(n-=7),d((n+i)/7))}var b=function(){function e(){}return e.prototype.indexOfPeriod=function(e){return r.get_day_of_year(e)-1},e.prototype.startOfPeriod=function(e,t,i){var n=r.days_per_year(i);return r.get_cal(r.get_timezone("Etc/UTC"),i,r.JANUARY,1+Math.min(t,n))},e}(),w=function(e){function t(t){var i=e.call(this)||this;return i._sessionsSpec=t,i}return Object(c.__extends)(t,e),t.prototype.indexOfPeriod=function(t){return e.prototype.indexOfPeriod.call(this,t)-function(e,t){var i=S(e,t),n=r.get_cal(r.get_timezone("Etc/UTC"),r.get_year(t),r.JANUARY,1);r.add_date(n,7*i);var o=i*e.weekEndsCount()+e.holidaysFromYearStart(n),s=r.get_day_of_year(t)-r.get_day_of_year(n);return o+s-e.calendarDaysToBusinessDays(n,s)}(this._sessionsSpec,t)},t.prototype.startOfPeriod=function(t,i,n){var o=7-this._sessionsSpec.weekEndsCount(),s=Math.max(0,d(i/o)-1),a=r.get_cal(r.get_timezone("Etc/UTC"),n,r.JANUARY,1),l=r.get_days_per_year(a);if(r.add_date(a,7*s),(i-=o*s-this._sessionsSpec.holidaysFromYearStart(a))>0){var c=this._sessionsSpec.businessDaysToCalendarDays(a,i);r.add_date(a,c)}var u=r.get_day_of_year(a)-1;return nr.get_days_per_year(n)?this.startOfPeriod(e,0,i+1):(r.add_date(n,s),n)},e}(),x=function(){function e(){}return e.prototype.indexOfPeriod=function(e){return r.get_month(e) +return{from:this._periodStartDay,to:this._periodEndDay}},t.prototype.indexOfBarInYear=function(e){var t=r.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e),i=r.get_year(t),n=this._builder.indexOfPeriod(t),o=this._sessionTgt.timezone,s=this._builder.startOfPeriod(o,n,i),a=y(this._sessionTgt.spec,s);return s=r.get_cal_from_unix_timestamp_ms(r.get_timezone("Etc/UTC"),a),i=0&&(n-=7),d((n+i)/7))}var S=function(){function e(){}return e.prototype.indexOfPeriod=function(e){return r.get_day_of_year(e)-1},e.prototype.startOfPeriod=function(e,t,i){var n=r.days_per_year(i);return r.get_cal(r.get_timezone("Etc/UTC"),i,r.JANUARY,1+Math.min(t,n))},e}(),w=function(e){function t(t){var i=e.call(this)||this;return i._sessionsSpec=t,i}return Object(c.__extends)(t,e),t.prototype.indexOfPeriod=function(t){return e.prototype.indexOfPeriod.call(this,t)-function(e,t){var i=b(e,t),n=r.get_cal(r.get_timezone("Etc/UTC"),r.get_year(t),r.JANUARY,1);r.add_date(n,7*i);var o=i*e.weekEndsCount()+e.holidaysFromYearStart(n),s=r.get_day_of_year(t)-r.get_day_of_year(n);return o+s-e.calendarDaysToBusinessDays(n,s)}(this._sessionsSpec,t)},t.prototype.startOfPeriod=function(t,i,n){var o=7-this._sessionsSpec.weekEndsCount(),s=Math.max(0,d(i/o)-1),a=r.get_cal(r.get_timezone("Etc/UTC"),n,r.JANUARY,1),l=r.get_days_per_year(a);if(r.add_date(a,7*s),(i-=o*s-this._sessionsSpec.holidaysFromYearStart(a))>0){var c=this._sessionsSpec.businessDaysToCalendarDays(a,i);r.add_date(a,c)}var u=r.get_day_of_year(a)-1;return nr.get_days_per_year(n)?this.startOfPeriod(e,0,i+1):(r.add_date(n,s),n)},e}(),x=function(){function e(){}return e.prototype.indexOfPeriod=function(e){return r.get_month(e) },e.prototype.startOfPeriod=function(e,t,i){if(t<0){var n=d((11-t)/12);i-=n,t+=12*n}else t>r.DECEMBER&&(i++,t=r.JANUARY);return r.get_cal(r.get_timezone("Etc/UTC"),i,t,1)},e}();function T(e,t,i,r){void 0===r&&(r=!1);var n=o.Interval.parse(e),s=n.multiplier();return n.kind()===o.ResolutionKind.Minutes?new _(60*s,t):n.kind()===o.ResolutionKind.Seconds?new _(s,t):n.kind()===o.ResolutionKind.Range?new _(60*s,t):new g(t,i,s,function(e,t){switch(e){case o.ResolutionKind.Days:return new P(t);case o.ResolutionKind.Weeks:return new C(t);case o.ResolutionKind.Months:return new x}throw new Error("Unknown dwm resolution: "+e)}(n.kind(),t),r)}function L(e,t,i,r,n,a,l){var c,u,h=new p("Etc/UTC",e,t,i),d=o.Interval.parse(n+r),f=d.isDWM();f?(u=s(d,l),c=864e5):(u=d.inMilliseconds(),c=60*h.spec.findSession(0,0,0).getEntry().length()*1e3);var _=c/u,m=(f?7:7-h.spec.weekEndsCount())*_;return as.startOffset()+s.length()&&n===s.dayOfWeek()-1&&(n++,o-=1440),n===s.dayOfWeek()&&o>=s.startOffset()&&o0&&e.stroke(),this._data.fillBackground&&(e.fillStyle=this.getColor(),e.fill())}},e}()},InMJ:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Flat Bottom");function a(e,t){this._constructor="LineToolFlatBottom";var n=t||a.createProperties();r.call(this,e,n),this.version=a.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(a,r),a.version=1,a.prototype.pointsCount=function(){return 3},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Flat Bottom"},a.prototype.hasEditableCoordinates=function(){return!1},a.prototype.addPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),r.prototype.addPoint.call(this,e)},a.prototype.setLastPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),r.prototype.setLastPoint.call(this,e)},a.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,void(this._points[2].price=t.price);r.prototype.setPoint.call(this,e,t)},a.prototype.canHasAlert=function(){return!0},a.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 r=this._points[2];r.time=t.time,r.index=t.index;var n,o,s,a,l={price:r.price,time:e.time,index:e.index},c=[];r.index<=l.index?(c.push(r),c.push(l)):(c.push(l),c.push(r)),i[0].price>c[0].price?(n=i,o=c):c[0].price>i[0].price||c[1].price>i[1].price?(n=c,o=i):(n=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(n,"Upper",s,a),this._linePointsToAlertPlot(o,"Lower",u,a)]},a.prototype.getInputsPropertyPage=function(){return null},a.prototype.getStylesPropertyPage=function(){return o.LineToolFlatBottomStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("vm8R").GeneralTrendFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolflatbottom",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolFlatBottom=a},IzGk:function(e,t,i){"use strict";i.r(t),i.d(t,"translatedIntervalString",(function(){return n}));i("YFKU");var r=i("pPtI");function n(e){var t=Object(r.getTranslatedResolutionModel)(e,!0);return null===t?e:t.multiplier+(t.mayOmitShortKind?"":t.shortKind)}},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 r}));var r=function(e,t){var i,r,n=0;function o(){e.apply(r,i)}return function(){r=this,i=arguments,clearTimeout(n),n=setTimeout(o,t)}}},JT5O:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyMarket",(function(){return o}));var r=i("aIyQ"),n=i.n(r),o=function(){function e(e,t){this.visibilityChanged=new n.a,this._dialogPromise=null,this._dialog=null,this._chartWidgetCollection=e,this._options=t}return e.prototype.isVisible=function(){return null!==this._dialog&&this._dialog.isVisible()},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 r=void 0;r=Promise.all([i.e("react"),i.e(3),i.e(4),i.e(6),i.e(7),i.e(9),i.e(11),i.e(16),i.e(32),i.e(63),i.e(64),i.e(72),i.e(0),i.e(5),i.e(13),i.e("study-market")]).then(i.bind(null,"zbLM")).then((function(e){return new e.IndicatorsLibraryContainer(t._chartWidgetCollection,t._options)})),this._dialogPromise=r.then((function(i){t._dialog=i,t._dialog.getVisibilityChanged().subscribe(null,(function(e){t.visibilityChanged.fire(e)})),t._dialog.open(e)}))}return this._dialogPromise},e}()},JcHK:function(e,t,i){"use strict";function r(e){return e.getAll().some((function(e){return e.isInitialized()}))}function n(e,t){var i=e.getAll(),r=function(){t(),i.forEach((function(e){e.chartWidgetInitialized.unsubscribe(null,r)}))};i.forEach((function(e){e.chartWidgetInitialized.subscribe(null,r,!0)}))}i.r(t),i.d(t,"isAnyChartWidgetInitialized",(function(){return r})),i.d(t,"waitAnyChartWidgetInitialized",(function(){return n}))},JjUe:function(e,t,i){"use strict";i.r(t), -i.d(t,"OverlayDataWindowView",(function(){return S}));var r=i("mrSG"),n=i("ivNn"),o=i("4miz"),s=i("GH0z"),a=i("k9/m"),l=i("7qT/"),c=i("Ialn"),u=i("qFKp"),h=i("38az"),d=i("e92V"),p=i("mMWL"),f=i("Tmoa"),_=u.CheckMobile.any(),m=_&&!0,y=new s.PercentageFormatter,g=window.t("n/a"),v=g+" ("+g+"%)",S=function(e){function t(t,i){var r=e.call(this)||this;return r._invalidated=!0,r._study=t,r._model=i,r._items.push(new o.a(window.t("Open"),"")),r._items.push(new o.a(window.t("High"),"")),r._items.push(new o.a(window.t("Low"),"")),r._items.push(new o.a(window.t("Close"),"")),r._items.push(new o.a("","")),r._items.push(new o.a("","")),r._items.push(new o.a(window.t("Change"),"")),r.update(),r}return Object(r.__extends)(t,e),t.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},t.prototype.update=function(){this._invalidated=!0},t.prototype._updateImpl=function(){if(this._header=this._study.title(),this._items[0].setValue(g),this._items[1].setValue(g),this._items[2].setValue(g),this._items[3].setValue(g),this._items[6].setValue(v),!this._model.timeScale().isEmpty()&&0!==this._study.data().size()){for(var e=this._showLastPriceAndChangeOnly(),t=0,i=this._items;t=0?0:1,basedOnPrevClose:n.change>=0?0:1}}}else{var o=this._study.data().search(i-1,a.PlotRowSearchMode.NearestLeft,1),s=o&&o.value[4]||null;if(null!==s)return{values:{change:e-s,percentChange:Object(l.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}}},t.prototype._color=function(e,t,i){ +i.d(t,"OverlayDataWindowView",(function(){return b}));var r=i("mrSG"),n=i("ivNn"),o=i("4miz"),s=i("GH0z"),a=i("k9/m"),l=i("7qT/"),c=i("Ialn"),u=i("qFKp"),h=i("38az"),d=i("e92V"),p=i("mMWL"),f=i("Tmoa"),_=u.CheckMobile.any(),m=_&&!0,y=new s.PercentageFormatter,g=window.t("n/a"),v=g+" ("+g+"%)",b=function(e){function t(t,i){var r=e.call(this)||this;return r._invalidated=!0,r._study=t,r._model=i,r._items.push(new o.a(window.t("Open"),"")),r._items.push(new o.a(window.t("High"),"")),r._items.push(new o.a(window.t("Low"),"")),r._items.push(new o.a(window.t("Close"),"")),r._items.push(new o.a("","")),r._items.push(new o.a("","")),r._items.push(new o.a(window.t("Change"),"")),r.update(),r}return Object(r.__extends)(t,e),t.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},t.prototype.update=function(){this._invalidated=!0},t.prototype._updateImpl=function(){if(this._header=this._study.title(),this._items[0].setValue(g),this._items[1].setValue(g),this._items[2].setValue(g),this._items[3].setValue(g),this._items[6].setValue(v),!this._model.timeScale().isEmpty()&&0!==this._study.data().size()){for(var e=this._showLastPriceAndChangeOnly(),t=0,i=this._items;t=0?0:1,basedOnPrevClose:n.change>=0?0:1}}}else{var o=this._study.data().search(i-1,a.PlotRowSearchMode.NearestLeft,1),s=o&&o.value[4]||null;if(null!==s)return{values:{change:e-s,percentChange:Object(l.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}}},t.prototype._color=function(e,t,i){ var r=Object(f.resetTransparency)(h.SeriesBarColorer.upColor(this._study.properties())),n=Object(f.resetTransparency)(h.SeriesBarColorer.downColor(this._study.properties()));if(i&&!m)return t.priceDirection?r:n;var o=this._study.properties().childs().style.value();if(10===o){var s=this._study.barColorer().barStyle(e,!1);return null!=s.barBorderColor?Object(f.resetTransparency)(s.barBorderColor):Object(f.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?r:n:0===t.priceDirection.basedOnCurrentBar?r:n},t}(o.b)},JmuD:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)},t.hasProperty=function(e,t){return t in e}},K4L1:function(e,t,i){"use strict";var r=i("Eyy1").assert,n=i("lCO3").Version,o=i("uOxu").getLogger("Chart.Study.Versioning"),s=i("Wt0y"),a=i("0YCj"),l=i("TcSq").extractPineId,c=i("Si3H").migrateMetaInfoAndPropState;function u(e,t){if(!e)throw new Error("No studies metainfo");var r=i("EyEd");if(this._studiesMetainfo=e,!t)throw new Error("No studies migrations");this._studiesMigrations=t,this._migrations={};for(var n=0;n=22)return t;for(var i={},r=0,n=0;;){var o=t[n];if(void 0===o)break;var s=t[o.id];o.isFake&&(o.id="in_"+r++),i[n]=o,i[o.id]=s,n++}return i}]}u.prototype.updateMetaInfo=function(e){if(!e)return e;r(!e.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync");for(var t=null,i=this._studiesMetainfo,n=0;n=12&&l<=26){var c={};for(s=0;s=12&&c<=26){var h=n.columns;n.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 r=0;ri&&(a.max=i))}if(e&&e.inputs){var n=u.splitInputs(e.inputs),o=n.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(n.obj,n.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 r=u.splitInputs(e.inputs);e.inputs=r.obj;var n=a.versionOf(t);ni&&(i=n))}e[i+1]=t},u.splitInputs=function(e){var t={},i={};for(var r in e)isNumber(parseInt(r,10))?t[r]=e[r]:i[r]=e[r];return{arr:t,obj:i}},u.findInputKeyById=function(e,t){var i=null;for(var r in e)if(isNumber(parseInt(r,10))&&e[r].id===t){i=r;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";Object.defineProperty(t,"__esModule",{value:!0}),t.dur=350,t.easingFunc={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){ +TradingView.merge(e,_)}}if("MA"===t.id){var b=new a({id:"MAExp",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgExp",type:"line"}],palettes:{}}),S=new a({id:"MASimple",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgSimple",type:"line"}],palettes:{}}),w=new a({id:"MAVolumeWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgVolumeWeighted",type:"line"}],palettes:{}}),P=new a({id:"MAWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgWeighted",type:"line"}],palettes:{}});switch(e.inputs.type){case"exp":t=b;break;case"simple":t=S;break;case"weighted":t=P;break;case"volume weighted":t=w}e.styles[t.plots[0].id]=e.styles.MovAvg,delete e.styles.MovAvg,delete e.inputs.type}return i.oldShowStudyLastValueProperty&&(e.oldShowLastValue=e.showLastValue),delete e.showLastValue,delete e.showStudyArguments,c(t,e),{propsState:e,metaInfo:t}},u.mergeInputs=function(e,t){u.mergeInputsArrPart(e,t),u.mergeInputsObjPart(e,t)},u.mergeInputsArrPart=function(e,t){var i=u.splitInputs(t);for(var r in i.arr){var n=u.findInputKeyById(e,i.arr[r].id);n?TradingView.merge(e[n],i.arr[r]):u.appendInputInfoToArr(e,i.arr[r])}},u.mergeInputsObjPart=function(e,t){var i=u.splitInputs(t);TradingView.merge(e,i.obj)},u.appendInputInfoToArr=function(e,t){var i=-1;for(var r in e){var n=parseInt(r,10);isNumber(n)&&(n>i&&(i=n))}e[i+1]=t},u.splitInputs=function(e){var t={},i={};for(var r in e)isNumber(parseInt(r,10))?t[r]=e[r]:i[r]=e[r];return{arr:t,obj:i}},u.findInputKeyById=function(e,t){var i=null;for(var r in e)if(isNumber(parseInt(r,10))&&e[r].id===t){i=r;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";Object.defineProperty(t,"__esModule",{value:!0}),t.dur=350,t.easingFunc={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){ return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}};var r=function(){function e(e,t,i,r){this._mX1=e,this._mY1=t,this._mX2=i,this._mY2=r}return e.prototype.easingFunc=function(e){return this._mX1===this._mY1&&this._mX2===this._mY2?e:this._calcBezier(this._getTForX(e))},e.prototype._a=function(e,t){return 1-3*t+3*e},e.prototype._b=function(e,t){return 3*t-6*e},e.prototype._c=function(e){return 3*e},e.prototype._calcBezier=function(e){return((this._a(this._mY1,this._mY2)*e+this._b(this._mY1,this._mY2))*e+this._c(this._mY1))*e},e.prototype._getSlope=function(e){return 3*this._a(this._mX1,this._mX2)*e*e+2*this._b(this._mX1,this._mX2)*e+this._c(this._mX1)},e.prototype._getTForX=function(e){for(var t=e,i=0;i<4;++i){var r=this._getSlope(t);if(0===r)return t;t-=(this._calcBezier(t)-e)/r}return t},e}();t.CubicBezier=r,t.color={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"}},KUek:function(e,t,i){"use strict";i.r(t);var r,n,o=i("Eyy1"),s=i("aIyQ"),a=i.n(s),l=i("k9/m"),c=i("hsV8"),u=i("jy4L"),h=i("w4Ji"),d=i("jenN"),p=i("uOxu"),f=Object(p.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"}(r||(r={})),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"}(n||(n={}));var _=function(){function e(e,t,i,o){this._inputs=null,this._status=n.Idle,this._studyId=null,this._turnaroundCounter=1,this._studyStatus={type:r.Undefined},this._studyStatusChanged=new a.a,this._graphics=new d.LiveStudyGraphics,this._dataCleared=new a.a,this._dataUpdated=new a.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 l.PlotList(Object(h.studyPlotFunctionMap)(o),h.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:r.Undefined}),this._gateway.modifyStudy(this._studyId,this._turnaround(),e,this._onMessage.bind(this)),this._status===n.Active&&this._changeStatusTo(n.AwaitingFirstDataUpdate))},e.prototype.isStarted=function(){return this._status!==n.Idle},e.prototype.isActive=function(){return this._status===n.Active},e.prototype.start=function(){this.isStarted()?f.logNormal("start: data source is already started, nothing to do"):(Object(o.assert)(null!==this._inputs,"Inputs should be defined when starting a study data source"),this._gateway.isConnected().value()?this._createStudy():this._changeStatusTo(n.AwaitingConnection))},e.prototype.stop=function(){this.isStarted()?(null!==this._studyId&&(this._gateway.removeStudy(this._studyId),this._studyId=null,this._onStudyStatusChangedTo({type:r.Undefined})),this._changeStatusTo(n.Idle)):f.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(o.assert)(this._status===n.Active,"Couldn't steal data from non-active data source"),this.stop();var e=this._plots,t=this._graphics.extract();return this._plots=new l.PlotList(Object(h.studyPlotFunctionMap)(this._metaInfo),h.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(o.assert)(this._status!==e,"Source and destination status should be distinct"),f.logNormal("Status changed from "+n[this._status]+" to "+n[e]),this._status=e},e.prototype._createStudy=function(){var e=this._series.seriesId();null!=e?this._createStudyUsingParentId(e):(this._changeStatusTo(n.AwaitingParent),this._series.dataEvents().completed().subscribe(this,this._onSeriesCompleted,!0))},e.prototype._createStudyUsingParentId=function(e){ Object(o.assert)(this._status!==n.Active,'Status should not be "Active" when creating a study'),Object(o.assert)(this._studyStatus.type===r.Undefined,'Study status should be "Undefined" when creating a study'),Object(o.assert)(null===this._studyId,"Study id should be empty when creating a study"),this._studyId=Object(u.makeNextStudyId)(),this._gateway.createStudy(this._studyId,this._turnaround(),e,this._metaInfo.fullId+"!",Object(o.ensureNotNull)(this._inputs),this._onMessage.bind(this)),this._changeStatusTo(n.AwaitingFirstDataUpdate)},e.prototype._onGatewayIsConnectedChanged=function(e){e?this._onGatewayConnected():this._onGatewayDisconnected()},e.prototype._onGatewayConnected=function(){this._status===n.AwaitingConnection&&this._createStudy()},e.prototype._onGatewayDisconnected=function(){this._status!==n.Idle&&this._status!==n.AwaitingConnection&&(this._studyId=null,this._changeStatusTo(n.AwaitingConnection),this._studyStatus.type!==r.Undefined&&this._onStudyStatusChangedTo({type:r.Undefined})),this._turnaroundCounter=1},e.prototype._onSeriesCompleted=function(){this._status===n.AwaitingParent&&this._createStudyUsingParentId(Object(o.ensure)(this._series.seriesId()))},e.prototype._onStudyStatusChangedTo=function(e){var t=this._studyStatus;this._studyStatus=e,f.logNormal("Study status type changed from "+r[t.type]+" to "+r[e.type]),this._studyStatusChanged.fire(t,e)},e.prototype._onMessage=function(e){if("data_update"===e.method){var t=e.params,i=t.customId,r=t.turnaround,n=t.plots,o=t.nonseries;i===this._studyId&&this._checkTurnaround(r)&&this._onDataUpdate(n,o)}else if("study_loading"===e.method){var s=e.params,a=(i=s[0],r=s[1],s[2]);i===this._studyId&&this._checkTurnaround(r)&&this._onStudyLoading(a)}else if("study_completed"===e.method){var l=e.params;i=l[0],r=l[1],a=l[2];i===this._studyId&&this._checkTurnaround(r)&&this._onStudyCompleted(a)}else if("study_error"===e.method){var c=e.params,u=(i=c[0],r=c[1],c[2]),h=c[3];a=c[4];i===this._studyId&&this._checkTurnaround(r)&&this._onStudyError(u,h,a)}},e.prototype._onDataUpdate=function(e,t){var i=Object(c.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!==n.Idle&&(this._status===n.AwaitingFirstDataUpdate&&(this._changeStatusTo(n.Active),this.clearData()),this._mergePlots(e),null!==i&&(i.indexes_replace?(Object(o.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:r.Loading,startTime:Date.now()})},e.prototype._onStudyError=function(e,t,i){this.clearData(),this._onStudyStatusChangedTo({type:r.Error,reason:e})},e.prototype._onStudyCompleted=function(e){this._onStudyStatusChangedTo({ -type:r.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}(),m=i("kcTO"),y=i("Ocx9"),g=i("Kxc7");i.d(t,"sessionsPreferencesDefault",(function(){return S})),i.d(t,"Sessions",(function(){return b}));var v=new m.PriceFormatter,S={graphics:{backgrounds:{outOfSession:{color:"#2196F3",transparency:92,visible:!1}},vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}}},b=function(){function e(e,t){var i=this;this._studySource=null,this._paneViews=[],this._metaInfo=null,this._destroyed=!1,this._isStarted=!1,this._loadedGraphics=null,this._model=e,this._doubleClickHandler=t;var r=e.mainSeries();this._properties=new y.DefaultProperty("sessions"),this._removeDuplicateProperties(),this._properties.subscribe(this,this._onPropertiesChanged),e.studyMetaInfoRepository().findById({type:"java",studyId:"Sessions@tv-basicstudies"}).then((function(t){i._destroyed||null===i._loadedGraphics&&(i._setMetaInfo(t),null!==i._metaInfo&&(i._studySource=new _(e.chartApi(),r,"sessions_",i._metaInfo),i._createPaneViews(),i._studySource.dataCleared().subscribe(i,i.updateAllViews),i._studySource.dataUpdated().subscribe(i,i.updateAllViews),i._studySource.setInputs({}),i._processHibernate()))})),e.timeScale().onReset().subscribe(this,this._clearData),e.timeScale().logicalRangeChanged().subscribe(this,this.updateAllViews),e.mainSeries().properties().extendedHours.subscribe(this,this._updateVisibleOutOfSessionBackground),e.mainSeries().properties().interval.subscribe(this,this._processHibernate),this._updateVisibleOutOfSessionBackground(e.mainSeries().properties().extendedHours)}return e.prototype.start=function(){this._isStarted=!0,this._processHibernate()},e.prototype.restart=function(){this._clearData(),g.enabled("stop_study_on_restart")&&this.stop(),this.start()},e.prototype.isStarted=function(){return this._isStarted},e.prototype.stop=function(){this._isStarted=!1,null!==this._studySource&&this._studySource.stop()},e.prototype.paneViews=function(e){return e.containsMainSeries()?this._paneViews:[]},e.prototype.priceAxisViews=function(e,t){return[]},e.prototype.updateAllViews=function(){this._paneViews.forEach((function(e){return e.update()}))},e.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._updateVisibleOutOfSessionBackground),this._model.mainSeries().properties().interval.unsubscribe(this,this._processHibernate), +type:r.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}(),m=i("kcTO"),y=i("Ocx9"),g=i("Kxc7");i.d(t,"sessionsPreferencesDefault",(function(){return b})),i.d(t,"Sessions",(function(){return S}));var v=new m.PriceFormatter,b={graphics:{backgrounds:{outOfSession:{color:"#2196F3",transparency:92,visible:!1}},vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}}},S=function(){function e(e,t){var i=this;this._studySource=null,this._paneViews=[],this._metaInfo=null,this._destroyed=!1,this._isStarted=!1,this._loadedGraphics=null,this._model=e,this._doubleClickHandler=t;var r=e.mainSeries();this._properties=new y.DefaultProperty("sessions"),this._removeDuplicateProperties(),this._properties.subscribe(this,this._onPropertiesChanged),e.studyMetaInfoRepository().findById({type:"java",studyId:"Sessions@tv-basicstudies"}).then((function(t){i._destroyed||null===i._loadedGraphics&&(i._setMetaInfo(t),null!==i._metaInfo&&(i._studySource=new _(e.chartApi(),r,"sessions_",i._metaInfo),i._createPaneViews(),i._studySource.dataCleared().subscribe(i,i.updateAllViews),i._studySource.dataUpdated().subscribe(i,i.updateAllViews),i._studySource.setInputs({}),i._processHibernate()))})),e.timeScale().onReset().subscribe(this,this._clearData),e.timeScale().logicalRangeChanged().subscribe(this,this.updateAllViews),e.mainSeries().properties().extendedHours.subscribe(this,this._updateVisibleOutOfSessionBackground),e.mainSeries().properties().interval.subscribe(this,this._processHibernate),this._updateVisibleOutOfSessionBackground(e.mainSeries().properties().extendedHours)}return e.prototype.start=function(){this._isStarted=!0,this._processHibernate()},e.prototype.restart=function(){this._clearData(),g.enabled("stop_study_on_restart")&&this.stop(),this.start()},e.prototype.isStarted=function(){return this._isStarted},e.prototype.stop=function(){this._isStarted=!1,null!==this._studySource&&this._studySource.stop()},e.prototype.paneViews=function(e){return e.containsMainSeries()?this._paneViews:[]},e.prototype.priceAxisViews=function(e,t){return[]},e.prototype.updateAllViews=function(){this._paneViews.forEach((function(e){return e.update()}))},e.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._updateVisibleOutOfSessionBackground),this._model.mainSeries().properties().interval.unsubscribe(this,this._processHibernate), this._properties.unsubscribe(this,this._onPropertiesChanged)},e.prototype.series=function(){return this._model.mainSeries()},e.prototype.priceScale=function(){return this.series().priceScale()},e.prototype.graphics=function(){return this._loadedGraphics||Object(o.ensureNotNull)(this._studySource).graphics()},e.prototype.properties=function(){return this._properties},e.prototype.graphicsInfo=function(){return Object(o.ensureNotNull)(this._metaInfo).graphics},e.prototype.firstValue=function(e){return this._model.mainSeries().firstValue()},e.prototype.formatter=function(){return v},e.prototype.state=function(e){var t={properties:this._properties.state()};return e&&null!==this._metaInfo&&(t.data={graphics:Object(d.saveStudyGraphics)(this.graphics()),metaInfo:this._metaInfo}),t},e.prototype.restoreState=function(e,t){this._properties.mergeAndFire(e.properties),this._removeDuplicateProperties(),this._updateVisibleOutOfSessionBackground(this._model.mainSeries().properties().extendedHours),void 0!==e.data&&t&&(this._loadStudyGraphics(e.data.graphics),this._setMetaInfo(e.data.metaInfo),this._createPaneViews())},e.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)},e.prototype.applyPreferences=function(e){this._properties.mergePreferences(e)},e.prototype.metaInfo=function(){return Object(o.ensureNotNull)(this._metaInfo)},e.prototype._loadStudyGraphics=function(e){if(void 0!==e.backgrounds){var t=e.backgrounds.findIndex((function(e){return"inSession"===e.styleId}));e.backgrounds.splice(t,1)}this._loadedGraphics=Object(d.loadStudyGraphics)(e)},e.prototype._setMetaInfo=function(e){void 0!==e.graphics.backgrounds&&void 0!==e.graphics.backgrounds.inSession&&delete e.graphics.backgrounds.inSession,this._metaInfo=e},e.prototype._updateVisibleOutOfSessionBackground=function(e){this._outOfSessionVisibilityProperty().setValue(e.value())},e.prototype._clearData=function(){null!==this._studySource&&this._studySource.clearData()},e.prototype._createPaneViews=function(){var e=this,t={mouseDoubleClickHandler:this._doubleClickHandler};Object(d.createGraphicsPaneViews)(this,this._model,t).then((function(t){e._paneViews=t,e._model.lightUpdate()}))},e.prototype._onPropertiesChanged=function(){this._processHibernate(),this.updateAllViews()},e.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()}},e.prototype._canBeHibernated=function(){return this._model.mainSeries().isDWM()||!this._outOfSessionVisibilityProperty().value()&&!this._vertLinesVisibleProperty().value()},e.prototype._isHibernated=function(){return this._isStarted&&(null===this._studySource||!this._studySource.isStarted())},e.prototype._outOfSessionVisibilityProperty=function(){ -return this._properties.childs().graphics.childs().backgrounds.childs().outOfSession.childs().visible},e.prototype._vertLinesVisibleProperty=function(){return this._properties.childs().graphics.childs().vertlines.childs().sessBreaks.childs().visible},e.prototype._removeDuplicateProperties=function(){this._properties.hasChild("properties")&&(this._properties.removeProperty("properties"),Object(y.saveDefaultProperties)(!0),this._properties.childChanged("",null),Object(y.saveDefaultProperties)(!1))},e}()},KcY8:function(e,t,i){"use strict";var r=i("mrSG"),n=i("aO4+"),o=i("f6yo"),s=i("Tmoa"),a=i("Ialn"),l=i("8Uy/"),c=i("jFln"),u=i("ikwP"),h=i("VdBB"),d=i("qFKp").CheckMobile.any()?10:0,p=function(){function e(e,t){this.setData(e,t)}return e.prototype.setData=function(e,t){this._data=Object(r.__assign)({},e),this._commonData=Object(r.__assign)({},t)},e.prototype.draw=function(e,t,i,r,n,o){if(this._data.visible){e.font=t.font;var h,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),y=Math.floor(t.paddingOuter*o),g=this._data.text,v=Math.round(t.baselineOffset*o),S=void 0!==this._data.labelIcon,b=Math.max(1,Math.floor(o)),w=Math.floor(t.fontSize*o)+f+_;if(w%2!=b%2&&(w+=1),S)h=w;else{var P=Math.ceil(i.measureText(e,g));h=Math.round(P*o)+d+p+m+y}var C=this._commonData.coordinate;this._commonData.fixedCoordinate&&(C=this._commonData.fixedCoordinate);var x,T,L="right"===n,I=this._getOffsetScaled(L,r,o),M=Math.ceil(r*o),O=L?M:0,A=O;e.fillStyle=Object(s.resetTransparency)(this._commonData.background),e.lineWidth=1,Object(c.setLineStyle)(e,l.LINESTYLE_SOLID),e.lineCap="butt";var k=Math.round(C*o)-Math.floor(.5*o),E=Math.floor(k+b/2-w/2),D=E+w;if(g||S){if(L?(x=O-d,T=(A=O-h)+y):(A=O+h,x=O+d,T=O+p+d+m),O+=I,A+=I,x+=I,e.beginPath(),e.moveTo(O,E),e.lineTo(A,E),e.lineTo(A,D),e.lineTo(O,D),e.fill(),0!==I&&this._data.fillOffset){e.fillStyle=t.paneBackgroundColor;var V=L?Math.ceil(r*o)+1:0;e.beginPath(),e.moveTo(O,E),e.lineTo(V,E),e.lineTo(V,D),e.lineTo(O,D),e.fill()}if(S){switch(this._data.labelIcon){case 0:this._drawPlusIcon(e,O,A,E,k,D,b)}return}this._data.tickVisible&&(e.fillStyle=this._commonData.color,e.fillRect(O,k,x-O,b)),e.textAlign="left",e.fillStyle=this._commonData.color,Object(u.drawScaled)(e,o,(function(){e.fillText(g,(T+I)/o,(D-_-v)/o)}))}if(this._data.secondLine){var B=Math.ceil(i.measureText(e,this._data.secondLine)*o)+m+y;e.fillStyle=Object(s.resetTransparency)(this._commonData.background),this._data.text&&(E+=w+b,D+=w+b),L?(O=(A=Math.min(A,M-B))+B,T=A+y):(A=(O=Math.max(A-B,p))+B,T=O+m),O+=I,A+=I,e.beginPath(),e.moveTo(O,E),e.lineTo(A,E),e.lineTo(A,D),e.lineTo(O,D),e.fill(),e.textAlign="left",e.fillStyle=this._commonData.color;var R=this._data.secondLine;Object(u.drawScaled)(e,o,(function(){e.fillText(Object(a.startWithLTR)(R),(T+I)/o,(D-_-v)/o)}))}}},e.prototype.height=function(e,t){if(!this._data.visible)return 0;var i=e.fontSize+e.paddingTop+e.paddingBottom +return this._properties.childs().graphics.childs().backgrounds.childs().outOfSession.childs().visible},e.prototype._vertLinesVisibleProperty=function(){return this._properties.childs().graphics.childs().vertlines.childs().sessBreaks.childs().visible},e.prototype._removeDuplicateProperties=function(){this._properties.hasChild("properties")&&(this._properties.removeProperty("properties"),Object(y.saveDefaultProperties)(!0),this._properties.childChanged("",null),Object(y.saveDefaultProperties)(!1))},e}()},KcY8:function(e,t,i){"use strict";var r=i("mrSG"),n=i("aO4+"),o=i("f6yo"),s=i("Tmoa"),a=i("Ialn"),l=i("8Uy/"),c=i("jFln"),u=i("ikwP"),h=i("VdBB"),d=i("qFKp").CheckMobile.any()?10:0,p=function(){function e(e,t){this.setData(e,t)}return e.prototype.setData=function(e,t){this._data=Object(r.__assign)({},e),this._commonData=Object(r.__assign)({},t)},e.prototype.draw=function(e,t,i,r,n,o){if(this._data.visible){e.font=t.font;var h,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),y=Math.floor(t.paddingOuter*o),g=this._data.text,v=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)h=w;else{var P=Math.ceil(i.measureText(e,g));h=Math.round(P*o)+d+p+m+y}var C=this._commonData.coordinate;this._commonData.fixedCoordinate&&(C=this._commonData.fixedCoordinate);var x,T,L="right"===n,I=this._getOffsetScaled(L,r,o),M=Math.ceil(r*o),O=L?M:0,A=O;e.fillStyle=Object(s.resetTransparency)(this._commonData.background),e.lineWidth=1,Object(c.setLineStyle)(e,l.LINESTYLE_SOLID),e.lineCap="butt";var k=Math.round(C*o)-Math.floor(.5*o),E=Math.floor(k+S/2-w/2),D=E+w;if(g||b){if(L?(x=O-d,T=(A=O-h)+y):(A=O+h,x=O+d,T=O+p+d+m),O+=I,A+=I,x+=I,e.beginPath(),e.moveTo(O,E),e.lineTo(A,E),e.lineTo(A,D),e.lineTo(O,D),e.fill(),0!==I&&this._data.fillOffset){e.fillStyle=t.paneBackgroundColor;var V=L?Math.ceil(r*o)+1:0;e.beginPath(),e.moveTo(O,E),e.lineTo(V,E),e.lineTo(V,D),e.lineTo(O,D),e.fill()}if(b){switch(this._data.labelIcon){case 0:this._drawPlusIcon(e,O,A,E,k,D,S)}return}this._data.tickVisible&&(e.fillStyle=this._commonData.color,e.fillRect(O,k,x-O,S)),e.textAlign="left",e.fillStyle=this._commonData.color,Object(u.drawScaled)(e,o,(function(){e.fillText(g,(T+I)/o,(D-_-v)/o)}))}if(this._data.secondLine){var B=Math.ceil(i.measureText(e,this._data.secondLine)*o)+m+y;e.fillStyle=Object(s.resetTransparency)(this._commonData.background),this._data.text&&(E+=w+S,D+=w+S),L?(O=(A=Math.min(A,M-B))+B,T=A+y):(A=(O=Math.max(A-B,p))+B,T=O+m),O+=I,A+=I,e.beginPath(),e.moveTo(O,E),e.lineTo(A,E),e.lineTo(A,D),e.lineTo(O,D),e.fill(),e.textAlign="left",e.fillStyle=this._commonData.color;var R=this._data.secondLine;Object(u.drawScaled)(e,o,(function(){e.fillText(Object(a.startWithLTR)(R),(T+I)/o,(D-_-v)/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)return null;var i=this._data.offset,r=Object(n.box)(new n.Point(t.xl+i-d,t.y-d),new n.Point(t.xl+i+t.containerWidth+d,t.y+t.containerHeight+d)),s=t.left&&Object(o.pointInBox)(e,r),a=Object(n.box)(new n.Point(t.xr-i-d,t.y-d),new n.Point(t.xr-i+t.containerWidth+d,t.y+t.containerHeight+d)),l=t.right&&Object(o.pointInBox)(e,a);if(s||l){var c=s?"left":"right";return new h.HitTestResult(h.HitTestResult.CUSTOM,{mouseClickHandler:void 0===t.mouseClickHandler?void 0:t.mouseClickHandler.bind(this,e,c),tooltip:t.tooltip})}return null},e.prototype._getOffsetScaled=function(e,t,i){var r=e?-1:1,n=0===this._data.offset?0:r*this._data.offset,o=0===n?0:r*Math.max(1,Math.round(Math.abs(n)*i));return e&&t*i%1!=0&&(o=r*(Math.abs(o)+1)),o},e.prototype._drawPlusIcon=function(e,t,i,r,n,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,n,l,s),e.fillRect(h,r+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(s.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),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.setData(this._axisRendererData,this._commonRendererData),this._paneRenderer.setData(this._paneRendererData,this._commonRendererData),this._axisRenderer},e.prototype.paneRenderer=function(){return this._updateRendererDataIfNeeded(),this._axisRenderer.setData(this._axisRendererData,this._commonRendererData),this._paneRenderer.setData(this._paneRendererData,this._commonRendererData),this._paneRenderer},e.prototype.setPaneRendererLabelIcon=function(e){this._paneRendererData.labelIcon=e},e.prototype._updateRendererDataIfNeeded=function(){this._invalidated&&(this._updateRendererData(this._axisRendererData,this._paneRendererData,this._commonRendererData),this._invalidated=!1)},e}()},Ke3L:function(e,t,i){"use strict";i.r(t),i.d(t,"ProjectionSeriesPriceAxisView",(function(){return l}));var r=i("mrSG"),n=i("Eyy1"),o=i("k9/m"),s=i("TQMj"),a=i("oXaB"),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(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 r=this._getData().model,s=this._getSource(),l=s.priceScale(),c=r.timeScale(),u=this.lastPrice();if(!c.isEmpty()&&!l.isEmpty()&&void 0!==u){var h=c.visibleBarsStrictRange();if(null!==h){var d=h.firstBar(),p=h.lastBar(),f=s.data(),_=f.search(p,o.PlotRowSearchMode.NearestLeft);if(null!==_){var m=s.nearestIndex(d,o.PlotRowSearchMode.NearestRight);if(void 0!==m){var y=s.model().properties().scalesProperties,g=Object(n.ensureNotNull)(f.valueAt(m))[TradingView.CLOSE_PLOT],v=i.background,S=y.showSeriesLastValue.value(),b=!1,w=!1,P=!1,C=s.lastValueData(TradingView.CLOSE_PLOT,!1),x=s.properties();if(8===x.style.value()&&x.haStyle.showRealLastPrice.value()){var T=s.lastValueData(TradingView.CLOSE_PLOT,!0);if(T.noData||T.color===i.background||(v=T.color),!T.noData&&!C.noData){var L=T.index===C.index;b=L&&y.showSymbolLabels.value(),w=y.seriesLastValueMode.value()===a.PriceAxisLastValueMode.LastPriceAndPercentageValue,S=S&&L,P=L&&this._isCountdownEnabled()&&x.showCountdown.value()}}else{v=s.barColorer().barStyle(_.index,!0).barColor}i.background=v,i.color=this.generateTextColor(v),i.coordinate=l.priceToCoordinate(u,g),e.visible=S||P,C.noData||(C.text=l.formatPrice(u,g),C.formattedPriceAbsolute=l.formatPriceAbsolute(u),C.formattedPricePercentage=l.formatPricePercentage(u,g),e.text=this._axisFirstLineText(C,S,w),e.secondLine=P?this._countdownText():"",t.text=this._paneText(C,S,b,w)),t.visible=b||S&&w}}}}},t}(s.SeriesPriceAxisView)},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 r=i("mrSG"),n=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(r.__extends)(t,e),t.prototype.setData=function(e,t){ +return this._updateRendererDataIfNeeded(),this._axisRenderer.setData(this._axisRendererData,this._commonRendererData),this._paneRenderer.setData(this._paneRendererData,this._commonRendererData),this._axisRenderer},e.prototype.paneRenderer=function(){return this._updateRendererDataIfNeeded(),this._axisRenderer.setData(this._axisRendererData,this._commonRendererData),this._paneRenderer.setData(this._paneRendererData,this._commonRendererData),this._paneRenderer},e.prototype.setPaneRendererLabelIcon=function(e){this._paneRendererData.labelIcon=e},e.prototype._updateRendererDataIfNeeded=function(){this._invalidated&&(this._updateRendererData(this._axisRendererData,this._paneRendererData,this._commonRendererData),this._invalidated=!1)},e}()},Ke3L:function(e,t,i){"use strict";i.r(t),i.d(t,"ProjectionSeriesPriceAxisView",(function(){return l}));var r=i("mrSG"),n=i("Eyy1"),o=i("k9/m"),s=i("TQMj"),a=i("oXaB"),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(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 r=this._getData().model,s=this._getSource(),l=s.priceScale(),c=r.timeScale(),u=this.lastPrice();if(!c.isEmpty()&&!l.isEmpty()&&void 0!==u){var h=c.visibleBarsStrictRange();if(null!==h){var d=h.firstBar(),p=h.lastBar(),f=s.data(),_=f.search(p,o.PlotRowSearchMode.NearestLeft);if(null!==_){var m=s.nearestIndex(d,o.PlotRowSearchMode.NearestRight);if(void 0!==m){var y=s.model().properties().scalesProperties,g=Object(n.ensureNotNull)(f.valueAt(m))[TradingView.CLOSE_PLOT],v=i.background,b=y.showSeriesLastValue.value(),S=!1,w=!1,P=!1,C=s.lastValueData(TradingView.CLOSE_PLOT,!1),x=s.properties();if(8===x.style.value()&&x.haStyle.showRealLastPrice.value()){var T=s.lastValueData(TradingView.CLOSE_PLOT,!0);if(T.noData||T.color===i.background||(v=T.color),!T.noData&&!C.noData){var L=T.index===C.index;S=L&&y.showSymbolLabels.value(),w=y.seriesLastValueMode.value()===a.PriceAxisLastValueMode.LastPriceAndPercentageValue,b=b&&L,P=L&&this._isCountdownEnabled()&&x.showCountdown.value()}}else{v=s.barColorer().barStyle(_.index,!0).barColor}i.background=v,i.color=this.generateTextColor(v),i.coordinate=l.priceToCoordinate(u,g),e.visible=b||P,C.noData||(C.text=l.formatPrice(u,g),C.formattedPriceAbsolute=l.formatPriceAbsolute(u),C.formattedPricePercentage=l.formatPricePercentage(u,g),e.text=this._axisFirstLineText(C,b,w),e.secondLine=P?this._countdownText():"",t.text=this._paneText(C,b,S,w)),t.visible=S||b&&w}}}}},t}(s.SeriesPriceAxisView)},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 r=i("mrSG"),n=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(r.__extends)(t,e),t.prototype.setData=function(e,t){ this._setBaseData(e,t)},t.prototype._drawItemShape=function(e,t,i){var r=t.pixelRatio,n=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*r)+n,h=i.vertOffset,d=Math.round((i.y+h+o*c/2)*r)+n,p=Object(s.ceiledEven)(a*r),f=p/2,_=Math.round(c*r),m=Math.round(l*r);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()!==r.Invalid&&this.multiplier()>0},e.prototype.isDWM=function(){return this.isValid()&&!this.isRange()&&!this.isIntraday()},e.prototype.isIntraday=function(){var e=c.has(this.kind());return this.isValid()&&!this.isRange()&&e},e.prototype.isSeconds=function(){return this.kind()===r.Seconds},e.prototype.isMinutes=function(){return this.kind()===r.Minutes},e.prototype.isMinuteHours=function(){return this.kind()===r.Minutes&&d(this.multiplier())},e.prototype.isDays=function(){return this.kind()===r.Days},e.prototype.isWeeks=function(){return this.kind()===r.Weeks},e.prototype.isMonths=function(){return this.kind()===r.Months},e.prototype.isRange=function(){return this.kind()===r.Range},e.prototype.isTimeBased=function(){return!this.isRange()},e.prototype.letter=function(){return this.isValid()&&this.kind()!==r.Minutes?this.kind()[0].toUpperCase():""},e.prototype.value=function(){return this.isValid()?this.kind()===r.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(r.Minutes,60*h(i[1])):new e(l[i[2]],h(i[1])):null!==(i=s.exec(t))?new e(r.Minutes,h(i[1])):new e(r.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() @@ -301,20 +301,20 @@ marks:a,index_diff:[]}]};this._server.receiveLocalResponse(h)}},l.prototype.onTi TradingView.ChartapiMessagerInstances=[],e.exports=l}).call(this,i("jCNj"))},"N+BX":function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Double Curve");function a(e,t){this._constructor="LineToolBezierCubic";var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("a6on").BezierCubicPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return 2},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Double Curve"},a.prototype.controlPoints=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),r=e.add(t).scaled(.33),n=e.add(t).scaled(.67),o=r.add(i),s=n.subtract(i);return[this.screenPointToPoint(o),this.screenPointToPoint(s)]},a.prototype.setLastPoint=function(e,t){r.prototype.setLastPoint.call(this,e,t),this._controlPoints=this.controlPoints()},a.prototype.addPoint=function(e,t,i){var n=r.prototype.addPoint.call(this,e,t,!0);if(n){var o=this.controlPoints();delete this._controlPoints,this._points.push(o[0]),this._points.push(o[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)}return n},a.prototype.restorePoints=function(e,t,i){r.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2),this._createPointProperty(3)},a.prototype.getStylesPropertyPage=function(){return o.LineToolBezierStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("b4fl").GeneralBezierDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolbeziercubic",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolBezierCubic=a},N1UO:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyApi",(function(){return h}));var r=i("mrSG"),n=(i("YFKU"),i("Eyy1")),o=i("9iCb"),s=i("xo8u"),a=i("gaBL"),l=i("HGup"),c=i("jRfx"),u=i("/ToI"),h=function(){function e(e,t){this._study=e,this._undoModel=t,this._model=t.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(r.__assign)(Object(r.__assign)({},e),{localizedName:void 0!==e.name?window.t(e.name,{context:"input"}):""})}))},e.prototype.getInputValues=function(){var e=this._study.inputs();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 }))?r._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},r=this,n=0,o=e;n0&&(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){var d=17*r;i.fillStyle=e.colors.text,a.mainSeriesText&&h+d0&&(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()}function y(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,i,l,c,u,d,f,y,g,v,S,b,w,P,C,x,T;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:for(t=p[e.layout],i=e.charts.map((function(e){return function(e){for(var t=e.panes[0],i=t.canvas.width+t.leftAxis.canvas.width+t.rightAxis.canvas.width,r=0,o=0,s=e.panes;o=i&&l<=n){var c=a.y +e.timeAxis.rhsStub.contentWidth>0&&i.drawImage(e.timeAxis.rhsStub.canvas,l,n)}i.restore()}function y(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,i,l,c,u,d,f,y,g,v,b,S,w,P,C,x,T;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:for(t=p[e.layout],i=e.charts.map((function(e){return function(e){for(var t=e.panes[0],i=t.canvas.width+t.leftAxis.canvas.width+t.rightAxis.canvas.width,r=0,o=0,s=e.panes;o=i&&l<=n){var c=a.y ;if(e.y>=Math.min(c,this._data.histogramBase)&&e.y<=Math.max(c,this._data.histogramBase))return new r.HitTestResult(r.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 r=0;ru.center?u.right=c.left-t-1:c.left=u.right+t+1))}var h=Math.ceil(this._data.barSpacing*e);for(r=0;r0&&h<4)for(r=0;rh&&(c.roundedCenter>c.center?c.right-=1:c.left+=1)}}else this._precalculatedCache=[]},e}()},NhkU:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("hayr").propertyPages,s=i("ytGH").LineToolWidthsProperty,a=window.t("Pitchfan");function l(e,t){this._constructor="LineToolPitchfan";var n=t||l.createProperties();r.call(this,e,n),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);for(var o=[this._properties.child("median").child("linewidth")],a=0;a<=l.LevelsCount;a++)o.push(this._properties.child("level"+a).child("linewidth"));this._widthsProperty=new s(o)}inherit(l,r),l.LevelsCount=8,l.prototype.levelsCount=function(){return l.LevelsCount},l.prototype.pointsCount=function(){return 3},l.prototype.translatedType=function(){return a},l.prototype.name=function(){return"Pitchfan"},l.prototype.processErase=function(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},l.prototype.getStylesPropertyPage=function(){return o.LineToolPitchfanStylesPropertyPage},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),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 n("linetoolpitchfan",e,!1,{range:[0,8]});return l._configureProperties(t),t},l._configureProperties=function(e){r._configureProperties(e)},t.LineToolPitchfan=l},NsVT:function(e,t,i){"use strict";i.r(t);var r=i("hY0g"),n=i.n(r),o=i("HySD");function s(e,t){for(var i=0,r=0,n=t;r0&&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 r=i;t._fullscreenArea!==e.name&&(e.availWidth.setValue(i),e.canNegotiate.width&&(r=s(i,e.negotiations.width)));var n=e.container.value();return n&&(n.style.width=r+"px"),e.width.setValue(r),r},this._setHeight=function(e,i){var r=i;t._fullscreenArea!==e.name&&(e.availHeight.setValue(i),e.canNegotiate.height&&(r=s(i,e.negotiations.height)));var n=e.container.value();return n&&(n.style.height=r+"px"),e.height.setValue(r),r};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 r=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 n.a,height:new n.a,availWidth:new n.a,availHeight:new n.a,alive:new n.a(!0),container:new n.a(r),visible:new n.a(!0),fullscreen:new n.a(!0),rdState:new o.ResizerDetacherState};return s.rdState.pushOwner(s),this._areas[i]=s,s.rdState.owner.subscribe((function(e){ -var r=s.container.value();if(e!==s)r&&(r.innerHTML="",r.parentElement&&r.parentElement.removeChild(r));else{for(var n=null,o=t._availableAreas.indexOf(i);o--;){var a=t._availableAreas[o];if(t._affectsLayout(a)){n=t._areas[a].container.value();break}}r&&(n&&r.parentElement?r.insertAdjacentElement("afterend",n):t._container.appendChild(r))}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,r=this._areas.tradingpanel,n=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,y=0,g=0,v=0;(e===this._recalcSingleRunToken&&l&&this._processVisibility(l)&&(v=this._setHeight(l,u),this._setWidth(l,c)),e===this._recalcSingleRunToken&&t&&this._processVisibility(t))&&(g=this._setHeight(t,u),(y=this._setWidth(t,c))&&(y+=4),(L=t.container.value())&&(L.style.top=v+"px"));e===this._recalcSingleRunToken&&i&&this._processVisibility(i)&&((L=i.container.value())&&(L.style.top=g+v+"px"),this._setHeight(i,u-g-v),(f=this._setWidth(i,c))&&(f+=4));if(e===this._recalcSingleRunToken&&r&&this._processVisibility(r)){this._setHeight(r,u);var S=c-f;h||(S-=300),m=this._setWidth(r,S)}if(e===this._recalcSingleRunToken&&n&&this._processVisibility(n)){this._setHeight(n,u-v);S=c-f-m;h||(S-=300),_=this._setWidth(n,S),(L=n.container.value())&&(L.style.top=v+"px")}var b=m+_,w=b?4:0;if(e===this._recalcSingleRunToken&&o&&this._processVisibility(o)){var P=Math.max(y,f);(L=o.container.value())&&(L.style.left=P+"px",L.style.top=v+"px");S=c-P-m-_-w;this._setWidth(o,S),d=this._setHeight(o,u)}var C=0,x=c-f-m-_-w;if(e===this._recalcSingleRunToken&&s&&this._processVisibility(s)){(L=s.container.value())&&(L.style.left=f+"px",L.classList.toggle("no-border-top-left-radius",!f),L.classList.toggle("no-border-top-right-radius",!b)),this._setWidth(s,x);var T=u-d-v;C=Math.min(300,T-0),p=this._setHeight(s,T)+4}if(e===this._recalcSingleRunToken&&a&&this._processVisibility(a)){var L;(L=a.container.value())&&(L.style.left=f+"px",L.style.top=d+v+"px",L.classList.toggle("no-border-bottom-left-radius",!p||!f),L.classList.toggle("no-border-bottom-right-radius",!b||!p)),this._setWidth(a,x);T=u-d-p-v;this._setHeight(a,Math.max(T,C))}e===this._recalcSingleRunToken&&r&&this._affectsLayout("tradingpanel")&&((L=r.container.value())&&(L.style.right=_+"px",L.style.top=v+"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"), +var r=s.container.value();if(e!==s)r&&(r.innerHTML="",r.parentElement&&r.parentElement.removeChild(r));else{for(var n=null,o=t._availableAreas.indexOf(i);o--;){var a=t._availableAreas[o];if(t._affectsLayout(a)){n=t._areas[a].container.value();break}}r&&(n&&r.parentElement?r.insertAdjacentElement("afterend",n):t._container.appendChild(r))}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,r=this._areas.tradingpanel,n=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,y=0,g=0,v=0;(e===this._recalcSingleRunToken&&l&&this._processVisibility(l)&&(v=this._setHeight(l,u),this._setWidth(l,c)),e===this._recalcSingleRunToken&&t&&this._processVisibility(t))&&(g=this._setHeight(t,u),(y=this._setWidth(t,c))&&(y+=4),(L=t.container.value())&&(L.style.top=v+"px"));e===this._recalcSingleRunToken&&i&&this._processVisibility(i)&&((L=i.container.value())&&(L.style.top=g+v+"px"),this._setHeight(i,u-g-v),(f=this._setWidth(i,c))&&(f+=4));if(e===this._recalcSingleRunToken&&r&&this._processVisibility(r)){this._setHeight(r,u);var b=c-f;h||(b-=300),m=this._setWidth(r,b)}if(e===this._recalcSingleRunToken&&n&&this._processVisibility(n)){this._setHeight(n,u-v);b=c-f-m;h||(b-=300),_=this._setWidth(n,b),(L=n.container.value())&&(L.style.top=v+"px")}var S=m+_,w=S?4:0;if(e===this._recalcSingleRunToken&&o&&this._processVisibility(o)){var P=Math.max(y,f);(L=o.container.value())&&(L.style.left=P+"px",L.style.top=v+"px");b=c-P-m-_-w;this._setWidth(o,b),d=this._setHeight(o,u)}var C=0,x=c-f-m-_-w;if(e===this._recalcSingleRunToken&&s&&this._processVisibility(s)){(L=s.container.value())&&(L.style.left=f+"px",L.classList.toggle("no-border-top-left-radius",!f),L.classList.toggle("no-border-top-right-radius",!S)),this._setWidth(s,x);var T=u-d-v;C=Math.min(300,T-0),p=this._setHeight(s,T)+4}if(e===this._recalcSingleRunToken&&a&&this._processVisibility(a)){var L;(L=a.container.value())&&(L.style.left=f+"px",L.style.top=d+v+"px",L.classList.toggle("no-border-bottom-left-radius",!p||!f),L.classList.toggle("no-border-bottom-right-radius",!S||!p)),this._setWidth(a,x);T=u-d-p-v;this._setHeight(a,Math.max(T,C))}e===this._recalcSingleRunToken&&r&&this._affectsLayout("tradingpanel")&&((L=r.container.value())&&(L.style.right=_+"px",L.style.top=v+"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 r.get_cal(r.get_timezone("Etc/UTC"),this.year,this.month-1,this.day)},e.prototype.addDays=function(t){var i=this.toCalendar(r.get_timezone("Etc/UTC"));return r.add_date(i,t),e.fromCalendar(i)},e.fromCalendar=function(t){return new e(r.get_year(t),r.get_month(t)+1,r.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.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.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.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},"OK+B":function(e,t,i){"use strict";var r=i("Eyy1").assert,n=i("eJTA"),o=n.rgba,s=n.rgbaToString,a=n.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,y=d.isStudyLineToolName,g=i("Ss5c").LineDataSource,v=i("OH2X").LineToolBarsPattern,S=i("OH2X").LineToolCallout,b=i("HLXm"),w=i("GVHu"),P=w.Study,C=w.prepareStudyPropertiesForLoadChart,x=i("3ClC").createStudy,T=i("qJq3").Series,L=i("dfhE"),I=i("n5al"),M=i("0YCj"),O=i("Kxc7"),A=i("uOxu").getLogger("Chart.Serialization"),k=i("OH2X").LineToolParallelChannel,E=i("OH2X").LineToolTrendAngle,D=i("OH2X").LineToolGhostFeed,V=i("OH2X").LineToolElliott,B=i("7ktv").PriceDataSource,R=i("iDOr").Pane,N=i("Tmoa"),F=i("jofe").createDeferredPromise,j=i("ApcL").preferencesByWhiteList,W=(A=i("uOxu").getLogger("Chart.Serialization"), +t.LineToolPolyline=i("hP9j").LineToolPolyline,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.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},"OK+B":function(e,t,i){"use strict";var r=i("Eyy1").assert,n=i("eJTA"),o=n.rgba,s=n.rgbaToString,a=n.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,y=d.isStudyLineToolName,g=i("Ss5c").LineDataSource,v=i("OH2X").LineToolBarsPattern,b=i("OH2X").LineToolCallout,S=i("HLXm"),w=i("GVHu"),P=w.Study,C=w.prepareStudyPropertiesForLoadChart,x=i("3ClC").createStudy,T=i("qJq3").Series,L=i("dfhE"),I=i("n5al"),M=i("0YCj"),O=i("Kxc7"),A=i("uOxu").getLogger("Chart.Serialization"),k=i("OH2X").LineToolParallelChannel,E=i("OH2X").LineToolTrendAngle,D=i("OH2X").LineToolGhostFeed,V=i("OH2X").LineToolElliott,B=i("7ktv").PriceDataSource,R=i("iDOr").Pane,N=i("Tmoa"),F=i("jofe").createDeferredPromise,j=i("ApcL").preferencesByWhiteList,W=(A=i("uOxu").getLogger("Chart.Serialization"), i("mPvX").LineToolsGroupModel);c.version=2,c.prototype.state=function(e,t,i){for(var r={panes:[]},n=0;n1&&n.push(l)),s=(s+1)%t.length}return n},c.prototype.restoreState=function(e,t,i){new z(this).reset();var r={};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 n=TradingView.factoryDefaults("chartproperties").scalesProperties;TradingView.merge(n,e.chartProperties.scalesProperties),!("showLastValue"in n)||"showSeriesLastValue"in n||"showStudyLastValue"in n||(n.showSeriesLastValueProperty=n.showLastValue,n.showStudyLastValueProperty=n.showLastValue),"showSeriesLastValue"in n&&(r.showSeriesLastValueProperty=!0),"showStudyLastValue"in n&&(r.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),this._properties.paneProperties.mergeAndFire(e.chartProperties.paneProperties),this._properties.scalesProperties.mergeAndFire(n),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)}}var c=e.panes;this.panes()[0].restoreState(c[0],t,e.version,r,i,!0);var u=1;for(s=1;sm&&f%100==0?{lines_limit_exceeded:!0,line_tools_count:f}:(this._dataSourceCollectionChanged.fire(),{})}A.logDebug("ChartModel.restoreState: invalid state")}else A.logDebug("ChartModel.restoreState: invalid state");else A.logDebug("ChartModel.restoreState: invalid state")},R.prototype.state=function(e,t,i,r,n){var o={},s=new Map;function a(e){if(s.has(e))return s.get(e);var o=null,a=i&&!e.isSavedInStudyTemplates()||!e.state||!(o=e.state(t,n))||!e.isSavedInChart(t)||r&&e.isActualSymbol&&!e.isActualSymbol()?null:o;return s.set(e,a),a}if(e){o.sources=[];for(var l=0;l1e200){var m=h-1;A.logWarn("Datasource zorder has bad value: "+f.zorder+" Resetting it to "+m),f.zorder=m}else if(!this.isZOrderAvailable(f.zorder)){l&&"MainSeries"===_&&this._model.mainSeries().zorder()===f.zorder||(f.zorder=d+1)}s[O=f.id]=f.ownerSource,_&&("MainSeries"===_?this._restoreMainSeries(f,t,l,r,n,o):_.toLowerCase().startsWith("study")?this._restoreStudy(f,t,r,o):TradingView.isInherited(TradingView[_],g)?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)}}}var y,v,S=new Set,b=this;function w(e){var t=defaults("chartproperties").paneProperties.axisProperties,i=new u(b.model().properties().scalesProperties,t);return i.restoreState(e.state),e.sources.forEach((function(e){var r=b.dataSourceForId(e);r&&function(e,t,i){S.add(e),void 0!==i.m_showSymbolLabels&&e instanceof T&&b.model().properties().scalesProperties.showSymbolLabels.setValue(i.m_showSymbolLabels), -e.setPriceScale(t),t.addDataSource(e)}(r,i,t)})),0===i.dataSources().length?null:i}if(e.leftAxisesState)y=e.leftAxisesState.map(w).filter((function(e){return null!==e}));else{var C=w({state:e.leftAxisState,sources:e.leftAxisSources});y=null!==C?[C]:[]}if(this._leftPriceScales.slice().forEach(function(e){this.removePriceScale(e)}.bind(this)),this._leftPriceScales=[],y.forEach((function(e){b._placePriceScale(e,"left")})),e.rightAxisesState)v=e.rightAxisesState.map(w).filter((function(e){return null!==e}));else{var x=w({state:e.rightAxisState,sources:e.rightAxisSources});v=null!==x?[x]:[]}this._rightPriceScales.forEach(function(e){this.removePriceScale(e)}.bind(this)),this._rightPriceScales=[],v.forEach((function(e){b._placePriceScale(e,"right")})),this._currentPriceScaleRatio=e.priceScaleRatio||e.leftPriceScaleRatio||e.rightPriceScaleRatio||null;for(p=0;p1e200){var m=h-1;A.logWarn("Datasource zorder has bad value: "+f.zorder+" Resetting it to "+m),f.zorder=m}else if(!this.isZOrderAvailable(f.zorder)){l&&"MainSeries"===_&&this._model.mainSeries().zorder()===f.zorder||(f.zorder=d+1)}s[O=f.id]=f.ownerSource,_&&("MainSeries"===_?this._restoreMainSeries(f,t,l,r,n,o):_.toLowerCase().startsWith("study")?this._restoreStudy(f,t,r,o):TradingView.isInherited(TradingView[_],g)?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)}}}var y,v,b=new Set,S=this;function w(e){var t=defaults("chartproperties").paneProperties.axisProperties,i=new u(S.model().properties().scalesProperties,t);return i.restoreState(e.state),e.sources.forEach((function(e){var r=S.dataSourceForId(e);r&&function(e,t,i){b.add(e),void 0!==i.m_showSymbolLabels&&e instanceof T&&S.model().properties().scalesProperties.showSymbolLabels.setValue(i.m_showSymbolLabels), +e.setPriceScale(t),t.addDataSource(e)}(r,i,t)})),0===i.dataSources().length?null:i}if(e.leftAxisesState)y=e.leftAxisesState.map(w).filter((function(e){return null!==e}));else{var C=w({state:e.leftAxisState,sources:e.leftAxisSources});y=null!==C?[C]:[]}if(this._leftPriceScales.slice().forEach(function(e){this.removePriceScale(e)}.bind(this)),this._leftPriceScales=[],y.forEach((function(e){S._placePriceScale(e,"left")})),e.rightAxisesState)v=e.rightAxisesState.map(w).filter((function(e){return null!==e}));else{var x=w({state:e.rightAxisState,sources:e.rightAxisSources});v=null!==x?[x]:[]}this._rightPriceScales.forEach(function(e){this.removePriceScale(e)}.bind(this)),this._rightPriceScales=[],v.forEach((function(e){S._placePriceScale(e,"right")})),this._currentPriceScaleRatio=e.priceScaleRatio||e.leftPriceScaleRatio||e.rightPriceScaleRatio||null;for(p=0;p=t||!i._shouldExtrapolateMore()?null:r(i.newBarBuilder(e),n,t,!0).times}))},s.prototype._ensureExtrapolatedToTime=function(e,t){var i=this;return this._extrapolateData(e,(function(r){if(r>=t||!i._shouldExtrapolateMore())return null;var o=n(i.newBarBuilder(e),r,t,2e3,!0);return o.times[o.length-1]e?this._extrapolatedBarsCache=[]:this._lastRealBarTime!==t&&this._extrapolatedBarsCache.shift(e-this._lastRealBarIndex)),this._lastRealBarIndex=e,this._lastRealBarTime=t;for(var i=0;i'},PoSe:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i){var r,n,o,s=null,a=0;i=i||{};var l=function(){a=!1===i.leading?0:Date.now(),s=null,o=e.apply(r,n),s||(r=n=null)};return function(){var c=Date.now();a||!1!==i.leading||(a=c);var u=t-(c-a);return r=this,n=arguments,u<=0||u>t?(s&&(clearTimeout(s),s=null),a=c,o=e.apply(r,n),s||(r=n=null)):s||!1===i.trailing||(s=setTimeout(l,u)),o}}, -e.exports=t.default},Q19o:function(e,t,i){"use strict";(function(t,r){var n=i("Eyy1").ensureNotNull,o=i("jA0t"),s=i("9iCb").applyOverridesToStudy,a=i("0YCj"),l=i("5JMW"),c=l.LineDataSourceApi,u=l.isLineToolRiskReward,h=i("N1UO").StudyApi,d=i("ltKl").SeriesApi,p=i("QrSB").SelectionApi,f=i("mf9N").PaneApi,_=i("IiTo"),m=i("LxhU").Interval,y=i("jCNj"),g=i("2jXJ").supportedLineTools,v=i("7MZv").showTooManyStudiesNotice,S=i("ogJP").isNumber,b=i("ogJP").inherit,w=i("vu5c").onSeriesCompletedOrErrorReceived,P=i("CW80").createLineToolProperties,C=i("96Yh"),x=C.lineToolEntityInfo,T=C.studyEntityInfo,L=i("lReN").LineToolsGroupControllerApi,I=i("ocrj").RemoveSourcesCommand,M=i("FDyI").ChartWidgetApiBase,O=i("mMWL"),A=function(e,i){M.call(this,e),this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap,this._activateChart=i,this._selectionApi=null,this._visibleBarsChanged=new t,this._chartWidget.onAboutToBeDestroyed().subscribe(this,this._destroy,!0),this._chartWidget.withModel(this,(function(){this._chartWidget.model().timeScale().visibleBarsStrictRangeChanged().subscribe(this,this._onVisibleBarsChanged)}))};function k(e,t){return t.map((function(t){return e.dataSourceForId(t)}))}function E(e,t){var i=r.utc_to_cal(t.timezone,1e3*e),n=t.spec.correctTradingDay(i);return r.set_hms(n,0,0,0,0,y.get_timezone("Etc/UTC")),n.getTime()/1e3}b(A,M),A.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new f(e,this._chartWidget),this._panes.set(e,t)),t},A.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget.model()),this._studies.set(e,t)),t},A.prototype._getLineDataSourceApi=function(e){var t=this._lineDataSources.get(e);return void 0===t&&(t=new c(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 r=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(r.time_t,r.offset)}}))}.bind(this)}),this._lineDataSources.set(e,t)),t},A.prototype._makeSubscriptionFromDelegate=function(e){return{subscribe:e.subscribe.bind(e),unsubscribe:e.unsubscribe.bind(e),unsubscribeAll:e.unsubscribeAll.bind(e)}},A.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},A.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},A.prototype.setZoomEnabled=function(e){this._chartWidget.model().model().setZoomEnabled(e)},A.prototype.setScrollEnabled=function(e){this._chartWidget.model().model().setScrollEnabled(e)},A.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},A.prototype.clearMarks=function(){this._chartWidget.clearMarks()},A.prototype.symbol=function(){return this._chartWidget.getSymbol()},A.prototype.symbolExt=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name, +e.exports=t.default},Q19o:function(e,t,i){"use strict";(function(t,r){var n=i("Eyy1").ensureNotNull,o=i("jA0t"),s=i("9iCb").applyOverridesToStudy,a=i("0YCj"),l=i("5JMW"),c=l.LineDataSourceApi,u=l.isLineToolRiskReward,h=i("N1UO").StudyApi,d=i("ltKl").SeriesApi,p=i("QrSB").SelectionApi,f=i("mf9N").PaneApi,_=i("IiTo"),m=i("LxhU").Interval,y=i("jCNj"),g=i("2jXJ").supportedLineTools,v=i("7MZv").showTooManyStudiesNotice,b=i("ogJP").isNumber,S=i("ogJP").inherit,w=i("vu5c").onSeriesCompletedOrErrorReceived,P=i("CW80").createLineToolProperties,C=i("96Yh"),x=C.lineToolEntityInfo,T=C.studyEntityInfo,L=i("lReN").LineToolsGroupControllerApi,I=i("ocrj").RemoveSourcesCommand,M=i("FDyI").ChartWidgetApiBase,O=i("mMWL"),A=function(e,i){M.call(this,e),this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap,this._activateChart=i,this._selectionApi=null,this._visibleBarsChanged=new t,this._chartWidget.onAboutToBeDestroyed().subscribe(this,this._destroy,!0),this._chartWidget.withModel(this,(function(){this._chartWidget.model().timeScale().visibleBarsStrictRangeChanged().subscribe(this,this._onVisibleBarsChanged)}))};function k(e,t){return t.map((function(t){return e.dataSourceForId(t)}))}function E(e,t){var i=r.utc_to_cal(t.timezone,1e3*e),n=t.spec.correctTradingDay(i);return r.set_hms(n,0,0,0,0,y.get_timezone("Etc/UTC")),n.getTime()/1e3}S(A,M),A.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new f(e,this._chartWidget),this._panes.set(e,t)),t},A.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget.model()),this._studies.set(e,t)),t},A.prototype._getLineDataSourceApi=function(e){var t=this._lineDataSources.get(e);return void 0===t&&(t=new c(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 r=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(r.time_t,r.offset)}}))}.bind(this)}),this._lineDataSources.set(e,t)),t},A.prototype._makeSubscriptionFromDelegate=function(e){return{subscribe:e.subscribe.bind(e),unsubscribe:e.unsubscribe.bind(e),unsubscribeAll:e.unsubscribeAll.bind(e)}},A.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},A.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},A.prototype.setZoomEnabled=function(e){this._chartWidget.model().model().setZoomEnabled(e)},A.prototype.setScrollEnabled=function(e){this._chartWidget.model().model().setScrollEnabled(e)},A.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},A.prototype.clearMarks=function(){this._chartWidget.clearMarks()},A.prototype.symbol=function(){return this._chartWidget.getSymbol()},A.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}:null},A.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},A.prototype.setSymbol=function(e,t){if(e!==this.symbol()){var i=this._chartWidget.model().mainSeries().dataEvents();t&&w(i,(function(e){e||t()})),this._activateChart(),this._chartWidget.setSymbol(e)}},A.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},A.prototype.setResolution=function(e,t){var i=m.normalize(e);if(null!==i&&i!==this.resolution()){var r=this._chartWidget.model().mainSeries().dataEvents();t&&w(r,(function(e){e||t()})),this._activateChart(),this._chartWidget.setResolution(i)}},A.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 r=i.properties();r&&r.visible&&r.visible.setValue(t)}},A.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(T)},A.prototype.availableZOrderOperations=function(e){var t=k(this._chartWidget.model().model(),e);return this._chartWidget.model().availableZOrderOperations(t)},A.prototype.sendToBack=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().sendToBack(t)},A.prototype.bringToFront=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().bringToFront(t)},A.prototype.insertAfter=function(e,t){var i=this._chartWidget.model().model(),r=k(i,e),n=i.dataSourceForId(t);this._chartWidget.model().insertAfter(r,n)},A.prototype.insertBefore=function(e,t){var i=this._chartWidget.model().model(),r=k(i,e),n=i.dataSourceForId(t);this._chartWidget.model().insertBefore(r,n)},A.prototype.bringForward=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().bringForward(t)},A.prototype.sendBackward=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().sendBackward(t)},A.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)},A.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(x).filter((function(e){return null!==e.name}))},A.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},A.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},A.prototype.removeEntity=function(e,t){var i=this._chartWidget.model().chartModel().dataSourceForId(e);i?t&&t.disableUndo?new I(this._chartWidget.model().chartModel(),[i],"").redo():this._chartWidget.model().removeSource(i,!0,!0):console.warn("Can't find a source with id: "+e)},A.prototype.removeEntityWithUndo=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);this._chartWidget.model().removeSource(t,!1)},A.prototype.selection=function(){ return null===this._selectionApi&&(this._selectionApi=new p(this._chartWidget.model().model())),this._selectionApi},A.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveSymbol,e.saveInterval)},A.prototype.drawOnAllCharts=function(e){O.drawOnAllCharts.setValue(e)},A.prototype.applyStudyTemplate=function(e){this._chartWidget.model().applyStudyTemplate(e,""+1e3*Math.random())},A.prototype.setVisibleRange=function(e,t){if(void 0!==e&&e.from&&e.to&&!isNaN(e.from)&&!isNaN(e.to)){var i=[parseInt(e.from),parseInt(e.to)],r=this._alignPoints(i),n=r[0],o=r[1],s=void 0!==t&&"function"==typeof t,a=new Promise(function(e){this._chartWidget.setVisibleTimeRange(n,o,s?{}:t,e)}.bind(this));return s&&(console.warn("setVisibleRange now returns a Promise object and don't accept callback as the last argument"),a.then(t)),a}console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.')},A.prototype._getSession=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return new _.SessionInfo(e.timezone,e.session,e.holidays,e.corrections)},A.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,m.isDWM(r.interval())){var c=this._getSession();e.from=E(e.from,c),e.to=E(e.to,c)}return e},A.prototype.getTimeScaleLogicalRange=function(){return this._chartWidget.model().timeScale().logicalRange()},A.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},A.prototype.scrollPosition=function(){return this._chartWidget.model().timeScale().rightOffset()},A.prototype.defaultScrollPosition=function(){return this._chartWidget.model().timeScale().defaultRightOffsetProperty().value()},A.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},A.prototype.createOrderLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},A.prototype.createPositionLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},A.prototype.createExecutionShape=function(e){e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},A.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},A.prototype._alignPoints=function(e){ -var t=this._chartWidget.model().model(),i=t.mainSeries(),r=i.interval();if(t.timeScale().isEmpty()||!m.isDWM(r))return e;var n=_.createAligner(r,i.symbolInfo(),!0);return null===n?e:e.map((function(e){return e?(n.moveTo(1e3*e),n.startOfBar(0)/1e3):e}))},A.prototype._convertUserPointsToDataSource=function(e){var t=this._chartWidget.model().model(),i=t.mainSeries(),r=t.timeScale().points(),n=i.data();if(t.timeScale().isEmpty())return null;var o=e.map((function(e){return e.time})),s=this._alignPoints(o);function a(e,t,o){var s=r.closestIndexLeft(e)||0,a={index:s},l=r.valueAt(s);if(e>l&&s===r.lastIndex()){var c=i.syncModel().distance(l,e);c.success&&(a.index=a.index+c.result)}if(S(t))a.price=t;else{var u=o?["open","high","low","close"].indexOf(o)+1:1;u<=0&&(u=1),a.price=n.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 _=1;_l&&s===r.lastIndex()){var c=i.syncModel().distance(l,e);c.success&&(a.index=a.index+c.result)}if(b(t))a.price=t;else{var u=o?["open","high","low","close"].indexOf(o)+1:1;u<=0&&(u=1),a.price=n.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 _=1;_5;if(c||!t){if(c&&!this._moveExceededManhattanDistance&&t){var u=.5*s,h=a>=u&&!this._options.treatVertTouchDragAsPageScroll,d=u>a&&!this._options.treatHorzTouchDragAsPageScroll;h||d||(this._preventDragProcess=!0)}c&&(this._moveExceededManhattanDistance=!0,this._cancelClick=!0,t&&this._clearLongTapTimeout()),this._preventDragProcess||(this._processEvent(i,this._handler.pressedMouseMoveEvent),t&&Object(o.a)(e))}}}},e.prototype._mouseUpHandler=function(e){if(!("button"in e)||0===e.button){var t=this._makeCompatEvent(e);this._clearLongTapTimeout(),this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null);var i=l(e);if(i&&this._mouseLeaveHandler(e),this._processEvent(t,this._handler.mouseUpEvent),i?++this._tapCount:++this._clickCount,this._clickTimeoutId&&(this._clickCount>1||this._tapCount>1))Math.abs(this._clickPosition.x-t.localX)+Math.abs(this._clickPosition.y-t.localY)<(i?15:5)&&!this._cancelClick&&this._processEvent(t,this._handler.mouseDoubleClickEvent),this._resetClickTimeout();else this._cancelClick||this._processEvent(t,this._handler.mouseClickEvent);if(l(e)&&(0===this._tapCount&&Object(o.a)(e),this._mouseLeaveHandler(e),0===e.touches.length&&this._longTapActive&&(this._longTapActive=!1,Object(o.a)(e))),r.isFF)this._target.ownerDocument.documentElement.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp)}},e.prototype._clearLongTapTimeout=function(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)},e.prototype._mouseDownHandler=function(e){if(!("button"in e)||0===e.button){var t=this._target.ownerDocument.documentElement;r.isFF&&t.addEventListener("mouseleave",this._onFirefoxOutsideMouseUp);var i=this._makeCompatEvent(e);this._cancelClick=!1,this._moveExceededManhattanDistance=!1,this._preventDragProcess=!1,l(e)&&this._mouseEnterHandler(e),this._mouseMoveStartPosition={x:i.pageX,y:i.pageY},this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null);var n=this._mouseMoveWithDownHandler.bind(this),o=this._mouseUpHandler.bind(this);this._unsubscribeRoot=function(){t.removeEventListener("touchmove",n),t.removeEventListener("touchend",o),t.removeEventListener("mousemove",n),t.removeEventListener("mouseup",o)},t.addEventListener("touchmove",n,{passive:!1}),t.addEventListener("touchend",o,{passive:!1}),this._clearLongTapTimeout(),l(e)&&1===e.touches.length?this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,e),240):(t.addEventListener("mousemove",n),t.addEventListener("mouseup",o)),this._mousePressed=!0,this._processEvent(i,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._tapCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500),this._clickPosition={x:i.localX,y:i.localY})}},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._unsubscribeOutsideEvents=function(){t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",i)},t.addEventListener("mousedown",i),t.addEventListener("touchstart",i,{passive:!0}),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("contextmenu",this._longTapHandler.bind(this)),this._target.addEventListener("touchstart",this._mouseDownHandler.bind(this),{passive:!0}),Modernizr.mobiletouch||this._target.addEventListener("mousedown",this._mouseDownHandler.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=a(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=a(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){this._unsubscribeMousemove&&this._unsubscribeMousemove();var t=this._makeCompatEvent(e);this._processEvent(t,this._handler.mouseLeaveEvent)},e.prototype._longTapHandler=function(e){l(e)||Object(o.a)(e);var t=this._makeCompatEvent(e);this._processEvent(t,this._handler.longTapEvent),this._processEvent(t,this._handler.contextMenuEvent),this._cancelClick=!0,this._longTapActive=!0},e.prototype._processEvent=function(e,t){t&&t.call(this._handler,e)},e.prototype._makeCompatEvent=function(e){var t;t="touches"in e&&e.touches.length?e.touches[0]:"changedTouches"in e&&e.changedTouches.length?e.changedTouches[0]:e;var i=this._target.getBoundingClientRect()||{left:0,top:0};return{clientX:t.clientX,clientY:t.clientY, pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY,localX:t.clientX-i.left,localY:t.clientY-i.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,type:e.type.startsWith("mouse")?"mouse":"touch",target:t.target,view:e.view,preventDefault:function(){Object(o.a)(e)}}},e}();function a(e,t){var i=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.sqrt(i*i+r*r)}function l(e){return Boolean(e.touches)}},Si3H:function(e,t,i){"use strict";i.r(t);var r=i("Eyy1"),n=i("0YCj"),o=i.n(n),s=i("ogJP"),a=function(){function e(){}return e.prototype.targetMetaInfoVersion=function(){return 47},e.prototype.migrateMetaInfo=function(e){var t=e,i=e;if(i._metainfoVersion=47,t.defaults&&void 0!==t.defaults.precision){var r=t.defaults&&t.defaults.precision,n=Object(s.isNumber)(r)?r:parseInt(r);0===n?i.format={type:"volume"}:isFinite(n)?i.format={type:"price",precision:n}:i.format={type:"inherit"},delete t.defaults.precision}else i.format={type:"inherit"}},e.prototype.migratePropState=function(e){},e}(),l=i("mrSG"),c=function(){function e(){}return e.prototype.targetMetaInfoVersion=function(){return 50},e.prototype.migrateMetaInfo=function(e){var t=e,i=e;if(i._metainfoVersion=50,void 0!==t.defaults&&void 0!==t.defaults.ohlcPlots&&void 0!==t.ohlcPlots)for(var n=t.ohlcPlots,o=t.defaults.ohlcPlots,s=Object(r.ensureDefined)(Object(r.ensureDefined)(i.defaults).ohlcPlots),a=0,c=Object.keys(o);a=n.targetMetaInfoVersion()||(n.migrateMetaInfo(e),void 0!==t&&n.migratePropState(t),Object(r.assert)(e._metainfoVersion===n.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 r=i("mrSG"),n=i("tqok"),o=i("hsV8");function s(e,t){if(e.index>=t.length)return null;var i=t[e.index];return i===n.a?null:{startPrice:e.startPrice,endPrice:e.endPrice,index:i,extendTop:e.extendTop,extendBottom:e.extendBottom}}function a(e,t,i){var n=Object(o.ensureTimePointIndexIndex)(i.indexOf(e.index));return Object(r.__assign)(Object(r.__assign)({id:t},e),{index:n})}},Ss5c:function(e,t,i){"use strict";(function(e){ -var r=i("Eyy1").ensureDefined,n=i("aO4+").Point,o=i("4TVt").LineToolPriceAxisView,s=i("fJhV").LineDataSourceTimeAxisView,a=i("fgLi").DataSource,l=i("mMWL"),c=i("LxhU"),u=c.Interval,h=c.ResolutionKind,d=i("pPtI").getServerInterval,p=i("uOxu").getLogger("Chart.LineDataSource"),f=i("FQhm"),_=i("aIyQ"),m=i("hayr").propertyPages,y=i("WkOR").areEqualSymbols,g=i("Kxc7"),v=i("ytGH").LineToolWidthsProperty,S=g.enabled("datasource_copypaste");function b(t,i){a.call(this),this._model=t,this._properties=i,this._pointAdded=new _,this._pointChanged=new _,this._onTemplateApplying=new _,this._onTemplateApplied=new _,this._paneViews=[],this._points=[],this._fixedPoints=[],this._timePoint=[],this._currentPointsetId=null,this._properties.hasChild("symbol")||this._properties.addChild("symbol",new e(t.mainSeries().symbol())),this._properties.hasChild("interval")||this._properties.addChild("interval",new e(t.mainSeries().interval())),this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,b.prototype.calcIsActualSymbol);var r=this;if(this._properties.listeners().subscribe(this,(function(){r.propertiesChanged()})),this._createPointsProperties(),this.m_priceAxisViews=[],this.m_timeAxisViews=[],this.pointsCount()>0)for(var n=0;n=i.multiplier()&&(t=e.key)})),t},b.prototype.calcIsActualSymbol=function(){var e=this._properties.symbol,t=this._model.mainSeries(),i=e.value();if(this._isActualSymbol=t.symbolSameAsCurrent(i),this._isActualSymbol){var r=t.symbol();y(i,r)||(p.logWarn('Possible drawing "migrating" detected from "'+i+'" to "'+r+'"'),p.logWarn("Series symbolInfo: "+JSON.stringify(t.symbolInfo())),p.logWarn((new Error).stack)),e.setValue(r)}this.calcIsActualInterval(),this.calcIsActualCurrency()},b.prototype.calcIsActualCurrency=function(){if(this._model.currencyLabelEnabled()){var e=this.ownerSource();if(null===e)return void(this._isActualCurrency=!1);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&&i.currency_code===i.original_currency_code}}else this._isActualCurrency=!0},b.prototype.calcIsActualInterval=function(){var e=this._properties,t=this._model.mainSeries(),i=u.parse(t.interval()),r=e.intervalsVisibilities;if(this._isActualInterval=!1,i.isSeconds()&&i.multiplier()<60){var n=r.seconds.value(),o=r.secondsFrom.value(),s=r.secondsTo.value();this._isActualInterval=n&&i.multiplier()>=o&&i.multiplier()<=s}if(i.isSeconds()&&i.multiplier()>=60){var a=Math.floor(i.multiplier()/60);n=r.minutes.value(),o=r.minutesFrom.value(),s=r.minutesTo.value();this._isActualInterval=n&&a>=o&&a<=s}if(i.isMinutes()&&i.multiplier()<60){n=r.minutes.value(),o=r.minutesFrom.value(),s=r.minutesTo.value();this._isActualInterval=n&&i.multiplier()>=o&&i.multiplier()<=s}if(i.isMinutes()&&i.multiplier()>=60){var l=Math.floor(i.multiplier()/60);n=r.hours.value(),o=r.hoursFrom.value(),s=r.hoursTo.value();this._isActualInterval=n&&l>=o&&l<=s}if(i.isDays()){n=r.days.value(),o=r.daysFrom.value(),s=r.daysTo.value();this._isActualInterval=n&&i.multiplier()>=o&&i.multiplier()<=s}if(i.isWeeks()&&(this._isActualInterval=r.weeks.value()),i.isMonths()&&(this._isActualInterval=r.months.value()),i.isRange()&&(this._isActualInterval=r.ranges.value()),!this._isActualInterval&&this._model.selection().isSelected(this)){var c=this;this._model.selectionMacro((function(e){e.removeSourceFromSelection(c)}))}},b.PointIndexProperty=function(t,i){e.call(this),this._lineSource=t,this._pointIndex=i},inherit(b.PointIndexProperty,e),b.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},b.PointIndexProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.index=e,this._lineSource.setPoint(this._pointIndex,t),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},b.prototype._syncMultichartState=function(){var e={points:this._timePoint,interval:this._model.mainSeries().interval()} -;this.linkKey&&this.isSynchronizable()&&l.finishChangingLineTool({model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:e})},b.prototype._createPointProperty=function(e){var t=this._properties.points;t.addProperty(e);var i=t[e];i.addChild("price",new b.PointPriceProperty(this,e)),i.addChild("bar",new b.PointIndexProperty(this,e))},b.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var e=0;e0&&(this._points=e)},b.prototype.restorePoints=function(e,t,i){this._timePoint=e,this._points=t, -i||this.denormalizeTimePoints()},b.prototype.restoreExternalPoints=function(e){this.properties().interval.setValue(e.interval),this._timePoint=e.points,this.isActualSymbol()?this.createServerPoints():this.clearServerPoints()},b.prototype.restoreExternalState=function(e){this.properties().merge(e)},b.prototype.restorePositionPercents=function(e){this._positionPercents=e},b.prototype.getLinkKey=function(){return this.linkKey||null},b.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},b.prototype.propertiesChanged=function(e){this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),e||this._syncLineStyleIfNeeded()},b.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})}},b.prototype._muteSyncLineStyle=function(){this._syncLineStyleMuted=!0},b.prototype._unmuteSyncLineStyleWithoutApplyingChanges=function(){this.propertiesChanged(),this._syncLineStyleMuted=!1},b.prototype.points=function(){for(var e=[],t=0;t=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),i},b.prototype.addPoint=function(e,t,i){var r=this._preparePoint(e,t);return this._addPointIntenal(r,t,i)},b.prototype._addPointIntenal=function(e,t,i){this._points.push(e);var r=this._points.length===this.pointsCount();return r?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=e,this._pointAdded.fire(this._points.length-1),r},b.prototype.addFixedPoint=function(e){this._fixedPoints.push(e);var t=this._fixedPoints.length===this.pointsCount();return t&&this.calcPositionPercents(),t},b.prototype.calcPositionPercents=function(){if(!this.priceScale()||this.priceScale().isEmpty())return[];this._positionPercents=[];for(var e=0;e=0;--t)e.push(this._paneViews[t]);return e},b.prototype._setPaneViews=function(e){this._paneViews=e,this._model.lightUpdate()},b.prototype.dataWindowView=function(){return null},b.prototype.statusView=function(){return null},b.prototype.isSourceHidden=function(){return!this._properties.visible.value()||l.hideAllDrawings().value()&&this.canBeHidden()||!this._isActualInterval||!this._isActualSymbol||!this._isActualCurrency},b.prototype.isSynchronizable=function(){return!0},b.prototype.priceAxisViews=function(e,t){if(t!==this.priceScale()||this.isSourceHidden())return null;if(this._model.lineBeingEdited()===this){var i=this._model.linePointBeingEdited();if(i0)for(var n=0;n=i.multiplier()&&(t=e.key)})),t},S.prototype.calcIsActualSymbol=function(){var e=this._properties.symbol,t=this._model.mainSeries(),i=e.value();if(this._isActualSymbol=t.symbolSameAsCurrent(i),this._isActualSymbol){var r=t.symbol();y(i,r)||(p.logWarn('Possible drawing "migrating" detected from "'+i+'" to "'+r+'"'),p.logWarn("Series symbolInfo: "+JSON.stringify(t.symbolInfo())),p.logWarn((new Error).stack)),e.setValue(r)}this.calcIsActualInterval(),this.calcIsActualCurrency()},S.prototype.calcIsActualCurrency=function(){if(this._model.currencyLabelEnabled()){var e=this.ownerSource();if(null===e)return void(this._isActualCurrency=!1);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&&i.currency_code===i.original_currency_code}}else this._isActualCurrency=!0},S.prototype.calcIsActualInterval=function(){var e=this._properties,t=this._model.mainSeries(),i=u.parse(t.interval()),r=e.intervalsVisibilities;if(this._isActualInterval=!1,i.isSeconds()&&i.multiplier()<60){var n=r.seconds.value(),o=r.secondsFrom.value(),s=r.secondsTo.value();this._isActualInterval=n&&i.multiplier()>=o&&i.multiplier()<=s}if(i.isSeconds()&&i.multiplier()>=60){var a=Math.floor(i.multiplier()/60);n=r.minutes.value(),o=r.minutesFrom.value(),s=r.minutesTo.value();this._isActualInterval=n&&a>=o&&a<=s}if(i.isMinutes()&&i.multiplier()<60){n=r.minutes.value(),o=r.minutesFrom.value(),s=r.minutesTo.value();this._isActualInterval=n&&i.multiplier()>=o&&i.multiplier()<=s}if(i.isMinutes()&&i.multiplier()>=60){var l=Math.floor(i.multiplier()/60);n=r.hours.value(),o=r.hoursFrom.value(),s=r.hoursTo.value();this._isActualInterval=n&&l>=o&&l<=s}if(i.isDays()){n=r.days.value(),o=r.daysFrom.value(),s=r.daysTo.value();this._isActualInterval=n&&i.multiplier()>=o&&i.multiplier()<=s}if(i.isWeeks()&&(this._isActualInterval=r.weeks.value()),i.isMonths()&&(this._isActualInterval=r.months.value()),i.isRange()&&(this._isActualInterval=r.ranges.value()),!this._isActualInterval&&this._model.selection().isSelected(this)){var c=this;this._model.selectionMacro((function(e){e.removeSourceFromSelection(c)}))}},S.PointIndexProperty=function(t,i){e.call(this),this._lineSource=t,this._pointIndex=i},inherit(S.PointIndexProperty,e),S.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},S.PointIndexProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.index=e,this._lineSource.setPoint(this._pointIndex,t),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},S.prototype._syncMultichartState=function(){var e={points:this._timePoint,interval:this._model.mainSeries().interval()} +;this.linkKey&&this.isSynchronizable()&&l.finishChangingLineTool({model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:e})},S.prototype._createPointProperty=function(e){var t=this._properties.points;t.addProperty(e);var i=t[e];i.addChild("price",new S.PointPriceProperty(this,e)),i.addChild("bar",new S.PointIndexProperty(this,e))},S.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var e=0;e0&&(this._points=e)},S.prototype.restorePoints=function(e,t,i){this._timePoint=e,this._points=t, +i||this.denormalizeTimePoints()},S.prototype.restoreExternalPoints=function(e){this.properties().interval.setValue(e.interval),this._timePoint=e.points,this.isActualSymbol()?this.createServerPoints():this.clearServerPoints()},S.prototype.restoreExternalState=function(e){this.properties().merge(e)},S.prototype.restorePositionPercents=function(e){this._positionPercents=e},S.prototype.getLinkKey=function(){return this.linkKey||null},S.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},S.prototype.propertiesChanged=function(e){this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),e||this._syncLineStyleIfNeeded()},S.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})}},S.prototype._muteSyncLineStyle=function(){this._syncLineStyleMuted=!0},S.prototype._unmuteSyncLineStyleWithoutApplyingChanges=function(){this.propertiesChanged(),this._syncLineStyleMuted=!1},S.prototype.points=function(){for(var e=[],t=0;t=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),i},S.prototype.addPoint=function(e,t,i){var r=this._preparePoint(e,t);return this._addPointIntenal(r,t,i)},S.prototype._addPointIntenal=function(e,t,i){this._points.push(e);var r=this._points.length===this.pointsCount();return r?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=e,this._pointAdded.fire(this._points.length-1),r},S.prototype.addFixedPoint=function(e){this._fixedPoints.push(e);var t=this._fixedPoints.length===this.pointsCount();return t&&this.calcPositionPercents(),t},S.prototype.calcPositionPercents=function(){if(!this.priceScale()||this.priceScale().isEmpty())return[];this._positionPercents=[];for(var e=0;e=0;--t)e.push(this._paneViews[t]);return e},S.prototype._setPaneViews=function(e){this._paneViews=e,this._model.lightUpdate()},S.prototype.dataWindowView=function(){return null},S.prototype.statusView=function(){return null},S.prototype.isSourceHidden=function(){return!this._properties.visible.value()||l.hideAllDrawings().value()&&this.canBeHidden()||!this._isActualInterval||!this._isActualSymbol||!this._isActualCurrency},S.prototype.isSynchronizable=function(){return!0},S.prototype.priceAxisViews=function(e,t){if(t!==this.priceScale()||this.isSourceHidden())return null;if(this._model.lineBeingEdited()===this){var i=this._model.linePointBeingEdited();if(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)},TMWk:function(e,t,i){"use strict";var r=i("Eyy1").assert,n=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,r){o.call(this,e,t,i,r),this._underlyingData=new s(a(r),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,n(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,n){if(e.indexOf(i.type)>-1){var o=null;this._metaInfo.plots.forEach((function(e,t){e.id===i.target&&(o=t)})),r(o>=0,"target plot not found for strategy plot "+i.id);var s={strategy:i.type,strategyIndex:n,targetIndex:o};t.push(s)}}),this),t},c.prototype._createStrategy=function(e,t,i,r){return new c["Strategy_"+e](t,i,r)},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,r=null,n=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(n){if(n.pointIndex!==u.pointIndex){c>=0&&(e.valueAt(c)[t]=a);var h=!1;r&&(h=r.value<=n.value&&n.value<=a||r.value>=n.value&&n.value>=a),h?n.pointIndex>=0&&(e.valueAt(n.pointIndex)[t]=null):r=n,n=u}}else n=u;return!1}))},t.study_ScriptWithDataOffset=c},TQMj:function(e,t,i){"use strict";i.r(t);var r=i("mrSG"),n=i("Eyy1"),o=i("LxhU"),s=i("KcY8"),a=i("Kxc7"),l=i("oXaB");function c(e){return e<10?"0"+e:e.toString()}i.d(t,"SeriesPriceAxisView",(function(){return f}));var u=a.enabled("countdown"),h=a.enabled("price_scale_always_last_bar_value"),d=[0,1,2,3,9,8],p=a.enabled("force_exchange_as_title"),f=function(e){function t(t,i){var r=e.call(this)||this;return r._source=t,r._data=i,r}return Object(r.__extends)(t,e),t.prototype._getSource=function(){return this._source},t.prototype._getData=function(){return this._data},t.prototype._isCountdownEnabled=function(){return u},t.prototype._countdownText=function(){var e=o.Interval.parse(this._source.interval());if(e.isDWM()||e.isSeconds()&&1===e.multiplier())return"" ;var t=1e3*Object(n.ensure)(Object(n.ensureNotNull)(this._source.data().bars().last()).value[0]),i=o.Interval.parse(this._source.interval()).inMilliseconds(),r=t.valueOf()+i,s=Math.round((r-this._currentTime())/1e3);if(s<=0)return"";var a=null;(s=Math.min(s,i/1e3))>=3600&&(a=c(Math.floor(s/3600))),s%=3600;var l=c(Math.floor(s/60));s%=60;var u=c(Math.floor(s));return null!==a?a+":"+l+":"+u:l+":"+u},t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var r=this._source.properties();if(12!==r.style.value()){var n=this._data.model.properties().scalesProperties,o=n.showSeriesLastValue.value(),s=u&&-1!==d.indexOf(r.style.value())&&r.showCountdown.value(),a=n.showSymbolLabels.value(),c=n.seriesLastValueMode.value()===l.PriceAxisLastValueMode.LastPriceAndPercentageValue,p=this._source.lastValueData(void 0,h);if(!p.noData){var f=8===r.style.value();if((o||s||a)&&f&&r.haStyle.showRealLastPrice.value()){var _=this._source.lastValueData(void 0,!1),m=this._source.lastValueData(void 0,!0);_.noData||m.noData||_.index!==m.index||(o=!1,s=!1,a=!1)}if(o||s){var y=this._axisFirstLineText(p,o,c),g=s?this._countdownText():"";0===y.length?(e.text=g,e.secondLine=""):(e.text=y,e.secondLine=g),0===y.length&&0===g.length||(e.visible=!0)}(a||c)&&(t.text=this._paneText(p,o,a,c),t.visible=t.text.length>0),i.background=this._source.priceLineColor(p.color),i.color=this.generateTextColor(i.background),i.coordinate=p.coordinate,i.floatCoordinate=p.floatCoordinate}}},t.prototype._paneText=function(e,t,i,r){var n="";if(p){var o=this._source.symbolInfo();n+=o?o.exchange+" ":""}else if(i){var s=this._source.getSymbolName();s.length>40&&(s=s.substr(0,37)+"..."),n+=s+" "}return t&&r&&(n+=this._source.priceScale().isPercentage()?e.formattedPriceAbsolute:e.formattedPricePercentage),n.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}(s.a)},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 r=i("Qb4w"),n=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),n=s(e.maxValue(),t);return new r.PriceRange(i,n)}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),n=c(e.maxValue(),t);return new r.PriceRange(i,n)}function h(e){var t=Math.abs(e);if(t<1e-8)return 0;var i=Object(n.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}}, @@ -357,12 +357,12 @@ var r=e.call(this)||this;return r._study=t,r._plotname=i,r}return Object(r.__ext ;return t.text=this.properties().childs().text.value(),t},t.createProperties=function(e,i){var r=new s.DefaultProperty(i,e);return t._configureProperties(r),r},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),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){a.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new c.a("")),e.addExclusion("text")},t.version=2,t}(a.LineDataSource),_=function(e){function t(t,i){var r=e.call(this,t,i,"linetoolarrowmarkleft")||this;return r._constructor="LineToolArrowMarkLeft",r}return Object(r.__extends)(t,e),t.prototype.direction=function(){return"left"},t.prototype.translatedType=function(){return u},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 f.createProperties(e,"linetoolarrowmarkleft")},t}(f),m=function(e){function t(t,i){var r=e.call(this,t,i,"linetoolarrowmarkup")||this;return r._constructor="LineToolArrowMarkUp",r}return Object(r.__extends)(t,e),t.prototype.direction=function(){return"up"},t.prototype.translatedType=function(){return h},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 f.createProperties(e,"linetoolarrowmarkup")},t}(f),y=function(e){function t(t,i){var r=e.call(this,t,i,"linetoolarrowmarkright")||this;return r._constructor="LineToolArrowMarkRight",r}return Object(r.__extends)(t,e),t.prototype.direction=function(){return"right"},t.prototype.translatedType=function(){return d},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 f.createProperties(e,"linetoolarrowmarkright")},t}(f),g=function(e){function t(t,i){var r=e.call(this,t,i,"linetoolarrowmarkdown")||this;return r._constructor="LineToolArrowMarkDown",r}return Object(r.__extends)(t,e),t.prototype.direction=function(){return"down"},t.prototype.translatedType=function(){return p},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 f.createProperties(e,"linetoolarrowmarkdown")},t}(f)},TrvT:function(e,t,i){"use strict";i.r(t),i.d(t,"CompareDataWindowView",(function(){return u}));var r=i("mrSG"),n=i("it7y"),o=i("e92V"),s=i("mMWL"),a=i("qFKp"),l=i("ogJP"),c=a.CheckMobile.any(),u=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r._studyCompare=t,r}return Object(r.__extends)(t,e), t.prototype._updateImpl=function(){e.prototype._updateImpl.call(this),this._items[0].setTitle(this._studyCompare.guiPlotName(""))},t.prototype._hideValues=function(){return!1},t.prototype._currentIndex=function(){var e,t=this._model.crossHairSource().lockedIndex;return c&&(null===this._model.crossHairSource().pane&&void 0===t||Object(o.a)(s.tool.value())||null!==this._model.lineBeingEdited())?e=this._study.data().lastIndex():(e=this._model.crossHairSource().appliedIndex(),Object(l.isNumber)(e)||(e=this._study.data().lastIndex())),e},t}(n.StudyDataWindowView)},TzTt:function(e,t,i){"use strict";var r;function n(e,t){var i,n;return i=null==t?document.documentElement:9===t.nodeType?t.documentElement:t,r&&(n=r.get(i)),n||((n=i.ownerDocument.createRange()).selectNodeContents(i),r&&r.set(i,n)),n.createContextualFragment(e)}function o(e,t){var i,r=n(e,t);if("firstElementChild"in r)i=r.firstElementChild;else{i=null;for(var o=0;o0?"+"+(o-o%1)+n:0===o?"":String(o-o%1+n))}}},"U0+/":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyMetaInfoRepository",(function(){return u}));i("YFKU");var r=i("Eyy1"),n=i("0YCj"),o=i.n(n),s=i("Si3H"),a=i("lCO3"),l=i("uOxu"),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(r){c.logNormal("Requesting studies metadata #"+t+" finished");var n=r.params[1].metainfo.slice();e._processLibraryMetaInfo(n),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;tr?1:i50)){var i=0,r=v(this._position1,this._position2,this._maxSpeed),n=g(this._position1,this._position2),o=[r],s=[n];if(i+=n,null!==this._position3){var a=v(this._position2,this._position3,this._maxSpeed);if(Math.sign(a)===Math.sign(r)){var l=g(this._position2,this._position3);if(o.push(a),s.push(l),i+=l,null!==this._position4){var c=v(this._position3,this._position4,this._maxSpeed);if(Math.sign(c)===Math.sign(r)){var u=g(this._position3,this._position4);o.push(c),s.push(u),i+=u}}}}for(var h,d,p=0,f=0;f50)){var i=0,r=v(this._position1,this._position2,this._maxSpeed),n=g(this._position1,this._position2),o=[r],s=[n];if(i+=n,null!==this._position3){var a=v(this._position2,this._position3,this._maxSpeed);if(Math.sign(a)===Math.sign(r)){var l=g(this._position2,this._position3);if(o.push(a),s.push(l),i+=l,null!==this._position4){var c=v(this._position3,this._position4,this._maxSpeed);if(Math.sign(c)===Math.sign(r)){var u=g(this._position3,this._position4);o.push(c),s.push(u),i+=u}}}}for(var h,d,p=0,f=0;f=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.showContextMenuForSelection=function(e){var t=this._chartUndoModel().selection();if(!t.isEmpty()){var i=t.sources().filter((function(e){return e.hasContextMenu()}));this.showContextMenuForSources(i,e)}},e.prototype.showContextMenuForSources=function(e,t,i){if(!e.length)return Promise.resolve(null);var r=e[0],n=Object(a.merge)(Object(a.clone)(this._options.contextMenu),i||{}),o=new T.ActionsProvider(this._chart,n);if(r===this._chartUndoModel().crossHairSource())return r.handleContextMenuEvent(t),Promise.resolve(null) ;var s=o.contextMenuActionsForSources(e);return 0===s.length?Promise.resolve(null):L.ContextMenuManager.createMenu(s).then((function(e){return e.show(t),e}))},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(){return{type:"pane",leftAxis:this._lhsPriceAxisesContainer.getScreenshotData(),rightAxis:this._rhsPriceAxisesContainer.getScreenshotData(),content:this._canvasBinding.canvas.toDataURL(),canvas:this._canvasBinding.canvas,contentWidth:this._size.w,contentHeight:this._size.h,studies:[]}},e.prototype.hardResetCanvas=function(){this._size.equals(new _.Size(0,0))||(Object(_.hardResizeCanvas)(this._canvasBinding,this._size),Object(_.hardResizeCanvas)(this._topCanvasBinding,this._size),this._lhsPriceAxisesContainer.hardResetCanvas(),this._rhsPriceAxisesContainer.hardResetCanvas())},e.prototype.updatePriceAxisWidgets=function(){if(this.hasState()){var e=this._chartModel(),t=e.paneForSource(e.mainSeries());if(t){var i=e.priceScaleSlotsCount(),r=this.state(),n=r.visibleLeftPriceScales(),o=r.visibleRightPriceScales();this._lhsPriceAxisesContainer.setScales(n,i.left,t.leftPriceScales().length,i.left+i.right),this._rhsPriceAxisesContainer.setScales(o,i.right,t.rightPriceScales().length,i.left+i.right)}}},e.prototype.update=function(){this.hasState()&&(this._lhsPriceAxisesContainer.update(),this._rhsPriceAxisesContainer.update(),null!==this._legendWidget&&this._legendWidget.update(),this.updateControls())},e.prototype.updateControls=function(){this.hasState()&&null!==this._paneControls&&this._paneControls.update()},e.prototype.updateThemedColors=function(e){this._themedColor=e,this._updateByThemedColors()},e.prototype.statusWidget=function(){return this._legendWidget},e.prototype.getElement=function(){return this._rowElement},e.prototype.canvasElement=function(){return this._canvasBinding.canvas},e.prototype.hasCanvas=function(e){return this._canvasBinding.canvas===e||this._topCanvasBinding.canvas===e},e.prototype.pinchStartEvent=function(){this._options.handleScale.pinch&&(this._terminateActiveAnimations(),this._prevPinchScale=1,this._pinching=!0,this._wasPinched=!0)},e.prototype.pinchEvent=function(e,t){if(this._options.handleScale.pinch){var i=5*(t-this._prevPinchScale);this._prevPinchScale=t,this._chartModel().zoomTime(e.x,i,!0),this._prevPinchScale=t}},e.prototype.pinchEndEvent=function(){this._pinching=!1},e.prototype.mouseClickEvent=function(e){if(this.hasState()){ -var t=this._dataSourceAtPoint(e.localX,e.localY),i=this._chartUndoModel(),n=t&&t.source,o=t&&!t.isCustom&&null!==t.source?t.source.id():null;if(this._lastClickedSourceId!==o){if(null!==this._lastClickedSourceId){var a=i.model().dataSourceForId(this._lastClickedSourceId);a&&a.onClickOutside&&(a.onClickOutside(e),i.model().updateSource(a))}this._lastClickedSourceId=o}if(!this._isSelectBarModeEnabled()||this.trackingModeEnabled()&&!this._exitTrackingModeOnNextTry||i.crossHairSource().trySelectCurrentBar(),t&&t.hittest&&t.hittest.result()===c.HitTestResult.CUSTOM){var l=t.hittest.data().mouseClickHandler;l&&(l(e),i.model().updateSource(Object(r.ensureNotNull)(n)))}this._isSelectBarModeEnabled()||t&&t.source===i.crossHairSource()||this._tryExitTrackingMode(),n instanceof f.BarsMarksContainer&&t&&Object(r.ensureNotNull)(t.hittest).data()&&n.onClicked(Object(r.ensureNotNull)(t.hittest).data()),n&&Object(h.isLineTool)(n)&&Object(s.emit)("drawing_event",n.id(),"click")}},e.prototype.exitTrackingMode=function(){null!==this._state&&null!==this._startTrackPoint&&(this._exitTrackingModeOnNextTry=!0,this._tryExitTrackingMode())},e.prototype.trackingModeEnabled=function(){return null!==this._state&&null!==this._startTrackPoint},e.prototype._topCanvasRenderParams=function(){return{pixelRatio:this._topCanvasBinding.pixelRatio,phisicalWidth:this._topCanvasBinding.canvas.width,phisicalHeight:this._topCanvasBinding.canvas.height,cssWidth:this._chartModel().timeScale().width(),cssHeight:this.height()}},e.prototype._canvasRenderParams=function(){return{pixelRatio:this._canvasBinding.pixelRatio,phisicalWidth:this._canvasBinding.canvas.width,phisicalHeight: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._clearCursorPosition=function(){this._chartModel().clearCurrentPosition()},e.prototype._dataSourceAtPoint=function(e,t){var i=null,r=null,o=null;if(!this.hasState())return null;var s=this.state(),a=s.height(),l=s.width(),c=!1,h=function(e,t,n,s){var a=o?o.result():0;e.result()>a&&(o=e,i=t,r=n,c=s)},d=this._canvasRenderParams(),p=new n.Point(e,t);this._hitTestCustomSources(d,s.customSources(u.CustomSourceLayer.Foreground),p,h);for(var f=s.hitTestSources(),_=this._chartUndoModel(),m=f.length;0=0;--g){var b;if((x=S[g].renderer(a,l))&&x.hitTest)(b=x.hitTest(p,d))&&h(b,v,x,!1)}if(this.containsMainSeries()){var w=_.barsMarksSources();for(m=0;m=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._tryStartMovingLineTool=function(e,t,i,o){if(null===t.source||!t.source.movable()||null!==this._startTrackPoint)return!1;if(!this._preventSourceChange){var s=this._chartUndoModel(),a=Object(r.ensureNotNull)(Object(r.ensureNotNull)(this._state).mainDataSource()).firstValue(),l=Object(r.ensureNotNull)(t.source.priceScale()).coordinateToPrice(e.localY,Object(r.ensureNotNull)(a)),c=D(t.source)?s.selection().sources():[t.source],u=new n.Point(e.localX,e.localY),h={index:o,price:l};return this._startMoveLineToolParams={source:c,startPoint:{logical:h,screen:u},data:t.hittest&&t.hittest.data(),envState:i},!0}return this._startMoveLineToolParams=null,!1},e.prototype._chartModel=function(){return this._chart.model().model()},e.prototype._chartUndoModel=function(){return this._chart.model()},e.prototype._externalPaneXCoord=function(e,t){t+=this._div.getBoundingClientRect().left+document.body.scrollLeft;var i=Object(r.ensureNotNull)(this._chart.paneByState(e)),n=i._div.getBoundingClientRect().left+document.body.scrollLeft;return i._correctXCoord(t-n)},e.prototype._externalPaneYCoord=function(e,t){t+=this._div.getBoundingClientRect().left+document.body.scrollTop;var i=Object(r.ensureNotNull)(this._chart.paneByState(e)),n=i._div.getBoundingClientRect().left+document.body.scrollTop;return i._correctYCoord(t-n)},e.prototype._correctXCoord=function(e){return Math.max(0,Math.min(e,this._size.w-1))},e.prototype._correctYCoord=function(e){return Math.max(0,Math.min(e,this._size.h-1))},e.prototype._processScroll=function(e){if(this._chart.model().model().scrollEnabled()){var t=Date.now();this._startScrollingPos||this._preventScroll()||(this._startScrollingPos={x:e.clientX,y:e.clientY,timestamp:t,localX:e.localX,localY:e.localY}),null!==this._scrollXAnimation&&this._scrollXAnimation.addPosition(e.localX,t),null!==this._scrollYAnimation&&this._scrollYAnimation.addPosition(e.localY,t);var i=this._chartUndoModel(),r=this.state().defaultPriceScale();if(this._startScrollingPos&&!this._isScrolling&&(this._startScrollingPos.x!==e.clientX||this._startScrollingPos.y!==e.clientY))return i.beginUndoMacro("scroll").setCustomFlag("doesnt_affect_save",!0),null===this._scrollXAnimation&&R&&(this._scrollXAnimation=new S(.2,3.2,-.0026,15),this._scrollXAnimation.addPosition(this._startScrollingPos.localX,this._startScrollingPos.timestamp),this._scrollXAnimation.addPosition(e.localX,t)),this._scrollYAnimation,i.selection().isEmpty()||(r=i.selection().sources()[0].priceScale()), +var t=this._dataSourceAtPoint(e.localX,e.localY),i=this._chartUndoModel(),n=t&&t.source,o=t&&!t.isCustom&&null!==t.source?t.source.id():null;if(this._lastClickedSourceId!==o){if(null!==this._lastClickedSourceId){var a=i.model().dataSourceForId(this._lastClickedSourceId);a&&a.onClickOutside&&(a.onClickOutside(e),i.model().updateSource(a))}this._lastClickedSourceId=o}if(!this._isSelectBarModeEnabled()||this.trackingModeEnabled()&&!this._exitTrackingModeOnNextTry||i.crossHairSource().trySelectCurrentBar(),t&&t.hittest&&t.hittest.result()===c.HitTestResult.CUSTOM){var l=t.hittest.data().mouseClickHandler;l&&(l(e),i.model().updateSource(Object(r.ensureNotNull)(n)))}this._isSelectBarModeEnabled()||t&&t.source===i.crossHairSource()||this._tryExitTrackingMode(),n instanceof f.BarsMarksContainer&&t&&Object(r.ensureNotNull)(t.hittest).data()&&n.onClicked(Object(r.ensureNotNull)(t.hittest).data()),n&&Object(h.isLineTool)(n)&&Object(s.emit)("drawing_event",n.id(),"click")}},e.prototype.exitTrackingMode=function(){null!==this._state&&null!==this._startTrackPoint&&(this._exitTrackingModeOnNextTry=!0,this._tryExitTrackingMode())},e.prototype.trackingModeEnabled=function(){return null!==this._state&&null!==this._startTrackPoint},e.prototype._topCanvasRenderParams=function(){return{pixelRatio:this._topCanvasBinding.pixelRatio,phisicalWidth:this._topCanvasBinding.canvas.width,phisicalHeight:this._topCanvasBinding.canvas.height,cssWidth:this._chartModel().timeScale().width(),cssHeight:this.height()}},e.prototype._canvasRenderParams=function(){return{pixelRatio:this._canvasBinding.pixelRatio,phisicalWidth:this._canvasBinding.canvas.width,phisicalHeight: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._clearCursorPosition=function(){this._chartModel().clearCurrentPosition()},e.prototype._dataSourceAtPoint=function(e,t){var i=null,r=null,o=null;if(!this.hasState())return null;var s=this.state(),a=s.height(),l=s.width(),c=!1,h=function(e,t,n,s){var a=o?o.result():0;e.result()>a&&(o=e,i=t,r=n,c=s)},d=this._canvasRenderParams(),p=new n.Point(e,t);this._hitTestCustomSources(d,s.customSources(u.CustomSourceLayer.Foreground),p,h);for(var f=s.hitTestSources(),_=this._chartUndoModel(),m=f.length;0=0;--g){var S;if((x=b[g].renderer(a,l))&&x.hitTest)(S=x.hitTest(p,d))&&h(S,v,x,!1)}if(this.containsMainSeries()){var w=_.barsMarksSources();for(m=0;m=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._tryStartMovingLineTool=function(e,t,i,o){if(null===t.source||!t.source.movable()||null!==this._startTrackPoint)return!1;if(!this._preventSourceChange){var s=this._chartUndoModel(),a=Object(r.ensureNotNull)(Object(r.ensureNotNull)(this._state).mainDataSource()).firstValue(),l=Object(r.ensureNotNull)(t.source.priceScale()).coordinateToPrice(e.localY,Object(r.ensureNotNull)(a)),c=D(t.source)?s.selection().sources():[t.source],u=new n.Point(e.localX,e.localY),h={index:o,price:l};return this._startMoveLineToolParams={source:c,startPoint:{logical:h,screen:u},data:t.hittest&&t.hittest.data(),envState:i},!0}return this._startMoveLineToolParams=null,!1},e.prototype._chartModel=function(){return this._chart.model().model()},e.prototype._chartUndoModel=function(){return this._chart.model()},e.prototype._externalPaneXCoord=function(e,t){t+=this._div.getBoundingClientRect().left+document.body.scrollLeft;var i=Object(r.ensureNotNull)(this._chart.paneByState(e)),n=i._div.getBoundingClientRect().left+document.body.scrollLeft;return i._correctXCoord(t-n)},e.prototype._externalPaneYCoord=function(e,t){t+=this._div.getBoundingClientRect().left+document.body.scrollTop;var i=Object(r.ensureNotNull)(this._chart.paneByState(e)),n=i._div.getBoundingClientRect().left+document.body.scrollTop;return i._correctYCoord(t-n)},e.prototype._correctXCoord=function(e){return Math.max(0,Math.min(e,this._size.w-1))},e.prototype._correctYCoord=function(e){return Math.max(0,Math.min(e,this._size.h-1))},e.prototype._processScroll=function(e){if(this._chart.model().model().scrollEnabled()){var t=Date.now();this._startScrollingPos||this._preventScroll()||(this._startScrollingPos={x:e.clientX,y:e.clientY,timestamp:t,localX:e.localX,localY:e.localY}),null!==this._scrollXAnimation&&this._scrollXAnimation.addPosition(e.localX,t),null!==this._scrollYAnimation&&this._scrollYAnimation.addPosition(e.localY,t);var i=this._chartUndoModel(),r=this.state().defaultPriceScale();if(this._startScrollingPos&&!this._isScrolling&&(this._startScrollingPos.x!==e.clientX||this._startScrollingPos.y!==e.clientY))return i.beginUndoMacro("scroll").setCustomFlag("doesnt_affect_save",!0),null===this._scrollXAnimation&&R&&(this._scrollXAnimation=new b(.2,3.2,-.0026,15),this._scrollXAnimation.addPosition(this._startScrollingPos.localX,this._startScrollingPos.timestamp),this._scrollXAnimation.addPosition(e.localX,t)),this._scrollYAnimation,i.selection().isEmpty()||(r=i.selection().sources()[0].priceScale()), null===r||r.isEmpty()||(this._scrollPriceScale=r,i.startScrollPrice(this.state(),r,e.localY)),i.startScrollTime(e.localX),this._isScrolling=!0,void this.setCursorForTool();this._isScrolling&&(null!==this._scrollPriceScale&&i.scrollPriceTo(this.state(),this._scrollPriceScale,e.localY),i.scrollTimeTo(e.localX))}},e.prototype._finishScroll=function(){var e=this._chartUndoModel();e.endScrollTime(),null!==this._scrollPriceScale&&e.endScrollPrice(this.state(),this._scrollPriceScale),e.endUndoMacro(),this._isScrolling=!1,this._startScrollingPos=null,this._scrollPriceScale=null,this.setCursorForTool()},e.prototype._endScroll=function(e){var t=this;if(!this._isScrolling)return!1;var i=this._isScrolling&&this._scrollUndoCommandInStack();if(this._isScrolling){var r=Date.now();null!==this._scrollXAnimation&&this._scrollXAnimation.start(e.localX,r),null!==this._scrollYAnimation&&this._scrollYAnimation.start(e.localY,r);var n=this._chartUndoModel();if((null===this._scrollXAnimation||this._scrollXAnimation.finished(r))&&(null===this._scrollYAnimation||this._scrollYAnimation.finished(r)))return this._finishScroll(),i;var o=this._scrollXAnimation,s=this._scrollYAnimation,a=function(){if(null!==o&&!o.terminated()||null!==s&&!s.terminated()){var e=Date.now(),i=null===o||o.finished(e),r=null===s||s.finished(e);null===o||o.terminated()||n.scrollTimeTo(o.getPosition(e)),null===s||s.terminated()||null===t._scrollPriceScale||n.scrollPriceTo(t.state(),t._scrollPriceScale,s.getPosition(e)),i&&r?t._finishScroll():requestAnimationFrame(a)}};requestAnimationFrame(a)}return i},e.prototype._terminateActiveAnimations=function(){var e=Date.now(),t=null===this._scrollXAnimation||this._scrollXAnimation.finished(e),i=null===this._scrollYAnimation||this._scrollYAnimation.finished(e);null===this._scrollXAnimation&&null===this._scrollYAnimation||t&&i||this._finishScroll(),null!==this._scrollXAnimation&&(this._scrollXAnimation.terminate(),this._scrollXAnimation=null),null!==this._scrollYAnimation&&(this._scrollYAnimation.terminate(),this._scrollYAnimation=null)},e.prototype._preventScroll=function(){return B&&this._longTap||this._contextMenuOpenedOnLastMouseDown||Object(h.isLineToolName)(d.tool.value())||Boolean(this._chartUndoModel().lineBeingCreated())||null!==this._startTrackPoint},e.prototype._isSelectBarModeEnabled=function(){return this._chartUndoModel().crossHairSource().selectBarMode().value()},e.prototype._finishTool=function(e){var t=this._chartUndoModel(),i=d.tool.value();if(Object(d.resetToCursor)(),this._preventCrossHairMove()&&this._clearCursorPosition(),t.selectionMacro((function(t){t.addSourceToSelection(e)})),Object(M.c)(i)){var r=t.createUndoCheckpoint();this._chart.showChartPropertiesForSource(e,O.TabNames.text,void 0,r)}Object(I.trackDrawingCreated)(e)},e.prototype._updateByThemedColors=function(){null!==this._legendWidget&&this._legendWidget.updateThemedColors(this._themedColor),null!==this._paneControls&&this._paneControls.updateThemedColors(this._themedColor)},e.prototype._scrollUndoCommandInStack=function(){ var e=this._chartUndoModel().undoHistory().undoStack();if(e.isEmpty())return!1;var t=e.head();if(!(t instanceof p.a))return!1;if(t.isEmpty())return!1;var i=t.commands()[0];return i instanceof x.PriceScaleChangeUndoCommand||i instanceof C.a},e.prototype._onStateDestroyed=function(){this.setState(null)},e.prototype._getHideNotMainSourcesValue=function(){return!this._chart.isActive()&&!this._chart.crossHairSyncEnabled()},e.prototype._onDataSourcesCollectionChanged=function(){this._startMoveLineToolParams=null,null!==this._legendWidget&&this._legendWidget.updateLayout()},e.prototype._loadAndCreateLegendWidget=function(){var e=this;Promise.all([i.e(68),i.e(12),i.e("chart-widget-gui")]).then(i.bind(null,"sAH5")).then((function(t){if(!e._isDestroyed){var i=t.LegendWidget,r=Object(l.deepExtend)({},e._options.legendWidget);r.canShowSourceCode=!e._chart.onWidget(),r.readOnlyMode=r.readOnlyMode||e._chart.readOnly(),r.statusesWidgets={sourceStatusesEnabled:e._options.sourceStatusesWidgetEnabled,marketStatusEnabled:e._options.marketStatusWidgetEnabled,marketStatus:e._options.marketStatusWidget||{},dataUpdateModeEnabled:e._options.chartWarningWidgetEnabled,dataUpdateMode:e._options.chartWarningWidget||{}};var n=new w.a(e._getHideNotMainSourcesValue());e._hideNotMainSourcesInLegendSpawn=Object(P.a)((function(){return{}}),e._chart.chartWidgetCollection().activeChartWidget,e._chart.chartWidgetCollection().lock.crosshair),e._hideNotMainSourcesInLegendSpawn.subscribe((function(){n.setValue(e._getHideNotMainSourcesValue())})),e._legendWidget=new i(e._chartUndoModel(),e,e._chart.backgroundBasedTheme(),n,r,{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._themedColor)}}))},e.prototype._loadAndCreatePaneControlsWidget=function(){var e=this;Promise.all([Promise.all([i.e(68),i.e(12),i.e("chart-widget-gui")]).then(i.bind(null,"lvAK")),Promise.all([i.e(68),i.e(12),i.e("chart-widget-gui")]).then(i.bind(null,"bdgK"))]).then((function(t){var i=t[0],r=t[1];if(!e._isDestroyed){var n=i.PaneControlsWidget;e._paneControls=new n(e._chartUndoModel(),e,{backgroundThemeName:e._chart.backgroundBasedTheme()},{toggleMaximizePane:e._chart.toggleMaximizePane.bind(e._chart)},e._div),e._paneControls.updateWidgetModeByWidth(e._size.w),e._paneControls.updateThemedColors(e._themedColor),e._paneControlsResizeObserver=new r.default(e._handleRestrictLegendWidth.bind(e)),e._paneControlsResizeObserver.observe(e._paneControls.getElement())}}))},e.prototype._handleRestrictLegendWidth=function(e){if(null!==this._legendWidget&&null!==this._paneControls){ var t=this._legendWidget.getElement(),i=e[e.length-1].contentRect.width;t.style.maxWidth=0!==i?"calc(100% - "+(i+k+E)+"px)":""}},e}()},UJLt:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SaveRenameDialog=void 0;var r=function(){function e(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{},i=t.fields,r=t.confirm,n=t.manager,s=t.title,a=void 0===s?"":s,l=t.destroyOnClose,c=void 0===l||l,u=t.modal,h=void 0!==u&&u;o(this,e),this._form=document.createElement("div"),this._fields=i,this._appendFieldsToForm(),this._title=a,this._destroyOnClose=c,this._modal=h,this._manager=n,this._isConfirmDialogOpened=!1,r&&(this._needCheckConfirm=!0,this._shouldShowConfirm=r.shouldShowDialog,this._getConfirmMessage=r.getMessage)}return r(e,[{key:"setField",value:function(e,t){this._fields.find((function(t){return t.name===e})).value=t}},{key:"show",value:function(){var e=this,t=this._createDialog();return new Promise((function(i){t.then((function(t){t.on("action:submit",(function(t){return e._onSubmit(t,i)})),t.open(),t.on("beforeClose",e._unmountFields.bind(e)),e._fields[0].select()}))}))}},{key:"_appendFieldsToForm",value:function(){var e=this;this._fields.forEach((function(t){t.appendTo(e._form)}))}},{key:"_createDialog",value:function(){var e=this;return new Promise((function(t){Promise.all([i.e("dialogs-core"),i.e(55),i.e(10),i.e(14),i.e("create-dialog")]).then(function(r){var n=i("YDhE").createDialog;t(n({type:e._modal?"modal":"popup",title:e._title,content:$(e._form),actionsWrapTemplate:'
',width:470,destroyOnClose:e._destroyOnClose,manager:e._manager,isClickOutFn:function(){if(e._isConfirmDialogOpened)return!1},actions:[{name:"submit",type:"primary",text:window.t("Save"),key:13,addClass:"js-submit-button"},{name:"cancel",type:"default",text:window.t("Cancel"),method:"close",addClass:"js-cancel-button"}]}))}.bind(null,i)).catch(i.oe)}))}},{key:"_onSubmit",value:function(e,t){var i=this,r=this._validate();if(r)e.error(r.error),r.focus();else{if(!this._needCheckConfirm)return t(this._collectValues(),e),void e.close();Promise.resolve(this._shouldShowConfirm(this._collectValues())).then((function(r){if(!r)return t(i._collectValues(),e),void e.close();i._showConfirmDialog().then((function(r){r===a&&(e.focus(),i._fields[0].focus()),r===s&&(t(i._collectValues(),e),e.close())}))}))}}},{key:"_showConfirmDialog",value:function(){var e=this;return new Promise((function(t){Promise.resolve(e._getConfirmMessage(e._collectValues())).then((function(i){e._isConfirmDialogOpened=!0,(0, @@ -371,8 +371,8 @@ e.prototype.addLineTools=function(e){var t=this;this._doAndFireOnChange((functio ;n=this.screenPointToPoint(_),(TradingView.isNaN(n.price)||TradingView.isNaN(n.index))&&(n=this.screenPointToPoint(p))}}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return n},c.prototype._fixVerticalDiameterPoints=function(e,t,i){var r=this.pointToScreenPoint(e)[0],n=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:r.x,y:n.y+l}).price},c.prototype.addPoint=function(e,t,i){var r=o.prototype.addPoint.call(this,e,t,i);return r&&(this._fakePointAdded=!1),r},c.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 r(-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 r(-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=n(s,a,o).distance;c=a.subtract(s),u=s.add(a).scaled(.5);d=(d=new r(-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=n(s,a,o).distance,c=a.subtract(s),u=s.add(a).scaled(.5);d=(d=new r(-c.y,c.x)).normalized(),l=u.add(d.scaled(h)),l=this.screenPointToPoint(l),this._points[2]=l}this.normalizePoints()},c.prototype.pointsCount=function(){return 3},c.prototype.translatedType=function(){return l},c.prototype.name=function(){return"Ellipse"},c.prototype.hasEditableCoordinates=function(){return!1},c.version=2,c.prototype.migrateVersion=function(e,t,i){if(1===e&&2===this._points.length){var r=this._points[0].price,n=.5*(this._points[0].price+this._points[1].price);this._points[0]={price:n,index:this._points[0].index},this._points[1]={price:n,index:this._points[1].index},this._points.push({price:r,index:this._points[0].index})}if(1===e&&2===this._timePoint.length){r=this._timePoint[0].price,n=.5*(this._timePoint[0].price+this._timePoint[1].price);this._timePoint[0].price=n,this._timePoint[1].price=n;var o={price:r,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t} ;this._timePoint.push(o)}},c.prototype.getInputsPropertyPage=function(){return null},c.prototype.getStylesPropertyPage=function(){return a.LineToolEllipseStylesPropertyPage},c.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Zd1D").GeneralFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},c.createProperties=function(e){var t=new s("linetoolellipse",e);return c._configureProperties(t),t},c._configureProperties=function(e){o._configureProperties(e)},t.LineToolEllipse=c},V0al:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererXCross",(function(){return s}));var r=i("mrSG"),n=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(t,e),t.prototype._drawItemShapeUsingCSSPixels=function(e,t){var i=t.width,r=t.height,n=t.x-i/2,o=t.vertOffset,s=t.y-r/2+o;e.moveTo(n,s),e.lineTo(n+i,s+r),e.moveTo(n,s+r),e.lineTo(n+i,s)},t.prototype._calcBoundingBox=function(t){var i=t.width,r=t.height,n=t.x-i/2,s=t.vertOffset,a=t.y-r/2+s,l=n,c=n+i,u=a,h=a+r,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}(n.c)},V3Oj:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolText",(function(){return p})),i.d(t,"LineToolTextAbsolute",(function(){return f}));var r=i("mrSG"),n=i("Eyy1"),o=i("YFKU"),s=i("hayr"),a=i("Ss5c"),l=i("tc+8"),c=i.n(l),u=i("Ocx9"),h=Object(o.t)("Text",{context:"tool"}),d=Object(o.t)("Anchored Text"),p=function(e){function t(r,n){var o=this,s=n||t.createProperties();return(o=e.call(this,r,s)||this)._constructor="LineToolText",o._barSpacing=r.timeScale().barSpacing(),i.e("lt-pane-views").then(function(e){var t=i("mr3a").TextPaneView;o._setPaneViews([new t(o,r)])}.bind(null,i)).catch(void 0),o}return Object(r.__extends)(t,e),t.prototype.setPoint=function(e,t,i){var r,n=this.properties().childs();if(0===e&&n.wordWrapWidth.value()){var o=this.model().timeScale();r=this.isFixed()?this.fixedPoints()[0].x:o.indexToCoordinate(this.points()[0].index);var s=o.indexToCoordinate(t.index)-r-~~(n.fontsize.value()/6);if(!isFinite(s))return;n.wordWrapWidth.setValue(Math.max(100,s))}},t.prototype.pointsCount=function(){return 1},t.prototype.translatedType=function(){return h},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(n.ensureNotNull)(t.priceRange()).length(),this._isPriceDencityLog=t.isLog())},t.prototype.restoreSize=function(){var e=Object(n.ensureNotNull)(this.priceScale());this._barSpacing=this.model().timeScale().barSpacing(),this._priceDencity=e.height()/Object(n.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.getInputsPropertyPage=function(){return null},t.prototype.getStylesPropertyPage=function(){return s.propertyPages.LineToolTextStylesPropertyPage},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 u.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(21),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"QWxu")).then((function(e){return e.TextDefinitionsViewModel}))},t._configureProperties=function(e){a.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new c.a(window.t("Text"))),e.addExclusion("text")},t}(a.LineDataSource),f=function(e){function t(i,r){var n=r||t.createProperties();return e.call(this,i,n)||this}return Object(r.__extends)(t,e),t.prototype.isSynchronizable=function(){return!1},t.prototype.translatedType=function(){return d},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 u.DefaultProperty("linetooltextabsolute",e);return t._configureProperties(i),i},t._configureProperties=function(e){p._configureProperties(e)},t}(p)},VNzU:function(e,t,i){"use strict";i.r(t);var r=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 n,o={s:{title:"1 chart",count:1,sizer:function(e,t){if(0!==t)throw new RangeError("invalid index");return e}}};n={};var s=Object(r.__assign)(Object(r.__assign)({},o),n);function a(e){return"s"===e}function l(e){return!a(e)}},VVxS:function(e,t,i){"use strict";var r=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()};r.prototype.length=0,r.prototype.isAvailable=!1,r.prototype.localStorage={"tvlocalstorage.available":"false"},r.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}},r.prototype.key=function(e){return this.isAvailable?this.localStorage.key(e):Object.keys(this.localStorage)[e]},r.prototype.getItem=function(e){return this.isAvailable?this.localStorage.getItem(e):void 0===this.localStorage[e]?null:this.localStorage[e]},r.prototype.setItem=function(e,t){ -this.isAvailable?this.localStorage.setItem(e,t):this.localStorage[e]=t,this._updateLength()},r.prototype.removeItem=function(e){this.isAvailable?this.localStorage.removeItem(e):delete this.localStorage[e],this._updateLength()},r.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()};var n=function(e){this.storage=e};n.prototype.getItem=function(e){return Promise.resolve(this.storage.getItem(e))},n.prototype.setItem=function(e,t){return Promise.resolve(this.storage.setItem(e,t))},window.TVLocalStorage=new r,window.TVLocalStorageAsync=new n(window.TVLocalStorage),e.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},VdBB:function(e,t,i){"use strict";i.r(t),i.d(t,"HitTestResult",(function(){return r}));var r=function(){function e(e,t,i){this._result=e,this._data=t,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,r=i("FBuY").TVXWindowEvents,n=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(I){}if(e){var h={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},d=function(e,t,i){var r=h[e];return null==r?t:r},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={},y=[/^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 g(e){return _+"."+e}function v(e,t){var i=m[e];return null==i?t:i}function S(e,t,i){i=i||{};var r=""+t;return m[e]!==r&&(m[e]=r,w(e)),i.forceFlush&&!f&&(f=setTimeout((function(){f=void 0,P()}),10)),c}function b(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]?n.removeItem(g(e)):n.setItem(g(e),m[e])}catch(I){}else 0;r.emit("settings",JSON.stringify({key:e,value:m[e]})) -}function P(e){}function C(){return Object.keys(m)}function x(e){for(var t=0;t=0;o--)e.test(r[o])&&n.push(r[o]),e.lastIndex=0;return n},sync:function(e){i?T(i.initialSettings||{}):u()?(function(){if(TradingView.onWidget()&&a.includes(window.location.host))for(var e=n.length;e--;){var t=n.key(e);if(0===t.indexOf("tradingview.")){var i=t.replace("tradingview.",_+".");n.setItem(i,n.getItem(t)),n.removeItem(t)}}}(),function(){m={};for(var e=_+".",t=!s.enabled("save_chart_properties_to_local_storage"),i=n.length;i--;){var r=n.key(i);if(r&&r.substring(0,e.length)===e){var o=r.substring(e.length);t&&!x(o)||(m[o]=n.getItem(r))}}}()):T(e||{}),L.fire()},onSync:L,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 r=i("XlJ7"),n=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(r.makeFont)(i,n.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}()},W3MX:function(e){ +this.isAvailable?this.localStorage.setItem(e,t):this.localStorage[e]=t,this._updateLength()},r.prototype.removeItem=function(e){this.isAvailable?this.localStorage.removeItem(e):delete this.localStorage[e],this._updateLength()},r.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()};var n=function(e){this.storage=e};n.prototype.getItem=function(e){return Promise.resolve(this.storage.getItem(e))},n.prototype.setItem=function(e,t){return Promise.resolve(this.storage.setItem(e,t))},window.TVLocalStorage=new r,window.TVLocalStorageAsync=new n(window.TVLocalStorage),e.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},VdBB:function(e,t,i){"use strict";i.r(t),i.d(t,"HitTestResult",(function(){return r}));var r=function(){function e(e,t,i){this._result=e,this._data=t,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,r=i("FBuY").TVXWindowEvents,n=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(I){}if(e){var h={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},d=function(e,t,i){var r=h[e];return null==r?t:r},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={},y=[/^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 g(e){return _+"."+e}function v(e,t){var i=m[e];return null==i?t:i}function b(e,t,i){i=i||{};var r=""+t;return m[e]!==r&&(m[e]=r,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]?n.removeItem(g(e)):n.setItem(g(e),m[e])}catch(I){}else 0;r.emit("settings",JSON.stringify({key:e,value:m[e]})) +}function P(e){}function C(){return Object.keys(m)}function x(e){for(var t=0;t=0;o--)e.test(r[o])&&n.push(r[o]),e.lastIndex=0;return n},sync:function(e){i?T(i.initialSettings||{}):u()?(function(){if(TradingView.onWidget()&&a.includes(window.location.host))for(var e=n.length;e--;){var t=n.key(e);if(0===t.indexOf("tradingview.")){var i=t.replace("tradingview.",_+".");n.setItem(i,n.getItem(t)),n.removeItem(t)}}}(),function(){m={};for(var e=_+".",t=!s.enabled("save_chart_properties_to_local_storage"),i=n.length;i--;){var r=n.key(i);if(r&&r.substring(0,e.length)===e){var o=r.substring(e.length);t&&!x(o)||(m[o]=n.getItem(r))}}}()):T(e||{}),L.fire()},onSync:L,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 r=i("XlJ7"),n=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(r.makeFont)(i,n.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}()},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-600","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-header-bg":"color-athens-gray-2","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-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-screener-header-bg-hover":"#f1f3f6","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-white-theme-tooltip-text":"#333333","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-stopped-auto":"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-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-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-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-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-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-twitter":"#1DA1F2","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-delay-mode":"color-berry-pink-600","color-delay-mode-bg":"color-berry-pink-600","color-eod-mode":"color-berry-pink-600","color-eod-mode-bg":"color-berry-pink-600","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"}') },W5mg:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var r=["first_visible_bar_time","last_visible_bar_time"];function n(e){return!e.groupId&&"time"!==e.type&&!e.isHidden&&!r.includes(e.id)}},WIS0:function(e,t,i){"use strict";i.r(t),i.d(t,"DatafeedRequestsCachedProcessor",(function(){return d}));var r=i("mrSG"),n=i("Eyy1"),o=i("LxhU"),s=i("Y7w9"),a=i("ocLq"),l=i("Kxc7");i("HbRj");function c(e,t){return e.ticker+(e.currency_code?"_#_"+e.currency_code:"")+"_#_"+t}function u(e){return new Date(e).toISOString()}var h=function(){function e(e,t,i,r){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._gaps=[],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._resolution=Object(n.ensureNotNull)(o.Interval.normalize(i)),this._dwmAligner=r}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 r=this,n=this._getNextSubscriptionId(),o=Math.floor(e.from/1e3),s=Math.floor(e.to/1e3);this._pendingSubscribers.push({key:n,range:{from:o,to:s},onHistoryCallback:t,onErrorCallback:i}),this._clearResetCacheTimeout();return setTimeout((function(){r._destroyed||r._processPendingSubscribers()}),0),n},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 r=this._subscribers.find((function(t){return t.key===e}));if(r)return this._subscribers.splice(this._subscribers.indexOf(r),1),void(this._subscribers.length||(this._symbolInfo.expired||this._symbolInfo.expiration_date?this._unsubscribeRealtime():this._resetCacheTimeout=setTimeout((function(){t._resetCacheTimeout=null,t._purgeCache(),t._unsubscribeRealtime()}))));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._gaps=[],this._errorMessage=null,this._leftDate=null,this._endOfData=!1},e.prototype._processPendingSubscribers=function(){var e=this,t=this._pendingSubscribers;if(t.length)if(this._requesting)this._logMessage("Processing is skipped due active request");else{if(this._logMessage("Processing pending subscribers, count="+t.length),this._errorMessage){ var i=this._errorMessage;return this._logMessage("Return error: "+i),this._pendingSubscribers=[],void t.forEach((function(e){e.onErrorCallback(i)}))}var r=t.reduce((function(e,t){return Math.min(t.range.from,e)}),1/0);if(this._logMessage('Leftmost requested "from" is '+u(1e3*r)),!this._leftDate||r0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(e.key,r.count(),u(r.bars[0].time),u(r.bars[r.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(e.key)),t.barset=r;var n=this._inGapNextTime(i.from);if(n)this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,u(1e3*n))),r.nextTime=n;else if(0===r.count()){var o=this._cache.bars.length&&this._cache.bars[this._cache.bars.length-1].time/1e3;o&&i.from>o&&(this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,u(1e3*o))),r.nextTime=o||void 0)}this._endOfData&&null!==this._leftDate&&e.range.from<=this._leftDate&&(r.endOfData=!0),e.onHistoryCallback(r)},e.prototype._createBarset=function(e){var t=Object(s.lowerbound)(this._cache.bars,1e3*e,(function(e,t){return e.time>1,a=r+s;i(e[a],t)?(r=a+1,o-=s+1):o=s}return r}function s(e,t,i,r){return void 0===i&&(i=0),void 0===r&&(r=e.length),o(e,t,n,i,r)}function a(e,t,i,r,n){void 0===r&&(r=0),void 0===n&&(n=e.length);for(var o=n-r;0>1,a=r+s;i(t,e[a])?o=s:(r=a+1,o-=s+1)}return r}function l(e,t,i,r){return void 0===i&&(i=0),void 0===r&&(r=e.length),a(e,t,n,i,r)}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 n=new Set(t),o=[],a=[];return e.forEach((function(e,t){n.has(e)||(o.push(e),a.push(t))})),is?(console.warn("Too many variables-link in HEX-color search: "+i[0]),null):e(o,i)}(e);o[e]=n.ensureNotNull(t)})),t.colorsPalette=o,t.getHexColorByName=function(e){var i=t.colorsPalette[e];if(!i)throw new Error("No such color "+e);return i}},YWnQ:function(e,t,i){"use strict";var r;i.r(t),i.d(t,"SymbolErrorPermissionDeniedReason",(function(){return r})),i.d(t,"permissionDenied",(function(){return n})),function(e){e.Symbol="symbol",e.ExtendedHours="extended_hours",e.GroupPermission="group"}(r||(r={}));var n="permission denied"},"Ye2/":function(e,t,i){"use strict";var r;i.r(t),i.d(t,"LineToolBarsPatternMode",(function(){return r})),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"}(r||(r={}))},Yj6H:function(e,t,i){"use strict";i.r(t),i.d(t,"PriceScaleBase",(function(){return _}));var r=i("Eyy1"),n=i("aIyQ"),o=i.n(n),s=i("Qb4w"),a=i("TTFo"),l=i("qJq3"),c=i("7ktv"),u=i("tc+8"),h=i.n(u),d=i("3ClC"),p=i("/tGj"),f={autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0,isInverted:!1,indexedTo100:!1},_=function(){function e(e){this._marksCache=null,this._onMarksChanged=new o.a,this._onCurrencyLabelContentChanged=new o.a,this.m_dataSources=[],this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._hasSeries=!1,this._seriesLikeSources=[],this._seriesLikeSourcesSet=new Set,this._priceDataSources=[],this._lastSourceRemoved=new o.a,this._scaleSeriesOnly=!1,this._currencyCache=null,e=Object.assign({},f,e),this._properties=new h.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.dataSources=function(){return this.m_dataSources},e.prototype.seriesLikeSources=function(){return this._seriesLikeSources},e.prototype.addDataSource=function(e,t){var i=this;if(t||-1===this.m_dataSources.indexOf(e)){if(e instanceof c.PriceDataSource&&(this._priceDataSources.push(e),e.currencyChanged().subscribe(this,(function(){return i._currencyCache=null})),Object(p.isSymbolSource)(e)&&(this._seriesLikeSources.push(e),this._seriesLikeSourcesSet.add(e),e.symbolResolved().subscribe(this,(function(){return i._currencyCache=null})),e instanceof l.Series))){var r=e.properties();this._hasSeries||(r.childs().lockScale&&(this.setMode({lockScale:r.childs().lockScale.value()}),r.removeProperty("lockScale")),r.childs().pnfStyle.childs().lockScale&&r.childs().pnfStyle.removeProperty("lockScale")),this._hasSeries=!0}e.properties().visible.listeners().subscribe(null,(function(){i._sourcesForAutoscale=null,i._currencyCache=null})),this.m_dataSources.push(e),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._currencyCache=null,this.updateFormatter(),this._initScaleProperties(),this.invalidateSourcesCache()}},e.prototype.removeDataSource=function(e){var t=this.m_dataSources.indexOf(e);if(Object(r.assert)(-1!==t,"Source is not attached to scale"),e.properties().visible.listeners().unsubscribeAll(this),this.m_dataSources.splice(t,1),e instanceof c.PriceDataSource){var i=this._priceDataSources.indexOf(e);if(Object(r.assert)(-1!==i,"Source is not found"),this._priceDataSources.splice(i,1),Object(p.isSymbolSource)(e)){var n=this._seriesLikeSources.indexOf(e);Object(r.assert)(-1!==n,"Source is not found"),this._seriesLikeSources.splice(n,1),this._seriesLikeSourcesSet.delete(e),e.symbolResolved().unsubscribeAll(this),e instanceof l.Series&&(this._hasSeries=!1)}e.currencyChanged().unsubscribeAll(this)}this.mainSource()||this.setMode({autoScale:!0}),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.invalidateSourcesCache(),0===this.m_dataSources.length&&this._lastSourceRemoved.fire(),this._currencyCache=null},e.prototype.currency=function(e){if(null!==this._currencyCache&&e.size===this._currencyCache.availableCurrenciesCount)return this._currencyCache.value;for(var t=void 0,i=new Set,n=new Set,o=0===this._seriesLikeSources.length,s=void 0,a=!0,l=0,c=0,u=0,h=this._seriesLikeSources;u0)s=null;else if(void 0===s)s=v;else if(null!==s&&s!==v){s=null;break}o=!0;break}}}}return void 0===t&&(t=0===l&&0===c?null:{readOnly:o,selectedCurrency:s||null,currencies:n,originalCurrencies:i,symbolSourceCount:l,allCurrenciesAreOriginal:a}),this._currencyCache={value:t,availableCurrenciesCount:e.size},t},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(r.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(),r=t?this.topMargin():this.bottomMargin(),n=this.isLog(),o=n?Object(a.toLog)(e.from):e.from,l=n?Object(a.toLog)(e.to):e.to,c=l-o;o+=r*c,l-=i*c,this.setMode({autoScale:!1}),this.setPriceRange(new s.PriceRange(o,l)),this._marksCache=null,this._onMarksChanged.fire()}},e.prototype.hasMainSeries=function(){return this._hasSeries},e.prototype.getStudies=function(){return this.dataSources().filter(d.isStudy)},e.prototype.lastSourceRemoved=function(){return this._lastSourceRemoved},e.prototype._recalculateSourcesForAutoscale=function(){this._mainSource&&(this._scaleSeriesOnly=this._scalesProperties.childs().scaleSeriesOnly.value());var e=this._scaleSeriesOnly&&this._hasSeries;this._sourcesForAutoscale=this.m_dataSources.filter((function(t){return!!(t.properties().visible.value()||t instanceof l.Series)&&(e?t instanceof l.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), +if(null!==t)for(var _=0,m=this._priceDataSources;_0)s=null;else if(void 0===s)s=v;else if(null!==s&&s!==v){s=null;break}o=!0;break}}}}return void 0===t&&(t=0===l&&0===c?null:{readOnly:o,selectedCurrency:s||null,currencies:n,originalCurrencies:i,symbolSourceCount:l,allCurrenciesAreOriginal:a}),this._currencyCache={value:t,availableCurrenciesCount:e.size},t},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(r.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(),r=t?this.topMargin():this.bottomMargin(),n=this.isLog(),o=n?Object(a.toLog)(e.from):e.from,l=n?Object(a.toLog)(e.to):e.to,c=l-o;o+=r*c,l-=i*c,this.setMode({autoScale:!1}),this.setPriceRange(new s.PriceRange(o,l)),this._marksCache=null,this._onMarksChanged.fire()}},e.prototype.hasMainSeries=function(){return this._hasSeries},e.prototype.getStudies=function(){return this.dataSources().filter(d.isStudy)},e.prototype.lastSourceRemoved=function(){return this._lastSourceRemoved},e.prototype._recalculateSourcesForAutoscale=function(){this._mainSource&&(this._scaleSeriesOnly=this._scalesProperties.childs().scaleSeriesOnly.value());var e=this._scaleSeriesOnly&&this._hasSeries;this._sourcesForAutoscale=this.m_dataSources.filter((function(t){return!!(t.properties().visible.value()||t instanceof l.Series)&&(e?t instanceof l.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._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}()},Yjuu:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("xUGI"),s=i("hayr").propertyPages,a=i("ytGH").LineToolWidthsProperty,l=window.t("Fib Speed Resistance Arcs");function c(){o.call(this)}function u(e,t){this._constructor="LineToolFibSpeedResistanceArcs";var n=t||u.createProperties();r.call(this,e,n),e._fibSpeedResistanceArcsLabelsCache||(e._fibSpeedResistanceArcsLabelsCache=new c),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);for(var o=[this._properties.child("trendline").child("linewidth")],s=1;s<=u.LevelsCount;s++)o.push(this._properties.child("level"+s).child("linewidth"));this._widthsProperty=new a(o)}inherit(c,o),c.prototype.levelsCount=function(){return u.LevelsCount},inherit(u,r),u.LevelsCount=11,u.prototype.levelsCount=function(){return u.LevelsCount},u.prototype.pointsCount=function(){return 2},u.prototype.translatedType=function(){return l},u.prototype.name=function(){return"Fib Speed Resistance Arcs"},u.prototype.processErase=function(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},u.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpeedResistanceArcsStylesPropertyPage},u.createProperties=function(e){var t=new n("linetoolfibspeedresistancearcs",e,!1,{range:[1,11]});return u._configureProperties(t),t},u.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("pdv6").FibSpeedResistanceArcsDefinitionsViewModel}.bind(null,i)).catch(i.oe)},u._configureProperties=function(e){r._configureProperties(e)},t.LineToolFibSpeedResistanceArcs=u},YlKu:function(e,t,i){"use strict";i.r(t), i.d(t,"ApplyLineToolTemplateUndoCommand",(function(){return n}));var r=i("mrSG"),n=function(e){function t(t,i,r){var n=e.call(this,r)||this;return n._source=t,n._newState=i,n._oldState=t.properties().state(),n}return Object(r.__extends)(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 r=i("mrSG"),n=i("2h0C"),o=function(e){function t(t,i,r,n,o){void 0===o&&(o=null);var s=e.call(this,t,i,!0,r,n)||this;return null!==o?t.update({onExecute:o.bind(s)}):t.update({onExecute:s._onActionCallback.bind(s)}),s}return Object(r.__extends)(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}(n.Binding)},YuHv:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var r=i("AWC/");function n(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);var i=document.createElement("div"),n=document.createElement("div");return i.appendChild(n),i.classList.add(r.container),n.classList.add(r.inner),e.forEach((function(e){i.classList.add(r[e])})),t.forEach((function(e){i.classList.add(r[e])})),i}},Z0Sh:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("hayr").propertyPages,s=window.t("Gann Box");function a(e,t){this._constructor="LineToolGannSquare";var n=t||a.createProperties();r.call(this,e,n),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(a,r),a.HLevelsCount=7,a.VLevelsCount=7,a.prototype.hLevelsCount=function(){return a.HLevelsCount},a.prototype.vLevelsCount=function(){return a.VLevelsCount},a.prototype.pointsCount=function(){return 2},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Gann Box"};var l=[4.5,9,11.25,18,22.5,36,45],c=function(){for(var e=[],t=l.length-1,i=1,r=0,n=0;n<1e10;)n=l[r]*i,e.push(Math.round(n)),e.push(Math.ceil(-n)),r===t-1&&(i*=10),r=(r+1)%t;return e.sort((function(e,t){return et?1:0})),e}();a.prototype._alignPriceOnPattern=function(e,t){var i=Math.round(1e6*(e.price-t.price))/1e6;if(0===i)return t.price;for(var r=l[0],n=l[l.length-1],o=1,s=Math.abs(i);s=0&&!(l[c]*o=0?a:-a),e},a.prototype._alignTimeOnPattern=function(e,t){var i=e.index-t.index;if(0===i)return 0;for(var r=c.length-2;r>=0&&!(c[r]0?1:0,e.index=t.index+c[r],e},a.prototype._alignPointsFixedIncrement=function(e,t){return this._alignTimeOnPattern(e,t),this._alignPriceOnPattern(e,t),e},a.prototype._preparePoint=function(e,t){ return t&&t.shift()&&0!==this._points.length&&this._alignPointsFixedIncrement(e,this._points[0]),r.prototype._preparePoint.call(this,e,t)},a.prototype.setPoint=function(e,t,i){if(i&&i.shift()){var n=0===e?this._points[1]:this._points[0];this._alignPointsFixedIncrement(t,n)}r.prototype.setPoint.call(this,e,t,i)},a.prototype.getStylesPropertyPage=function(){return o.LineToolGannSquareStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("2liL").GannSquareDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolgannsquare",e,!1,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]});return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolGannSquare=a},Z8aO:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesPriceLinePaneView",(function(){return s}));var r=i("mrSG"),n=i("k4w6"),o=i("8Uy/"),s=function(e){function t(t){var i=e.call(this,t)||this;return i._lineRendererData.linestyle=o.LINESTYLE_SMALL_DASHED,i}return Object(r.__extends)(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}(n.a)},ZAbA:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesDataEvents",(function(){return o}));var r=i("aIyQ"),n=i.n(r),o=function(){function e(){this._completed=new n.a,this._error=new n.a,this._symbolError=new n.a,this._symbolResolved=new n.a,this._seriesError=new n.a,this._symbolNotPermitted=new n.a,this._symbolGroupNotPermitted=new n.a,this._extendedHoursNotPermitted=new n.a,this._chartTypeNotPermitted=new n.a,this._intradaySpreadNotPermitted=new n.a,this._intradayExchangeNotPermitted=new n.a,this._customIntervalNotPermitted=new n.a,this._secondsIntervalNotPermitted=new n.a,this._tickMarksRangeChanged=new n.a,this._barReceived=new n.a,this._messageReceived=new n.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 n}));var r=i("Eyy1"),n=function(){function e(e,t){Object(r.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,"removeSettingsValue",(function(){return l}));var r=i("Vdly"),n=i("m/cY"),o=i("e1ZQ");function s(){return r.getValue("date_format",Object(o.defaultDateFormat)())}var a=Object(n.a)(s()) -;function l(){a.setValue(Object(o.defaultDateFormat)()),r.remove("date_format")}r.onSync.subscribe(null,(function(){return a.setValue(s())})),a.listeners().subscribe(null,(function(){return r.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 r}));var r="CLOSE_POPUPS_AND_DIALOGS_COMMAND"},"Zo2/":function(e,t,i){"use strict";(function(t,r){i("YCFM"),i("YFKU");var n=i("Eyy1").assert,o=i("Y7w9").moveToHead,s=i("mkn5").PaneWidget,a=i("fYB8").PaneSeparator,l=i("mNEU"),c=i("1IXQ").PriceAxisWidget,u=i("uPb3").TimeAxisWidget,h=i("fTGZ").BarsMarksContainer,d=i("qJq3").Series,p=i("Kxc7"),f=i("YmeR").ActionBinder,_=i("mKT+").resolveAndShowEditObjectDialog,m=i("Vdly").setValue,y=i("QloM").TabNames,g=i("cdbK").showGoToDateDialog,v=i("/3z9"),S=i("lxNp"),b=i("7nsU").showConfirmInputsDialog,w=i("GVHu").Study,P=i("8sOK").StudyStub,C=i("3ClC").isStudy,x=i("Ss5c").LineDataSource,T=i("CW80"),L=T.isLineToolName,I=T.isLineTool,M=T.isStudyLineTool,O=i("7KDR"),A=O.Action,k=O.Separator,E=(i("L/Ed").ToolboxType,i("mMWL")),D=i("LxhU").Interval,V=i("pPtI"),B=V.setLastUsedResolution,R=V.getDefaultResolution,N=i("n5al"),F=N.isRangeStyle,j=N.getDefaultStyle,W=i("pvsv").showSymbolInfoDialog,z=i("i1o5").InvalidateMask,H=i("i1o5").InvalidationLevel,U=i("nqXy").MouseWheelHelper,Y=i("PT1i").linking,G=i("mYjs").showChangeIntervalDialog,q=i("u5Q5").showDialog,K=i("u5Q5"),Z=K.activateKeyPressHandler,J=(K.setToastsForHotkeyChanges,i("Ocx9").DefaultProperty),X=i("+6ja"),Q=X.availableTimezones,ee=X.timezoneIsAvailable,te=i("0F0w").ChartSession,ie=i("0YCj"),re=i("c2JX").Spinner,ne=i("PC8g").trackEvent,oe=i("Tmoa"),se=i("ikwP").Size,ae=i("wZIs"),le=i("uOxu").getLogger("ChartWidget",{color:"#606"}),ce=i("U0+/").StudyMetaInfoRepository,ue=i("VNzU").isMultipleLayout,he=i("b1GK").addPerfMark,de=i("KnF9").EnvironmentState,pe=i("FQhm"),fe=i("wjVR").ChartWidgetBase,_e=i("EsvI").isStdThemedDefaultValue,me=i("qFKp").CheckMobile.any(),ye=i("ikwP").getCanvasDevicePixelRatio,ge=i("B8p3").setHandler,ve=(Y=i("PT1i").linking,i("YWnQ").permissionDenied),Se=window.t("On The Left"),be=window.t("On The Right"),we=window.t("Move Scale To Left"),Pe=window.t("Move Scale To Right"),Ce=p.enabled("chart_content_overrides_by_defaults");function xe(e,i){fe.call(this,e,i),this._options.timeScaleWidget&&(this._options.timeScaleWidget.pressedMouseMoveScale=this._options.handleScale.axisPressedMouseMove);var n=this;this._startSpinner(this._options.container.value());var o=this._options.content,s=this._options.readOnly;this._backgroundBasedTheme=new t("light"),this._removeMaximizeHotkey=null,n._hotkeys=S.createGroup({desc:"Chart actions",isDisabled:function(){return!n._isActive}});var a=this._options.containsData,l=this._options.onWidget,c=this._options.onCmeWidget;c&&le.logWarn("[ChartWidget] 'onCmeWidget' option is depricated") -;var u=this._options.widgetCustomer,h=this._options.timezone,d=this._options.hideSymbolSearch,p=this._options.defSymbol,f=D.isValid(this._options.defInterval)?this._options.defInterval:void 0,_=parseInt(this._options.defStyle),m=N.isValidStyle(_)?_:void 0,y=this._options.defExtendedHours,g=this._options.defTimeframe;this._chartWidgetCollection=this._options.chartWidgetCollection||null,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._lhsAxesWidth=0,this._rhsAxesWidth=0;var v=this._contentSeriesProperties();v&&(p=v.symbol,f=v.interval),void 0===this._options.useUserChartPreferences&&(this._options.useUserChartPreferences=!0),this._properties=new J("chartproperties",void 0,void 0,this._options.useUserChartPreferences);var b=this._options.useUserChartPreferences?ae.defaults("chartproperties.mainSeriesProperties"):ae.factoryDefaults("chartproperties.mainSeriesProperties");this._properties.mainSeriesProperties.merge(b),f=f||b.interval||"D",N.isValidStyle(m)||(m=N.isValidStyle(b.style)?b.style:j(D.isRange(f))),this._properties.mainSeriesProperties.merge({visible:!0,symbol:p||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:f,style:m,extendedHours:y,lineStyle:{styleType:ae.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),h&&ee(h)&&this._properties.timezone.setValue(h),this._tagsChanged=new r,this._modelCreated=new r,this._disconnected=new r,this._reconnectBailout=new r,this._connected=new r,this._redrawPanes=new r,this._onScroll=new r,this.chartWidgetInitialized=new r,this._chartSession=new te(ChartApiInstance),this._metaInfoRepository=new ce(this._chartSession),this.lhsPriceAxisWidthChanged=new r,this.rhsPriceAxisWidthChanged=new r,this._timingsMeter=null,this._isActive=this._options.isActive,this._options.container.subscribe((function(e){n._setElement($(e))}),{callWithLast:!0});var w=function(){n.resize()};this._options.width.subscribe(w),this._options.height.subscribe(w),this._options.visible.subscribe(this._updateTimingsMeterState.bind(this)),this._properties.paneProperties.background.listeners().subscribe(this,this._updateThemedColor),this._aboutToBeDestroyed=new r,this._actions=null,this._definitionsViewModel=null,this._backgroundColorSpawn=null,this._onZoom=new r}inherit(xe,fe),xe.prototype.onZoom=function(){return this._onZoom},xe.prototype.isInitialized=function(){return Boolean(this._inited)},xe.prototype.compareSymbols=function(){return this._compareSymbols},xe.prototype._getChartPropertyDefinitionsViewModel=function(){ +;function l(){a.setValue(Object(o.defaultDateFormat)()),r.remove("date_format")}r.onSync.subscribe(null,(function(){return a.setValue(s())})),a.listeners().subscribe(null,(function(){return r.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 r}));var r="CLOSE_POPUPS_AND_DIALOGS_COMMAND"},"Zo2/":function(e,t,i){"use strict";(function(t,r){i("YCFM"),i("YFKU");var n=i("Eyy1").assert,o=i("Y7w9").moveToHead,s=i("mkn5").PaneWidget,a=i("fYB8").PaneSeparator,l=i("mNEU"),c=i("1IXQ").PriceAxisWidget,u=i("uPb3").TimeAxisWidget,h=i("fTGZ").BarsMarksContainer,d=i("qJq3").Series,p=i("Kxc7"),f=i("YmeR").ActionBinder,_=i("mKT+").resolveAndShowEditObjectDialog,m=i("Vdly").setValue,y=i("QloM").TabNames,g=i("cdbK").showGoToDateDialog,v=i("/3z9"),b=i("lxNp"),S=i("7nsU").showConfirmInputsDialog,w=i("GVHu").Study,P=i("8sOK").StudyStub,C=i("3ClC").isStudy,x=i("Ss5c").LineDataSource,T=i("CW80"),L=T.isLineToolName,I=T.isLineTool,M=T.isStudyLineTool,O=i("7KDR"),A=O.Action,k=O.Separator,E=(i("L/Ed").ToolboxType,i("mMWL")),D=i("LxhU").Interval,V=i("pPtI"),B=V.setLastUsedResolution,R=V.getDefaultResolution,N=i("n5al"),F=N.isRangeStyle,j=N.getDefaultStyle,W=i("pvsv").showSymbolInfoDialog,z=i("i1o5").InvalidateMask,H=i("i1o5").InvalidationLevel,U=i("nqXy").MouseWheelHelper,Y=i("PT1i").linking,G=i("mYjs").showChangeIntervalDialog,q=i("u5Q5").showDialog,K=i("u5Q5"),Z=K.activateKeyPressHandler,J=(K.setToastsForHotkeyChanges,i("Ocx9").DefaultProperty),X=i("+6ja"),Q=X.availableTimezones,ee=X.timezoneIsAvailable,te=i("0F0w").ChartSession,ie=i("0YCj"),re=i("c2JX").Spinner,ne=i("PC8g").trackEvent,oe=i("Tmoa"),se=i("ikwP").Size,ae=i("wZIs"),le=i("uOxu").getLogger("ChartWidget",{color:"#606"}),ce=i("U0+/").StudyMetaInfoRepository,ue=i("VNzU").isMultipleLayout,he=i("b1GK").addPerfMark,de=i("KnF9").EnvironmentState,pe=i("FQhm"),fe=i("wjVR").ChartWidgetBase,_e=i("EsvI").isStdThemedDefaultValue,me=i("qFKp").CheckMobile.any(),ye=i("ikwP").getCanvasDevicePixelRatio,ge=i("B8p3").setHandler,ve=(Y=i("PT1i").linking,i("YWnQ").permissionDenied),be=window.t("On The Left"),Se=window.t("On The Right"),we=window.t("Move Scale To Left"),Pe=window.t("Move Scale To Right"),Ce=p.enabled("chart_content_overrides_by_defaults");function xe(e,i){fe.call(this,e,i),this._options.timeScaleWidget&&(this._options.timeScaleWidget.pressedMouseMoveScale=this._options.handleScale.axisPressedMouseMove);var n=this;this._startSpinner(this._options.container.value());var o=this._options.content,s=this._options.readOnly;this._backgroundBasedTheme=new t("light"),this._removeMaximizeHotkey=null,n._hotkeys=b.createGroup({desc:"Chart actions",isDisabled:function(){return!n._isActive}});var a=this._options.containsData,l=this._options.onWidget,c=this._options.onCmeWidget;c&&le.logWarn("[ChartWidget] 'onCmeWidget' option is depricated") +;var u=this._options.widgetCustomer,h=this._options.timezone,d=this._options.hideSymbolSearch,p=this._options.defSymbol,f=D.isValid(this._options.defInterval)?this._options.defInterval:void 0,_=parseInt(this._options.defStyle),m=N.isValidStyle(_)?_:void 0,y=this._options.defExtendedHours,g=this._options.defTimeframe;this._chartWidgetCollection=this._options.chartWidgetCollection||null,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._lhsAxesWidth=0,this._rhsAxesWidth=0;var v=this._contentSeriesProperties();v&&(p=v.symbol,f=v.interval),void 0===this._options.useUserChartPreferences&&(this._options.useUserChartPreferences=!0),this._properties=new J("chartproperties",void 0,void 0,this._options.useUserChartPreferences);var S=this._options.useUserChartPreferences?ae.defaults("chartproperties.mainSeriesProperties"):ae.factoryDefaults("chartproperties.mainSeriesProperties");this._properties.mainSeriesProperties.merge(S),f=f||S.interval||"D",N.isValidStyle(m)||(m=N.isValidStyle(S.style)?S.style:j(D.isRange(f))),this._properties.mainSeriesProperties.merge({visible:!0,symbol:p||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:f,style:m,extendedHours:y,lineStyle:{styleType:ae.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),h&&ee(h)&&this._properties.timezone.setValue(h),this._tagsChanged=new r,this._modelCreated=new r,this._disconnected=new r,this._reconnectBailout=new r,this._connected=new r,this._redrawPanes=new r,this._onScroll=new r,this.chartWidgetInitialized=new r,this._chartSession=new te(ChartApiInstance),this._metaInfoRepository=new ce(this._chartSession),this.lhsPriceAxisWidthChanged=new r,this.rhsPriceAxisWidthChanged=new r,this._timingsMeter=null,this._isActive=this._options.isActive,this._options.container.subscribe((function(e){n._setElement($(e))}),{callWithLast:!0});var w=function(){n.resize()};this._options.width.subscribe(w),this._options.height.subscribe(w),this._options.visible.subscribe(this._updateTimingsMeterState.bind(this)),this._properties.paneProperties.background.listeners().subscribe(this,this._updateThemedColor),this._aboutToBeDestroyed=new r,this._actions=null,this._definitionsViewModel=null,this._backgroundColorSpawn=null,this._onZoom=new r}inherit(xe,fe),xe.prototype.onZoom=function(){return this._onZoom},xe.prototype.isInitialized=function(){return Boolean(this._inited)},xe.prototype.compareSymbols=function(){return this._compareSymbols},xe.prototype._getChartPropertyDefinitionsViewModel=function(){ if(null===this._definitionsViewModel){var e=this;return new Promise((function(t,r){Promise.all([i.e(21),i.e(54),i.e("general-property-page")]).then(function(n){if(e._isDestroyed)r("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)},xe.prototype._initMaximizeHotkey=function(e){var t=this;function i(e){e.defaultPrevented||v.modifiersFromEvent(e)===v.Modifiers.Alt&&e.stopPropagation()}function r(e){e.defaultPrevented||v.modifiersFromEvent(e)===v.Modifiers.Alt&&(e.preventDefault(),e.stopPropagation(),t.toggleFullscreen())}return e.addEventListener("mousedown",i,!0),e.addEventListener("click",r,!0),function(){e.removeEventListener("mousedown",i,!0),e.removeEventListener("click",r,!0)}},xe.prototype.toggleFullscreen=function(){var e=this.getResizerDetacher();e.fullscreenable.value()&&(e.fullscreen.value()?e.exitFullscreen():e.requestFullscreen())},xe.prototype.backgroundBasedTheme=function(){return this._backgroundBasedTheme.readonly()},xe.prototype._updateThemedColor=function(){var e=this._properties.paneProperties.background.value(),t=oe.getLuminance(e)<.5;this._jqMainDiv.toggleClass("chart-widget--themed-dark",t),this._jqMainDiv.toggleClass("chart-widget--themed-light",!t),this._backgroundBasedTheme.setValue(t?"dark":"light"),_e("chartProperties.paneProperties.background",e,this._backgroundBasedTheme.value())&&(e=null);for(var i=0;i',t),this._elTooltipDiv=t.createElement("div"),this._elTooltipDiv.className="tooltip-wrapper",this._jqMainDiv.append(this._elTooltipDiv),this._elMainTable=t.createElement("table"),this._elMainTable.className="chart-markup-table",this._elMainTable.setAttribute("cellpading","0"),this._elMainTable.setAttribute("cellspacing","0"),this._jqMainDiv.append(this._elMainTable),(this._options.controlBarEnabled||p.enabled("control_bar"))&&Promise.all([i.e(68),i.e(12),i.e("chart-widget-gui")]).then(function(e){if(!this._isDestroyed){this._controlBarNavigation&&this._controlBarNavigation.destroy();var t=i("TGRH").ControlBarNavigation;this._controlBarNavigation=new t(this,this._jqMainDiv[0],this._options.controlBar),this._model&&this.adjustSize()}}.bind(this).bind(null,i)).catch(i.oe),(this._options.handleScale.mouseWheel||this._options.handleScroll.mouseWheel)&&(this._mouseWheelHelper=new U,this._onWheelBound=this._onMousewheel.bind(this),this._jqMainDiv[0].addEventListener("wheel",this._onWheelBound,{passive:!1})),this.resize(),this._justActivated=!1,this.withModel(this,(function(){this._jqParent.append(this._jqMainDiv),this._jqMainDiv.on("mousedown",this._beginRequestActive.bind(this)),this._jqMainDiv.on("mouseup",this._endRequestActive.bind(this)),this._jqMainDiv.on("touchstart",this._beginRequestActive.bind(this)),this._jqMainDiv.on("touchmove",this._endRequestActive.bind(this)),this._jqMainDiv.on("touchend",this._endRequestActive.bind(this)),this._jqParent.on("click",this._requestActive.bind(this))})),this._inited&&(null!==this._timeAxisWidget&&(this._timeAxisWidget.destroy(),this._timeAxisWidget=null),this._paneWidgets.forEach((function(e){e.destroy()})),this._paneWidgets.length=0,this._paneSeparators.forEach((function(e){e.destroy()})),this._paneSeparators.length=0,this._update(z.full()))},xe.prototype._beginRequestActive=function(){var e=!1;this._chartWidgetCollection&&(e=this._chartWidgetCollection.activeChartWidget.value()!==this,this._chartWidgetCollection.activeChartWidget.setValue(this)),e&&(TradingView.isMobile.any()&&this._isLineToolModeExceptBrush()&&this.updateCrossHairPositionIfNeeded(),this._justActivated=!0)},xe.prototype._endRequestActive=function(){var e=this;this._justActivated&&setTimeout((function(){e._justActivated=!1}),0)},xe.prototype._requestActive=function(){this._beginRequestActive(),this._endRequestActive()},xe.prototype.justActivated=function(){return this._justActivated},xe.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,r=-t.deltaY/100 ;if(0!==i&&this._options.handleScroll.mouseWheel||0!==r&&this._options.handleScale.mouseWheel){switch(e.cancelable&&e.preventDefault(),e.deltaMode){case e.DOM_DELTA_PAGE:i*=120,r*=120;break;case e.DOM_DELTA_LINE:i*=32,r*=32}if(0!==r&&this._options.handleScale.mouseWheel){var n=Math.sign(r)*Math.min(1,Math.abs(r)),o=this._jqMainDiv[0].getBoundingClientRect(),s=e.clientX-this._lhsAxesWidth-o.left;if(!Number.isFinite(s)||!Number.isFinite(n))return void le.logWarn("Incorrect mouse wheel processing: scrollPosition: "+s+", zoomScale: "+n);var a=new de(e).control();this.model().model().zoomTime(s,n,!!a||void 0),this._onZoom.fire(a)}0!==i&&this._options.handleScroll.mouseWheel&&this.model().scrollChart(-80*i)}}},xe.prototype.setTimezone=function(e){e&&ee(e)?this._properties.timezone.setValue(e):console.warn("Incorrect timezone: "+JSON.stringify(e))},xe.prototype.getTimezone=function(){return this._properties.timezone.value()},xe.prototype.refreshMarks=function(){this.model().barsMarksSources().forEach((function(e){e.refreshData()}))},xe.prototype.clearMarks=function(){this.model().barsMarksSources().forEach((function(e){e.clearMarks()}))},xe.prototype.metaInfoRepository=function(){return this._metaInfoRepository},xe.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._jqParent.append(this._jqMainDiv),this._spinner&&(this._spinner.stop(),delete this._spinner),$(window).on("keydown:chart_"+this._id,(function(e){27===e.which&&e.preventDefault()})),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)},xe.prototype._activateSymbolSearchHotkeys=function(){this.readOnly()||this._hideSymbolSearch||Z()},xe.prototype._checkObsoleteTimezone=function(){var e=this._properties.timezone.value();ee(e)||this._properties.timezone.setValue({UTC:"Etc/UTC",EST:"America/New_York",CST:"America/Chicago",PST:"America/Los_Angeles"}[e]||"exchange")},xe.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()}))}))}))},xe.prototype.initColors=function(){this._properties.paneProperties.vertGridProperties.color.listeners().subscribe(this,xe.prototype.redrawPanes),this._properties.paneProperties.horzGridProperties.color.listeners().subscribe(this,xe.prototype.redrawPanes),this._properties.scalesProperties.lineColor.listeners().subscribe(this,xe.prototype.setScaleLineColor), this._properties.scalesProperties.textColor.listeners().subscribe(this,xe.prototype.setScaleTextColor)},xe.prototype._initBackgroundColor=function(){null===this._backgroundColorSpawn&&(this._backgroundColorSpawn=this._model.model().backgroundColor().spawn(),this._backgroundColorSpawn.subscribe(this.setBackgroundColor.bind(this)))},xe.prototype.paneWidgets=function(){return this._paneWidgets},xe.prototype.paneByCanvas=function(e){for(var t=0;t'),this.$shield=$('
').appendTo(this.$element),this.$element.appendTo(t),this._showed=!1,this._cw.withModel(this,this._connectToModel)},xe.LoadingScreen.prototype._connectToModel=function(){this._cw.model().mainSeries().dataEvents().messageReceived().subscribe(this,(function(e){switch(e.method){case"symbol_error":e.params[1]!==ve&&this.hide();break;case"series_error":p.enabled("hide_loading_screen_on_series_error")&&this.hide();break;case"series_completed":this.hide()}}))},xe.LoadingScreen.prototype.show=function(){this._cw._inLoadingState=!0,this._showed||(this._showed=!0,this._show())},xe.LoadingScreen.prototype._show=function(){var e=this._cw.properties().paneProperties.background.value();this.$shield.css("background",e),this.$element.addClass("fade")},xe.LoadingScreen.prototype.hide=function(){delete this._cw._inLoadingState,this._showed&&this._hide()},xe.LoadingScreen.prototype._hide=function(){this._showed=!1,this.$element.removeClass("fade")},xe.LoadingScreen.prototype.$canvas=null,xe.LoadingScreen.prototype.context=null,xe.LoadingScreen.prototype.isShown=function(){return this._showed},xe.prototype.unsetActivePaneWidget=function(){this.activePaneWidget=!1},xe.prototype.setActivePaneWidget=function(e){this.activePaneWidget=e},xe.prototype.toggleMaximizePane=function(e){if(!(this._paneWidgets.length<2)){this._maximizedPaneWidget?(this._maximizedPaneWidget.state().setMaximized(!1),this._maximizedPaneWidget=null,this._paneSeparators.forEach((function(e){e.show()}))):(this._maximizedPaneWidget=e, this._maximizedPaneWidget.state().setMaximized(!0),this._paneSeparators.forEach((function(e){e.hide()})));for(var t=this._paneWidgets.length;t--;)this._paneWidgets[t].updateControls(),this._paneWidgets[t].updatePriceAxisWidgets();this._timeAxisWidget.updatePriceAxisStubs(),this.adjustSize(),this.updateCrossHairPositionIfNeeded()}},xe.prototype._makePaneWidgetsAndSeparators=function(){for(var e=this._model.panes(),t=e.length,i=this._paneWidgets.length,r=t;r0){var o=new a(this,r-1,r);this._paneSeparators.push(o),this._timeAxisWidget?$(o.getElement()).insertBefore(this._timeAxisWidget.getElement()):$(o.getElement()).appendTo(this._elMainTable)}this._timeAxisWidget?this._elMainTable.insertBefore(l.getElement(),this._timeAxisWidget.getElement()):this._elMainTable.appendChild(l.getElement())}null!==this._timeAxisSeparator&&this._timeAxisSeparator.destroy(),this._timeAxisSeparator=new a(this,this._paneWidgets.length-1,0,!0),$(this._timeAxisSeparator.getElement()).insertBefore(this._timeAxisWidget.getElement());for(r=0;r0;)for(var t=this._content.panes[e].sources,i=t.length;i-- >0;)if("MainSeries"===t[i].type)return t[i].state},xe.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()}))},xe.prototype.createSessionBreaksActions=function(e){var t=new A({label:window.t("Session Breaks"),checkable:!0,statName:"ToggleSessionBreaks"});t.binder=new f(t,this._model.chartModel().sessions().properties().graphics.vertlines.sessBreaks.visible,this.model(),"Session Breaks"),this._actions.sessionBreaks=t},xe.prototype.updateActionForIntradayOnly=function(e){!e||!e instanceof A||e.update({disabled:this.model().mainSeries().isDWM()})},xe.prototype.withModel=function(e,t){this.model()?t.call(e):this.modelCreated().subscribe(e,t,!0)},xe.prototype.containsVolume=function(){return this.model().dataSources().some((function(e){return e instanceof w&&"Volume"===e.metaInfo().shortId}))},xe.prototype.containsStudyByPredicate=function(e){return!!this._model&&this._model.dataSources().some((function(t){if(!(t instanceof w))return!1;var i=t.metaInfo();return e(i)}))},xe.prototype.containsStudy=function(e){return this.containsStudyByPredicate((function(t){return t.id===e||t.fullId===e}))},xe.prototype.isSmall=function(){return this._width()<550||this._height()<300},xe.prototype.onWidget=function(){return this._onWidget},xe.prototype.onCmeWidget=function(){return"cme"===this.widgetCustomer()},xe.prototype.widgetCustomer=function(){return this._widgetCustomer},xe.prototype._width=function(){return this._options.width.value()},xe.prototype._height=function(){return this._options.height.value()},xe.prototype.resize=function(){var e={height:this._height()+"px",width:this._width()+"px"};this._jqMainDiv.css(e),this._elMainTable.style.height=e.height, this._elMainTable.style.width=e.width,this._resizeHandler&&this._jqMainDiv&&this._resizeHandler()},xe.prototype.chartSession=function(){return this._chartSession},xe.prototype.maxLhsPriceAxisWidth=0,xe.prototype.maxRhsPriceAxisWidth=0,xe.prototype.GUIResetScales=function(){ne("GUI","Reset Scales");var e=this.model();e&&e.resetScales()},xe.prototype.onLineCancelled=function(){E.resetToCursor()},xe.prototype._startSpinner=function(e){this._spinner||e&&(this._spinner=(new re).spin(e))},xe.prototype.isJustClonedChart=function(){return!!(this._options||{}).justCloned},xe.prototype.setDataWindowWidget=function(e){this._dataWindowWidget=e},xe.prototype.removeDataWindowWidget=function(){this._dataWindowWidget=null},p.enabled("datasource_copypaste")&&(xe.prototype.onAppClipboardPaste=function(e){le.logDebug("[[paste]]"),this._model&&this._model.pasteSourceFromClip(e)},xe.prototype.onAppClipboardCopy=function(e){e||(e=this._model.selection().sources()),e.filter((function(e){return e instanceof w&&e.isChildStudy()})).length?le.logDebug("Can not copy child study"):(le.logDebug("[[copy]]"),this._model&&this._model.copySourcesToClip(e))},xe.prototype.onAppClipboardCut=function(e){le.logDebug("[[cut]]"),this._model&&this._model.cutSourcesToClip(e||this._model.selection().sources())}),xe.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"))},xe.prototype.applyStudiesOverrides=function(e){ie.setDefaultsOverrides(e),this._applyStudiesOverrides()},xe.prototype.setActive=function(e){this._isActive=e,me&&(e&&this.selectBarMode().value()?this.startTrackingMode():this.exitTrackingMode()),this._paneWidgets.forEach((function(e){e.update()})),e||this.model().selectionMacro((function(e){e.clearSelection()}))},xe.prototype.isActive=function(){return this._isActive},xe.prototype.trackTime=function(){return this._chartWidgetCollection.lock.trackTime},xe.prototype.crossHairSyncEnabled=function(){return this._chartWidgetCollection.lock.crosshair.value()},xe.prototype.isMultipleLayout=function(){return ue(this._chartWidgetCollection.layout.value())},xe.prototype.selectBarMode=function(){return this._model.model().selectBarMode()},xe.prototype.toggleSelectBarMode=function(){this.selectBarMode().value()||(E.resetToCursor(!0),this._model.lineBeingCreated()&&this._model.cancelCreatingLine()),this._model.model().toggleSelectBarMode(),this.selectBarMode().value()&&this.startTrackingMode()},xe.prototype.startTrackingMode=function(){if(me){this.exitTrackingMode(),this.updateCrossHairPositionIfNeeded();var e=this._maximizedPaneWidget||this._paneWidgets[0],t=this._model.model().crossHairSource().currentPoint();e.startTrackingMode(t,t,new de)}},xe.prototype.onBarSelected=function(){return this._model.model().onBarSelected()}, -xe.prototype.trySetChartStyle=function(e){var t=this.model();return!!t&&(t.mainSeries().properties().style.value()===e||!!p.enabled("charting_library_base")&&(this._setChartStyle(e),!0))},xe.prototype._setChartStyle=function(e){var t=this.model(),i=t.mainSeries().properties().style;t.setChartStyleProperty(i,e,"Change Series Style")},xe.prototype.showReplayOrderConfirmationDialog=function(){if(!this.model().isInReplay())return Promise.resolve()},xe.prototype._addPerfMark=function(e){he("ChartWidget."+this._id+"."+e)},xe.prototype.requestFullscreen=function(){this._options.requestFullscreen()},xe.prototype.getResizerDetacher=function(){return this._options},e.exports.ChartWidget=xe,e.exports.trackingModeIsAvailable=me}).call(this,i("hY0g"),i("aIyQ"))},"Zp/P":function(e,t,i){"use strict";i.r(t),i.d(t,"extendAndClipLineSegment",(function(){return c})),i.d(t,"getArrowPoints",(function(){return u})),i.d(t,"optimalBarWidth",(function(){return h})),i.d(t,"optimalCandlestickWidth",(function(){return d})),i.d(t,"optimalHiLoWidth",(function(){return p})),i.d(t,"selectionTolerance",(function(){return f})),i.d(t,"coordinateIsValid",(function(){return _})),i.d(t,"setValidLineStyle",(function(){return m}));var r=i("aO4+"),n=i("hBTJ"),o=i("qFKp"),s=i("ogJP"),a=i("jFln"),l=o.CheckMobile.any()?12:2;function c(e,t,i,o,s,a){if(Object(r.equalPoints)(e,t))return null;var l=new r.Point(0,0),c=new r.Point(i,o);if(s){if(a){var u=Object(n.intersectLineAndBox)(Object(r.lineThroughPoints)(e,t),Object(r.box)(l,c));return Array.isArray(u)?u:null}var h;return null===(h=Object(n.intersectRayAndBox)(t,e,Object(r.box)(l,c)))||Object(r.equalPoints)(t,h)?null:Object(r.lineSegment)(t,h)}if(a)return null===(h=Object(n.intersectRayAndBox)(e,t,Object(r.box)(l,c)))||Object(r.equalPoints)(e,h)?null:Object(r.lineSegment)(e,h);u=Object(n.intersectLineSegmentAndBox)(Object(r.lineSegment)(e,t),Object(r.box)(l,c));return Array.isArray(u)?u:null}function u(e,t,i,r){var n=.5*i,o=Math.sqrt(2),s=t.subtract(e),a=s.normalized(),l=5*i;r&&(l=Math.min(l,.35*s.length()));var c=1*n;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),y=_.subtract(t).normalized().scaled(c),g=m.subtract(t).normalized().scaled(c),v=t.add(y),S=t.add(g),b=n*(o-1),w=d.scaled(b),P=Math.min(l-1*n/o,n*o*1),C=a.scaled(P),x=t.subtract(w),T=t.add(w),L=t.subtract(C);return[[_,v],[m,S],[x,L.subtract(w)],[T,L.add(w)]]}function h(e,t){return t=t||1,Math.floor(.3*e*t)}function d(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),r=Math.floor(e*i*t),n=Math.floor(e*t),o=Math.min(r,n);return Math.max(Math.floor(t),o)}function p(e){return.4*e}function f(e){return l+.5*e}function _(e){return null!=e&&!Object(s.isNaN)(e)}function m(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 r=i("GEp6"),n=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=2.5&&e<=4)return Math.floor(3*t);var i=1-.2*Math.atan(Math.max(4,e)-4)/(.5*Math.PI),r=Math.floor(e*i*t),n=Math.floor(e*t),o=Math.min(r,n);return Math.max(Math.floor(t),o)}function p(e){return.4*e}function f(e){return l+.5*e}function _(e){return null!=e&&!Object(s.isNaN)(e)}function m(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 r=i("GEp6"),n=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=3},inherit(u,r),u.version=2,u.LevelsCount=24,u.prototype.levelsCount=function(){return u.LevelsCount},u.prototype.stop=function(){r.prototype.stop.call(this),this._model._trendBasedFibExtensionLabelsCache.removeSource(this.id())},u.prototype.pointsCount=function(){return 3},u.prototype.translatedType=function(){return l},u.prototype.name=function(){return"Trend-Based Fib Extension"},u.prototype.migrateVersion=function(e,t,i){1===e&&this.properties().extendLines.setValue(!0)},u.prototype.processErase=function(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},u.prototype.getStylesPropertyPage=function(){return s.LineToolTrendBasedFibExtensionStylesPropertyPage},u.createProperties=function(e){var t=new n("linetooltrendbasedfibextension",e,!1,{range:[0,8]});return u._configureProperties(t),t},u.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("17v9").FibDrawingsWith24LevelsDefinitionsViewModel}.bind(null,i)).catch(i.oe)},u._configureProperties=function(e){r._configureProperties(e)},u.prototype.fibLevelsBasedOnLogScale=function(){return this.properties().fibLevelsBasedOnLogScale.value()&&this.priceScale().isLog()},t.LineToolTrendBasedFibExtension=u},"Zy3/":function(e,t,i){"use strict";i.r(t),i.d(t,"CompositeRenderer",(function(){return r}));var r=function(){function e(){this._renderers=[],this._globalAlpha=1}return e.prototype.setGlobalAlpha=function(e){this._globalAlpha=e},e.prototype.append=function(e){this._renderers.push(e)},e.prototype.insert=function(e,t){this._renderers.splice(t,0,e)},e.prototype.clear=function(){this._renderers.length=0},e.prototype.draw=function(e,t){for(var i=0;i=0;r--){var n=this._renderers[r].hitTest(e,t);null!==n&&(null===i||n.result()>i.result())&&(i=n)}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 r;i.r(t),i.d(t,"LineEnd",(function(){return r})),function(e){e[e.Normal=0]="Normal",e[e.Arrow=1]="Arrow",e[e.Circle=2]="Circle"}(r||(r={}))},a9Kt:function(e,t){ e.exports=''},aDyP:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("7KDR").Action,s=i("hayr").propertyPages,a=i("rCHB").LineToolPitchforkStyle,l=null,c=i("ytGH").LineToolWidthsProperty,u=window.t("Pitchfork");function h(e,t){this._constructor="LineToolPitchfork";var i=t||h.createProperties();r.call(this,e,i),this._properties.style.listeners().subscribe(this,h.prototype._recreatePaneView),this._recreatePaneView();for(var n=[this._properties.child("median").child("linewidth")],o=0;o<=h.LevelsCount;o++)n.push(this._properties.child("level"+o).child("linewidth"));this._widthsProperty=new c(n)}inherit(h,r),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 r=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,r=t.value;i.properties().style.setValue(r),i.updateAllViews(),i._model.updateSource(i)}});e.push(r)}return[e[0],e[3],e[1],e[2]]},h.prototype._recreatePaneView=function(){if(null!==l){var e=[];this._properties.style.value()===a.Original?e=[new l.PitchforkLinePaneView(this,this._model)]:this._properties.style.value()===a.Schiff?e=[new l.SchiffPitchforkLinePaneView(this,this._model)]:this._properties.style.value()===a.Schiff2?e=[new l.SchiffPitchfork2LinePaneView(this,this._model)]:this._properties.style.value()===a.Inside&&(e=[new l.InsidePitchforkLinePaneView(this,this._model)]),this._setPaneViews(e)}else i.e("lt-pane-views").then(function(e){null===l&&(l=i("cT+B")),this._recreatePaneView()}.bind(this).bind(null,i)).catch(i.oe)},h.prototype.pointsCount=function(){return 3},h.prototype.translatedType=function(){return u},h.prototype.name=function(){return"Pitchfork"},h.prototype.processErase=function(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},h.prototype.getStylesPropertyPage=function(){return s.LineToolPitchforkStylesPropertyPage},h.createProperties=function(e){var t=new n("linetoolpitchfork",e,!1,{range:[0,8]});return h._configureProperties(t),t},h.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("HCdA").PitchForkDefinitionsViewModel}.bind(null,i)).catch(i.oe)},h._configureProperties=function(e){r._configureProperties(e)},t.LineToolPitchfork=h},aILO:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Head and Shoulders");function a(e,t){ this._constructor="LineToolHeadAndShoulders";var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("Fx2Q").LineToolHeadAndShouldersPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return 7},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Head and Shoulders"},a.prototype.getStylesPropertyPage=function(){return o.LineToolLineTool5PointsPatternStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("EFc4").Points5PatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolheadandshoulders",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolHeadAndShoulders=a},aIha:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolFlagMark",(function(){return c}));var r=i("mrSG"),n=i("aO4+"),o=i("YFKU"),s=i("Ss5c"),a=i("Ocx9"),l=Object(o.t)("Flag Mark"),c=function(e){function t(r,o){var s=this,a=o||t.createProperties();return(s=e.call(this,r,a)||this)._constructor="LineToolFlagMark",i.e("lt-pane-views").then(function(e){var t=new(0,i("y/56").FlagMarkPaneView)(s,s.model());t.setAnchors(new n.Point(0,0)),s._setPaneViews([t])}.bind(null,i)).catch(void 0),s}return Object(r.__extends)(t,e),t.prototype.pointsCount=function(){return 1},t.prototype.translatedType=function(){return l},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 a.DefaultProperty("linetoolflagmark",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"w/mY")).then((function(e){return e.FlagMarkDefinitionsViewModel}))},t.version=2,t}(s.LineDataSource)},aIyQ:function(e,t,i){"use strict";(function(e){i("uOxu").getLogger("Common.Delegate");function t(){this._listeners=[]}function r(e){return!e.singleshot}t.prototype.subscribe=function(e,t,i){var r={object:e,member:t,singleshot:!!i};this._listeners.push(r)},t.prototype.unsubscribe=function(e,t){for(var i=0;i=0;--t){this._listeners[t].object===e&&this._listeners.splice(t,1)}},t.prototype.destroy=function(){delete this._listeners},t.prototype.fire=function(){var e=this._listeners;this._listeners=this._listeners.filter(r);for(var t=e.length,i=0;i=0;e--)this._subcommands[e].undo()},t.prototype.commands=function(){return this._subcommands},t}(i("RDU5").UndoCommand)},bSeV:function(e,t){},bTqm:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("NJRZ").LineTool5PointsPattern,s=window.t("Cypher Pattern");function a(e,t){this._constructor="LineToolCypherPattern";var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("mjK7").CypherPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,o),a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Cypher Pattern"},a.createProperties=function(e){var t=new n("linetoolcypherpattern",e);return a._configureProperties(t),t},a._configureProperties=function(e){o._configureProperties(e)},t.LineToolCypherPattern=a},bc0y:function(e,t,i){},beCu:function(e,t,i){"use strict";i.r(t),i.d(t,"doAnimate",(function(){return s}));var r=i("mrSG");var n={from:0,duration:250,easing:i("j1f4").easingFunc.easeOutCubic},o=function(){function e(e){var t=this;this._doing=!0, this._options=Object(r.__assign)(Object(r.__assign)({},n),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._animation=function(e,t,i){var r=this;if(this._doing){var n,o,s,a=(i=!i||i<1e12?performance.now():i)-e,l=a>=this._options.duration||t===this._options.to,c=(n=this._options.from,o=this._options.to,s=this._options.easing(a/this._options.duration),n*(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){r._animation(e,u,t)}))}else this._finishAnimation()},e.prototype._finishAnimation=function(){this._options.onComplete&&this._options.onComplete()},e}();function s(e){return new o(e)}},biIa:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesWaterlinePaneView",(function(){return l}));var r=i("mrSG"),n=i("k4w6"),o=i("//lt"),s=i("VdBB"),a=i("8Uy/"),l=function(e){function t(t){var i=e.call(this,t)||this,r={cursorType:o.PaneCursorType.VerticalResize,pressedMouseMoveHandler:function(e){var i=t.priceScale(),r=t.properties().baselineStyle,n=i.height(),o=100-e.y/n*100,s=o<0?0:Math.round(10*o)/10;r.baseLevelPercentage.setValue(Math.max(Math.min(s,100),0))}};return i._lineRenderer.setHitTest(new s.HitTestResult(s.HitTestResult.CUSTOM_MOVE,r)),i._lineRendererData.visible=!0,i._lineRendererData.linestyle=a.LINESTYLE_SPARSE_DOTTED,i}return Object(r.__extends)(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}(n.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 r=i("mrSG"),n=(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(55),i.e(10),i.e(14),i.e("create-dialog")]).then(function(o){var s=i("YDhE").createDialog;t(s(Object(r.__assign)(Object(r.__assign)({},n),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 r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Sine Line");function a(e,t){this._constructor="LineToolSineLine";var n=t||a.createProperties();r.call(this,e,n),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(a,r), a.prototype.pointsCount=function(){return 2},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Sine Line"},a.prototype.getStylesPropertyPage=function(){return o.LineToolTimeCyclesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("LX4V").CyclicAndSineLinesPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolsineline",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolSineLine=a},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 r=i("TzTt"),n=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(r.b)(o()),a=function(){function e(e){this._shown=!1,this._el=s.cloneNode(!0),this.setSize(e||n.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 r=e[i];void 0!==r&&t._el.style.setProperty(i,r)})),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}()},cBZt:function(e,t,i){"use strict";function r(e,t){return e+"@"+t}function n(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")}i.r(t),i.d(t,"studyIdString",(function(){return r})),i.d(t,"extractStudyId",(function(){return n}))},cKqi:function(e,t,i){"use strict";(function(e){ -var r=i("aO4+").Point,n=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,y=i("i3nr").OverlayStatusView,g=i("JjUe").OverlayDataWindowView,v=i("z8/4").OverlayLegendView,S=i("38az").SeriesBarColorer,b=i("l4sv").HorizontalLineRenderer,w=i("hayr").propertyPages,P=i("Kxc7"),C=i("6sst").OverlayStudyPriceLineAxisView,x=i("Qb4w").PriceRange,T=i("XPit").barFunction,L=i("XPit").seriesPlotFunctionMap,I=i("k9/m").PlotList,M=i("n5al").createSeriesFormatter,O=i("n5al").seriesCurrency,A=i("n5al").extractSymbolNameFromSymbolInfo,k=i("wOSo").QuotesProvider,E=i("qFKp").CheckMobile.any()&&!1,D=!P.enabled("hide_study_overlay_legend_item"),V=P.enabled("uppercase_instrument_names"),B=i("uOxu").getLogger("Chart.StudyOverlay"),R=P.enabled("study_overlay_compare_legend_option");function N(e,t){this._source=e,this._model=t,this._points=[new r(0,0)],this._lineRenderer=new b}function F(e,t){return null==e[t]}function j(t,i,r,n){this._waterlineView=null,i.hasChild("currencyId")||i.addChild("currencyId",new e(null)),o.call(this,t,i,r,n),this.m_data=new I(L(),F),this._formatter=null,this._paneView=null;var s=this;this.properties().minTick.listeners().subscribe(null,(function(){s._recreatePriceFormattingDependencies(),s.updateAllViews(),s._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.properties().currencyId.subscribe(this,this._onCurrencyChanged),this._updateBarFunction(),this._quotesProvider=new k,E&&this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate)}N.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 r(0,e.coordinate)],this._color=e.color)}},N.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(j,o),j.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},j.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this.symbolInfo();return e=i?i.name:t,V?e.toUpperCase():e},j.prototype.currency=function(){return this._properties.currencyId.value()||null},j.prototype.setCurrency=function(e){this._properties.currencyId.setValue(e)}, +var r=i("aO4+").Point,n=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,y=i("i3nr").OverlayStatusView,g=i("JjUe").OverlayDataWindowView,v=i("z8/4").OverlayLegendView,b=i("38az").SeriesBarColorer,S=i("l4sv").HorizontalLineRenderer,w=i("hayr").propertyPages,P=i("Kxc7"),C=i("6sst").OverlayStudyPriceLineAxisView,x=i("Qb4w").PriceRange,T=i("XPit").barFunction,L=i("XPit").seriesPlotFunctionMap,I=i("k9/m").PlotList,M=i("n5al").createSeriesFormatter,O=i("n5al").seriesCurrency,A=i("n5al").extractSymbolNameFromSymbolInfo,k=i("wOSo").QuotesProvider,E=i("qFKp").CheckMobile.any()&&!1,D=!P.enabled("hide_study_overlay_legend_item"),V=P.enabled("uppercase_instrument_names"),B=i("uOxu").getLogger("Chart.StudyOverlay"),R=P.enabled("study_overlay_compare_legend_option");function N(e,t){this._source=e,this._model=t,this._points=[new r(0,0)],this._lineRenderer=new S}function F(e,t){return null==e[t]}function j(t,i,r,n){this._waterlineView=null,i.hasChild("currencyId")||i.addChild("currencyId",new e(null)),o.call(this,t,i,r,n),this.m_data=new I(L(),F),this._formatter=null,this._paneView=null;var s=this;this.properties().minTick.listeners().subscribe(null,(function(){s._recreatePriceFormattingDependencies(),s.updateAllViews(),s._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.properties().currencyId.subscribe(this,this._onCurrencyChanged),this._updateBarFunction(),this._quotesProvider=new k,E&&this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate)}N.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 r(0,e.coordinate)],this._color=e.color)}},N.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(j,o),j.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},j.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this.symbolInfo();return e=i?i.name:t,V?e.toUpperCase():e},j.prototype.currency=function(){return this._properties.currencyId.value()||null},j.prototype.setCurrency=function(e){this._properties.currencyId.setValue(e)}, j.prototype.symbolSource=function(){return this},j.prototype.lastValueData=function(e,t,i){var r={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return r;var o=this._model.timeScale().visibleBarsStrictRange();if(null===o)return r;if(!this.properties().visible.value())return r;var a=this.nearestIndex(o.lastBar(),s.NearestLeft,TradingView.OPEN_PLOT);if(null==a)return r;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 r;var d=this._barFunction(h);if(!isNumber(d))return r;var p={noData:!1};i&&(p.price=d);var f=this.firstValue();if(!isNumber(f))return r;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 n.STYLE_BARS:p.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.barStyle.upColor.value():_.barStyle.downColor.value();break;case n.STYLE_CANDLES:case n.STYLE_HOLLOW_CANDLES:p.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.candleStyle.upColor.value():_.candleStyle.downColor.value();break;case n.STYLE_LINE:p.color=_.lineStyle.color.value();break;case n.STYLE_AREA:p.color=_.areaStyle.color1.value();break;case n.STYLE_BASELINE:var m=_.baselineStyle,y=this.priceScale(),g=Math.round(y.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}},he.prototype.startScalePrice=function(e,t,i){e.startScalePrice(t,i)},he.prototype.scalePriceTo=function(e,t,i){e.scalePriceTo(t,i),this.mainSeries().priceScale().isLockScale()?this.lightUpdate():this.invalidate(this._paneInvalidationMask(e,T.Light)),this._setScalesResetAvailable(!0)},he.prototype.endScalePrice=function(e,t){e.endScalePrice(t),this.invalidate(this._paneInvalidationMask(e,T.Light))},he.prototype.startScrollPrice=function(e,t,i){e.startScrollPrice(t,i)},he.prototype.scrollPriceTo=function(e,t,i){e.scrollPriceTo(t,i),this.invalidate(this._paneInvalidationMask(e,T.Light))},he.prototype.endScrollPrice=function(e,t){e.endScrollPrice(t),this.invalidate(this._paneInvalidationMask(e,T.Light))},he.prototype.setPriceAutoScale=function(e,t,i){e.setPriceAutoScale(t,i),this.invalidate(this._paneInvalidationMask(e,T.Light))},he.prototype.restorePriceScaleState=function(e,t,i){e.restorePriceScaleState(t,i),this.invalidate(this._paneInvalidationMask(e,T.Light))},he.prototype.resetPriceScale=function(e,t){this._setScalesResetAvailable(!1),e.resetPriceScale(t),this.invalidate(this._paneInvalidationMask(e,T.Light))},he.prototype.updateScales=function(e,t){this._undoModel._chartWidget._updateScalesActions()},he.prototype.startScaleTime=function(e){this._timeScale.startScale(e)},he.prototype.mainSeriesScaleRatioProperty=function(){return this._mainSeriesScaleRatioProperty},he.prototype.mainSeriesScaleRatioPropertyOnChanged=function(){this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)},he.prototype.mainSeriesScaleRatio=function(){return q(this._timeScale,this.m_mainSeries.priceScale())}, he.prototype.setMainSeriesScaleRatio=function(e){this.paneForSource(this.m_mainSeries).applyPriceScaleRatio(this.m_mainSeries.priceScale(),e)},he.prototype.scaleTimeTo=function(e){this._timeScale.scaleTo(e),this.recalculateAllPanes(),this.lightUpdate(),this._setScalesResetAvailable(!0)},he.prototype.endScaleTime=function(){this._timeScale.endScale(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources())},he.prototype.startScrollTime=function(e){this._timeScale.startScroll(e),this._isTimeScrolling=!0},he.prototype.scrollTimeTo=function(e){this._timeScale.scrollTo(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},he.prototype.endScrollTime=function(){this._timeScale.endScroll(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._isTimeScrolling=!1},he.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach((function(e){y(e)&&e.recalcStudyIfNeeded&&e.recalcStudyIfNeeded()}))},he.prototype.recalcVisibleRangeStudy=function(e,t){void 0!==this._recalcVRTimerId&&clearTimeout(this._recalcVRTimerId);var i=this;this._recalcVRTimerId=setTimeout((function(){i._recalcVisibleRangeStudy(e,t)}),500)},he.prototype._recalcVisibleRangeStudy=function(e,t){if(!this.timeScale().isEmpty()){var i=this.timeScale().visibleBarsStrictRange(),r=this.mainSeries().nearestData(i.firstBar(),R.NearestRight),n=this.mainSeries().nearestData(i.lastBar(),R.NearestLeft),o=this.mainSeries().bars().lastIndex(),s=r?r.index:void 0,a=n?n.index:void 0,l=s===this._oldStartVisibleIndex,c=a===this._oldEndVisibleIndex;if(!l||!c||t){this._oldStartVisibleIndex=s,this._oldEndVisibleIndex=a;for(var u={first_visible_bar_time:1e3*Math.floor(r&&r.value?r.value[TradingView.TIME_PLOT]:0),last_visible_bar_time:1e3*Math.floor(n&&n.value?n.value[TradingView.TIME_PLOT]:0),subscribeRealtime:n&&n.index===o},h=0;h0&&m.listeners().fire(m)}}}},he.prototype.onResetScales=function(){return this._resetScales},he.prototype.resetTimeScale=function(){this._timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this.updateCrossHair(),this.lightUpdate(),this._resetScales.fire(),this._setScalesResetAvailable(!1)},he.prototype.restoreTimeScaleState=function(e){this._timeScale.restoreState(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},he.prototype.restoreFactoryDefaults=function(e){e.restoreFactoryDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0)},he.prototype.selectionMacro=function(e){var t=this.selection().sources();e({removeSourceFromSelection:pe.bind(this),addSourceToSelection:fe.bind(this),clearSelection:de.bind(this), selection:this.selection.bind(this)});var i=Z(t,this.selection().sources()),r=Z(this.selection().sources(),t);r.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)})),r.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||r.length>0)&&this._selectedSourceChanged.fire()},he.prototype.checkLineToolSelection=function(){this._selection.checkLineToolSelection()},he.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},he.prototype.selection=function(){return this._selection},he.prototype.invalidate=function(e){this._invalidateHandler&&this._invalidateHandler(e)},he.prototype.dataSources=function(){var e=[];e.push(this.m_crossHairSource);for(var t=0;t0)for(s=this.dataSources(),a=0;a0){var c=n-r,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):o.lastBar()!==r&&(u=i.rightOffset()-c)}null!==u&&i.setRightOffset(u)}}i.setBaseIndex(n)}},he.prototype.recalculatePane=function(e){e&&e.recalculate()},he.prototype.paneForSource=function(e){for(var t=this._panes.length-1;t>=0;t--)if(-1!==this._panes[t].dataSources().indexOf(e))return this._panes[t];return e instanceof P?this.paneForSource(this.m_mainSeries):null},he.prototype.recalculateAllPanes=function(){for(var e=0;e1},he.prototype.createLineTool=function(e,t,i,r,n,o){if(!_(i))return null;if("LineToolExecution"!==i&&ee("drawings","Study_Drawing_"+i),r){var s=r.state();r=f(i,s)}var l=p(i,this,r,null),c=!l.linkKey&&!n;F.drawOnAllCharts().value()?l.linkKey=n||U.randomHash():l.linkKey=n,l.toolname=i,o=o||e.mainDataSource(),r||l.properties().currencyId.setValue(o.symbolSource().currency()),l.setOwnerSource(o);var u,h=e.defaultPriceScale();if(e.addDataSource(l,h),l.isFixed()){var d=e.mainDataSource().firstValue(),m=this._timeScale.indexToCoordinate(t.index),y=h.priceToCoordinate(t.price,d);u=l.addFixedPoint(new a(m,y))}else u=l.addPoint(t);return u||(this._lineBeingCreated=l,this._paneBeingCreatedLineOn=e),c&&l.enableCurrentIntervalVisibility(),this.fullUpdate(),l},he.prototype.lineBeingCreated=function(){return this._lineBeingCreated},he.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},he.prototype.coninueCreatingLine=function(e,t,i,r){var n=this._lineBeingCreated.addPoint(e,t,i);this._lineBeingCreated.updateAllViews();var o=new x(T.Light);return n&&(this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null),this.invalidate(o),n},he.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var e=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),F.drawOnAllCharts().value()&&e.isSynchronizable()&&F.cancelLineTool({model:this})}},he.prototype.startChangingLinetool=function(e,t,i,r,n){this._lineBeingEdited=e,F.isToolEditingNow.setValue(!0),this._linePointBeingEdited=i,this._lineBeingEdited.startChanging(i,t,n);var o=this.paneForSource(e);this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(i,t),this._lineBeingEdited.setPoint(i,t,r,n),this._lineBeingEdited.updateAllViews();var s=this._paneInvalidationMask(o,T.Light);if(s.force=!0,this.invalidate(s),e.linkKey&&e.isSynchronizable()){var a=this.externalTimeStamp(t.index);F.startChangingLineTool({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:a},pointIndex:i,envState:r})}},he.prototype.lineBeingEdited=function(){return this._lineBeingEdited},he.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},he.prototype.changeLinePoint=function(e,t,i){var r=this.paneForSource(this._lineBeingEdited),n=e.price,o=e.index;if(void 0!==e.x&&void 0!==e.y){var s=this._lineBeingEdited.priceScale(),a=r.mainDataSource().firstValue();n=s.coordinateToPrice(e.y,a),o=Math.round(this.timeScale().coordinateToIndex(e.x)),n=this._magnet.align(n,o,r),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:n,index:o},t,i)}else this._lineBeingEdited.setPoint(this._linePointBeingEdited,e,t,i);if(this._lineBeingEdited.updateAllViews(),this.lightUpdate(),this._lineBeingEdited.linkKey&&this._lineBeingEdited.isSynchronizable()){ var l=this.externalTimeStamp(o);F.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:n,timeStamp:l},envState:t})}},he.prototype.endChangingLinetool=function(e,t){var i=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,e,t),this._lineBeingEdited=null,F.isToolEditingNow.setValue(!1),this._linePointBeingEdited=null,this.lightUpdate();var r={points:i._timePoint,interval:this.mainSeries().interval()};i.linkKey&&i.isSynchronizable()&&F.finishChangingLineTool({model:this,linkKey:i.linkKey,symbol:this.mainSeries().symbol(),finalState:r})},he.prototype.finishLineTool=function(e){var t=this.lineBeingCreated();t&&(t.finish&&t.finish(),!e&&F.drawOnAllCharts().value()&&t.linkKey&&t.isSynchronizable()&&F.finishLineTool({linkKey:t.linkKey,model:this}))},he.prototype.calculateDefaultTags=function(){for(var e=[],t=this.dataSources(),i=0;i-1&&this._modelIntervals.splice(t,1)},he.prototype.clearIntervals=function(){for(var e=0;e=0?p.SeriesBarColorer.upColor(this._series.properties()):p.SeriesBarColorer.downColor(this._series.properties());else{var M=this._series.barColorer().barStyle(u,!1);I=w(f,null!=M.barBorderColor?M.barBorderColor:M.barColor)}I=Object(m.resetTransparency)(w(f,I));for(var O=0,A=this._items;Ou&&(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=r.background;var _=Math.round(d*i),m=Math.round(0*i),y=Math.round(p*i),g=Math.round(f*i);e.fillRect(_,m,y-_,g-m);var v=Math.round(r.coordinate*i),S=m,b=Math.round((S+t.borderSize+t.tickLength)*i);e.fillStyle=r.color;var w=Math.max(1,Math.floor(i)),P=Math.floor(.5*i);e.fillRect(v-P,S,w,b-S);var C=f-t.baselineOffset-t.paddingBottom;e.textAlign="left",e.fillStyle=r.color,Object(n.drawScaled)(e,i,(function(){return e.fillText(r.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(), +;var r=i("mrSG"),n=i("eJTA"),o=i("ivNn"),s=i("4miz"),a=i("IzGk"),l=i("k9/m"),c=i("GH0z"),u=i("7qT/"),h=i("Ialn"),d=i("qFKp"),p=i("38az"),f=i("e92V"),_=i("mMWL"),m=i("Tmoa"),y=d.CheckMobile.any(),g=y&&!0,v=new c.PercentageFormatter,b=window.t("n/a"),S=b+" ("+b+"%)";function w(e,t){var i=Object(n.parseRgb)(t),r=Object(n.parseRgb)(e);return Object(n.distanceRgb)(i,r)<70?Object(n.rgbToHexString)(Object(n.invertRgb)(i)):t}var P=function(e){function t(t,i){var r=e.call(this)||this;return r._invalidated=!0,r._series=t,r._model=i,r._items.push(new s.a(window.t("Open"),"")),r._items.push(new s.a(window.t("High"),"")),r._items.push(new s.a(window.t("Low"),"")),r._items.push(new s.a(window.t("Close"),"")),r._items.push(new s.a("","")),r._items.push(new s.a("","")),r._items.push(new s.a(window.t("Change"),"")),r.update(),r}return Object(r.__extends)(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(){var e=this._series.symbolInfo();e?(this._header=[e.name,Object(a.translatedIntervalString)(this._series.interval()),e.exchange].join(", "),this._title=e.description):this._header=this._series.symbol();for(var t=this._showLastPriceAndChangeOnly(),i=0,r=this._items;i=0?p.SeriesBarColorer.upColor(this._series.properties()):p.SeriesBarColorer.downColor(this._series.properties());else{var M=this._series.barColorer().barStyle(u,!1);I=w(f,null!=M.barBorderColor?M.barBorderColor:M.barColor)}I=Object(m.resetTransparency)(w(f,I));for(var O=0,A=this._items;Ou&&(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=r.background;var _=Math.round(d*i),m=Math.round(0*i),y=Math.round(p*i),g=Math.round(f*i);e.fillRect(_,m,y-_,g-m);var v=Math.round(r.coordinate*i),b=m,S=Math.round((b+t.borderSize+t.tickLength)*i);e.fillStyle=r.color;var w=Math.max(1,Math.floor(i)),P=Math.floor(.5*i);e.fillRect(v-P,b,w,S-b);var C=f-t.baselineOffset-t.paddingBottom;e.textAlign="left",e.fillStyle=r.color,Object(n.drawScaled)(e,i,(function(){return e.fillText(r.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(r.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 n})),i.d(t,"fibLevelPrice",(function(){return o}));var r=i("Eyy1");function n(e,t,i,n,o,s){if(s)return Math.round(Object(r.ensureDefined)(e.coordinate)+Object(r.ensureDefined)(t.coordinate)*i);var a=e.price+t.price*i;return n.priceToCoordinate(a,o)}function o(e,t,i,n,o,s){if(!s)return e.price+t.price*i;var a=Object(r.ensureDefined)(e.coordinate)+Object(r.ensureDefined)(t.coordinate)*i;return n.coordinateToPrice(a,o)}},d700:function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o}));var r=i("/3z9");function n(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 r.Modifiers.Alt:return(38===i||40===i)&&"SELECT"===t.tagName||n(t);case r.Modifiers.Alt+r.Modifiers.Shift:return n(t);case r.Modifiers.Mod:if(67===i||!r.isMacKeyboard&&45===i){var o=t.ownerDocument&&t.ownerDocument.getSelection();if(o&&!o.isCollapsed)return!0}return n(t);case r.Modifiers.Mod+r.Modifiers.Shift:return i>=33&&i<=40&&n(t);case r.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 r=i("aO4+"),n=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,r,n,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 B(e,t,i,r,n,o){y.call(this,"Zoom"),this._model=e,this._startBar=t,this._endBar=i,this._startPrice=r,this._endPrice=n,this._pane=o}function R(e,t,i){y.call(this,"Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}function N(e,t,i){y.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, +Object(n.distanceToSegment)(new r.Point(o,t.y),new r.Point(l,i.y),new r.Point(e.x,e.y)).distance<=c)return new a.HitTestResult(a.HitTestResult.REGULAR)}return null},e}()},dDSx:function(e,t,i){"use strict";(function(e){var r=i("CW80").isLineTool,n=i("Ss5c").LineDataSource,o=i("FIi8").deepExtend,s=i("OK+B"),a=i("beCu").doAnimate,l=i("onDC").ChartUndoModelBase,c=i("Ocx9").saveDefaultProperties,u=i("GVQo"),h=i("GVHu").Study,d=i("8sOK").StudyStub,p=i("0YCj"),f=i("0waE"),_=i("7MZv").showTooManyStudiesNotice,m=i("MY2c").UndoStack,y=i("RDU5").UndoCommand,g=i("Ltzl").SaveLineToolStateUndoCommand,v=i("YlKu").ApplyLineToolTemplateUndoCommand,b=i("s9sR").SetResolutionUndoCommand,S=i("8C8C").RestoreFactoryDefaultsUndoCommand,w=i("2OVc").InsertStudyCommand,P=i("FKaq").SetPriceScaleSelectionStrategyCommand,C=i("/YGI").StudyInserter,x=i("PC8g").trackEvent,T=i("Fixu").trackDrawingPasted,L=i("uOxu").getLogger("Chart.ChartUndoModel"),I=i("QTwd").RestoreDefaultsPreferencesUndoCommand,M=i("bJYc").SetPropertyUndoCommand;function O(t,i,r,n,o,a,c,u,h){l.call(this,c),this._chartWidget=a,this.m_model=new s(t,i,r,n,o,this,u,h),this.m_zoomStack=new m,this._onSimpleZoomIn=new e,this._onSimpleZoomOut=new e,this._currentCustomMoveSource=null,this.beginUndoMacro=c.beginUndoMacro.bind(c),this.endUndoMacro=c.endUndoMacro.bind(c),this.createUndoCheckpoint=c.createUndoCheckpoint.bind(c),this.undoToCheckpoint=c.undoToCheckpoint.bind(c)}function A(e,t,i,r){y.call(this,i),this._priceScale=t,this._newMode=e,this._model=r}function k(e,t,i,r){y.call(this,i),this._property=e,this._newValue=t,this._model=r,this._priceScale=this._model.mainSeries().priceScale()}function E(e,t,i,r){y.call(this,"scale price",!1),this.m_model=e,this.m_pane=t,this.m_priceScale=i,this.m_state=r,this.m_newPriceScaleState=null}function D(e,t,i,r){this._model=e,this._series=t,this._oldSymbol=t.symbol(),this._oldInterval=t.interval(),this._symbol=i,this._interval=r}function V(e,t,i){y.call(this,"Move "+t[0].title()+" "+(i>0?"Forward":"Backward")),this._model=e,this._sourcesIds=t.map((function(e){return e.id()})),this._shift=i}function B(e,t,i,r,n,o){y.call(this,"Zoom"),this._model=e,this._startBar=t,this._endBar=i,this._startPrice=r,this._endPrice=n,this._pane=o}function R(e,t,i){y.call(this,"Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}function N(e,t,i){y.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.showStudyPlotLabels,delete this._newChartProps.scalesProperties.showFundamentalNameLabel,delete this._newChartProps.scalesProperties.showFundamentalLastValue,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().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)}function F(e,t){y.call(this,"Stop Sincing Drawing"),this._model=e,this._sourceId=t.id(),this._linkKey=t.linkKey}function j(e,t){y.call(this,"Paste Indicator"),this._model=e,this._clipboardData=t}function W(e,t){y.call(this,"Move",!1),this._origPoint=e.clone(),this._point=null,this._handler=t}inherit(O,l),O.prototype.version=function(){return this.m_model._version},O.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)}},O.prototype.paneForSource=function(e){return this.m_model.paneForSource(e)},O.prototype.createPane=function(e){return this.m_model.createPane(e)},O.prototype.readOnly=function(){return this.m_model.readOnly()},O.prototype.restart=function(){this.m_model.restart()},O.prototype.disconnect=function(){this.m_model.disconnect()},O.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},O.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},O.prototype.chartModel=function(){return this._model()},O.prototype._model=function(){return this.m_model},O.prototype.pushUndoCommand=function(e){this._pushUndoCommand(e)},O.prototype._pushUndoCommand=function(e){this._undoHistory.pushUndoCommand(e)},O.prototype.startScalePrice=function(e,t,i){this.pushUndoCommand(new E(this.m_model,e,t,t.state())),this.chartModel().startScalePrice(e,t,i)}, O.prototype.scalePriceTo=function(e,t,i){this.chartModel().scalePriceTo(e,t,i)},O.prototype.endScalePrice=function(e,t){this.chartModel().endScalePrice(e,t)},O.prototype.startScrollPrice=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollState=t.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(e,t,i))},O.prototype.scrollPriceTo=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new E(this.m_model,e,t,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(e,t,i))},O.prototype.endScrollPrice=function(e,t){t.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(e,t))},O.prototype.setPriceAutoScale=function(e,t,i){this.pushUndoCommand(new E(this.m_model,e,t,t.state())),this.chartModel().setPriceAutoScale(e,t,i)},O.prototype.resetPriceScale=function(e,t){this.pushUndoCommand(new E(this.m_model,e,t,t.state())),this.chartModel().resetPriceScale(e,t)},O.prototype.setWidth=function(e){this.m_model.setWidth(e)},O.prototype.setPaneHeight=function(e,t){this.m_model.setPaneHeight(e,t)},O.prototype.gridSource=function(){return this.m_model.gridSource()},O.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},O.prototype.addAlertsSource=function(e){return this.m_model.addAlertsSource(e)},O.prototype.alertsSources=function(){return this.m_model.alertsSources()},O.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()},O.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},O.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},O.prototype.model=function(){return this.m_model},O.prototype.chartWidget=function(){return this._chartWidget},O.prototype.mainSeries=function(){return this.m_model.m_mainSeries},O.prototype.mainSeriesScaleRatioProperty=function(){return this.m_model.mainSeriesScaleRatioProperty()},O.prototype.panes=function(){return this.m_model.panes()},O.prototype.timeScale=function(){return this.m_model.timeScale()},O.prototype.selectionMacro=function(e){return this.m_model.selectionMacro(e)},O.prototype.setHoveredSource=function(e,t){this.m_model.setHoveredSource(e,t)},O.prototype.selection=function(){return this.m_model.selection()},O.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},O.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},O.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},O.prototype.invalidate=function(e){this.m_model.invalidate(e)},O.prototype.setCurrentPosition=function(e,t,i,r){this.m_model.setCurrentPosition(e,t,i,r)},O.prototype.setAndSaveCurrentPosition=function(e,t,i,r){this.m_model.setAndSaveCurrentPosition(e,t,i,r)},O.prototype.modifySeries=function(e,t,i){var r=new D(this.m_model,e,t,i);this.pushUndoCommand(r)}, -O.prototype.canCreateStudy=function(e){return this.model().chartApi().chartApi().isCanCreateStudy(e)},O.prototype.checkIfFeatureAvailable=function(e,t){var i=this.canCreateStudy(),r=t&&t instanceof h;return!this.readOnly()&&r&&(i=this.canCreateStudy(!0)),!!i||(r||_(),!1)},O.prototype._insertStudy=function(e,t,i,r,n,o,s,a,l){var c=new w(this.m_model,e,t,i,r,n,o,s,a,l||null,"Insert "+e.description);return this.pushUndoCommand(c),c.insertedStudy()},O.prototype.insertStudyWithoutCheck=function(e){return this._insertStudy(e)},O.prototype.createStudyInserter=function(e,t,i){var r=this,n=null,o={createStudy:function(e,t,i,o,s,a,l,c,u){return r.checkIfFeatureAvailable(e,a)?(x("studies","Study_"+e.id),"Compare@tv-basicstudies"===e.id&&x("compare","symbol:"+t.symbol),r._insertStudy(e,t,o,s,a,l,c,u,n)):(L.logNormal("Cannot insert study "+e.id),null)}};void 0!==i&&(o.createStub=function(){var e=r.m_model.insertStudyStub(i);return n={targetPaneId:r.m_model.paneForSource(e).id(),targetZOrder:e.zorder()},e.id()},o.removeStub=function(e){return r.m_model.removeStudyStub(e)});var s=new C(e,this.m_model._studiesMetaInfoRepository,o);return s.setParentSource(t),s},O.prototype.setProperty=function(e,t,i,r){if(e&&e.value()!==t){var n=new M(e,t,i,this.m_model,r);this.pushUndoCommand(n),this.emitEvent("setProperty")}},O.prototype.setProperties=function(e,t,i){var r=this;this.beginUndoMacro(i),this.m_model.selectionMacro((function(){for(var n=0;n0&&t.reverse(),t.forEach((function(t){e._model.changeZOrder(t,e._shift)}))},O.prototype.removePane=function(e){var t=this.m_model.panes()[e].dataSources().slice();this.removeSources(t,!1,"Remove pane")},inherit(B,y),B.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)},B.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.lightUpdate()},inherit(R,y),R.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void L.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},R.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void L.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(N,y),N.prototype._merge=function(e,t,i){var r=this._model;c(!0),e&&(r.properties().paneProperties.mergeAndFire(e.paneProperties),r.properties().scalesProperties.mergeAndFire(e.scalesProperties)),r.mainSeries().priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),r.mainSeries().properties().mergeAndFire(t),r.mainSeries().properties().saveDefaults(),r.mainSeries().createPaneView(),r.mainSeries().invalidateBarStylesCache(),r._version=t.version,r.recalculateAllPanes(),r.fullUpdate(),r.properties().saveDefaults(),r.sessions().restoreState({properties:i}),c(!1)},N.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps,this._oldSessionsProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},N.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps,this._newSessionProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(F,y),F.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},F.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},inherit(j,y),j.prototype.redo=function(){if(!this._sourceState){var e=TradingView.clone(this._clipboardData.source);e.id=f.guid(),this._sourceState=e}var t=null,i=null -;this._sourceState.metaInfo.is_price_study?(t=this._model.paneForSource(this._model.mainSeries()),i=this._model.mainSeries().priceScale()):i=(t=this._model.createPane()).defaultPriceScale();var r=t._restoreStudy(this._sourceState);r.metaInfo().linkedToSeries&&r.setOwnerSource(this._model.mainSeries()),r.start(),r.setPriceScale(i),t.move(r,i)},j.prototype.undo=function(){this._sourceState||L.logError("This command was never executed - nothing to undo");var e=this._model.dataSourceForId(this._sourceState.id);this._model.removeSource(e)},inherit(W,y),W.prototype.setPoint=function(e){this._point=e.clone(),this._handler(e)},W.prototype.point=function(){return this._point},W.prototype.undo=function(){this._handler(this._origPoint)},W.prototype.redo=function(){this._handler(this._point)},t.ChartUndoModel=O,t.PriceScaleChangeUndoCommand=E}).call(this,i("aIyQ"))},dTSQ:function(e,t,i){"use strict";function r(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}i.r(t),i.d(t,"regExpEscape",(function(){return r}))},dUDn:function(e,t,i){"use strict";i.r(t),i.d(t,"StandardPivotPointsPriceAxisView",(function(){return s}));var r=i("mrSG"),n=i("KcY8"),o=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],s=function(e){function t(t,i){var r=e.call(this)||this;r._source=t,r._data=i;var n=i.name;return r._completeName="P"===n.toUpperCase()?"P":"S"+n[1]+"/R"+n[1],r}return Object(r.__extends)(t,e),t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var r=this._source.properties();if(r.visible.value()){var n=this._completeName,s=r.levelsStyle.visibility;if(s[n]&&s[n].value()){var a=this._source.model().timeScale(),l=this._source.priceScale();if(!(a.isEmpty()||null===a.visibleBarsStrictRange()||null!==l&&l.isEmpty())){var c=this._source.customData();if(c&&c.pivots){var u=this._source.pricesView().prices()[o.indexOf(this._data.name.toUpperCase())];if(u){i.background=u.color,i.color=this.generateTextColor(u.color),i.coordinate=u.coordinate,i.floatCoordinate=u.floatCoordinate;var h=this._source.model().properties().scalesProperties;h.showStudyLastValue.value()&&(e.text=u.formatted,e.visible=!0),h.showStudyPlotLabels.value()&&(t.text=this._source.priceLabelText(this._data.name),t.visible=!0)}}}}}},t}(n.a)},dfhE:function(e,t,i){"use strict";var r,n,o;i.r(t),i.d(t,"STATUS_OFFLINE",(function(){return s})),i.d(t,"STATUS_RESOLVING",(function(){return a})),i.d(t,"STATUS_LOADING",(function(){return l})),i.d(t,"STATUS_READY",(function(){return c})),i.d(t,"STATUS_INVALID_SYMBOL",(function(){return u})),i.d(t,"STATUS_SNAPSHOT",(function(){return h})),i.d(t,"STATUS_EOD",(function(){return d})),i.d(t,"STATUS_PULSE",(function(){return p})),i.d(t,"STATUS_DELAYED",(function(){return f})),i.d(t,"STATUS_DELAYED_STREAMING",(function(){return _})),i.d(t,"STATUS_NO_BARS",(function(){return m})),i.d(t,"STATUS_REPLAY",(function(){return y})),i.d(t,"SERIES_STATUS_TEXT",(function(){return g})),i.d(t,"STYLE_LINE_TYPE_MARKERS",(function(){return v})),i.d(t,"STYLE_LINE_TYPE_STEP",(function(){return S})),i.d(t,"STYLE_LINE_TYPE_SIMPLE",(function(){ -return b})),i.d(t,"STYLE_BARS",(function(){return w})),i.d(t,"STYLE_CANDLES",(function(){return P})),i.d(t,"STYLE_LINE",(function(){return C})),i.d(t,"STYLE_AREA",(function(){return x})),i.d(t,"STYLE_RENKO",(function(){return T})),i.d(t,"STYLE_KAGI",(function(){return L})),i.d(t,"STYLE_PNF",(function(){return I})),i.d(t,"STYLE_PB",(function(){return M})),i.d(t,"STYLE_HEIKEN_ASHI",(function(){return O})),i.d(t,"STYLE_HOLLOW_CANDLES",(function(){return A})),i.d(t,"STYLE_BASELINE",(function(){return k})),i.d(t,"STYLE_RANGE",(function(){return E})),i.d(t,"STYLE_HILO",(function(){return D})),i.d(t,"STYLE_SHORT_NAMES",(function(){return V})),i.d(t,"SYMBOL_STRING_DATA",(function(){return B}));var s=0,a=1,l=2,c=3,u=4,h=5,d=6,p=7,f=8,_=9,m=10,y=11,g=((r={})[s]="connecting",r[a]="loading",r[l]="loading",r[c]="realtime",r[u]="invalid",r[h]="snapshot",r[d]="endofday",r[p]="endofday",r[f]="delayed",r[_]="delayed_streaming",r[m]="forbidden",r[y]="replay",r),v=0,S=1,b=2,w=0,P=1,C=2,x=3,T=4,L=5,I=6,M=7,O=8,A=9,k=10,E=11,D=12,V=((n={})[0]="bar",n[1]="candle",n[9]="hollowCandle",n[2]="line",n[3]="area",n[4]="renko",n[7]="pb",n[5]="kagi",n[6]="pnf",n[8]="ha",n[10]="baseline",n[11]="range",n[12]="hilo",n),B=((o={})[4]={type:"BarSetRenko@tv-prostudies",basicStudyVersion:40},o[7]={type:"BarSetPriceBreak@tv-prostudies",basicStudyVersion:34},o[5]={type:"BarSetKagi@tv-prostudies",basicStudyVersion:34},o[6]={type:"BarSetPnF@tv-prostudies",basicStudyVersion:34},o[8]={type:"BarSetHeikenAshi@tv-basicstudies",basicStudyVersion:60},o[11]={type:"BarSetRange@tv-basicstudies",basicStudyVersion:72},o)},di4O:function(e,t,i){"use strict";i.r(t),i.d(t,"watermarkProperty",(function(){return u})),i.d(t,"restoreWatermarkPropertyDefaults",(function(){return h}));var r=i("eJTA"),n=i("Vdly"),o=i("tc+8"),s=i.n(o),a={visibility:!1,color:"rgba(80, 83, 94, 0.25)"};function l(){var e=n.getJSON("symbolWatermark"),t=Object.assign({},a,e);if(void 0===e){if(void 0!==n.getJSON("chartproperties")){var i=n.getJSON("chartproperties").symbolWatermarkProperties;if(void 0!==i){var o=Object(r.tryParseRgba)(i.color);t=Object.assign(t,i),null!==o&&(0!==o[3]?t.visibility=!0:(o[3]=.25,t.color=Object(r.rgbaToString)(o)))}}delete t.transparency}return t}var c=null;function u(){return null===c&&(c=new s.a(l()),n.onSync.subscribe(null,(function(){null!==c&&c.mergeAndFire(l())})),c.listeners().subscribe(null,(function(){null!==c&&n.setJSON("symbolWatermark",c.state())}))),c}function h(){null!==c&&c.mergeAndFire(a)}},e1ZQ:function(e,t,i){"use strict";i.r(t),i.d(t,"dateFormatFunctions",(function(){return p})),i.d(t,"availableDateFormats",(function(){return f})),i.d(t,"defaultDateFormat",(function(){return _}));var r=i("YFKU"),n=i("kcTO"),o={1:r.t("Jan"),2:r.t("Feb"),3:r.t("Mar"),4:r.t("Apr"),5:r.t("May"),6:r.t("Jun"),7:r.t("Jul"),8:r.t("Aug"),9:r.t("Sep"),10:r.t("Oct"),11:r.t("Nov"),12:r.t("Dec")},s=function(e,t){return(t?e.getMonth():e.getUTCMonth())+1},a=function(e,t){return t?e.getFullYear():e.getUTCFullYear()},l=function(e,t){ +;this._sourceState.metaInfo.is_price_study?(t=this._model.paneForSource(this._model.mainSeries()),i=this._model.mainSeries().priceScale()):i=(t=this._model.createPane()).defaultPriceScale();var r=t._restoreStudy(this._sourceState);r.metaInfo().linkedToSeries&&r.setOwnerSource(this._model.mainSeries()),r.start(),r.setPriceScale(i),t.move(r,i)},j.prototype.undo=function(){this._sourceState||L.logError("This command was never executed - nothing to undo");var e=this._model.dataSourceForId(this._sourceState.id);this._model.removeSource(e)},inherit(W,y),W.prototype.setPoint=function(e){this._point=e.clone(),this._handler(e)},W.prototype.point=function(){return this._point},W.prototype.undo=function(){this._handler(this._origPoint)},W.prototype.redo=function(){this._handler(this._point)},t.ChartUndoModel=O,t.PriceScaleChangeUndoCommand=E}).call(this,i("aIyQ"))},dTSQ:function(e,t,i){"use strict";function r(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}i.r(t),i.d(t,"regExpEscape",(function(){return r}))},dUDn:function(e,t,i){"use strict";i.r(t),i.d(t,"StandardPivotPointsPriceAxisView",(function(){return s}));var r=i("mrSG"),n=i("KcY8"),o=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],s=function(e){function t(t,i){var r=e.call(this)||this;r._source=t,r._data=i;var n=i.name;return r._completeName="P"===n.toUpperCase()?"P":"S"+n[1]+"/R"+n[1],r}return Object(r.__extends)(t,e),t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var r=this._source.properties();if(r.visible.value()){var n=this._completeName,s=r.levelsStyle.visibility;if(s[n]&&s[n].value()){var a=this._source.model().timeScale(),l=this._source.priceScale();if(!(a.isEmpty()||null===a.visibleBarsStrictRange()||null!==l&&l.isEmpty())){var c=this._source.customData();if(c&&c.pivots){var u=this._source.pricesView().prices()[o.indexOf(this._data.name.toUpperCase())];if(u){i.background=u.color,i.color=this.generateTextColor(u.color),i.coordinate=u.coordinate,i.floatCoordinate=u.floatCoordinate;var h=this._source.model().properties().scalesProperties;h.showStudyLastValue.value()&&(e.text=u.formatted,e.visible=!0),h.showStudyPlotLabels.value()&&(t.text=this._source.priceLabelText(this._data.name),t.visible=!0)}}}}}},t}(n.a)},dfhE:function(e,t,i){"use strict";var r,n,o;i.r(t),i.d(t,"STATUS_OFFLINE",(function(){return s})),i.d(t,"STATUS_RESOLVING",(function(){return a})),i.d(t,"STATUS_LOADING",(function(){return l})),i.d(t,"STATUS_READY",(function(){return c})),i.d(t,"STATUS_INVALID_SYMBOL",(function(){return u})),i.d(t,"STATUS_SNAPSHOT",(function(){return h})),i.d(t,"STATUS_EOD",(function(){return d})),i.d(t,"STATUS_PULSE",(function(){return p})),i.d(t,"STATUS_DELAYED",(function(){return f})),i.d(t,"STATUS_DELAYED_STREAMING",(function(){return _})),i.d(t,"STATUS_NO_BARS",(function(){return m})),i.d(t,"STATUS_REPLAY",(function(){return y})),i.d(t,"SERIES_STATUS_TEXT",(function(){return g})),i.d(t,"STYLE_LINE_TYPE_MARKERS",(function(){return v})),i.d(t,"STYLE_LINE_TYPE_STEP",(function(){return b})),i.d(t,"STYLE_LINE_TYPE_SIMPLE",(function(){ +return S})),i.d(t,"STYLE_BARS",(function(){return w})),i.d(t,"STYLE_CANDLES",(function(){return P})),i.d(t,"STYLE_LINE",(function(){return C})),i.d(t,"STYLE_AREA",(function(){return x})),i.d(t,"STYLE_RENKO",(function(){return T})),i.d(t,"STYLE_KAGI",(function(){return L})),i.d(t,"STYLE_PNF",(function(){return I})),i.d(t,"STYLE_PB",(function(){return M})),i.d(t,"STYLE_HEIKEN_ASHI",(function(){return O})),i.d(t,"STYLE_HOLLOW_CANDLES",(function(){return A})),i.d(t,"STYLE_BASELINE",(function(){return k})),i.d(t,"STYLE_RANGE",(function(){return E})),i.d(t,"STYLE_HILO",(function(){return D})),i.d(t,"STYLE_SHORT_NAMES",(function(){return V})),i.d(t,"SYMBOL_STRING_DATA",(function(){return B}));var s=0,a=1,l=2,c=3,u=4,h=5,d=6,p=7,f=8,_=9,m=10,y=11,g=((r={})[s]="connecting",r[a]="loading",r[l]="loading",r[c]="realtime",r[u]="invalid",r[h]="snapshot",r[d]="endofday",r[p]="endofday",r[f]="delayed",r[_]="delayed_streaming",r[m]="forbidden",r[y]="replay",r),v=0,b=1,S=2,w=0,P=1,C=2,x=3,T=4,L=5,I=6,M=7,O=8,A=9,k=10,E=11,D=12,V=((n={})[0]="bar",n[1]="candle",n[9]="hollowCandle",n[2]="line",n[3]="area",n[4]="renko",n[7]="pb",n[5]="kagi",n[6]="pnf",n[8]="ha",n[10]="baseline",n[11]="range",n[12]="hilo",n),B=((o={})[4]={type:"BarSetRenko@tv-prostudies",basicStudyVersion:40},o[7]={type:"BarSetPriceBreak@tv-prostudies",basicStudyVersion:34},o[5]={type:"BarSetKagi@tv-prostudies",basicStudyVersion:34},o[6]={type:"BarSetPnF@tv-prostudies",basicStudyVersion:34},o[8]={type:"BarSetHeikenAshi@tv-basicstudies",basicStudyVersion:60},o[11]={type:"BarSetRange@tv-basicstudies",basicStudyVersion:72},o)},di4O:function(e,t,i){"use strict";i.r(t),i.d(t,"watermarkProperty",(function(){return u})),i.d(t,"restoreWatermarkPropertyDefaults",(function(){return h}));var r=i("eJTA"),n=i("Vdly"),o=i("tc+8"),s=i.n(o),a={visibility:!1,color:"rgba(80, 83, 94, 0.25)"};function l(){var e=n.getJSON("symbolWatermark"),t=Object.assign({},a,e);if(void 0===e){if(void 0!==n.getJSON("chartproperties")){var i=n.getJSON("chartproperties").symbolWatermarkProperties;if(void 0!==i){var o=Object(r.tryParseRgba)(i.color);t=Object.assign(t,i),null!==o&&(0!==o[3]?t.visibility=!0:(o[3]=.25,t.color=Object(r.rgbaToString)(o)))}}delete t.transparency}return t}var c=null;function u(){return null===c&&(c=new s.a(l()),n.onSync.subscribe(null,(function(){null!==c&&c.mergeAndFire(l())})),c.listeners().subscribe(null,(function(){null!==c&&n.setJSON("symbolWatermark",c.state())}))),c}function h(){null!==c&&c.mergeAndFire(a)}},e1ZQ:function(e,t,i){"use strict";i.r(t),i.d(t,"dateFormatFunctions",(function(){return p})),i.d(t,"availableDateFormats",(function(){return f})),i.d(t,"defaultDateFormat",(function(){return _}));var r=i("YFKU"),n=i("kcTO"),o={1:r.t("Jan"),2:r.t("Feb"),3:r.t("Mar"),4:r.t("Apr"),5:r.t("May"),6:r.t("Jun"),7:r.t("Jul"),8:r.t("Aug"),9:r.t("Sep"),10:r.t("Oct"),11:r.t("Nov"),12:r.t("Dec")},s=function(e,t){return(t?e.getMonth():e.getUTCMonth())+1},a=function(e,t){return t?e.getFullYear():e.getUTCFullYear()},l=function(e,t){ return Object(n.numberToStringWithLeadingZero)(function(e,t){return t?e.getDate():e.getUTCDate()}(e,t),2)},c=function(e,t){return o[s(e,t)]},u=function(e,t){return Object(n.numberToStringWithLeadingZero)(s(e,t),2)},h=function(e,t){return Object(n.numberToStringWithLeadingZero)(a(e,t)%100,2)},d=function(e,t){return Object(n.numberToStringWithLeadingZero)(a(e,t),4)},p={"dd MMM 'yy":function(e,t){return l(e,t)+" "+c(e,t)+" '"+h(e,t)},"MMM dd":function(e,t){return c(e,t)+" "+l(e,t)},"yyyy-MM-dd":function(e,t){return d(e,t)+"-"+u(e,t)+"-"+l(e,t)},"yy-MM-dd":function(e,t){return h(e,t)+"-"+u(e,t)+"-"+l(e,t)},"yy/MM/dd":function(e,t){return h(e,t)+"/"+u(e,t)+"/"+l(e,t)},"yyyy/MM/dd":function(e,t){return d(e,t)+"/"+u(e,t)+"/"+l(e,t)},"dd-MM-yyyy":function(e,t){return l(e,t)+"-"+u(e,t)+"-"+d(e,t)},"dd-MM-yy":function(e,t){return l(e,t)+"-"+u(e,t)+"-"+h(e,t)},"dd/MM/yy":function(e,t){return l(e,t)+"/"+u(e,t)+"/"+h(e,t)},"dd/MM/yyyy":function(e,t){return l(e,t)+"/"+u(e,t)+"/"+d(e,t)},"MM/dd/yy":function(e,t){return u(e,t)+"/"+l(e,t)+"/"+h(e,t)},"MM/dd/yyyy":function(e,t){return u(e,t)+"/"+l(e,t)+"/"+d(e,t)}},f=Object.keys(p),_=function(){return-1!==["ja","ko","zh","zh_TW"].indexOf(window.language||"")?"yyyy-MM-dd":"dd MMM 'yy"}},e92V:function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o})),i.d(t,"c",(function(){return s}));var r=i("OH2X");function n(e){return!1}function o(e){return e in r||!1}function s(e){switch(e){case"LineToolBalloon":case"LineToolText":case"LineToolTextAbsolute":case"LineToolCallout":case"LineToolNote":case"LineToolNoteAbsolute":return!0}return!1}},eJTA:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i("ivNn");function n(e,t,i){return r.isNaN(t)||ti?i:Math.round(t)}function o(e,t,i){return r.isNaN(t)||ti?i:Math.round(1e4*t)/1e4}function s(e){return n(0,e,255)}function a(e){return n(0,e,255)}function l(e){return n(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,r=e[2]/255,n=Math.min(t,i,r),o=Math.max(t,i,r),s=0,a=0,l=(n+o)/2;if(n===o)s=0,a=0;else{var c=o-n;switch(a=l>.5?c/(2-o-n):c/(o+n),o){case t:s=((i-r)/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 y(e){var t,i,r,n=e[0],o=e[1],c=e[2];if(0===o)t=i=r=c;else{var u=c<.5?c*(1+o):c+o-c*o,h=2*c-u;t=m(h,u,n+1/3),i=m(h,u,n),r=m(h,u,n-1/3)}return[s(255*t),a(255*i),l(255*r)]}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,r){if(Array.isArray(e)){var n=e;return r=t,[n[0],n[1],n[2],c(r)]}var o=t;return i=i||0,r=r||0,[s(e),a(o),l(i),c(r)]}, -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=y,t.rgbToHsv=function(e){var t=e[0],i=e[1],r=e[2],n=t/255,o=i/255,s=r/255,a=Math.min(n,o,s),l=Math.max(n,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 v(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=D,t.parseRgba=V},ePL1:function(e,t,i){"use strict";i.r(t),i.d(t,"types",(function(){return r}));var r={ECONOMIC:"economic",QUANDL:"quandl"}},ei7k:function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o}));var r=i("CLNU");function n(e){return Object(r.clean)(JSON.stringify(e))}function o(e){return JSON.parse(Object(r.clean)(e,!0))}},"f+Sq":function(e,t,i){"use strict";function r(e){if(void 0===e)throw new Error("Value is undefined");return e}function n(e){if(null===e)throw new Error("Value is null");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("Assertion failed"+(t?": "+t:""))},t.ensureDefined=r,t.ensureNotNull=n,t.ensure=function(e){return n(r(e))}},f3xO:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererUnicodeChar",(function(){return p}));var r=i("mrSG"),n=i("/SnT"),o=i.n(n),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 r=e.call(this,t,i)||this;r._heightEnsured=Object(s.ensureDefined)(r._height);var n=t.char.slice(0,40);return r._ch=o()(n)[0]||" ",r._fontFamily=t.fontFamily||h.CHART_FONT_FAMILY,r._charCache=new d.b(r._ch,!1,!1,r._fontFamily,r._heightEnsured),r}return Object(r.__extends)(t,e),t.prototype.hitTest=function(e){for(var t=Object(u.selectionTolerance)(this._heightEnsured),i=0,r=this._items;i0?1:-1,s=i.y+i.vertOffset-o*Math.round(this._heightEnsured/2);r=i.style&&void 0!==i.style.color?i.style.color:this._color,this._charCache.paintTo(e,t,r,n,s,d.a.Center,i.vertOffset>0?d.c.Top:d.c.Bottom)},t.prototype._startPath=function(e,t,i,r){},t.prototype._endPath=function(e){},t}(l.b)},f6yo:function(e,t,i){"use strict" ;Object.defineProperty(t,"__esModule",{value:!0});var r=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,n){var o=t.add(i).scaled(.5).add(n).scaled(.5),s=r.intersectLineSegments(t,i,o,e);return null===s&&(null===(s=r.intersectLineSegments(i,n,o,e))&&null===(s=r.intersectLineSegments(n,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,r=!1,n=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)'},fxzW:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererDiamond",(function(){return s}));var r=i("mrSG"),n=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(t,e),t.prototype._drawItemShapeUsingCSSPixels=function(e,t){var i=Math.round(t.height/2),r=t.x,n=t.vertOffset,o=t.y+n;e.moveTo(r,o-i),e.lineTo(r+i,o),e.lineTo(r,o+i),e.lineTo(r-i,o),e.lineTo(r,o-i)},t.prototype._calcBoundingBox=function(t){var i=Math.round(t.height/2),r=t.x,n=t.vertOffset,s=t.y+n,a=r-i,l=r+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}(n.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 r=i("yMne"),n=null,o=null;function s(){return o}function a(){null===o&&(o=new Promise((function(e){ Promise.all([i.e(31),i.e(39),i.e(75),i.e(14),i.e(29),i.e(35),i.e(47),i.e("floating-toolbars")]).then(function(t){if(null===n){var o=i("gmn6").FavoriteDrawingToolbar;n=new o({left:window.innerWidth/2,top:r.HEADER_TOOLBAR_HEIGHT_EXPANDED+61}),e(n)}}.bind(null,i)).catch(void 0)})))}},gAom:function(e,t,i){"use strict";function r(e,t,i,r,n,o){e.fillRect(t+o,i,r-2*o,o),e.fillRect(t+o,i+n-o,r-2*o,o),e.fillRect(t,i,o,n),e.fillRect(t+r-o,i,o,n)}function n(e,t,i,r){e.beginPath();var n=e.lineWidth%2?.5:0;e.moveTo(i,t+n),e.lineTo(r,t+n),e.stroke()}function o(e,t,i,r){e.beginPath();var n=e.lineWidth%2?.5:0;e.moveTo(t+n,i),e.lineTo(t+n,r),e.stroke()}i.r(t),i.d(t,"fillRectInnerBorder",(function(){return r})),i.d(t,"drawHorizontalLine",(function(){return n})),i.d(t,"drawVerticalLine",(function(){return o}))},gBDZ:function(e,t,i){"use strict";var r=i("Eyy1"),n=i("XlJ7");var o,s,a=i("ikwP");i.d(t,"a",(function(){return o})),i.d(t,"c",(function(){return s})),i.d(t,"b",(function(){return l})),function(e){e.Left="left",e.Right="right",e.Center="center"}(o||(o={})),function(e){e.Top="top",e.Bottom="bottom",e.Middle="middle"}(s||(s={}));var l=function(){function e(e,t,i,o,s,l){void 0===l&&(l="center"),this._cacheRenderParams=null,this._canvasesMap={},this._lines=e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=function(e,t,i,r){return Object(n.makeFont)(r,i,(e?"bold ":"")+(t?"italic ":""))}(t,i,o,s),this._fontSize=s,this._verticalPadding=~~(s/6),this._textAlign=l;var c=Object(a.createDisconnectedCanvas)(document,new a.Size(0,0),1),u=Object(r.ensureNotNull)(c.getContext("2d"));u.font=this._font;for(var h=0,d=0,p=this._lines;d0){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.updateCrosshair=function(){var e=this.crossHairSource(),t=e.pane;if(null!==t){var i=e.originCoordX(),r=e.originCoordY();this.setAndSaveCurrentPosition(i,r,t)}},e.prototype.zoomTime=function(e,t,i){if(this._zoomEnabled){var r=this.timeScale();if(!r.isEmpty()&&0!==t){var n=r.width();e=Math.max(1,Math.min(e,n-2)),r.zoom(e,t,i),this.updateCrosshair(),this.recalculateAllPanes(), -this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._setScalesResetAvailable(!0)}}},e.prototype.lineToolsGroupModel=function(){return this._lineToolsGroupModel},e.prototype.restoreLineToolsGroups=function(e){this._lineToolsGroupModel=b.LineToolsGroupModel.fromState(this,e)},e.prototype.updateSource=function(e){var t=this._invalidationMaskForSource(e);null!==t&&this.invalidate(t)},e.prototype.replaceStudyStub=function(e,t){var i=this.paneForSource(e);if(null===i)return!1;var r=e.priceScale(),n=e.zorder(),o=e.ownerSource();return this.paneForSource(e)===i?i.replaceSource(e,t,r):(i.insertDataSource(t,r,n),this.removeSource(e)),t.setOwnerSource(o),this.dataSources().forEach((function(i){i.ownerSource()===e&&i.setOwnerSource(t)})),t.start(),this.recalculatePane(i),this.fullUpdate(),!0},e.prototype.insertStudyStub=function(e){var t=this.mainSeries(),i=Object(r.ensureNotNull)(this.paneForSource(t)),n=new o.StudyStub(this,null,e),s=i.createPriceScaleAtPosition("overlay");return i.addDataSource(n,s,!1),this.recalculatePane(i),this.fullUpdate(),n},e.prototype.removeStudyStub=function(e){var t=this.dataSourceForId(e);return null===t?(L.logNormal("StudyStub id="+e+" is not found in chart model"),!1):(this.removeSource(t),!0)},e.prototype.setHoveredSource=function(e,t){var i=this._hoveredSource!==e;if(i||this._lastHittestData!==t){this._lastHittestData=t;var r,n=null;if(this._hoveredSource)this._hoveredSource.updateAllViews(),n=new f.InvalidateMask,null!==(r=this._invalidationMaskForSource(this._hoveredSource,f.InvalidationLevel.Light))&&n.merge(r);if(this._hoveredSource=e,e)e.updateAllViews(),n||(n=new f.InvalidateMask),null!==(r=this._invalidationMaskForSource(e,f.InvalidationLevel.Light))&&n.merge(r);n&&this.invalidate(n),i&&this._hoveredSourceChanged.fire(e)}},e.prototype.hoveredSource=function(){return this._hoveredSource},e.prototype.hoveredSourceChanged=function(){return this._hoveredSourceChanged},e.prototype.lastHittestData=function(){return this._lastHittestData},e.prototype.findNonOverlayStudyWithGroupingKey=function(e,t){for(var i=function(t){var i=t.dataSources().find((function(i){return Object(c.isStudy)(i)&&i.metaInfo().groupingKey===e&&!t.isOverlay(i)}));if(void 0!==i)return{value:{pane:t,study:i}}},r=0,n=void 0!==t?[t]:this._panes;r=0&&e=0&&e1)return void t.setValue(!1)}t.setValue(!0)}},e.prototype._getAvailableCurrencies=function(){var e=this;return this._options.currencyLabelEnabled?Object(T.isArray)(this._availableCurrencies)?this._availableCurrencies:(null!==this._availableCurrencies||(this._availableCurrencies=this.chartApi().availableCurrencies(),this._availableCurrencies.then((function(t){e._destroyed||(e._availableCurrencies=t,e.lightUpdate())})).catch((function(t){L.logWarn("An error occurred while getting available currencies: "+t),e._availableCurrencies=null}))),[]):[]},e}()},gQ5K:function(e,t,i){"use strict";i.r(t),i.d(t,"DateFormatter",(function(){return o}));var r=i("kcTO"),n=i("e1ZQ"),o=function(){function e(e){void 0===e&&(e="yyyy-MM-dd"),this._dateFormatFunc=n.dateFormatFunctions[e]}return e.prototype.format=function(e){return r.customFormatters&&r.customFormatters.dateFormatter?r.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!1)},e.prototype.formatLocal=function(e){return r.customFormatters.dateFormatter?r.customFormatters.dateFormatter.formatLocal?r.customFormatters.dateFormatter.formatLocal(e):r.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 r=i("mrSG"),n=i("Eyy1"),o=i("vq8G"),s=i("6Fc/"),a=function(e){ function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(t,e),t.prototype._drawMarker=function(e,t,i,r,o){var a=Object(n.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!=r%2&&(u+=1);var h=r%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 r}));var r=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,r=t.pixelRatio,n=0;n'+e+""}));a.innerHTML=(t=l.text).format.apply(t,c).replace(/\s\+\s/g,'+'),r.classList.add(S["common-tooltip__body--with-hotkey"]),s&&a.classList.add(S["common-tooltip__hotkey-block--divider"]),r.appendChild(a)}return i.addEventListener("contextmenu",v.a),i}function P(e,t){var i=t.rect;if(i){!function(e,t){var i,r=f.includes(t)?p[t]:"";(i=e.classList).remove.apply(i,f.map((function(e){return p[e]})).filter((function(e){return!!e}))),r&&!e.classList.contains(r)&&e.classList.add(r)}(e,t.colorTheme||"default"),t.addClass&&e.classList.add(t.addClass);var r=k(e);r.classList.toggle(S["common-tooltip__body--width_wide"],Boolean(t.wide)),r.classList.toggle(S["common-tooltip__body--no-padding"],Boolean(t.noPadding)),r.classList.toggle(S["common-tooltip__body--width_narrow"],Boolean(t.narrow)),r.classList.toggle(S["common-tooltip__body--no-buttons"],!0),e.classList.toggle(S["common-tooltip--no-pointer-events"],!Modernizr.pointerevents),r.style.left=x(0),r.style.width=x(r.clientWidth+(Boolean(t.noPadding)?0:2));var n=document.body.clientWidth,o=window.innerHeight,s=t.vertical,a=t.extendMargin||s&&i.w<20||!s&&i.h<20;e.classList.toggle(S["common-tooltip--farther"],a),e.classList.toggle(S["common-tooltip--vertical"],s), -e.classList.toggle(S["common-tooltip--horizontal"],!s);var l=e.querySelector("."+S["common-tooltip__ear-holder"]),c="";if(s){e.style.left=x(i.x+i.w),e.style.top=x(i.y-(e.offsetHeight-i.h)/2);var u=(e.querySelector(":last-child")||r).getBoundingClientRect().right+10>n;e.classList.toggle(S["common-tooltip--direction_reversed"],u),e.classList.toggle(S["common-tooltip--direction_normal"],!u),c=u?"after":"before",Object(g.isRtl)()?(c=t.otr?"after":c,c=t.otl?"before":c):(c=t.otr?"before":c,c=t.otl?"after":c),l.classList.toggle(S["common-tooltip__ear-holder--before"],"before"===c),l.classList.toggle(S["common-tooltip__ear-holder--after"],"after"===c),"after"===c&&(e.style.left="auto",e.style.right=x(n-i.x))}else{var h=i.x-(r.offsetWidth-i.w)/2,d=n-10-e.offsetWidth,_=Math.max(10,Math.min(h,d));e.style.bottom=x(o-i.y),e.style.left=x(_);u=d\n\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t
\n',L='\n\t
\n',I='\n\t
\n',M=Object(y.b)(T),O=Object(y.b)(L),A=Object(y.b)(I);function k(e){return e.querySelector("."+S["common-tooltip__body"])}var E=i("lxNp");i.d(t,"showOnElement",(function(){return N})),i.d(t,"show",(function(){return F})),i.d(t,"updateTooltipText",(function(){return j})),i.d(t,"hide",(function(){return W}));var D=!1,V=null,B=null;Modernizr.mobiletouch||document.addEventListener("mouseover",(function(e){for(var t=e.target,i=e.currentTarget,r=function(e,t,i){var r=[];for(;e&&e!==t;)e.classList&&e.classList.contains(i)&&r.push(e),e=e.parentElement||(n=e.parentNode)&&(n.nodeType===Node.ELEMENT_NODE?n:null);var n;return r}(t,i,"apply-common-tooltip"),n=function(t){if("buttons"in e){if(1&e.buttons)return"continue"}else if(1===e.which)return"continue";var i=function(){return N(t)};if(i()){var r=function(){t.removeEventListener("common-tooltip-update",i),t.removeEventListener("mouseleave",r),t.removeEventListener("mousedown",r),document.removeEventListener("scroll",r), -B&&(B.destroy(),B=null),W()};return t.addEventListener("common-tooltip-update",i),t.addEventListener("mouseleave",r),t.addEventListener("mousedown",r),document.addEventListener("scroll",r),null===B&&(B=Object(E.createGroup)({desc:"Tooltip"})).add({desc:"Hide",hotkey:27,handler:r}),"break"}},o=0,s=r;o'+e+""}));a.innerHTML=(t=l.text).format.apply(t,c).replace(/\s\+\s/g,'+'),r.classList.add(b["common-tooltip__body--with-hotkey"]),s&&a.classList.add(b["common-tooltip__hotkey-block--divider"]),r.appendChild(a)}return i.addEventListener("contextmenu",v.a),i}function P(e,t){var i=t.rect;if(i){!function(e,t){var i,r=f.includes(t)?p[t]:"";(i=e.classList).remove.apply(i,f.map((function(e){return p[e]})).filter((function(e){return!!e}))),r&&!e.classList.contains(r)&&e.classList.add(r)}(e,t.colorTheme||"default"),t.addClass&&e.classList.add(t.addClass);var r=k(e);r.classList.toggle(b["common-tooltip__body--width_wide"],Boolean(t.wide)),r.classList.toggle(b["common-tooltip__body--no-padding"],Boolean(t.noPadding)),r.classList.toggle(b["common-tooltip__body--width_narrow"],Boolean(t.narrow)),r.classList.toggle(b["common-tooltip__body--no-buttons"],!0),e.classList.toggle(b["common-tooltip--no-pointer-events"],!Modernizr.pointerevents),r.style.left=x(0),r.style.width=x(r.clientWidth+(Boolean(t.noPadding)?0:2));var n=document.body.clientWidth,o=window.innerHeight,s=t.vertical,a=t.extendMargin||s&&i.w<20||!s&&i.h<20;e.classList.toggle(b["common-tooltip--farther"],a),e.classList.toggle(b["common-tooltip--vertical"],s), +e.classList.toggle(b["common-tooltip--horizontal"],!s);var l=e.querySelector("."+b["common-tooltip__ear-holder"]),c="";if(s){e.style.left=x(i.x+i.w),e.style.top=x(i.y-(e.offsetHeight-i.h)/2);var u=(e.querySelector(":last-child")||r).getBoundingClientRect().right+10>n;e.classList.toggle(b["common-tooltip--direction_reversed"],u),e.classList.toggle(b["common-tooltip--direction_normal"],!u),c=u?"after":"before",Object(g.isRtl)()?(c=t.otr?"after":c,c=t.otl?"before":c):(c=t.otr?"before":c,c=t.otl?"after":c),l.classList.toggle(b["common-tooltip__ear-holder--before"],"before"===c),l.classList.toggle(b["common-tooltip__ear-holder--after"],"after"===c),"after"===c&&(e.style.left="auto",e.style.right=x(n-i.x))}else{var h=i.x-(r.offsetWidth-i.w)/2,d=n-10-e.offsetWidth,_=Math.max(10,Math.min(h,d));e.style.bottom=x(o-i.y),e.style.left=x(_);u=d\n\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t
\n',L='\n\t
\n',I='\n\t
\n',M=Object(y.b)(T),O=Object(y.b)(L),A=Object(y.b)(I);function k(e){return e.querySelector("."+b["common-tooltip__body"])}var E=i("lxNp");i.d(t,"showOnElement",(function(){return N})),i.d(t,"show",(function(){return F})),i.d(t,"updateTooltipText",(function(){return j})),i.d(t,"hide",(function(){return W}));var D=!1,V=null,B=null;Modernizr.mobiletouch||document.addEventListener("mouseover",(function(e){for(var t=e.target,i=e.currentTarget,r=function(e,t,i){var r=[];for(;e&&e!==t;)e.classList&&e.classList.contains(i)&&r.push(e),e=e.parentElement||(n=e.parentNode)&&(n.nodeType===Node.ELEMENT_NODE?n:null);var n;return r}(t,i,"apply-common-tooltip"),n=function(t){if("buttons"in e){if(1&e.buttons)return"continue"}else if(1===e.which)return"continue";var i=function(){return N(t)};if(i()){var r=function(){t.removeEventListener("common-tooltip-update",i),t.removeEventListener("mouseleave",r),t.removeEventListener("mousedown",r),document.removeEventListener("scroll",r), +B&&(B.destroy(),B=null),W()};return t.addEventListener("common-tooltip-update",i),t.addEventListener("mouseleave",r),t.addEventListener("mousedown",r),document.addEventListener("scroll",r),null===B&&(B=Object(E.createGroup)({desc:"Tooltip"})).add({desc:"Hide",hotkey:27,handler:r}),"break"}},o=0,s=r;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,n(new r(a,t.y),new r(l,i.y),new r(e.x,e.y)).distance<=c)return this.hittest?this.hittest:new s(s.REGULAR);return null},t.PaneRendererLine=TradingView.PaneRendererLine=l},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 r=i("Kxc7"),n=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*([hdwms]?)\s*$/i.exec(e)||[],i=~~t[1],r=t[2]&&t[2].toUpperCase()||null,n={qty:!i&&r?1:i,unit:r};return n.error=!i&&!r, n.intraday=!(n.error||n.unit&&"H"!==n.unit),n}function u(e){if(r.enabled("allow_supported_resolutions_set_only")){var t=s.Interval.normalize(e);return null!==t&&Object(n.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(n.setLastUsedResolution)(e),o.linking.interval.setValue(e)}},hBTJ:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i("Eyy1"),n=i("aO4+"),o=i("GEp6"),s=i("f6yo");function a(e,t){var i=e.A,r=t.A,o=e.B,s=t.B,a=e.C,l=t.C,c=i*s-r*o;if(Math.abs(c)<1e-6)return null;var u=(o*l-s*a)/c,h=(r*a-i*l)/c;return new n.Point(u,h)}function l(e,t,i,r){var n=function(e,t,i,r){var n=t.subtract(e),o=r.subtract(i),s=n.x*o.y-n.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,r);if(null===n)return null;var s=t.subtract(e).scaled(n).add(e),a=o.distanceToSegment(i,r,s);return Math.abs(a.distance)<1e-6?n:null}function c(e,t){for(var i=0,r=e;i0&&n.equalPoints(e[e.length-1],t))&&(e.push(t),!0)}function h(e,t){for(var i=[],r=0;r=3?i:null}t.intersectLineSegmentAndBox=function(e,t){var i=e[0].x,r=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,r,n,o){var s=0;return en&&(s|=2),to&&(s|=8),s}for(var d=h(i,r,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,y=void 0,g=void 0;8&m?(y=i+(o-i)*(u-r)/(s-r),g=u):4&m?(y=i+(o-i)*(l-r)/(s-r),g=l):2&m?(g=r+(s-r)*(c-i)/(o-i),y=c):(g=r+(s-r)*(a-i)/(o-i),y=a),m===d?d=h(i=y,r=g,a,l,c,u):p=h(o=y,s=g,a,l,c,u)}return f?n.equalPoints(n.point(i,r),n.point(o,s))?n.point(i,r):n.lineSegment(n.point(i,r),n.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?n.lineSegment(n.point(i,l),n.point(s,l)):null}if(0===e.B){var u=-e.C/e.A;return i<=u&&u<=s?n.lineSegment(n.point(u,o),n.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 n.Point(t,i))},p=function(t){var r=function(e,t){return-(e.C+e.B*t)/e.A}(e,t);i<=r&&r<=s&&c(h,new n.Point(r,t))};switch(d(i),p(o),d(s),p(a),h.length){case 0:return null;case 1:return h[0];case 2:return n.equalPoints(h[0],h[1])?h[0]:n.lineSegment(h[0],h[1])}return r.assert(!1,"We should have at most two intersection points"),null},t.intersectRayAndBox=function(e,t,i){var r=l(e,t,i.min,new n.Point(i.max.x,i.min.y)),o=l(e,t,new n.Point(i.max.x,i.min.y),i.max),a=l(e,t,i.max,new n.Point(i.min.x,i.max.y)),c=l(e,t,new n.Point(i.min.x,i.max.y),i.min),u=[];if(null!==r&&r>=0&&u.push(r),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,r=0;r0&&(h=2*Math.PI-h),0===e&&(h+=Math.PI),this._properties.angle.setValue(h)}else{var d=this._startChangeWidth,p=s.subtract(o).length();if(this._origScale*dx?a.PlotRowSearchMode.NearestLeft:a.PlotRowSearchMode.Exact,L=this._study.nearestIndex(C,T);if(void 0!==L){var I=y[b];if(void 0===I&&(I=this._study.getMinFirstBarIndexForPlot(b),Number.isFinite(I)&&(y[b]=I)),!(I>L)){var M=this._study.data().last(),O=this._study.data().valueAt(L)||(null!==M?M.value:null);if(null!==O){var A=O[P+1];if(Object(n.isNumber)(A)){S.setValue(m.format(A));var k=this._study.properties().styles[b].color.value();h=o[P];Object(l.isOhlcPlot)(h)&&(b=h.target||b,k=this._study.properties().ohlcPlots[b].color.value());var E=k;if(s[b]&&O.length>s[b].index+1){var D=O[s[b].index+1],V=s[b].palette;if(null!=D&&void 0!==V){var B=s[b].paletterProps,R=V.valToIndex?V.valToIndex[D]:D -;E=B.colors[void 0!==R?R:D].color.value()}}E=Object(d.resetTransparency)(E),S.setColor(E)}}}}}}}},t.prototype._currentIndex=function(){var e=this._model.crossHairSource().lockedIndex;return void 0!==e?e:null!==this._model.crossHairSource().pane?this._model.crossHairSource().appliedIndex():this._study.data().lastIndex()},t}(o.b)},ivNn:function(e,t,i){"use strict";function r(e){return Math.round(1e10*e)/1e10}Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=function(e){return"number"==typeof e&&isFinite(e)},t.isInteger=function(e){return"number"==typeof e&&e%1==0},t.isNaN=function(e){return!(e<=0||e>0)},t.fixComputationError=r,t.alignTo=function(e,t){var i=e/t,n=Math.floor(i),o=i-n;return o>2e-10?r(o>.5?(n+1)*t:n*t):e}},j1f4:function(e,t,i){"use strict";i.r(t);var r=i("K9GE");for(var n in r)"default"!==n&&function(e){i.d(t,e,(function(){return r[e]}))}(n)},jA0t:function(e,t,i){"use strict";var r=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 r=0;rt){if((n=o-1)x?a.PlotRowSearchMode.NearestLeft:a.PlotRowSearchMode.Exact,L=this._study.nearestIndex(C,T);if(void 0!==L){var I=y[S];if(void 0===I&&(I=this._study.getMinFirstBarIndexForPlot(S),Number.isFinite(I)&&(y[S]=I)),!(I>L)){var M=this._study.data().last(),O=this._study.data().valueAt(L)||(null!==M?M.value:null);if(null!==O){var A=O[P+1];if(Object(n.isNumber)(A)){b.setValue(m.format(A));var k=this._study.properties().styles[S].color.value();h=o[P];Object(l.isOhlcPlot)(h)&&(S=h.target||S,k=this._study.properties().ohlcPlots[S].color.value());var E=k;if(s[S]&&O.length>s[S].index+1){var D=O[s[S].index+1],V=s[S].palette;if(null!=D&&void 0!==V){var B=s[S].paletterProps,R=V.valToIndex?V.valToIndex[D]:D +;E=B.colors[void 0!==R?R:D].color.value()}}E=Object(d.resetTransparency)(E),b.setColor(E)}}}}}}}},t.prototype._currentIndex=function(){var e=this._model.crossHairSource().lockedIndex;return void 0!==e?e:null!==this._model.crossHairSource().pane?this._model.crossHairSource().appliedIndex():this._study.data().lastIndex()},t}(o.b)},ivNn:function(e,t,i){"use strict";function r(e){return Math.round(1e10*e)/1e10}Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=function(e){return"number"==typeof e&&isFinite(e)},t.isInteger=function(e){return"number"==typeof e&&e%1==0},t.isNaN=function(e){return!(e<=0||e>0)},t.fixComputationError=r,t.alignTo=function(e,t){var i=e/t,n=Math.floor(i),o=i-n;return o>2e-10?r(o>.5?(n+1)*t:n*t):e}},j1f4:function(e,t,i){"use strict";i.r(t);var r=i("K9GE");for(var n in r)"default"!==n&&function(e){i.d(t,e,(function(){return r[e]}))}(n)},jA0t:function(e,t,i){"use strict";var r=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 r=0;rt){if((n=o-1)0&&e-t[r-1]<=n)return n;return 0},n.prototype.is_valid=function(){return!this._invalid},n._offset=function(e,t,i){var r=o(e,i);return-1===r?0:t[r]};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,r=u.get_day_of_year(e)-i;return Math.ceil(r/7)+1},get_minutes_from_midnight:function(e){return 60*u.get_hours(e)+u.get_minutes(e)},set_hms:function(e,t,i,r,n,o){e.setUTCHours(t),e.setUTCMinutes(i),e.setUTCSeconds(r),e.setUTCMilliseconds(n),u.correct_time(e,o)},correct_time:function(e,t){var i=e.getTime(),r=t.correction_loc(i);e.setTime(i+r)},add_days_considering_dst:function(e,t,i){var r=e.offset_utc(t),n=this.clone(t);this.add_date(n,i);var o=e.offset_utc(n);return n.setTime(n.getTime()+r-o),n},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,r,n,o,s){var a=new Date(Date.UTC(t,i,r,n||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 n(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 r=i("Hr11"),n=r.greaterThan,o=r.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,r,n){isFinite(t)&&isFinite(r)&&isFinite(i)&&isFinite(n)&&(e.lineStyle!==s.LINESTYLE_SOLID?s.drawDashedLine(e,t,i,r,n):s.drawSolidLine(e,t,i,r,n))},s.drawArrow=function(e,t,i,r,n,o){if(o=void 0===o?2:o,isFinite(t)&&isFinite(r)&&isFinite(i)&&isFinite(n)){var s=Math.round(o/2);e.beginPath(),e.moveTo(r,n),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,r,n){e.beginPath(),e.moveTo(t,i),e.lineTo(r,n),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 r=0;r0&&(c.thereYet=o,c.cap=Math.max),t-r>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,r)||!c.thereYet(h,s);){var f=Math.atan2(s-i,r-t),_=a[d];u=l.cap(r,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 r=i("mrSG"),n=i("Eyy1"),o=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n._restorePane=!1,n}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=this,t=this._chartModel.panes().length,i=this._chartModel.panes()[this._targetPaneIndex()],r=Object(n.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),o=this._chartModel.children(r,!0);o.forEach((function(t){return e._chartModel.detachSource(t)})),this._restorePane=this._chartModel.detachSource(r);var s=i.findSuitableScale(r);if(i.addDataSource(r,s,!1),o.forEach((function(e){return i.addDataSource(e,s,!1)})),r===this._chartModel.mainSeries()){var a=i.priceScalePosition(s);i.movePriceScale(s,a,0)}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(n.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),r=this._chartModel.children(i,!0);r.forEach((function(e){return t._chartModel.detachSource(e)})),this._chartModel.detachSource(i);var o=e.getPriceScaleById(this._initialPriceScaleId);null===o&&(o=e.createPriceScaleAtPosition(this._initialPriceScalePosition,this._initialPriceScaleIndex)),e.addDataSource(i,o,!0),r.forEach((function(t){return e.addDataSource(t,o,!1)})),this._chartModel.fullUpdate()},t}(i("3u3j").a),s=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return Object(r.__extends)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex-1},t}(o),a=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return Object(r.__extends)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex+1},t}(o),l=function(e){function t(t,i,r,n){var o=e.call(this,t,i,n)||this;return o._targetPane=r,o}return Object(r.__extends)(t,e),t.prototype._targetPaneIndex=function(){return this._targetPane},t}(o)},jTis:function(e,t,i){"use strict";var r;i.r(t),i.d(t,"CalloutConsts",(function(){return r})),function(e){e[e.RoundRadius=8]="RoundRadius",e[e.TextMargins=2]="TextMargins",e[e.MinWidth=100]="MinWidth"}(r||(r={}))},jenN:function(e,t,i){"use strict";i.r(t),i.d(t,"createGraphicsPaneViews",(function(){return l})),i.d(t,"createGraphicsPriceAxisViews",(function(){return u}));var r=i("uOxu"),n=i("7Fue");i.d(t,"isStudyGraphicsEmpty",(function(){return n.a}));var o=i("xWfy");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})) @@ -526,75 +526,75 @@ var r=i[t];if("function"==typeof e[r]){e[r]();break}}this.isFullscreen.setValue( e.height.unsubscribe(this._updateDocumentHeight),e.alive.setValue(!1);var t=e.container.value(),i=null==t?void 0:t.parentElement;i&&(i.removeChild(t),i.removeChild(this._layoutSizeSensor))}},e.prototype._height=function(e){return"visual"===this._viewportType?this._layoutSizeSensor.clientHeight:e.container.value().clientHeight},e.prototype._width=function(e){return e.container.value().clientWidth},e.prototype._requestFullscreen=function(){this._fullscreenApi.enter()},e.prototype._exitFullscreen=function(){this._fullscreenApi.exit()},e.prototype._initFullscreen=function(){var e=this;this._fullscreenApi.isFullscreen.subscribe((function(t){e._resizeHandler&&e._resizeHandler()}))},e}()},ljE9:function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return o}));var r=new WeakMap;function n(e,t){var i=r.get(e);return i instanceof Function?i(t):i&&i[t]}function o(e,t,i){if(i instanceof Function)r.set(e,i);else{var n=r.get(e),o=void 0===n||n instanceof Function?{}:n;o[t]=i,r.set(e,o)}}},loH8:function(e,t,i){"use strict";var r=i("aO4+"),n=r.Point,o=r.box,s=i("f6yo").pointInBox,a=i("VdBB").HitTestResult;function l(e,t,i,r){this._cache=e,this._cacheRect=t,this._targetRect=i,this._devicePixelRatio=r}l.prototype.draw=function(e){e.save(),e.setTransform(1,0,0,1,0,0);var t=this._devicePixelRatio;e.drawImage(this._cache,this._cacheRect.left*t,this._cacheRect.top*t,this._cacheRect.width*t,this._cacheRect.height*t,this._targetRect.left*t,this._targetRect.top*t,this._targetRect.width*t,this._targetRect.height*t),e.restore()},l.prototype.hitTest=function(e){var t=new n(this._targetRect.left,this._targetRect.top),i=t.add(new n(this._targetRect.width,this._targetRect.height));return s(e,o(t,i))?new a(a.REGULAR):null},e.exports=l},ltKl:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesApi",(function(){return a}));var r=i("Eyy1"),n=i("jRfx"),o=i("HGup"),s=i("/ToI"),a=function(){function e(e,t){this._series=e,this._model=t}return e.prototype.isUserEditEnabled=function(){return this._series.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._series.setUserEditEnabled(e)},e.prototype.mergeUp=function(){this._model.isMergeUpAvailableForSource(this._series)&&new n.c(this._model,this._series,"").redo()},e.prototype.mergeDown=function(){this._model.isMergeDownAvailableForSource(this._series)&&new n.a(this._model,this._series,"").redo()},e.prototype.unmergeUp=function(){this._model.isUnmergeAvailableForSource(this._series)&&new o.c(this._model,this._series,"").redo()},e.prototype.unmergeDown=function(){this._model.isUnmergeAvailableForSource(this._series)&&new o.a(this._model,this._series,"").redo()},e.prototype.detachToRight=function(){new s.b(this._model,this._series,this._pane(),"right","").redo()},e.prototype.detachToLeft=function(){new s.b(this._model,this._series,this._pane(),"left","").redo()},e.prototype.detachNoScale=function(){new s.b(this._model,this._series,this._pane(),"overlay","").redo()},e.prototype.changePriceScale=function(e){ var t=Object(r.ensureNotNull)(this._model.paneForSource(this._series));switch(e){case"new-left":new s.b(this._model,this._series,t,"left","").redo();break;case"new-right":new s.b(this._model,this._series,t,"right","").redo();break;case"no-scale":Object(r.assert)(t.actionNoScaleIsEnabled(this._series),"Unable to leave a pane without any non-overlay price scale"),new s.b(this._model,this._series,t,"overlay","").redo();break;default:var i=this._model.dataSourceForId(e);if(null===i)throw new Error("There is no study with entityId='"+e+"'");var n=this._model.paneForSource(i)===t;Object(r.assert)(n,"Study should be on the main pane");var o=Object(r.ensureNotNull)(i.priceScale());new s.a(this._model,this._series,t,o,"").redo()}},e.prototype.isVisible=function(){return this._series.properties().visible.value()},e.prototype.setVisible=function(e){this._series.properties().visible.setValue(e)},e.prototype.bringToFront=function(){this._model.bringToFront([this._series])},e.prototype.sendToBack=function(){this._model.sendToBack([this._series])},e.prototype.entityId=function(){return this._series.id()},e.prototype.chartStyleProperties=function(e){return this._series.properties().child(l(e)).state(["inputs","inputsInfo"])},e.prototype.setChartStyleProperties=function(e,t){this._series.properties().child(l(e)).mergeAndFire(t)},e.prototype.barsCount=function(){return this._series.bars().size()},e.prototype.isLoading=function(){return this._series.isLoading()},e.prototype._pane=function(){return Object(r.ensureNotNull)(this._model.paneForSource(this._series))},e}();function l(e){switch(e){case 0:return"barStyle";case 1:return"candleStyle";case 2:return"lineStyle";case 3:return"areaStyle";case 4:return"renkoStyle";case 5:return"kagiStyle";case 6:return"pnfStyle";case 7:return"pbStyle";case 8:return"haStyle";case 9:return"hollowCandleStyle";case 10:return"baselineStyle";case 11:return"rangeStyle";case 12:return"hiloStyle";default:Object(r.ensureNever)(e)}throw new Error("unsupported chart style: "+e)}},lxNp:function(e,t,i){"use strict";i.r(t);var r=i("/3z9"),n=i("d700"),o=i("hY0g"),s=i.n(o),a=function(){function e(){var e=this;this._groups=[],this._pressedKeys=new s.a(0),this._keyDownListener=function(t){if(!t.defaultPrevented){var i=Object(r.hashFromEvent)(t);if(e._pressedKeys.setValue(i),!Object(n.a)(i,t.target))for(var o=e._groups.length;o-- >0;){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(r.hashFromEvent)(t);e._pressedKeys.setValue(i)},this._blurEvent=function(){e._pressedKeys.setValue(0)},this._mouseEvent=function(t){var i=Object(r.modifiersFromEvent)(t),n=255&e._pressedKeys.value();e._pressedKeys.setValue(i|n)}}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("PC8g"),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 n=this._actions[i];if(n.hotkey===e&&((!n.element||t.target&&n.element.contains(t.target))&&!n.isDisabled()))return n.handler(t),t.preventDefault(),Object(l.trackEvent)("Keyboard Shortcuts",Object(r.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 r.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 r=i("tc+8"),n=i.n(r);function o(e){return new n.a(e)}},mE5r:function(e,t,i){"use strict";i.r(t);var r=i("mrSG"),n=i("Eyy1"),o=i("ikwP"),s=i("i1o5"),a=i("aO4+"),l=i("XlJ7"),c=i("EsvI"),u=i("OsWk"),h=i("rL76"),d=i("zDbI"),p=parseInt(h.labelheight),f=parseInt(h.bottommargin);function _(e){return e/11}var m=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(h.wrapper),this._element.classList.add(h.label),this._labelElement.className=h.symbol,this._element.appendChild(this._labelElement),this._gearElement.className=h.gear,this._gearElement.innerHTML=u,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=_(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(l.makeFont)(t.fontSize,d.CHART_FONT_FAMILY);e.fillStyle=c.themes[t.theme].getThemedColor("color-price-axis-label-back"),e.globalAlpha=.5,e.beginPath();var r=_(t.fontSize)*p/2,n=Object(a.point)(t.offset+t.width/2,t.height/2);e.arc(n.x,n.y,r,0,2*Math.PI,!0),e.fill(),e.globalAlpha=1,e.fillStyle=c.themes[t.theme].getThemedColor("color-price-axis-label-text"),e.textAlign="center",e.font=i,e.textBaseline="middle",e.fillText(this._info.label,n.x,n.y)}},e.prototype.setAxisNameInfo=function(e){this._info=e,null!==e&&(this._labelElement.textContent=e.label)},e.height=function(e){return(p+f)*e},e}(),y=i("aIyQ"),g=i.n(y),v=i("S8xo"),S=i("5VQP"),b=i("ljE9"),w={enableTooltip:!0,showLabels:!0,enableMenu:!0,enableHighlight:!0},P=function(){function e(e,t,i,n,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=n.rendererOptionsProvider,this._sourcesTitlesProvider=n.sourcesTitlesProvider,this._contextMenuItemsProvider=n.contextMenuItemsProvider,this._backgroundBasedTheme=n.backgroundBasedTheme,this._getBackgroundColor=n.getBackgroundColor,this._properties=t,this._axisInfo=i,this._labelOptions=Object(r.__assign)(Object(r.__assign)({},w),s),this._properties.lineColor.subscribe(this,this._onPropertyChanged),this._cell=document.createElement("div"),this._cell.classList.add(h["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 m,this._label.setAxisNameInfo(this._axisInfo),this._cell.appendChild(this._label.getElement()),this._labelOptions.enableTooltip&&Object(b.b)(this._cell,"text",(function(e){return a._tooltipContent()}))):this._label=null,this._mouseEventHandler=new v.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){null!==this._label&&"symbol"!==this._labelMode&&this._labelOptions.enableHighlight&&this._setHighlighted(!0)},e.prototype.mouseLeaveEvent=function(e){"symbol"!==this._labelMode&&this._setHighlighted(!1)},e.prototype.mouseClickEvent=function(e){var t=this;e.preventDefault(),null===this._fixedLabelMode&&"symbol"!==this._labelMode&&this._labelOptions.enableMenu&&this._labelOptions.showLabels?(this._fixedLabelMode=this._labelMode,this.setLabelMode("gear"),S.ContextMenuManager.createMenu(this._contextMenuItemsProvider(),{statName:"PriceScaleLabelContextMenu"},(function(){t.setLabelMode(Object(n.ensureNotNull)(t._fixedLabelMode)),t._fixedLabelMode=null})).then((function(e){return e.show((function(e,i){var r=t._cell.getBoundingClientRect();return{clientX:t._isLeft?r.left:r.right-e,clientY:r.top-Math.min(i,r.top),overrideHeight:r.top.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(l.makeFont)(t.fontSize,d.CHART_FONT_FAMILY);e.fillStyle=c.themes[t.theme].getThemedColor("color-price-axis-label-back"),e.globalAlpha=.5,e.beginPath();var r=_(t.fontSize)*p/2,n=Object(a.point)(t.offset+t.width/2,t.height/2);e.arc(n.x,n.y,r,0,2*Math.PI,!0),e.fill(),e.globalAlpha=1,e.fillStyle=c.themes[t.theme].getThemedColor("color-price-axis-label-text"),e.textAlign="center",e.font=i,e.textBaseline="middle",e.fillText(this._info.label,n.x,n.y)}},e.prototype.setAxisNameInfo=function(e){this._info=e,null!==e&&(this._labelElement.textContent=e.label)},e.height=function(e){return(p+f)*e},e}(),y=i("aIyQ"),g=i.n(y),v=i("S8xo"),b=i("5VQP"),S=i("ljE9"),w={enableTooltip:!0,showLabels:!0,enableMenu:!0,enableHighlight:!0},P=function(){function e(e,t,i,n,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=n.rendererOptionsProvider,this._sourcesTitlesProvider=n.sourcesTitlesProvider,this._contextMenuItemsProvider=n.contextMenuItemsProvider,this._backgroundBasedTheme=n.backgroundBasedTheme,this._getBackgroundColor=n.getBackgroundColor,this._properties=t,this._axisInfo=i,this._labelOptions=Object(r.__assign)(Object(r.__assign)({},w),s),this._properties.lineColor.subscribe(this,this._onPropertyChanged),this._cell=document.createElement("div"),this._cell.classList.add(h["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 m,this._label.setAxisNameInfo(this._axisInfo),this._cell.appendChild(this._label.getElement()),this._labelOptions.enableTooltip&&Object(S.b)(this._cell,"text",(function(e){return a._tooltipContent()}))):this._label=null,this._mouseEventHandler=new v.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){null!==this._label&&"symbol"!==this._labelMode&&this._labelOptions.enableHighlight&&this._setHighlighted(!0)},e.prototype.mouseLeaveEvent=function(e){"symbol"!==this._labelMode&&this._setHighlighted(!1)},e.prototype.mouseClickEvent=function(e){var t=this;e.preventDefault(),null===this._fixedLabelMode&&"symbol"!==this._labelMode&&this._labelOptions.enableMenu&&this._labelOptions.showLabels?(this._fixedLabelMode=this._labelMode,this.setLabelMode("gear"),b.ContextMenuManager.createMenu(this._contextMenuItemsProvider(),{statName:"PriceScaleLabelContextMenu"},(function(){t.setLabelMode(Object(n.ensureNotNull)(t._fixedLabelMode)),t._fixedLabelMode=null})).then((function(e){return e.show((function(e,i){var r=t._cell.getBoundingClientRect();return{clientX:t._isLeft?r.left:r.right-e,clientY:r.top-Math.min(i,r.top),overrideHeight:r.topthis._axises.length&&this._axises.lengthu;){var h=Object(n.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(C.a)(p._side,p._stubs.length):null,t=p._stubs.length,i=new P(p._side,p._stubProperties,e,p._stubParams(t),p._labelsOptions);i.onLabelHovered().subscribe(p,(function(t){o._labelsOptions.showLabels&&o._labelsOptions.enableHighlight&&o._onLabelHovered.fire(Object(n.ensureNotNull)(e),t)})),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,r=t.children,n=0;n1,"Unable to change pane's height if there is only one pane");var n=i.indexOf(this._pane);Object(r.assert)(-1!==n,"Invalid pane index");var o=new l(t,n,e);this._chartWidget.model().undoHistory().pushUndoCommand(o)},e.prototype.moveTo=function(e){var t=this.paneIndex();t!==e&&(Object(r.assert)(e>=0&&e1,"Unable to change pane's height if there is only one pane");var n=i.indexOf(this._pane);Object(r.assert)(-1!==n,"Invalid pane index");var o=new l(t,n,e);this._chartWidget.model().undoHistory().pushUndoCommand(o)},e.prototype.moveTo=function(e){var t=this.paneIndex();t!==e&&(Object(r.assert)(e>=0&&eM.MOVEPOINT_BACKGROUND;TradingView.isMobile.any()&&e.hittest&&e.hittest.result()===M.MOVEPOINT_BACKGROUND&&(n=!0),this._preventSourceChange&&(n=!1),i.selectionMacro((function(i){n?(t.control()||i.selection().isSelected(e.source)||i.clearSelection(),t.control()&&i.selection().isSelected(e.source)?(r=e.source,i.removeSourceFromSelection(e.source)):e.source instanceof w&&i.addSourceToSelection(e.source,e.hittest&&e.hittest.data()),i.selection().sources().length>1&&f("GUI","Multiselect","Click Select")):t.control()||i.clearSelection()}))}return r},z.prototype._tryStartChangingLineTool=function(e,t,i,r){if(null!==this._startTrackPoint)return!1;if(!this._preventSourceChange&&t.hittest&&t.source instanceof w&&t.hittest.result()===M.CHANGEPOINT){var n=this._chartUndoModel(),o=this._state.mainDataSource().firstValue(),s=t.source.priceScale().coordinateToPrice(e.localY,o);return n.selectionMacro((function(e){e.clearSelection(),e.addSourceToSelection(t.source)})),s=n.model().magnet().align(s,r,this._state),this._startChangeLineToolParams={source:t.source,startPoint:{index:r,price:s},screenPoint:{x:e.localX,y:e.localY},data:t.hittest.data().pointIndex,envState:i},!0}return this._startChangeLineToolParams=null,!1},z.prototype._tryHandleEraserMouseDown=function(e,t){if(e.source&&"eraser"===I.tool.value()&&(!(n=e.source)||!n.customization||!n.customization.disableErasing)){var i=this._chartUndoModel();if(e.source instanceof h||e.source instanceof o){var r=e.hittest.eraseMarker();return t.control()&&void 0!==r&&e.source.processErase?e.source.processErase(i,r):i.removeSource(e.source),!0}}var n;return!1},z.prototype._tryStartCloning=function(e,t,i,r){if(i.control()){var o=this._chartUndoModel().selection().sources().filter((function(e){return e.cloneable()}));if(r&&r.cloneable()&&o.push(r),o.length>0)return this._clonningAtMoveLineTools=o,this._startCloningPoint=new n(e.localX,e.localY),!0}return!1},z.prototype.mouseDownEvent=function(e){if(this._longTap=!1,this._contextMenuOpenedOnLastMouseDown=!1,this._exitTrackingModeOnNextTry=null!==this._startTrackPoint,this.hasState()){this._terminateActiveAnimations();var t=this._chart.trackingModePaneWidget();if(null!==t&&t!==this){var i=this._chartModel().crossHairSource().currentPoint();this._chart.exitTrackingMode(),this.startTrackingMode(new n(e.localX,e.localY),new n(i.x,e.localY),new g(e))} -document.activeElement!==document.body&&document.activeElement!==document.documentElement?document.activeElement&&document.activeElement.blur?document.activeElement.blur():document.body.focus():document.getSelection?document.getSelection().removeAllRanges():document.selection&&document.selection.clear(),k.emit("mouse_down",{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}),this._updateCommonTooltip(null);var o=this._chartUndoModel(),s=new g(e);o.mainSeries().clearGotoDateResult(),this.hideInplaceEditor();var a=this._state.defaultPriceScale();if(!a.isEmpty()&&!o.timeScale().isEmpty()){var l=o.crossHairSource();if(!TradingView.supportTouch()||"LineToolBrush"===I.tool.value()){var c=o.lineBeingCreated(),u=null!==c?o.paneForSource(c):null;null!==u&&u!==this._state?this._setCursorPositionOnExternalPane(u,e.localX,e.localY,s):this._setCursorPosition(e.localX,e.localY,s)}var d=this._state.mainDataSource().firstValue(),f=a.coordinateToPrice(e.localY,d),_=this._chartModel().timeScale().coordinateToIndex(e.localX);if(l.startMeasurePoint()&&l.endMeasurePoint()&&l.clearMeasure(),s.shift()&&I.toolIsCursor(I.tool.value())&&o.selection().isEmpty()&&I.tool.setValue("measure"),!(this._tryStartMeasure(e,l,s,f,_)||this._tryFinishMeasure(e,l)||this._tryFinishZoom(e)||this._tryStartZoom(e,f,_,s))){null!==this._startTrackPoint&&(this._initCrossHairPosition=l.currentPoint(),this._startTrackPoint=new n(e.localX,e.localY));var m=this._dataSourceAtPoint(e.localX,e.localY);if(TradingView.supportTouch()&&(this._preventSourceChange=null===m.source||!o.selection().isSelected(m.source)),this._isSelectBarModeEnabled()||this._isScrolling||!p(I.tool.value())&&!o.lineBeingCreated()){if(m.hittest&&m.hittest.result()===M.CUSTOM)(y=m.hittest.data().mouseDownHandler)&&y(e);if(!this._chart.readOnly()){var y;if(m&&m.hittest&&m.hittest.result()===M.CUSTOM_MOVE)if(y=m.hittest.data().pressedMouseMoveHandler)return void(m.isCustom?y(e):o.startCustomMoving(m.source,new n(e.localX,e.localY),y));var v=this._handleSelectionMouseDownAndGetJustDeselectedSource(m,s);if(this._tryHandleEraserMouseDown(m,s))return;var S=m.source&&TradingView.isInherited(m.source.constructor,h)&&m.source.isLocked();if(!(this._lockDrawingsProperty.value()||S)&&m&&!m.isCustom){if(m.source&&m.source.userEditEnabled&&!m.source.userEditEnabled())return;if(this._tryStartChangingLineTool(e,m,s,_))return;if(m.hittest&&this.checkMovepoint(m.hittest.result())){if(this._tryStartCloning(e,m,s,v))return;if(this._tryStartMovingLineTool(e,m,s,_))return}}if(m.source&&m.source instanceof b&&m.source.isDraggable())return void(this._chart.draggingSource=m.source)}m.hittest&&m.hittest.result()===M.REGULAR||(this._processing=!0)}else(!r.enabled("charting_library_base")||_>=0)&&(s.shift()||o.selectionMacro((function(e){e.clearSelection()})),this._mouseDownEventForLineTool(e,s,_,f))}}}},z.prototype.drawRightThere=function(e){if(p(e)){var t=this._chartUndoModel(),i=t.crossHairSource(),r=t.model().magnet().align(i.price,i.index,this._state) -;t.createLineTool(this.state(),{index:i.index,price:r},e)}},z.prototype._mouseDownEventForLineTool=function(e,t,i,r){if(this.hasState()){var o=this._chartUndoModel(),s=!1,a=null,l=e.localX,c=e.localY,u=o.model().crossHairSource(),h=I.tool.value();if(I.hideAllDrawings().setValue(!1),I.lockDrawings().setValue(!1),TradingView.supportTouch()&&p(h)&&"LineToolBrush"!==h&&!o.lineBeingCreated()&&(this._startTouchPoint=new n(l,c),this._initCrossHairPosition=u.currentPoint()),!o.lineBeingCreated()||o.lineBeingCreated()instanceof d){if(!TradingView.supportTouch()||"LineToolBrush"===h){var f={index:i,price:o.model().magnet().align(r,i,this._state)};a=o.createLineTool(this._state,f,h),o.lineBeingCreated()||(s=!0)}}else{var _=o.lineBeingCreated().ownerSource().firstValue();if(TradingView.supportTouch()){if(!this._startTouchPoint){this._startTouchPoint=new n(l,c);var m=o.lineBeingCreated().points(),y=m[m.length-1],g=o.timeScale().indexToCoordinate(y.index),v=(r=y.price,o.lineBeingCreated().priceScale().priceToCoordinate(r,_));return void(this._lastDrawingPoint=new n(g,v))}}else{a=o.lineBeingCreated();var S=o.paneForSource(a);if(S!==this._state){l=this._externalPaneXCoord(S,e.localX),c=this._externalPaneYCoord(S,e.localY),r=a.priceScale().coordinateToPrice(c,_),i=Math.round(o.timeScale().coordinateToIndex(l));s=o.coninueCreatingLine({index:i,price:r},t)}else r=o.model().magnet().align(r,i,this._state),s=o.coninueCreatingLine({index:i,price:r},t)}}a&&o.selectionMacro((function(e){e.addSourceToSelection(a)})),s&&(this._finishTool(a),e.preventDefault())}},z.prototype._equalsCursorCache=function(e,t){return I.toolIsCursor(e.tool)?e.tool===t.tool&&e.theme===t.theme&&e.crosshair===t.crosshair:e.tool===t.tool&&e.theme===t.theme},z.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)},z.prototype.setCursorForTool=function(e,t,i){var r=I.tool.value();if(t&&t.control()&&e)this._setCursorClassName("pointer");else if(void 0===i){if(I.toolIsCursor(r)){if(this._chart.draggingSource||this._isScrolling||this._chartUndoModel()&&this._chartUndoModel().sourcesBeingMoved().length)return void this._setCursorClassName("grabbing");if(e&&this._options.sourceSelectionEnabled)return void this._setCursorClassName("pointer")}if("eraser"!==r)if("zoom"!==r){var n=I.cursorTool.value();"dot"!==n?"arrow"!==n?this._setCursorClassName(""):this._setCursorClassName("default"):this._setCursorClassName("dot")}else this._setCursorClassName("zoom-in");else this._setCursorClassName("eraser")}else switch(i){case R.VerticalResize:this._setCursorClassName("ns-resize");break;case R.HorizontalResize:this._setCursorClassName("ew-resize");break;case R.Default:this._setCursorClassName("default");break;case R.Pointer:this._setCursorClassName("pointer")}},z.prototype.setDragToAnotherPaneCursor=function(){this._setCursorClassName("grabbing")}, +document.activeElement!==document.body&&document.activeElement!==document.documentElement?document.activeElement&&document.activeElement.blur?document.activeElement.blur():document.body.focus():document.getSelection?document.getSelection().removeAllRanges():document.selection&&document.selection.clear(),k.emit("mouse_down",{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}),this._updateCommonTooltip(null);var o=this._chartUndoModel(),s=new g(e);o.mainSeries().clearGotoDateResult(),this.hideInplaceEditor();var a=this._state.defaultPriceScale();if(!a.isEmpty()&&!o.timeScale().isEmpty()){var l=o.crossHairSource();if(!TradingView.supportTouch()||"LineToolBrush"===I.tool.value()){var c=o.lineBeingCreated(),u=null!==c?o.paneForSource(c):null;null!==u&&u!==this._state?this._setCursorPositionOnExternalPane(u,e.localX,e.localY,s):this._setCursorPosition(e.localX,e.localY,s)}var d=this._state.mainDataSource().firstValue(),f=a.coordinateToPrice(e.localY,d),_=this._chartModel().timeScale().coordinateToIndex(e.localX);if(l.startMeasurePoint()&&l.endMeasurePoint()&&l.clearMeasure(),s.shift()&&I.toolIsCursor(I.tool.value())&&o.selection().isEmpty()&&I.tool.setValue("measure"),!(this._tryStartMeasure(e,l,s,f,_)||this._tryFinishMeasure(e,l)||this._tryFinishZoom(e)||this._tryStartZoom(e,f,_,s))){null!==this._startTrackPoint&&(this._initCrossHairPosition=l.currentPoint(),this._startTrackPoint=new n(e.localX,e.localY));var m=this._dataSourceAtPoint(e.localX,e.localY);if(TradingView.supportTouch()&&(this._preventSourceChange=null===m.source||!o.selection().isSelected(m.source)),this._isSelectBarModeEnabled()||this._isScrolling||!p(I.tool.value())&&!o.lineBeingCreated()){if(m.hittest&&m.hittest.result()===M.CUSTOM)(y=m.hittest.data().mouseDownHandler)&&y(e);if(!this._chart.readOnly()){var y;if(m&&m.hittest&&m.hittest.result()===M.CUSTOM_MOVE)if(y=m.hittest.data().pressedMouseMoveHandler)return void(m.isCustom?y(e):o.startCustomMoving(m.source,new n(e.localX,e.localY),y));var v=this._handleSelectionMouseDownAndGetJustDeselectedSource(m,s);if(this._tryHandleEraserMouseDown(m,s))return;var b=m.source&&TradingView.isInherited(m.source.constructor,h)&&m.source.isLocked();if(!(this._lockDrawingsProperty.value()||b)&&m&&!m.isCustom){if(m.source&&m.source.userEditEnabled&&!m.source.userEditEnabled())return;if(this._tryStartChangingLineTool(e,m,s,_))return;if(m.hittest&&this.checkMovepoint(m.hittest.result())){if(this._tryStartCloning(e,m,s,v))return;if(this._tryStartMovingLineTool(e,m,s,_))return}}if(m.source&&m.source instanceof S&&m.source.isDraggable())return void(this._chart.draggingSource=m.source)}m.hittest&&m.hittest.result()===M.REGULAR||(this._processing=!0)}else(!r.enabled("charting_library_base")||_>=0)&&(s.shift()||o.selectionMacro((function(e){e.clearSelection()})),this._mouseDownEventForLineTool(e,s,_,f))}}}},z.prototype.drawRightThere=function(e){if(p(e)){var t=this._chartUndoModel(),i=t.crossHairSource(),r=t.model().magnet().align(i.price,i.index,this._state) +;t.createLineTool(this.state(),{index:i.index,price:r},e)}},z.prototype._mouseDownEventForLineTool=function(e,t,i,r){if(this.hasState()){var o=this._chartUndoModel(),s=!1,a=null,l=e.localX,c=e.localY,u=o.model().crossHairSource(),h=I.tool.value();if(I.hideAllDrawings().setValue(!1),I.lockDrawings().setValue(!1),TradingView.supportTouch()&&p(h)&&"LineToolBrush"!==h&&!o.lineBeingCreated()&&(this._startTouchPoint=new n(l,c),this._initCrossHairPosition=u.currentPoint()),!o.lineBeingCreated()||o.lineBeingCreated()instanceof d){if(!TradingView.supportTouch()||"LineToolBrush"===h){var f={index:i,price:o.model().magnet().align(r,i,this._state)};a=o.createLineTool(this._state,f,h),o.lineBeingCreated()||(s=!0)}}else{var _=o.lineBeingCreated().ownerSource().firstValue();if(TradingView.supportTouch()){if(!this._startTouchPoint){this._startTouchPoint=new n(l,c);var m=o.lineBeingCreated().points(),y=m[m.length-1],g=o.timeScale().indexToCoordinate(y.index),v=(r=y.price,o.lineBeingCreated().priceScale().priceToCoordinate(r,_));return void(this._lastDrawingPoint=new n(g,v))}}else{a=o.lineBeingCreated();var b=o.paneForSource(a);if(b!==this._state){l=this._externalPaneXCoord(b,e.localX),c=this._externalPaneYCoord(b,e.localY),r=a.priceScale().coordinateToPrice(c,_),i=Math.round(o.timeScale().coordinateToIndex(l));s=o.coninueCreatingLine({index:i,price:r},t)}else r=o.model().magnet().align(r,i,this._state),s=o.coninueCreatingLine({index:i,price:r},t)}}a&&o.selectionMacro((function(e){e.addSourceToSelection(a)})),s&&(this._finishTool(a),e.preventDefault())}},z.prototype._equalsCursorCache=function(e,t){return I.toolIsCursor(e.tool)?e.tool===t.tool&&e.theme===t.theme&&e.crosshair===t.crosshair:e.tool===t.tool&&e.theme===t.theme},z.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)},z.prototype.setCursorForTool=function(e,t,i){var r=I.tool.value();if(t&&t.control()&&e)this._setCursorClassName("pointer");else if(void 0===i){if(I.toolIsCursor(r)){if(this._chart.draggingSource||this._isScrolling||this._chartUndoModel()&&this._chartUndoModel().sourcesBeingMoved().length)return void this._setCursorClassName("grabbing");if(e&&this._options.sourceSelectionEnabled)return void this._setCursorClassName("pointer")}if("eraser"!==r)if("zoom"!==r){var n=I.cursorTool.value();"dot"!==n?"arrow"!==n?this._setCursorClassName(""):this._setCursorClassName("default"):this._setCursorClassName("dot")}else this._setCursorClassName("zoom-in");else this._setCursorClassName("eraser")}else switch(i){case R.VerticalResize:this._setCursorClassName("ns-resize");break;case R.HorizontalResize:this._setCursorClassName("ew-resize");break;case R.Default:this._setCursorClassName("default");break;case R.Pointer:this._setCursorClassName("pointer")}},z.prototype.setDragToAnotherPaneCursor=function(){this._setCursorClassName("grabbing")}, z.prototype._updateCommonTooltip=function(e){var t=this._lastCommonTooltipData,i=null;if(e&&e.hittest){var r=e.hittest.data();r&&(i=r.tooltip||null)}if(null!=t||null!=i){if(null==i||""===i.text)return this._lastCommonTooltipData=null,void B.hide();if(!t||i.text!==t.text||i.rect.x!==t.rect.x||i.rect.y!==t.rect.y||i.rect.w!==t.rect.w||i.rect.h!==t.rect.h){this._lastCommonTooltipData=i;var n=TradingView.clone(i),o=this._paneCell.getBoundingClientRect();n.rect.x+=o.left,n.rect.y+=o.top,B.show(n)}}},z.prototype._processMouseMoveForCustomHandler=function(e,t){var i=e.hittest&&e.hittest.result()===M.CUSTOM;if(i&&(null===this._prevHoveredHittest||this._prevHoveredHittest.renderer!==e.renderer)){var r=e.hittest.data().mouseEnterHandler;r&&r(t),this._prevHoveredHittest=e}if(i){var n=e.hittest.data().mouseMoveHandler;n&&n(t)}if(null!==this._prevHoveredHittest&&this._prevHoveredHittest.renderer!==e.renderer){var o=this._prevHoveredHittest.hittest.data().mouseLeaveHandler;o&&o(t),this._prevHoveredHittest=null}},z.prototype.mouseMoveEvent=function(e){if(this.hasState()){var t=this._dataSourceAtPoint(e.localX,e.localY);this._processMouseMoveForCustomHandler(t,e);var i=this._chartUndoModel();if(i){var r=e.localX,n=e.localY,o=new g(e);if(null===this._firstZoomPoint){var s=!1;if(!(this._chart.readOnly()||this._editDialog&&this._editDialog.isVisible())){var l=I.tool.value(),c=null;if(!this._processing&&(I.toolIsCursor(l)||"eraser"===l||o.control()||!i.lineBeingCreated())){var u=t&&t.source;s=!!u&&-1!==W.indexOf(u.toolname),t.hittest&&t.hittest.result()>M.MOVEPOINT_BACKGROUND?(c=t.source,t.source&&a(t.source)&&("eraser"!==l||t.source.constructor!==TradingView.Series)?i.setHoveredSource(t.source,t.hittest.data()):i.setHoveredSource(null)):i.setHoveredSource(null)}if(this._options.sourceSelectionEnabled)if(this._isSelectBarModeEnabled())this._setCursorClassName("pointer");else{var h=t.hittest&&t.hittest.data()&&t.hittest.data().cursorType;this.setCursorForTool(c,o,null===h?void 0:h)}if(this._updateCommonTooltip(t),null!==t&&null!==t.hittest&&t.hittest.result()===M.CUSTOM_MOVE)switch(h=(t.hittest.data()||{}).cursorType){case R.VerticalResize:this._setCursorClassName("ns-resize")}}if(this._preventCrossHairMove()&&this._clearCursorPosition(),i.crossHairSource().setLinesShouldBeHidden(s),this._chart.readOnly()&&this._options.sourceSelectionEnabled&&(null!==t.source&&a(t.source)?i.setHoveredSource(t.source,t.hittest.data()):i.setHoveredSource(null,null)),i.lineBeingCreated()){var d=i.lineBeingCreated(),p=i.paneForSource(d);if(p!==this._state)return void this._setCursorPositionOnExternalPane(p,r,n,o)}l=I.tool.value();TradingView.supportTouch()||this._setCursorPosition(r,n,o)}else this._processMouseMoveWhileZoom(e,o)}}},z.prototype._startChangeOrMoveLineToolIfNeeded=function(){if(null!==this._startChangeLineToolParams){var e=this._startChangeLineToolParams;this._chartUndoModel().startChangingLinetool(e.source,e.startPoint,e.data,e.envState)}if(null!==this._startMoveLineToolParams){e=this._startMoveLineToolParams -;this._chartUndoModel().startMovingSources(e.source,e.startPoint,e.data,e.envState)}this._startMoveLineToolParams=null,this._startChangeLineToolParams=null},z.prototype.pressedMouseMoveEvent=function(e){if(this.hasState()&&!this._pinching){this._startChangeOrMoveLineToolIfNeeded(),this._touchMove=!0,this._preventSourceChange=!1;var t=new g(e),i=this._chartUndoModel(),o=i.crossHairSource(),s=e.localX,a=e.localY;if(null!==this._firstZoomPoint)return this._processMouseMoveWhileZoom(e),void(this._firstZoomPoint.draggingMode=!0);if(!TradingView.supportTouch()&&"touchmove"!==e.type||!o.startMeasurePoint()){var l=I.tool.value();if(TradingView.supportTouch()&&this._startTouchPoint&&p(l)&&"LineToolBrush"!==l&&!i.lineBeingCreated()&&!this._isSelectBarModeEnabled()){this._chart.justActivated()&&(this._initCrossHairPosition=o.currentPoint());var c=this._initCrossHairPosition,u=new n(s,a).subtract(this._startTouchPoint),h=c.add(u);this._setCursorPosition(h.x,h.y,t)}else if(!TradingView.supportTouch()||!i.lineBeingCreated()||i.lineBeingCreated()instanceof d){if(null!==this._startTrackPoint){this._exitTrackingModeOnNextTry=!1;c=this._initCrossHairPosition,u=new n(s,a).subtract(this._startTrackPoint),h=c.add(u);this._setCursorPosition(h.x,h.y,t)}else this._preventCrossHairMove()||this._setCursorPosition(s,a,t);var f=I.tool.value(),_=this._isSelectBarModeEnabled();if(!p(f)||"LineToolBrush"===l||_||t.control()){if("LineToolBrush"===f&&!_){if((A=this._state.defaultPriceScale()).isEmpty())return;var m=i.lineBeingCreated();if(!m)return;var y=new n(e.localX,e.localY),v=m.ownerSource().firstValue();return y.price=A.coordinateToPrice(e.localY,v),y.index=Math.round(i.timeScale().coordinateToIndex(e.localX)),void((!r.enabled("charting_library_base")||y.index>=0)&&i.coninueCreatingLine(y))}if(this._chart.draggingSource){var S=e.target,b=this._chart.paneByCanvas(S);b&&(b!==this?b.setDragToAnotherPaneCursor():b.setCursorForTool());var w=this._chart.timeAxisByCanvas(S);w&&w.setCursor("grabbing")}if(!i.timeScale().isEmpty()){var P=this._options.handleScroll;if(P.pressedMouseMove&&"touch"!==e.type||(P.horzTouchDrag||P.vertTouchDrag)&&"mouse"!==e.type)if(i.customMoveBeingProcessed())i.processCustomMove(new n(s,a));else{if(i.lineBeingEdited()){var C=Math.round(i.timeScale().coordinateToIndex(s));return(!r.enabled("charting_library_base")||C>=0)&&i.changeLinePoint({x:s,y:a},t),void this.setCursorForTool()}var x=this;if(i.sourcesBeingMoved().length)i.sourcesBeingMoved().forEach((function(o){var l=o.priceScale();if(!l.isEmpty()){var c=(o.ownerSource()||x._state.mainDataSource()).firstValue(),u=i.timeScale().coordinateToIndex(e.localX),h=l.coordinateToPrice(e.localY,c);if(x.setCursorForTool(),r.enabled("charting_library_base"))if(i.sourcesBeingMoved().some((function(e){return!e.onlyYMoving()}))){var d=o.points();if(0!==d.length)if(d.reduce((function(e,t){return t.index=0)&&i.coninueCreatingLine(y))}if(this._chart.draggingSource){var b=e.target,S=this._chart.paneByCanvas(b);S&&(S!==this?S.setDragToAnotherPaneCursor():S.setCursorForTool());var w=this._chart.timeAxisByCanvas(b);w&&w.setCursor("grabbing")}if(!i.timeScale().isEmpty()){var P=this._options.handleScroll;if(P.pressedMouseMove&&"touch"!==e.type||(P.horzTouchDrag||P.vertTouchDrag)&&"mouse"!==e.type)if(i.customMoveBeingProcessed())i.processCustomMove(new n(s,a));else{if(i.lineBeingEdited()){var C=Math.round(i.timeScale().coordinateToIndex(s));return(!r.enabled("charting_library_base")||C>=0)&&i.changeLinePoint({x:s,y:a},t),void this.setCursorForTool()}var x=this;if(i.sourcesBeingMoved().length)i.sourcesBeingMoved().forEach((function(o){var l=o.priceScale();if(!l.isEmpty()){var c=(o.ownerSource()||x._state.mainDataSource()).firstValue(),u=i.timeScale().coordinateToIndex(e.localX),h=l.coordinateToPrice(e.localY,c);if(x.setCursorForTool(),r.enabled("charting_library_base"))if(i.sourcesBeingMoved().some((function(e){return!e.onlyYMoving()}))){var d=o.points();if(0!==d.length)if(d.reduce((function(e,t){return t.index8){var L=this._clonningAtMoveLineTools,M=this.cloneLineTools(L,!0).map((function(e){return i.model().dataSourceForId(e)}));i.selectionMacro((function(e){e.clearSelection(),M.forEach((function(t){e.addSourceToSelection(t)}))}));var O=new n(e.localX,e.localY),A=M[0].priceScale(),k=(v=this._state.mainDataSource().firstValue(),{index:i.timeScale().coordinateToIndex(e.localX),price:A.coordinateToPrice(e.localY,v)});i.startMovingSources(M,{logical:k,screen:O},t),this._clonningAtMoveLineTools=null,this._startCloningPoint=null}}else{var E=I.toolIsMeasure(f)||o.startMeasurePoint()&&o.endMeasurePoint();this._chart.readOnly()||!t.control()||p(f)||E?(this._processScroll(e),this._preventScroll()&&!this._preventCrossHairMove()&&null===this._startTrackPoint&&this._setCursorPosition(e.localX,e.localY,new g(e))):this._isSelecting||(o.startSelection(this._state),this._isSelecting=!0)}}}}}else if(this._startTouchPoint){var D=i.lineBeingCreated(),V=i.paneForSource(D);if(V!==this._state)return void this._setCursorPositionOnExternalPane(V,e.localX,e.localY,t);var B=e.localX-this._startTouchPoint.x,R=e.localY-this._startTouchPoint.y,N=this._lastDrawingPoint.x+B,F=this._lastDrawingPoint.y+R;this._setCursorPosition(N,F,t)}}else this._setCursorPosition(s,a,t)}},z.prototype._processMouseUpForCustomHandler=function(e){var t=this._dataSourceAtPoint(e.localX,e.localY);if(t.hittest&&t.hittest.result()===M.CUSTOM){var i=t.hittest.data().mouseUpHandler;i&&i(e)}},z.prototype.mouseUpEvent=function(e){if(this.hasState()){var t=null!==this._startTrackPoint,i=this._wasPinched;this._wasPinched=!1,this._longTap=!1,this._startMoveLineToolParams=null,this._startChangeLineToolParams=null,this._processMouseUpForCustomHandler(e),this._clonningAtMoveLineTools=null;var r=this;delete this._isSelecting;var n=this._chartUndoModel(),o=n.model().crossHairSource();if(o.selection()&&null===this._firstZoomPoint){var s=this._state.lineToolsForArea(o.selection());n.selectionMacro((function(e){s.forEach((function(t){e.addSourceToSelection(t)}))})),o.clearSelection(),f("GUI","Multiselect","Area Select")}k.emit("mouse_up",{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY});var a=this._touchMove;delete this._touchMove;var l=new g(e),c=I.tool.value();if(TradingView.supportTouch()&&!a&&"LineToolBrush"!==c&&p(c)&&!n.lineBeingCreated()){if(this._chart.justActivated())return;if(o.pane!==this._state)return void this._setCursorPosition(e.localX,e.localY,l);var u=o.currentPoint(),h=this._state.defaultPriceScale(),_=this._state.mainDataSource().firstValue(),m=h.coordinateToPrice(u.y,_),y={index:R=Math.round(n.timeScale().coordinateToIndex(u.x)),price:m},v=n.createLineTool(this._state,y,c);return n.selectionMacro((function(e){e.addSourceToSelection(v)})),n.lineBeingCreated()||(this._finishTool(v),e.preventDefault()),void delete this._startTouchPoint} -if(!n.lineBeingCreated()||n.lineBeingCreated()instanceof d||!this._startTouchPoint){if(null!==this._firstZoomPoint&&this._firstZoomPoint.draggingMode)this._finishZoom(e);else if(!TradingView.supportTouch()&&"touchend"!==e.type||!this._tryFinishMeasure(e,o)){if(this._processing=!1,n.customMoveBeingProcessed()&&n.endCustomMoving(),n.lineBeingEdited())return n.endChangingLinetool(),void(this._preventCrossHairMove()&&this._clearCursorPosition());if("LineToolBrush"!==c||this._isSelectBarModeEnabled()){if(n.sourcesBeingMoved().length)return n.endMovingSource(),n.sourcesBeingMoved().forEach((function(e){r.setCursorForTool(e)})),void n.invalidate(O.cursor());if(!this._chart.readOnly()){var S=this._dataSourceAtPoint(e.localX,e.localY),b=e.localX>=0&&e.localXM.MOVEPOINT_BACKGROUND||TradingView.isMobile.any())&&n.selectionMacro((function(e){e.clearSelection(),e.addSourceToSelection(S.source)}));delete this._touchMove}else{var B=n.lineBeingCreated();if(null!==B&&F(B),n.finishLineTool(),(h=this._state.defaultPriceScale()).isEmpty())return;if(!B)return;_=B.ownerSource().firstValue(),m=h.coordinateToPrice(e.localY,_);var R=Math.round(n.timeScale().coordinateToIndex(e.localX));n.coninueCreatingLine({index:R,price:m})}}}else{var N=!1;if(delete this._startTouchPoint,!a){var j=(v=n.lineBeingCreated()).points()[v.points().length-1],m=j.price;N=n.coninueCreatingLine({index:j.index,price:m},new g(e)),delete this._lastDrawingPoint}N&&(this._finishTool(v),e.preventDefault())}}},z.prototype.mouseLeaveEvent=function(e){if(this.hasState()){var t=this._chartUndoModel();if(t){if(TradingView.isMobile.any()||this._clearCursorPosition(),t.setHoveredSource(null),null!==this._prevHoveredHittest){var i=this._prevHoveredHittest.hittest.data().mouseLeaveHandler;i&&i(e),this._prevHoveredHittest=null}this._updateCommonTooltip(null),"function"==typeof this.onMouseLeave&&this.onMouseLeave(this)}}},z.prototype.showEditDialogForSource=function(e){if(this._options.propertyPagesEnabled&&(!e.userEditEnabled||e.userEditEnabled()))if(e===this._chartUndoModel().mainSeries())this._chart.showGeneralChartProperties(_.style);else{ +if(!n.lineBeingCreated()||n.lineBeingCreated()instanceof d||!this._startTouchPoint){if(null!==this._firstZoomPoint&&this._firstZoomPoint.draggingMode)this._finishZoom(e);else if(!TradingView.supportTouch()&&"touchend"!==e.type||!this._tryFinishMeasure(e,o)){if(this._processing=!1,n.customMoveBeingProcessed()&&n.endCustomMoving(),n.lineBeingEdited())return n.endChangingLinetool(),void(this._preventCrossHairMove()&&this._clearCursorPosition());if("LineToolBrush"!==c||this._isSelectBarModeEnabled()){if(n.sourcesBeingMoved().length)return n.endMovingSource(),n.sourcesBeingMoved().forEach((function(e){r.setCursorForTool(e)})),void n.invalidate(O.cursor());if(!this._chart.readOnly()){var b=this._dataSourceAtPoint(e.localX,e.localY),S=e.localX>=0&&e.localXM.MOVEPOINT_BACKGROUND||TradingView.isMobile.any())&&n.selectionMacro((function(e){e.clearSelection(),e.addSourceToSelection(b.source)}));delete this._touchMove}else{var B=n.lineBeingCreated();if(null!==B&&F(B),n.finishLineTool(),(h=this._state.defaultPriceScale()).isEmpty())return;if(!B)return;_=B.ownerSource().firstValue(),m=h.coordinateToPrice(e.localY,_);var R=Math.round(n.timeScale().coordinateToIndex(e.localX));n.coninueCreatingLine({index:R,price:m})}}}else{var N=!1;if(delete this._startTouchPoint,!a){var j=(v=n.lineBeingCreated()).points()[v.points().length-1],m=j.price;N=n.coninueCreatingLine({index:j.index,price:m},new g(e)),delete this._lastDrawingPoint}N&&(this._finishTool(v),e.preventDefault())}}},z.prototype.mouseLeaveEvent=function(e){if(this.hasState()){var t=this._chartUndoModel();if(t){if(TradingView.isMobile.any()||this._clearCursorPosition(),t.setHoveredSource(null),null!==this._prevHoveredHittest){var i=this._prevHoveredHittest.hittest.data().mouseLeaveHandler;i&&i(e),this._prevHoveredHittest=null}this._updateCommonTooltip(null),"function"==typeof this.onMouseLeave&&this.onMouseLeave(this)}}},z.prototype.showEditDialogForSource=function(e){if(this._options.propertyPagesEnabled&&(!e.userEditEnabled||e.userEditEnabled()))if(e===this._chartUndoModel().mainSeries())this._chart.showGeneralChartProperties(_.style);else{ var t=this;this._chart.showChartPropertiesForSource(e).then((function(e){t._editDialog=e}))}},z.prototype.processDoubleClickOnSource=function(e){this.showEditDialogForSource(e)},z.prototype.mouseDoubleClickEvent=function(e){if(this.hasState()){var t=!this._chart.readOnly()&&!p(I.tool.value())&&this._dataSourceAtPoint(e.localX,e.localY),i=t&&t.hittest&&t.source;if(i&&t.hittest.result()<=M.MOVEPOINT_BACKGROUND&&!TradingView.isMobile.any()&&(i=null),i&&!a(i)&&(i=null),t.isCustom){if(t.hittest.result()===M.CUSTOM){var r=t.hittest.data().mouseDoubleClickHandler;void 0!==r&&r(e)}}else i?this.processDoubleClickOnSource(i):this._chart.readOnly()||p(I.tool.value())||this._chartUndoModel().lineBeingCreated()||!this._chartUndoModel().selection().isEmpty()||this._chart.toggleMaximizePane(this)}},z.prototype.longTapEvent=function(e){this._longTap=!0,null===this._startTrackPoint&&this._trackingModeShouldBeActive()&&this.startTrackingMode(new n(e.localX,e.localY),new n(e.localX,e.localY),new g(e))},z.prototype.startTrackingMode=function(e,t,i){this._startChangeLineToolParams=null,this._startMoveLineToolParams=null,this._chartUndoModel().selectionMacro((function(e){e.clearSelection()})),this._startTrackPoint=e,this._exitTrackingModeOnNextTry=!1,this._setCursorPosition(t.x,t.y,i),this._initCrossHairPosition=this._chartModel().crossHairSource().currentPoint()},z.prototype.contextMenuEvent=function(e){var t=this._chartUndoModel();if(!t.crossHairSource().startMeasurePoint()||j){if(!this._pinching&&(null===this._firstZoomPoint||j||this.cancelZoom(),!this.hideInplaceEditor())){if(!I.toolIsCursor(I.tool.value())&&!this._isSelectBarModeEnabled()){if(TradingView.isMobile.any())return;return I.resetToCursor(!0),this.setCursorForTool(),void(t.lineBeingCreated()&&t.cancelCreatingLine())}if(this._options.contextMenuEnabled){var i=this._dataSourceAtPoint(e.localX,e.localY),r=i?i.source:null;if(null!==this._startTrackPoint){if(this._preventSourceChange)return;this._clearCursorPosition()}this._contextMenuOpenedOnLastMouseDown=!0,this._contextMenuX=e.localX,this._contextMenuY=e.localY;var n=i&&i.hittest?i.hittest.result():0,o=n>=M.REGULAR||n>=M.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any();if(i.isCustom){if(o&&i.hittest.result()===M.CUSTOM){var s=i.hittest.data().contextMenuHandler;void 0!==s&&s(e)}}else{this._chart.updateActions();var l=!1,c=this;t.selectionMacro((function(t){null!==r&&o?(!t.selection().isSelected(r)&&r instanceof w&&(t.clearSelection(),t.addSourceToSelection(r)),l=r.hasContextMenu()):(c._options.contextMenu.general&&c._contextMenu(e).then((function(t){t.show(e)})),t.clearSelection())})),l&&(a(r)?c.showContextMenuForSelection(e):c.showContextMenuForSources([r],e)),this.paint()}}}}else t.crossHairSource().clearMeasure()},z.prototype._contextMenu=function(e){function t(e){return e instanceof x}var i=this._initActions(e),r=this._customActions();i=i.filter((function(e){return null!==e})),r.remove.forEach((function(e){for(var t=0;t0;o--)t(n[o])&&t(n[o-1])&&n.splice(o,1);return n.length&&t(n[0])&&n.splice(0,1),n.length&&t(n[n.length-1])&&n.splice(n.length-1,1),L.createMenu(n,{statName:"ChartContextMenu"})},z.prototype.createRemoveMenu=function(){var e=this._chart.actions();return new C({label:window.t("Remove"),statName:"Remove",subItems:[e.paneRemoveAllStudies,e.paneRemoveAllDrawingTools,e.paneRemoveAllStudiesDrawingTools]})},z.prototype._initActions=function(e){var t=this,i=this._chart.actions(),n=[];if(r.enabled("datasource_copypaste")){var o=V.get(),s=((o||{}).sources||[]).filter((function(e){return"study"===e.type||"drawing"===e.type}));if(o&&s.length){var a=new C({label:window.t("Paste %s").replace("%s",window.t(o.title||o.type)),shortcutHint:T.humanReadableHash(T.Modifiers.Mod+86),statName:"Paste",onExecute:function(){t._chart.onAppClipboardPaste(t.state())}});n.push(a)}}return n.length&&n.push(new x),n.push(i.chartReset),n.push(new x),n[n.length-1]instanceof x||n.push(new x),window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist)&&i.addToWatchlist&&n.push(i.addToWatchlist),r.enabled("text_notes")&&n.push(i.addToTextNotes),n[n.length-1]instanceof x||n.push(new x),n.push(this._createLockTimeAxisAction(e)),n.push(new x),r.enabled("charting_library_base")||n.push(i.applyColorTheme),n[n.length-1]instanceof x||n.push(new x),this._chart.applyIndicatorsToAllChartsAvailable()&&(n.push(i.applyStudiesToAllCharts),n.push(new x)),n.push(i.paneRemoveAllDrawingTools),n.push(i.paneRemoveAllStudies),n.push(new x),pro.hasPackage("mtp-mtpredictor")&&this.state().containsMainSeries()&&n.push(S(this._chart,this._state,this._contextMenuX,this._contextMenuY),new x),n.push(i.hideAllMarks),n.push(new x),r.enabled("show_chart_property_page")&&n.push(i.chartProperties),n[n.length-1]instanceof x&&n.pop(),n},z.prototype._customActions=function(){var e={top:[],bottom:[],remove:[]},t=this._chartUndoModel().timeScale(),i=this._state&&this._state.defaultPriceScale();if(!r.enabled("custom_items_in_context_menu"))return e;var n,o=t.isEmpty()?void 0:t.indexToUserTime(t.coordinateToIndex(this._contextMenuX));if(i&&!i.isEmpty()){var s=this._state.mainDataSource().firstValue();n=i.coordinateToPrice(this._contextMenuY,s)}return k.emit("onContextMenu",{unixtime:o?o/1e3:void 0,price:n,callback:function(t){[].concat(t).forEach((function(t){var i;t.text&&(t.text.length>1&&"-"===t.text[0]?e.remove.push(t.text.slice(1)):(i="-"===t.text?new x:new C({label:t.text,onExecute:t.click}),t.position&&"top"===t.position?e.top.push(i):e.bottom.push(i)))}))}}),e},z.prototype._timeAxisMenu=function(){if(this._chartUndoModel().timeScale().isEmpty())return null;var e=this._chart.getTimeScale();return new C({label:window.t("Time Scale"),subItems:e.getContextMenuActions(),statName:"TimeScale"})},z.prototype.toggleLockTimeAxis=function(e,t){if("boolean"!=typeof t&&(t=!I.lockTimeAxis().value()),t){var i=this._chartUndoModel().timeScale(),r=i.coordinateToIndex(e),n=i.points().roughTime(r) +;for(var n=r.top.concat(i).concat(r.bottom),o=n.length-1;o>0;o--)t(n[o])&&t(n[o-1])&&n.splice(o,1);return n.length&&t(n[0])&&n.splice(0,1),n.length&&t(n[n.length-1])&&n.splice(n.length-1,1),L.createMenu(n,{statName:"ChartContextMenu"})},z.prototype.createRemoveMenu=function(){var e=this._chart.actions();return new C({label:window.t("Remove"),statName:"Remove",subItems:[e.paneRemoveAllStudies,e.paneRemoveAllDrawingTools,e.paneRemoveAllStudiesDrawingTools]})},z.prototype._initActions=function(e){var t=this,i=this._chart.actions(),n=[];if(r.enabled("datasource_copypaste")){var o=V.get(),s=((o||{}).sources||[]).filter((function(e){return"study"===e.type||"drawing"===e.type}));if(o&&s.length){var a=new C({label:window.t("Paste %s").replace("%s",window.t(o.title||o.type)),shortcutHint:T.humanReadableHash(T.Modifiers.Mod+86),statName:"Paste",onExecute:function(){t._chart.onAppClipboardPaste(t.state())}});n.push(a)}}return n.length&&n.push(new x),n.push(i.chartReset),n.push(new x),n[n.length-1]instanceof x||n.push(new x),window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist)&&i.addToWatchlist&&n.push(i.addToWatchlist),r.enabled("text_notes")&&n.push(i.addToTextNotes),n[n.length-1]instanceof x||n.push(new x),n.push(this._createLockTimeAxisAction(e)),n.push(new x),r.enabled("charting_library_base")||n.push(i.applyColorTheme),n[n.length-1]instanceof x||n.push(new x),this._chart.applyIndicatorsToAllChartsAvailable()&&(n.push(i.applyStudiesToAllCharts),n.push(new x)),n.push(i.paneRemoveAllDrawingTools),n.push(i.paneRemoveAllStudies),n.push(new x),pro.hasPackage("mtp-mtpredictor")&&this.state().containsMainSeries()&&n.push(b(this._chart,this._state,this._contextMenuX,this._contextMenuY),new x),n.push(i.hideAllMarks),n.push(new x),r.enabled("show_chart_property_page")&&n.push(i.chartProperties),n[n.length-1]instanceof x&&n.pop(),n},z.prototype._customActions=function(){var e={top:[],bottom:[],remove:[]},t=this._chartUndoModel().timeScale(),i=this._state&&this._state.defaultPriceScale();if(!r.enabled("custom_items_in_context_menu"))return e;var n,o=t.isEmpty()?void 0:t.indexToUserTime(t.coordinateToIndex(this._contextMenuX));if(i&&!i.isEmpty()){var s=this._state.mainDataSource().firstValue();n=i.coordinateToPrice(this._contextMenuY,s)}return k.emit("onContextMenu",{unixtime:o?o/1e3:void 0,price:n,callback:function(t){[].concat(t).forEach((function(t){var i;t.text&&(t.text.length>1&&"-"===t.text[0]?e.remove.push(t.text.slice(1)):(i="-"===t.text?new x:new C({label:t.text,onExecute:t.click}),t.position&&"top"===t.position?e.top.push(i):e.bottom.push(i)))}))}}),e},z.prototype._timeAxisMenu=function(){if(this._chartUndoModel().timeScale().isEmpty())return null;var e=this._chart.getTimeScale();return new C({label:window.t("Time Scale"),subItems:e.getContextMenuActions(),statName:"TimeScale"})},z.prototype.toggleLockTimeAxis=function(e,t){if("boolean"!=typeof t&&(t=!I.lockTimeAxis().value()),t){var i=this._chartUndoModel().timeScale(),r=i.coordinateToIndex(e),n=i.points().roughTime(r) ;I.lockTimeAxisTime.setValue(n)}I.lockTimeAxis().setValue(t)},z.prototype._createLockTimeAxisAction=function(e){var t=I.lockTimeAxis().value();return new C({label:window.t("Lock Vertical Line On Time Axis"),statName:"ToggleLockCursorInTime",checkable:!0,checked:t,onExecute:this.toggleLockTimeAxis.bind(this,e.localX,!t)})},z.prototype._createHVLineAction=function(e,t){var i=this;return new C({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 r=y(i._state),n=r.mainDataSource().firstValue(),o=i._chartUndoModel().timeScale().coordinateToIndex(e.localX),s=r.defaultPriceScale().coordinateToPrice(e.localY,n),a=i._chartUndoModel().createLineTool(r,{index:o,price:s},"vertical"===t?"LineToolVertLine":"LineToolHorzLine");i._finishTool(a)}})},z.prototype.cloneLineTools=function(e,t){return this._chartUndoModel().cloneLineTools(e,t)},z.prototype.setPriceAxisSizes=function(e,t,i){this._priceAxisesContainer(e).setSizes(t,i)},z.prototype.update=function(){this._lhsPriceAxisesContainer.update(),this._rhsPriceAxisesContainer.update(),null!==this._legendWidget&&this._legendWidget.update(),this.updateControls()},z.prototype.updateControls=function(){null!==this._paneControls&&this._paneControls.update()},z.prototype.drawBackground=function(e,t,i){E(e,0,0,Math.ceil(i.pixelRatio*this._size.w)+1,Math.ceil(i.pixelRatio*this._size.h)+1,t)},z.prototype.drawGrid=function(e,t){for(var i=y(this._state),r=this._chartUndoModel().gridSource().paneViews(i),n=i.height(),o=i.width(),s=0;s=0;d--)h[d].createDrawingsCaches();var p=this._state.customSources(N.Foreground),f=this._state.customSources(N.Background);for(d=0;d=0;d--)h[d].clearDrawingCaches()},z.prototype._drawCustomSource=function(e,t,i){for(var r=this.state(),n=r.height(),o=r.width(),s=e.paneViews(r),a=0;aA.Cursor&&this._state&&this.recalculatePriceScale(),this._lhsPriceAxisesContainer.paint(e),this._rhsPriceAxisesContainer.paint(e),e!==A.Cursor){var i=this._canvasBinding.canvas.getContext("2d") ;i.setTransform(1,0,0,1,0,0);var r=this._canvasRenderParams();this.drawBackground(i,this.backgroundColor(),r),this._state&&(this.drawGrid(i,r),this.drawWatermark(i,r),this.drawSources(i,r),this.drawBarsMarks(i,r,t))}if(this._state){var n=this._topCanvasBinding.canvas.getContext("2d");n.setTransform(1,0,0,1,0,0);r=this._topCanvasRenderParams();n.clearRect(0,0,Math.ceil(this._size.w*r.pixelRatio),Math.ceil(this._size.h*r.pixelRatio)),this.drawCrossHair(n,r),this.drawActiveLineTool(n,r)}}},z.prototype._priceAxisesContainer=function(e){return c.isLeft(e)?this._lhsPriceAxisesContainer:this._rhsPriceAxisesContainer},z.prototype.createActionLockScale=function(e){if(!(e instanceof TradingView.Series))return null;var t=u(e.priceScale(),this._chartUndoModel().model().mainSeriesScaleRatio()),i=new C({checkable:e.priceScale().isLockScale(),label:window.t("Lock Scale")+" "+t,statName:"LockScale"});return i._binding=new m(i,e.priceScale().properties().lockScale,this._chartUndoModel(),"Lock Scale",(function(){var t={lockScale:this.value()};this._undoModel.setPriceScaleMode(t,e.priceScale(),this._undoText)})),i},z.prototype._updateCrosshairOnZoom=function(){if(I.lockTimeAxis().value()){var e=this._chartUndoModel().crossHairSource();e.setPosition(e.index,e.price,this.state())}},z.prototype.leftPriceAxisesContainer=function(){return this._lhsPriceAxisesContainer},z.prototype.rightPriceAxisesContainer=function(){return this._rhsPriceAxisesContainer},z.prototype._tryStartMeasure=function(e,t,i,r,n){return!(!I.toolIsMeasure(I.tool.value())||t.startMeasurePoint())&&(this._preventCrossHairMove()||this._setCursorPosition(e.localX,e.localY,i),r=this._chartModel().magnet().align(r,n,this._state),t.startMeasuring({price:r,index:n},this._state),!0)},z.prototype._tryFinishMeasure=function(e,t){if(t.startMeasurePoint()&&!t.endMeasurePoint()){var i=t.price,r=t.index;return i=this._chartModel().magnet().align(i,r,this._state),t.finishMeasure({price:i,index:r}),I.resetToCursor(),this._preventCrossHairMove()&&this._clearCursorPosition(),!0}return!1},z.prototype._tryFinishZoom=function(e){return null!==this._firstZoomPoint&&(this._finishZoom(e),!0)},z.prototype._tryStartZoom=function(e,t,i,r){var n=this._chart.model().model().zoomEnabled();if("zoom"===I.tool.value()&&n){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,r),this._chartModel().crossHairSource().startSelection(this._state),!0}return!1},z.prototype.highlightedPriceAxis=function(){return this._highlightedPriceAxis},e.exports.PaneWidget=z}).call(this,i("hY0g"),i("Kxc7"))},mpWx:function(e,t,i){"use strict";function r(e,t){for(var i=Promise.reject(),r=0;r0,this._precision=e}return e.prototype.state=function(){return{precision:this._precision}},e.prototype.format=function(e){ +for(var t=e.split("+"),i=t.pop().toUpperCase().charCodeAt(0),n=0;n0,this._precision=e}return e.prototype.state=function(){return{precision:this._precision}},e.prototype.format=function(e){ if(!Object(n.isNumber)(e))return s;var t="";return e<0&&(t="-",e=-e),e>=1e100?window.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 r=this._numericFormatter.parse(e.slice(0,-1));return Object(n.isNumber)(r)?{res:!0,value:r*t[i]}:{error:"not a number",res:!1,value:NaN}}r=this._numericFormatter.parse(e);return Object(n.isNumber)(r)?{res:!0,value:r}:{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(o.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 r=i("aO4+").Point,n=i("Ss5c").LineDataSource,o=i("Ocx9").DefaultProperty,s=i("hayr").propertyPages,a=window.t("Trend Angle");function l(e,t){var r=t||l.createProperties();n.call(this,e,r),this._constructor="LineToolTrendAngle",this._properties.addChild("angle",new l.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(l,n),l.prototype.isSynchronizable=function(){return!1},l.AngleProperty=function(t){e.call(this),this._lineSource=t},inherit(l.AngleProperty,e),l.AngleProperty.prototype.value=function(){var e=180*this._lineSource._angle/Math.PI;return Math.round(e)},l.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],n=Math.cos(this._lineSource._angle),o=-Math.sin(this._lineSource._angle),s=new r(n,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)},l.prototype.pointsCount=function(){return 2},l.prototype.translatedType=function(){return a},l.prototype.name=function(){return"Trend Angle"},l.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)},l.prototype.addPoint=function(e,t){var i=n.prototype.addPoint.call(this,e,t);return i&&this._calculateAngle(),i}, l.prototype.setLastPoint=function(e,t){n.prototype.setLastPoint.call(this,e,t),this.points().length>1&&this._calculateAngle()},l.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,n=-Math.sin(this._angle)*this._distance,o=t.add(new r(i,n)),s=this.screenPointToPoint(o);return e.push(s),e},l.prototype.setPoint=function(e,t,i){n.prototype.setPoint.call(this,e,t,i),this.points().length>1&&1===e&&this._calculateAngle()},l.prototype.restoreData=function(e){this._angle=e.angle,this._distance=e.distance},l.prototype.state=function(e){var t=n.prototype.state.call(this,e);return t.angle=this._angle,t.distance=this._distance,t},l.prototype.cloneData=function(e){this._angle=e._angle,this._distance=e._distance},l.prototype.canHasAlert=function(){return!0},l.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},l.prototype.getInputsPropertyPage=function(){return s.LineToolTrendAngleInputsPropertyPage},l.prototype.getStylesPropertyPage=function(){return s.LineToolTrendAngleStylesPropertyPage},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("o1gc").TrendAngleDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l.createProperties=function(e){var t=new o("linetooltrendangle",e);return l._configureProperties(t),t},l._configureProperties=function(e){n._configureProperties(e)},t.LineToolTrendAngle=l}).call(this,i("tc+8"))},"nd9+":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolGannComplex",(function(){return p}));var r=i("mrSG"),n=i("aO4+"),o=i("Eyy1"),s=i("T6Of"),a=i("Ss5c"),l=i("FaJS"),c=i("hayr"),u=i("LAp3"),h=i("ytGH"),d=window.t("Gann Square"),p=function(e){function t(r,n){var o=e.call(this,r,n||t.createProperties())||this;o.version=2,o._constructor="LineToolGannComplex",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();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);for(var l=[],c=o.properties().childs(),u=c.levels.childCount(),d=0;d=this.pointsCount()?setTimeout((function(){return r._migratePoint()})):this._timePoint.length>=this.pointsCount()&&this._pointAdded.subscribe(this,this._migratePoint))},t.prototype.destroy=function(){var e=this.properties();e.unsubscribe(this,this._adjustScaleRatio),e.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)},t.prototype.pointsCount=function(){return 2},t.prototype.translatedType=function(){return d},t.prototype.name=function(){return"Gann Square"},t.prototype.addPoint=function(t,i,r){this._points.length>1&&this._points.pop();var n=e.prototype.addPoint.call(this,t,i,r),s=this.priceScale();return!Object(o.ensureNotNull)(s).isLog()&&n&&this._correctFirstPoint(),n},t.prototype.setPoint=function(t,i,r,n){e.prototype.setPoint.call(this,t,i,r,n),void 0!==r&&r.shift()?this._correctPoint(t):this._correctScaleRatio()},t.prototype.setLastPoint=function(t,i){var r=this.priceScale();Object(o.ensureNotNull)(r).isLog()||(this._points[1]=t,this._correctPoint(1)),e.prototype.setLastPoint.call(this,t,i)},t.prototype.getStylesPropertyPage=function(){return c.propertyPages.LineToolGannComplexStylesPropertyPage},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(),r=0;r0,s=r.index-n.index>0,a=o&&!s||!o&&s?-1:1;0===e&&(a=-a),r.price=n.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){n=n.normalized();var o=Math.acos(n.x);return n.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 r}));i("YFKU");var r=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 r=Math.floor(e/3600);e-=3600*r;var n=Math.floor(e/60);e-=60*n;var o="";return i&&(o+=i+window.t("d",{context:"dates"})+" "),r&&(o+=r+window.t("h",{context:"dates"})+" "),n&&(o+=n+window.t("m",{context:"dates"})+" "),e&&(o+=e+window.t("s",{context:"dates"})+" "),t&&(o="-"+o),o.trim()},e}()},nqXy:function(e,t,i){"use strict";i.r(t),i.d(t,"MouseWheelHelper",(function(){return r}));var r=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}()},oIoN:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Disjoint Channel");function a(e,t){this._constructor="LineToolDisjointAngle";var n=t||a.createProperties();r.call(this,e,n),this.version=a.version,i.e("lt-pane-views").then(function(e){var t=i("pBAL").DisjointChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.version=1,a.prototype.pointsCount=function(){return 3},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Disjoint Channel"},a.prototype.hasEditableCoordinates=function(){return!1},a.prototype.addPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),r.prototype.addPoint.call(this,e)},a.prototype.setLastPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),r.prototype.setLastPoint.call(this,e)},a.prototype.setPoint=function(e,t,i){var n=.5*(this._points[1].price+this._points[2].price);if(i&&i.shift()&&1===e){this._snapPoint45Degree(t,this.points()[0])}if(e<3&&r.prototype.setPoint.call(this,e,t),0!==e&&2!==e)if(1===e){var o=this._points[1].price-n;this._points[2].price=this._points[1].price-2*o}else if(3===e){o=t.price-this._points[2].price;this._points[0].price=this._points[1].price-o,this._points[0].index=t.index}},a.prototype.canHasAlert=function(){return!0},a.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 r=this._points[2];r.time=t.time,r.index=t.index;var n,o,s,a,l={price:r.price+(t.price-e.price),time:e.time,index:e.index},c=[];r.index<=l.index?(c.push(r),c.push(l)):(c.push(l),c.push(r)),i[0].price>c[0].price?(n=i,o=c):c[0].price>i[0].price||c[1].price>i[1].price?(n=c,o=i):(n=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(n,"Upper",s,a),this._linePointsToAlertPlot(o,"Lower",s,a)]},a.prototype.getInputsPropertyPage=function(){return null},a.prototype.getStylesPropertyPage=function(){return o.LineToolDisjointChannelStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("vm8R").GeneralTrendFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetooldisjointangle",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolDisjointChannel=a},oNDq:function(e,t,i){"use strict";i.r(t),i.d(t,"createConfirmDialog",(function(){return o}));var r=i("mrSG"),n=(i("YFKU"),{actions:[{key:13,name:"yes",text:window.t("Yes"),type:"success"},{method:"close",name:"no",text:window.t("No"),type:"default"}],actionsWrapTemplate:'
',content:window.t("Are you sure?"),contentWrapTemplate:'

',destroyOnClose:!0,title:window.t("Confirmation"),width:400,dataset:{"dialog-type":"confirm-dialog"}});function o(e){return new Promise((function(t){Promise.all([i.e("dialogs-core"),i.e(55),i.e(10),i.e(14),i.e("create-dialog")]).then(function(o){var s=i("YDhE").createDialog;t(s(Object(r.__assign)(Object(r.__assign)({},n),e)))}.bind(null,i)).catch(void 0)}))}},oWyD:function(e,t,i){},oXaB:function(e,t,i){"use strict";var r;i.r(t),i.d(t,"PriceAxisLastValueMode",(function(){return r})),function(e){e[e.LastPriceAndPercentageValue=0]="LastPriceAndPercentageValue",e[e.LastValueAccordingToScale=1]="LastValueAccordingToScale"}(r||(r={}))},ocLq:function(e,t,i){"use strict";(function(t){var r=i("5B3K").StudyError,n=i("Y7w9"),o=i("ogJP").inherit,s=i("E6p6").SessionStage,a=function(){var e="undefined"!=typeof window?window:t,a=e.PineJsCalendar?e.PineJsCalendar:i("jCNj"),l=i("IiTo"),c=i("IDnv").extrapolateBarsFrontToTime,u={};function h(e,t,i,r,n){var o=n,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 p(e,t,i){this._deviation=e;var r=i.new_var(u.high(i)),n=i.new_var(u.low(i));r.get(2*t+1),n.get(2*t+1),this._pivotHigh=new d(t,t,d.HIGH,r,i),this._pivotLow=new d(t,t,d.LOW,n,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=u.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 f(e){this.symbol=e,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0}function _(e){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=e}function m(e){_.call(this,e),this.hist=new Float64Array(2e3),this.hist_pos=-1}function y(e,t,i,r,n,o,s){this.periodBase=r,this.tickerid=e,this.currencyCode=t,this.period=i,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 l.SessionInfo("Etc/UTC","24x7"),this.other_sessions={},this.script=n,this.ticker=y.parseTicker(e);var a=y.parsePeriod(i);this.resolution=a.resolution,this.interval=a.interval,this.bb_cache={},this.minTick=o,this.periodForInitialRange=s}function g(e,t,i,r,n,o,s,a,l,c,u){this.body=s,this.symbols=[],this.runner=o,this.inputCallback=l,this.out=a,this.nonseriesOut=u,this.ctx=new f(this.add_sym(e,t,i,r,c,n)),this.init()}function v(e){this.symbols=[],this.barsets=[],this.subscription=[],this.host=e,this.isRecalculated=!1,this.start()}function S(e){this.runner=new v(e)}function b(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0}function w(e,t){this.period=e,this.generateEmptyBars=!!t}function P(){}return u.max_series_default_size=10001,u.n=function(e){return e.symbol.index+1},u.nz=function(e,t){return t=t||0,isFinite(e)?e:t},u.na=function(e){return 0===arguments.length?NaN:isNaN(e)?1:0},u.isZero=function(e){return Math.abs(e)<=1e-10},u.toBool=function(e){return isFinite(e)&&!u.isZero(e)},u.eq=function(e,t){return u.isZero(e-t)},u.neq=function(e,t){return!u.eq(e,t)},u.ge=function(e,t){return u.isZero(e-t)||e>t},u.gt=function(e,t){return!u.isZero(e-t)&&e>t},u.lt=function(e,t){return!u.isZero(e-t)&&e1e-10},u.less=function(e,t){return t-e>1e-10},u.max=Math.max,u.min=Math.min,u.pow=Math.pow,u.abs=Math.abs,u.log=Math.log,u.log10=function(e){return Math.log(e)/Math.LN10},u.sqrt=Math.sqrt,u.sign=function(e){return isNaN(e)?NaN:u.isZero(e)?0:e>0?1:-1},u.exp=Math.exp, +;this._index>1&&(this._currentIndex.set(o),this._currentValue.set(s),this._pivotIndex.set(a))}function p(e,t,i){this._deviation=e;var r=i.new_var(u.high(i)),n=i.new_var(u.low(i));r.get(2*t+1),n.get(2*t+1),this._pivotHigh=new d(t,t,d.HIGH,r,i),this._pivotLow=new d(t,t,d.LOW,n,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=u.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 f(e){this.symbol=e,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0}function _(e){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=e}function m(e){_.call(this,e),this.hist=new Float64Array(2e3),this.hist_pos=-1}function y(e,t,i,r,n,o,s){this.periodBase=r,this.tickerid=e,this.currencyCode=t,this.period=i,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 l.SessionInfo("Etc/UTC","24x7"),this.other_sessions={},this.script=n,this.ticker=y.parseTicker(e);var a=y.parsePeriod(i);this.resolution=a.resolution,this.interval=a.interval,this.bb_cache={},this.minTick=o,this.periodForInitialRange=s}function g(e,t,i,r,n,o,s,a,l,c,u){this.body=s,this.symbols=[],this.runner=o,this.inputCallback=l,this.out=a,this.nonseriesOut=u,this.ctx=new f(this.add_sym(e,t,i,r,c,n)),this.init()}function v(e){this.symbols=[],this.barsets=[],this.subscription=[],this.host=e,this.isRecalculated=!1,this.start()}function b(e){this.runner=new v(e)}function S(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0}function w(e,t){this.period=e,this.generateEmptyBars=!!t}function P(){}return u.max_series_default_size=10001,u.n=function(e){return e.symbol.index+1},u.nz=function(e,t){return t=t||0,isFinite(e)?e:t},u.na=function(e){return 0===arguments.length?NaN:isNaN(e)?1:0},u.isZero=function(e){return Math.abs(e)<=1e-10},u.toBool=function(e){return isFinite(e)&&!u.isZero(e)},u.eq=function(e,t){return u.isZero(e-t)},u.neq=function(e,t){return!u.eq(e,t)},u.ge=function(e,t){return u.isZero(e-t)||e>t},u.gt=function(e,t){return!u.isZero(e-t)&&e>t},u.lt=function(e,t){return!u.isZero(e-t)&&e1e-10},u.less=function(e,t){return t-e>1e-10},u.max=Math.max,u.min=Math.min,u.pow=Math.pow,u.abs=Math.abs,u.log=Math.log,u.log10=function(e){return Math.log(e)/Math.LN10},u.sqrt=Math.sqrt,u.sign=function(e){return isNaN(e)?NaN:u.isZero(e)?0:e>0?1:-1},u.exp=Math.exp, u.sin=Math.sin,u.cos=Math.cos,u.tan=Math.tan,u.asin=Math.asin,u.acos=Math.acos,u.atan=Math.atan,u.floor=Math.floor,u.ceil=Math.ceil,u.round=Math.round,u.avg=function(e,t,i,r,n,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];r.push(a)}}r.reverse()}return r},u.iff=function(e,t,i){return u.not(e)?i:t},u.rising=function(e,t){for(var i=1;ie.get(0))return 0;return 1},u.falling=function(e,t){for(var i=1;i=0;n--){r+=(t-n)*e.get(n)}return 2*r/(t*(t+1))},u.vwma=function(e,t,i){var r=i.new_var(u.volume(i)),n=i.new_var(e.get(0)*u.volume(i));return u.sma(n,t,i)/u.sma(r,t,i)},u.swma=function(e,t){return(e.get(0)+2*e.get(1)+2*e.get(2)+e.get(3))/6},u.lowestbars=function(e,t,i){return-h(e,t,0,(function(e,t){return u.lt(e,t)}),Number.MAX_VALUE).index},u.lowest=function(e,t,i){return h(e,t,0,(function(e,t){return u.lt(e,t)}),Number.MAX_VALUE).value},u.highestbars=function(e,t,i){return-h(e,t,0,(function(e,t){return u.gt(e,t)}),Number.MIN_VALUE).index},u.highest=function(e,t,i){return h(e,t,0,(function(e,t){return u.gt(e,t)}),Number.MIN_VALUE).value},u.cum=function(e,t){var i=t.new_var(),r=u.nz(i.get(1))+e;return i.set(r),r},u.accdist=function(e){var t=u.high(e),i=u.low(e),r=u.close(e),n=u.volume(e);return u.cum(r===t&&r===i||t===i?0:n*(2*r-i-t)/(t-i),e)},u.correlation=function(e,t,i,r){var n=u.sma(e,i,r),o=u.sma(t,i,r),s=r.new_var(e.get()*t.get());return(u.sma(s,i,r)-n*o)/Math.sqrt(u.variance2(e,n,i)*u.variance2(t,o,i))},u.stoch=function(e,t,i,r,n){var o=u.highest(t,r),s=u.lowest(i,r);return u.fixnan(100*(e.get()-s)/(o-s),n)},u.tsi=function(e,t,i,r){var n=r.new_var(u.change(e)),o=r.new_var(u.abs(u.change(e))),s=r.new_var(u.ema(n,i,r)),a=r.new_var(u.ema(o,i,r));return u.ema(s,t,r)/u.ema(a,t,r)},u.cross=function(e,t,i){if(isNaN(e)||isNaN(t))return!1;var r,n=i.new_var((r=e-t)<0?-1:0===r?0:1);return!isNaN(n.get(1))&&n.get(1)!==n.get()},u.linreg=function(e,t,i){for(var r=0,n=0,o=0,s=0,a=0;athis._currentValue.get():ithis._areaRight},d.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===d.HIGH?t>r:t0&&i.set(e),i},f.prototype.new_unlimited_var=function(e){var t=this.vars;t.length<=this.vars_index&&t.push(new m(this.symbol));var i=t[this.vars_index++];return arguments.length>0&&i.set(e),i},f.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new f(this.symbol)),this.ctx[this.ctx_index++]},f.prototype.prepare=function(e){this.ctx_index=0,this.vars_index=0;for(var t=0;te&&(e=i)}return e},f.prototype.stop=function(){this.symbol=null,this.vars=null},_.prototype.valueOf=function(){return this.get(0)},_.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=u.max(this.mindepth,e),NaN)},_.prototype._get=function(e){var t=this.hist_pos-e;return t<0&&(t+=this.hist.length),this.hist[t]},_.prototype.set=function(e){this.hist&&(this.hist[this.hist_pos]=e,this.modified=!0)},_.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)},_.prototype.add_hist=function(){if(!this.hist){var e=u.na(this.mindepth)?u.max_series_default_size:u.max(this.mindepth+1,1);e=Math.round(e);for(var t=new Array(e),i=0;i=0){var r=i.split(",");t=y.parsePeriod(r[1]),i=r[0]}var n=!1,o=!1,s=i[i.length-1];-1==="DWM".indexOf(s)&&("S"===s?o=!0:(n=!0,s=""));var a=parseInt(n?i:i.length>1?i.slice(0,i.length-1):1);return{resolution:s,interval:a,pureResolution:[a,s].join(""),isIntraday:n,isSeconds:o,range:t}},y.newBarBuilder=function(e,t,i){var r=y.parsePeriod(e);return l.newBarBuilder(r.interval+r.resolution,t,i)},y.newSession=function(e){return new l.SessionInfo(e.timezone,e.session,e.holidays,e.corrections)},y.prototype.set_symbolinfo=function(e){for(var t in e||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=e,this.timezone=a.get_timezone(e.timezone),this.session.init(e.timezone,e.session,e.holidays,e.corrections),this.other_sessions)this.other_sessions.hasOwnProperty(t)&&this.other_sessions[t].init(e.timezone,e.session,e.holidays,e.corrections)},y.prototype.get_session=function(e){if(!e)return this.session;var t=this.other_sessions[e];return t||(t=new l.SessionInfo("Etc/UTC","24x7"),this.other_sessions[e]=t),t},y.prototype.isdwm=function(){return""!==this.resolution&&"S"!==this.resolution},y.prototype.enable_dwm_aligning=function(e,t){this.dwm_aligner=y.newBarBuilder(this.period,e,t)},y.prototype.bartime=function(e,t){var i=this.time;if(e){var r=e;t&&(r+=t);var n=this.bb_cache[r];if(!n){var o=this.get_session(t);n=y.newBarBuilder(e,o),this.bb_cache[r]=n}i=n.alignTime(i)}if(!this.isdwm()||isNaN(i))return i;var s=a.utc_to_cal(this.timezone,i);return this.session.spec.correctTradingDay(s),a.cal_to_utc(this.timezone,s)},y.prototype.lastbar=function(e){if(!isNaN(e.time)){var t=e.time;this.dwm_aligner&&(this.dwm_aligner.moveTo(t),t=this.dwm_aligner.startOfBar(0));var i=this.time!==t;i&&this.index>=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.script.calc(this)}},g.prototype.calc=function(e){var t=this.ctx,i=this.body;t.prepare(e);var r=i.main(t,this.inputCallback),n=this;this.out&&r&&(!isNaN(t.symbol.time)||r.nonseries)&&(r.nonseries?("projection"===r.type&&(r.projectionTime=t.symbol.time),this.nonseriesOut(t.symbol,r)):r.bars?r.bars.forEach((function(e){n.out(t.symbol,e)})):this.out(t.symbol,r))},g.prototype.init=function(){var e=this.ctx,t=this.body;t.init&&t.init(e,this.inputCallback),t.main(e,this.inputCallback)},g.prototype.add_sym=function(e,t,i,r,n,o){var s=this.runner.add_sym(e,t,i,r,this,n,o);return this.symbols.push(s),s.isdwm()&&this.symbols.length>1&&s.enable_dwm_aligning(this.symbols[0].session,s.session),s},g.prototype.maxAdditionalDepth=function(){return this.ctx.maxAdditionalDepth()},g.prototype.stop=function(){this.symbols=null,this.ctx.stop(), -this.ctx=null},g.prototype.get_sym=function(e){return this.symbols[e]},v.prototype.add_sym=function(e,t,i,r,n,o,s){var a=new y(e,t,i,r,n,o,s);return this.symbols.push(a),a},v.prototype.get_sym=function(e){return this.symbols[e]},v.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)},v.prototype.start=function(){var e=this.host;this._script=new g(e.tickerid,e.currencyCode,e.period,e.periodBase||e.period,e.periodForInitialRange,this,e.body,this.out.bind(this),e.input,e.symbolInfo.minmov/e.symbolInfo.pricescale,e.nonseriesOut);var t=this,i=[],r=this.symbols,n=(e.additionalBarsCount||0)+t._script.maxAdditionalDepth();function o(r,o){var s=v.feed.subscribe(r.tickerid,r.currencyCode,r.period,r.periodBase,r.periodForInitialRange,(function(i){"series"===(i.nonseries?"nonseries":"series")?t.update(o,i):i.lastBar?(t.nonseriesUpdate=i,i.lastBar.isLastBar=!0,t.symbols[0].lastbar(i.lastBar),t.nonseriesUpdate=null):e.nonseriesOut(r,i)}),e.onErrorCallback,e.symbolInfo,e.sessionId,e.rangeExtension,n);i.push(s)}for(var s=0;s=0;i--)for(var r=e[i],n=this.barsets[i],o=n.count(),s=0;s=0;i--)for(var r=e[i],n=this.barsets[i],o=n.count(),s=0;s=0;i--){var r=this._chartModel.restoreSource(this._restorePanes[i],this._paneIndexes[i],this._paneStates[i],this._sourceStates[i],this._priceScalePositionIds[i]);t.push(r)}t.some((function(i,r){return i.id()!==e._sourceIds[t.length-r-1]}))&&u.logError("Source was restored improperly - source ids does not match"),this._excludeLineToolsUndoCommands.forEach((function(e){return e.undo()}))},t}(o.UndoCommand)},odCa:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("fgLi").DataSource,o=i("tc+8"),s=i("Ocx9").DefaultProperty,a=i("hayr").propertyPages,l=i("jTis").CalloutConsts,c=window.t("Callout");function u(e,t){this._constructor="LineToolCallout";var n=t||u.createProperties();r.call(this,e,n),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(u,r),u.prototype.pointsCount=function(){return 2},u.prototype.translatedType=function(){return c},u.prototype.name=function(){return"Callout"},u.prototype.correctPoints=function(e){var t=this._currentMovingPoint.index-this._startMovingPoint.index,i=this._currentMovingPoint.price-this._startMovingPoint.price,r=e[1];r.index+=t,r.price+=i,e[1]=r},u.prototype.addPoint=function(e){var t=r.prototype.addPoint.call(this,e);return t&&this._calculateBarOffset(),t},u.prototype._calculateBarOffset=function(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)},u.prototype.setLastPoint=function(e){r.prototype.setLastPoint.call(this,e),2===this.points().length&&this._calculateBarOffset()},u.prototype.setPoint=function(e,t){switch(e){case 0:r.prototype.setPoint.call(this,e,t),this._calculateBarOffset();break;case 1:var i=this.properties();if(!i.wordWrapWidth)return;var n=this._points,o=this._dragStartLeftEdgeIndex,s=Math.round((t.index-o)/2);if(isFinite(o)&&isFinite(s)){n[1]={index:o+s,price:n[1].price},this._calculateBarOffset(),this.normalizePoints();var a=this._timeScale.indexToCoordinate(o+2*s)-this._timeScale.indexToCoordinate(o)-l.RoundRadius-l.TextMargins;if(!isFinite(a))return;i.wordWrapWidth.setValue(Math.max(l.MinWidth,a));break}n[1]=t,this._calculateBarOffset(),this.normalizePoints()}},u.prototype.startDragPoint=function(e,t){var i=this.properties();1===e&&i.wordWrap&&i.wordWrap.value()&&(this._dragStartLeftEdgeIndex=2*this.points()[1].index-t.index)},u.prototype.move=function(e,t,i){r.prototype.move.call(this,e,t,i),this._calculateBarOffset()},u.prototype.state=function(e){var t=r.prototype.state.call(this,e);return t.barOffset=this._barOffset,t},u.prototype.restoreData=function(e){e.barOffset?this._barOffset=e.barOffset:this._calculateBarOffset(),this._calculatePoint2()},u.prototype.setPriceScale=function(e){n.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&this._calculatePoint2()},u.prototype.template=function(){var e=r.prototype.template.call(this) ;return e.text=this.properties().childs().text.value(),e},u.prototype._applyTemplateImpl=function(e){r.prototype._applyTemplateImpl.call(this,e),this.properties().childs().text.setValue(e.text)},u.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}}},u.prototype.getStylesPropertyPage=function(){return a.LineToolCalloutStylesPropertyPage},u.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("xhf0").CalloutDefinitionsViewModel}.bind(null,i)).catch(i.oe)},u.createProperties=function(e){var t=new s("linetoolcallout",e);return u._configureProperties(t),t},u._configureProperties=function(e){r._configureProperties(e),e.hasChild("text")||e.addChild("text",new o(window.t("Text"))),e.addExclusion("text")},t.LineToolCallout=u},oiZD:function(e,t,i){"use strict";i.r(t);var r=i("hY0g"),n=i.n(r);i.d(t,"watchedTheme",(function(){return o})),i.d(t,"setTheme",(function(){return s}));var o=new n.a;function s(e){o.setValue(e)}o.subscribe((function(e){!function(e,t){void 0===t&&(t=window);for(var i="theme-"+e,r=t.document.documentElement.classList,n=0,o=Array.from(r);no){var s=Object(n.extrapolateBarsFrontToTime)(this._barBuilder(),o||1e3*e,1e3*t,2e3,!0);this._extrapolatedData=this._extrapolatedData.concat(s.times),i=this._extrapolatedData.length}if((o=this._extrapolatedData[i-1])<1e3*t)return{success:!1};var a=this._extrapolatedData.indexOf(1e3*t);return-1===a?{success:!1}:{success:!0,result:a}},e.prototype.projectTime=function(e,t){if(!this.isValid())return e;var i=this._extrapolatedData.length,r=i>0?this._extrapolatedData[0]:null,o=null!==r?this._extrapolatedData[i-1]:null;if(1e3*e!==r&&(this._extrapolatedData=[1e3*e],r=null,o=null),null===r||t>=i){var s=Object(n.extrapolateBarsFrontByCount)(this._barBuilder(),o||1e3*e,t-i+1,!0) -;this._extrapolatedData=this._extrapolatedData.concat(s.times),i=this._extrapolatedData.length}return ii.zorder()}));if(0===r.length)throw new Error("Cannot bring forward source that alreadt on back");var n=r[0];if(Object(f.isLineTool)(n)){var o=e.model().lineToolsGroupModel().groupForLineTool(n);if(null!==o){var s=o.lineTools();n=s[s.length-1]}}return n}var E=function(e){function t(t,i,r){return e.call(this,t,r,k(i,r),"Send "+r[0].title()+" backward")||this}return Object(r.__extends)(t,e),t}(T);function D(e,t){return Object(n.ensureNotNull)(e.paneForSource(t.lineTools()[0]))}var V=function(e){function t(t,i){return e.call(this,t,i.lineTools(),O(D(t,i),i.lineTools()),"Send Group "+i.name()+" backward")||this}return Object(r.__extends)(t,e),t}(I),B=function(e){function t(t,i){return e.call(this,t,i.lineTools(),k(D(t,i),i.lineTools()),"Bring Group "+i.name()+" backward")||this}return Object(r.__extends)(t,e),t}(T),R=i("ogJP"),N=function(e){function t(t,i,r){var n=e.call(this,"Rearrange panes")||this;return n._chartModel=t,n._index=i,Object(R.isNumber)(r)?n._dstIndex=r:n._dstIndex="up"===r?i-1:i+1,n}return Object(r.__extends)(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=r,s=t.lineToolsGroupModel().groupForLineTool(r);if(null!==s){var a=s.lineTools();o=a[a.length-1]}this._environment.beginUndoMacro(ne);var l=new Map,c=new Set;i.forEach((function(i){var r=e._groupForLineTool(i);if(null!==r){var o=l.get(r)||[];o.push(i),l.set(r,o);var s=Object(n.ensureNotNull)(t.paneForSource(i));c.add(s)}})),Object(n.assert)(c.size<=1,"All selected sources should be on the same pane"),l.forEach((function(i,r){var n=new y.a(t,r,i);e._environment.pushUndoCommand(n)}));var u=new Q(t,Object(b.sortSources)(i));this._environment.pushUndoCommand(u);var h=new L(t,i,o);this._environment.pushUndoCommand(h), +})),i=null===this._groupId?void 0:this._groupId;this._groupId=this._model.lineToolsGroupModel().createGroup(t,this._title,i).id},t.prototype.undo=function(){var e=Object(n.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(Object(n.ensureNotNull)(this._groupId)));this._model.lineToolsGroupModel().removeGroup(e)},t.prototype.createdGroupId=function(){return this._groupId},t}(d.UndoCommand),$=window.t("Add line tool(s) {lineTool} to group {group}"),ee=function(e){function t(t,i,r){var n=e.call(this,$.format({group:i.name()}))||this;return n._model=t,n._groupId=i.id,n._lineToolsIds=r.map((function(e){return e.id()})),n}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=this,t=Object(n.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(this._groupId)),i=this._lineToolsIds.map((function(t){return e._model.dataSourceForId(t)}));t.addLineTools(i)},t.prototype.undo=function(){var e=this,t=this._lineToolsIds.map((function(t){return e._model.dataSourceForId(t)}));Object(n.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(this._groupId)).excludeLineTools(t)},t}(d.UndoCommand),te=i("bJYc"),ie=function(e){function t(t,i,r,n){var o=e.call(this,n)||this;return o._chartModel=t,o._groupId=i.id,o._oldName=i.name(),o._newName=r,o}return Object(r.__extends)(t,e),t.prototype.redo=function(){Object(n.ensureNotNull)(this._chartModel.lineToolsGroupModel().groupForId(this._groupId)).setName(this._newName)},t.prototype.undo=function(){Object(n.ensureNotNull)(this._chartModel.lineToolsGroupModel().groupForId(this._groupId)).setName(this._oldName)},t}(d.UndoCommand),re=i("mMWL"),ne=window.t("Create line tools group from selection"),oe=window.t("Removing line tools group {name}"),se=window.t("Add line tool {lineTool} to group {name}"),ae=window.t("Make group {group} visible"),le=window.t("Make group {group} invisible"),ce=window.t("Lock group {group}"),ue=window.t("Unlock group {group}"),he=window.t("Rename group {group} to {newName}"),de=function(){function e(e){this._environment=e}return e.prototype.createGroupFromSelection=function(){var e=this,t=this._environment.model();Object(n.assert)(!t.selection().isEmpty(),"Cannot create group from empty selection");var i=Object(S.sortSources)(t.selection().sources());Object(n.assert)(i.every((function(e){return Object(f.isLineTool)(e)})),"A group could contain line tools only");var r=i.reduce((function(e,t){return e.zorder()>t.zorder()?e:t}),i[0]),o=r,s=t.lineToolsGroupModel().groupForLineTool(r);if(null!==s){var a=s.lineTools();o=a[a.length-1]}this._environment.beginUndoMacro(ne);var l=new Map,c=new Set;i.forEach((function(i){var r=e._groupForLineTool(i);if(null!==r){var o=l.get(r)||[];o.push(i),l.set(r,o);var s=Object(n.ensureNotNull)(t.paneForSource(i));c.add(s)}})),Object(n.assert)(c.size<=1,"All selected sources should be on the same pane"),l.forEach((function(i,r){var n=new y.a(t,r,i);e._environment.pushUndoCommand(n)}));var u=new Q(t,Object(S.sortSources)(i));this._environment.pushUndoCommand(u);var h=new L(t,i,o);this._environment.pushUndoCommand(h), this._environment.endUndoMacro();var d=Object(n.ensureNotNull)(u.createdGroupId());return Object(n.ensureNotNull)(t.lineToolsGroupModel().groupForId(d))},e.prototype.removeGroup=function(e){var t=this._environment.model(),i=e.lineTools();this._environment.beginUndoMacro(oe.format({name:e.name()}));var r=new J(t,e,"");this._environment.pushUndoCommand(r);var o=new m.RemoveSourcesCommand(t,i,"");this._environment.pushUndoCommand(o),i.forEach((function(e){null!==e.getLinkKey()&&Object(re.removeLineTool)({model:t,linkKey:Object(n.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(),r=new y.a(i,e,[t]);this._environment.pushUndoCommand(r)},e.prototype.addLineToolToGroup=function(e,t){var i=this._environment.model(),r=i.lineToolsGroupModel().groupForLineTool(t);if(r!==e){var n=se.format({lineTool:t.title(),name:e.name()});this._environment.beginUndoMacro(n),null!==r&&this._environment.pushUndoCommand(new y.a(i,r,[t])),this._environment.pushUndoCommand(new ee(i,e,[t])),this._environment.endUndoMacro()}},e.prototype.bringToFront=function(e){var t=this._environment.model(),i=new C(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 x(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 B(t,e);this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.sendBackward=function(e){var t=this._environment.model(),i=new V(t,e);this._environment.pushUndoCommand(i),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.insertAfter=function(e,t){var i,r=this._environment.model();if(t instanceof Z.a){var n=t.lineTools();i=n[n.length-1]}else i=t;var o=new L(r,e.lineTools(),i);this._environment.pushUndoCommand(o),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.insertBefore=function(e,t){var i,r=this._environment.model();t instanceof Z.a?i=t.lineTools()[0]:i=t;var n=new M(r,e.lineTools(),i);this._environment.pushUndoCommand(n),this._environment.emitEvent("changeZOrder",[e.lineTools()])},e.prototype.availableZOrderOperations=function(e){var t=this._environment.model(),i=e.lineTools(),r=i[0],o=i[i.length-1],s=Object(n.ensureNotNull)(t.paneForSource(i[0])).allOrderedSourcesWithoutSpecial(),a=s[0],l=s[s.length-1];return{bringForwardEnabled:o!==l,bringToFrontEnabled:o!==l,sendBackwardEnabled:r!==a,sendToBackEnabled:r!==a}},e.prototype.setGroupVisibility=function(e,t){var i=this,r=(t?ae:le).format({group:e.name()}),n=this._environment.model();this._environment.beginUndoMacro(r),e.lineTools().forEach((function(e){var r=e.properties().visible,o=new te.SetPropertyUndoCommand(r,t,"",n) -;i._environment.pushUndoCommand(o)})),this._environment.endUndoMacro()},e.prototype.setGroupLock=function(e,t){var i=this,r=(t?ce:ue).format({group:e.name()}),n=this._environment.model();this._environment.beginUndoMacro(r),e.lineTools().forEach((function(e){var r=e.properties().frozen,o=new te.SetPropertyUndoCommand(r,t,"",n);i._environment.pushUndoCommand(o)})),this._environment.endUndoMacro()},e.prototype.setGroupName=function(e,t){var i=this._environment.model(),r=he.format({group:e.name(),newName:t}),n=new ie(i,e,t,r);this._environment.pushUndoCommand(n)},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}(),pe=i("3ClC"),fe=i("pQ+n"),_e=window.t("Apply study template {template}"),me=function(e){function t(t,i,r){var n=e.call(this,_e.format({template:r}))||this;return n._model=t,n._templateContent=i,n._initialState=t.studyTemplate(!0,!0),n._initialGroupsState=t.lineToolsGroupModel().state(),n}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=this._merge(this._templateContent).filter(f.isLineTool);this._model.lineToolsGroupModel().removeLineTools(e),this._model.mainSeries().onChartStyleChanged();var t=this._model.mainSeries().properties();Object(z.preparePriceAxisProperties)(t),this._model.recalcVisibleRangeStudy(this._model.dataSources(),!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();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 r=Object(z.getChartStyleByResolution)(e.interval,i.properties().style.value());i.setChartStyleWithIntervalIfNeeded(r,e.interval)}for(var n=t.panes(),o=[],s=n.length;s--;)for(var a=(m=n[s]).containsMainSeries(),l=(v=m.dataSources()).length;l--;){var c=v[l];(!a||Object(pe.isStudy)(c)&&c.isRemovedByStudyTemplates())&&o.push(c)}t.resetDeferredStudies();for(var u=Object(fe.a)(t,o),h=0;h1?"Remove drawings group":"Remove "+e[0].title();this.removeSources(e,!1,t)}},t.prototype.removeSources=function(e,t,i,r){var o=this;r||(e=e.filter((function(e){return e.isUserDeletable()})));var s=this._model(),a=s.lineToolsGroupModel();this.beginUndoMacro(i),s.selectionMacro((function(r){var l=new Map;e.forEach((function(e){if(Object(f.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(re.removeLineTool)({model:o.model(),linkKey:Object(n.ensureNotNull)(e.getLinkKey())})}})),l.forEach((function(e,t){var i=new y.a(s,t,e);o._pushUndoCommand(i)}));var c=new m.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 S.c(this._model(),e,"Merge up");this._mergeUnmergeSource(e,t)},t.prototype.mergeSourceDown=function(e){var t=new S.a(this._model(),e,"Merge down");this._mergeUnmergeSource(e,t)},t.prototype.mergeToPane=function(e,t){var i=this._model().panes().indexOf(t),r=new S.b(this._model(),e,i,"Merge to pane");this._mergeUnmergeSource(e,r)}, -t.prototype.unmergeSourceUp=function(e){var t=new v.c(this._model(),e,"Unmerge up");this._mergeUnmergeSource(e,t)},t.prototype.unmergeSourceDown=function(e){var t=new v.a(this._model(),e,"Unmerge down");this._mergeUnmergeSource(e,t)},t.prototype.unmergeToNewBottomPane=function(e){var t=new v.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(f.isLineTool),r=i.map((function(e){return t.groupForLineTool(e)}));Object(n.assert)(new Set(r).size<=1,"Cannot move line tools from different group");for(var o=0===r.length?null:r[0],s={bringForwardEnabled:!1,bringToFrontEnabled:!1,sendBackwardEnabled:!1,sendToBackEnabled:!1},a=new Set(i),l=function(e){if(Object(f.isLineTool)(e)&&null!==o){var t=Object(b.sortSources)(o.lineTools().filter((function(t){return!a.has(t)||t===e})));return s=Ee(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(n.ensureNotNull)(c._model().paneForSource(e)).allOrderedSourcesWithoutSpecial();if(0===i.length)return"continue";var r=e.zorder(),l=i[0].zorder(),u=i[i.length-1].zorder();s=Ee(s,{bringForwardEnabled:r!==u,bringToFrontEnabled:r!==u,sendBackwardEnabled:r!==l,sendToBackEnabled:r!==l})},c=this,u=0,h=Object(b.sortSources)(e);u20&&(this._pushUndoCommand(new F.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 F.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 F.a(this.model(),t,"Reset Time Scale")),this.model().resetTimeScale()},t.prototype.rearrangePanes=function(e,t){var i=new N(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.movePane=function(e,t){var i=new N(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.pasteLineTool=function(e,t){var i=new be(this.model(),t,e);this._pushUndoCommand(i) +null!==this._currentLineMoveCommand&&(this._currentLineMoveCommand.saveNewState(),this._pushUndoCommand(this._currentLineMoveCommand)),this._currentLineMoveCommand=null},t.prototype.startChangingLinetool=function(e,t,i,r,n){this._currentLineChangeCommand=new g.SaveLineToolStateUndoCommand(this.model(),[e],"Change "+i+"point",!1),this.model().startChangingLinetool(e,t,i,r,n)},t.prototype.changeLinePoint=function(e,t,i){this.model().changeLinePoint(e,t,i)},t.prototype.endChangingLinetool=function(e){this.model().endChangingLinetool(e),null!==this._currentLineChangeCommand&&(this._currentLineChangeCommand.saveNewState(),this._pushUndoCommand(this._currentLineChangeCommand)),this._currentLineChangeCommand=null},t.prototype.setChartStyleProperty=function(e,t,i){if(e.value()!==t){var r=new Y(e,t,this.mainSeries(),i,this.model(),this.chartWidget());this._pushUndoCommand(r),this.emitEvent("setChartStyleProperty"),Object(j.trackChartStyleChanged)(e.value())}},t.prototype.applyStudyTemplate=function(e,t){var i=new me(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.cloneLineTools=function(e,t){for(var i=this,r=0;r1?"Remove drawings group":"Remove "+e[0].title();this.removeSources(e,!1,t)}},t.prototype.removeSources=function(e,t,i,r){var o=this;r||(e=e.filter((function(e){return e.isUserDeletable()})));var s=this._model(),a=s.lineToolsGroupModel();this.beginUndoMacro(i),s.selectionMacro((function(r){var l=new Map;e.forEach((function(e){if(Object(f.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(re.removeLineTool)({model:o.model(),linkKey:Object(n.ensureNotNull)(e.getLinkKey())})}})),l.forEach((function(e,t){var i=new y.a(s,t,e);o._pushUndoCommand(i)}));var c=new m.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 b.c(this._model(),e,"Merge up");this._mergeUnmergeSource(e,t)},t.prototype.mergeSourceDown=function(e){var t=new b.a(this._model(),e,"Merge down");this._mergeUnmergeSource(e,t)},t.prototype.mergeToPane=function(e,t){var i=this._model().panes().indexOf(t),r=new b.b(this._model(),e,i,"Merge to pane");this._mergeUnmergeSource(e,r)}, +t.prototype.unmergeSourceUp=function(e){var t=new v.c(this._model(),e,"Unmerge up");this._mergeUnmergeSource(e,t)},t.prototype.unmergeSourceDown=function(e){var t=new v.a(this._model(),e,"Unmerge down");this._mergeUnmergeSource(e,t)},t.prototype.unmergeToNewBottomPane=function(e){var t=new v.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(f.isLineTool),r=i.map((function(e){return t.groupForLineTool(e)}));Object(n.assert)(new Set(r).size<=1,"Cannot move line tools from different group");for(var o=0===r.length?null:r[0],s={bringForwardEnabled:!1,bringToFrontEnabled:!1,sendBackwardEnabled:!1,sendToBackEnabled:!1},a=new Set(i),l=function(e){if(Object(f.isLineTool)(e)&&null!==o){var t=Object(S.sortSources)(o.lineTools().filter((function(t){return!a.has(t)||t===e})));return s=Ee(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(n.ensureNotNull)(c._model().paneForSource(e)).allOrderedSourcesWithoutSpecial();if(0===i.length)return"continue";var r=e.zorder(),l=i[0].zorder(),u=i[i.length-1].zorder();s=Ee(s,{bringForwardEnabled:r!==u,bringToFrontEnabled:r!==u,sendBackwardEnabled:r!==l,sendToBackEnabled:r!==l})},c=this,u=0,h=Object(S.sortSources)(e);u20&&(this._pushUndoCommand(new F.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 F.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 F.a(this.model(),t,"Reset Time Scale")),this.model().resetTimeScale()},t.prototype.rearrangePanes=function(e,t){var i=new N(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.movePane=function(e,t){var i=new N(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.pasteLineTool=function(e,t){var i=new Se(this.model(),t,e);this._pushUndoCommand(i) ;var r=i.source();return i.needCopyToOtherCharts()&&this.copyToOtherCharts([r]),r},t.prototype.setPriceScaleCurrency=function(e,t){var i=new we.a(e,t,this.chartWidget(),"Change currency");this._pushUndoCommand(i)},t.prototype.setMainSeriesSymbol=function(e){if(this.mainSeries().symbol()!==e){var t=!1;if(this._model().currencyLabelEnabled()&&null!==this.mainSeries().currency()){var i=this._model().availableCurrenciesSet(),r=this.mainSeries().priceScale().currency(i);t=null===r||!r.readOnly&&(null===r.selectedCurrency||r.allCurrenciesAreOriginal||1===r.symbolSourceCount)}this._pushUndoCommand(new Ce(e,this.chartWidget(),t))}},t.prototype.copyToOtherCharts=function(e){var t=this,i=this.mainSeries(),o=i.syncModel(),s=this.timeScale();if(o)for(var a=0,l=e;a0&&(u[0].x===u[1].x?Object(c.drawVerticalLine)(e,Math.round(u[0].x*r),u[0].y*r,u[1].y*r):u[0].y===u[1].y?Object(c.drawHorizontalLine)(e,Math.round(u[0].y*r),u[0].x*r,u[1].x*r):Object(o.drawLine)(e,u[0].x*r,u[0].y*r,u[1].x*r,u[1].y*r)),i.overlayLineEndings&&this._drawEnds(e,l,i.linewidth,r)}},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 r=u.CheckMobile.any()?24:3,n="floatPoints"in i?i.floatPoints:i.points,o=n[0],s=n[1],l=this._extendAndClipLineSegment(o,s,t);if(null!==l&&Object(a.distanceToSegment)(l[0],l[1],e).distance<=r)return this._hittest;return null}, -e.prototype._extendAndClipLineSegment=function(e,t,i){var r=Object(s.ensureNotNull)(this._data);return Object(l.extendAndClipLineSegment)(e,t,i.cssWidth,i.cssHeight,r.extendleft,r.extendright)},e.prototype._drawEnds=function(e,t,i,n){var o=t[0],a=t[1],l=Object(s.ensureNotNull)(this._data);switch(l.leftend){case r.LineEnd.Arrow:d(a,o,e,i,n);break;case r.LineEnd.Circle:h(o,e,i,Object(s.ensureDefined)(l.endstyle),n)}switch(l.rightend){case r.LineEnd.Arrow:d(o,a,e,i,n);break;case r.LineEnd.Circle:h(a,e,i,Object(s.ensureDefined)(l.endstyle),n)}},e}()},pKDv:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("ABCD Pattern");function a(e,t){this._constructor="LineToolABCD";var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("bFMU").ABCDPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return 4},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"ABCD Pattern"},a.prototype.getStylesPropertyPage=function(){return o.LineToolABCDPatternStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("y4pE").AbcdPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolabcd",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolABCD=a},pPtI:function(e,t,i){"use strict";i.r(t),i.d(t,"normalizeIntervalString",(function(){return m})),i.d(t,"isAvailable",(function(){return y})),i.d(t,"setLastUsedResolution",(function(){return g})),i.d(t,"getRangeResolution",(function(){return v})),i.d(t,"getTimeBasedResolution",(function(){return S})),i.d(t,"getDefaultResolution",(function(){return b})),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 T})),i.d(t,"getResolutionsFromSettings",(function(){return L})),i.d(t,"convertResolutionsFromSettings",(function(){return I})),i.d(t,"mergeResolutions",(function(){return M})),i.d(t,"sortResolutions",(function(){return O})),i.d(t,"getCustomResolutions",(function(){return E})),i.d(t,"getTranslatedResolution",(function(){return D})),i.d(t,"getTranslatedResolutionModel",(function(){return V}));i("bSeV"),i("YFKU");var r,n,o,s=i("LxhU"),a=i("n5al"),l=i("Vdly"),c=i("PT1i"),u=i("IVMC"),h=i.n(u),d=i("ogJP"),p=((r={})[s.ResolutionKind.Seconds]=60,r[s.ResolutionKind.Minutes]=1440,r[s.SpecialResolutionKind.Hours]=24,r[s.ResolutionKind.Days]=365,r[s.ResolutionKind.Weeks]=52,r[s.ResolutionKind.Months]=12,r[s.ResolutionKind.Range]=1e3,r[s.ResolutionKind.Invalid]=NaN,r),f=((n={})[s.ResolutionKind.Seconds]=1,n[s.ResolutionKind.Minutes]=2,n[s.SpecialResolutionKind.Hours]=3,n[s.ResolutionKind.Days]=4, -n[s.ResolutionKind.Weeks]=5,n[s.ResolutionKind.Months]=6,n[s.ResolutionKind.Range]=7,n[s.ResolutionKind.Invalid]=8,n),_=((o={})[s.ResolutionKind.Invalid]="",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 y(e){if(s.Interval.isRange(e))return!0;var t=m(e),i=c.linking.supportedResolutions.value(),r=!1;void 0!==i?r=-1!==i.map(m).indexOf(t):r=!0;return(c.linking.intraday.value()||s.Interval.isDWM(e))&&r}function g(e){s.Interval.isValid(e)&&(s.Interval.isRange(e)?l.setValue("chart.lastUsedRangeResolution",e):l.setValue("chart.lastUsedTimeBasedResolution",e))}function v(e){var t=l.getValue("chart.lastUsedRangeResolution");if(void 0!==t&&s.Interval.isRange(t))return t;for(var i="100R",r=0,n=e;r0},ue.prototype.onTagsChanged=function(){return this._tagsChanged},ue.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},ue.prototype.onIntervalChanged=function(){return this._intervalChanged},ue.prototype.onStatusChanged=function(){return this._onStatusChanged},ue.prototype.onStyleChanged=function(){return this._onStyleChanged},ue.prototype.onRestarted=function(){return this._onRestarted},ue.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},ue.prototype.status=function(){return this._status},ue.prototype.isDWM=function(){if(null!==this._isDWMCached)return this._isDWMCached;var e=G.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},ue.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},ue.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._priceLineView=this.hasClosePrice()?new X(this):null;var e=this._properties.style.value();switch(e){case ue.STYLE_BARS:this._paneView=new y(this,this.m_model);break;case ue.STYLE_CANDLES:this._paneView=new m(this,this.m_model);break;case ue.STYLE_LINE:this._paneView=new f(this,this.m_model);break;case ue.STYLE_AREA:this._paneView=new p(this,this.m_model);break;case ue.STYLE_HEIKEN_ASHI:this._paneView=new g(this,this.m_model);break;case ue.STYLE_HOLLOW_CANDLES:this._paneView=new _(this,this.m_model);break;case ue.STYLE_BASELINE:this._paneView=new v(this,this.m_model),this._waterlineView=new b(this);break;case ue.STYLE_HILO:this._paneView=new S(this,this.m_model);break;default:throw Error("Unknown chart style assigned: "+e)}},ue.prototype._clearStylePlot=function(e,t){if(0!==e.size()){var i=t||o(e.firstIndex()),r=o(e.lastIndex())+1;e.range(i,r).each((function(e,t){t[TradingView.STYLE_PLOT]=null}))}},ue.prototype.invalidateBarStylesCache=function(e){F.logDebug("Invalidate style cache starting from "+e),this._clearStylePlot(this.m_data.m_bars,e),this._clearStylePlot(this.m_data.m_nsBars)}, +return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||TradingView.DEFAULT_BAR_COUNT},ue.prototype._nextSymbolId=1,ue.prototype._nextSeriesId=1,Object.assign(ue,W),ue.prototype.model=function(){return this.m_model},ue.prototype.fixLastBar=function(e){},ue.prototype.clearData=function(){this.data().clear()},ue.prototype.data=function(){return this.m_data},ue.prototype.symbolId=function(){return this._symbolId},ue.prototype.seriesId=function(){return this._seriesId},ue.prototype.isPulse=function(){return this._symbolInfo&&this._symbolInfo.resolutions.length>0},ue.prototype.onTagsChanged=function(){return this._tagsChanged},ue.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},ue.prototype.onIntervalChanged=function(){return this._intervalChanged},ue.prototype.onStatusChanged=function(){return this._onStatusChanged},ue.prototype.onStyleChanged=function(){return this._onStyleChanged},ue.prototype.onRestarted=function(){return this._onRestarted},ue.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},ue.prototype.status=function(){return this._status},ue.prototype.isDWM=function(){if(null!==this._isDWMCached)return this._isDWMCached;var e=G.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},ue.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},ue.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._priceLineView=this.hasClosePrice()?new X(this):null;var e=this._properties.style.value();switch(e){case ue.STYLE_BARS:this._paneView=new y(this,this.m_model);break;case ue.STYLE_CANDLES:this._paneView=new m(this,this.m_model);break;case ue.STYLE_LINE:this._paneView=new f(this,this.m_model);break;case ue.STYLE_AREA:this._paneView=new p(this,this.m_model);break;case ue.STYLE_HEIKEN_ASHI:this._paneView=new g(this,this.m_model);break;case ue.STYLE_HOLLOW_CANDLES:this._paneView=new _(this,this.m_model);break;case ue.STYLE_BASELINE:this._paneView=new v(this,this.m_model),this._waterlineView=new S(this);break;case ue.STYLE_HILO:this._paneView=new b(this,this.m_model);break;default:throw Error("Unknown chart style assigned: "+e)}},ue.prototype._clearStylePlot=function(e,t){if(0!==e.size()){var i=t||o(e.firstIndex()),r=o(e.lastIndex())+1;e.range(i,r).each((function(e,t){t[TradingView.STYLE_PLOT]=null}))}},ue.prototype.invalidateBarStylesCache=function(e){F.logDebug("Invalidate style cache starting from "+e),this._clearStylePlot(this.m_data.m_bars,e),this._clearStylePlot(this.m_data.m_nsBars)}, ue.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},ue.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 r=i.barColorer();null===e?e=r:e.pushBackBarColorer(r)}}return null===e?e=new x(this):e.pushBackBarColorer(new x(this)),this._barColorerCache=e,this._barColorerCache},ue.prototype.properties=function(){return this._properties},ue.prototype._barsState=function(e){var t=e.state();return t.data.forEach((function(e){e.value.splice(7,1)})),t},ue.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.currencyId=this.properties().currencyId.value(),t},ue.prototype.restoreState=function(e,t){t&&this._setStatus(ue.STATUS_SNAPSHOT),this._properties.mergeAndFire(e.state),e.currencyId&&this.properties().currencyId.setValue(e.currencyId),this._prevChartStyle=this.properties().style.value(),this.createPaneView(),t&&this.restoreData(e.bars,e.nsBars,e.symbolInfo,e.rtPrice,e.boxSize,e.reversalAmount)},ue.prototype.hasStateForAlert=function(){return!1},ue.prototype.stateForAlert=function(){throw new Error("Not implemented")},ue.prototype.idForAlert=function(){return s.prototype.idForAlert.call(this)},ue.prototype.restoreData=function(e,t,i,r,n,o){this._status=ue.STATUS_SNAPSHOT,this.m_data.m_bars.restoreState(e),this.m_data.m_nsBars.restoreState(t),this.updateSymbolInfo(i,!1),this.m_data.lastProjectionPrice=r,this.m_data.boxSize=n,n||(this.properties().style.value()===ue.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===ue.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=o,o||this.properties().style.value()===ue.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value()),this._loading=!1},ue.prototype.setProperties=function(e){e.timeframe||e.merge({timeframe:""}),e.shortName||e.merge({shortName:""}),e.currencyId||e.addChild("currencyId",new r(null)),this._properties=e,this._properties.symbol.listeners().subscribe(this,ue.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,ue.prototype.changeInterval), this._properties.currencyId.listeners().subscribe(this,ue.prototype.changeCurrency),this._properties.timeframe.listeners().subscribe(this,ue.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,ue.prototype.changeProperties)},ue.prototype.changeSymbol=function(){this.setSymbolIntervalCurrencyDelayed(),this.m_model.checkLineToolSelection()},ue.prototype.changeInterval=function(){this.setSymbolIntervalCurrencyDelayed()},ue.prototype.changeCurrency=function(){this.setSymbolIntervalCurrencyDelayed(),this.m_model.checkLineToolSelection(),this._currencyChanged.fire()},ue.prototype.changeTimeFrame=function(){B("GUI","Change timeframe")},ue.prototype.title=function(){return this.properties().symbol.value()+", "+R(this.properties().interval.value())},ue.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),ie.emit("series_properties_changed",this._id))},ue.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},ue.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},ue.prototype.onData=function(e){var t=this;switch(e.method){case"symbol_resolved":if(e.params[0]!==this._symbolId){F.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()||(B("Symbol",e.params[1].listed_exchange,e.params[1].name),B("Symbol Type",e.params[1].type,e.params[1].listed_exchange));var i=this.symbolInfo().minmov/this.symbolInfo().pricescale,r=this.properties();r.style.value()===ue.STYLE_RENKO&&r.renkoStyle.inputs.boxSize.value()=3&&(this._priceOffset=e[2].price-e[0].price)},a.prototype.setPoint=function(e,t,i){i&&i.shift()&&e<2&&this._snapPoint45Degree(t,this.points()[1-e]),r.prototype.setPoint.call(this,e,t,i),2===e&&this.calculatePriceDiff();var n=this.points()[0];this._points[2].index=n.index,this._points[2].price=n.price+this._priceOffset},a.prototype.pointsCount=function(){return 3},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Parallel Channel"},a.prototype.hasEditableCoordinates=function(){return!1},a.prototype.addPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]),r.prototype.addPoint.call(this,e,t)},a.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset},a.prototype.cloneData=function(e){this._priceOffset=e._priceOffset},a.prototype.restoreData=function(e){ e.priceOffset&&(this._priceOffset=e.priceOffset)},a.prototype.state=function(e){var t=r.prototype.state.call(this,e);return t.priceOffset=this._priceOffset,t},a.prototype.canHasAlert=function(){return!0},a.prototype._getAlertPlots=function(){var e=[].concat(this._points).splice(0,2);function t(e,t){return e.index<=t.index?[e,t]:[t,e]}var i,r,n,o,s=t((e=e.concat([{price:e[0].price+this._priceOffset,time:e[0].time,index:e[0].index},{price:e[1].price+this._priceOffset,time:e[1].time,index:e[1].index}]))[0],e[1]),a=t(e[2],e[3]);this._priceOffset<0?(r=a,i=s):(r=s,i=a);var l=this.properties().extendLeft.value(),c=this.properties().extendRight.value();return e[0].index<=e[1].index?(n=l,o=c):(n=c,o=l),[this._linePointsToAlertPlot(i,"Upper",n,o),this._linePointsToAlertPlot(r,"Lower",n,o)]},a.prototype.getInputsPropertyPage=function(){return null},a.prototype.getStylesPropertyPage=function(){return o.LineToolParallelChannelStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("VkdP").ParallelChannelDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolparallelchannel",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolParallelChannel=a},qckB:function(e,t){e.exports=''},qgcf:function(e,t,i){"use strict";i.r(t),i.d(t,"calculateLabelPosition",(function(){return f})),i.d(t,"wordWrap",(function(){return m})),i.d(t,"TextRenderer",(function(){return M}));var r,n=i("aO4+"),o=i("GEp6"),s=i("Eyy1"),a=i("f6yo"),l=i("Ialn"),c=i("VdBB"),u=i("jFln"),h=i("ogJP"),d=i("ikwP"),p=i("8Uy/");function f(e,t,i,r,o){var s=.5*(t.x+i.x),a=i.y;return t.y>i.y?(a-=e.height/2+r.y,a=Math.max(e.height/2,a)):(a+=e.height/2+r.y,a=Math.min(o-e.height/2,a)),new n.Point(s,a)}function _(){var e=document.createElement("canvas");e.width=0,e.height=0,r=Object(s.ensureNotNull)(e.getContext("2d"))}function m(e,t,i){r||_(),i=Object(h.isString)(i)?parseInt(i):i;var n=(e+="").split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/);if(n[n.length-1]||n.pop(),!Object(h.isNumber)(i)||!isFinite(i)||i<=0)return n;r.font=t;for(var o=[],s=0;s0&&r.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(u=1===u?1:~~(i/r.measureText(p).width*p.length), -r.measureText(p.substr(0,u)).width<=i)for(;r.measureText(p.substr(0,u+1)).width<=i;)u++;else for(;u>1&&r.measureText(p.substr(0,--u)).width>i;);u<1&&(u=1),o.push(p.substr(0,u)),c[0]=p.substr(u),c[1]=""}if(r.measureText(c.join("")).width<=i){o.push(c.join(""));break}}}return o}function y(e,t,i){if(0===i)return e.clone();var r=(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 n.Point(r,o)}function g(e,t){return t+2*P(e)+2*b(e)}function v(e,t){return x(e)*t+C(e)*(t-1)+2*w(e)+2*S(e)}function S(e){return void 0!==e.boxPaddingVert?Math.ceil(e.boxPaddingVert*L(e)):void 0!==e.boxPadding?Math.ceil(e.boxPadding*L(e)):~~(x(e)/3)}function b(e){return void 0!==e.boxPaddingHorz?Math.ceil(e.boxPaddingHorz*L(e)):void 0!==e.boxPadding?Math.ceil(e.boxPadding*L(e)):~~(x(e)/3)}function w(e){return Math.ceil((e.backgroundVertInflate||0)*L(e))}function P(e){return Math.ceil((e.backgroundHorzInflate||0)*L(e))}function C(e){return(e.padding||0)*L(e)}function x(e){return Math.ceil(T(e)*L(e))}function T(e){return e.fontsize||e.fontSize||30}function L(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}function I(e,t,i){var r=t%2?.5:0;return{left:Math.round(e.boxLeft*i)+r,right:Math.round((e.boxLeft+e.boxWidth)*i)+r,top:Math.round(e.boxTop*i)+r,bottom:Math.round((e.boxTop+e.boxHeight)*i)+r}}var M=function(){function e(e,t){this._data=null,this._internalData=null,this._boxSize=null,this._linesInfo=null,this._fontInfo=null,this._hittest=t||new c.HitTestResult(c.HitTestResult.MOVEPOINT),void 0!==e&&this.setData(e)}return e.prototype.setData=function(e){!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;ih?(t=new n.Point(l+h/2,c+h/2),i=new n.Point(l+u-h/2,c+h/2),r=h/2):(t=new n.Point(l+u/2,c+u/2),i=new n.Point(l+u/2,c+h-u/2),r=u/2);var p=y(t,d,s),f=y(i,d,s);return Object(o.distanceToSegment)(p,f,e).distance<=r?this._hittest:null},e.prototype.doesIntersectWithBox=function(e){return null!==this._data&&void 0!==this._data.points&&0!==this._data.points.length&&Object(a.pointInBox)(this._data.points[0],e)},e.prototype.measure=function(){if(null===this._data)return{width:0,height:0};var e=this._getBoxSize();return{width:e.boxWidth,height:e.boxHeight}},e.prototype.setPoints=function(e,t){Object(s.ensureNotNull)(this._data).points=e,this._hittest=t||new c.HitTestResult(c.HitTestResult.MOVEPOINT)},e.prototype.fontStyle=function(e){return null===this._data?"":this._getFontInfo().fontStyle},e.prototype.wordWrap=function(e,t,i){return m(e,i||this.fontStyle(),t)},e.prototype.draw=function(e,t){if(null!==this._data&&void 0!==this._data.points&&0!==this._data.points.length){var i=t.pixelRatio,r=this._getInternalData(),n=this._getRotationPoint().scaled(i);e.save(),e.translate(n.x,n.y),e.rotate(this._data.angle||0),e.translate(-n.x,-n.y);var o=this._getFontInfo().fontSize;if(e.textBaseline=r.textBaseLine,e.textAlign=r.textAlign,e.font=this.fontStyle(),this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){var s=Math.round(~~Math.max(o/12,1)*i);if(this._data.backgroundRoundRect){var a=I(r,s,i),l=a.left,c=a.right,h=a.top,f=a.bottom;Object(u.drawRoundRect)(e,l,h,c-l,f-h,this._data.backgroundRoundRect*i),this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.fill()),this._data.borderColor&&(e.strokeStyle=this._data.borderColor,e.lineWidth=s,e.stroke())}else{if(this._data.backgroundColor){e.fillStyle=this._data.backgroundColor;var _=I(r,s,i),m=(l=_.left,c=_.right,_.top);f=_.bottom;e.fillRect(l,m,c-l,f-m)}if(this._data.borderColor||this._data.highlightBorder){var y=void 0;this._data.borderColor?(e.strokeStyle=this._data.borderColor,e.lineWidth=s,y=I(r,s,i)):(e.strokeStyle=this._data.color,Object(u.setLineStyle)(e,p.LINESTYLE_DASHED),e.lineWidth=Math.max(1,Math.floor(i)),y=I(r,e.lineWidth,i)),e.beginPath(),e.moveTo(y.left,y.top),e.lineTo(y.left,y.bottom),e.lineTo(y.right,y.bottom),e.lineTo(y.right,y.top),e.lineTo(y.left,y.top),e.stroke()}}}e.fillStyle=this._data.color;for(var g=r.textStart,v=r.textTop,S=C(this._data),b=Math.floor(.05*o),w=function(t){Object(d.drawScaled)(e,i,(function(){return e.fillText(t,g,v+b)})),v+=o+S},P=0,x=this._getLinesInfo().lines;Pi&&(t=t.slice(0,i))}this._linesInfo={linesMaxWidth:g(e,this._getLinesMaxWidth(t)),lines:t}}return this._linesInfo},e.prototype._getFontInfo=function(){if(null===this._fontInfo){var e=Object(s.ensureNotNull)(this._data),t=x(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(s.ensureNotNull)(this._data);this._boxSize={boxWidth:g(t,e.linesMaxWidth),boxHeight:v(t,e.lines.length)}}return this._boxSize},e.prototype._getRotationPoint=function(){var e,t,i=this._getInternalData(),r=i.boxLeft,o=i.boxTop,a=i.boxWidth,l=i.boxHeight,c=Object(s.ensureNotNull)(this._data),u=c.horzAlign,h=c.vertAlign;switch(u){case"center":e=r+a/2;break;case"left":e=r;break;case"right":e=r+a}switch(h){case"middle":t=o+l/2;break;case"top":t=o;break;case"bottom":t=o+l}return new n.Point(e,t)},e}()},qySK:function(e,t,i){"use strict";i.d(t,"b",(function(){return l})),i.d(t,"a",(function(){return c}));var r=i("Eyy1"),n=i("JmuD"),o=i("SqfW"),s=i("7Fue"),a=i("xWfy");function l(e){if(!Object(n.isObject)(e))throw new Error("Graphics commands should be wrapped in an object");if(Object(n.hasProperty)(e,"create"),Object(n.hasProperty)(e,"erase")){var t=e.erase;Object(r.assert)(Array.isArray(t),"Collection of erase commands should be array");for(var i=0,o=t;i1&&r.measureText(p.substr(0,--u)).width>i;);u<1&&(u=1),o.push(p.substr(0,u)),c[0]=p.substr(u),c[1]=""}if(r.measureText(c.join("")).width<=i){o.push(c.join(""));break}}}return o}function y(e,t,i){if(0===i)return e.clone();var r=(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 n.Point(r,o)}function g(e,t){return t+2*P(e)+2*S(e)}function v(e,t){return x(e)*t+C(e)*(t-1)+2*w(e)+2*b(e)}function b(e){return void 0!==e.boxPaddingVert?Math.ceil(e.boxPaddingVert*L(e)):void 0!==e.boxPadding?Math.ceil(e.boxPadding*L(e)):~~(x(e)/3)}function S(e){return void 0!==e.boxPaddingHorz?Math.ceil(e.boxPaddingHorz*L(e)):void 0!==e.boxPadding?Math.ceil(e.boxPadding*L(e)):~~(x(e)/3)}function w(e){return Math.ceil((e.backgroundVertInflate||0)*L(e))}function P(e){return Math.ceil((e.backgroundHorzInflate||0)*L(e))}function C(e){return(e.padding||0)*L(e)}function x(e){return Math.ceil(T(e)*L(e))}function T(e){return e.fontsize||e.fontSize||30}function L(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}function I(e,t,i){var r=t%2?.5:0;return{left:Math.round(e.boxLeft*i)+r,right:Math.round((e.boxLeft+e.boxWidth)*i)+r,top:Math.round(e.boxTop*i)+r,bottom:Math.round((e.boxTop+e.boxHeight)*i)+r}}var M=function(){function e(e,t){this._data=null,this._internalData=null,this._boxSize=null,this._linesInfo=null,this._fontInfo=null,this._hittest=t||new c.HitTestResult(c.HitTestResult.MOVEPOINT),void 0!==e&&this.setData(e)}return e.prototype.setData=function(e){!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;ih?(t=new n.Point(l+h/2,c+h/2),i=new n.Point(l+u-h/2,c+h/2),r=h/2):(t=new n.Point(l+u/2,c+u/2),i=new n.Point(l+u/2,c+h-u/2),r=u/2);var p=y(t,d,s),f=y(i,d,s);return Object(o.distanceToSegment)(p,f,e).distance<=r?this._hittest:null},e.prototype.doesIntersectWithBox=function(e){return null!==this._data&&void 0!==this._data.points&&0!==this._data.points.length&&Object(a.pointInBox)(this._data.points[0],e)},e.prototype.measure=function(){if(null===this._data)return{width:0,height:0};var e=this._getBoxSize();return{width:e.boxWidth,height:e.boxHeight}},e.prototype.setPoints=function(e,t){Object(s.ensureNotNull)(this._data).points=e,this._hittest=t||new c.HitTestResult(c.HitTestResult.MOVEPOINT)},e.prototype.fontStyle=function(e){return null===this._data?"":this._getFontInfo().fontStyle},e.prototype.wordWrap=function(e,t,i){return m(e,i||this.fontStyle(),t)},e.prototype.draw=function(e,t){if(null!==this._data&&void 0!==this._data.points&&0!==this._data.points.length){var i=t.pixelRatio,r=this._getInternalData(),n=this._getRotationPoint().scaled(i);e.save(),e.translate(n.x,n.y),e.rotate(this._data.angle||0),e.translate(-n.x,-n.y);var o=this._getFontInfo().fontSize;if(e.textBaseline=r.textBaseLine,e.textAlign=r.textAlign,e.font=this.fontStyle(),this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){var s=Math.round(~~Math.max(o/12,1)*i);if(this._data.backgroundRoundRect){var a=I(r,s,i),l=a.left,c=a.right,h=a.top,f=a.bottom;Object(u.drawRoundRect)(e,l,h,c-l,f-h,this._data.backgroundRoundRect*i),this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.fill()),this._data.borderColor&&(e.strokeStyle=this._data.borderColor,e.lineWidth=s,e.stroke())}else{if(this._data.backgroundColor){e.fillStyle=this._data.backgroundColor;var _=I(r,s,i),m=(l=_.left,c=_.right,_.top);f=_.bottom;e.fillRect(l,m,c-l,f-m)}if(this._data.borderColor||this._data.highlightBorder){var y=void 0;this._data.borderColor?(e.strokeStyle=this._data.borderColor,e.lineWidth=s,y=I(r,s,i)):(e.strokeStyle=this._data.color,Object(u.setLineStyle)(e,p.LINESTYLE_DASHED),e.lineWidth=Math.max(1,Math.floor(i)),y=I(r,e.lineWidth,i)),e.beginPath(),e.moveTo(y.left,y.top),e.lineTo(y.left,y.bottom),e.lineTo(y.right,y.bottom),e.lineTo(y.right,y.top),e.lineTo(y.left,y.top),e.stroke()}}}e.fillStyle=this._data.color;for(var g=r.textStart,v=r.textTop,b=C(this._data),S=Math.floor(.05*o),w=function(t){Object(d.drawScaled)(e,i,(function(){return e.fillText(t,g,v+S)})),v+=o+b},P=0,x=this._getLinesInfo().lines;Pi&&(t=t.slice(0,i))}this._linesInfo={linesMaxWidth:g(e,this._getLinesMaxWidth(t)),lines:t}}return this._linesInfo},e.prototype._getFontInfo=function(){if(null===this._fontInfo){var e=Object(s.ensureNotNull)(this._data),t=x(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(s.ensureNotNull)(this._data);this._boxSize={boxWidth:g(t,e.linesMaxWidth),boxHeight:v(t,e.lines.length)}}return this._boxSize},e.prototype._getRotationPoint=function(){var e,t,i=this._getInternalData(),r=i.boxLeft,o=i.boxTop,a=i.boxWidth,l=i.boxHeight,c=Object(s.ensureNotNull)(this._data),u=c.horzAlign,h=c.vertAlign;switch(u){case"center":e=r+a/2;break;case"left":e=r;break;case"right":e=r+a}switch(h){case"middle":t=o+l/2;break;case"top":t=o;break;case"bottom":t=o+l}return new n.Point(e,t)},e}()},qySK:function(e,t,i){"use strict";i.d(t,"b",(function(){return l})),i.d(t,"a",(function(){return c}));var r=i("Eyy1"),n=i("JmuD"),o=i("SqfW"),s=i("7Fue"),a=i("xWfy");function l(e){if(!Object(n.isObject)(e))throw new Error("Graphics commands should be wrapped in an object");if(Object(n.hasProperty)(e,"create"),Object(n.hasProperty)(e,"erase")){var t=e.erase;Object(r.assert)(Array.isArray(t),"Collection of erase commands should be array");for(var i=0,o=t;ii?i/m:1,f+=g.lineHeight*g.zoom}}var y=Math.max((e-f)/2,0);for(_=0;_=n}},s9sR:function(e,t,i){"use strict";i.r(t),i.d(t,"SetResolutionUndoCommand",(function(){return a}));var r=i("mrSG"),n=i("RDU5"),o=i("LxhU"),s=i("n5al"),a=function(e){function t(t,i,r,n){var o=e.call(this,n)||this;return o._property=t,o._value=i,o._prevValue=t.value(), @@ -622,27 +622,27 @@ e=this._roundPrice(e);var t=this.entryPrice()-1/this._model.mainSeries().base(); a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("LX4V").CyclicAndSineLinesPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolcirclelines",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolCircleLines=a},tWVy:function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return o}));var r=i("aIyQ"),n=new(i.n(r).a);function o(){n.fire()}},"tc+8":function(e,t,i){"use strict";(function(t){function i(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])}i.prototype.merge=function(e,t){var i=null;if(t)var r=(i=[]).length;if(null==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 n=0;nr&&i.push(this),i},i.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)},i.prototype.state=function(e){var t=this._value;void 0===t&&(t={});for(var i=0;i=0},i.prototype.addChild=function(e,t){this[e]=t,-1===this._childs.indexOf(e)&&this._childs.push(e),t.listeners().subscribe(this,i.prototype.childChanged)}, i.prototype.childChanged=function(e,t){this._muteChildChanges||this.listeners().fire(this)},i.prototype.subscribe=function(e,t){this.listeners().subscribe(e,t,!1)},i.prototype.unsubscribe=function(e,t){this.listeners().unsubscribe(e,t)},i.prototype.unsubscribeAll=function(e){this.listeners().unsubscribeAll(e)},i.prototype.childs=function(){return this},e.exports=i}).call(this,i("aIyQ"))},teHb:function(e,t,i){"use strict";i.r(t),i.d(t,"ratioStudyItem",(function(){return s}));var r=i("mrSG"),n=i("7dm8"),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(t,e),t.prototype._doCalculation=function(e,t,i,r){return e*t/(i*r)},t}(n.a),s={name:"Ratio",metainfo:{_metainfoVersion:15,defaults:n.b,plots:n.d,styles:n.e,description:"Ratio",shortDescription:"Ratio",is_price_study:!1,inputs:n.c,id:"Ratio@tv-basicstudies-1"},constructor:o}},tqok:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var r=-2e6},tzRX:function(e,t){e.exports=''},"u+0B":function(e,t,i){"use strict";i.r(t),i.d(t,"TextWidthCache",(function(){return n}));var r=/[2-9]/g,n=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 n=i||r,o=String(t).replace(n,"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 r=i("Zp/P").coordinateIsValid,n=i("gyZD").PaneRendererLine;function o(e){e.forceLineColor=!1,n.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,n),o.prototype._drawImpl=function(e){if(0!==this.items.length){e.lineCap="square",e.strokeStyle=this.lineColor,e.lineWidth=this.lineWidth,e.lineStyle=this.lineStyle,e.lineWidth=1;for(var t=0;t=0&&!r(this.items[i].y);)i--;if(!(t>=i)){e.translate(.5,.5) ;for(var o={},s=this.items,a=t;a<=i;a++){var l=s[a];if(h=l.style?l.style.color:this.lineColor,a=1&&(r+=8*(1+encodeURIComponent(e[i]).length),!(i-1>0&&r+8*(1+encodeURIComponent(e[i-1]).length)>t));i--);return e.slice(i)}(y(e,t).map(g),75497472)}function S(e,t,i,n){if(t!==c||n.id!==u){var o=new Date;if(e<=r.NORMAL&&function(e,t,i,r,n){var o={id:s,message:String(t),subSystemId:r,timestamp:Number(e)};s+=1,i.push(o),void 0!==n&&i.length>n&&i.splice(0,1)}(o,t,i,n.id,n.maxCount),e<=d&&(!n.highRate||_())&&(!l||n.id.match(l))){var a=o.toISOString()+":"+n.id+":"+t;switch(e){case r.DEBUG:console.debug(a);break;case r.INFO:case r.NORMAL:n.color?console.log("%c"+a,"color: "+n.color):console.log(a);break;case r.WARNING:console.warn(a);break;case r.ERROR:console.error(a)}c=t,u=n.id,h&&clearTimeout(h),h=setTimeout((function(){c=null,u=null,h=NaN}),1e3)}}}function b(e,t){void 0===t&&(t={});var i=[];a.push(i);var n=Object.assign(t,{id:e});function o(e){return function(t){return S(e,t,i,n)}}return{logDebug:o(r.DEBUG),logError:o(r.ERROR),logInfo:o(r.INFO),logNormal:o(r.NORMAL),logWarn:o(r.WARNING)}}var w=b("logger"),P=n.lon=function(e,t){m(r.DEBUG),w.logNormal("Debug logging enabled"),p=Boolean(e),l=t||null,x()},C=n.loff=function(){m(r.INFO),w.logInfo("Debug logging disabled")};function x(){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=r.WARNING),m(e), -w.logNormal("Init with settings - level: "+d+", high-rate: "+p)}(),n.performance&&n.performance.now?w.logNormal("Sync logger and perf times, now is "+n.performance.now()):w.logWarn("Perf time is not available")},uPb3:function(e,t,i){"use strict";(function(e,r){i("xrEm");var n=i("u+0B").TextWidthCache,o=i("7KDR").Separator,s=i("5VQP").ContextMenuManager,a=i("i1o5").InvalidationLevel,l=i("ikwP"),c=l.createBoundCanvas,u=l.getContext2D,h=l.drawScaled,d=l.hardResizeCanvas,p=l.clearRect,f=l.fillRect,_=l.Size,m=i("S8xo").MouseEventHandler,y=i("PC8g").trackEvent,g=i("XlJ7").makeFont,v=i("8OdW"),S=i("CW80").isLineTool,b=i("mE5r").PriceAxisesContainer,w=i("1IXQ").PriceAxisWidget,P=i("3/8U").axesHighlightColor,C=i("zDbI").CHART_FONT_FAMILY,x={contextMenuEnabled:!0,timezoneMenuEnabled:!0,pressedMouseMoveScale:!0};function T(t,i,r,n,s){this._options=Object.assign({},x,i),this.chart=t,this._properties=t.properties().scalesProperties,this.contextMenu=null,this._element=document.createElement("tr"),this._backgroundBasedTheme=s;var a=t.model().model().rendererOptionsProvider(),l=this.backgroundColor.bind(this);function u(){throw new Error("Time axis does not support real price scales")}var h=this;var d={titlesProvider:r,stubContextMenuProvider:function(e,t){var i=h.getContextMenuActions(!0),r=n(e,t);return r[r.length-1]===h.chart.actions().scalesProperties?Array.prototype.splice.apply(r,[r.length-2,0,new o].concat(i)):(r.push(new o),r=r.concat(i)),r},backgroundBasedTheme:s,rendererOptionsProvider:a,getBackgroundColor:l};this._onLabelHovered=new e,this._lhsStubContainer=new b(this._properties,w.LHS,u,d,this._options.priceAxisLabelsOptions),this._lhsStubContainer.onLabelHovered().subscribe(this,function(e,t){this._onLabelHovered.fire(e,t)}.bind(this)),this._rhsStubContainer=new b(this._properties,w.RHS,u,d,this._options.priceAxisLabelsOptions),this._rhsStubContainer.onLabelHovered().subscribe(this,function(e,t){this._onLabelHovered.fire(e,t)}.bind(this)),this._element.appendChild(this._lhsStubContainer.getElement()),this._cell=document.createElement("td"),this._element.appendChild(this._cell),this._cell.classList.add("chart-markup-table","time-axis"),this._cell.style.height="25px",this._dv=document.createElement("div"),this._dv.style.width="100%",this._dv.style.height="100%",this._dv.style.position="relative",this._dv.style.overflow="hidden",this._cell.appendChild(this._dv),this._canvasConfiguredHandler=function(){this.chart.model().model().lightUpdate()}.bind(this),this._canvasBinding=c(this._dv,new _(16,16)),this._canvasBinding.subscribeCanvasConfigured(this._canvasConfiguredHandler);var p=this._canvasBinding.canvas;p.style.position="absolute",p.style.zIndex="1",p.style.left="0",p.style.top="0",this._topCanvasConfiguredHandler=function(){this.chart.model().model().lightUpdate()}.bind(this),this._topCanvasBinding=c(this._dv,new _(16,16)),this._topCanvasBinding.subscribeCanvasConfigured(this._topCanvasConfiguredHandler);var f=this._topCanvasBinding.canvas;f.style.position="absolute",f.style.zIndex="2",f.style.left="0",f.style.top="0", +},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"))},uOxu:function(e,t,i){"use strict";i.r(t),i.d(t,"LOGLEVEL",(function(){return r})),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 y})),i.d(t,"serializeLogHistoryEntry",(function(){return g})),i.d(t,"getLogHistory",(function(){return v})),i.d(t,"getLogger",(function(){return S})),i.d(t,"loggingOn",(function(){return P})),i.d(t,"loggingOff",(function(){return C}));var r,n="undefined"!=typeof window?window:{},o=!1;try{localStorage.getItem(""),o=!0}catch(T){}!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"}(r||(r={}));var s=0,a=[],l=null,c=null,u=null,h=NaN,d=r.WARNING,p=!1;function f(){return d}function _(){return p}function m(e){e=Math.max(r.ERROR,Math.min(r.DEBUG,e)),d=e,x()}function y(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 g(e){return new Date(e.timestamp).toISOString()+":"+e.subSystemId+":"+e.message.replace(/"/g,"'")}function v(e,t){return function(e,t){var i,r=0;for(i=e.length-1;i>=1&&(r+=8*(1+encodeURIComponent(e[i]).length),!(i-1>0&&r+8*(1+encodeURIComponent(e[i-1]).length)>t));i--);return e.slice(i)}(y(e,t).map(g),75497472)}function b(e,t,i,n){if(t!==c||n.id!==u){var o=new Date;if(e<=r.NORMAL&&function(e,t,i,r,n){var o={id:s,message:String(t),subSystemId:r,timestamp:Number(e)};s+=1,i.push(o),void 0!==n&&i.length>n&&i.splice(0,1)}(o,t,i,n.id,n.maxCount),e<=d&&(!n.highRate||_())&&(!l||n.id.match(l))){var a=o.toISOString()+":"+n.id+":"+t;switch(e){case r.DEBUG:console.debug(a);break;case r.INFO:case r.NORMAL:n.color?console.log("%c"+a,"color: "+n.color):console.log(a);break;case r.WARNING:console.warn(a);break;case r.ERROR:console.error(a)}c=t,u=n.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 n=Object.assign(t,{id:e});function o(e){return function(t){return b(e,t,i,n)}}return{logDebug:o(r.DEBUG),logError:o(r.ERROR),logInfo:o(r.INFO),logNormal:o(r.NORMAL),logWarn:o(r.WARNING)}}var w=S("logger"),P=n.lon=function(e,t){m(r.DEBUG),w.logNormal("Debug logging enabled"),p=Boolean(e),l=t||null,x()},C=n.loff=function(){m(r.INFO),w.logInfo("Debug logging disabled")};function x(){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=r.WARNING),m(e), +w.logNormal("Init with settings - level: "+d+", high-rate: "+p)}(),n.performance&&n.performance.now?w.logNormal("Sync logger and perf times, now is "+n.performance.now()):w.logWarn("Perf time is not available")},uPb3:function(e,t,i){"use strict";(function(e,r){i("xrEm");var n=i("u+0B").TextWidthCache,o=i("7KDR").Separator,s=i("5VQP").ContextMenuManager,a=i("i1o5").InvalidationLevel,l=i("ikwP"),c=l.createBoundCanvas,u=l.getContext2D,h=l.drawScaled,d=l.hardResizeCanvas,p=l.clearRect,f=l.fillRect,_=l.Size,m=i("S8xo").MouseEventHandler,y=i("PC8g").trackEvent,g=i("XlJ7").makeFont,v=i("8OdW"),b=i("CW80").isLineTool,S=i("mE5r").PriceAxisesContainer,w=i("1IXQ").PriceAxisWidget,P=i("3/8U").axesHighlightColor,C=i("zDbI").CHART_FONT_FAMILY,x={contextMenuEnabled:!0,timezoneMenuEnabled:!0,pressedMouseMoveScale:!0};function T(t,i,r,n,s){this._options=Object.assign({},x,i),this.chart=t,this._properties=t.properties().scalesProperties,this.contextMenu=null,this._element=document.createElement("tr"),this._backgroundBasedTheme=s;var a=t.model().model().rendererOptionsProvider(),l=this.backgroundColor.bind(this);function u(){throw new Error("Time axis does not support real price scales")}var h=this;var d={titlesProvider:r,stubContextMenuProvider:function(e,t){var i=h.getContextMenuActions(!0),r=n(e,t);return r[r.length-1]===h.chart.actions().scalesProperties?Array.prototype.splice.apply(r,[r.length-2,0,new o].concat(i)):(r.push(new o),r=r.concat(i)),r},backgroundBasedTheme:s,rendererOptionsProvider:a,getBackgroundColor:l};this._onLabelHovered=new e,this._lhsStubContainer=new S(this._properties,w.LHS,u,d,this._options.priceAxisLabelsOptions),this._lhsStubContainer.onLabelHovered().subscribe(this,function(e,t){this._onLabelHovered.fire(e,t)}.bind(this)),this._rhsStubContainer=new S(this._properties,w.RHS,u,d,this._options.priceAxisLabelsOptions),this._rhsStubContainer.onLabelHovered().subscribe(this,function(e,t){this._onLabelHovered.fire(e,t)}.bind(this)),this._element.appendChild(this._lhsStubContainer.getElement()),this._cell=document.createElement("td"),this._element.appendChild(this._cell),this._cell.classList.add("chart-markup-table","time-axis"),this._cell.style.height="25px",this._dv=document.createElement("div"),this._dv.style.width="100%",this._dv.style.height="100%",this._dv.style.position="relative",this._dv.style.overflow="hidden",this._cell.appendChild(this._dv),this._canvasConfiguredHandler=function(){this.chart.model().model().lightUpdate()}.bind(this),this._canvasBinding=c(this._dv,new _(16,16)),this._canvasBinding.subscribeCanvasConfigured(this._canvasConfiguredHandler);var p=this._canvasBinding.canvas;p.style.position="absolute",p.style.zIndex="1",p.style.left="0",p.style.top="0",this._topCanvasConfiguredHandler=function(){this.chart.model().model().lightUpdate()}.bind(this),this._topCanvasBinding=c(this._dv,new _(16,16)),this._topCanvasBinding.subscribeCanvasConfigured(this._topCanvasConfiguredHandler);var f=this._topCanvasBinding.canvas;f.style.position="absolute",f.style.zIndex="2",f.style.left="0",f.style.top="0", this._element.appendChild(this._rhsStubContainer.getElement()),this.restoreDefaultCursor(),this.update(),this._minVisibleSpan=v.MINUTE_SPAN,this._mouseEventHandler=new m(this._topCanvasBinding.canvas,this,{treatVertTouchDragAsPageScroll:!0,treatHorzTouchDragAsPageScroll:!1}),this.size=new _(0,0)}T.prototype.destroy=function(){this._mouseEventHandler.destroy(),this._topCanvasBinding.unsubscribeCanvasConfigured(this._topCanvasConfiguredHandler),this._topCanvasBinding.destroy(),this._canvasBinding.unsubscribeCanvasConfigured(this._canvasConfiguredHandler),this._canvasBinding.destroy(),this._rhsStubContainer.onLabelHovered().unsubscribeAll(this),this._lhsStubContainer.onLabelHovered().unsubscribeAll(this),this._lhsStubContainer.destroy(),this._rhsStubContainer.destroy(),this.chart.properties().paneProperties.background.unsubscribeAll(this)},T.prototype.getElement=function(){return this._element},T.prototype.hasCanvas=function(e){return this._canvasBinding.canvas===e||this._topCanvasBinding.canvas===e},T.prototype._BORDER_SIZE=1,T.prototype._OFFSET_SIZE=1,T.prototype._TICK_LENGTH=3,T.prototype.onLabelHovered=function(){return this._onLabelHovered},T.prototype.backgroundColor=function(){return this.chart.model().model().backgroundColor().value()},T.prototype.lineColor=function(){return this._properties.lineColor.value()},T.prototype.textColor=function(){return this._properties.textColor.value()},T.prototype.fontSize=function(){return this._properties.fontSize.value()},T.prototype.baseFont=function(){return g(this.fontSize(),C,"")},T.prototype.baseBoldFont=function(){return g(this.fontSize(),C,"bold")},T.prototype.rendererOptions=function(){this._rendererOptions||(this._rendererOptions={borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new n});var e=this._rendererOptions;if(e.fontSize!==this.fontSize()){var t=this.fontSize();e.fontSize=t,e.font=this.baseFont(),e.font=g(this.fontSize(),C,""),e.paddingTop=Math.ceil(t/2.5),e.paddingBottom=e.paddingTop,e.paddingHorizontal=Math.ceil(t/2),e.baselineOffset=Math.round(this.fontSize()/5),e.widthCache.reset()}return this._rendererOptions},T.prototype._zoomAvailable=function(){return!this.chart.model().timeScale().isEmpty()&&this.chart.model().model().zoomEnabled()&&this._options.pressedMouseMoveScale},T.prototype.mouseDownEvent=function(e){if(this._mousedown||!this._zoomAvailable())return!0;this._mousedown=!0;var t=this.chart.model();t.timeScale().isEmpty()||t.startScaleTime(e.localX)},T.prototype.mouseDownOutsideEvent=function(e){this._zoomAvailable()&&this._mousedown&&(this._mousedown=!1,this.chart.model().endScaleTime(),this.restoreDefaultCursor())},T.prototype.pressedMouseMoveEvent=function(e){if(this._zoomAvailable()){var t=this.chart.model(),i=!1,r=(new Date).valueOf();if(this._lastScrollScaleTime)r-this._lastScrollScaleTime<100&&(i=!0);i||(t.scaleTimeTo(e.localX),this._lastScrollScaleTime=r)}},T.prototype.mouseUpEvent=function(e){this._zoomAvailable()&&(this._mousedown=!1,this.chart.model().endScaleTime(), -this.restoreDefaultCursor())},T.prototype.contextMenuEvent=function(e){this._options.contextMenuEnabled&&this._createContextMenu().then((function(t){t.show(e)}))},T.prototype.mouseEnterEvent=function(e){this.chart.model().model().zoomEnabled()&&this.setCursor("ew-resize")},T.prototype.mouseLeaveEvent=function(e){this.restoreDefaultCursor()},T.prototype._createContextMenu=function(){return s.createMenu(this.getContextMenuActions(),{statName:"TimeScaleContextMenu"})},T.prototype.getContextMenuActions=function(e){var t=this.chart;t.updateActions();var i=t.actions(),n=[];return e||n.push(i.timeScaleReset,new o),this._options.timezoneMenuEnabled&&n.push(i.applyTimeZone),n.push(i.sessionBreaks),r.enabled("charting_library_base")||n.push(i.extendedHours),n},T.prototype.mouseClickEvent=function(e){},T.prototype.mouseDoubleClickEvent=function(e){y("GUI","Double click time scale"),this.chart.model().resetTimeScale()},T.prototype.optimalHeight=function(){var e=this.rendererOptions();return Math.ceil(e.offsetSize+e.borderSize+e.tickLength+e.fontSize+e.paddingTop+e.paddingBottom)},T.prototype.setSizes=function(e,t,i){this.size&&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._cell.style.width=e.w+"px",this._cell.style.height=e.h+"px"),this._lhsStubContainer.setSizes(e.h,t),this._rhsStubContainer.setSizes(e.h,i)},T.prototype._spanIndex=function(e){for(var t=[v.MINUTE_SPAN,v.HOUR_SPAN,v.DAY_SPAN,v.MONTH_SPAN,v.YEAR_SPAN],i=t.length-1;i>0;){if(t[i]<=e)return i;i--}return i},T.prototype._spanOffset=function(e,t){if(t0&&this._hightlightBackground(e,r,t)}var n=i.model().crossHairSource();n.startMeasurePoint()&&this._hightlightBackground(e,n.measurePoints(),t)}},T.prototype.drawTickMarks=function(e,t){var i=this.chart.model().timeScale().marks();if(i&&0!==i.length){var r=i.reduce((function(e,t){return e.span>t.span?e:t}),i[0]).span;r>30&&r<40&&(r=30),e.save(),e.strokeStyle=this.lineColor() +this.restoreDefaultCursor())},T.prototype.contextMenuEvent=function(e){this._options.contextMenuEnabled&&this._createContextMenu().then((function(t){t.show(e)}))},T.prototype.mouseEnterEvent=function(e){this.chart.model().model().zoomEnabled()&&this.setCursor("ew-resize")},T.prototype.mouseLeaveEvent=function(e){this.restoreDefaultCursor()},T.prototype._createContextMenu=function(){return s.createMenu(this.getContextMenuActions(),{statName:"TimeScaleContextMenu"})},T.prototype.getContextMenuActions=function(e){var t=this.chart;t.updateActions();var i=t.actions(),n=[];return e||n.push(i.timeScaleReset,new o),this._options.timezoneMenuEnabled&&n.push(i.applyTimeZone),n.push(i.sessionBreaks),r.enabled("charting_library_base")||n.push(i.extendedHours),n},T.prototype.mouseClickEvent=function(e){},T.prototype.mouseDoubleClickEvent=function(e){y("GUI","Double click time scale"),this.chart.model().resetTimeScale()},T.prototype.optimalHeight=function(){var e=this.rendererOptions();return Math.ceil(e.offsetSize+e.borderSize+e.tickLength+e.fontSize+e.paddingTop+e.paddingBottom)},T.prototype.setSizes=function(e,t,i){this.size&&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._cell.style.width=e.w+"px",this._cell.style.height=e.h+"px"),this._lhsStubContainer.setSizes(e.h,t),this._rhsStubContainer.setSizes(e.h,i)},T.prototype._spanIndex=function(e){for(var t=[v.MINUTE_SPAN,v.HOUR_SPAN,v.DAY_SPAN,v.MONTH_SPAN,v.YEAR_SPAN],i=t.length-1;i>0;){if(t[i]<=e)return i;i--}return i},T.prototype._spanOffset=function(e,t){if(t0&&this._hightlightBackground(e,r,t)}var n=i.model().crossHairSource();n.startMeasurePoint()&&this._hightlightBackground(e,n.measurePoints(),t)}},T.prototype.drawTickMarks=function(e,t){var i=this.chart.model().timeScale().marks();if(i&&0!==i.length){var r=i.reduce((function(e,t){return e.span>t.span?e:t}),i[0]).span;r>30&&r<40&&(r=30),e.save(),e.strokeStyle=this.lineColor() ;var n=this.rendererOptions(),o=n.borderSize+n.tickLength+n.paddingTop+n.fontSize-n.baselineOffset;e.textAlign="center",e.fillStyle=this.lineColor();var s=Math.max(1,Math.floor(t)),a=Math.floor(.5*t),l=Math.round(n.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=r&&e.fillText(n.label,n.coord,o)}})),e.restore()}},T.prototype.drawBackLabels=function(e,t){e.save();var i=new Set,r=this.chart.model(),n=r.dataSources();r.selection().sources().forEach((function(e){i.add(e)})),r.hoveredSource()&&i.add(r.hoveredSource()),r.sourcesBeingMoved().forEach((function(e){i.add(e)}));var o=r.lineBeingEdited()||r.lineBeingCreated();o&&i.add(o),i.add(this.chart.model().crossHairSource()),n=n.concat(r.model().customSources());for(var s=this.rendererOptions(),a=0;a=s)&&(r={value:s,view:o})}}})),i.view&&t.push(i.view),r.view&&t.push(r.view),t},T.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))},T.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,r=this.chart.model(),n=[],o=r.lineBeingEdited()||r.lineBeingCreated();o&&o.timeAxisViews&&((i=o.timeAxisViews())&&i.length&&n.push(i));(this._addViewsOrMaxMin(r.sourcesBeingMoved(),n),this._addViewsOrMaxMin(r.selection().sources(),n),r.hoveredSource()&&!r.selection().isSelected(r.hoveredSource()))&&(r.hoveredSource().timeAxisViews&&(i=r.hoveredSource().timeAxisViews())&&i.length&&n.push(i));(i=r.crossHairSource().timeAxisViews())&&i.length&&n.push(i);var s=this.rendererOptions();n.forEach((function(i){i.forEach((function(i){e.save(),i.renderer().draw(e,s,t),e.restore()}))})),e.restore()},T.prototype.hardResetCanvas=function(){this.size&&(d(this._canvasBinding,this.size),d(this._topCanvasBinding,this.size))},T.prototype.paint=function(e){if(0!==e)if(e!==a.Cursor){var t=u(this._canvasBinding.canvas),i=this._canvasBinding.pixelRatio;if(this.drawBackground(t,i),this.chart.model()){this.drawTickMarks(t,i),this.drawBackLabels(t,i),this.chart.model().crossHairSource().updateAllViews();r=u(this._topCanvasBinding.canvas);this.drawCrossHairLabel(r,i)}this._lhsStubContainer.paint(e),this._rhsStubContainer.paint(e)}else{var r=u(this._topCanvasBinding.canvas) ;this.drawCrossHairLabel(r,this._topCanvasBinding.pixelRatio)}},T.prototype.restoreDefaultCursor=function(){this.setCursor("")},T.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)},T.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)}},T.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=T}).call(this,i("aIyQ"),i("Kxc7"))},"uXw/":function(e,t,i){"use strict";(function(t){var r=i("IiTo"),n=i("LxhU").Interval,o=i("Y7w9").lowerbound,s=i("aIyQ"),a=function(){var e={},a=new Map,l=null,c=new s,u="undefined"!=typeof window?window:t,h=u.PineJsCalendar?u.PineJsCalendar:i("jCNj");function d(){a.forEach((function(t,i){var r=t.symbol,n=t.symbolInfo,o=t.pointsets,s=r;e.hasOwnProperty(s)||(e[s]=[]);var a=function(e,t,i){for(var r=0,n=null,o=0;o0){var c=t.getOffsetSinceLastRealBar(e,l[0],l[1]);c>r&&(r=c,n=l)}}return n}(n,i,o);null!==a&&i.ready()&&i.ensureExtrapolatedTo(n,a[0],a[1]);for(var l=0;l=o)return 0;var c=new r.SessionInfo(e.timezone,e.session,e.holidays,e.corrections),u=_(e,a,c,i,o);if(u>=1e3)return u;return s.findDistanceInBars(i,o,e)}(s,a,t,e[0].value[0]/1e3,i);var l=o(e,1e3*t,(function(e,t){return e.value[0]4*(7-i.spec.weekEndsCount())){d=_/7*(7-i.spec.weekEndsCount())}else{for(var m=0,y={},g=p;g.valueOf()<=f.valueOf();g=h.add_days_considering_dst(i.timezone,g,1)){void 0===y[S=h.get_day_of_week(g)]&&(y[S]=i.spec.isWeekEnd(S)),y[S]&&m++}d=_-m}if(t.isDays())o=Math.ceil(d/t.multiplier());else{var v=t.isSeconds()?t.multiplier():60*t.multiplier();if(_<1)if(i.spec.findSession(i.spec.getWeekIndex(p),h.get_day_of_week(p),h.get_minutes_from_midnight(p)).getEntry()===i.spec.findSession(i.spec.getWeekIndex(f),h.get_day_of_week(f),h.get_minutes_from_midnight(f)).getEntry())return Math.ceil((n-r)/v);var S=i.spec.entries()[0].dayOfWeek(),b=60*i.spec.entries().reduce((function(e,t){return e+(t.dayOfWeek()===S?t.length():0)}),0);o=Math.ceil(d*b/v)}}return o}function m(e,t,i){var n=r.createAligner(t,i);return null!==n&&(e=e.map((function(e){return n.alignTimeIfPossible(1e3*e)/1e3}))),e}return{createPointset:function(e,t,i,r,n,o){var s={guid:e,points:i},c=a.get(r);void 0===c&&(c={symbol:t,symbolInfo:n,session:o,pointsets:[]},a.set(r,c)),c.pointsets.push(s),null===l&&(l=setTimeout(d,0))},removePointset:function(t){var i=[];a.forEach((function(e,r){for(var n=e.pointsets,o=0;o0;)this.removeProperty(this._childs[0]);this._initValues=[];for(var t=0;t4*(7-i.spec.weekEndsCount())){d=_/7*(7-i.spec.weekEndsCount())}else{for(var m=0,y={},g=p;g.valueOf()<=f.valueOf();g=h.add_days_considering_dst(i.timezone,g,1)){void 0===y[b=h.get_day_of_week(g)]&&(y[b]=i.spec.isWeekEnd(b)),y[b]&&m++}d=_-m}if(t.isDays())o=Math.ceil(d/t.multiplier());else{var v=t.isSeconds()?t.multiplier():60*t.multiplier();if(_<1)if(i.spec.findSession(i.spec.getWeekIndex(p),h.get_day_of_week(p),h.get_minutes_from_midnight(p)).getEntry()===i.spec.findSession(i.spec.getWeekIndex(f),h.get_day_of_week(f),h.get_minutes_from_midnight(f)).getEntry())return Math.ceil((n-r)/v);var b=i.spec.entries()[0].dayOfWeek(),S=60*i.spec.entries().reduce((function(e,t){return e+(t.dayOfWeek()===b?t.length():0)}),0);o=Math.ceil(d*S/v)}}return o}function m(e,t,i){var n=r.createAligner(t,i);return null!==n&&(e=e.map((function(e){return n.alignTimeIfPossible(1e3*e)/1e3}))),e}return{createPointset:function(e,t,i,r,n,o){var s={guid:e,points:i},c=a.get(r);void 0===c&&(c={symbol:t,symbolInfo:n,session:o,pointsets:[]},a.set(r,c)),c.pointsets.push(s),null===l&&(l=setTimeout(d,0))},removePointset:function(t){var i=[];a.forEach((function(e,r){for(var n=e.pointsets,o=0;o0;)this.removeProperty(this._childs[0]);this._initValues=[];for(var t=0;tl&&t1?u(e[n],t.slice(1),i):(e[n]&&e[n].setValue?e[n].setValue(i):e[n]=i,!0))}function h(e){i||p.logWarn("Path `"+e+"` does not exist.")}}function y(e,t,i,r){window.__defaultsOverrides&&m(e,t,i,window.__defaultsOverrides,r)} function g(){var e=/^linetool.+/;Object.keys(TradingView.defaultProperties).forEach((function(t){e.test(t)&&y(TradingView.defaultProperties[t],null,!1,t)}))}function v(e,t){return t?function(e,t){var i=_(e);if(!window._UNIT_TESTS){var r=TradingView.clone(TVSettings.getJSON(e,null));if(function(e){var t=new Set(["linetoolregressiontrend"]);return e.startsWith("study_")||t.has(e)}(e)&&r&&function(e){if(!e)return!1;e=e.toString();var t=new RegExp("\\d+").exec(e);return null!==t&&t[0]===e}(r.version)){var n=r.inputs,o=t.updateStudyInputs(r.id,r.version,"last",n,null);r.inputs=o;var s=t.updateStudyState(r,r);r=s}TradingView.merge(i,r)}return i}(e,t):function(e){var t=_(e);if(!window._UNIT_TESTS){var i=TradingView.clone(TVSettings.getJSON(e,null));i&&TradingView.merge(t,i)}return t}(e)}v.create=function(e,t){if(t){var i=_(e);TradingView.defaultProperties[e]=Object.assign(t,i)}},v.remove=function(e){TradingView.defaultProperties[e]=void 0},TradingView.saveDefaults=function(e,t){TVSettings.setJSON(e,t)},TradingView.factoryDefaults=_,window.applyDefaultOverridesToLinetools=g,window.applyDefaultsOverrides=y,window.applyPropertiesOverrides=m,window.defaults=v,t.applyDefaultOverridesToLinetools=g,t.applyDefaultsOverrides=y,t.applyPropertiesOverrides=m,t.defaults=v,t.factoryDefaults=_,t.saveDefaults=TradingView.saveDefaults},wamh:function(e,t,i){"use strict";i.r(t),i.d(t,"ChangeToolBarsThemeUndoCommand",(function(){return s}));var r=i("mrSG"),n=i("EsvI"),o=i("oiZD"),s=function(e){function t(t,i,r){void 0===r&&(r=!0);var n=e.call(this,"Apply Toolbars Theme")||this;return n._prevThemeName=t,n._themeName=i,n._syncState=r,n}return Object(r.__extends)(t,e),t.prototype.undo=function(){Object(n.isStdThemeName)(this._prevThemeName)&&(Object(o.setTheme)(this._prevThemeName),this._syncState&&Object(n.syncTheme)())},t.prototype.redo=function(){Object(n.isStdThemeName)(this._themeName.toLowerCase())&&(Object(o.setTheme)(this._themeName.toLowerCase()),this._syncState&&Object(n.syncTheme)())},t}(i("RDU5").UndoCommand)},wi9r:function(e,t,i){"use strict";(function(e){var t=i("0waE").randomHash;function r(e){this._chartApi=e,this._sessionid="qs_"+t(),this._sessionstarted=!1}r.prototype.destroy=function(){this._sessionstarted&&(this._chartApi.quoteDeleteSession(this._sessionid),this._sessionid=null,this._sessionstarted=!1)},r.prototype.connected=function(){return this._chartApi.connected()},r.prototype.connect=function(e){this._globalHandler=e,this._chartApi.createSession(this._sessionid,this),this._chartApi.connect()},r.prototype.disconnect=function(){this._chartApi.disconnect()},r.prototype.quoteAddSymbols=function(e,t){e=[].concat(e),t&&t.forcePermission&&(e=e.concat({flags:["force_permission"]})),this._chartApi.quoteAddSymbols(this._sessionid,e)},r.prototype.quoteRemoveSymbols=function(e){this._chartApi.quoteRemoveSymbols(this._sessionid,e)},r.prototype.quoteFastSymbols=function(e){this._chartApi.quoteFastSymbols(this._sessionid,e)},r.prototype.quoteSetFields=function(e){this._chartApi.quoteSetFields(this._sessionid,e)}, r.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)},r.prototype.quoteHibernateAll=function(e){this._chartApi.quoteHibernateAll(this._sessionid)},TradingView.QuoteSession=r,e&&e.exports&&(e.exports=r)}).call(this,i("YuTi")(e))},wiuq:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolArrowMarker",(function(){return c}));var r=i("mrSG"),n=i("Ss5c"),o=i("Ocx9"),s=i("tc+8"),a=i.n(s),l=window.t("Arrow Marker"),c=function(e){function t(r,n){var o=e.call(this,r,n||t.createProperties())||this;return o._constructor="LineToolArrowMarker",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(r.__extends)(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.name=function(){return"Trend Line"},t.prototype.translatedType=function(){return l},t.prototype.getStylesPropertyPage=function(){},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(21),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"FxV7")).then((function(e){return e.ArrowMarkerDefinitionsViewModel}))},t._configureProperties=function(e){n.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new a.a("")),e.addExclusion("text")},t}(n.LineDataSource)},wjVR:function(e,t,i){"use strict";i.r(t),i.d(t,"ChartWidgetBase",(function(){return f}));var r=i("mrSG"),n=i("Eyy1"),o=i("ogJP"),s=i("CW80"),a=i("3ClC"),l=i("i1o5"),c=i("GVHu"),u=i("mMWL"),h=i("KnF9"),d={addToWatchlistEnabled:!0,sourceSelectionEnabled:!0,propertyPagesEnabled:!0,paneContextMenuEnabled:!0,priceScaleContextMenuEnabled:!0,currencyLabelEnabled:!1,goToDateEnabled:!1,marketStatusWidgetEnabled:!0,chartWarningWidgetEnabled:!0,paneControlsEnabled:!0,isSymbolAvailable:function(e){return Promise.resolve(!0)},legendWidgetEnabled:!0,chartEventsEnabled:!0,esdEnabled:!1,croppedTickMarks:!0,handleScale:{mouseWheel:!0,pinch:!0,axisPressedMouseMove:!0},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0}};function p(e,t,i){var r=t.mainSeries().syncModel(),n=e.mainSeries().syncModel(),o=i;null!==r&&null!==n&&(o=e.createSyncPoint(r,n).sourceTimeToTargetTime(i));return e.timeScale().points().roughIndex(o,n&&n.distance.bind(n))}var f=function(){function e(e,t){this.activePaneWidget=null,this._model=null,this._paneWidgets=[],this._maximizedPaneWidget=null,this._timeAxisWidget=null,this._paneSeparators=[],this._timeAxisSeparator=null,this._isDestroyed=!1,this._id=t,this._options=Object(o.merge)(Object(o.clone)(d),e),this._subscribeToDrawingState()}return e.prototype.destroy=function(){this._isDestroyed=!0},e.prototype.id=function(){return this._id},e.prototype.timeAxisHeight=function(){ return null!==this._timeAxisWidget?this._timeAxisWidget.size.h:0},e.prototype.images=function(){var e=this;window.TradingView.printing=!0;var t=this.model().selection().sources();this.model().selectionMacro((function(e){return e.clearSelection()}));var i,r=function(t){t.paint(l.InvalidationLevel.Light,e.onWidget());var i=t.getScreenshotData();i.containsMainSeries=t.containsMainSeries(),i.studies=[];for(var r=0,o=t.state().dataSources();rn)){var s,a=this.m_series.bars().range(i,n),l=this.m_series.priceScale(),c=this.m_series.barColorer(),u={};if(a.each((function(i,r){var n,o={};(o.time=Math.round(i),e(r,o))&&(u.value=r,n=r[TradingView.STYLE_PLOT]?r[TradingView.STYLE_PLOT]:c.barStyle(i,!1,u),r[TradingView.STYLE_PLOT]=n,u.previousValue=r,o.color=n.barColor,o.borderColor=n.barBorderColor,o.wickColor=n.barWickColor,o.hollow=n.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=p(i,n);this._selectionData={points:[],bgColor:this.m_model.backgroundColor().value(),visible:!0},this._selectionData.hittestResult=o.REGULAR;for(var d=0;dn)){var s,a=this.m_series.bars().range(i,n),l=this.m_series.priceScale(),c=this.m_series.barColorer(),u={};if(a.each((function(i,r){var n,o={};(o.time=Math.round(i),e(r,o))&&(u.value=r,n=r[TradingView.STYLE_PLOT]?r[TradingView.STYLE_PLOT]:c.barStyle(i,!1,u),r[TradingView.STYLE_PLOT]=n,u.previousValue=r,o.color=n.barColor,o.borderColor=n.barBorderColor,o.wickColor=n.barWickColor,o.hollow=n.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=p(i,n);this._selectionData={points:[],bgColor:this.m_model.backgroundColor().value(),visible:!0},this._selectionData.hittestResult=o.REGULAR;for(var d=0;d=t&&e.y<=i||e.y<=t&&e.y>=i))return new n(n.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,r=this._data.points1,n=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 y in u){var g=u[y];e.beginPath();for(var v=0;v=0;P--)e.lineTo(S[P].timePoint,S[P].point2)}else{var C=S[0].point2;e.lineTo(b+d,w),e.lineTo(b+d,C),e.lineTo(b-d,C),e.lineTo(b-d,w)}}e.closePath(),e.fillStyle=a.generateColor(y,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(),r=this._source.properties().bands[this._bandAKey],n=this._source.properties().bands[this._bandBKey];this._level1=e.priceToCoordinate(r.value.value(),i),this._level2=e.priceToCoordinate(n.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,y=this._source.data().firstIndex();u>y&&(m=uv+_&&hh?u+f:m,b=m;b<=g;++b){if(this._timePoints.push(t.indexToCoordinate(S++)),this._colors){var w=this._source.data().valueAt(b-_);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(b-d),x=this._source.data().valueAt(b-p);if(null!==C&&null!==x){var T=C[this._plotIndex1()],L=x[this._plotIndex2()];this._points1.push(T),this._points2.push(L)}}}}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(){r(!1,"Pure virtual call!")},d.prototype._plotBId=function(){r(!1,"Pure virtual call!")},d.prototype._color=function(){r(!1,"Pure virtual call!")},d.prototype._transparency=function(){r(!1,"Pure virtual call!")},d.prototype._visible=function(){r(!1,"Pure virtual call!")},d.prototype._correctStartBarIndex=function(e){return e}, +;var e,t,i=this.m_series.properties().lineStyle,r={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:i.color.value(),lineStyle:i.linestyle.value(),withMarkers:i.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,lineWidth:i.linewidth.value(),simpleMode:!0};return i.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP?(e=new l).setData(r):e=new a(r),this.m_model.selection().isSelected(this.m_series)?((t=new d).append(e),this._isMarkersEnabled&&t.append(new n(this._selectionData))):t=e,t},inherit(T,C),T.prototype.update=function(){this._invalidated=!0},T.prototype.renderer=function(){this._invalidated&&(C.prototype.update.call(this),this._invalidated=!1);var e={simpleMode:!1};e.barSpacing=this.m_model.timeScale().barSpacing(),e.items=this.m_items,e.lineColor=this.m_series.properties().areaStyle.linecolor.value(),e.lineStyle=this.m_series.properties().areaStyle.linestyle.value(),e.lineWidth=this.m_series.properties().areaStyle.linewidth.value();var t=this.m_series.properties().areaStyle.transparency.value();e.isSeries=!0,e.color1=f.generateColor(this.m_series.properties().areaStyle.color1.value(),t),e.color2=f.generateColor(this.m_series.properties().areaStyle.color2.value(),t),e.bottom=this.m_series.priceScale().height();var i=new d;return i.append(new c(e)),this.m_model.selection().isSelected(this.m_series)&&this._isMarkersEnabled&&i.append(new n(this._selectionData)),i},inherit(L,C),L.prototype.update=function(){this._invalidated=!0},L.prototype._updateImpl=function(){C.prototype.update.call(this);var e=this.m_series.properties().baselineStyle,t=e.transparency.value();this._topFillColor1=f.generateColor(e.topFillColor1.value(),t),this._topFillColor2=f.generateColor(e.topFillColor2.value(),t),this._bottomFillColor1=f.generateColor(e.bottomFillColor1.value(),t),this._bottomFillColor2=f.generateColor(e.bottomFillColor2.value(),t),this._topLineColor=e.topLineColor.value(),this._bottomLineColor=e.bottomLineColor.value(),this._topLineWidth=e.topLineWidth.value(),this._bottomLineWidth=e.bottomLineWidth.value(),this._barSpacing=this.m_model.timeScale().barSpacing(),this._bottom=this.m_series.priceScale().height(),this._baseLevelCoordinate=Math.round(this._bottom*(Math.abs(100-e.baseLevelPercentage.value())/100))},L.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData({items:this.m_items,topFillColor1:this._topFillColor1,topFillColor2:this._topFillColor2,bottomFillColor1:this._bottomFillColor1,bottomFillColor2:this._bottomFillColor2,topLineColor:this._topLineColor,bottomLineColor:this._bottomLineColor,topLineWidth:this._topLineWidth,bottomLineWidth:this._bottomLineWidth,lineStyle:CanvasEx.LINESTYLE_SOLID,barSpacing:this._barSpacing,baseLevelCoordinate:this._baseLevelCoordinate,bottom:this._bottom});var e=new d;return e.append(this._renderer),this.m_model.selection().isSelected(this.m_series)&&e.append(new n(this._selectionData)),e},t.SeriesBarsPaneView=b,t.SeriesCandlesPaneView=S,t.SeriesHollowCandlesPaneView=P, +t.SeriesLinePaneView=x,t.SeriesAreaPaneView=T,t.SeriesHeikenAshiPaneView=w,t.SeriesBaselinePaneView=L,t.SeriesBarCandlesPaneView=g},"x2L+":function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return a}));var r=i("m/cY"),n=i("Vdly");function o(){return n.getBool("Chart.ShowMarketOpenStatus",!0)}var s=Object(r.a)(o());function a(){s.setValue(!0),n.remove("Chart.ShowMarketOpenStatus")}n.onSync.subscribe(null,(function(){return s.setValue(o())})),s.subscribe(null,(function(){return n.setValue("Chart.ShowMarketOpenStatus",s.value())}))},"x40+":function(e,t,i){"use strict";var r=i("Eyy1").assert,n=i("VdBB").HitTestResult,o=i("Zp/P").coordinateIsValid,s=i("0YCj"),a=i("Tmoa"),l=i("Hr11").clamp,c=i("k9/m").PlotRowSearchMode,u=i("cPgM").ScaledPaneRenderer;function h(){u.call(this),this._data=null}function d(e){this._source=e,this._points1=[],this._points2=[],this._timePoints=[],this._getBarSpacing=e.model().timeScale().barSpacing.bind(e.model().timeScale()),this._invalidated=!0,this._areaRenderer=new h,this._plIndex1=null,this._plIndex2=null}function p(e){d.call(this,e)}function f(e,t,i){d.call(this,e),this._isHlineFill=t.type===s.FilledArea.TYPE_HLINES,r(this._isHlineFill||t.type===s.FilledArea.TYPE_PLOTS,"Wrong filledArea type: "+t.type),this._isHlineFill&&this._initBandIndexes(t.objAId,t.objBId),this._fillMetaInfo=t,this._fillStyleProps=i;var n=e._metaInfo;if(t.palette)for(var o in n.plots)if(n.plots[o].palette===t.palette){this._colorPlotOffset=parseInt(o),this._colorsMap=n.palettes[t.palette].valToIndex,this._colorValues=e.properties().palettes[t.palette].colors;break}}inherit(h,u),h.prototype.setData=function(e){this._data=e},h.prototype.hitTest=function(e){if(null===this._data)return null;for(var t,i,r=1;r=t&&e.y<=i||e.y<=t&&e.y>=i))return new n(n.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,r=this._data.points1,n=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 y in u){var g=u[y];e.beginPath();for(var v=0;v=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(y,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(),r=this._source.properties().bands[this._bandAKey],n=this._source.properties().bands[this._bandBKey];this._level1=e.priceToCoordinate(r.value.value(),i),this._level2=e.priceToCoordinate(n.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,y=this._source.data().firstIndex();u>y&&(m=uv+_&&hh?u+f:m,S=m;S<=g;++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),x=this._source.data().valueAt(S-p);if(null!==C&&null!==x){var T=C[this._plotIndex1()],L=x[this._plotIndex2()];this._points1.push(T),this._points2.push(L)}}}}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(){r(!1,"Pure virtual call!")},d.prototype._plotBId=function(){r(!1,"Pure virtual call!")},d.prototype._color=function(){r(!1,"Pure virtual call!")},d.prototype._transparency=function(){r(!1,"Pure virtual call!")},d.prototype._visible=function(){r(!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(r);else{i.clear();var n=t.head(),o=n&&n.text();n&&n.canMerge(r)?n.merge(r):t.push(r);var a=r.text();""!==a&&a!==o&&h.logNormal("DO: "+a)}r.executeOnPush()&&r.redo(),e.length||s.fire(c())}function c(){var e=t.head(),r=i.head();return{enableUndo:!t.isEmpty(),undoText:void 0===e?void 0:e.text(),enableRedo:!i.isEmpty(),redoText:void 0===r?void 0:r.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(r.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 r=new a(e,t,i);l(r),r.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}}}},xUGI:function(e,t,i){"use strict";var r=i("GH0z").PercentageFormatter,n=i("zXvd").NumericFormatter,o=i("zDbI").CHART_FONT_FAMILY,s=i("d1Pk").fibLevelPrice,a=i("ikwP").createDisconnectedBoundCanvas,l=i("ikwP").getPrescaledContext2D,c=i("ikwP").resizeCanvasPreservingContent,u=i("ikwP").Size;function h(e){this._fibLevelsBasedOnLogScaleProperty=e,this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=1,this._actualWidth=1,this._numericFormatter=new n,this._percentageFormatter=new r,this._canvas=a(document,new u(this._actualWidth,h.ROW_HEIGHT*this._actualCapacity)),this._cache=l(this._canvas.canvas)}h.prototype.destroy=function(){this._canvas.destroy(),this._cache=null},h.prototype.levelsCount=function(){return 0},h.prototype.topByRow=function(e){return e*h.ROW_HEIGHT},h.prototype.rowHeight=function(e){return h.ROW_HEIGHT},h.prototype.devicePixelRatio=function(){return this._canvas&&this._canvas.pixelRatio||0},h.prototype._recreateCanvas=function(e,t){this._canvas=c(this._canvas,new u(e,t)),this._cache=l(this._canvas.canvas),this._cache.font="12px "+o},h.prototype.canvas=function(){return this._canvas.canvas},h.ROW_HEIGHT=14,h.prototype.points=function(e){return[e.points()[0],e.points()[1]]},h.prototype.startPoint=function(e,t){ -var i=t?e.points()[0].price:e.points()[1].price;if(!this._calculateLogLevels(e))return{price:i};var r=e.ownerSource().firstValue();return{price:i,coordinate:e.priceScale().priceToCoordinate(i,r)}},h.prototype.priceRange=function(e,t){var i=this.points(e),r=i[0],n=i[1],o=t?n.price-r.price:r.price-n.price;if(!this._calculateLogLevels(e))return{price:o};var s=e.priceScale(),a=e.ownerSource().firstValue(),l=s.priceToCoordinate(r.price,a),c=s.priceToCoordinate(n.price,a);return{price:o,coordinate:t?c-l:l-c}},h.prototype.sourceIsReady=function(e){return e.points().length>=2},h.prototype._calculateLogLevels=function(e){return e.fibLevelsBasedOnLogScale&&e.fibLevelsBasedOnLogScale()},h.prototype._calculateWidth=function(e){if(!this.sourceIsReady(e))return null;var t=l(this.canvas());t.font="12px "+o;var i=!!e.properties().showPrices&&e.properties().showPrices.value(),r=!!e.properties().coeffsAsPercents&&e.properties().coeffsAsPercents.value(),n=e.properties().showCoeffs.value(),a=this.points(e),c=a[0],u=a[1];if(!c||!u)return null;var h=e.ownerSource().firstValue();if(null===h)return 0;var d=!1,p=e.properties();p.reverse&&p.reverse.value()&&(d=p.reverse.value());for(var f=this.startPoint(e,d),_=this.priceRange(e,d),m=this._calculateLogLevels(e),y=0,g=[],v=1;v<=this.levelsCount();v++){var S=p["level"+v].coeff.value(),b="";if(n&&(b+=r?this._percentageFormatter.format(Math.round(1e4*S)/100):this._numericFormatter.format(S)),i){var w=e.priceScale(),P=s(f,_,S,w,h,m);b+="("+w.formatPrice(P,h)+")"}var C={text:b,left:y,width:t.measureText(b).width+4};g.push(C),y+=C.width}return{totalWidth:y,cells:g}},h.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 r=e.priceScale();r&&(r.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 n=1;n<=this.levelsCount();n++){var o=i["level"+n],s={coeff:o.coeff.value(),color:o.color.value()};t.items.push(s)}return t},h.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,h.ROW_HEIGHT*this._actualCapacity)),t},h.prototype._repaintSource=function(e,t,i){var r=h.ROW_HEIGHT*i.row,n=l(this.canvas());n.clearRect(0,r,this._actualWidth,h.ROW_HEIGHT),n.textBaseline="bottom",n.font="12px "+o,r+=h.ROW_HEIGHT;for(var s=0;s=2},h.prototype._calculateLogLevels=function(e){return e.fibLevelsBasedOnLogScale&&e.fibLevelsBasedOnLogScale()},h.prototype._calculateWidth=function(e){if(!this.sourceIsReady(e))return null;var t=l(this.canvas());t.font="12px "+o;var i=!!e.properties().showPrices&&e.properties().showPrices.value(),r=!!e.properties().coeffsAsPercents&&e.properties().coeffsAsPercents.value(),n=e.properties().showCoeffs.value(),a=this.points(e),c=a[0],u=a[1];if(!c||!u)return null;var h=e.ownerSource().firstValue();if(null===h)return 0;var d=!1,p=e.properties();p.reverse&&p.reverse.value()&&(d=p.reverse.value());for(var f=this.startPoint(e,d),_=this.priceRange(e,d),m=this._calculateLogLevels(e),y=0,g=[],v=1;v<=this.levelsCount();v++){var b=p["level"+v].coeff.value(),S="";if(n&&(S+=r?this._percentageFormatter.format(Math.round(1e4*b)/100):this._numericFormatter.format(b)),i){var w=e.priceScale(),P=s(f,_,b,w,h,m);S+="("+w.formatPrice(P,h)+")"}var C={text:S,left:y,width:t.measureText(S).width+4};g.push(C),y+=C.width}return{totalWidth:y,cells:g}},h.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 r=e.priceScale();r&&(r.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 n=1;n<=this.levelsCount();n++){var o=i["level"+n],s={coeff:o.coeff.value(),color:o.color.value()};t.items.push(s)}return t},h.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,h.ROW_HEIGHT*this._actualCapacity)),t},h.prototype._repaintSource=function(e,t,i){var r=h.ROW_HEIGHT*i.row,n=l(this.canvas());n.clearRect(0,r,this._actualWidth,h.ROW_HEIGHT),n.textBaseline="bottom",n.font="12px "+o,r+=h.ROW_HEIGHT;for(var s=0;sthis._actualWidth&&(this._recreateCanvas(o.totalWidth,h.ROW_HEIGHT*this._actualCapacity),this._actualWidth=o.totalWidth);i=this._sourcesToRow[e.id()];this._repaintSource(o,n,i),this._sourcesToRow[e.id()].effectiveState=n,this._sourcesToRow[e.id()].preparedCells=o}else this._sourcesToRow[e.id()].effectiveState=null}return this._sourcesToRow[e.id()]},e.exports=h},xWfy:function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return l})),i.d(t,"d",(function(){return c}));var r=i("tqok"),n=i("SqfW"),o=i("7Fue"),s=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,"data"===e){var i=t;this._indexes=i.indexes,this._vertlines=(s=i.vertlines,a=this._indexes,l=n.b,c=new Map,s.forEach((function(e,t){var i=c.get(t)||new Set;e.forEach((function(e){var t=l(e,a);null!==t&&i.add(t)})),c.set(t,i)})),c)}else if("state"===e){var r=t;this._indexes=r.indexes||[],this._vertlines=function(e,t,i){var r=new Map;if(void 0===e)return r;for(var n=function(e){var n=e.styleId,o=r.get(n)||new Set;e.data.forEach((function(e){var r=i(e,t);null!==r&&o.add(r)})),r.set(n,o)},o=0,s=e;o0?a:void 0),c}},xdS3:function(e,t,i){},xnA2:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("xUGI"),s=i("hayr").propertyPages,a=window.t("Fib Channel");function l(){o.call(this)}function c(e,t){this._constructor="LineToolFibChannel";var n=t||c.createProperties();r.call(this,e,n),this.version=c.version,e._fibChannelLabelsCache||(e._fibChannelLabelsCache=new l),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(l,o),l.prototype.levelsCount=function(){return c.LevelsCount},inherit(c,r),c.LevelsCount=24,c.version=2,c.prototype.levelsCount=function(){return c.LevelsCount},c.prototype.migrateVersion=function(e,t,i){i.properties.removeProperty("reverse")},c.prototype.pointsCount=function(){return 3},c.prototype.translatedType=function(){return a},c.prototype.name=function(){return"Fib Channel" },c.prototype.processErase=function(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},c.prototype.getStylesPropertyPage=function(){return s.LineToolFibChannelStylesPropertyPage},c.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("17v9").FibDrawingsWith24LevelsDefinitionsViewModel}.bind(null,i)).catch(i.oe)},c.createProperties=function(e){var t=new n("linetoolfibchannel",e,!1,{range:[1,24],names:["coeff","color","visible"]});return c._configureProperties(t),t},c._configureProperties=function(e){r._configureProperties(e)},t.LineToolFibChannel=c},xo8u:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var r=i("mrSG"),n=i("Eyy1"),o=function(e){function t(t,i,r,o){var s=e.call(this,o)||this;s._newSourcesCurrencies=new Map,s._oldSourcesCurrencies=new Map,s._showFade=!1,s._chartWidget=r;for(var a=r.model().mainSeries(),l=0,c=t.seriesLikeSources();l0&&(r=Object.assign({},this._points[0]),this._points.unshift(r))}},f.prototype.applyTemplate=function(e){delete e.background,delete e.backgroundColor,delete e.showBackground,r.prototype.applyTemplate.call(this,e)},f.prototype.translatedType=function(){return"Elliott Labels"},f.prototype.name=function(){return"Elliott Labels"},f.prototype.additionalActions=function(e){var t=this;return[new n({label:window.t("Degree"),subItems:a.map((function(i){var r=p.filter((function(e){return e.value===i}))[0];return new n({label:r.title,checkable:!0,checked:t.properties().degree.value()===i,onExecute:function(){e.setProperty(t.properties().degree,i,"Change Elliott Degree")}})}))})]},f.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]}},f.prototype.getStylesPropertyPage=function(){return s.LineToolElliottStylesPropertyPage},f.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("UHSU").ElliottPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},f.prototype.availableDegreesValues=function(){return p},f.prototype.getDegrees=function(){return p.map((function(e){return e.title}))}, -f.createProperties=function(e){var t=new o("linetoolelliott",e);return f._configureProperties(t),t},f._configureProperties=function(e){r._configureProperties(e)},inherit(_,f),_.prototype.pointsCount=function(){return 6},_._configureProperties=function(e){f._configureProperties(e)},inherit(m,_),m._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"]],m.prototype.translatedType=function(){return l},m.prototype.name=function(){return"Elliott Impulse Wave (12345)"},m.prototype.labelsGroup=function(){return m._labelsGroups},m.createProperties=function(e){var t=new o("linetoolelliottimpulse",e);return m._configureProperties(t),t},m._configureProperties=function(e){_._configureProperties(e)},inherit(y,_),y._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"]],y.prototype.translatedType=function(){return c},y.prototype.name=function(){return"Elliott Triangle Wave (ABCDE)"},y.prototype.labelsGroup=function(){return y._labelsGroups},y.createProperties=function(e){var t=new o("linetoolelliotttriangle",e);return y._configureProperties(t),t},y._configureProperties=function(e){_._configureProperties(e)},inherit(g,_),g._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"]],g.prototype.translatedType=function(){return u},g.prototype.name=function(){return"Elliott Triple Combo Wave (WXYXZ)"},g.prototype.labelsGroup=function(){return g._labelsGroups},g.createProperties=function(e){var t=new o("linetoolelliotttriplecombo",e);return g._configureProperties(t),t},g._configureProperties=function(e){_._configureProperties(e)},inherit(v,f),v.prototype.pointsCount=function(){return 4},v._configureProperties=function(e){f._configureProperties(e)},inherit(S,v),S._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],S.prototype.translatedType=function(){return h},S.prototype.name=function(){return"Elliott Correction Wave (ABC)"},S.prototype.labelsGroup=function(){return S._labelsGroups},S.createProperties=function(e){var t=new o("linetoolelliottcorrection",e);return S._configureProperties(t),t},S._configureProperties=function(e){v._configureProperties(e)},inherit(b,v),b._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],b.prototype.translatedType=function(){return d},b.prototype.name=function(){return"Elliott Double Combo Wave (WXY)"},b.prototype.labelsGroup=function(){return b._labelsGroups},b.createProperties=function(e){var t=new o("linetoolelliottdoublecombo",e);return b._configureProperties(t),t},b._configureProperties=function(e){v._configureProperties(e)},t.LineToolElliott=f,t.LineToolElliottImpulse=m,t.LineToolElliottTriangle=y,t.LineToolElliottTripleCombo=g,t.LineToolElliottCorrection=S,t.LineToolElliottDoubleCombo=b},xzdg:function(e,t,i){"use strict" +;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function _(e,t){f.call(this,e,t)}function m(e,t){this._constructor="LineToolElliottImpulse";var i=t||m.createProperties();_.call(this,e,i)}function y(e,t){this._constructor="LineToolElliottTriangle";var i=t||y.createProperties();_.call(this,e,i)}function g(e,t){this._constructor="LineToolElliottTripleCombo";var i=t||g.createProperties();_.call(this,e,i)}function v(e,t){f.call(this,e,t)}function b(e,t){this._constructor="LineToolElliottCorrection";var i=t||b.createProperties();v.call(this,e,i)}function S(e,t){var i=t||S.createProperties();v.call(this,e,i),this._constructor="LineToolElliottDoubleCombo"}inherit(f,r),f.version=4,f.migrateState=function(e){var t={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinor"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottCircle"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize]),"LineToolElliottMajorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize])},f.prototype.migrateVersion=function(e,t,i){if(i.properties.hasChild("background")&&i.properties.removeProperty("background"),i.properties.hasChild("backgroundColor")&&i.properties.removeProperty("backgroundColor"),i.properties.hasChild("showBackground")&&i.properties.removeProperty("showBackground"),1===e){var r=Object.assign({},this._timePoint[0]);this._timePoint.unshift(r),this._points.length>0&&(r=Object.assign({},this._points[0]),this._points.unshift(r))}},f.prototype.applyTemplate=function(e){delete e.background,delete e.backgroundColor,delete e.showBackground,r.prototype.applyTemplate.call(this,e)},f.prototype.translatedType=function(){return"Elliott Labels"},f.prototype.name=function(){return"Elliott Labels"},f.prototype.additionalActions=function(e){var t=this;return[new n({label:window.t("Degree"),subItems:a.map((function(i){var r=p.filter((function(e){return e.value===i}))[0];return new n({label:r.title,checkable:!0,checked:t.properties().degree.value()===i,onExecute:function(){e.setProperty(t.properties().degree,i,"Change Elliott Degree")}})}))})]},f.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]}},f.prototype.getStylesPropertyPage=function(){return s.LineToolElliottStylesPropertyPage},f.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("UHSU").ElliottPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},f.prototype.availableDegreesValues=function(){return p},f.prototype.getDegrees=function(){return p.map((function(e){return e.title}))}, +f.createProperties=function(e){var t=new o("linetoolelliott",e);return f._configureProperties(t),t},f._configureProperties=function(e){r._configureProperties(e)},inherit(_,f),_.prototype.pointsCount=function(){return 6},_._configureProperties=function(e){f._configureProperties(e)},inherit(m,_),m._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"]],m.prototype.translatedType=function(){return l},m.prototype.name=function(){return"Elliott Impulse Wave (12345)"},m.prototype.labelsGroup=function(){return m._labelsGroups},m.createProperties=function(e){var t=new o("linetoolelliottimpulse",e);return m._configureProperties(t),t},m._configureProperties=function(e){_._configureProperties(e)},inherit(y,_),y._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"]],y.prototype.translatedType=function(){return c},y.prototype.name=function(){return"Elliott Triangle Wave (ABCDE)"},y.prototype.labelsGroup=function(){return y._labelsGroups},y.createProperties=function(e){var t=new o("linetoolelliotttriangle",e);return y._configureProperties(t),t},y._configureProperties=function(e){_._configureProperties(e)},inherit(g,_),g._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"]],g.prototype.translatedType=function(){return u},g.prototype.name=function(){return"Elliott Triple Combo Wave (WXYXZ)"},g.prototype.labelsGroup=function(){return g._labelsGroups},g.createProperties=function(e){var t=new o("linetoolelliotttriplecombo",e);return g._configureProperties(t),t},g._configureProperties=function(e){_._configureProperties(e)},inherit(v,f),v.prototype.pointsCount=function(){return 4},v._configureProperties=function(e){f._configureProperties(e)},inherit(b,v),b._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],b.prototype.translatedType=function(){return h},b.prototype.name=function(){return"Elliott Correction Wave (ABC)"},b.prototype.labelsGroup=function(){return b._labelsGroups},b.createProperties=function(e){var t=new o("linetoolelliottcorrection",e);return b._configureProperties(t),t},b._configureProperties=function(e){v._configureProperties(e)},inherit(S,v),S._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],S.prototype.translatedType=function(){return d},S.prototype.name=function(){return"Elliott Double Combo Wave (WXY)"},S.prototype.labelsGroup=function(){return S._labelsGroups},S.createProperties=function(e){var t=new o("linetoolelliottdoublecombo",e);return S._configureProperties(t),t},S._configureProperties=function(e){v._configureProperties(e)},t.LineToolElliott=f,t.LineToolElliottImpulse=m,t.LineToolElliottTriangle=y,t.LineToolElliottTripleCombo=g,t.LineToolElliottCorrection=b,t.LineToolElliottDoubleCombo=S},xzdg:function(e,t,i){"use strict" ;i.r(t);var r=i("Eyy1"),n=i("YFKU"),o=i("7KDR"),s=i("ikwP"),a=i("ogJP"),l=i("jFln"),c=i("u+0B"),u=i("XlJ7"),h=i("PC8g"),d=i("zDbI"),p=i("Hr11"),f=i("Kxc7").enabled("charting_library_debug_mode"),_=function(){function e(e,t,i,r){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,r)}return e.prototype.destroy=function(){delete this._textWidthCache,this._keys=[],this._hash.clear()},e.prototype.paintTo=function(e,t,i,r,n){var o=this._getLabelImage(e,t);if("left"!==n){var a=Object(s.getCanvasDevicePixelRatio)(e.canvas);i-=Math.floor(o.textWidth*a)}r-=Math.ceil(o.height/2),e.drawImage(o.canvas,i,r,o.width,o.height)},e.prototype.getLabelHeight=function(e,t){return this._getLabelImage(e,t).height},e.prototype._getLabelImage=function(e,t){var i,n=this;if(this._hash.has(t))i=Object(r.ensureDefined)(this._hash.get(t));else{if(this._keys.length>=200){var o=Object(r.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=n._font,e.fillStyle=n._color,e.fillText(t,0,d-l-c)}))}return i},e}(),m=i("ljE9"),y=i("+cnz"),g=i("CxTi"),v=function(){function e(){var e=this;this._width=null,this._currencyInfo=null,this._fontSize=0,this._currencyLabelWrapper=document.createElement("div"),this._currencyLabelWrapper.className=g["price-axis-currency-label-wrapper"],this._currencyLabel=document.createElement("span"),this._currencyLabel.className=g["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=g["price-axis-currency-label-text"],this._currencyLabel.appendChild(this._currencyText),this._arrowDown=document.createElement("span"),this._arrowDown.className=g["price-axis-currency-label-arrow-down"],this._arrowDown.innerHTML=y,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,r){var n=this._currencyText.textContent;if(null!==n){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(g.css_value_currency_label_radius)*i);Object(l.drawRoundRect)(e,o-c,f,2*c,_,m),e.fillStyle=h.backgroundColor,e.fill();var y=Math.max(1,Math.floor(i));e.lineWidth=y,e.strokeStyle=r?g.css_value_border_color_dark:g.css_value_border_color_light,Object(l.drawRoundRect)(e,o-c+y/2,f+y/2,2*c-y,_-y,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(n,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(n.t)("Mixed"):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(g.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(g.css_value_currency_label_top)},e.prototype._tooltipContent=function(){return null===this._currencyInfo?"":null===this._currencyInfo.selectedCurrency?Array.from(this._currencyInfo.currencies).join(", "):""},e}(),S=i("mrSG");i.d(t,"PriceAxisWidgetBase",(function(){return w}));var b={contextMenuEnabled:!0,currencyLabelEnabled:!1,contextMenu:{general:!0,source:!0},pressedMouseMoveScale:!0,croppedTickMarks:!0},w=function(){function e(e,t,i,r,n){var o=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._options=Object(a.merge)(Object(a.clone)(b),r),this._rendererOptionsProvider=n, +;return this._width=e.right-e.left+1+8,this._width},e.prototype.drawLabel=function(e,t,i,r){var n=this._currencyText.textContent;if(null!==n){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(g.css_value_currency_label_radius)*i);Object(l.drawRoundRect)(e,o-c,f,2*c,_,m),e.fillStyle=h.backgroundColor,e.fill();var y=Math.max(1,Math.floor(i));e.lineWidth=y,e.strokeStyle=r?g.css_value_border_color_dark:g.css_value_border_color_light,Object(l.drawRoundRect)(e,o-c+y/2,f+y/2,2*c-y,_-y,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(n,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(n.t)("Mixed"):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(g.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(g.css_value_currency_label_top)},e.prototype._tooltipContent=function(){return null===this._currencyInfo?"":null===this._currencyInfo.selectedCurrency?Array.from(this._currencyInfo.currencies).join(", "):""},e}(),b=i("mrSG");i.d(t,"PriceAxisWidgetBase",(function(){return w}));var S={contextMenuEnabled:!0,currencyLabelEnabled:!1,contextMenu:{general:!0,source:!0},pressedMouseMoveScale:!0,croppedTickMarks:!0},w=function(){function e(e,t,i,r,n){var o=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._options=Object(a.merge)(Object(a.clone)(S),r),this._rendererOptionsProvider=n, this._cell=document.createElement("div"),this._cell.className="price-axis",this._cell.style.width="25px",this._cell.style.left="0",this._canvasConfiguredHandler=function(){o._recreateTickMarksCache(o._rendererOptionsProvider.options()),o._undoModel.model().lightUpdate()},this._canvasBinding=Object(s.createBoundCanvas)(this._cell,new s.Size(16,16)),this._canvasBinding.subscribeCanvasConfigured(this._canvasConfiguredHandler);var l=this._canvasBinding.canvas;l.style.position="absolute",l.style.zIndex="1",l.style.left="0",l.style.top="0",this._topCanvasConfiguredHandler=function(){return o._undoModel.model().lightUpdate()},this._topCanvasBinding=Object(s.createBoundCanvas)(this._cell,new s.Size(16,16)),this._topCanvasBinding.subscribeCanvasConfigured(this._topCanvasConfiguredHandler);var u=this._topCanvasBinding.canvas;u.style.position="absolute",u.style.zIndex="2",u.style.left="0",u.style.top="0",this._options.currencyLabelEnabled?(this._currencyLabel=new v,this._cell.appendChild(this._currencyLabel.element()),this._currencyLabel.labelElement().addEventListener("click",(function(e){return o._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,n[0].label),this._widthCache.measureText(i,n[n.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(r.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(r.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(r.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.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().availableCurrenciesSet());null!==e&&this._properties.childs().showCurrency.value()?(this._currencyLabel.show(),this._currencyLabel.updateColors(this.backgroundColor(),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(r.ensureNotNull)(this._currencyLabel).currencyInfo();if(null===t||t.readOnly)return[];var i=[],s=function(e,t,i,r){return new o.Action({label:e,checkable:!0,checked:t,onExecute:i,statName:r})},a=t.selectedCurrency,l=t.originalCurrencies;if(l.size>1){var c=s(Object(n.t)("Mixed"),null===t.selectedCurrency,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),null)}),"Mixed");i.push(c)}if(null!==a){var u=s(a,!0,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),a)}),a);i.push(u)}var h=Array.from(this._pane.state().model().availableCurrenciesSet()),d=h.filter((function(e){return e!==a&&l.has(e)}));d.sort();for(var p=function(r){i.push(s(r,t.selectedCurrency===r,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),r)}),r))},f=0,_=d;f<_.length;f++){p(_[f])}(null!==a||d.length>0)&&i.push(new o.Separator);var m=h.filter((function(e){return e!==a&&!l.has(e)}));m.sort();for(var y=function(r){i.push(s(r,t.selectedCurrency===r,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),r)}),r))},g=0,v=m;g1){var c=s(Object(n.t)("Mixed"),null===t.selectedCurrency,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),null)}),"Mixed");i.push(c)}if(null!==a){var u=s(a,!0,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),a)}),a);i.push(u)}var h=Array.from(this._pane.state().model().availableCurrenciesSet()),d=h.filter((function(e){return e!==a&&l.has(e)}));d.sort();for(var p=function(r){i.push(s(r,t.selectedCurrency===r,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),r)}),r))},f=0,_=d;f<_.length;f++){p(_[f])}(null!==a||d.length>0)&&i.push(new o.Separator);var m=h.filter((function(e){return e!==a&&!l.has(e)}));m.sort();for(var y=function(r){i.push(s(r,t.selectedCurrency===r,(function(){return e._undoModel.setPriceScaleCurrency(e.priceScale(),r)}),r))},g=0,v=m;gt.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(n.setLineStyle)(e,this._data.linestyle);var r=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(r*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 r,n=i("mrSG"),o=i("Eyy1"),s=i("0YCj"),a=i.n(s),l=i("23IT"),c=i("ogJP"),u=i("uOxu"),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 r=i.target;if(e.has(r))return!1;e.add(r);var n=Object(o.ensureDefined)(t.ohlcPlots);return!Object(o.ensureDefined)(n[r]).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),r=Object(n.__assign)({},_),s=0,a=i;s=1e-15&&e<1?e.toFixed(15).replace(/\.?0+$/,""):String(e)},e}()},zZ2k:function(e,t,i){"use strict";i.r(t);var r=i("mrSG"),n=i("Eyy1"),o=i("fgLi"),s=i("hY0g"),a=i.n(s),l=i("KcY8"),c=function(e){function t(t,i,r){var n=e.call(this)||this;return n._source=t,n._priceScale=i,n._priceProvider=r,n}return Object(r.__extends)(t,e),t.prototype.setHitTestData=function(e){this._hitTestData=e},t.prototype._updateRendererData=function(e,t,i){e.visible=!1,t.visible=!1;var r=this._priceScale.mainSource(),n=null!==r?r.firstValue():null;if(this._isVisible()&&!this._priceScale.isEmpty()&&null!==n){var o=this._priceProvider(this._priceScale);null!==o&&(i.background=this._bgColor(),i.color=this.generateTextColor(i.background),i.coordinate=this._priceScale.priceToCoordinate(o,n),e.text=this._priceScale.formatPrice(o,n),e.visible=!0,t.visible=!0,t.hitTestData=this._hitTestData)}},t}(l.a),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(t,e),t.prototype._isVisible=function(){return this._source.visible&&null!==this._source.pane},t.prototype._bgColor=function(){return"#4c525e"},t}(c),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.__extends)(t,e),t.prototype._isVisible=function(){return null!==this._source.measurePane()},t.prototype._bgColor=function(){return this._source.model().isDark()?"#1E88E5":"#2196F3"},t}(c),d=i("mMWL"),p=i("qFKp"),f=i("Tmoa"),_=i("8Uy/"),m=i("jFln"),y=i("VdBB"),g=i("gAom"),v=function(){function e(e){this._data=e}return e.prototype.hitTest=function(e){return void 0===this._data.mouseClickHandler?null:new y.HitTestResult(y.HitTestResult.CUSTOM,{mouseClickHandler:this._data.mouseClickHandler})},e.prototype.draw=function(e,t){var i=t.pixelRatio,r=this._data.vertLinesVisible,n=this._data.horzLinesVisible;if(r||n){e.save(),e.lineWidth=Math.max(1,Math.floor(this._data.lineWidth*i)),e.strokeStyle=this._data.color,e.fillStyle=this._data.color,e.lineCap="butt",Object(m.setLineStyle)(e,this._data.lineStyle);var o=Math.round(this._data.x*i),s=Math.round(this._data.y*i),a=Math.ceil(this._data.w*i),l=Math.ceil(this._data.h*i);r&&o>=0&&Object(g.drawVerticalLine)(e,o,0,l),n&&s>=0&&Object(g.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 -}(),S=i("CW80"),b=function(){function e(e,t,i){this._rendererData={},this._renderer=new v(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,r=Object(d.lockTimeAxis)().value(),n=this._rendererData;if(!i||null===this._pane)return null;n.horzLinesVisible=i&&this._horzVisible,n.vertLinesVisible=i||r;var o,s=this._source.model(),a=this._source.properties(),l=this._source.selectBarMode().value()&&this._source.isOnHoveredChartWidget(),c=p.CheckMobile.any()&&Object(S.isLineToolName)(s.currentTool())&&!l;o=c?s.isDark()?"#1E88E5":"#2196F3":a.childs().color.value();var u=a.childs().transparency.value();return!c&&u>0&&(o=Object(f.generateColor)(o,u)),n.color=o,n.lineWidth=a.childs().width.value(),n.lineStyle=a.childs().style.value(),n.drawCenter=c&&this._pane===this._source.pane,n.w=this._pane.width(),n.h=this._pane.height(),n.x=void 0!==this._source.lockedX&&isFinite(this._source.lockedX)&&this._source.lockedX||this._source.x,n.y=this._source.y,l&&(n.vertLinesVisible=!0,n.lineStyle=_.LINESTYLE_SOLID,n.lineWidth=2,n.color="#ff0000"),this._renderer},e}(),w=i("IjC5"),P=function(){function e(e){this._renderer=new w.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(),r={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]};return this._renderer.setData(r),this._renderer},e}(),C=i("aO4+"),x=i("Ialn"),T=i("GH0z"),L=i("5C6T"),I=i("nda6"),M=i("pJOz"),O=i("qgcf"),A=i("Zy3/"),k=i("a7Ha"),E=i("zDbI"),D=window.t("{0} bars"),V=new I.TimeSpanFormatter,B=function(){function e(e,t){this._pipFormatter=null,this._lastSymbolInfo=null,this._horzTrenRenderer=new M.TrendLineRenderer,this._vertTrenRenderer=new M.TrendLineRenderer,this._bgRenderer=new w.RectangleRenderer,this._labelRenderer=new O.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 r=Object(n.ensureNotNull)(this._source.measurePane()),o=t.price,s=i.price,a=i.price-o,l=i.index-t.index,c=Object(x.forceLTRStr)(""+l),u=Object(n.ensureNotNull)(r.mainDataSource()),h=Object(n.ensureNotNull)(u.formatter()).format(a);if(Math.abs(o)>1e-8){var d=a/Math.abs(o);h+=" ("+(new T.PercentageFormatter).format(100*d)+")"}var p=Object(x.forceLTRStr)(h);this._label=p+"\n"+D.format(c) -;var f=Object(n.ensureNotNull)(u.firstValue()),m=this._source.model().timeScale().indexToCoordinate(t.index),y=this._source.model().timeScale().indexToCoordinate(i.index),g=r.defaultPriceScale().priceToCoordinate(o,f),v=r.defaultPriceScale().priceToCoordinate(s,f);this._p1=new C.Point(m,g),this._p2=new C.Point(y,v);var S=this._source.model().timeScale().indexToUserTime(t.index),b=this._source.model().timeScale().indexToUserTime(i.index),w=null;if(null!==S&&null!==b){var P=this._pane.model().mainSeries().symbolInfo();null!==P&&P!==this._lastSymbolInfo&&(this._pipFormatter=new L.PipFormatter(P.pricescale,P.minmov,P.type,P.minmove2),this._lastSymbolInfo=P),w=(b.valueOf()-S.valueOf())/1e3}var I=this._pipFormatter?this._pipFormatter.format(a):null,M=null!==I?" , "+I:"",A=null!==w?V.format(w):null,B=null!==A?", "+Object(x.startWithLTR)(A):"";this._label=Object(x.forceLTRStr)(p+M)+"\n"+D.format(c)+B;var R=s=50?k.LineEnd.Arrow:k.LineEnd.Normal};this._horzTrenRenderer.setData(H);var U,Y,G=Math.round(W.x);H={points:[U=new C.Point(G,this._p1.y),Y=new C.Point(G,this._p2.y)],color:N,linewidth:1,linestyle:_.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:k.LineEnd.Normal,rightend:Math.abs(U.y-Y.y)>=50?k.LineEnd.Arrow:k.LineEnd.Normal};this._vertTrenRenderer.setData(H);var q,K={x:0,y:10},Z=.5*(this._p1.x+this._p2.x),J=this._p2.y,X=new C.Point(Z,J),Q=(q=Object(n.ensureNotNull)(this._label),{points:[X],text:q,color:"#FFFFFF",horzAlign:"center",vertAlign:"middle",font:E.CHART_FONT_FAMILY,offsetX:K.x,offsetY:K.y,bold:!1,italic:!1,fontsize:12,padding:8,highlightBorder:!1,backgroundColor:F,backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4});this._labelRenderer.setData(Q);var $=this._labelRenderer.measure(),ee=Object(O.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 A.CompositeRenderer;return e.append(this._bgRenderer),e.append(this._horzTrenRenderer),e.append(this._vertTrenRenderer),e.append(this._labelRenderer),e},e}(),R=function(e){function t(t){var i=e.call(this)||this;return i._data=t,i}return Object(r.__extends)(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(), +}(),b=i("CW80"),S=function(){function e(e,t,i){this._rendererData={},this._renderer=new v(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,r=Object(d.lockTimeAxis)().value(),n=this._rendererData;if(!i||null===this._pane)return null;n.horzLinesVisible=i&&this._horzVisible,n.vertLinesVisible=i||r;var o,s=this._source.model(),a=this._source.properties(),l=this._source.selectBarMode().value()&&this._source.isOnHoveredChartWidget(),c=p.CheckMobile.any()&&Object(b.isLineToolName)(s.currentTool())&&!l;o=c?s.isDark()?"#1E88E5":"#2196F3":a.childs().color.value();var u=a.childs().transparency.value();return!c&&u>0&&(o=Object(f.generateColor)(o,u)),n.color=o,n.lineWidth=a.childs().width.value(),n.lineStyle=a.childs().style.value(),n.drawCenter=c&&this._pane===this._source.pane,n.w=this._pane.width(),n.h=this._pane.height(),n.x=void 0!==this._source.lockedX&&isFinite(this._source.lockedX)&&this._source.lockedX||this._source.x,n.y=this._source.y,l&&(n.vertLinesVisible=!0,n.lineStyle=_.LINESTYLE_SOLID,n.lineWidth=2,n.color="#ff0000"),this._renderer},e}(),w=i("IjC5"),P=function(){function e(e){this._renderer=new w.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(),r={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]};return this._renderer.setData(r),this._renderer},e}(),C=i("aO4+"),x=i("Ialn"),T=i("GH0z"),L=i("5C6T"),I=i("nda6"),M=i("pJOz"),O=i("qgcf"),A=i("Zy3/"),k=i("a7Ha"),E=i("zDbI"),D=window.t("{0} bars"),V=new I.TimeSpanFormatter,B=function(){function e(e,t){this._pipFormatter=null,this._lastSymbolInfo=null,this._horzTrenRenderer=new M.TrendLineRenderer,this._vertTrenRenderer=new M.TrendLineRenderer,this._bgRenderer=new w.RectangleRenderer,this._labelRenderer=new O.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 r=Object(n.ensureNotNull)(this._source.measurePane()),o=t.price,s=i.price,a=i.price-o,l=i.index-t.index,c=Object(x.forceLTRStr)(""+l),u=Object(n.ensureNotNull)(r.mainDataSource()),h=Object(n.ensureNotNull)(u.formatter()).format(a);if(Math.abs(o)>1e-8){var d=a/Math.abs(o);h+=" ("+(new T.PercentageFormatter).format(100*d)+")"}var p=Object(x.forceLTRStr)(h);this._label=p+"\n"+D.format(c) +;var f=Object(n.ensureNotNull)(u.firstValue()),m=this._source.model().timeScale().indexToCoordinate(t.index),y=this._source.model().timeScale().indexToCoordinate(i.index),g=r.defaultPriceScale().priceToCoordinate(o,f),v=r.defaultPriceScale().priceToCoordinate(s,f);this._p1=new C.Point(m,g),this._p2=new C.Point(y,v);var b=this._source.model().timeScale().indexToUserTime(t.index),S=this._source.model().timeScale().indexToUserTime(i.index),w=null;if(null!==b&&null!==S){var P=this._pane.model().mainSeries().symbolInfo();null!==P&&P!==this._lastSymbolInfo&&(this._pipFormatter=new L.PipFormatter(P.pricescale,P.minmov,P.type,P.minmove2),this._lastSymbolInfo=P),w=(S.valueOf()-b.valueOf())/1e3}var I=this._pipFormatter?this._pipFormatter.format(a):null,M=null!==I?" , "+I:"",A=null!==w?V.format(w):null,B=null!==A?", "+Object(x.startWithLTR)(A):"";this._label=Object(x.forceLTRStr)(p+M)+"\n"+D.format(c)+B;var R=s=50?k.LineEnd.Arrow:k.LineEnd.Normal};this._horzTrenRenderer.setData(H);var U,Y,G=Math.round(W.x);H={points:[U=new C.Point(G,this._p1.y),Y=new C.Point(G,this._p2.y)],color:N,linewidth:1,linestyle:_.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:k.LineEnd.Normal,rightend:Math.abs(U.y-Y.y)>=50?k.LineEnd.Arrow:k.LineEnd.Normal};this._vertTrenRenderer.setData(H);var q,K={x:0,y:10},Z=.5*(this._p1.x+this._p2.x),J=this._p2.y,X=new C.Point(Z,J),Q=(q=Object(n.ensureNotNull)(this._label),{points:[X],text:q,color:"#FFFFFF",horzAlign:"center",vertAlign:"middle",font:E.CHART_FONT_FAMILY,offsetX:K.x,offsetY:K.y,bold:!1,italic:!1,fontsize:12,padding:8,highlightBorder:!1,backgroundColor:F,backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4});this._labelRenderer.setData(Q);var $=this._labelRenderer.measure(),ee=Object(O.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 A.CompositeRenderer;return e.append(this._bgRenderer),e.append(this._horzTrenRenderer),e.append(this._vertTrenRenderer),e.append(this._labelRenderer),e},e}(),R=function(e){function t(t){var i=e.call(this)||this;return i._data=t,i}return Object(r.__extends)(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),N=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,r=Object(d.lockTimeAxis)().value(),o=i&&this._horzVisible,s=i||r;if("y"===this._axis&&!o||!s)return null;var a="y"===this._axis?this._pane.width()-4.5:Object(n.ensureDefined)(this._source.lockedX)+1,l="y"===this._axis?this._source.y:this._pane.height()-5.5-1;return new R({x:a,y:l,width:9,height:11,bodyHeight:7})},e}();i.d(t,"CrosshairBase",(function(){return j}));var F={menuEnabled:!1,menuForMainSourceOnly:!1,disableTradingMenuActions:!1},j=function(e){function t(t,i){var r=e.call(this)||this;r._measurePane=null,r._startMeasurePoint=null,r._endMeasurePoint=null,r._lastValidMeasurePoint=null,r._isOnHoveredChartWidget=!1,r._selectBarMode=new a.a(!1),r._selectionPane=null,r._selectionView=new P(r),r._selectionStartPoint=null,r._measurePaneView=null,r._timeLockPaneView=null,r._priceAxisViews=new Map,r._panePriceAxisViews=new Map,r._startMeasurePriceAxisViews=new Map,r._endMeasurePriceAxisViews=new Map,r._model=t,r._options=Object.assign({},F,i||{}),r._linesShouldBeHidden=r._model.readOnly();var o=function(e){return function(t){return t===Object(n.ensureNotNull)(r._measurePane).defaultPriceScale()?e():null}};return r._currentPosPriceProvider=function(e){var t=Object(n.ensureNotNull)(r.pane);if(e===t.defaultPriceScale())return r.price;var i=Object(n.ensureNotNull)(t.defaultPriceScale().mainSource()).firstValue();if(null===i)return null;var o=t.defaultPriceScale().priceToCoordinate(r.price,i),s=Object(n.ensureNotNull)(e.mainSource()).firstValue();return null===s?null:e.coordinateToPrice(o,s)},r._startMeasurePriceProvider=o((function(){return Object(n.ensureNotNull)(r._startMeasurePoint).price})),r._endMeasurePriceProvider=o((function(){return Object(n.ensureNotNull)(r._lastMeasurePoint()).price})),r}return Object(r.__extends)(t,e),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},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.measurePoints=function(){this.updateAllViews();var e=[Object(n.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.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,u,!0)),this._startMeasurePoint&&i.push(this._createPriceAxisViewOnDemand(this._startMeasurePriceAxisViews,null,e,t,this._startMeasurePriceProvider,h)),this._lastMeasurePoint()&&i.push(this._createPriceAxisViewOnDemand(this._endMeasurePriceAxisViews,null,e,t,this._endMeasurePriceProvider,h)),i},t.prototype.timeAxisViews=function(){var e=[];return this._linesShouldBeHidden||!this.visible&&!Object(d.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,r=[new b(this,e,i)];return e===this._selectionPane&&r.push(this._selectionView),e===this._measurePane&&(null===this._measurePaneView&&(this._measurePaneView=new B(this,e)),this._measurePaneView.update(),r.push(this._measurePaneView)),Object(d.lockTimeAxis)().value()&&(null===this._timeLockPaneView&&(this._timeLockPaneView=new N(this,e)),r.push(this._timeLockPaneView)),r},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._lastMeasurePoint=function(){ +t.prototype.measurePane=function(){return this._measurePane||null},t.prototype.startMeasuring=function(e,t){this._startMeasurePoint=e,this._measurePane=t},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.measurePoints=function(){this.updateAllViews();var e=[Object(n.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.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,u,!0)),this._startMeasurePoint&&i.push(this._createPriceAxisViewOnDemand(this._startMeasurePriceAxisViews,null,e,t,this._startMeasurePriceProvider,h)),this._lastMeasurePoint()&&i.push(this._createPriceAxisViewOnDemand(this._endMeasurePriceAxisViews,null,e,t,this._endMeasurePriceProvider,h)),i},t.prototype.timeAxisViews=function(){var e=[];return this._linesShouldBeHidden||!this.visible&&!Object(d.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,r=[new S(this,e,i)];return e===this._selectionPane&&r.push(this._selectionView),e===this._measurePane&&(null===this._measurePaneView&&(this._measurePaneView=new B(this,e)),this._measurePaneView.update(),r.push(this._measurePaneView)),Object(d.lockTimeAxis)().value()&&(null===this._timeLockPaneView&&(this._timeLockPaneView=new N(this,e)),r.push(this._timeLockPaneView)),r},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._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,r,n,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),s&&i.onDestroyed().subscribe(this,(function(){return a._onPaneDestroyed(i)})));var u=l.get(r);if(void 0===u){if(u=new o(this,r,n),l.set(r,u),void 0!==c){var h=new CrosshairMenuView(u,this,r,this._model,{menuForMainSourceOnly:this._options.menuForMainSourceOnly});c.set(r,h)}s&&r.lastSourceRemoved().subscribe(this,(function(){return a._onPriceScaleCleared(r)}))}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}(o.DataSource)},zZ5f:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("hayr").propertyPages,s=window.t("Fib Speed Resistance Fan");function a(e,t){this._constructor="LineToolFibSpeedResistanceFan";var n=t||a.createProperties();r.call(this,e,n),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(a,r),a.HLevelsCount=7,a.VLevelsCount=7,a.prototype.hLevelsCount=function(){return a.HLevelsCount},a.prototype.vLevelsCount=function(){return a.VLevelsCount},a.prototype.pointsCount=function(){return 2},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Fib Speed Resistance Fan"},a.prototype.processErase=function(e,t){var i="h"===t.type?"hlevel"+t.index:"vlevel"+t.index,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},a.prototype.getStylesPropertyPage=function(){return o.LineToolFibSpeedResistanceFanStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("2PB4").FibSpeedResistanceFanDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){void 0!==e&&void 0===e.reverse&&(e.reverse=!0);var t=new n("linetoolfibspeedresistancefan",e,!1,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]});return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolFibSpeedResistanceFan=a},ziJ5:function(e,t,i){"use strict";(function(e){ var r=i("QIuV"),n=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),this._constructor="LineToolPosition";var n=t||d.createProperties();r.call(this,e,n),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(){ diff --git a/charting_library/charting_library.js b/charting_library/charting_library.js index 934b5686..dc5db0c8 100644 --- a/charting_library/charting_library.js +++ b/charting_library/charting_library.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.TradingView={})}(this,(function(t){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,o=arguments,n=1,i=arguments.length;n'},t}();window.TradingView=window.TradingView||{},window.TradingView.version=r,t.version=r,t.widget=s,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.TradingView={})}(this,(function(t){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,o=arguments,n=1,i=arguments.length;n'},t}();window.TradingView=window.TradingView||{},window.TradingView.version=r,t.version=r,t.widget=s,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/charting_library/cs-tv-chart.5a9a8b4e.html b/charting_library/cs-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/cs-tv-chart.5a9a8b4e.html rename to charting_library/cs-tv-chart.9f0bfab4.html index f3047fcb..4e0737ce 100644 --- a/charting_library/cs-tv-chart.5a9a8b4e.html +++ b/charting_library/cs-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/da_DK-tv-chart.5a9a8b4e.html b/charting_library/da_DK-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/da_DK-tv-chart.5a9a8b4e.html rename to charting_library/da_DK-tv-chart.9f0bfab4.html index f09b4f01..06ae3354 100644 --- a/charting_library/da_DK-tv-chart.5a9a8b4e.html +++ b/charting_library/da_DK-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/de-tv-chart.5a9a8b4e.html b/charting_library/de-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/de-tv-chart.5a9a8b4e.html rename to charting_library/de-tv-chart.9f0bfab4.html index 55b6659f..9a7d9cf0 100644 --- a/charting_library/de-tv-chart.5a9a8b4e.html +++ b/charting_library/de-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/el-tv-chart.5a9a8b4e.html b/charting_library/el-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/el-tv-chart.5a9a8b4e.html rename to charting_library/el-tv-chart.9f0bfab4.html index 3fd65af8..eeb72d0f 100644 --- a/charting_library/el-tv-chart.5a9a8b4e.html +++ b/charting_library/el-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/en-tv-chart.5a9a8b4e.html b/charting_library/en-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/en-tv-chart.5a9a8b4e.html rename to charting_library/en-tv-chart.9f0bfab4.html index 2bbb9511..8377eb1f 100644 --- a/charting_library/en-tv-chart.5a9a8b4e.html +++ b/charting_library/en-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/es-tv-chart.5a9a8b4e.html b/charting_library/es-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/es-tv-chart.5a9a8b4e.html rename to charting_library/es-tv-chart.9f0bfab4.html index 4f13e3d0..7ff14d2a 100644 --- a/charting_library/es-tv-chart.5a9a8b4e.html +++ b/charting_library/es-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/et_EE-tv-chart.5a9a8b4e.html b/charting_library/et_EE-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/et_EE-tv-chart.5a9a8b4e.html rename to charting_library/et_EE-tv-chart.9f0bfab4.html index 581642b0..e29edbd0 100644 --- a/charting_library/et_EE-tv-chart.5a9a8b4e.html +++ b/charting_library/et_EE-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/fa-tv-chart.5a9a8b4e.html b/charting_library/fa-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/fa-tv-chart.5a9a8b4e.html rename to charting_library/fa-tv-chart.9f0bfab4.html index 29ac051c..f8d75298 100644 --- a/charting_library/fa-tv-chart.5a9a8b4e.html +++ b/charting_library/fa-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/fr-tv-chart.5a9a8b4e.html b/charting_library/fr-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/fr-tv-chart.5a9a8b4e.html rename to charting_library/fr-tv-chart.9f0bfab4.html index b0d9c266..c2dacc6e 100644 --- a/charting_library/fr-tv-chart.5a9a8b4e.html +++ b/charting_library/fr-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/he_IL-tv-chart.5a9a8b4e.html b/charting_library/he_IL-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/he_IL-tv-chart.5a9a8b4e.html rename to charting_library/he_IL-tv-chart.9f0bfab4.html index ed78f48d..a59f7763 100644 --- a/charting_library/he_IL-tv-chart.5a9a8b4e.html +++ b/charting_library/he_IL-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/hu_HU-tv-chart.5a9a8b4e.html b/charting_library/hu_HU-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/hu_HU-tv-chart.5a9a8b4e.html rename to charting_library/hu_HU-tv-chart.9f0bfab4.html index 3a1b3eb2..edb56aff 100644 --- a/charting_library/hu_HU-tv-chart.5a9a8b4e.html +++ b/charting_library/hu_HU-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/id_ID-tv-chart.5a9a8b4e.html b/charting_library/id_ID-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/id_ID-tv-chart.5a9a8b4e.html rename to charting_library/id_ID-tv-chart.9f0bfab4.html index 97351fe0..eb8d6673 100644 --- a/charting_library/id_ID-tv-chart.5a9a8b4e.html +++ b/charting_library/id_ID-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/it-tv-chart.5a9a8b4e.html b/charting_library/it-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/it-tv-chart.5a9a8b4e.html rename to charting_library/it-tv-chart.9f0bfab4.html index 3e10fea8..1bcb2c16 100644 --- a/charting_library/it-tv-chart.5a9a8b4e.html +++ b/charting_library/it-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/ja-tv-chart.5a9a8b4e.html b/charting_library/ja-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/ja-tv-chart.5a9a8b4e.html rename to charting_library/ja-tv-chart.9f0bfab4.html index fd297d27..9f30b402 100644 --- a/charting_library/ja-tv-chart.5a9a8b4e.html +++ b/charting_library/ja-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/ko-tv-chart.5a9a8b4e.html b/charting_library/ko-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/ko-tv-chart.5a9a8b4e.html rename to charting_library/ko-tv-chart.9f0bfab4.html index 5ab32e8d..d04b41cb 100644 --- a/charting_library/ko-tv-chart.5a9a8b4e.html +++ b/charting_library/ko-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/ms_MY-tv-chart.5a9a8b4e.html b/charting_library/ms_MY-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/ms_MY-tv-chart.5a9a8b4e.html rename to charting_library/ms_MY-tv-chart.9f0bfab4.html index bcef5b4c..211497d3 100644 --- a/charting_library/ms_MY-tv-chart.5a9a8b4e.html +++ b/charting_library/ms_MY-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/nl_NL-tv-chart.5a9a8b4e.html b/charting_library/nl_NL-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/nl_NL-tv-chart.5a9a8b4e.html rename to charting_library/nl_NL-tv-chart.9f0bfab4.html index 47136b5c..bf50db16 100644 --- a/charting_library/nl_NL-tv-chart.5a9a8b4e.html +++ b/charting_library/nl_NL-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/no-tv-chart.5a9a8b4e.html b/charting_library/no-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/no-tv-chart.5a9a8b4e.html rename to charting_library/no-tv-chart.9f0bfab4.html index e91bcdac..05904bd3 100644 --- a/charting_library/no-tv-chart.5a9a8b4e.html +++ b/charting_library/no-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/pl-tv-chart.5a9a8b4e.html b/charting_library/pl-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/pl-tv-chart.5a9a8b4e.html rename to charting_library/pl-tv-chart.9f0bfab4.html index 5497d8cc..298bd560 100644 --- a/charting_library/pl-tv-chart.5a9a8b4e.html +++ b/charting_library/pl-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/pt-tv-chart.5a9a8b4e.html b/charting_library/pt-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/pt-tv-chart.5a9a8b4e.html rename to charting_library/pt-tv-chart.9f0bfab4.html index 52a274c3..291aff66 100644 --- a/charting_library/pt-tv-chart.5a9a8b4e.html +++ b/charting_library/pt-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/ro-tv-chart.5a9a8b4e.html b/charting_library/ro-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/ro-tv-chart.5a9a8b4e.html rename to charting_library/ro-tv-chart.9f0bfab4.html index 148ec434..fbd43d42 100644 --- a/charting_library/ro-tv-chart.5a9a8b4e.html +++ b/charting_library/ro-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/ru-tv-chart.5a9a8b4e.html b/charting_library/ru-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/ru-tv-chart.5a9a8b4e.html rename to charting_library/ru-tv-chart.9f0bfab4.html index 54cb827f..4c963e0a 100644 --- a/charting_library/ru-tv-chart.5a9a8b4e.html +++ b/charting_library/ru-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/sk_SK-tv-chart.5a9a8b4e.html b/charting_library/sk_SK-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/sk_SK-tv-chart.5a9a8b4e.html rename to charting_library/sk_SK-tv-chart.9f0bfab4.html index 3d0a6f90..5dadca63 100644 --- a/charting_library/sk_SK-tv-chart.5a9a8b4e.html +++ b/charting_library/sk_SK-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/sv-tv-chart.5a9a8b4e.html b/charting_library/sv-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/sv-tv-chart.5a9a8b4e.html rename to charting_library/sv-tv-chart.9f0bfab4.html index 41061367..a478685c 100644 --- a/charting_library/sv-tv-chart.5a9a8b4e.html +++ b/charting_library/sv-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/th-tv-chart.5a9a8b4e.html b/charting_library/th-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/th-tv-chart.5a9a8b4e.html rename to charting_library/th-tv-chart.9f0bfab4.html index bdd1d125..b11d6dc6 100644 --- a/charting_library/th-tv-chart.5a9a8b4e.html +++ b/charting_library/th-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/tr-tv-chart.5a9a8b4e.html b/charting_library/tr-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/tr-tv-chart.5a9a8b4e.html rename to charting_library/tr-tv-chart.9f0bfab4.html index 86427609..35a5b77a 100644 --- a/charting_library/tr-tv-chart.5a9a8b4e.html +++ b/charting_library/tr-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/vi-tv-chart.5a9a8b4e.html b/charting_library/vi-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/vi-tv-chart.5a9a8b4e.html rename to charting_library/vi-tv-chart.9f0bfab4.html index 4b6a6d91..e70bff05 100644 --- a/charting_library/vi-tv-chart.5a9a8b4e.html +++ b/charting_library/vi-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/zh-tv-chart.5a9a8b4e.html b/charting_library/zh-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/zh-tv-chart.5a9a8b4e.html rename to charting_library/zh-tv-chart.9f0bfab4.html index 522ffbc6..c65caf79 100644 --- a/charting_library/zh-tv-chart.5a9a8b4e.html +++ b/charting_library/zh-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/zh_TW-tv-chart.5a9a8b4e.html b/charting_library/zh_TW-tv-chart.9f0bfab4.html similarity index 99% rename from charting_library/zh_TW-tv-chart.5a9a8b4e.html rename to charting_library/zh_TW-tv-chart.9f0bfab4.html index 818a3cfe..eef7323d 100644 --- a/charting_library/zh_TW-tv-chart.5a9a8b4e.html +++ b/charting_library/zh_TW-tv-chart.9f0bfab4.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file